path
stringlengths
5
300
repo_name
stringlengths
6
76
content
stringlengths
26
1.05M
ajax/libs/react-data-grid/0.14.11/react-data-grid-with-addons.js
seogi1004/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("react"), require("react-dom")); else if(typeof define === 'function' && define.amd) define(["react", "react-dom"], factory); else if(typeof exports === 'object') exports["ReactDataGrid"] = factory(require("react"), require("react-dom")); else root["ReactDataGrid"] = factory(root["React"], root["ReactDOM"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) { return /******/ (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'; module.exports = __webpack_require__(1); module.exports.Editors = __webpack_require__(40); module.exports.Formatters = __webpack_require__(44); module.exports.Toolbar = __webpack_require__(46); module.exports.Row = __webpack_require__(24); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var BaseGrid = __webpack_require__(4); var Row = __webpack_require__(24); var ExcelColumn = __webpack_require__(15); var KeyboardHandlerMixin = __webpack_require__(27); var CheckboxEditor = __webpack_require__(36); var DOMMetrics = __webpack_require__(34); var ColumnMetricsMixin = __webpack_require__(37); var RowUtils = __webpack_require__(39); var ColumnUtils = __webpack_require__(10); if (!Object.assign) { Object.assign = __webpack_require__(38); } var ReactDataGrid = React.createClass({ displayName: 'ReactDataGrid', mixins: [ColumnMetricsMixin, DOMMetrics.MetricsComputatorMixin, KeyboardHandlerMixin], propTypes: { rowHeight: React.PropTypes.number.isRequired, headerRowHeight: React.PropTypes.number, minHeight: React.PropTypes.number.isRequired, minWidth: React.PropTypes.number, enableRowSelect: React.PropTypes.bool, onRowUpdated: React.PropTypes.func, rowGetter: React.PropTypes.func.isRequired, rowsCount: React.PropTypes.number.isRequired, toolbar: React.PropTypes.element, enableCellSelect: React.PropTypes.bool, columns: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.array]).isRequired, onFilter: React.PropTypes.func, onCellCopyPaste: React.PropTypes.func, onCellsDragged: React.PropTypes.func, onAddFilter: React.PropTypes.func, onGridSort: React.PropTypes.func, onDragHandleDoubleClick: React.PropTypes.func, onGridRowsUpdated: React.PropTypes.func, onRowSelect: React.PropTypes.func, rowKey: React.PropTypes.string, rowScrollTimeout: React.PropTypes.number }, getDefaultProps: function getDefaultProps() { return { enableCellSelect: false, tabIndex: -1, rowHeight: 35, enableRowSelect: false, minHeight: 350, rowKey: 'id', rowScrollTimeout: 0 }; }, getInitialState: function getInitialState() { var columnMetrics = this.createColumnMetrics(); var initialState = { columnMetrics: columnMetrics, selectedRows: [], copied: null, expandedRows: [], canFilter: false, columnFilters: {}, sortDirection: null, sortColumn: null, dragged: null, scrollOffset: 0 }; if (this.props.enableCellSelect) { initialState.selected = { rowIdx: 0, idx: 0 }; } else { initialState.selected = { rowIdx: -1, idx: -1 }; } return initialState; }, onSelect: function onSelect(selected) { if (this.props.enableCellSelect) { if (this.state.selected.rowIdx !== selected.rowIdx || this.state.selected.idx !== selected.idx || this.state.selected.active === false) { var _idx = selected.idx; var _rowIdx = selected.rowIdx; if (_idx >= 0 && _rowIdx >= 0 && _idx < ColumnUtils.getSize(this.state.columnMetrics.columns) && _rowIdx < this.props.rowsCount) { this.setState({ selected: selected }); } } } }, onCellClick: function onCellClick(cell) { this.onSelect({ rowIdx: cell.rowIdx, idx: cell.idx }); }, onCellDoubleClick: function onCellDoubleClick(cell) { this.onSelect({ rowIdx: cell.rowIdx, idx: cell.idx }); this.setActive('Enter'); }, onViewportDoubleClick: function onViewportDoubleClick() { this.setActive(); }, onPressArrowUp: function onPressArrowUp(e) { this.moveSelectedCell(e, -1, 0); }, onPressArrowDown: function onPressArrowDown(e) { this.moveSelectedCell(e, 1, 0); }, onPressArrowLeft: function onPressArrowLeft(e) { this.moveSelectedCell(e, 0, -1); }, onPressArrowRight: function onPressArrowRight(e) { this.moveSelectedCell(e, 0, 1); }, onPressTab: function onPressTab(e) { this.moveSelectedCell(e, 0, e.shiftKey ? -1 : 1); }, onPressEnter: function onPressEnter(e) { this.setActive(e.key); }, onPressDelete: function onPressDelete(e) { this.setActive(e.key); }, onPressEscape: function onPressEscape(e) { this.setInactive(e.key); }, onPressBackspace: function onPressBackspace(e) { this.setActive(e.key); }, onPressChar: function onPressChar(e) { if (this.isKeyPrintable(e.keyCode)) { this.setActive(e.keyCode); } }, onPressKeyWithCtrl: function onPressKeyWithCtrl(e) { var keys = { KeyCode_c: 99, KeyCode_C: 67, KeyCode_V: 86, KeyCode_v: 118 }; var idx = this.state.selected.idx; if (this.canEdit(idx)) { if (e.keyCode === keys.KeyCode_c || e.keyCode === keys.KeyCode_C) { var _value = this.getSelectedValue(); this.handleCopy({ value: _value }); } else if (e.keyCode === keys.KeyCode_v || e.keyCode === keys.KeyCode_V) { this.handlePaste(); } } }, onCellCommit: function onCellCommit(commit) { var selected = Object.assign({}, this.state.selected); selected.active = false; if (commit.key === 'Tab') { selected.idx += 1; } var expandedRows = this.state.expandedRows; // if(commit.changed && commit.changed.expandedHeight){ // expandedRows = this.expandRow(commit.rowIdx, commit.changed.expandedHeight); // } this.setState({ selected: selected, expandedRows: expandedRows }); if (this.props.onRowUpdated) { this.props.onRowUpdated(commit); } var targetRow = commit.rowIdx; if (this.props.onGridRowsUpdated) { this.props.onGridRowsUpdated({ cellKey: commit.cellKey, fromRow: targetRow, toRow: targetRow, updated: commit.updated, action: 'cellUpdate' }); } }, onDragStart: function onDragStart(e) { var value = this.getSelectedValue(); this.handleDragStart({ idx: this.state.selected.idx, rowIdx: this.state.selected.rowIdx, value: value }); // need to set dummy data for FF if (e && e.dataTransfer) { if (e.dataTransfer.setData) { e.dataTransfer.dropEffect = 'move'; e.dataTransfer.effectAllowed = 'move'; e.dataTransfer.setData('text/plain', 'dummy'); } } }, onToggleFilter: function onToggleFilter() { this.setState({ canFilter: !this.state.canFilter }); }, onDragHandleDoubleClick: function onDragHandleDoubleClick(e) { if (this.props.onDragHandleDoubleClick) { this.props.onDragHandleDoubleClick(e); } if (this.props.onGridRowsUpdated) { var cellKey = this.getColumn(e.idx).key; var updated = _defineProperty({}, cellKey, e.rowData[cellKey]); this.props.onGridRowsUpdated({ cellKey: cellKey, fromRow: e.rowIdx, toRow: this.props.rowsCount - 1, updated: updated, action: 'columnFill' }); } }, handleDragStart: function handleDragStart(dragged) { if (!this.dragEnabled()) { return; } var idx = dragged.idx; var rowIdx = dragged.rowIdx; if (idx >= 0 && rowIdx >= 0 && idx < this.getSize() && rowIdx < this.props.rowsCount) { this.setState({ dragged: dragged }); } }, handleDragEnd: function handleDragEnd() { if (!this.dragEnabled()) { return; } var fromRow = undefined; var toRow = undefined; var selected = this.state.selected; var dragged = this.state.dragged; var cellKey = this.getColumn(this.state.selected.idx).key; fromRow = selected.rowIdx < dragged.overRowIdx ? selected.rowIdx : dragged.overRowIdx; toRow = selected.rowIdx > dragged.overRowIdx ? selected.rowIdx : dragged.overRowIdx; if (this.props.onCellsDragged) { this.props.onCellsDragged({ cellKey: cellKey, fromRow: fromRow, toRow: toRow, value: dragged.value }); } if (this.props.onGridRowsUpdated) { var updated = _defineProperty({}, cellKey, dragged.value); this.props.onGridRowsUpdated({ cellKey: cellKey, fromRow: fromRow, toRow: toRow, updated: updated, action: 'cellDrag' }); } this.setState({ dragged: { complete: true } }); }, handleDragEnter: function handleDragEnter(row) { if (!this.dragEnabled()) { return; } var dragged = this.state.dragged; dragged.overRowIdx = row; this.setState({ dragged: dragged }); }, handleTerminateDrag: function handleTerminateDrag() { if (!this.dragEnabled()) { return; } this.setState({ dragged: null }); }, handlePaste: function handlePaste() { if (!this.copyPasteEnabled()) { return; } var selected = this.state.selected; var cellKey = this.getColumn(this.state.selected.idx).key; var textToCopy = this.state.textToCopy; var toRow = selected.rowIdx; if (this.props.onCellCopyPaste) { this.props.onCellCopyPaste({ cellKey: cellKey, rowIdx: toRow, value: textToCopy, fromRow: this.state.copied.rowIdx, toRow: toRow }); } if (this.props.onGridRowsUpdated) { var updated = _defineProperty({}, cellKey, textToCopy); this.props.onGridRowsUpdated({ cellKey: cellKey, fromRow: toRow, toRow: toRow, updated: updated, action: 'copyPaste' }); } this.setState({ copied: null }); }, handleCopy: function handleCopy(args) { if (!this.copyPasteEnabled()) { return; } var textToCopy = args.value; var selected = this.state.selected; var copied = { idx: selected.idx, rowIdx: selected.rowIdx }; this.setState({ textToCopy: textToCopy, copied: copied }); }, handleSort: function handleSort(columnKey, direction) { this.setState({ sortDirection: direction, sortColumn: columnKey }, function () { this.props.onGridSort(columnKey, direction); }); }, getSelectedRow: function getSelectedRow(rows, key) { var _this = this; var selectedRow = rows.filter(function (r) { if (r[_this.props.rowKey] === key) { return true; } return false; }); if (selectedRow.length > 0) { return selectedRow[0]; } }, // columnKey not used here as this function will select the whole row, // but needed to match the function signature in the CheckboxEditor handleRowSelect: function handleRowSelect(rowIdx, columnKey, rowData, e) { e.stopPropagation(); var selectedRows = this.props.enableRowSelect === 'single' ? [] : this.state.selectedRows.slice(0); var selectedRow = this.getSelectedRow(selectedRows, rowData[this.props.rowKey]); if (selectedRow) { selectedRow.isSelected = !selectedRow.isSelected; } else { rowData.isSelected = true; selectedRows.push(rowData); } this.setState({ selectedRows: selectedRows, selected: { rowIdx: rowIdx, idx: 0 } }); if (this.props.onRowSelect) { this.props.onRowSelect(selectedRows.filter(function (r) { return r.isSelected === true; })); } }, handleCheckboxChange: function handleCheckboxChange(e) { var allRowsSelected = undefined; if (e.currentTarget instanceof HTMLInputElement && e.currentTarget.checked === true) { allRowsSelected = true; } else { allRowsSelected = false; } var selectedRows = []; for (var i = 0; i < this.props.rowsCount; i++) { var row = Object.assign({}, this.props.rowGetter(i), { isSelected: allRowsSelected }); selectedRows.push(row); } this.setState({ selectedRows: selectedRows }); if (typeof this.props.onRowSelect === 'function') { this.props.onRowSelect(selectedRows.filter(function (r) { return r.isSelected === true; })); } }, getScrollOffSet: function getScrollOffSet() { var scrollOffset = 0; var canvas = ReactDOM.findDOMNode(this).querySelector('.react-grid-Canvas'); if (canvas) { scrollOffset = canvas.offsetWidth - canvas.clientWidth; } this.setState({ scrollOffset: scrollOffset }); }, getRowOffsetHeight: function getRowOffsetHeight() { var offsetHeight = 0; this.getHeaderRows().forEach(function (row) { return offsetHeight += parseFloat(row.height, 10); }); return offsetHeight; }, getHeaderRows: function getHeaderRows() { var rows = [{ ref: 'row', height: this.props.headerRowHeight || this.props.rowHeight }]; if (this.state.canFilter === true) { rows.push({ ref: 'filterRow', filterable: true, onFilterChange: this.props.onAddFilter, height: 45 }); } return rows; }, getInitialSelectedRows: function getInitialSelectedRows() { var selectedRows = []; for (var i = 0; i < this.props.rowsCount; i++) { selectedRows.push(false); } return selectedRows; }, getSelectedValue: function getSelectedValue() { var rowIdx = this.state.selected.rowIdx; var idx = this.state.selected.idx; var cellKey = this.getColumn(idx).key; var row = this.props.rowGetter(rowIdx); return RowUtils.get(row, cellKey); }, moveSelectedCell: function moveSelectedCell(e, rowDelta, cellDelta) { // we need to prevent default as we control grid scroll // otherwise it moves every time you left/right which is janky e.preventDefault(); var rowIdx = this.state.selected.rowIdx + rowDelta; var idx = this.state.selected.idx + cellDelta; this.onSelect({ idx: idx, rowIdx: rowIdx }); }, setActive: function setActive(keyPressed) { var rowIdx = this.state.selected.rowIdx; var idx = this.state.selected.idx; if (this.canEdit(idx) && !this.isActive()) { var _selected = Object.assign(this.state.selected, { idx: idx, rowIdx: rowIdx, active: true, initialKeyCode: keyPressed }); this.setState({ selected: _selected }); } }, setInactive: function setInactive() { var rowIdx = this.state.selected.rowIdx; var idx = this.state.selected.idx; if (this.canEdit(idx) && this.isActive()) { var _selected2 = Object.assign(this.state.selected, { idx: idx, rowIdx: rowIdx, active: false }); this.setState({ selected: _selected2 }); } }, canEdit: function canEdit(idx) { var col = this.getColumn(idx); return this.props.enableCellSelect === true && (col.editor != null || col.editable); }, isActive: function isActive() { return this.state.selected.active === true; }, setupGridColumns: function setupGridColumns() { var props = arguments.length <= 0 || arguments[0] === undefined ? this.props : arguments[0]; var cols = props.columns.slice(0); var unshiftedCols = {}; if (props.enableRowSelect) { var headerRenderer = props.enableRowSelect === 'single' ? null : React.createElement('input', { type: 'checkbox', onChange: this.handleCheckboxChange }); var selectColumn = { key: 'select-row', name: '', formatter: React.createElement(CheckboxEditor, null), onCellChange: this.handleRowSelect, filterable: false, headerRenderer: headerRenderer, width: 60, locked: true, getRowMetaData: function getRowMetaData(rowData) { return rowData; } }; unshiftedCols = cols.unshift(selectColumn); cols = unshiftedCols > 0 ? cols : unshiftedCols; } return cols; }, copyPasteEnabled: function copyPasteEnabled() { return this.props.onCellCopyPaste !== null; }, dragEnabled: function dragEnabled() { return this.props.onCellsDragged !== null; }, renderToolbar: function renderToolbar() { var Toolbar = this.props.toolbar; if (React.isValidElement(Toolbar)) { return React.cloneElement(Toolbar, { onToggleFilter: this.onToggleFilter, numberOfRows: this.props.rowsCount }); } }, render: function render() { var cellMetaData = { selected: this.state.selected, dragged: this.state.dragged, onCellClick: this.onCellClick, onCellDoubleClick: this.onCellDoubleClick, onCommit: this.onCellCommit, onCommitCancel: this.setInactive, copied: this.state.copied, handleDragEnterRow: this.handleDragEnter, handleTerminateDrag: this.handleTerminateDrag, onDragHandleDoubleClick: this.onDragHandleDoubleClick }; var toolbar = this.renderToolbar(); var containerWidth = this.props.minWidth || this.DOMMetrics.gridWidth(); var gridWidth = containerWidth - this.state.scrollOffset; // depending on the current lifecycle stage, gridWidth() may not initialize correctly // this also handles cases where it always returns undefined -- such as when inside a div with display:none // eg Bootstrap tabs and collapses if (typeof containerWidth === 'undefined' || isNaN(containerWidth)) { containerWidth = '100%'; } if (typeof gridWidth === 'undefined' || isNaN(gridWidth)) { gridWidth = '100%'; } return React.createElement( 'div', { className: 'react-grid-Container', style: { width: containerWidth } }, toolbar, React.createElement( 'div', { className: 'react-grid-Main' }, React.createElement(BaseGrid, _extends({ ref: 'base' }, this.props, { rowKey: this.props.rowKey, headerRows: this.getHeaderRows(), columnMetrics: this.state.columnMetrics, rowGetter: this.props.rowGetter, rowsCount: this.props.rowsCount, rowHeight: this.props.rowHeight, cellMetaData: cellMetaData, selectedRows: this.state.selectedRows.filter(function (r) { return r.isSelected === true; }), expandedRows: this.state.expandedRows, rowOffsetHeight: this.getRowOffsetHeight(), sortColumn: this.state.sortColumn, sortDirection: this.state.sortDirection, onSort: this.handleSort, minHeight: this.props.minHeight, totalWidth: gridWidth, onViewportKeydown: this.onKeyDown, onViewportDragStart: this.onDragStart, onViewportDragEnd: this.handleDragEnd, onViewportDoubleClick: this.onViewportDoubleClick, onColumnResize: this.onColumnResize, rowScrollTimeout: this.props.rowScrollTimeout })) ) ); } }); module.exports = ReactDataGrid; /***/ }, /* 2 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }, /* 3 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_3__; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var PropTypes = React.PropTypes; var Header = __webpack_require__(5); var Viewport = __webpack_require__(21); var GridScrollMixin = __webpack_require__(35); var DOMMetrics = __webpack_require__(34); var cellMetaDataShape = __webpack_require__(31); var Grid = React.createClass({ displayName: 'Grid', propTypes: { rowGetter: PropTypes.oneOfType([PropTypes.array, PropTypes.func]).isRequired, columns: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), columnMetrics: PropTypes.object, minHeight: PropTypes.number, totalWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), headerRows: PropTypes.oneOfType([PropTypes.array, PropTypes.func]), rowHeight: PropTypes.number, rowRenderer: PropTypes.func, emptyRowsView: PropTypes.func, expandedRows: PropTypes.oneOfType([PropTypes.array, PropTypes.func]), selectedRows: PropTypes.oneOfType([PropTypes.array, PropTypes.func]), rowsCount: PropTypes.number, onRows: PropTypes.func, sortColumn: React.PropTypes.string, sortDirection: React.PropTypes.oneOf(['ASC', 'DESC', 'NONE']), rowOffsetHeight: PropTypes.number.isRequired, onViewportKeydown: PropTypes.func.isRequired, onViewportDragStart: PropTypes.func.isRequired, onViewportDragEnd: PropTypes.func.isRequired, onViewportDoubleClick: PropTypes.func.isRequired, onColumnResize: PropTypes.func, onSort: PropTypes.func, cellMetaData: PropTypes.shape(cellMetaDataShape), rowKey: PropTypes.string.isRequired, rowScrollTimeout: PropTypes.number }, mixins: [GridScrollMixin, DOMMetrics.MetricsComputatorMixin], getDefaultProps: function getDefaultProps() { return { rowHeight: 35, minHeight: 350 }; }, getStyle: function getStyle() { return { overflow: 'hidden', outline: 0, position: 'relative', minHeight: this.props.minHeight }; }, render: function render() { var headerRows = this.props.headerRows || [{ ref: 'row' }]; var EmptyRowsView = this.props.emptyRowsView; return React.createElement( 'div', _extends({}, this.props, { style: this.getStyle(), className: 'react-grid-Grid' }), React.createElement(Header, { ref: 'header', columnMetrics: this.props.columnMetrics, onColumnResize: this.props.onColumnResize, height: this.props.rowHeight, totalWidth: this.props.totalWidth, headerRows: headerRows, sortColumn: this.props.sortColumn, sortDirection: this.props.sortDirection, onSort: this.props.onSort }), this.props.rowsCount >= 1 || this.props.rowsCount === 0 && !this.props.emptyRowsView ? React.createElement( 'div', { ref: 'viewPortContainer', onKeyDown: this.props.onViewportKeydown, onDoubleClick: this.props.onViewportDoubleClick, onDragStart: this.props.onViewportDragStart, onDragEnd: this.props.onViewportDragEnd }, React.createElement(Viewport, { ref: 'viewport', rowKey: this.props.rowKey, width: this.props.columnMetrics.width, rowHeight: this.props.rowHeight, rowRenderer: this.props.rowRenderer, rowGetter: this.props.rowGetter, rowsCount: this.props.rowsCount, selectedRows: this.props.selectedRows, expandedRows: this.props.expandedRows, columnMetrics: this.props.columnMetrics, totalWidth: this.props.totalWidth, onScroll: this.onScroll, onRows: this.props.onRows, cellMetaData: this.props.cellMetaData, rowOffsetHeight: this.props.rowOffsetHeight || this.props.rowHeight * headerRows.length, minHeight: this.props.minHeight, rowScrollTimeout: this.props.rowScrollTimeout }) ) : React.createElement( 'div', { ref: 'emptyView', className: 'react-grid-Empty' }, React.createElement(EmptyRowsView, null) ) ); } }); module.exports = Grid; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var joinClasses = __webpack_require__(6); var shallowCloneObject = __webpack_require__(7); var ColumnMetrics = __webpack_require__(8); var ColumnUtils = __webpack_require__(10); var HeaderRow = __webpack_require__(12); var PropTypes = React.PropTypes; var Header = React.createClass({ displayName: 'Header', propTypes: { columnMetrics: PropTypes.shape({ width: PropTypes.number.isRequired, columns: PropTypes.any }).isRequired, totalWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), height: PropTypes.number.isRequired, headerRows: PropTypes.array.isRequired, sortColumn: PropTypes.string, sortDirection: PropTypes.oneOf(['ASC', 'DESC', 'NONE']), onSort: PropTypes.func, onColumnResize: PropTypes.func }, getInitialState: function getInitialState() { return { resizing: null }; }, componentWillReceiveProps: function componentWillReceiveProps() { this.setState({ resizing: null }); }, shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { var update = !ColumnMetrics.sameColumns(this.props.columnMetrics.columns, nextProps.columnMetrics.columns, ColumnMetrics.sameColumn) || this.props.totalWidth !== nextProps.totalWidth || this.props.headerRows.length !== nextProps.headerRows.length || this.state.resizing !== nextState.resizing || this.props.sortColumn !== nextProps.sortColumn || this.props.sortDirection !== nextProps.sortDirection; return update; }, onColumnResize: function onColumnResize(column, width) { var state = this.state.resizing || this.props; var pos = this.getColumnPosition(column); if (pos != null) { var _resizing = { columnMetrics: shallowCloneObject(state.columnMetrics) }; _resizing.columnMetrics = ColumnMetrics.resizeColumn(_resizing.columnMetrics, pos, width); // we don't want to influence scrollLeft while resizing if (_resizing.columnMetrics.totalWidth < state.columnMetrics.totalWidth) { _resizing.columnMetrics.totalWidth = state.columnMetrics.totalWidth; } _resizing.column = ColumnUtils.getColumn(_resizing.columnMetrics.columns, pos); this.setState({ resizing: _resizing }); } }, onColumnResizeEnd: function onColumnResizeEnd(column, width) { var pos = this.getColumnPosition(column); if (pos !== null && this.props.onColumnResize) { this.props.onColumnResize(pos, width || column.width); } }, getHeaderRows: function getHeaderRows() { var _this = this; var columnMetrics = this.getColumnMetrics(); var resizeColumn = undefined; if (this.state.resizing) { resizeColumn = this.state.resizing.column; } var headerRows = []; this.props.headerRows.forEach(function (row, index) { var headerRowStyle = { position: 'absolute', top: _this.getCombinedHeaderHeights(index), left: 0, width: _this.props.totalWidth, overflow: 'hidden' }; headerRows.push(React.createElement(HeaderRow, { key: row.ref, ref: row.ref, style: headerRowStyle, onColumnResize: _this.onColumnResize, onColumnResizeEnd: _this.onColumnResizeEnd, width: columnMetrics.width, height: row.height || _this.props.height, columns: columnMetrics.columns, resizing: resizeColumn, filterable: row.filterable, onFilterChange: row.onFilterChange, sortColumn: _this.props.sortColumn, sortDirection: _this.props.sortDirection, onSort: _this.props.onSort })); }); return headerRows; }, getColumnMetrics: function getColumnMetrics() { var columnMetrics = undefined; if (this.state.resizing) { columnMetrics = this.state.resizing.columnMetrics; } else { columnMetrics = this.props.columnMetrics; } return columnMetrics; }, getColumnPosition: function getColumnPosition(column) { var columnMetrics = this.getColumnMetrics(); var pos = -1; columnMetrics.columns.forEach(function (c, idx) { if (c.key === column.key) { pos = idx; } }); return pos === -1 ? null : pos; }, getCombinedHeaderHeights: function getCombinedHeaderHeights(until) { var stopAt = this.props.headerRows.length; if (typeof until !== 'undefined') { stopAt = until; } var height = 0; for (var index = 0; index < stopAt; index++) { height += this.props.headerRows[index].height || this.props.height; } return height; }, getStyle: function getStyle() { return { position: 'relative', height: this.getCombinedHeaderHeights(), overflow: 'hidden' }; }, setScrollLeft: function setScrollLeft(scrollLeft) { var node = ReactDOM.findDOMNode(this.refs.row); node.scrollLeft = scrollLeft; this.refs.row.setScrollLeft(scrollLeft); if (this.refs.filterRow) { var nodeFilters = ReactDOM.findDOMNode(this.refs.filterRow); nodeFilters.scrollLeft = scrollLeft; this.refs.filterRow.setScrollLeft(scrollLeft); } }, render: function render() { var className = joinClasses({ 'react-grid-Header': true, 'react-grid-Header--resizing': !!this.state.resizing }); var headerRows = this.getHeaderRows(); return React.createElement( 'div', _extends({}, this.props, { style: this.getStyle(), className: className }), headerRows ); } }); module.exports = Header; /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ function classNames() { var classes = ''; var arg; for (var i = 0; i < arguments.length; i++) { arg = arguments[i]; if (!arg) { continue; } if ('string' === typeof arg || 'number' === typeof arg) { classes += ' ' + arg; } else if (Object.prototype.toString.call(arg) === '[object Array]') { classes += ' ' + classNames.apply(null, arg); } else if ('object' === typeof arg) { for (var key in arg) { if (!arg.hasOwnProperty(key) || !arg[key]) { continue; } classes += ' ' + key; } } } return classes.substr(1); } // safely export classNames for node / browserify if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } // safely export classNames for RequireJS if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return classNames; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } /***/ }, /* 7 */ /***/ function(module, exports) { "use strict"; function shallowCloneObject(obj) { var result = {}; for (var k in obj) { if (obj.hasOwnProperty(k)) { result[k] = obj[k]; } } return result; } module.exports = shallowCloneObject; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var shallowCloneObject = __webpack_require__(7); var sameColumn = __webpack_require__(9); var ColumnUtils = __webpack_require__(10); var getScrollbarSize = __webpack_require__(11); function setColumnWidths(columns, totalWidth) { return columns.map(function (column) { var colInfo = Object.assign({}, column); if (column.width) { if (/^([0-9]+)%$/.exec(column.width.toString())) { colInfo.width = Math.floor(column.width / 100 * totalWidth); } } return colInfo; }); } function setDefferedColumnWidths(columns, unallocatedWidth, minColumnWidth) { var defferedColumns = columns.filter(function (c) { return !c.width; }); return columns.map(function (column) { if (!column.width) { if (unallocatedWidth <= 0) { column.width = minColumnWidth; } else { column.width = Math.floor(unallocatedWidth / ColumnUtils.getSize(defferedColumns)); } } return column; }); } function setColumnOffsets(columns) { var left = 0; return columns.map(function (column) { column.left = left; left += column.width; return column; }); } /** * Update column metrics calculation. * * @param {ColumnMetricsType} metrics */ function recalculate(metrics) { // compute width for columns which specify width var columns = setColumnWidths(metrics.columns, metrics.totalWidth); var unallocatedWidth = columns.filter(function (c) { return c.width; }).reduce(function (w, column) { return w - column.width; }, metrics.totalWidth); unallocatedWidth -= getScrollbarSize(); var width = columns.filter(function (c) { return c.width; }).reduce(function (w, column) { return w + column.width; }, 0); // compute width for columns which doesn't specify width columns = setDefferedColumnWidths(columns, unallocatedWidth, metrics.minColumnWidth); // compute left offset columns = setColumnOffsets(columns); return { columns: columns, width: width, totalWidth: metrics.totalWidth, minColumnWidth: metrics.minColumnWidth }; } /** * Update column metrics calculation by resizing a column. * * @param {ColumnMetricsType} metrics * @param {Column} column * @param {number} width */ function resizeColumn(metrics, index, width) { var column = ColumnUtils.getColumn(metrics.columns, index); var metricsClone = shallowCloneObject(metrics); metricsClone.columns = metrics.columns.slice(0); var updatedColumn = shallowCloneObject(column); updatedColumn.width = Math.max(width, metricsClone.minColumnWidth); metricsClone = ColumnUtils.spliceColumn(metricsClone, index, updatedColumn); return recalculate(metricsClone); } function areColumnsImmutable(prevColumns, nextColumns) { return typeof Immutable !== 'undefined' && prevColumns instanceof Immutable.List && nextColumns instanceof Immutable.List; } function compareEachColumn(prevColumns, nextColumns, isSameColumn) { var i = undefined; var len = undefined; var column = undefined; var prevColumnsByKey = {}; var nextColumnsByKey = {}; if (ColumnUtils.getSize(prevColumns) !== ColumnUtils.getSize(nextColumns)) { return false; } for (i = 0, len = ColumnUtils.getSize(prevColumns); i < len; i++) { column = prevColumns[i]; prevColumnsByKey[column.key] = column; } for (i = 0, len = ColumnUtils.getSize(nextColumns); i < len; i++) { column = nextColumns[i]; nextColumnsByKey[column.key] = column; var prevColumn = prevColumnsByKey[column.key]; if (prevColumn === undefined || !isSameColumn(prevColumn, column)) { return false; } } for (i = 0, len = ColumnUtils.getSize(prevColumns); i < len; i++) { column = prevColumns[i]; var nextColumn = nextColumnsByKey[column.key]; if (nextColumn === undefined) { return false; } } return true; } function sameColumns(prevColumns, nextColumns, isSameColumn) { if (areColumnsImmutable(prevColumns, nextColumns)) { return prevColumns === nextColumns; } return compareEachColumn(prevColumns, nextColumns, isSameColumn); } module.exports = { recalculate: recalculate, resizeColumn: resizeColumn, sameColumn: sameColumn, sameColumns: sameColumns }; /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var isValidElement = __webpack_require__(2).isValidElement; module.exports = function sameColumn(a, b) { var k = undefined; for (k in a) { if (a.hasOwnProperty(k)) { if (typeof a[k] === 'function' && typeof b[k] === 'function' || isValidElement(a[k]) && isValidElement(b[k])) { continue; } if (!b.hasOwnProperty(k) || a[k] !== b[k]) { return false; } } } for (k in b) { if (b.hasOwnProperty(k) && !a.hasOwnProperty(k)) { return false; } } return true; }; /***/ }, /* 10 */ /***/ function(module, exports) { 'use strict'; module.exports = { getColumn: function getColumn(columns, idx) { if (Array.isArray(columns)) { return columns[idx]; } else if (typeof Immutable !== 'undefined') { return columns.get(idx); } }, spliceColumn: function spliceColumn(metrics, idx, column) { if (Array.isArray(metrics.columns)) { metrics.columns.splice(idx, 1, column); } else if (typeof Immutable !== 'undefined') { metrics.columns = metrics.columns.splice(idx, 1, column); } return metrics; }, getSize: function getSize(columns) { if (Array.isArray(columns)) { return columns.length; } else if (typeof Immutable !== 'undefined') { return columns.size; } } }; /***/ }, /* 11 */ /***/ function(module, exports) { 'use strict'; var size = undefined; function getScrollbarSize() { if (size === undefined) { var outer = document.createElement('div'); outer.style.width = '50px'; outer.style.height = '50px'; outer.style.position = 'absolute'; outer.style.top = '-200px'; outer.style.left = '-200px'; var inner = document.createElement('div'); inner.style.height = '100px'; inner.style.width = '100%'; outer.appendChild(inner); document.body.appendChild(outer); var outerWidth = outer.clientWidth; outer.style.overflowY = 'scroll'; var innerWidth = inner.clientWidth; document.body.removeChild(outer); size = outerWidth - innerWidth; } return size; } module.exports = getScrollbarSize; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var shallowEqual = __webpack_require__(13); var HeaderCell = __webpack_require__(14); var getScrollbarSize = __webpack_require__(11); var ExcelColumn = __webpack_require__(15); var ColumnUtilsMixin = __webpack_require__(10); var SortableHeaderCell = __webpack_require__(18); var FilterableHeaderCell = __webpack_require__(19); var HeaderCellType = __webpack_require__(20); var PropTypes = React.PropTypes; var HeaderRowStyle = { overflow: React.PropTypes.string, width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), height: React.PropTypes.number, position: React.PropTypes.string }; var DEFINE_SORT = ['ASC', 'DESC', 'NONE']; var HeaderRow = React.createClass({ displayName: 'HeaderRow', propTypes: { width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), height: PropTypes.number.isRequired, columns: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), onColumnResize: PropTypes.func, onSort: PropTypes.func.isRequired, onColumnResizeEnd: PropTypes.func, style: PropTypes.shape(HeaderRowStyle), sortColumn: PropTypes.string, sortDirection: React.PropTypes.oneOf(DEFINE_SORT), cellRenderer: PropTypes.func, headerCellRenderer: PropTypes.func, filterable: PropTypes.bool, onFilterChange: PropTypes.func, resizing: PropTypes.func }, mixins: [ColumnUtilsMixin], shouldComponentUpdate: function shouldComponentUpdate(nextProps) { return nextProps.width !== this.props.width || nextProps.height !== this.props.height || nextProps.columns !== this.props.columns || !shallowEqual(nextProps.style, this.props.style) || this.props.sortColumn !== nextProps.sortColumn || this.props.sortDirection !== nextProps.sortDirection; }, getHeaderCellType: function getHeaderCellType(column) { if (column.filterable) { if (this.props.filterable) return HeaderCellType.FILTERABLE; } if (column.sortable) return HeaderCellType.SORTABLE; return HeaderCellType.NONE; }, getFilterableHeaderCell: function getFilterableHeaderCell() { return React.createElement(FilterableHeaderCell, { onChange: this.props.onFilterChange }); }, getSortableHeaderCell: function getSortableHeaderCell(column) { var sortDirection = this.props.sortColumn === column.key ? this.props.sortDirection : DEFINE_SORT.NONE; return React.createElement(SortableHeaderCell, { columnKey: column.key, onSort: this.props.onSort, sortDirection: sortDirection }); }, getHeaderRenderer: function getHeaderRenderer(column) { var headerCellType = this.getHeaderCellType(column); var renderer = undefined; switch (headerCellType) { case HeaderCellType.SORTABLE: renderer = this.getSortableHeaderCell(column); break; case HeaderCellType.FILTERABLE: renderer = this.getFilterableHeaderCell(); break; default: break; } return renderer; }, getStyle: function getStyle() { return { overflow: 'hidden', width: '100%', height: this.props.height, position: 'absolute' }; }, getCells: function getCells() { var cells = []; var lockedCells = []; for (var i = 0, len = this.getSize(this.props.columns); i < len; i++) { var column = this.getColumn(this.props.columns, i); var cell = React.createElement(HeaderCell, { ref: i, key: i, height: this.props.height, column: column, renderer: this.getHeaderRenderer(column), resizing: this.props.resizing === column, onResize: this.props.onColumnResize, onResizeEnd: this.props.onColumnResizeEnd }); if (column.locked) { lockedCells.push(cell); } else { cells.push(cell); } } return cells.concat(lockedCells); }, setScrollLeft: function setScrollLeft(scrollLeft) { var _this = this; this.props.columns.forEach(function (column, i) { if (column.locked) { _this.refs[i].setScrollLeft(scrollLeft); } }); }, render: function render() { var cellsStyle = { width: this.props.width ? this.props.width + getScrollbarSize() : '100%', height: this.props.height, whiteSpace: 'nowrap', overflowX: 'hidden', overflowY: 'hidden' }; var cells = this.getCells(); return React.createElement( 'div', _extends({}, this.props, { className: 'react-grid-HeaderRow' }), React.createElement( 'div', { style: cellsStyle }, cells ) ); } }); module.exports = HeaderRow; /***/ }, /* 13 */ /***/ function(module, exports) { /** * 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 shallowEqual * @typechecks * */ 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty; /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. * Returns true when the values of all keys are strictly equal. */ function shallowEqual(objA, objB) { if (objA === objB) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. var bHasOwnProperty = hasOwnProperty.bind(objB); for (var i = 0; i < keysA.length; i++) { if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { return false; } } return true; } module.exports = shallowEqual; /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var joinClasses = __webpack_require__(6); var ExcelColumn = __webpack_require__(15); var ResizeHandle = __webpack_require__(16); var PropTypes = React.PropTypes; function simpleCellRenderer(objArgs) { return React.createElement( 'div', { className: 'widget-HeaderCell__value' }, objArgs.column.name ); } var HeaderCell = React.createClass({ displayName: 'HeaderCell', propTypes: { renderer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired, column: PropTypes.shape(ExcelColumn).isRequired, onResize: PropTypes.func.isRequired, height: PropTypes.number.isRequired, onResizeEnd: PropTypes.func.isRequired, className: PropTypes.string }, getDefaultProps: function getDefaultProps() { return { renderer: simpleCellRenderer }; }, getInitialState: function getInitialState() { return { resizing: false }; }, onDragStart: function onDragStart(e) { this.setState({ resizing: true }); // need to set dummy data for FF if (e && e.dataTransfer && e.dataTransfer.setData) e.dataTransfer.setData('text/plain', 'dummy'); }, onDrag: function onDrag(e) { var resize = this.props.onResize || null; // for flows sake, doesnt recognise a null check direct if (resize) { var _width = this.getWidthFromMouseEvent(e); if (_width > 0) { resize(this.props.column, _width); } } }, onDragEnd: function onDragEnd(e) { var width = this.getWidthFromMouseEvent(e); this.props.onResizeEnd(this.props.column, width); this.setState({ resizing: false }); }, getWidthFromMouseEvent: function getWidthFromMouseEvent(e) { var right = e.pageX; var left = ReactDOM.findDOMNode(this).getBoundingClientRect().left; return right - left; }, getCell: function getCell() { if (React.isValidElement(this.props.renderer)) { return React.cloneElement(this.props.renderer, { column: this.props.column }); } return this.props.renderer({ column: this.props.column }); }, getStyle: function getStyle() { return { width: this.props.column.width, left: this.props.column.left, display: 'inline-block', position: 'absolute', overflow: 'hidden', height: this.props.height, margin: 0, textOverflow: 'ellipsis', whiteSpace: 'nowrap' }; }, setScrollLeft: function setScrollLeft(scrollLeft) { var node = ReactDOM.findDOMNode(this); node.style.webkitTransform = 'translate3d(' + scrollLeft + 'px, 0px, 0px)'; node.style.transform = 'translate3d(' + scrollLeft + 'px, 0px, 0px)'; }, render: function render() { var resizeHandle = undefined; if (this.props.column.resizable) { resizeHandle = React.createElement(ResizeHandle, { onDrag: this.onDrag, onDragStart: this.onDragStart, onDragEnd: this.onDragEnd }); } var className = joinClasses({ 'react-grid-HeaderCell': true, 'react-grid-HeaderCell--resizing': this.state.resizing, 'react-grid-HeaderCell--locked': this.props.column.locked }); className = joinClasses(className, this.props.className, this.props.column.cellClass); var cell = this.getCell(); return React.createElement( 'div', { className: className, style: this.getStyle() }, cell, resizeHandle ); } }); module.exports = HeaderCell; /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var ExcelColumnShape = { name: React.PropTypes.string.isRequired, key: React.PropTypes.string.isRequired, width: React.PropTypes.number.isRequired, filterable: React.PropTypes.bool }; module.exports = ExcelColumnShape; /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var Draggable = __webpack_require__(17); var ResizeHandle = React.createClass({ displayName: 'ResizeHandle', style: { position: 'absolute', top: 0, right: 0, width: 6, height: '100%' }, render: function render() { return React.createElement(Draggable, _extends({}, this.props, { className: 'react-grid-HeaderCell__resizeHandle', style: this.style })); } }); module.exports = ResizeHandle; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var PropTypes = React.PropTypes; var Draggable = React.createClass({ displayName: 'Draggable', propTypes: { onDragStart: PropTypes.func, onDragEnd: PropTypes.func, onDrag: PropTypes.func, component: PropTypes.oneOfType([PropTypes.func, PropTypes.constructor]) }, getDefaultProps: function getDefaultProps() { return { onDragStart: function onDragStart() { return true; }, onDragEnd: function onDragEnd() {}, onDrag: function onDrag() {} }; }, getInitialState: function getInitialState() { return { drag: null }; }, componentWillUnmount: function componentWillUnmount() { this.cleanUp(); }, onMouseDown: function onMouseDown(e) { var drag = this.props.onDragStart(e); if (drag === null && e.button !== 0) { return; } window.addEventListener('mouseup', this.onMouseUp); window.addEventListener('mousemove', this.onMouseMove); this.setState({ drag: drag }); }, onMouseMove: function onMouseMove(e) { if (this.state.drag === null) { return; } if (e.preventDefault) { e.preventDefault(); } this.props.onDrag(e); }, onMouseUp: function onMouseUp(e) { this.cleanUp(); this.props.onDragEnd(e, this.state.drag); this.setState({ drag: null }); }, cleanUp: function cleanUp() { window.removeEventListener('mouseup', this.onMouseUp); window.removeEventListener('mousemove', this.onMouseMove); }, render: function render() { return React.createElement('div', _extends({}, this.props, { onMouseDown: this.onMouseDown, className: 'react-grid-HeaderCell__draggable' })); } }); module.exports = Draggable; /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var joinClasses = __webpack_require__(6); var DEFINE_SORT = { ASC: 'ASC', DESC: 'DESC', NONE: 'NONE' }; var SortableHeaderCell = React.createClass({ displayName: 'SortableHeaderCell', propTypes: { columnKey: React.PropTypes.string.isRequired, column: React.PropTypes.shape({ name: React.PropTypes.string }), onSort: React.PropTypes.func.isRequired, sortDirection: React.PropTypes.oneOf(['ASC', 'DESC', 'NONE']) }, onClick: function onClick() { var direction = undefined; switch (this.props.sortDirection) { default: case null: case undefined: case DEFINE_SORT.NONE: direction = DEFINE_SORT.ASC; break; case DEFINE_SORT.ASC: direction = DEFINE_SORT.DESC; break; case DEFINE_SORT.DESC: direction = DEFINE_SORT.NONE; break; } this.props.onSort(this.props.columnKey, direction); }, getSortByText: function getSortByText() { var unicodeKeys = { ASC: '9650', DESC: '9660', NONE: '' }; return String.fromCharCode(unicodeKeys[this.props.sortDirection]); }, render: function render() { var className = joinClasses({ 'react-grid-HeaderCell-sortable': true, 'react-grid-HeaderCell-sortable--ascending': this.props.sortDirection === 'ASC', 'react-grid-HeaderCell-sortable--descending': this.props.sortDirection === 'DESC' }); return React.createElement( 'div', { className: className, onClick: this.onClick, style: { cursor: 'pointer' } }, this.props.column.name, React.createElement( 'span', { className: 'pull-right' }, this.getSortByText() ) ); } }); module.exports = SortableHeaderCell; /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var ExcelColumn = __webpack_require__(15); var FilterableHeaderCell = React.createClass({ displayName: 'FilterableHeaderCell', propTypes: { onChange: React.PropTypes.func.isRequired, column: React.PropTypes.shape(ExcelColumn) }, getInitialState: function getInitialState() { return { filterTerm: '' }; }, handleChange: function handleChange(e) { var val = e.target.value; this.setState({ filterTerm: val }); this.props.onChange({ filterTerm: val, columnKey: this.props.column.key }); }, renderInput: function renderInput() { if (this.props.column.filterable === false) { return React.createElement('span', null); } var inputKey = 'header-filter-' + this.props.column.key; return React.createElement('input', { key: inputKey, type: 'text', className: 'form-control input-sm', placeholder: 'Search', value: this.state.filterTerm, onChange: this.handleChange }); }, render: function render() { return React.createElement( 'div', null, React.createElement( 'div', { className: 'form-group' }, this.renderInput() ) ); } }); module.exports = FilterableHeaderCell; /***/ }, /* 20 */ /***/ function(module, exports) { "use strict"; var HeaderCellType = { SORTABLE: 0, FILTERABLE: 1, NONE: 2 }; module.exports = HeaderCellType; /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var Canvas = __webpack_require__(22); var ViewportScroll = __webpack_require__(33); var cellMetaDataShape = __webpack_require__(31); var PropTypes = React.PropTypes; var Viewport = React.createClass({ displayName: 'Viewport', mixins: [ViewportScroll], propTypes: { rowOffsetHeight: PropTypes.number.isRequired, totalWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, columnMetrics: PropTypes.object.isRequired, rowGetter: PropTypes.oneOfType([PropTypes.array, PropTypes.func]).isRequired, selectedRows: PropTypes.array, expandedRows: PropTypes.array, rowRenderer: PropTypes.func, rowsCount: PropTypes.number.isRequired, rowHeight: PropTypes.number.isRequired, onRows: PropTypes.func, onScroll: PropTypes.func, minHeight: PropTypes.number, cellMetaData: PropTypes.shape(cellMetaDataShape), rowKey: PropTypes.string.isRequired, rowScrollTimeout: PropTypes.number }, onScroll: function onScroll(scroll) { this.updateScroll(scroll.scrollTop, scroll.scrollLeft, this.state.height, this.props.rowHeight, this.props.rowsCount); if (this.props.onScroll) { this.props.onScroll({ scrollTop: scroll.scrollTop, scrollLeft: scroll.scrollLeft }); } }, getScroll: function getScroll() { return this.refs.canvas.getScroll(); }, setScrollLeft: function setScrollLeft(scrollLeft) { this.refs.canvas.setScrollLeft(scrollLeft); }, render: function render() { var style = { padding: 0, bottom: 0, left: 0, right: 0, overflow: 'hidden', position: 'absolute', top: this.props.rowOffsetHeight }; return React.createElement( 'div', { className: 'react-grid-Viewport', style: style }, React.createElement(Canvas, { ref: 'canvas', rowKey: this.props.rowKey, totalWidth: this.props.totalWidth, width: this.props.columnMetrics.width, rowGetter: this.props.rowGetter, rowsCount: this.props.rowsCount, selectedRows: this.props.selectedRows, expandedRows: this.props.expandedRows, columns: this.props.columnMetrics.columns, rowRenderer: this.props.rowRenderer, displayStart: this.state.displayStart, displayEnd: this.state.displayEnd, cellMetaData: this.props.cellMetaData, height: this.state.height, rowHeight: this.props.rowHeight, onScroll: this.onScroll, onRows: this.props.onRows, rowScrollTimeout: this.props.rowScrollTimeout }) ); } }); module.exports = Viewport; /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _shallowEqual = __webpack_require__(13); var _shallowEqual2 = _interopRequireDefault(_shallowEqual); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var joinClasses = __webpack_require__(6); var PropTypes = React.PropTypes; var ScrollShim = __webpack_require__(23); var Row = __webpack_require__(24); var cellMetaDataShape = __webpack_require__(31); var Canvas = React.createClass({ displayName: 'Canvas', mixins: [ScrollShim], propTypes: { rowRenderer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]), rowHeight: PropTypes.number.isRequired, height: PropTypes.number.isRequired, width: PropTypes.number, totalWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), style: PropTypes.string, className: PropTypes.string, displayStart: PropTypes.number.isRequired, displayEnd: PropTypes.number.isRequired, rowsCount: PropTypes.number.isRequired, rowGetter: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.array.isRequired]), expandedRows: PropTypes.array, onRows: PropTypes.func, onScroll: PropTypes.func, columns: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired, cellMetaData: PropTypes.shape(cellMetaDataShape).isRequired, selectedRows: PropTypes.array, rowKey: React.PropTypes.string, rowScrollTimeout: React.PropTypes.number }, getDefaultProps: function getDefaultProps() { return { rowRenderer: Row, onRows: function onRows() {}, selectedRows: [], rowScrollTimeout: 0 }; }, getInitialState: function getInitialState() { return { displayStart: this.props.displayStart, displayEnd: this.props.displayEnd, scrollingTimeout: null }; }, componentWillMount: function componentWillMount() { this._currentRowsLength = 0; this._currentRowsRange = { start: 0, end: 0 }; this._scroll = { scrollTop: 0, scrollLeft: 0 }; }, componentDidMount: function componentDidMount() { this.onRows(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (nextProps.displayStart !== this.state.displayStart || nextProps.displayEnd !== this.state.displayEnd) { this.setState({ displayStart: nextProps.displayStart, displayEnd: nextProps.displayEnd }); } }, shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { var shouldUpdate = nextState.displayStart !== this.state.displayStart || nextState.displayEnd !== this.state.displayEnd || nextState.scrollingTimeout !== this.state.scrollingTimeout || nextProps.rowsCount !== this.props.rowsCount || nextProps.rowHeight !== this.props.rowHeight || nextProps.columns !== this.props.columns || nextProps.width !== this.props.width || nextProps.cellMetaData !== this.props.cellMetaData || !(0, _shallowEqual2.default)(nextProps.style, this.props.style); return shouldUpdate; }, componentWillUnmount: function componentWillUnmount() { this._currentRowsLength = 0; this._currentRowsRange = { start: 0, end: 0 }; this._scroll = { scrollTop: 0, scrollLeft: 0 }; }, componentDidUpdate: function componentDidUpdate() { if (this._scroll.scrollTop !== 0 && this._scroll.scrollLeft !== 0) { this.setScrollLeft(this._scroll.scrollLeft); } this.onRows(); }, onRows: function onRows() { if (this._currentRowsRange !== { start: 0, end: 0 }) { this.props.onRows(this._currentRowsRange); this._currentRowsRange = { start: 0, end: 0 }; } }, onScroll: function onScroll(e) { var _this = this; this.appendScrollShim(); var _e$target = e.target; var scrollTop = _e$target.scrollTop; var scrollLeft = _e$target.scrollLeft; var scroll = { scrollTop: scrollTop, scrollLeft: scrollLeft }; // check how far we have scrolled, and if this means we are being taken out of range var scrollYRange = Math.abs(this._scroll.scrollTop - scroll.scrollTop) / this.props.rowHeight; var scrolledOutOfRange = scrollYRange > this.props.displayEnd - this.props.displayStart; this._scroll = scroll; this.props.onScroll(scroll); // if we go out of range, we queue the actual render, just rendering cheap placeholders // avoiding rendering anything expensive while a user scrolls down if (scrolledOutOfRange && this.props.rowScrollTimeout > 0) { var scrollTO = this.state.scrollingTimeout; if (scrollTO) { clearTimeout(scrollTO); } // queue up, and set state to clear the TO so we render the rows (not placeholders) scrollTO = setTimeout(function () { if (_this.state.scrollingTimeout !== null) { _this.setState({ scrollingTimeout: null }); } }, this.props.rowScrollTimeout); this.setState({ scrollingTimeout: scrollTO }); } }, getRows: function getRows(displayStart, displayEnd) { this._currentRowsRange = { start: displayStart, end: displayEnd }; if (Array.isArray(this.props.rowGetter)) { return this.props.rowGetter.slice(displayStart, displayEnd); } var rows = []; for (var i = displayStart; i < displayEnd; i++) { rows.push(this.props.rowGetter(i)); } return rows; }, getScrollbarWidth: function getScrollbarWidth() { var scrollbarWidth = 0; // Get the scrollbar width var canvas = ReactDOM.findDOMNode(this); scrollbarWidth = canvas.offsetWidth - canvas.clientWidth; return scrollbarWidth; }, getScroll: function getScroll() { var _ReactDOM$findDOMNode = ReactDOM.findDOMNode(this); var scrollTop = _ReactDOM$findDOMNode.scrollTop; var scrollLeft = _ReactDOM$findDOMNode.scrollLeft; return { scrollTop: scrollTop, scrollLeft: scrollLeft }; }, isRowSelected: function isRowSelected(row) { var _this2 = this; var selectedRows = this.props.selectedRows.filter(function (r) { var rowKeyValue = row.get ? row.get(_this2.props.rowKey) : row[_this2.props.rowKey]; return r[_this2.props.rowKey] === rowKeyValue; }); return selectedRows.length > 0 && selectedRows[0].isSelected; }, _currentRowsLength: 0, _currentRowsRange: { start: 0, end: 0 }, _scroll: { scrollTop: 0, scrollLeft: 0 }, setScrollLeft: function setScrollLeft(scrollLeft) { if (this._currentRowsLength !== 0) { if (!this.refs) return; for (var i = 0, len = this._currentRowsLength; i < len; i++) { if (this.refs[i] && this.refs[i].setScrollLeft) { this.refs[i].setScrollLeft(scrollLeft); } } } }, renderRow: function renderRow(props) { if (this.state.scrollingTimeout !== null) { // in the midst of a rapid scroll, so we render placeholders // the actual render is then queued (through a timeout) // this avoids us redering a bunch of rows that a user is trying to scroll past return this.renderScrollingPlaceholder(props); } var RowsRenderer = this.props.rowRenderer; if (typeof RowsRenderer === 'function') { return React.createElement(RowsRenderer, props); } if (React.isValidElement(this.props.rowRenderer)) { return React.cloneElement(this.props.rowRenderer, props); } }, renderScrollingPlaceholder: function renderScrollingPlaceholder(props) { // here we are just rendering empty cells // we may want to allow a user to inject this, and/or just render the cells that are in view // for now though we essentially are doing a (very lightweight) row + cell with empty content var styles = { row: { height: props.height, overflow: 'hidden' }, cell: { height: props.height, position: 'absolute' }, placeholder: { backgroundColor: 'rgba(211, 211, 211, 0.45)', width: '60%', height: Math.floor(props.height * 0.3) } }; return React.createElement( 'div', { key: props.key, style: styles.row, className: 'react-grid-Row' }, this.props.columns.map(function (col, idx) { return React.createElement( 'div', { style: Object.assign(styles.cell, { width: col.width, left: col.left }), key: idx, className: 'react-grid-Cell' }, React.createElement('div', { style: Object.assign(styles.placeholder, { width: Math.floor(col.width * 0.6) }) }) ); }) ); }, renderPlaceholder: function renderPlaceholder(key, height) { // just renders empty cells // if we wanted to show gridlines, we'd need classes and position as with renderScrollingPlaceholder return React.createElement( 'div', { key: key, style: { height: height } }, this.props.columns.map(function (column, idx) { return React.createElement('div', { style: { width: column.width }, key: idx }); }) ); }, render: function render() { var _this3 = this; var displayStart = this.state.displayStart; var displayEnd = this.state.displayEnd; var rowHeight = this.props.rowHeight; var length = this.props.rowsCount; var rows = this.getRows(displayStart, displayEnd).map(function (row, idx) { return _this3.renderRow({ key: displayStart + idx, ref: idx, idx: displayStart + idx, row: row, height: rowHeight, columns: _this3.props.columns, isSelected: _this3.isRowSelected(row), expandedRows: _this3.props.expandedRows, cellMetaData: _this3.props.cellMetaData }); }); this._currentRowsLength = rows.length; if (displayStart > 0) { rows.unshift(this.renderPlaceholder('top', displayStart * rowHeight)); } if (length - displayEnd > 0) { rows.push(this.renderPlaceholder('bottom', (length - displayEnd) * rowHeight)); } var style = { position: 'absolute', top: 0, left: 0, overflowX: 'auto', overflowY: 'scroll', width: this.props.totalWidth, height: this.props.height, transform: 'translate3d(0, 0, 0)' }; return React.createElement( 'div', { style: style, onScroll: this.onScroll, className: joinClasses('react-grid-Canvas', this.props.className, { opaque: this.props.cellMetaData.selected && this.props.cellMetaData.selected.active }) }, React.createElement( 'div', { style: { width: this.props.width, overflow: 'hidden' } }, rows ) ); } }); module.exports = Canvas; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _reactDom = __webpack_require__(3); var _reactDom2 = _interopRequireDefault(_reactDom); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ScrollShim = { appendScrollShim: function appendScrollShim() { if (!this._scrollShim) { var size = this._scrollShimSize(); var shim = document.createElement('div'); if (shim.classList) { shim.classList.add('react-grid-ScrollShim'); // flow - not compatible with HTMLElement } else { shim.className += ' react-grid-ScrollShim'; } shim.style.position = 'absolute'; shim.style.top = 0; shim.style.left = 0; shim.style.width = size.width + 'px'; shim.style.height = size.height + 'px'; _reactDom2.default.findDOMNode(this).appendChild(shim); this._scrollShim = shim; } this._scheduleRemoveScrollShim(); }, _scrollShimSize: function _scrollShimSize() { return { width: this.props.width, height: this.props.length * this.props.rowHeight }; }, _scheduleRemoveScrollShim: function _scheduleRemoveScrollShim() { if (this._scheduleRemoveScrollShimTimer) { clearTimeout(this._scheduleRemoveScrollShimTimer); } this._scheduleRemoveScrollShimTimer = setTimeout(this._removeScrollShim, 200); }, _removeScrollShim: function _removeScrollShim() { if (this._scrollShim) { this._scrollShim.parentNode.removeChild(this._scrollShim); this._scrollShim = undefined; } } }; module.exports = ScrollShim; /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var joinClasses = __webpack_require__(6); var Cell = __webpack_require__(25); var ColumnMetrics = __webpack_require__(8); var ColumnUtilsMixin = __webpack_require__(10); var cellMetaDataShape = __webpack_require__(31); var PropTypes = React.PropTypes; var Row = React.createClass({ displayName: 'Row', propTypes: { height: PropTypes.number.isRequired, columns: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired, row: PropTypes.any.isRequired, cellRenderer: PropTypes.func, cellMetaData: PropTypes.shape(cellMetaDataShape), isSelected: PropTypes.bool, idx: PropTypes.number.isRequired, key: PropTypes.string, expandedRows: PropTypes.arrayOf(PropTypes.object) }, mixins: [ColumnUtilsMixin], getDefaultProps: function getDefaultProps() { return { cellRenderer: Cell, isSelected: false, height: 35 }; }, shouldComponentUpdate: function shouldComponentUpdate(nextProps) { return !ColumnMetrics.sameColumns(this.props.columns, nextProps.columns, ColumnMetrics.sameColumn) || this.doesRowContainSelectedCell(this.props) || this.doesRowContainSelectedCell(nextProps) || this.willRowBeDraggedOver(nextProps) || nextProps.row !== this.props.row || this.hasRowBeenCopied() || this.props.isSelected !== nextProps.isSelected || nextProps.height !== this.props.height; }, handleDragEnter: function handleDragEnter() { var handleDragEnterRow = this.props.cellMetaData.handleDragEnterRow; if (handleDragEnterRow) { handleDragEnterRow(this.props.idx); } }, getSelectedColumn: function getSelectedColumn() { var selected = this.props.cellMetaData.selected; if (selected && selected.idx) { return this.getColumn(this.props.columns, selected.idx); } }, getCells: function getCells() { var _this = this; var cells = []; var lockedCells = []; var selectedColumn = this.getSelectedColumn(); this.props.columns.forEach(function (column, i) { var CellRenderer = _this.props.cellRenderer; var cell = React.createElement(CellRenderer, { ref: i, key: column.key + '-' + i, idx: i, rowIdx: _this.props.idx, value: _this.getCellValue(column.key || i), column: column, height: _this.getRowHeight(), formatter: column.formatter, cellMetaData: _this.props.cellMetaData, rowData: _this.props.row, selectedColumn: selectedColumn, isRowSelected: _this.props.isSelected }); if (column.locked) { lockedCells.push(cell); } else { cells.push(cell); } }); return cells.concat(lockedCells); }, getRowHeight: function getRowHeight() { var rows = this.props.expandedRows || null; if (rows && this.props.key) { var row = rows[this.props.key] || null; if (row) { return row.height; } } return this.props.height; }, getCellValue: function getCellValue(key) { var val = undefined; if (key === 'select-row') { return this.props.isSelected; } else if (typeof this.props.row.get === 'function') { val = this.props.row.get(key); } else { val = this.props.row[key]; } return val; }, setScrollLeft: function setScrollLeft(scrollLeft) { var _this2 = this; this.props.columns.forEach(function (column, i) { if (column.locked) { if (!_this2.refs[i]) return; _this2.refs[i].setScrollLeft(scrollLeft); } }); }, doesRowContainSelectedCell: function doesRowContainSelectedCell(props) { var selected = props.cellMetaData.selected; if (selected && selected.rowIdx === props.idx) { return true; } return false; }, willRowBeDraggedOver: function willRowBeDraggedOver(props) { var dragged = props.cellMetaData.dragged; return dragged != null && (dragged.rowIdx >= 0 || dragged.complete === true); }, hasRowBeenCopied: function hasRowBeenCopied() { var copied = this.props.cellMetaData.copied; return copied != null && copied.rowIdx === this.props.idx; }, renderCell: function renderCell(props) { if (typeof this.props.cellRenderer === 'function') { this.props.cellRenderer.call(this, props); } if (React.isValidElement(this.props.cellRenderer)) { return React.cloneElement(this.props.cellRenderer, props); } return this.props.cellRenderer(props); }, render: function render() { var className = joinClasses('react-grid-Row', 'react-grid-Row--' + (this.props.idx % 2 === 0 ? 'even' : 'odd'), { 'row-selected': this.props.isSelected }); var style = { height: this.getRowHeight(this.props), overflow: 'hidden' }; var cells = this.getCells(); return React.createElement( 'div', _extends({}, this.props, { className: className, style: style, onDragEnter: this.handleDragEnter }), React.isValidElement(this.props.row) ? this.props.row : cells ); } }); module.exports = Row; /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var joinClasses = __webpack_require__(6); var EditorContainer = __webpack_require__(26); var ExcelColumn = __webpack_require__(15); var isFunction = __webpack_require__(30); var CellMetaDataShape = __webpack_require__(31); var SimpleCellFormatter = __webpack_require__(32); var Cell = React.createClass({ displayName: 'Cell', propTypes: { rowIdx: React.PropTypes.number.isRequired, idx: React.PropTypes.number.isRequired, selected: React.PropTypes.shape({ idx: React.PropTypes.number.isRequired }), selectedColumn: React.PropTypes.object, height: React.PropTypes.number, tabIndex: React.PropTypes.number, ref: React.PropTypes.string, column: React.PropTypes.shape(ExcelColumn).isRequired, value: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number, React.PropTypes.object, React.PropTypes.bool]).isRequired, isExpanded: React.PropTypes.bool, isRowSelected: React.PropTypes.bool, cellMetaData: React.PropTypes.shape(CellMetaDataShape).isRequired, handleDragStart: React.PropTypes.func, className: React.PropTypes.string, cellControls: React.PropTypes.any, rowData: React.PropTypes.object.isRequired }, getDefaultProps: function getDefaultProps() { return { tabIndex: -1, ref: 'cell', isExpanded: false }; }, getInitialState: function getInitialState() { return { isRowChanging: false, isCellValueChanging: false }; }, componentDidMount: function componentDidMount() { this.checkFocus(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { this.setState({ isRowChanging: this.props.rowData !== nextProps.rowData, isCellValueChanging: this.props.value !== nextProps.value }); }, componentDidUpdate: function componentDidUpdate() { this.checkFocus(); var dragged = this.props.cellMetaData.dragged; if (dragged && dragged.complete === true) { this.props.cellMetaData.handleTerminateDrag(); } if (this.state.isRowChanging && this.props.selectedColumn != null) { this.applyUpdateClass(); } }, shouldComponentUpdate: function shouldComponentUpdate(nextProps) { return this.props.column.width !== nextProps.column.width || this.props.column.left !== nextProps.column.left || this.props.rowData !== nextProps.rowData || this.props.height !== nextProps.height || this.props.rowIdx !== nextProps.rowIdx || this.isCellSelectionChanging(nextProps) || this.isDraggedCellChanging(nextProps) || this.isCopyCellChanging(nextProps) || this.props.isRowSelected !== nextProps.isRowSelected || this.isSelected(); }, onCellClick: function onCellClick() { var meta = this.props.cellMetaData; if (meta != null && meta.onCellClick != null) { meta.onCellClick({ rowIdx: this.props.rowIdx, idx: this.props.idx }); } }, onCellDoubleClick: function onCellDoubleClick() { var meta = this.props.cellMetaData; if (meta != null && meta.onCellDoubleClick != null) { meta.onCellDoubleClick({ rowIdx: this.props.rowIdx, idx: this.props.idx }); } }, onDragHandleDoubleClick: function onDragHandleDoubleClick(e) { e.stopPropagation(); var meta = this.props.cellMetaData; if (meta != null && meta.onCellDoubleClick != null) { meta.onDragHandleDoubleClick({ rowIdx: this.props.rowIdx, idx: this.props.idx, rowData: this.getRowData() }); } }, onDragOver: function onDragOver(e) { e.preventDefault(); }, getStyle: function getStyle() { var style = { position: 'absolute', width: this.props.column.width, height: this.props.height, left: this.props.column.left }; return style; }, getFormatter: function getFormatter() { var col = this.props.column; if (this.isActive()) { return React.createElement(EditorContainer, { rowData: this.getRowData(), rowIdx: this.props.rowIdx, idx: this.props.idx, cellMetaData: this.props.cellMetaData, column: col, height: this.props.height }); } return this.props.column.formatter; }, getRowData: function getRowData() { return this.props.rowData.toJSON ? this.props.rowData.toJSON() : this.props.rowData; }, getFormatterDependencies: function getFormatterDependencies() { // convention based method to get corresponding Id or Name of any Name or Id property if (typeof this.props.column.getRowMetaData === 'function') { return this.props.column.getRowMetaData(this.getRowData(), this.props.column); } }, getCellClass: function getCellClass() { var className = joinClasses(this.props.column.cellClass, 'react-grid-Cell', this.props.className, this.props.column.locked ? 'react-grid-Cell--locked' : null); var extraClasses = joinClasses({ 'row-selected': this.props.isRowSelected, selected: this.isSelected() && !this.isActive(), editing: this.isActive(), copied: this.isCopied() || this.wasDraggedOver() || this.isDraggedOverUpwards() || this.isDraggedOverDownwards(), 'active-drag-cell': this.isSelected() || this.isDraggedOver(), 'is-dragged-over-up': this.isDraggedOverUpwards(), 'is-dragged-over-down': this.isDraggedOverDownwards(), 'was-dragged-over': this.wasDraggedOver() }); return joinClasses(className, extraClasses); }, getUpdateCellClass: function getUpdateCellClass() { return this.props.column.getUpdateCellClass ? this.props.column.getUpdateCellClass(this.props.selectedColumn, this.props.column, this.state.isCellValueChanging) : ''; }, isColumnSelected: function isColumnSelected() { var meta = this.props.cellMetaData; if (meta == null || meta.selected == null) { return false; } return meta.selected && meta.selected.idx === this.props.idx; }, isSelected: function isSelected() { var meta = this.props.cellMetaData; if (meta == null || meta.selected == null) { return false; } return meta.selected && meta.selected.rowIdx === this.props.rowIdx && meta.selected.idx === this.props.idx; }, isActive: function isActive() { var meta = this.props.cellMetaData; if (meta == null || meta.selected == null) { return false; } return this.isSelected() && meta.selected.active === true; }, isCellSelectionChanging: function isCellSelectionChanging(nextProps) { var meta = this.props.cellMetaData; if (meta == null || meta.selected == null) { return false; } var nextSelected = nextProps.cellMetaData.selected; if (meta.selected && nextSelected) { return this.props.idx === nextSelected.idx || this.props.idx === meta.selected.idx; } return true; }, applyUpdateClass: function applyUpdateClass() { var updateCellClass = this.getUpdateCellClass(); // -> removing the class if (updateCellClass != null && updateCellClass !== '') { var cellDOMNode = ReactDOM.findDOMNode(this); if (cellDOMNode.classList) { cellDOMNode.classList.remove(updateCellClass); // -> and re-adding the class cellDOMNode.classList.add(updateCellClass); } else if (cellDOMNode.className.indexOf(updateCellClass) === -1) { // IE9 doesn't support classList, nor (I think) altering element.className // without replacing it wholesale. cellDOMNode.className = cellDOMNode.className + ' ' + updateCellClass; } } }, setScrollLeft: function setScrollLeft(scrollLeft) { var ctrl = this; // flow on windows has an outdated react declaration, once that gets updated, we can remove this if (ctrl.isMounted()) { var node = ReactDOM.findDOMNode(this); var transform = 'translate3d(' + scrollLeft + 'px, 0px, 0px)'; node.style.webkitTransform = transform; node.style.transform = transform; } }, isCopied: function isCopied() { var copied = this.props.cellMetaData.copied; return copied && copied.rowIdx === this.props.rowIdx && copied.idx === this.props.idx; }, isDraggedOver: function isDraggedOver() { var dragged = this.props.cellMetaData.dragged; return dragged && dragged.overRowIdx === this.props.rowIdx && dragged.idx === this.props.idx; }, wasDraggedOver: function wasDraggedOver() { var dragged = this.props.cellMetaData.dragged; return dragged && (dragged.overRowIdx < this.props.rowIdx && this.props.rowIdx < dragged.rowIdx || dragged.overRowIdx > this.props.rowIdx && this.props.rowIdx > dragged.rowIdx) && dragged.idx === this.props.idx; }, isDraggedCellChanging: function isDraggedCellChanging(nextProps) { var isChanging = undefined; var dragged = this.props.cellMetaData.dragged; var nextDragged = nextProps.cellMetaData.dragged; if (dragged) { isChanging = nextDragged && this.props.idx === nextDragged.idx || dragged && this.props.idx === dragged.idx; return isChanging; } return false; }, isCopyCellChanging: function isCopyCellChanging(nextProps) { var isChanging = undefined; var copied = this.props.cellMetaData.copied; var nextCopied = nextProps.cellMetaData.copied; if (copied) { isChanging = nextCopied && this.props.idx === nextCopied.idx || copied && this.props.idx === copied.idx; return isChanging; } return false; }, isDraggedOverUpwards: function isDraggedOverUpwards() { var dragged = this.props.cellMetaData.dragged; return !this.isSelected() && this.isDraggedOver() && this.props.rowIdx < dragged.rowIdx; }, isDraggedOverDownwards: function isDraggedOverDownwards() { var dragged = this.props.cellMetaData.dragged; return !this.isSelected() && this.isDraggedOver() && this.props.rowIdx > dragged.rowIdx; }, checkFocus: function checkFocus() { if (this.isSelected() && !this.isActive()) { // determine the parent viewport element of this cell var parentViewport = ReactDOM.findDOMNode(this); while (parentViewport != null && parentViewport.className.indexOf('react-grid-Viewport') === -1) { parentViewport = parentViewport.parentElement; } var focusInGrid = false; // if the focus is on the body of the document, the user won't mind if we focus them on a cell if (document.activeElement == null || document.activeElement.nodeName && typeof document.activeElement.nodeName === 'string' && document.activeElement.nodeName.toLowerCase() === 'body') { focusInGrid = true; // otherwise } else { // only pull focus if the currently focused element is contained within the viewport if (parentViewport) { var focusedParent = document.activeElement; while (focusedParent != null) { if (focusedParent === parentViewport) { focusInGrid = true; break; } focusedParent = focusedParent.parentElement; } } } if (focusInGrid) { ReactDOM.findDOMNode(this).focus(); } } }, canEdit: function canEdit() { return this.props.column.editor != null || this.props.column.editable; }, renderCellContent: function renderCellContent(props) { var CellContent = undefined; var Formatter = this.getFormatter(); if (React.isValidElement(Formatter)) { props.dependentValues = this.getFormatterDependencies(); CellContent = React.cloneElement(Formatter, props); } else if (isFunction(Formatter)) { CellContent = React.createElement(Formatter, { value: this.props.value, dependentValues: this.getFormatterDependencies() }); } else { CellContent = React.createElement(SimpleCellFormatter, { value: this.props.value }); } return React.createElement( 'div', { ref: 'cell', className: 'react-grid-Cell__value' }, CellContent, ' ', this.props.cellControls ); }, render: function render() { var style = this.getStyle(); var className = this.getCellClass(); var cellContent = this.renderCellContent({ value: this.props.value, column: this.props.column, rowIdx: this.props.rowIdx, isExpanded: this.props.isExpanded }); var dragHandle = !this.isActive() && this.canEdit() ? React.createElement( 'div', { className: 'drag-handle', draggable: 'true', onDoubleClick: this.onDragHandleDoubleClick }, React.createElement('span', { style: { display: 'none' } }) ) : null; return React.createElement( 'div', _extends({}, this.props, { className: className, style: style, onClick: this.onCellClick, onDoubleClick: this.onCellDoubleClick, onDragOver: this.onDragOver }), cellContent, dragHandle ); } }); module.exports = Cell; /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var joinClasses = __webpack_require__(6); var keyboardHandlerMixin = __webpack_require__(27); var SimpleTextEditor = __webpack_require__(28); var isFunction = __webpack_require__(30); var EditorContainer = React.createClass({ displayName: 'EditorContainer', mixins: [keyboardHandlerMixin], propTypes: { rowIdx: React.PropTypes.number, rowData: React.PropTypes.object.isRequired, value: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number, React.PropTypes.object, React.PropTypes.bool]).isRequired, cellMetaData: React.PropTypes.shape({ selected: React.PropTypes.object.isRequired, copied: React.PropTypes.object, dragged: React.PropTypes.object, onCellClick: React.PropTypes.func, onCellDoubleClick: React.PropTypes.func, onCommitCancel: React.PropTypes.func, onCommit: React.PropTypes.func }).isRequired, column: React.PropTypes.object.isRequired, height: React.PropTypes.number.isRequired }, changeCommitted: false, getInitialState: function getInitialState() { return { isInvalid: false }; }, componentDidMount: function componentDidMount() { var inputNode = this.getInputNode(); if (inputNode !== undefined) { this.setTextInputFocus(); if (!this.getEditor().disableContainerStyles) { inputNode.className += ' editor-main'; inputNode.style.height = this.props.height - 1 + 'px'; } } }, componentWillUnmount: function componentWillUnmount() { if (!this.changeCommitted && !this.hasEscapeBeenPressed()) { this.commit({ key: 'Enter' }); } }, createEditor: function createEditor() { var _this = this; var editorRef = function editorRef(c) { return _this.editor = c; }; var editorProps = { ref: editorRef, column: this.props.column, value: this.getInitialValue(), onCommit: this.commit, rowMetaData: this.getRowMetaData(), height: this.props.height, onBlur: this.commit, onOverrideKeyDown: this.onKeyDown }; var customEditor = this.props.column.editor; if (customEditor && React.isValidElement(customEditor)) { // return custom column editor or SimpleEditor if none specified return React.cloneElement(customEditor, editorProps); } return React.createElement(SimpleTextEditor, { ref: editorRef, column: this.props.column, value: this.getInitialValue(), onBlur: this.commit, rowMetaData: this.getRowMetaData(), onKeyDown: function onKeyDown() {}, commit: function commit() {} }); }, onPressEnter: function onPressEnter() { this.commit({ key: 'Enter' }); }, onPressTab: function onPressTab() { this.commit({ key: 'Tab' }); }, onPressEscape: function onPressEscape(e) { if (!this.editorIsSelectOpen()) { this.props.cellMetaData.onCommitCancel(); } else { // prevent event from bubbling if editor has results to select e.stopPropagation(); } }, onPressArrowDown: function onPressArrowDown(e) { if (this.editorHasResults()) { // dont want to propogate as that then moves us round the grid e.stopPropagation(); } else { this.commit(e); } }, onPressArrowUp: function onPressArrowUp(e) { if (this.editorHasResults()) { // dont want to propogate as that then moves us round the grid e.stopPropagation(); } else { this.commit(e); } }, onPressArrowLeft: function onPressArrowLeft(e) { // prevent event propogation. this disables left cell navigation if (!this.isCaretAtBeginningOfInput()) { e.stopPropagation(); } else { this.commit(e); } }, onPressArrowRight: function onPressArrowRight(e) { // prevent event propogation. this disables right cell navigation if (!this.isCaretAtEndOfInput()) { e.stopPropagation(); } else { this.commit(e); } }, editorHasResults: function editorHasResults() { if (isFunction(this.getEditor().hasResults)) { return this.getEditor().hasResults(); } return false; }, editorIsSelectOpen: function editorIsSelectOpen() { if (isFunction(this.getEditor().isSelectOpen)) { return this.getEditor().isSelectOpen(); } return false; }, getRowMetaData: function getRowMetaData() { // clone row data so editor cannot actually change this // convention based method to get corresponding Id or Name of any Name or Id property if (typeof this.props.column.getRowMetaData === 'function') { return this.props.column.getRowMetaData(this.props.rowData, this.props.column); } }, getEditor: function getEditor() { return this.editor; }, getInputNode: function getInputNode() { return this.getEditor().getInputNode(); }, getInitialValue: function getInitialValue() { var selected = this.props.cellMetaData.selected; var keyCode = selected.initialKeyCode; if (keyCode === 'Delete' || keyCode === 'Backspace') { return ''; } else if (keyCode === 'Enter') { return this.props.value; } var text = keyCode ? String.fromCharCode(keyCode) : this.props.value; return text; }, getContainerClass: function getContainerClass() { return joinClasses({ 'has-error': this.state.isInvalid === true }); }, commit: function commit(args) { var opts = args || {}; var updated = this.getEditor().getValue(); if (this.isNewValueValid(updated)) { this.changeCommitted = true; var cellKey = this.props.column.key; this.props.cellMetaData.onCommit({ cellKey: cellKey, rowIdx: this.props.rowIdx, updated: updated, key: opts.key }); } }, isNewValueValid: function isNewValueValid(value) { if (isFunction(this.getEditor().validate)) { var isValid = this.getEditor().validate(value); this.setState({ isInvalid: !isValid }); return isValid; } return true; }, setCaretAtEndOfInput: function setCaretAtEndOfInput() { var input = this.getInputNode(); // taken from http://stackoverflow.com/questions/511088/use-javascript-to-place-cursor-at-end-of-text-in-text-input-element var txtLength = input.value.length; if (input.setSelectionRange) { input.setSelectionRange(txtLength, txtLength); } else if (input.createTextRange) { var fieldRange = input.createTextRange(); fieldRange.moveStart('character', txtLength); fieldRange.collapse(); fieldRange.select(); } }, isCaretAtBeginningOfInput: function isCaretAtBeginningOfInput() { var inputNode = this.getInputNode(); return inputNode.selectionStart === inputNode.selectionEnd && inputNode.selectionStart === 0; }, isCaretAtEndOfInput: function isCaretAtEndOfInput() { var inputNode = this.getInputNode(); return inputNode.selectionStart === inputNode.value.length; }, setTextInputFocus: function setTextInputFocus() { var selected = this.props.cellMetaData.selected; var keyCode = selected.initialKeyCode; var inputNode = this.getInputNode(); inputNode.focus(); if (inputNode.tagName === 'INPUT') { if (!this.isKeyPrintable(keyCode)) { inputNode.focus(); inputNode.select(); } else { inputNode.select(); } } }, hasEscapeBeenPressed: function hasEscapeBeenPressed() { var pressed = false; var escapeKey = 27; if (window.event) { if (window.event.keyCode === escapeKey) { pressed = true; } else if (window.event.which === escapeKey) { pressed = true; } } return pressed; }, renderStatusIcon: function renderStatusIcon() { if (this.state.isInvalid === true) { return React.createElement('span', { className: 'glyphicon glyphicon-remove form-control-feedback' }); } }, render: function render() { return React.createElement( 'div', { className: this.getContainerClass(), onKeyDown: this.onKeyDown, commit: this.commit }, this.createEditor(), this.renderStatusIcon() ); } }); module.exports = EditorContainer; /***/ }, /* 27 */ /***/ function(module, exports) { 'use strict'; var KeyboardHandlerMixin = { onKeyDown: function onKeyDown(e) { if (this.isCtrlKeyHeldDown(e)) { this.checkAndCall('onPressKeyWithCtrl', e); } else if (this.isKeyExplicitlyHandled(e.key)) { // break up individual keyPress events to have their own specific callbacks // this allows multiple mixins to listen to onKeyDown events and somewhat reduces methodName clashing var callBack = 'onPress' + e.key; this.checkAndCall(callBack, e); } else if (this.isKeyPrintable(e.keyCode)) { this.checkAndCall('onPressChar', e); } }, // taken from http://stackoverflow.com/questions/12467240/determine-if-javascript-e-keycode-is-a-printable-non-control-character isKeyPrintable: function isKeyPrintable(keycode) { var valid = keycode > 47 && keycode < 58 || // number keys keycode === 32 || keycode === 13 || // spacebar & return key(s) (if you want to allow carriage returns) keycode > 64 && keycode < 91 || // letter keys keycode > 95 && keycode < 112 || // numpad keys keycode > 185 && keycode < 193 || // ;=,-./` (in order) keycode > 218 && keycode < 223; // [\]' (in order) return valid; }, isKeyExplicitlyHandled: function isKeyExplicitlyHandled(key) { return typeof this['onPress' + key] === 'function'; }, isCtrlKeyHeldDown: function isCtrlKeyHeldDown(e) { return e.ctrlKey === true && e.key !== 'Control'; }, checkAndCall: function checkAndCall(methodName, args) { if (typeof this[methodName] === 'function') { this[methodName](args); } } }; module.exports = KeyboardHandlerMixin; /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var React = __webpack_require__(2); var EditorBase = __webpack_require__(29); var SimpleTextEditor = function (_EditorBase) { _inherits(SimpleTextEditor, _EditorBase); function SimpleTextEditor() { _classCallCheck(this, SimpleTextEditor); return _possibleConstructorReturn(this, Object.getPrototypeOf(SimpleTextEditor).apply(this, arguments)); } _createClass(SimpleTextEditor, [{ key: 'render', value: function render() { return React.createElement('input', { ref: 'input', type: 'text', onBlur: this.props.onBlur, className: 'form-control', defaultValue: this.props.value }); } }]); return SimpleTextEditor; }(EditorBase); module.exports = SimpleTextEditor; /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; 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; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var ExcelColumn = __webpack_require__(15); var EditorBase = function (_React$Component) { _inherits(EditorBase, _React$Component); function EditorBase() { _classCallCheck(this, EditorBase); return _possibleConstructorReturn(this, Object.getPrototypeOf(EditorBase).apply(this, arguments)); } _createClass(EditorBase, [{ key: 'getStyle', value: function getStyle() { return { width: '100%' }; } }, { key: 'getValue', value: function getValue() { var updated = {}; updated[this.props.column.key] = this.getInputNode().value; return updated; } }, { key: 'getInputNode', value: function getInputNode() { var domNode = ReactDOM.findDOMNode(this); if (domNode.tagName === 'INPUT') { return domNode; } return domNode.querySelector('input:not([type=hidden])'); } }, { key: 'inheritContainerStyles', value: function inheritContainerStyles() { return true; } }]); return EditorBase; }(React.Component); EditorBase.propTypes = { onKeyDown: React.PropTypes.func.isRequired, value: React.PropTypes.any.isRequired, onBlur: React.PropTypes.func.isRequired, column: React.PropTypes.shape(ExcelColumn).isRequired, commit: React.PropTypes.func.isRequired }; module.exports = EditorBase; /***/ }, /* 30 */ /***/ function(module, exports) { 'use strict'; var isFunction = function isFunction(functionToCheck) { var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; }; module.exports = isFunction; /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var PropTypes = __webpack_require__(2).PropTypes; module.exports = { selected: PropTypes.object.isRequired, copied: PropTypes.object, dragged: PropTypes.object, onCellClick: PropTypes.func.isRequired, onCellDoubleClick: PropTypes.func.isRequired, onCommit: PropTypes.func.isRequired, onCommitCancel: PropTypes.func.isRequired, handleDragEnterRow: PropTypes.func.isRequired, handleTerminateDrag: PropTypes.func.isRequired }; /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var SimpleCellFormatter = React.createClass({ displayName: 'SimpleCellFormatter', propTypes: { value: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number, React.PropTypes.object, React.PropTypes.bool]).isRequired }, shouldComponentUpdate: function shouldComponentUpdate(nextProps) { return nextProps.value !== this.props.value; }, render: function render() { return React.createElement( 'div', { title: this.props.value }, this.props.value ); } }); module.exports = SimpleCellFormatter; /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var ReactDOM = __webpack_require__(3); var DOMMetrics = __webpack_require__(34); var min = Math.min; var max = Math.max; var floor = Math.floor; var ceil = Math.ceil; module.exports = { mixins: [DOMMetrics.MetricsMixin], DOMMetrics: { viewportHeight: function viewportHeight() { return ReactDOM.findDOMNode(this).offsetHeight; } }, propTypes: { rowHeight: React.PropTypes.number, rowsCount: React.PropTypes.number.isRequired }, getDefaultProps: function getDefaultProps() { return { rowHeight: 30 }; }, getInitialState: function getInitialState() { return this.getGridState(this.props); }, getGridState: function getGridState(props) { var renderedRowsCount = ceil((props.minHeight - props.rowHeight) / props.rowHeight); var totalRowCount = min(renderedRowsCount * 2, props.rowsCount); return { displayStart: 0, displayEnd: totalRowCount, height: props.minHeight, scrollTop: 0, scrollLeft: 0 }; }, updateScroll: function updateScroll(scrollTop, scrollLeft, height, rowHeight, length) { var renderedRowsCount = ceil(height / rowHeight); var visibleStart = floor(scrollTop / rowHeight); var visibleEnd = min(visibleStart + renderedRowsCount, length); var displayStart = max(0, visibleStart - renderedRowsCount * 2); var displayEnd = min(visibleStart + renderedRowsCount * 2, length); var nextScrollState = { visibleStart: visibleStart, visibleEnd: visibleEnd, displayStart: displayStart, displayEnd: displayEnd, height: height, scrollTop: scrollTop, scrollLeft: scrollLeft }; this.setState(nextScrollState); }, metricsUpdated: function metricsUpdated() { var height = this.DOMMetrics.viewportHeight(); if (height) { this.updateScroll(this.state.scrollTop, this.state.scrollLeft, height, this.props.rowHeight, this.props.rowsCount); } }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (this.props.rowHeight !== nextProps.rowHeight || this.props.minHeight !== nextProps.minHeight) { this.setState(this.getGridState(nextProps)); } else if (this.props.rowsCount !== nextProps.rowsCount) { this.updateScroll(this.state.scrollTop, this.state.scrollLeft, this.state.height, nextProps.rowHeight, nextProps.rowsCount); } } }; /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var shallowCloneObject = __webpack_require__(7); var contextTypes = { metricsComputator: React.PropTypes.object }; var MetricsComputatorMixin = { childContextTypes: contextTypes, getChildContext: function getChildContext() { return { metricsComputator: this }; }, getMetricImpl: function getMetricImpl(name) { return this._DOMMetrics.metrics[name].value; }, registerMetricsImpl: function registerMetricsImpl(component, metrics) { var getters = {}; var s = this._DOMMetrics; for (var name in metrics) { if (s.metrics[name] !== undefined) { throw new Error('DOM metric ' + name + ' is already defined'); } s.metrics[name] = { component: component, computator: metrics[name].bind(component) }; getters[name] = this.getMetricImpl.bind(null, name); } if (s.components.indexOf(component) === -1) { s.components.push(component); } return getters; }, unregisterMetricsFor: function unregisterMetricsFor(component) { var s = this._DOMMetrics; var idx = s.components.indexOf(component); if (idx > -1) { s.components.splice(idx, 1); var name = undefined; var metricsToDelete = {}; for (name in s.metrics) { if (s.metrics[name].component === component) { metricsToDelete[name] = true; } } for (name in metricsToDelete) { if (metricsToDelete.hasOwnProperty(name)) { delete s.metrics[name]; } } } }, updateMetrics: function updateMetrics() { var s = this._DOMMetrics; var needUpdate = false; for (var name in s.metrics) { if (!s.metrics.hasOwnProperty(name)) continue; var newMetric = s.metrics[name].computator(); if (newMetric !== s.metrics[name].value) { needUpdate = true; } s.metrics[name].value = newMetric; } if (needUpdate) { for (var i = 0, len = s.components.length; i < len; i++) { if (s.components[i].metricsUpdated) { s.components[i].metricsUpdated(); } } } }, componentWillMount: function componentWillMount() { this._DOMMetrics = { metrics: {}, components: [] }; }, componentDidMount: function componentDidMount() { if (window.addEventListener) { window.addEventListener('resize', this.updateMetrics); } else { window.attachEvent('resize', this.updateMetrics); } this.updateMetrics(); }, componentWillUnmount: function componentWillUnmount() { window.removeEventListener('resize', this.updateMetrics); } }; var MetricsMixin = { contextTypes: contextTypes, componentWillMount: function componentWillMount() { if (this.DOMMetrics) { this._DOMMetricsDefs = shallowCloneObject(this.DOMMetrics); this.DOMMetrics = {}; for (var name in this._DOMMetricsDefs) { if (!this._DOMMetricsDefs.hasOwnProperty(name)) continue; this.DOMMetrics[name] = function () {}; } } }, componentDidMount: function componentDidMount() { if (this.DOMMetrics) { this.DOMMetrics = this.registerMetrics(this._DOMMetricsDefs); } }, componentWillUnmount: function componentWillUnmount() { if (!this.registerMetricsImpl) { return this.context.metricsComputator.unregisterMetricsFor(this); } if (this.hasOwnProperty('DOMMetrics')) { delete this.DOMMetrics; } }, registerMetrics: function registerMetrics(metrics) { if (this.registerMetricsImpl) { return this.registerMetricsImpl(this, metrics); } return this.context.metricsComputator.registerMetricsImpl(this, metrics); }, getMetric: function getMetric(name) { if (this.getMetricImpl) { return this.getMetricImpl(name); } return this.context.metricsComputator.getMetricImpl(name); } }; module.exports = { MetricsComputatorMixin: MetricsComputatorMixin, MetricsMixin: MetricsMixin }; /***/ }, /* 35 */ /***/ function(module, exports) { "use strict"; module.exports = { componentDidMount: function componentDidMount() { this._scrollLeft = this.refs.viewport ? this.refs.viewport.getScroll().scrollLeft : 0; this._onScroll(); }, componentDidUpdate: function componentDidUpdate() { this._onScroll(); }, componentWillMount: function componentWillMount() { this._scrollLeft = undefined; }, componentWillUnmount: function componentWillUnmount() { this._scrollLeft = undefined; }, onScroll: function onScroll(props) { if (this._scrollLeft !== props.scrollLeft) { this._scrollLeft = props.scrollLeft; this._onScroll(); } }, _onScroll: function _onScroll() { if (this._scrollLeft !== undefined) { this.refs.header.setScrollLeft(this._scrollLeft); if (this.refs.viewport) { this.refs.viewport.setScrollLeft(this._scrollLeft); } } } }; /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var CheckboxEditor = React.createClass({ displayName: 'CheckboxEditor', propTypes: { value: React.PropTypes.bool, rowIdx: React.PropTypes.number, column: React.PropTypes.shape({ key: React.PropTypes.string, onCellChange: React.PropTypes.func }), dependentValues: React.PropTypes.object }, handleChange: function handleChange(e) { this.props.column.onCellChange(this.props.rowIdx, this.props.column.key, this.props.dependentValues, e); }, render: function render() { var checked = this.props.value != null ? this.props.value : false; var checkboxName = 'checkbox' + this.props.rowIdx; return React.createElement( 'div', { className: 'react-grid-checkbox-container', onClick: this.handleChange }, React.createElement('input', { className: 'react-grid-checkbox', type: 'checkbox', name: checkboxName, checked: checked }), React.createElement('label', { htmlFor: checkboxName, className: 'react-grid-checkbox-label' }) ); } }); module.exports = CheckboxEditor; /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _reactDom = __webpack_require__(3); var _reactDom2 = _interopRequireDefault(_reactDom); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var ColumnMetrics = __webpack_require__(8); var DOMMetrics = __webpack_require__(34); Object.assign = __webpack_require__(38); var PropTypes = __webpack_require__(2).PropTypes; var ColumnUtils = __webpack_require__(10); var Column = function Column() { _classCallCheck(this, Column); }; module.exports = { mixins: [DOMMetrics.MetricsMixin], propTypes: { columns: PropTypes.arrayOf(Column), minColumnWidth: PropTypes.number, columnEquality: PropTypes.func }, DOMMetrics: { gridWidth: function gridWidth() { return _reactDom2.default.findDOMNode(this).parentElement.offsetWidth; } }, getDefaultProps: function getDefaultProps() { return { minColumnWidth: 80, columnEquality: ColumnMetrics.sameColumn }; }, componentWillMount: function componentWillMount() { this._mounted = true; }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (nextProps.columns) { if (!ColumnMetrics.sameColumns(this.props.columns, nextProps.columns, this.props.columnEquality) || nextProps.minWidth !== this.props.minWidth) { var columnMetrics = this.createColumnMetrics(nextProps); this.setState({ columnMetrics: columnMetrics }); } } }, getTotalWidth: function getTotalWidth() { var totalWidth = 0; if (this._mounted) { totalWidth = this.DOMMetrics.gridWidth(); } else { totalWidth = ColumnUtils.getSize(this.props.columns) * this.props.minColumnWidth; } return totalWidth; }, getColumnMetricsType: function getColumnMetricsType(metrics) { var totalWidth = metrics.totalWidth || this.getTotalWidth(); var currentMetrics = { columns: metrics.columns, totalWidth: totalWidth, minColumnWidth: metrics.minColumnWidth }; var updatedMetrics = ColumnMetrics.recalculate(currentMetrics); return updatedMetrics; }, getColumn: function getColumn(idx) { var columns = this.state.columnMetrics.columns; if (Array.isArray(columns)) { return columns[idx]; } else if (typeof Immutable !== 'undefined') { return columns.get(idx); } }, getSize: function getSize() { var columns = this.state.columnMetrics.columns; if (Array.isArray(columns)) { return columns.length; } else if (typeof Immutable !== 'undefined') { return columns.size; } }, metricsUpdated: function metricsUpdated() { var columnMetrics = this.createColumnMetrics(); this.setState({ columnMetrics: columnMetrics }); }, createColumnMetrics: function createColumnMetrics() { var props = arguments.length <= 0 || arguments[0] === undefined ? this.props : arguments[0]; var gridColumns = this.setupGridColumns(props); return this.getColumnMetricsType({ columns: gridColumns, minColumnWidth: this.props.minColumnWidth, totalWidth: props.minWidth }); }, onColumnResize: function onColumnResize(index, width) { var columnMetrics = ColumnMetrics.resizeColumn(this.state.columnMetrics, index, width); this.setState({ columnMetrics: columnMetrics }); } }; /***/ }, /* 38 */ /***/ function(module, exports) { 'use strict'; function ToObject(val) { if (val == null) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } 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 = Object.keys(Object(from)); for (var i = 0; i < keys.length; i++) { to[keys[i]] = from[keys[i]]; } } return to; }; /***/ }, /* 39 */ /***/ function(module, exports) { 'use strict'; var RowUtils = { get: function get(row, property) { if (typeof row.get === 'function') { return row.get(property); } return row[property]; } }; module.exports = RowUtils; /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var Editors = { AutoComplete: __webpack_require__(41), DropDownEditor: __webpack_require__(43), SimpleTextEditor: __webpack_require__(28), CheckboxEditor: __webpack_require__(36) }; module.exports = Editors; /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var ReactAutocomplete = __webpack_require__(42); var ExcelColumn = __webpack_require__(15); var optionPropType = React.PropTypes.shape({ id: React.PropTypes.required, title: React.PropTypes.string }); var AutoCompleteEditor = React.createClass({ displayName: 'AutoCompleteEditor', propTypes: { onCommit: React.PropTypes.func, options: React.PropTypes.arrayOf(optionPropType), label: React.PropTypes.any, value: React.PropTypes.any, height: React.PropTypes.number, valueParams: React.PropTypes.arrayOf(React.PropTypes.string), column: React.PropTypes.shape(ExcelColumn), resultIdentifier: React.PropTypes.string, search: React.PropTypes.string, onKeyDown: React.PropTypes.func }, getDefaultProps: function getDefaultProps() { return { resultIdentifier: 'id' }; }, handleChange: function handleChange() { this.props.onCommit(); }, getValue: function getValue() { var value = undefined; var updated = {}; if (this.hasResults() && this.isFocusedOnSuggestion()) { value = this.getLabel(this.refs.autoComplete.state.focusedValue); if (this.props.valueParams) { value = this.constuctValueFromParams(this.refs.autoComplete.state.focusedValue, this.props.valueParams); } } else { value = this.refs.autoComplete.state.searchTerm; } updated[this.props.column.key] = value; return updated; }, getInputNode: function getInputNode() { return ReactDOM.findDOMNode(this).getElementsByTagName('input')[0]; }, getLabel: function getLabel(item) { var label = this.props.label != null ? this.props.label : 'title'; if (typeof label === 'function') { return label(item); } else if (typeof label === 'string') { return item[label]; } }, hasResults: function hasResults() { return this.refs.autoComplete.state.results.length > 0; }, isFocusedOnSuggestion: function isFocusedOnSuggestion() { var autoComplete = this.refs.autoComplete; return autoComplete.state.focusedValue != null; }, constuctValueFromParams: function constuctValueFromParams(obj, props) { if (!props) { return ''; } var ret = []; for (var i = 0, ii = props.length; i < ii; i++) { ret.push(obj[props[i]]); } return ret.join('|'); }, render: function render() { var label = this.props.label != null ? this.props.label : 'title'; return React.createElement( 'div', { height: this.props.height, onKeyDown: this.props.onKeyDown }, React.createElement(ReactAutocomplete, { search: this.props.search, ref: 'autoComplete', label: label, onChange: this.handleChange, resultIdentifier: this.props.resultIdentifier, options: this.props.options, value: { title: this.props.value } }) ); } }); module.exports = AutoCompleteEditor; /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { (function webpackUniversalModuleDefinition(root, factory) { if(true) module.exports = factory(__webpack_require__(2)); else if(typeof define === 'function' && define.amd) define(["react"], factory); else if(typeof exports === 'object') exports["ReactAutocomplete"] = factory(require("react")); else root["ReactAutocomplete"] = factory(root["React"]); })(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { return /******/ (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"; var React = __webpack_require__(1); var joinClasses = __webpack_require__(2); var Autocomplete = React.createClass({ displayName: "Autocomplete", propTypes: { options: React.PropTypes.any, search: React.PropTypes.func, resultRenderer: React.PropTypes.oneOfType([React.PropTypes.component, React.PropTypes.func]), value: React.PropTypes.object, onChange: React.PropTypes.func, onError: React.PropTypes.func }, getDefaultProps: function () { return { search: searchArray }; }, getInitialState: function () { var searchTerm = this.props.searchTerm ? this.props.searchTerm : this.props.value ? this.props.value.title : ""; return { results: [], showResults: false, showResultsInProgress: false, searchTerm: searchTerm, focusedValue: null }; }, getResultIdentifier: function (result) { if (this.props.resultIdentifier === undefined) { return result.id; } else { return result[this.props.resultIdentifier]; } }, render: function () { var className = joinClasses(this.props.className, "react-autocomplete-Autocomplete", this.state.showResults ? "react-autocomplete-Autocomplete--resultsShown" : undefined); var style = { position: "relative", outline: "none" }; return React.createElement("div", { tabIndex: "1", className: className, onFocus: this.onFocus, onBlur: this.onBlur, style: style }, React.createElement("input", { ref: "search", className: "react-autocomplete-Autocomplete__search", style: { width: "100%" }, onClick: this.showAllResults, onChange: this.onQueryChange, onFocus: this.showAllResults, onBlur: this.onQueryBlur, onKeyDown: this.onQueryKeyDown, value: this.state.searchTerm }), React.createElement(Results, { className: "react-autocomplete-Autocomplete__results", onSelect: this.onValueChange, onFocus: this.onValueFocus, results: this.state.results, focusedValue: this.state.focusedValue, show: this.state.showResults, renderer: this.props.resultRenderer, label: this.props.label, resultIdentifier: this.props.resultIdentifier })); }, componentWillReceiveProps: function (nextProps) { var searchTerm = nextProps.searchTerm ? nextProps.searchTerm : nextProps.value ? nextProps.value.title : ""; this.setState({ searchTerm: searchTerm }); }, componentWillMount: function () { this.blurTimer = null; }, /** * Show results for a search term value. * * This method doesn't update search term value itself. * * @param {Search} searchTerm */ showResults: function (searchTerm) { this.setState({ showResultsInProgress: true }); this.props.search(this.props.options, searchTerm.trim(), this.onSearchComplete); }, showAllResults: function () { if (!this.state.showResultsInProgress && !this.state.showResults) { this.showResults(""); } }, onValueChange: function (value) { var state = { value: value, showResults: false }; if (value) { state.searchTerm = value.title; } this.setState(state); if (this.props.onChange) { this.props.onChange(value); } }, onSearchComplete: function (err, results) { if (err) { if (this.props.onError) { this.props.onError(err); } else { throw err; } } this.setState({ showResultsInProgress: false, showResults: true, results: results }); }, onValueFocus: function (value) { this.setState({ focusedValue: value }); }, onQueryChange: function (e) { var searchTerm = e.target.value; this.setState({ searchTerm: searchTerm, focusedValue: null }); this.showResults(searchTerm); }, onFocus: function () { if (this.blurTimer) { clearTimeout(this.blurTimer); this.blurTimer = null; } this.refs.search.getDOMNode().focus(); }, onBlur: function () { // wrap in setTimeout so we can catch a click on results this.blurTimer = setTimeout((function () { if (this.isMounted()) { this.setState({ showResults: false }); } }).bind(this), 100); }, onQueryKeyDown: function (e) { if (e.key === "Enter") { e.preventDefault(); if (this.state.focusedValue) { this.onValueChange(this.state.focusedValue); } } else if (e.key === "ArrowUp" && this.state.showResults) { e.preventDefault(); var prevIdx = Math.max(this.focusedValueIndex() - 1, 0); this.setState({ focusedValue: this.state.results[prevIdx] }); } else if (e.key === "ArrowDown") { e.preventDefault(); if (this.state.showResults) { var nextIdx = Math.min(this.focusedValueIndex() + (this.state.showResults ? 1 : 0), this.state.results.length - 1); this.setState({ showResults: true, focusedValue: this.state.results[nextIdx] }); } else { this.showAllResults(); } } }, focusedValueIndex: function () { if (!this.state.focusedValue) { return -1; } for (var i = 0, len = this.state.results.length; i < len; i++) { if (this.getResultIdentifier(this.state.results[i]) === this.getResultIdentifier(this.state.focusedValue)) { return i; } } return -1; } }); var Results = React.createClass({ displayName: "Results", getResultIdentifier: function (result) { if (this.props.resultIdentifier === undefined) { if (!result.id) { throw "id property not found on result. You must specify a resultIdentifier and pass as props to autocomplete component"; } return result.id; } else { return result[this.props.resultIdentifier]; } }, render: function () { var style = { display: this.props.show ? "block" : "none", position: "absolute", listStyleType: "none" }; var $__0 = this.props, className = $__0.className, props = (function (source, exclusion) { var rest = {};var hasOwn = Object.prototype.hasOwnProperty;if (source == null) { throw new TypeError(); }for (var key in source) { if (hasOwn.call(source, key) && !hasOwn.call(exclusion, key)) { rest[key] = source[key]; } }return rest; })($__0, { className: 1 }); return React.createElement("ul", React.__spread({}, props, { style: style, className: className + " react-autocomplete-Results" }), this.props.results.map(this.renderResult)); }, renderResult: function (result) { var focused = this.props.focusedValue && this.getResultIdentifier(this.props.focusedValue) === this.getResultIdentifier(result); var Renderer = this.props.renderer || Result; return React.createElement(Renderer, { ref: focused ? "focused" : undefined, key: this.getResultIdentifier(result), result: result, focused: focused, onMouseEnter: this.onMouseEnterResult, onClick: this.props.onSelect, label: this.props.label }); }, componentDidUpdate: function () { this.scrollToFocused(); }, componentDidMount: function () { this.scrollToFocused(); }, componentWillMount: function () { this.ignoreFocus = false; }, scrollToFocused: function () { var focused = this.refs && this.refs.focused; if (focused) { var containerNode = this.getDOMNode(); var scroll = containerNode.scrollTop; var height = containerNode.offsetHeight; var node = focused.getDOMNode(); var top = node.offsetTop; var bottom = top + node.offsetHeight; // we update ignoreFocus to true if we change the scroll position so // the mouseover event triggered because of that won't have an // effect if (top < scroll) { this.ignoreFocus = true; containerNode.scrollTop = top; } else if (bottom - scroll > height) { this.ignoreFocus = true; containerNode.scrollTop = bottom - height; } } }, onMouseEnterResult: function (e, result) { // check if we need to prevent the next onFocus event because it was // probably caused by a mouseover due to scroll position change if (this.ignoreFocus) { this.ignoreFocus = false; } else { // we need to make sure focused node is visible // for some reason mouse events fire on visible nodes due to // box-shadow var containerNode = this.getDOMNode(); var scroll = containerNode.scrollTop; var height = containerNode.offsetHeight; var node = e.target; var top = node.offsetTop; var bottom = top + node.offsetHeight; if (bottom > scroll && top < scroll + height) { this.props.onFocus(result); } } } }); var Result = React.createClass({ displayName: "Result", getDefaultProps: function () { return { label: function (result) { return result.title; } }; }, getLabel: function (result) { if (typeof this.props.label === "function") { return this.props.label(result); } else if (typeof this.props.label === "string") { return result[this.props.label]; } }, render: function () { var className = joinClasses({ "react-autocomplete-Result": true, "react-autocomplete-Result--active": this.props.focused }); return React.createElement("li", { style: { listStyleType: "none" }, className: className, onClick: this.onClick, onMouseEnter: this.onMouseEnter }, React.createElement("a", null, this.getLabel(this.props.result))); }, onClick: function () { this.props.onClick(this.props.result); }, onMouseEnter: function (e) { if (this.props.onMouseEnter) { this.props.onMouseEnter(e, this.props.result); } }, shouldComponentUpdate: function (nextProps) { return nextProps.result.id !== this.props.result.id || nextProps.focused !== this.props.focused; } }); /** * Search options using specified search term treating options as an array * of candidates. * * @param {Array.<Object>} options * @param {String} searchTerm * @param {Callback} cb */ function searchArray(options, searchTerm, cb) { if (!options) { return cb(null, []); } searchTerm = new RegExp(searchTerm, "i"); var results = []; for (var i = 0, len = options.length; i < len; i++) { if (searchTerm.exec(options[i].title)) { results.push(options[i]); } } cb(null, results); } module.exports = Autocomplete; /***/ }, /* 1 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_1__; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2015 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ function classNames() { var classes = ''; var arg; for (var i = 0; i < arguments.length; i++) { arg = arguments[i]; if (!arg) { continue; } if ('string' === typeof arg || 'number' === typeof arg) { classes += ' ' + arg; } else if (Object.prototype.toString.call(arg) === '[object Array]') { classes += ' ' + classNames.apply(null, arg); } else if ('object' === typeof arg) { for (var key in arg) { if (!arg.hasOwnProperty(key) || !arg[key]) { continue; } classes += ' ' + key; } } } return classes.substr(1); } // safely export classNames for node / browserify if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } // safely export classNames for RequireJS if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return classNames; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } /***/ } /******/ ]) }); ; /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _reactDom = __webpack_require__(3); var _reactDom2 = _interopRequireDefault(_reactDom); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var React = __webpack_require__(2); var EditorBase = __webpack_require__(29); var DropDownEditor = function (_EditorBase) { _inherits(DropDownEditor, _EditorBase); function DropDownEditor() { _classCallCheck(this, DropDownEditor); return _possibleConstructorReturn(this, Object.getPrototypeOf(DropDownEditor).apply(this, arguments)); } _createClass(DropDownEditor, [{ key: 'getInputNode', value: function getInputNode() { return _reactDom2.default.findDOMNode(this); } }, { key: 'onClick', value: function onClick() { this.getInputNode().focus(); } }, { key: 'onDoubleClick', value: function onDoubleClick() { this.getInputNode().focus(); } }, { key: 'render', value: function render() { return React.createElement( 'select', { style: this.getStyle(), defaultValue: this.props.value, onBlur: this.props.onBlur, onChange: this.onChange }, this.renderOptions() ); } }, { key: 'renderOptions', value: function renderOptions() { var options = []; this.props.options.forEach(function (name) { if (typeof name === 'string') { options.push(React.createElement( 'option', { key: name, value: name }, name )); } else { options.push(React.createElement( 'option', { key: name.id, value: name.value, title: name.title }, name.value )); } }, this); return options; } }]); return DropDownEditor; }(EditorBase); DropDownEditor.propTypes = { options: React.PropTypes.arrayOf(React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.objectOf({ id: React.PropTypes.string, title: React.PropTypes.string, meta: React.PropTypes.string })])).isRequired }; module.exports = DropDownEditor; /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; // not including this // it currently requires the whole of moment, which we dont want to take as a dependency var ImageFormatter = __webpack_require__(45); var Formatters = { ImageFormatter: ImageFormatter }; module.exports = Formatters; /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var React = __webpack_require__(2); var PendingPool = {}; var ReadyPool = {}; var ImageFormatter = React.createClass({ displayName: 'ImageFormatter', propTypes: { value: React.PropTypes.string.isRequired }, getInitialState: function getInitialState() { return { ready: false }; }, componentWillMount: function componentWillMount() { this._load(this.props.value); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { if (nextProps.value !== this.props.value) { this.setState({ value: null }); this._load(nextProps.value); } }, _load: function _load(src) { var imageSrc = src; if (ReadyPool[imageSrc]) { this.setState({ value: imageSrc }); return; } if (PendingPool[imageSrc]) { PendingPool[imageSrc].push(this._onLoad); return; } PendingPool[imageSrc] = [this._onLoad]; var img = new Image(); img.onload = function () { PendingPool[imageSrc].forEach(function (callback) { callback(imageSrc); }); delete PendingPool[imageSrc]; img.onload = null; imageSrc = undefined; }; img.src = imageSrc; }, _onLoad: function _onLoad(src) { if (this.isMounted() && src === this.props.value) { this.setState({ value: src }); } }, render: function render() { var style = this.state.value ? { backgroundImage: 'url(' + this.state.value + ')' } : undefined; return React.createElement('div', { className: 'react-grid-image', style: style }); } }); module.exports = ImageFormatter; /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(2); var Toolbar = React.createClass({ displayName: "Toolbar", propTypes: { onAddRow: React.PropTypes.func, onToggleFilter: React.PropTypes.func, enableFilter: React.PropTypes.bool, numberOfRows: React.PropTypes.number }, onAddRow: function onAddRow() { if (this.props.onAddRow !== null && this.props.onAddRow instanceof Function) { this.props.onAddRow({ newRowIndex: this.props.numberOfRows }); } }, getDefaultProps: function getDefaultProps() { return { enableAddRow: true }; }, renderAddRowButton: function renderAddRowButton() { if (this.props.onAddRow) { return React.createElement( "button", { type: "button", className: "btn", onClick: this.onAddRow }, "Add Row" ); } }, renderToggleFilterButton: function renderToggleFilterButton() { if (this.props.enableFilter) { return React.createElement( "button", { type: "button", className: "btn", onClick: this.props.onToggleFilter }, "Filter Rows" ); } }, render: function render() { return React.createElement( "div", { className: "react-grid-Toolbar" }, React.createElement( "div", { className: "tools" }, this.renderAddRowButton(), this.renderToggleFilterButton() ) ); } }); module.exports = Toolbar; /***/ } /******/ ]) }); ;
node_modules/react-icons/lib/ti/battery-full.js
bairrada97/festival
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactIconBase = require('react-icon-base'); var _reactIconBase2 = _interopRequireDefault(_reactIconBase); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var TiBatteryFull = function TiBatteryFull(props) { return _react2.default.createElement( _reactIconBase2.default, _extends({ viewBox: '0 0 40 40' }, props), _react2.default.createElement( 'g', null, _react2.default.createElement('path', { d: 'm15 26.7c-0.9 0-1.7-0.8-1.7-1.7v-6.7c0-0.9 0.8-1.6 1.7-1.6s1.7 0.7 1.7 1.6v6.7c0 0.9-0.8 1.7-1.7 1.7z m-5 0c-0.9 0-1.7-0.8-1.7-1.7v-6.7c0-0.9 0.8-1.6 1.7-1.6s1.7 0.7 1.7 1.6v6.7c0 0.9-0.8 1.7-1.7 1.7z m15 0c-0.9 0-1.7-0.8-1.7-1.7v-6.7c0-0.9 0.8-1.6 1.7-1.6s1.7 0.7 1.7 1.6v6.7c0 0.9-0.8 1.7-1.7 1.7z m-5 0c-0.9 0-1.7-0.8-1.7-1.7v-6.7c0-0.9 0.8-1.6 1.7-1.6s1.7 0.7 1.7 1.6v6.7c0 0.9-0.8 1.7-1.7 1.7z m11.7-10c0-2.8-2.3-5-5-5h-18.4c-2.7 0-5 2.2-5 5v10c0 2.7 2.3 5 5 5h18.4c2.7 0 5-2.3 5-5 1.8 0 3.3-1.5 3.3-3.4v-3.3c0-1.8-1.5-3.3-3.3-3.3z m-3.4 10c0 0.9-0.7 1.6-1.6 1.6h-18.4c-0.9 0-1.6-0.7-1.6-1.6v-10c0-1 0.7-1.7 1.6-1.7h18.4c0.9 0 1.6 0.7 1.6 1.7v10z' }) ) ); }; exports.default = TiBatteryFull; module.exports = exports['default'];
ajax/libs/inferno-devtools/1.0.0-beta41/inferno-devtools.js
jdh8/cdnjs
/*! * inferno-devtools v1.0.0-beta41 * (c) 2016 Dominic Gannaway * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('./inferno'), require('./inferno-component')) : typeof define === 'function' && define.amd ? define(['inferno', 'inferno-component'], factory) : (factory(global.Inferno,global.Inferno.Component)); }(this, (function (inferno,Component) { 'use strict'; Component = 'default' in Component ? Component['default'] : Component; // this is MUCH faster than .constructor === Array and instanceof Array // in Node 7 and the later versions of V8, slower in older versions though var isArray = Array.isArray; function isStatefulComponent(o) { return !isUndefined(o.prototype) && !isUndefined(o.prototype.render); } function isStringOrNumber(obj) { return isString(obj) || isNumber(obj); } function isInvalid(obj) { return isNull(obj) || obj === false || isTrue(obj) || isUndefined(obj); } function isString(obj) { return typeof obj === 'string'; } function isNumber(obj) { return typeof obj === 'number'; } function isNull(obj) { return obj === null; } function isTrue(obj) { return obj === true; } function isUndefined(obj) { return obj === undefined; } function isObject(o) { return typeof o === 'object'; } function findVNodeFromDom(vNode, dom) { if (!vNode) { var roots = inferno.options.roots; for (var i = 0; i < roots.length; i++) { var root = roots[i]; var result = findVNodeFromDom(root.input, dom); if (result) { return result; } } } else { if (vNode.dom === dom) { return vNode; } var flags = vNode.flags; var children = vNode.children; if (flags & 28 /* Component */) { children = children._lastInput || children; } if (children) { if (isArray(children)) { for (var i$1 = 0; i$1 < children.length; i$1++) { var child = children[i$1]; if (child) { var result$1 = findVNodeFromDom(child, dom); if (result$1) { return result$1; } } } } else if (isObject(children)) { var result$2 = findVNodeFromDom(children, dom); if (result$2) { return result$2; } } } } } var instanceMap = new Map(); function getKeyForVNode(vNode) { var flags = vNode.flags; if (flags & 4 /* ComponentClass */) { return vNode.children; } else { return vNode.dom; } } function getInstanceFromVNode(vNode) { var key = getKeyForVNode(vNode); return instanceMap.get(key); } function createInstanceFromVNode(vNode, instance) { var key = getKeyForVNode(vNode); instanceMap.set(key, instance); } function deleteInstanceForVNode(vNode) { var key = getKeyForVNode(vNode); instanceMap.delete(key); } /** * Create a bridge for exposing Inferno's component tree to React DevTools. * * It creates implementations of the interfaces that ReactDOM passes to * devtools to enable it to query the component tree and hook into component * updates. * * See https://github.com/facebook/react/blob/59ff7749eda0cd858d5ee568315bcba1be75a1ca/src/renderers/dom/ReactDOM.js * for how ReactDOM exports its internals for use by the devtools and * the `attachRenderer()` function in * https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/attachRenderer.js * for how the devtools consumes the resulting objects. */ function createDevToolsBridge() { var ComponentTree = { getNodeFromInstance: function getNodeFromInstance(instance) { return instance.node; }, getClosestInstanceFromNode: function getClosestInstanceFromNode(dom) { var vNode = findVNodeFromDom(null, dom); return vNode ? updateReactComponent(vNode, null) : null; } }; // Map of root ID (the ID is unimportant) to component instance. var roots = {}; findRoots(roots); var Mount = { _instancesByReactRootID: roots, _renderNewRootComponent: function _renderNewRootComponent(instance) { } }; var Reconciler = { mountComponent: function mountComponent(instance) { }, performUpdateIfNecessary: function performUpdateIfNecessary(instance) { }, receiveComponent: function receiveComponent(instance) { }, unmountComponent: function unmountComponent(instance) { } }; /** Notify devtools that a new component instance has been mounted into the DOM. */ var componentAdded = function (vNode) { var instance = updateReactComponent(vNode, null); if (isRootVNode(vNode)) { instance._rootID = nextRootKey(roots); roots[instance._rootID] = instance; Mount._renderNewRootComponent(instance); } visitNonCompositeChildren(instance, function (childInst) { if (childInst) { childInst._inDevTools = true; Reconciler.mountComponent(childInst); } }); Reconciler.mountComponent(instance); }; /** Notify devtools that a component has been updated with new props/state. */ var componentUpdated = function (vNode) { var prevRenderedChildren = []; visitNonCompositeChildren(getInstanceFromVNode(vNode), function (childInst) { prevRenderedChildren.push(childInst); }); // Notify devtools about updates to this component and any non-composite // children var instance = updateReactComponent(vNode, null); Reconciler.receiveComponent(instance); visitNonCompositeChildren(instance, function (childInst) { if (!childInst._inDevTools) { // New DOM child component childInst._inDevTools = true; Reconciler.mountComponent(childInst); } else { // Updated DOM child component Reconciler.receiveComponent(childInst); } }); // For any non-composite children that were removed by the latest render, // remove the corresponding ReactDOMComponent-like instances and notify // the devtools prevRenderedChildren.forEach(function (childInst) { if (!document.body.contains(childInst.node)) { deleteInstanceForVNode(childInst.vNode); Reconciler.unmountComponent(childInst); } }); }; /** Notify devtools that a component has been unmounted from the DOM. */ var componentRemoved = function (vNode) { var instance = updateReactComponent(vNode, null); visitNonCompositeChildren(function (childInst) { deleteInstanceForVNode(childInst.vNode); Reconciler.unmountComponent(childInst); }); Reconciler.unmountComponent(instance); deleteInstanceForVNode(vNode); if (instance._rootID) { delete roots[instance._rootID]; } }; return { componentAdded: componentAdded, componentUpdated: componentUpdated, componentRemoved: componentRemoved, ComponentTree: ComponentTree, Mount: Mount, Reconciler: Reconciler }; } function isRootVNode(vNode) { for (var i = 0; i < inferno.options.roots.length; i++) { var root = inferno.options.roots[i]; if (root.input === vNode) { return true; } } } /** * Update (and create if necessary) the ReactDOMComponent|ReactCompositeComponent-like * instance for a given Inferno component instance or DOM Node. */ function updateReactComponent(vNode, parentDom) { if (!vNode) { return null; } var flags = vNode.flags; var newInstance; if (flags & 28 /* Component */) { newInstance = createReactCompositeComponent(vNode, parentDom); } else { newInstance = createReactDOMComponent(vNode, parentDom); } var oldInstance = getInstanceFromVNode(vNode); if (oldInstance) { Object.assign(oldInstance, newInstance); return oldInstance; } createInstanceFromVNode(vNode, newInstance); return newInstance; } function normalizeChildren(children, dom) { if (isArray(children)) { return children.filter(function (child) { return !isInvalid(child); }).map(function (child) { return updateReactComponent(child, dom); }); } else { return !isInvalid(children) ? [updateReactComponent(children, dom)] : []; } } /** * Create a ReactDOMComponent-compatible object for a given DOM node rendered * by Inferno. * * This implements the subset of the ReactDOMComponent interface that * React DevTools requires in order to display DOM nodes in the inspector with * the correct type and properties. */ function createReactDOMComponent(vNode, parentDom) { var flags = vNode.flags; var type = vNode.type; var children = vNode.children; var props = vNode.props; var dom = vNode.dom; var isText = (flags & 1 /* Text */) || isStringOrNumber(vNode); return { _currentElement: isText ? (children || vNode) : { type: type, props: props }, _renderedChildren: !isText && normalizeChildren(children, dom), _stringText: isText ? (children || vNode) : null, _inDevTools: false, node: dom || parentDom, vNode: vNode }; } function normalizeKey(key) { if (key && key[0] === '.') { return null; } } /** * Return a ReactCompositeComponent-compatible object for a given Inferno * component instance. * * This implements the subset of the ReactCompositeComponent interface that * the DevTools requires in order to walk the component tree and inspect the * component's properties. * * See https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/getData.js */ function createReactCompositeComponent(vNode, parentDom) { var type = vNode.type; var instance = vNode.children; var lastInput = instance._lastInput || instance; var dom = vNode.dom; return { getName: function getName() { return typeName(type); }, _currentElement: { type: type, key: normalizeKey(vNode.key), ref: null, props: vNode.props }, props: instance.props, state: instance.state, forceUpdate: instance.forceUpdate.bind(instance), setState: instance.setState.bind(instance), node: dom, _instance: instance, _renderedComponent: updateReactComponent(lastInput, dom), vNode: vNode }; } function nextRootKey(roots) { return '.' + Object.keys(roots).length; } /** * Visit all child instances of a ReactCompositeComponent-like object that are * not composite components (ie. they represent DOM elements or text) */ function visitNonCompositeChildren(component, visitor) { if (component._renderedComponent) { if (!component._renderedComponent._component) { visitor(component._renderedComponent); visitNonCompositeChildren(component._renderedComponent, visitor); } } else if (component._renderedChildren) { component._renderedChildren.forEach(function (child) { if (child) { visitor(child); if (!child._component) { visitNonCompositeChildren(child, visitor); } } }); } } /** * Return the name of a component created by a `ReactElement`-like object. */ function typeName(type) { if (typeof type === 'function') { return type.displayName || type.name; } return type; } /** * Find all root component instances rendered by Inferno in `node`'s children * and add them to the `roots` map. */ function findRoots(roots) { inferno.options.roots.forEach(function (root) { roots[nextRootKey(roots)] = updateReactComponent(root.input, null); }); } var functionalComponentWrappers = new Map(); function wrapFunctionalComponent(vNode) { var originalRender = vNode.type; var name = vNode.type.name || '(Function.name missing)'; var wrappers = functionalComponentWrappers; if (!wrappers.has(originalRender)) { var wrapper = (function (Component$$1) { function wrapper () { Component$$1.apply(this, arguments); } if ( Component$$1 ) wrapper.__proto__ = Component$$1; wrapper.prototype = Object.create( Component$$1 && Component$$1.prototype ); wrapper.prototype.constructor = wrapper; wrapper.prototype.render = function render (props, state, context) { return originalRender(props, context); }; return wrapper; }(Component)); // Expose the original component name. React Dev Tools will use // this property if it exists or fall back to Function.name // otherwise. /* tslint:disable */ wrapper['displayName'] = name; /* tslint:enable */ wrappers.set(originalRender, wrapper); } vNode.type = wrappers.get(originalRender); vNode.ref = null; vNode.flags = 4 /* ComponentClass */; } // Credit: this based on on the great work done with Preact and its devtools // https://github.com/developit/preact/blob/master/devtools/devtools.js function initDevTools() { /* tslint:disable */ if (typeof window['__REACT_DEVTOOLS_GLOBAL_HOOK__'] === 'undefined') { /* tslint:enable */ // React DevTools are not installed return; } var nextVNode = inferno.options.createVNode; inferno.options.createVNode = function (vNode) { var flags = vNode.flags; if ((flags & 28 /* Component */) && !isStatefulComponent(vNode.type)) { wrapFunctionalComponent(vNode); } if (nextVNode) { return nextVNode(vNode); } }; // Notify devtools when preact components are mounted, updated or unmounted var bridge = createDevToolsBridge(); var nextAfterMount = inferno.options.afterMount; inferno.options.afterMount = function (vNode) { bridge.componentAdded(vNode); if (nextAfterMount) { nextAfterMount(vNode); } }; var nextAfterUpdate = inferno.options.afterUpdate; inferno.options.afterUpdate = function (vNode) { bridge.componentUpdated(vNode); if (nextAfterUpdate) { nextAfterUpdate(vNode); } }; var nextBeforeUnmount = inferno.options.beforeUnmount; inferno.options.beforeUnmount = function (vNode) { bridge.componentRemoved(vNode); if (nextBeforeUnmount) { nextBeforeUnmount(vNode); } }; // Notify devtools about this instance of "React" /* tslint:disable */ window['__REACT_DEVTOOLS_GLOBAL_HOOK__'].inject(bridge); /* tslint:enable */ return function () { inferno.options.afterMount = nextAfterMount; inferno.options.afterUpdate = nextAfterUpdate; inferno.options.beforeUnmount = nextBeforeUnmount; }; } initDevTools(); })));
rollup.config.docs.js
ricsv/react-leonardo-ui
/* eslint-env node */ import resolve from 'rollup-plugin-node-resolve'; import babel from 'rollup-plugin-babel'; import serve from 'rollup-plugin-serve'; import sourcemaps from 'rollup-plugin-sourcemaps'; import fs from 'fs'; import path from 'path'; import React from 'react'; import { renderToString } from 'react-dom/server'; function copyFileSync(src, dest) { const srcFile = path.resolve(__dirname, src); const destFile = path.resolve(__dirname, dest); const content = fs.readFileSync(srcFile); if (fs.existsSync(destFile)) { const toContent = fs.readFileSync(destFile).toString(); if (toContent === content.toString()) { // file content never changed, do nothing: return; } } fs.writeFileSync(destFile, content); } // Rollup plugin to copy static files function copy() { return { name: 'docs-copy', writeBundle() { copyFileSync('docs/src/docs.css', 'docs/dist/docs.css'); copyFileSync('docs/src/favicon.ico', 'docs/dist/favicon.ico'); copyFileSync('docs/src/react-logo.svg', 'docs/dist/react-logo.svg'); copyFileSync('node_modules/leonardo-ui/dist/leonardo-ui.css', 'docs/dist/leonardo-ui.css'); copyFileSync('node_modules/leonardo-ui/dist/lui-icons.woff', 'docs/dist/lui-icons.woff'); copyFileSync('node_modules/leonardo-ui/dist/lui-icons.ttf', 'docs/dist/lui-icons.ttf'); }, }; } // Rollup plugin to server-side render index.html function ssr() { return { name: 'docs-ssr', writeBundle() { const Docs = require('./docs/dist/docs'); // eslint-disable-line const str = renderToString(React.createElement(Docs)); const htmlContent = fs.readFileSync(path.resolve(__dirname, './docs/src/index.html'), 'utf8'); const ssrHtmlContent = htmlContent.replace(/\s*?<!--Content-->/, str); fs.writeFileSync(path.resolve(__dirname, './docs/dist/index.html'), ssrHtmlContent, 'utf8'); }, }; } const config = { input: 'docs/src/docs.js', output: { file: 'docs/dist/docs.js', format: 'umd', name: 'docsContainer', globals: { react: 'React', 'react-dom': 'ReactDOM', }, }, external: [ 'react', 'react-dom', ], plugins: [ babel({ exclude: 'node_modules/**', }), resolve({ modulesOnly: true, }), copy(), ssr(), ], }; if (process.env.BUILD !== 'production') { config.plugins.push(serve({ verbose: true, contentBase: [ 'docs/dist', 'docs/static', 'node_modules/leonardo-ui/dist', ], host: 'localhost', port: 8080, })); config.plugins.push(sourcemaps()); } export default config;
src/components/SiteHeader/index.js
iris-dni/iris-frontend
import React from 'react'; import Container from 'components/Container'; import Navigation from 'containers/Navigation'; import styles from './site-header.scss'; const SiteHeader = () => ( <header className={styles.root}> <Container> <Navigation /> </Container> </header> ); export default SiteHeader;
ajax/libs/inferno/1.0.0-beta17/inferno-mobx.min.js
emmy41124/cdnjs
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("./inferno-component"),require("./inferno"),require("./inferno-create-class"),require("./inferno-create-element")):"function"==typeof define&&define.amd?define(["inferno-component","inferno","inferno-create-class","inferno-create-element"],t):(e.Inferno=e.Inferno||{},e.Inferno.Mobx=t(e.Inferno.Component,e.Inferno,e.Inferno.createClass,e.Inferno.createElement))}(this,function(e,t,n,r){"use strict";function o(e){throw e||(e=p),new Error("Inferno Error: "+e)}function i(e,t){return t={exports:{}},e(t,t.exports),t.exports}function a(e){var t=w(e);t&&S&&S.set(t,e),O.emit({event:"render",renderTime:e.__$mobRenderEnd-e.__$mobRenderStart,totalTime:Date.now()-e.__$mobRenderStart,component:e,node:t})}function s(){"undefined"==typeof WeakMap&&o("[inferno-mobx] tracking components is not supported in this browser."),_||(_=!0)}function u(t){var n=t.prototype||t,r=n.componentDidMount,o=n.componentWillMount,i=n.componentWillUnmount;return n.componentWillMount=function(){var t=this;o&&o.call(this);var n,r=!1,i=this.displayName||this.name||this.constructor&&(this.constructor.displayName||this.constructor.name)||"<component>",a=this.render.bind(this),s=function(o,a){return n=new y(i+".render()",function(){if(!r&&(r=!0,t.__$mobxIsUnmounted!==!0)){var o=!0;try{e.prototype.forceUpdate.call(t),o=!1}finally{o&&n.dispose()}}}),u.$mobx=n,t.render=u,u(o,a)},u=function(e,o){r=!1;var i=void 0;return n.track(function(){_&&(t.__$mobRenderStart=Date.now()),i=g.allowStateChanges(!1,a.bind(t,e,o)),_&&(t.__$mobRenderEnd=Date.now())}),i};this.render=s},n.componentDidMount=function(){_&&a(this),r&&r.call(this)},n.componentWillUnmount=function(){if(i&&i.call(this),this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0,_){var e=w(this);e&&S&&S.delete(e),O.emit({event:"destroy",component:this,node:e})}},n.shouldComponentUpdate=function(e,t){var n=this;if(this.state!==t)return!0;var r=Object.keys(this.props);if(r.length!==Object.keys(e).length)return!0;for(var o=r.length-1;o>=0;o--){var i=r[o],a=e[i];if(a!==n.props[i])return!0;if(a&&"object"==typeof a&&!m(a))return!0}return!0},t}function c(e,t){var o=n({displayName:t.name,render:function(){var n=this,o={};for(var i in this.props)n.props.hasOwnProperty(i)&&(o[i]=n.props[i]);var a=e(this.context.mobxStores||{},o,this.context)||{};for(var s in a)o[s]=a[s];return o.ref=function(e){n.wrappedInstance=e},r(t,o)}});return o.contextTypes={mobxStores:function(){}},A(o,t),o}function l(e){var t=arguments;if("function"!=typeof e){for(var n=[],r=0;r<arguments.length;r++)n[r]=t[r];e=R(n)}return function(t){return c(e,t)}}function f(t,r){if(void 0===r&&(r=null),"string"==typeof t&&o("Store names should be provided as array"),Array.isArray(t))return r?l.apply(null,t)(f(r)):function(e){return f(t,e)};var i=t;if(!("function"!=typeof i||i.prototype&&i.prototype.render||i.isReactClass||e.isPrototypeOf(i))){var a=n({displayName:i.displayName||i.name,propTypes:i.propTypes,contextTypes:i.contextTypes,getDefaultProps:function(){return i.defaultProps},render:function(){return i.call(this,this.props,this.context)}});return f(a)}return i||o('Please pass a valid component to "observer"'),i.isMobXReactObserver=!0,u(i)}e="default"in e?e.default:e,t="default"in t?t.default:t,n="default"in n?n.default:n,r="default"in r?r.default:r;var p="a runtime error occured! Use Inferno in development environment to find the error.",h={children:!0,key:!0,ref:!0},d=function(e){function t(t,n){e.call(this,t,n),this.contextTypes={mobxStores:function(){}},this.childContextTypes={mobxStores:function(){}},this.store=t.store}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){return this.props.children},t.prototype.getChildContext=function(){var e=this,t={},n=this.context.mobxStores;if(n)for(var r in n)t[r]=n[r];for(var o in this.props)h[o]||(t[o]=e.props[o]);return{mobxStores:t}},t}(e),v="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b=i(function(e,t){function n(e,t,n,o){return 1===arguments.length&&"function"==typeof e?U(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?U(e,t):1===arguments.length&&"string"==typeof e?r(e):r(t).apply(null,arguments)}function r(e){return function(t,n,r){return r&&"function"==typeof r.value?(r.value=U(e,r.value),r.enumerable=!1,r.configurable=!0,r):Vt(e).apply(this,arguments)}}function o(e,t,n){var r="string"==typeof e?e:e.name||"<unnamed action>",o="function"==typeof e?e:t,i="function"==typeof e?t:n;return yt("function"==typeof o,"`runInAction` expects a function"),yt(0===o.length,"`runInAction` expects a function without arguments"),yt("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),N(r,o,i,void 0)}function i(e){return"function"==typeof e&&e.isMobxAction===!0}function a(e,t,n){function r(){a(u)}var o,a,s;"string"==typeof e?(o=e,a=t,s=n):"function"==typeof e&&(o=e.name||"Autorun@"+bt(),a=e,s=t),Fe(a,"autorun methods cannot have modifiers"),yt("function"==typeof a,"autorun expects a function"),yt(i(a)===!1,"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action."),s&&(a=a.bind(s));var u=new qt(o,function(){this.track(r)});return u.schedule(),u.getDisposer()}function s(e,t,n,r){var o,i,s,u;"string"==typeof e?(o=e,i=t,s=n,u=r):"function"==typeof e&&(o="When@"+bt(),i=e,s=t,u=n);var c=a(o,function(e){if(i.call(u)){e.dispose();var t=ee();s.call(u),te(t)}});return c}function u(e,t,n){return mt("`autorunUntil` is deprecated, please use `when`."),s.apply(null,arguments)}function c(e,t,n,r){function o(){s(f)}var a,s,u,c;"string"==typeof e?(a=e,s=t,u=n,c=r):"function"==typeof e&&(a=e.name||"AutorunAsync@"+bt(),s=e,u=t,c=n),yt(i(s)===!1,"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action."),void 0===u&&(u=1),c&&(s=s.bind(c));var l=!1,f=new qt(a,function(){l||(l=!0,setTimeout(function(){l=!1,f.isDisposed||f.track(o)},u))});return f.schedule(),f.getDisposer()}function l(e,t,r,o,i,a){function s(){if(!w.isDisposed){var e=!1;w.track(function(){var t=b(w);e=At(y,x,t),x=t}),m&&f&&l(x,w),m||e!==!0||l(x,w),m&&(m=!1)}}var u,c,l,f,p,h;"string"==typeof e?(u=e,c=t,l=r,f=o,p=i,h=a):(u=e.name||t.name||"Reaction@"+bt(),c=e,l=t,f=r,p=o,h=i),void 0===f&&(f=!1),void 0===p&&(p=0);var d=Ne(c,tn.Reference),v=d[0],b=d[1],y=v===tn.Structure;h&&(b=b.bind(h),l=n(u,l.bind(h)));var m=!0,g=!1,x=void 0,w=new qt(u,function(){p<1?s():g||(g=!0,setTimeout(function(){g=!1,s()},p))});return w.schedule(),w.getDisposer()}function f(e,t,n,r){return"function"==typeof e&&arguments.length<3?"function"==typeof t?p(e,t,void 0):p(e,void 0,t):$t.apply(null,arguments)}function p(e,t,n){var r=Ne(e,tn.Recursive),o=r[0],i=r[1];return new Wt(i,n,o===tn.Structure,i.name,t)}function h(e,t){yt("function"==typeof e&&1===e.length,"createTransformer expects a function that accepts one argument");var n={},r=Xt.resetId,o=function(r){function o(t,n){r.call(this,function(){return e(n)},null,!1,"Transformer-"+e.name+"-"+t,void 0),this.sourceIdentifier=t,this.sourceObject=n}return Mt(o,r),o.prototype.onBecomeUnobserved=function(){var e=this.value;r.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],t&&t(e,this.sourceObject)},o}(Wt);return function(e){r!==Xt.resetId&&(n={},r=Xt.resetId);var t=d(e),i=n[t];return i?i.get():(i=n[t]=new o(t,e),i.get())}}function d(e){if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object, got: "+e);var t=e.$transformId;return void 0===t&&(t=bt(),Tt(e,"$transformId",t)),t}function b(e,t){return K()||console.warn("[mobx.expr] 'expr' should only be used inside other reactive functions."),f(e,t).get()}function y(e){for(var t=arguments,n=[],r=1;r<arguments.length;r++)n[r-1]=t[r];return yt(arguments.length>=2,"extendObservable expected 2 or more arguments"),yt("object"==typeof e,"extendObservable expects an object as first argument"),yt(!pn(e),"extendObservable should not be used on maps, use map.merge instead"),n.forEach(function(t){yt("object"==typeof t,"all arguments of extendObservable should be objects"),yt(!k(t),"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),m(e,t,tn.Recursive,null)}),e}function m(e,t,n,r){var o=Qe(e,r,n);for(var i in t)if(Rt(t,i)){if(e===t&&!jt(e,i))continue;var a=Object.getOwnPropertyDescriptor(t,i);Ze(o,i,a)}return e}function g(e,t){return x(at(e,t))}function x(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=xt(e.observing).map(x)),t}function w(e,t){return _(at(e,t))}function _(e){var t={name:e.name};return ie(e)&&(t.observers=ae(e).map(_)),t}function S(e,t,n){return"function"==typeof n?A(e,t,n):O(e,t)}function O(e,t){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),st(I(e)).intercept(t)):st(e).intercept(t)}function A(e,t,n){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),y(e,{property:e[t]}),A(e,t,n)):st(e,t).intercept(n)}function R(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(it(e)===!1)return!1;var n=at(e,t);return Gt(n)}return Gt(e)}function k(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(qe(e)||pn(e))throw new Error("[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.");if(it(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return!!e.$mobx||Jt(e)||Zt(e)||Gt(e)}function T(e,t,n){return yt(arguments.length>=2&&arguments.length<=3,"Illegal decorator config",t),Et(e,t),yt(!n||!n.get,"@observable can not be used on getters, use @computed instead"),Ut.apply(null,arguments)}function I(e,t){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return T.apply(null,arguments);if(yt(arguments.length<3,"observable expects zero, one or two arguments"),k(e))return e;var n=Ne(e,tn.Recursive),r=n[0],o=n[1],i=r===tn.Reference?Nt.Reference:j(o);switch(i){case Nt.Array:case Nt.PlainObject:return ze(o,r);case Nt.Reference:case Nt.ComplexObject:return new mn(o,r);case Nt.ComplexFunction:throw new Error("[mobx.observable] To be able to make a function reactive it should not have arguments. If you need an observable reference to a function, use `observable(asReference(f))`");case Nt.ViewFunction:return mt("Use `computed(expr)` instead of `observable(expr)`"),f(e,t)}yt(!1,"Illegal State")}function j(e){return null===e||void 0===e?Nt.Reference:"function"==typeof e?e.length?Nt.ComplexFunction:Nt.ViewFunction:Lt(e)?Nt.Array:"object"==typeof e?St(e)?Nt.PlainObject:Nt.ComplexObject:Nt.Reference}function E(e,t,n,r){return"function"==typeof n?P(e,t,n,r):C(e,t,n)}function C(e,t,n){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),st(I(e)).observe(t,n)):st(e).observe(t,n)}function P(e,t,n,r){return St(e)&&!it(e)?(mt("Passing plain objects to intercept / observe is deprecated and will be removed in 3.0"),y(e,{property:e[t]}),P(e,t,n,r)):st(e,t).observe(n,r)}function D(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=null),k(e)){if(t&&null===n&&(n=[]),t&&null!==e&&"object"==typeof e)for(var o=0,i=n.length;o<i;o++)if(n[o][0]===e)return n[o][1];if(qe(e)){var a=r([]),s=e.map(function(e){return D(e,t,n)});a.length=s.length;for(var o=0,i=s.length;o<i;o++)a[o]=s[o];return a}if(it(e)){var a=r({});for(var u in e)a[u]=D(e[u],t,n);return a}if(pn(e)){var c=r({});return e.forEach(function(e,r){return c[r]=D(e,t,n)}),c}if(gn(e))return D(e.get(),t,n)}return e}function L(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=null),mt("toJSlegacy is deprecated and will be removed in the next major. Use `toJS` instead. See #566"),e instanceof Date||e instanceof RegExp)return e;if(t&&null===n&&(n=[]),t&&null!==e&&"object"==typeof e)for(var o=0,i=n.length;o<i;o++)if(n[o][0]===e)return n[o][1];if(!e)return e;if(Lt(e)){var a=r([]),s=e.map(function(e){return L(e,t,n)});a.length=s.length;for(var o=0,i=s.length;o<i;o++)a[o]=s[o];return a}if(pn(e)){var u=r({});return e.forEach(function(e,r){return u[r]=L(e,t,n)}),u}if(gn(e))return L(e.get(),t,n);if("object"==typeof e){var a=r({});for(var c in e)a[c]=L(e[c],t,n);return a}return e}function M(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=null),mt("toJSON is deprecated. Use toJS instead"),L.apply(null,arguments)}function V(e){return console.log(e),e}function $(e,t){switch(arguments.length){case 0:if(e=Xt.trackingDerivation,!e)return V("whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested it's value.");break;case 2:e=at(e,t)}return e=at(e),Gt(e)?V(e.whyRun()):Zt(e)?V(e.whyRun()):void yt(!1,"whyRun can only be used on reactions and computed values")}function U(e,t){yt("function"==typeof t,"`action` can only be invoked on functions"),yt("string"==typeof e&&e.length>0,"actions should have valid names, got: '"+e+"'");var n=function(){return N(e,t,this,arguments)};return n.isMobxAction=!0,n}function N(e,t,n,r){yt(!Gt(Xt.trackingDerivation),"Computed values or transformers should not invoke actions or trigger other side effects");var o,i=ge();if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];we({type:"action",name:e,fn:t,target:n,arguments:s})}var c=ee();Re(e,n,!1);var l=J(!0);try{return t.apply(n,r)}finally{W(l),ke(!1),te(c),i&&_e({time:Date.now()-o})}}function B(e){return 0===arguments.length?(mt("`useStrict` without arguments is deprecated, use `isStrictModeEnabled()` instead"),Xt.strictMode):(yt(null===Xt.trackingDerivation,"It is not allowed to set `useStrict` when a derivation is running"),Xt.strictMode=e,Xt.allowStateChanges=!e,void 0)}function z(){return Xt.strictMode}function F(e,t){var n=J(e),r=t();return W(n),r}function J(e){var t=Xt.allowStateChanges;return Xt.allowStateChanges=e,t}function W(e){Xt.allowStateChanges=e}function G(e){switch(e.dependenciesState){case Ft.UP_TO_DATE:return!1;case Ft.NOT_TRACKING:case Ft.STALE:return!0;case Ft.POSSIBLY_STALE:var t=!0,n=ee();try{for(var r=e.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Gt(a)&&(a.get(),e.dependenciesState===Ft.STALE))return t=!1,te(n),!0}return t=!1,ne(e),te(n),!1}finally{t&&ne(e)}}}function K(){return null!==Xt.trackingDerivation}function H(){Xt.allowStateChanges||yt(!1,Xt.strictMode?"It is not allowed to create or change state outside an `action` when MobX is in strict mode. Wrap the current method in `action` if this state change is intended":"It is not allowed to change the state when a computed value or transformer is being evaluated. Use 'autorun' to create reactive functions with side-effects.")}function X(e,t){ne(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Xt.runId;var n=Xt.trackingDerivation;Xt.trackingDerivation=e;var r,o=!0;try{r=t.call(e),o=!1}finally{o?q(e):(Xt.trackingDerivation=n,Y(e))}return r}function q(e){var t="[mobx] An uncaught exception occurred while calculating your computed value, autorun or transformer. Or inside the render() method of an observer based React component. These functions should never throw exceptions as MobX will not always be able to recover from them. "+("Please fix the error reported after this message or enable 'Pause on (caught) exceptions' in your debugger to find the root cause. In: '"+e.name+"'. ")+"For more details see https://github.com/mobxjs/mobx/issues/462";ge()&&xe({type:"error",message:t}),console.warn(t),ne(e),e.newObserving=null,e.unboundDepsCount=0,e.recoverFromError(),fe(),oe()}function Y(e){var t=e.observing,n=e.observing=e.newObserving;e.newObserving=null;for(var r=0,o=e.unboundDepsCount,i=0;i<o;i++){var a=n[i];0===a.diffValue&&(a.diffValue=1,r!==i&&(n[r]=a),r++)}for(n.length=r,o=t.length;o--;){var a=t[o];0===a.diffValue&&ue(a,e),a.diffValue=0}for(;r--;){var a=n[r];1===a.diffValue&&(a.diffValue=0,se(a,e))}}function Q(e){for(var t=e.observing,n=t.length;n--;)ue(t[n],e);e.dependenciesState=Ft.NOT_TRACKING,t.length=0}function Z(e){var t=ee(),n=e();return te(t),n}function ee(){var e=Xt.trackingDerivation;return Xt.trackingDerivation=null,e}function te(e){Xt.trackingDerivation=e}function ne(e){if(e.dependenciesState!==Ft.UP_TO_DATE){e.dependenciesState=Ft.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=Ft.UP_TO_DATE}}function re(){}function oe(){Xt.resetId++;var e=new Ht;for(var t in e)Kt.indexOf(t)===-1&&(Xt[t]=e[t]);Xt.allowStateChanges=!Xt.strictMode}function ie(e){return e.observers&&e.observers.length>0}function ae(e){return e.observers}function se(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function ue(e,t){if(1===e.observers.length)e.observers.length=0,ce(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function ce(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,Xt.pendingUnobservations.push(e))}function le(){Xt.inBatch++}function fe(){if(1===Xt.inBatch){for(var e=Xt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Xt.pendingUnobservations=[]}Xt.inBatch--}function pe(e){var t=Xt.trackingDerivation;null!==t?t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e):0===e.observers.length&&ce(e)}function he(e){if(e.lowestObserverState!==Ft.STALE){e.lowestObserverState=Ft.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Ft.UP_TO_DATE&&r.onBecomeStale(),r.dependenciesState=Ft.STALE}}}function de(e){if(e.lowestObserverState!==Ft.STALE){e.lowestObserverState=Ft.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Ft.POSSIBLY_STALE?r.dependenciesState=Ft.STALE:r.dependenciesState===Ft.UP_TO_DATE&&(e.lowestObserverState=Ft.UP_TO_DATE)}}}function ve(e){if(e.lowestObserverState===Ft.UP_TO_DATE){e.lowestObserverState=Ft.POSSIBLY_STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Ft.UP_TO_DATE&&(r.dependenciesState=Ft.POSSIBLY_STALE,r.onBecomeStale())}}}function be(){Xt.isRunningReactions===!0||Xt.inTransaction>0||Qt(ye)}function ye(){Xt.isRunningReactions=!0;for(var e=Xt.pendingReactions,t=0;e.length>0;){if(++t===Yt)throw oe(),new Error("Reaction doesn't converge to a stable state after "+Yt+" iterations. Probably there is a cycle in the reactive function: "+e[0]);for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}Xt.isRunningReactions=!1}function me(e){var t=Qt;Qt=function(n){return e(function(){return t(n)})}}function ge(){return!!Xt.spyListeners.length}function xe(e){if(!Xt.spyListeners.length)return!1;for(var t=Xt.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function we(e){var t=Ot({},e,{spyReportStart:!0});xe(t)}function _e(e){xe(e?Ot({},e,en):en)}function Se(e){return Xt.spyListeners.push(e),gt(function(){var t=Xt.spyListeners.indexOf(e);t!==-1&&Xt.spyListeners.splice(t,1)})}function Oe(e){return mt("trackTransitions is deprecated. Use mobx.spy instead"),"boolean"==typeof e&&(mt("trackTransitions only takes a single callback function. If you are using the mobx-react-devtools, please update them first"),e=arguments[1]),e?Se(e):(mt("trackTransitions without callback has been deprecated and is a no-op now. If you are using the mobx-react-devtools, please update them first"),function(){})}function Ae(e,t,n){void 0===t&&(t=void 0),void 0===n&&(n=!0),Re(e.name||"anonymous transaction",t,n);try{return e.call(t)}finally{ke(n)}}function Re(e,t,n){void 0===t&&(t=void 0),void 0===n&&(n=!0),le(),Xt.inTransaction+=1,n&&ge()&&we({type:"transaction",target:t,name:e})}function ke(e){void 0===e&&(e=!0),0===--Xt.inTransaction&&be(),e&&ge()&&_e(),fe()}function Te(e){return e.interceptors&&e.interceptors.length>0}function Ie(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),gt(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function je(e,t){for(var n=ee(),r=e.interceptors,o=0,i=r.length;o<i;o++)if(t=r[o](t),yt(!t||t.type,"Intercept handlers should return nothing or a change object"),!t)return null;return te(n),t}function Ee(e){return e.changeListeners&&e.changeListeners.length>0}function Ce(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),gt(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function Pe(e,t){var n=ee(),r=e.changeListeners;if(r){r=r.slice();for(var o=0,i=r.length;o<i;o++)Array.isArray(t)?r[o].apply(null,t):r[o](t);te(n)}}function De(e,t){return Fe(t,"Modifiers are not allowed to be nested"),{mobxModifier:e,value:t}}function Le(e){return e?e.mobxModifier||null:null}function Me(e){return De(tn.Reference,e)}function Ve(e){return De(tn.Structure,e)}function $e(e){return De(tn.Flat,e)}function Ue(e,t){return Ye(e,t)}function Ne(e,t){var n=Le(e);return n?[n,e.value]:[t,e]}function Be(e){if(void 0===e)return tn.Recursive;var t=Le(e);return yt(null!==t,"Cannot determine value mode from function. Please pass in one of these: mobx.asReference, mobx.asStructure or mobx.asFlat, got: "+e),t}function ze(e,t,n){var r;if(k(e))return e;switch(t){case tn.Reference:return e;case tn.Flat:Fe(e,"Items inside 'asFlat' cannot have modifiers"),r=tn.Reference;break;case tn.Structure:Fe(e,"Items inside 'asStructure' cannot have modifiers"),r=tn.Structure;break;case tn.Recursive:o=Ne(e,tn.Recursive),r=o[0],e=o[1];break;default:yt(!1,"Illegal State")}return Array.isArray(e)?He(e,r,n):St(e)&&Object.isExtensible(e)?m(e,e,r,n):e;var o}function Fe(e,t){if(null!==Le(e))throw new Error("[mobx] asStructure / asReference / asFlat cannot be used here. "+t)}function Je(e){var t=We(e),n=Ge(e);Object.defineProperty(sn.prototype,""+e,{enumerable:!1,configurable:!0,set:t,get:n})}function We(e){return function(t){var n=this.$mobx,r=n.values;if(Fe(t,"Modifiers cannot be used on array values. For non-reactive array values use makeReactive(asFlat(array))."),e<r.length){H();var o=r[e];if(Te(n)){var i=je(n,{type:"update",object:n.array,index:e,newValue:t});if(!i)return;t=i.newValue}t=n.makeReactiveArrayItem(t);var a=n.mode===tn.Structure?!Pt(o,t):o!==t;a&&(r[e]=t,n.notifyArrayChildUpdate(e,t,o))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}}}function Ge(e){return function(){var t=this.$mobx;return t&&e<t.values.length?(t.atom.reportObserved(),t.values[e]):void console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}}function Ke(e){for(var t=rn;t<e;t++)Je(t);rn=e}function He(e,t,n){return new sn(e,t,n)}function Xe(e){return mt("fastArray is deprecated. Please use `observable(asFlat([]))`"),He(e,tn.Flat,null)}function qe(e){return _t(e)&&cn(e.$mobx)}function Ye(e,t){return new fn(e,t)}function Qe(e,t,n){if(void 0===n&&(n=tn.Recursive),it(e))return e.$mobx;St(e)||(t=e.constructor.name+"@"+bt()),t||(t="ObservableObject@"+bt());var r=new hn(e,t,n);return It(e,"$mobx",r),r}function Ze(e,t,n){e.values[t]?(yt("value"in n,"cannot redefine property "+t),e.target[t]=n.value):"value"in n?et(e,t,n.value,!0,void 0):et(e,t,n.get,!0,n.set)}function et(e,t,n,r,o){r&&Et(e.target,t);var a,s=e.name+"."+t,u=!0;if(Gt(n))a=n,n.name=s,n.scope||(n.scope=e.target);else if("function"!=typeof n||0!==n.length||i(n))if(Le(n)===tn.Structure&&"function"==typeof n.value&&0===n.value.length)a=new Wt(n.value,e.target,!0,s,o);else{if(u=!1,Te(e)){var c=je(e,{object:e.target,name:t,type:"add",newValue:n});if(!c)return;n=c.newValue}a=new mn(n,e.mode,s,!1),n=a.value}else a=new Wt(n,e.target,!1,s,o);e.values[t]=a,r&&Object.defineProperty(e.target,t,u?nt(t):tt(t)),u||ot(e,e.target,t,n)}function tt(e){var t=dn[e];return t?t:dn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[e].get()},set:function(t){rt(this,e,t)}}}function nt(e){var t=vn[e];return t?t:vn[e]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[e].get()},set:function(t){return this.$mobx.values[e].set(t)}}}function rt(e,t,n){var r=e.$mobx,o=r.values[t];if(Te(r)){var i=je(r,{type:"update",object:e,name:t,newValue:n});if(!i)return;n=i.newValue}if(n=o.prepareNewValue(n),n!==yn){var a=Ee(r),s=ge(),i=a||s?{type:"update",object:e,oldValue:o.value,name:t,newValue:n}:null;s&&we(i),o.setNewValue(n),a&&Pe(r,i),s&&_e()}}function ot(e,t,n,r){var o=Ee(e),i=ge(),a=o||i?{type:"add",object:t,name:n,newValue:r}:null;i&&we(a),o&&Pe(e,a),i&&_e()}function it(e){return!!_t(e)&&(ft(e),bn(e.$mobx))}function at(e,t){if("object"==typeof e&&null!==e){if(qe(e))return yt(void 0===t,"It is not possible to get index atoms from arrays"),e.$mobx.atom;if(pn(e)){if(void 0===t)return at(e._keys);var n=e._data[t]||e._hasMap[t];return yt(!!n,"the entry '"+t+"' does not exist in the observable map '"+ut(e)+"'"),n}if(ft(e),it(e)){yt(!!t,"please specify a property");var r=e.$mobx.values[t];return yt(!!r,"no observable property '"+t+"' found on the observable object '"+ut(e)+"'"),r}if(Jt(e)||Gt(e)||Zt(e))return e}else if("function"==typeof e&&Zt(e.$mobx))return e.$mobx;yt(!1,"Cannot obtain atom from "+e)}function st(e,t){return yt(e,"Expecting some object"),void 0!==t?st(at(e,t)):Jt(e)||Gt(e)||Zt(e)?e:pn(e)?e:(ft(e),e.$mobx?e.$mobx:void yt(!1,"Cannot obtain administration from "+e))}function ut(e,t){var n;return n=void 0!==t?at(e,t):it(e)||pn(e)?st(e):at(e),n.name}function ct(e,t,n,r,o){function i(i,a,s,u,c){if(yt(o||pt(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){Rt(i,"__mobxLazyInitializers")||Tt(i,"__mobxLazyInitializers",i.__mobxLazyInitializers&&i.__mobxLazyInitializers.slice()||[]);var l=s.value,f=s.initializer;return i.__mobxLazyInitializers.push(function(t){e(t,a,f?f.call(t):l,u,s)}),{enumerable:r,configurable:!0,get:function(){return this.__mobxDidRunLazyInitializers!==!0&&ft(this),t.call(this,a)},set:function(e){this.__mobxDidRunLazyInitializers!==!0&&ft(this),n.call(this,a,e)}}}var p={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&this.__mobxInitializedProps[a]===!0||lt(this,a,void 0,e,u,s),t.call(this,a)},set:function(t){this.__mobxInitializedProps&&this.__mobxInitializedProps[a]===!0?n.call(this,a,t):lt(this,a,t,e,u,s)}};return(arguments.length<3||5===arguments.length&&c<3)&&Object.defineProperty(i,a,p),p}return o?function(){if(pt(arguments))return i.apply(null,arguments);var e=arguments,t=arguments.length;return function(n,r,o){return i(n,r,o,e,t)}}:i}function lt(e,t,n,r,o,i){Rt(e,"__mobxInitializedProps")||Tt(e,"__mobxInitializedProps",{}),e.__mobxInitializedProps[t]=!0,r(e,t,n,o,i)}function ft(e){e.__mobxDidRunLazyInitializers!==!0&&e.__mobxLazyInitializers&&(Tt(e,"__mobxDidRunLazyInitializers",!0),e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers.forEach(function(t){return t(e)}))}function pt(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]}function ht(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function dt(e){yt(e[xn]!==!0,"Illegal state: cannot recycle array as iterator"),It(e,xn,!0);var t=-1;return It(e,"next",function(){return t++,{done:t>=this.length,value:t<this.length?this[t]:void 0}}),e}function vt(e,t){It(e,ht(),t)}function bt(){return++Xt.mobxGuid}function yt(e,t,n){if(!e)throw new Error("[mobx] Invariant failed: "+t+(n?" in '"+n+"'":""))}function mt(e){Sn.indexOf(e)===-1&&(Sn.push(e),console.error("[mobx] Deprecated: "+e))}function gt(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function xt(e){var t=[];return e.forEach(function(e){t.indexOf(e)===-1&&t.push(e)}),t}function wt(e,t,n){if(void 0===t&&(t=100),void 0===n&&(n=" - "),!e)return"";var r=e.slice(0,t);return""+r.join(n)+(e.length>t?" (... and "+(e.length-t)+"more)":"")}function _t(e){return null!==e&&"object"==typeof e}function St(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Ot(){for(var e=arguments,t=arguments[0],n=1,r=arguments.length;n<r;n++){var o=e[n];for(var i in o)Rt(o,i)&&(t[i]=o[i])}return t}function At(e,t,n){return e?!Pt(t,n):t!==n}function Rt(e,t){return An.call(e,t)}function kt(e,t){for(var n=0;n<t.length;n++)Tt(e,t[n],e[t[n]])}function Tt(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function It(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function jt(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||n.configurable!==!1&&n.writable!==!1}function Et(e,t){yt(jt(e,t),"Cannot make property '"+t+"' observable, it is not configurable and writable in the target object")}function Ct(e){var t=[];for(var n in e)t.push(n);return t}function Pt(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;var n=Lt(e);if(n!==Lt(t))return!1;if(n){if(e.length!==t.length)return!1;for(var r=e.length-1;r>=0;r--)if(!Pt(e[r],t[r]))return!1;return!0}if("object"==typeof e&&"object"==typeof t){if(null===e||null===t)return!1;if(Ct(e).length!==Ct(t).length)return!1;for(var o in e){if(!(o in t))return!1;if(!Pt(e[o],t[o]))return!1}return!0}return e===t}function Dt(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return _t(e)&&e[n]===!0}}function Lt(e){return Array.isArray(e)||qe(e)}var Mt=v&&v.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};re(),t.extras={allowStateChanges:F,getAtom:at,getDebugName:ut,getDependencyTree:g,getObserverTree:w,isComputingDerivation:K,isSpyEnabled:ge,resetGlobalState:oe,spyReport:xe,spyReportEnd:_e,spyReportStart:we,trackTransitions:Oe,setReactionScheduler:me},t._={getAdministration:st,resetGlobalState:oe},"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(e.exports);var Vt=ct(function(e,t,r,o,i){var a=o&&1===o.length?o[0]:r.name||t||"<unnamed action>",s=n(a,r);Tt(e,t,s)},function(e){return this[e]},function(){yt(!1,"It is not allowed to assign new values to @action fields")},!1,!0);t.action=n,t.runInAction=o,t.isAction=i,t.autorun=a,t.when=s,t.autorunUntil=u,t.autorunAsync=c,t.reaction=l;var $t=ct(function(e,t,n,r,o){yt("undefined"!=typeof o,"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.");var i=o.get,a=o.set;yt("function"==typeof i,"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'");var s=!1;r&&1===r.length&&r[0].asStructure===!0&&(s=!0);var u=Qe(e,void 0,tn.Recursive);et(u,t,s?Ve(i):i,!1,a)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!0);t.computed=f,t.createTransformer=h,t.expr=b,t.extendObservable=y,t.intercept=S,t.isComputed=R,t.isObservable=k;var Ut=ct(function(e,t,n){var r=J(!0);"function"==typeof n&&(n=Me(n));var o=Qe(e,void 0,tn.Recursive);et(o,t,n,!0,void 0),W(r)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){rt(this,e,t)},!0,!1);t.observable=I;var Nt;!function(e){e[e.Reference=0]="Reference",e[e.PlainObject=1]="PlainObject",e[e.ComplexObject=2]="ComplexObject",e[e.Array=3]="Array",e[e.ViewFunction=4]="ViewFunction", e[e.ComplexFunction=5]="ComplexFunction"}(Nt||(Nt={})),t.observe=E,t.toJS=D,t.toJSlegacy=L,t.toJSON=M,t.whyRun=$,t.useStrict=B,t.isStrictModeEnabled=z;var Bt=function(){function e(e){void 0===e&&(e="Atom@"+bt()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Ft.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){pe(this)},e.prototype.reportChanged=function(){Re("propagatingAtomChange",null,!1),he(this),ke(!1)},e.prototype.toString=function(){return this.name},e}();t.BaseAtom=Bt;var zt=function(e){function t(t,n,r){void 0===t&&(t="Atom@"+bt()),void 0===n&&(n=On),void 0===r&&(r=On),e.call(this,t),this.name=t,this.onBecomeObservedHandler=n,this.onBecomeUnobservedHandler=r,this.isPendingUnobservation=!1,this.isBeingTracked=!1}return Mt(t,e),t.prototype.reportObserved=function(){return le(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),fe(),!!Xt.trackingDerivation},t.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},t}(Bt);t.Atom=zt;var Ft,Jt=Dt("Atom",Bt),Wt=function(){function e(e,t,n,r,o){this.derivation=e,this.scope=t,this.compareStructural=n,this.dependenciesState=Ft.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Ft.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.value=void 0,this.isComputing=!1,this.isRunningSetter=!1,this.name=r||"ComputedValue@"+bt(),o&&(this.setter=U(r+"-setter",o))}return e.prototype.peek=function(){this.isComputing=!0;var e=J(!1),t=this.derivation.call(this.scope);return W(e),this.isComputing=!1,t},e.prototype.peekUntracked=function(){var e=!0;try{var t=this.peek();return e=!1,t}finally{e&&q(this)}},e.prototype.onBecomeStale=function(){ve(this)},e.prototype.onBecomeUnobserved=function(){yt(this.dependenciesState!==Ft.NOT_TRACKING,"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row"),Q(this),this.value=void 0},e.prototype.get=function(){yt(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),le(),1===Xt.inBatch?G(this)&&(this.value=this.peekUntracked()):(pe(this),G(this)&&this.trackAndCompute()&&de(this));var e=this.value;return fe(),e},e.prototype.recoverFromError=function(){this.isComputing=!1},e.prototype.set=function(e){if(this.setter){yt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else yt(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){ge()&&xe({object:this,type:"compute",fn:this.derivation,target:this.scope});var e=this.value,t=this.value=X(this,this.peek);return At(this.compareStructural,t,e)},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return a(function(){var i=n.get();if(!r||t){var a=ee();e(i,o),te(a)}r=!1,o=i})},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.whyRun=function(){var e=Boolean(Xt.trackingDerivation),t=xt(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),n=xt(ae(this).map(function(e){return e.name}));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(e?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===Ft.NOT_TRACKING?" * This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).\n":" * This computation will re-run if any of the following observables changes:\n "+wt(t)+"\n "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n\tMissing items in this list?\n\t 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n\t 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n * If the outcome of this computation changes, the following observers will be re-run:\n "+wt(n)+"\n")},e}(),Gt=Dt("ComputedValue",Wt);!function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(Ft||(Ft={})),t.IDerivationState=Ft,t.untracked=Z;var Kt=["mobxGuid","resetId","spyListeners","strictMode","runId"],Ht=function(){function e(){this.version=4,this.trackingDerivation=null,this.runId=0,this.mobxGuid=0,this.inTransaction=0,this.isRunningReactions=!1,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[]}return e}(),Xt=function(){var e=new Ht;if(v.__mobservableTrackingStack||v.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(v.__mobxGlobal&&v.__mobxGlobal.version!==e.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");return v.__mobxGlobal?v.__mobxGlobal:v.__mobxGlobal=e}(),qt=function(){function e(e,t){void 0===e&&(e="Reaction@"+bt()),this.name=e,this.onInvalidate=t,this.observing=[],this.newObserving=[],this.dependenciesState=Ft.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+bt(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Xt.pendingReactions.push(this),le(),be(),fe())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){this.isDisposed||(this._isScheduled=!1,G(this)&&(this._isTrackPending=!0,this.onInvalidate(),this._isTrackPending&&ge()&&xe({object:this,type:"scheduled-reaction"})))},e.prototype.track=function(e){le();var t,n=ge();n&&(t=Date.now(),we({object:this,type:"reaction",fn:e})),this._isRunning=!0,X(this,e),this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Q(this),n&&_e({time:Date.now()-t}),fe()},e.prototype.recoverFromError=function(){this._isRunning=!1,this._isTrackPending=!1},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(le(),Q(this),fe()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.whyRun=function(){var e=xt(this._isRunning?this.newObserving:this.observing).map(function(e){return e.name});return"\nWhyRun? reaction '"+this.name+"':\n * Status: ["+(this.isDisposed?"stopped":this._isRunning?"running":this.isScheduled()?"scheduled":"idle")+"]\n * This reaction will re-run if any of the following observables changes:\n "+wt(e)+"\n "+(this._isRunning?" (... or any observable accessed during the remainder of the current run)":"")+"\n\tMissing items in this list?\n\t 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n\t 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"},e}();t.Reaction=qt;var Yt=100,Qt=function(e){return e()},Zt=Dt("Reaction",qt),en={spyReportEnd:!0};t.spy=Se,t.transaction=Ae;var tn;!function(e){e[e.Recursive=0]="Recursive",e[e.Reference=1]="Reference",e[e.Structure=2]="Structure",e[e.Flat=3]="Flat"}(tn||(tn={})),t.asReference=Me,Me.mobxModifier=tn.Reference,t.asStructure=Ve,Ve.mobxModifier=tn.Structure,t.asFlat=$e,$e.mobxModifier=tn.Flat,t.asMap=Ue;var nn=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),rn=0,on=function(){function e(){}return e}();on.prototype=[];var an=function(){function e(e,t,n,r){this.mode=t,this.array=n,this.owned=r,this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new Bt(e||"ObservableArray@"+bt())}return e.prototype.makeReactiveArrayItem=function(e){return Fe(e,"Array values cannot have modifiers"),this.mode===tn.Flat||this.mode===tn.Reference?e:ze(e,this.mode,this.atom.name+"[..]")},e.prototype.intercept=function(e){return Ie(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ce(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;e!==t&&(e>t?this.spliceWithArray(t,0,new Array(e-t)):this.spliceWithArray(e,t-e))},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>rn&&Ke(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){H();var r=this.values.length;if(void 0===e?e=0:e>r?e=r:e<0&&(e=Math.max(0,r+e)),t=1===arguments.length?r-e:void 0===t||null===t?0:Math.max(0,Math.min(t,r-e)),void 0===n&&(n=[]),Te(this)){var o=je(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!o)return _n;t=o.removedCount,n=o.added}n=n.map(this.makeReactiveArrayItem,this);var i=n.length-t;this.updateArrayLength(r,i);var a=(s=this.values).splice.apply(s,[e,t].concat(n));return 0===t&&0===n.length||this.notifyArraySplice(e,n,a),a;var s},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&ge(),o=Ee(this),i=o||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&we(i),this.atom.reportChanged(),o&&Pe(this,i),r&&_e()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&ge(),o=Ee(this),i=o||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&we(i),this.atom.reportChanged(),o&&Pe(this,i),r&&_e()},e}(),sn=function(e){function t(t,n,r,o){void 0===o&&(o=!1),e.call(this);var i=new an(r,n,this,o);It(this,"$mobx",i),t&&t.length?(i.updateArrayLength(0,t.length),i.values=t.map(i.makeReactiveArrayItem,i),i.notifyArraySplice(0,i.values.slice(),_n)):i.values=[],nn&&Object.defineProperty(i.array,"0",un)}return Mt(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n-0]=e[n];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.slice(),t.map(function(e){return qe(e)?e.slice():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.values},t.prototype.find=function(e,t,n){var r=this;void 0===n&&(n=0),this.$mobx.atom.reportObserved();for(var o=this.$mobx.values,i=o.length,a=n;a<i;a++)if(e.call(t,o[a],a,r))return o[a]},t.prototype.splice=function(e,t){for(var n=arguments,r=[],o=2;o<arguments.length;o++)r[o-2]=n[o];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,r)},t.prototype.push=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n-0]=e[n];var r=this.$mobx;return r.spliceWithArray(r.values.length,0,t),r.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n-0]=e[n];var r=this.$mobx;return r.spliceWithArray(0,0,t),r.values.length},t.prototype.reverse=function(){this.$mobx.atom.reportObserved();var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){this.$mobx.atom.reportObserved();var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.values.indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.toString=function(){return"[mobx.array] "+Array.prototype.toString.apply(this.$mobx.values,arguments)},t.prototype.toLocaleString=function(){return"[mobx.array] "+Array.prototype.toLocaleString.apply(this.$mobx.values,arguments)},t}(on);vt(sn.prototype,function(){return dt(this.slice())}),kt(sn.prototype,["constructor","intercept","observe","clear","concat","replace","toJS","toJSON","peek","find","splice","push","pop","shift","unshift","reverse","sort","remove","toString","toLocaleString"]),Object.defineProperty(sn.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some"].forEach(function(e){var t=Array.prototype[e];yt("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),Tt(sn.prototype,e,function(){return this.$mobx.atom.reportObserved(),t.apply(this.$mobx.values,arguments)})});var un={configurable:!0,enumerable:!1,set:We(0),get:Ge(0)};Ke(1e3),t.fastArray=Xe;var cn=Dt("ObservableArrayAdministration",an);t.isObservableArray=qe;var ln={},fn=function(){function e(e,t){var n=this;this.$mobx=ln,this._data={},this._hasMap={},this.name="ObservableMap@"+bt(),this._keys=new sn(null,tn.Reference,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this._valueMode=Be(t),this._valueMode===tn.Flat&&(this._valueMode=tn.Reference),F(!0,function(){St(e)?n.merge(e):Array.isArray(e)&&e.forEach(function(e){var t=e[0],r=e[1];return n.set(t,r)})})}return e.prototype._has=function(e){return"undefined"!=typeof this._data[e]},e.prototype.has=function(e){return!!this.isValidKey(e)&&(e=""+e,this._hasMap[e]?this._hasMap[e].get():this._updateHasMapEntry(e,!1).get())},e.prototype.set=function(e,t){this.assertValidKey(e),e=""+e;var n=this._has(e);if(Fe(t,"[mobx.map.set] Expected unwrapped value to be inserted to key '"+e+"'. If you need to use modifiers pass them as second argument to the constructor"),Te(this)){var r=je(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return;t=r.newValue}n?this._updateValue(e,t):this._addValue(e,t)},e.prototype.delete=function(e){var t=this;if(this.assertValidKey(e),e=""+e,Te(this)){var n=je(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var r=ge(),o=Ee(this),n=o||r?{type:"delete",object:this,oldValue:this._data[e].value,name:e}:null;return r&&we(n),Ae(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1);var n=t._data[e];n.setNewValue(void 0),t._data[e]=void 0},void 0,!1),o&&Pe(this,n),r&&_e(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap[e];return n?n.setNewValue(t):n=this._hasMap[e]=new mn(t,tn.Reference,this.name+"."+e+"?",!1),n},e.prototype._updateValue=function(e,t){var n=this._data[e];if(t=n.prepareNewValue(t),t!==yn){var r=ge(),o=Ee(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&we(i),n.setNewValue(t),o&&Pe(this,i),r&&_e()}},e.prototype._addValue=function(e,t){var n=this;Ae(function(){var r=n._data[e]=new mn(t,n._valueMode,n.name+"."+e,!1);t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)},void 0,!1);var r=ge(),o=Ee(this),i=o||r?{type:"add",object:this,name:e,newValue:t}:null;r&&we(i),o&&Pe(this,i),r&&_e()},e.prototype.get=function(e){if(e=""+e,this.has(e))return this._data[e].get()},e.prototype.keys=function(){return dt(this._keys.slice())},e.prototype.values=function(){return dt(this._keys.map(this.get,this))},e.prototype.entries=function(){var e=this;return dt(this._keys.map(function(t){return[t,e.get(t)]}))},e.prototype.forEach=function(e,t){var n=this;this.keys().forEach(function(r){return e.call(t,n.get(r),r)})},e.prototype.merge=function(e){var t=this;return Ae(function(){pn(e)?e.keys().forEach(function(n){return t.set(n,e.get(n))}):Object.keys(e).forEach(function(n){return t.set(n,e[n])})},void 0,!1),this},e.prototype.clear=function(){var e=this;Ae(function(){Z(function(){e.keys().forEach(e.delete,e)})},void 0,!1)},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toJS=function(){var e=this,t={};return this.keys().forEach(function(n){return t[n]=e.get(n)}),t},e.prototype.toJs=function(){return mt("toJs is deprecated, use toJS instead"),this.toJS()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.isValidKey=function(e){return null!==e&&void 0!==e&&("string"==typeof e||"number"==typeof e||"boolean"==typeof e)},e.prototype.assertValidKey=function(e){if(!this.isValidKey(e))throw new Error("[mobx.map] Invalid key: '"+e+"'")},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this.keys().map(function(t){return t+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return yt(t!==!0,"`observe` doesn't support the fire immediately property for observable maps."),Ce(this,e)},e.prototype.intercept=function(e){return Ie(this,e)},e}();t.ObservableMap=fn,vt(fn.prototype,function(){return this.entries()}),t.map=Ye;var pn=Dt("ObservableMap",fn);t.isObservableMap=pn;var hn=function(){function e(e,t,n){this.target=e,this.name=t,this.mode=n,this.values={},this.changeListeners=null,this.interceptors=null}return e.prototype.observe=function(e,t){return yt(t!==!0,"`observe` doesn't support the fire immediately property for observable objects."),Ce(this,e)},e.prototype.intercept=function(e){return Ie(this,e)},e}(),dn={},vn={},bn=Dt("ObservableObjectAdministration",hn);t.isObservableObject=it;var yn={},mn=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableValue@"+bt()),void 0===o&&(o=!0),e.call(this,r),this.mode=n,this.hasUnreportedChange=!1,this.value=void 0;var i=Ne(t,tn.Recursive),a=i[0],s=i[1];this.mode===tn.Recursive&&(this.mode=a),this.value=ze(s,this.mode,this.name),o&&ge()&&xe({type:"create",object:this,newValue:this.value})}return Mt(t,e),t.prototype.set=function(e){var t=this.value;if(e=this.prepareNewValue(e),e!==yn){var n=ge();n&&we({type:"update",object:this,newValue:e,oldValue:t}),this.setNewValue(e),n&&_e()}},t.prototype.prepareNewValue=function(e){if(Fe(e,"Modifiers cannot be used on non-initial values."),H(),Te(this)){var t=je(this,{object:this,type:"update",newValue:e});if(!t)return yn;e=t.newValue}var n=At(this.mode===tn.Structure,this.value,e);return n?ze(e,this.mode,this.name):yn},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Ee(this)&&Pe(this,[e,t])},t.prototype.get=function(){return this.reportObserved(),this.value},t.prototype.intercept=function(e){return Ie(this,e)},t.prototype.observe=function(e,t){return t&&e(this.value,void 0),Ce(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t}(Bt),gn=Dt("ObservableValue",mn),xn="__$$iterating",wn=function(){function e(){this.listeners=[],mt("extras.SimpleEventEmitter is deprecated and will be removed in the next major release")}return e.prototype.emit=function(){for(var e=arguments,t=this.listeners.slice(),n=0,r=t.length;n<r;n++)t[n].apply(null,e)},e.prototype.on=function(e){var t=this;return this.listeners.push(e),gt(function(){var n=t.listeners.indexOf(e);n!==-1&&t.listeners.splice(n,1)})},e.prototype.once=function(e){var t=this.on(function(){t(),e.apply(this,arguments)});return t},e}();t.SimpleEventEmitter=wn;var _n=[];Object.freeze(_n);var Sn=[],On=function(){},An=Object.prototype.hasOwnProperty;t.isArrayLike=Lt}),y=b.Reaction,m=b.isObservable,g=b.extras,x=function(){this.listeners=[]};x.prototype.on=function(e){var t=this;return this.listeners.push(e),function(){var n=t.listeners.indexOf(e);n!==-1&&t.listeners.splice(n,1)}},x.prototype.emit=function(e){this.listeners.forEach(function(t){return t(e)})},x.prototype.getTotalListeners=function(){return this.listeners.length},x.prototype.clearListeners=function(){this.listeners=[]};var w=t.findDOMNode,_=!1,S=new WeakMap,O=new x,A=i(function(e){function t(e,t,i){if("string"!=typeof t){var a=Object.getOwnPropertyNames(t);o&&(a=a.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;++s)if(!(n[a[s]]||r[a[s]]||i&&i[a[s]]))try{e[a[s]]=t[a[s]]}catch(e){}}return e}var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;e.exports=t,e.exports.default=e.exports}),R=function(e){return function(t,n){return e.forEach(function(e){if(!(e in n)){if(!(e in t))throw new Error('MobX observer: Store "'+e+'" is not available! Make sure it is provided by some Provider');n[e]=t[e]}}),n}},k={Provider:d,inject:l,connect:f,observer:f,trackComponents:s,renderReporter:O,componentByNodeRegistery:S};return k});
js/jquery.js
haimy/pms_landing
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},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(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={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:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px") },cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.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(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,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":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
assets/javascripts/archon/components/ProcScheduleSpecCard.js
panli889/archon
import React from 'react'; import Radium from 'radium'; import MDL from './MdlComponents'; let ProcScheduleSpecCard = React.createClass({ getInitialState() { return { isCpuValid: true, isMemoryValid: true, }; }, contextTypes: { theme: React.PropTypes.object, }, render() { const {theme} = this.context; const {cpu, memory} = this.props; const titleStyle = _.assign({}, theme.cardTitle, theme.colorStyle('info', true)); return ( <MDL.Card style={theme.card}> <MDL.CardTitle style={titleStyle} title={`运行资源调度`} /> <MDL.CardSupportText> 对Proc进行实时的动态运行CPU、内存等资源调整调度,输入需要的运行资源,点击确认调度即可。<br /> 目前预留内存:<b>{cpu}</b>,预留内存:<b>{memory}</b> </MDL.CardSupportText> <div style={{ padding: '0 16px' }}> <MDL.InputTextField inputType='number' name='cpu' ref='cpu' style={{ width: '100%' }} isValid={this.state.isCpuValid} onEnterPressed={this.doSchedule} label='预留CPU [0-32]' /> <MDL.InputTextField inputType='text' name='memory' ref='memory' style={{ width: '100%' }} isValid={this.state.isMemoryValid} onEnterPressed={this.doSchedule} label='预留内存 [例如,32M]' /> </div> <MDL.CardActions buttons={[ { title: '确认调度', color: 'accent', onClick: this.doSchedule }, ]} border={false} align='right' /> </MDL.Card> ); }, doSchedule() { const cpuValue = this.refs.cpu.getValue(); const memoryValue = this.refs.memory.getValue(); let numCpu = this.props.cpu; let isCpuValid = true; let isMemoryValid = true; if (!cpuValue) { isCpuValid = false; } else { numCpu = Number(cpuValue); if (isNaN(numCpu) || numCpu < 0 || numCpu > 32) { isCpuValid = false; } } if (!memoryValue) { isMemoryValid = false; } else { let lastCharIndex = memoryValue.length - 1; let unit = memoryValue[lastCharIndex].toUpperCase(); let numMem = Number(memoryValue.substring(0, lastCharIndex)); if (isNaN(numMem) || (unit !== 'M' && unit !== 'G')) { isMemoryValid = false; } } this.setState({isCpuValid, isMemoryValid}); if (isCpuValid && isMemoryValid) { this.props.doSchedule && this.props.doSchedule(numCpu, memoryValue); } }, }); export default Radium(ProcScheduleSpecCard);
docs/src/sections/PagerSection.js
apkiernan/react-bootstrap
import React from 'react'; import Anchor from '../Anchor'; import PropTable from '../PropTable'; import ReactPlayground from '../ReactPlayground'; import Samples from '../Samples'; export default function PagerSection() { return ( <div className="bs-docs-section"> <h2 className="page-header"> <Anchor id="pager">Pager</Anchor> <small>Pager, Pager.Item</small> </h2> <p>Quick previous and next links.</p> <h3><Anchor id="pager-default">Centers by default</Anchor></h3> <ReactPlayground codeText={Samples.PagerDefault} /> <h3><Anchor id="pager-aligned">Aligned</Anchor></h3> <p>Set the <code>previous</code> or <code>next</code> prop to <code>true</code>, to align left or right.</p> <ReactPlayground codeText={Samples.PagerAligned} /> <h3><Anchor id="pager-disabled">Disabled</Anchor></h3> <p>Set the <code>disabled</code> prop to <code>true</code> to disable the link.</p> <ReactPlayground codeText={Samples.PagerDisabled} /> <h3><Anchor id="pager-props">Props</Anchor></h3> <h4><Anchor id="pager-props-pager">Pager</Anchor></h4> <PropTable component="Pager"/> <h4><Anchor id="pager-props-pager-item">Pager.Item</Anchor></h4> <PropTable component="Pager.Item"/> </div> ); }
src/FontIcon/FontIcon.js
skarnecki/material-ui
import React from 'react'; import transitions from '../styles/transitions'; function getStyles(props, context, state) { const { color, hoverColor, } = props; const {baseTheme} = context.muiTheme; const offColor = color || baseTheme.palette.textColor; const onColor = hoverColor || offColor; return { root: { color: state.hovered ? onColor : offColor, position: 'relative', fontSize: baseTheme.spacing.iconSize, display: 'inline-block', userSelect: 'none', transition: transitions.easeOut(), }, }; } class FontIcon extends React.Component { static muiName = 'FontIcon'; static propTypes = { /** * This is the font color of the font icon. If not specified, * this component will default to muiTheme.palette.textColor. */ color: React.PropTypes.string, /** * This is the icon color when the mouse hovers over the icon. */ hoverColor: React.PropTypes.string, /** * Callback function fired when the mouse enters the element. * * @param {object} event `mouseenter` event targeting the element. */ onMouseEnter: React.PropTypes.func, /** * Callback function fired when the mouse leaves the element. * * @param {object} event `mouseleave` event targeting the element. */ onMouseLeave: React.PropTypes.func, /** * Override the inline-styles of the root element. */ style: React.PropTypes.object, }; static defaultProps = { onMouseEnter: () => {}, onMouseLeave: () => {}, }; static contextTypes = { muiTheme: React.PropTypes.object.isRequired, }; state = { hovered: false, }; handleMouseLeave = (event) => { // hover is needed only when a hoverColor is defined if (this.props.hoverColor !== undefined) this.setState({hovered: false}); if (this.props.onMouseLeave) { this.props.onMouseLeave(event); } }; handleMouseEnter = (event) => { // hover is needed only when a hoverColor is defined if (this.props.hoverColor !== undefined) this.setState({hovered: true}); if (this.props.onMouseEnter) { this.props.onMouseEnter(event); } }; render() { const { onMouseLeave, // eslint-disable-line no-unused-vars onMouseEnter, // eslint-disable-line no-unused-vars style, ...other, } = this.props; const {prepareStyles} = this.context.muiTheme; const styles = getStyles(this.props, this.context, this.state); return ( <span {...other} onMouseLeave={this.handleMouseLeave} onMouseEnter={this.handleMouseEnter} style={prepareStyles(Object.assign(styles.root, style))} /> ); } } export default FontIcon;
ajax/libs/angular-google-maps/1.2.0/angular-google-maps.js
FaiblUG/cdnjs
/*! angular-google-maps 1.2.0 2014-07-30 * AngularJS directives for Google Maps * git: https://github.com/nlaplante/angular-google-maps.git */ /** * @name InfoBox * @version 1.1.12 [December 11, 2012] * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google) * @copyright Copyright 2010 Gary Little [gary at luxcentral.com] * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class. * <p> * An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several * additional properties for advanced styling. An InfoBox can also be used as a map label. * <p> * An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>. */ /*! * * 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. */ /*jslint browser:true */ /*global google */ /** * @name InfoBoxOptions * @class This class represents the optional parameter passed to the {@link InfoBox} constructor. * @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node). * @property {boolean} [disableAutoPan=false] Disable auto-pan on <tt>open</tt>. * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum. * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox * (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>) * to the map pixel corresponding to <tt>position</tt>. * @property {LatLng} position The geographic location at which to display the InfoBox. * @property {number} zIndex The CSS z-index style value for the InfoBox. * Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property. * @property {string} [boxClass="infoBox"] The name of the CSS class defining the styles for the InfoBox container. * @property {Object} [boxStyle] An object literal whose properties define specific CSS * style values to be applied to the InfoBox. Style values defined here override those that may * be defined in the <code>boxClass</code> style sheet. If this property is changed after the * InfoBox has been created, all previously set styles (except those defined in the style sheet) * are removed from the InfoBox before the new style values are applied. * @property {string} closeBoxMargin The CSS margin style value for the close box. * The default is "2px" (a 2-pixel margin on all sides). * @property {string} closeBoxURL The URL of the image representing the close box. * Note: The default is the URL for Google's standard close box. * Set this property to "" if no close box is required. * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the * map edge after an auto-pan. * @property {boolean} [isHidden=false] Hide the InfoBox on <tt>open</tt>. * [Deprecated in favor of the <tt>visible</tt> property.] * @property {boolean} [visible=true] Show the InfoBox on <tt>open</tt>. * @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the <code>position</code> * location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned). * @property {string} pane The pane where the InfoBox is to appear (default is "floatPane"). * Set the pane to "mapPane" if the InfoBox is being used as a map label. * Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object. * @property {boolean} enableEventPropagation Propagate mousedown, mousemove, mouseover, mouseout, * mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox * (default is <tt>false</tt> to mimic the behavior of a <tt>google.maps.InfoWindow</tt>). Set * this property to <tt>true</tt> if the InfoBox is being used as a map label. */ /** * Creates an InfoBox with the options specified in {@link InfoBoxOptions}. * Call <tt>InfoBox.open</tt> to add the box to the map. * @constructor * @param {InfoBoxOptions} [opt_opts] */ function InfoBox(opt_opts) { opt_opts = opt_opts || {}; google.maps.OverlayView.apply(this, arguments); // Standard options (in common with google.maps.InfoWindow): // this.content_ = opt_opts.content || ""; this.disableAutoPan_ = opt_opts.disableAutoPan || false; this.maxWidth_ = opt_opts.maxWidth || 0; this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0); this.position_ = opt_opts.position || new google.maps.LatLng(0, 0); this.zIndex_ = opt_opts.zIndex || null; // Additional options (unique to InfoBox): // this.boxClass_ = opt_opts.boxClass || "infoBox"; this.boxStyle_ = opt_opts.boxStyle || {}; this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px"; this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif"; if (opt_opts.closeBoxURL === "") { this.closeBoxURL_ = ""; } this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1); if (typeof opt_opts.visible === "undefined") { if (typeof opt_opts.isHidden === "undefined") { opt_opts.visible = true; } else { opt_opts.visible = !opt_opts.isHidden; } } this.isHidden_ = !opt_opts.visible; this.alignBottom_ = opt_opts.alignBottom || false; this.pane_ = opt_opts.pane || "floatPane"; this.enableEventPropagation_ = opt_opts.enableEventPropagation || false; this.div_ = null; this.closeListener_ = null; this.moveListener_ = null; this.contextListener_ = null; this.eventListeners_ = null; this.fixedWidthSet_ = null; } /* InfoBox extends OverlayView in the Google Maps API v3. */ InfoBox.prototype = new google.maps.OverlayView(); /** * Creates the DIV representing the InfoBox. * @private */ InfoBox.prototype.createInfoBoxDiv_ = function () { var i; var events; var bw; var me = this; // This handler prevents an event in the InfoBox from being passed on to the map. // var cancelHandler = function (e) { e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } }; // This handler ignores the current event in the InfoBox and conditionally prevents // the event from being passed on to the map. It is used for the contextmenu event. // var ignoreHandler = function (e) { e.returnValue = false; if (e.preventDefault) { e.preventDefault(); } if (!me.enableEventPropagation_) { cancelHandler(e); } }; if (!this.div_) { this.div_ = document.createElement("div"); this.setBoxStyle_(); if (typeof this.content_.nodeType === "undefined") { this.div_.innerHTML = this.getCloseBoxImg_() + this.content_; } else { this.div_.innerHTML = this.getCloseBoxImg_(); this.div_.appendChild(this.content_); } // Add the InfoBox DIV to the DOM this.getPanes()[this.pane_].appendChild(this.div_); this.addClickHandler_(); if (this.div_.style.width) { this.fixedWidthSet_ = true; } else { if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) { this.div_.style.width = this.maxWidth_; this.div_.style.overflow = "auto"; this.fixedWidthSet_ = true; } else { // The following code is needed to overcome problems with MSIE bw = this.getBoxWidths_(); this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px"; this.fixedWidthSet_ = false; } } this.panBox_(this.disableAutoPan_); if (!this.enableEventPropagation_) { this.eventListeners_ = []; // Cancel event propagation. // // Note: mousemove not included (to resolve Issue 152) events = ["mousedown", "mouseover", "mouseout", "mouseup", "click", "dblclick", "touchstart", "touchend", "touchmove"]; for (i = 0; i < events.length; i++) { this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler)); } // Workaround for Google bug that causes the cursor to change to a pointer // when the mouse moves over a marker underneath InfoBox. this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (e) { this.style.cursor = "default"; })); } this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler); /** * This event is fired when the DIV containing the InfoBox's content is attached to the DOM. * @name InfoBox#domready * @event */ google.maps.event.trigger(this, "domready"); } }; /** * Returns the HTML <IMG> tag for the close box. * @private */ InfoBox.prototype.getCloseBoxImg_ = function () { var img = ""; if (this.closeBoxURL_ !== "") { img = "<img"; img += " src='" + this.closeBoxURL_ + "'"; img += " align=right"; // Do this because Opera chokes on style='float: right;' img += " style='"; img += " position: relative;"; // Required by MSIE img += " cursor: pointer;"; img += " margin: " + this.closeBoxMargin_ + ";"; img += "'>"; } return img; }; /** * Adds the click handler to the InfoBox close box. * @private */ InfoBox.prototype.addClickHandler_ = function () { var closeBox; if (this.closeBoxURL_ !== "") { closeBox = this.div_.firstChild; this.closeListener_ = google.maps.event.addDomListener(closeBox, "click", this.getCloseClickHandler_()); } else { this.closeListener_ = null; } }; /** * Returns the function to call when the user clicks the close box of an InfoBox. * @private */ InfoBox.prototype.getCloseClickHandler_ = function () { var me = this; return function (e) { // 1.0.3 fix: Always prevent propagation of a close box click to the map: e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } /** * This event is fired when the InfoBox's close box is clicked. * @name InfoBox#closeclick * @event */ google.maps.event.trigger(me, "closeclick"); me.close(); }; }; /** * Pans the map so that the InfoBox appears entirely within the map's visible area. * @private */ InfoBox.prototype.panBox_ = function (disablePan) { var map; var bounds; var xOffset = 0, yOffset = 0; if (!disablePan) { map = this.getMap(); if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama if (!map.getBounds().contains(this.position_)) { // Marker not in visible area of map, so set center // of map to the marker position first. map.setCenter(this.position_); } bounds = map.getBounds(); var mapDiv = map.getDiv(); var mapWidth = mapDiv.offsetWidth; var mapHeight = mapDiv.offsetHeight; var iwOffsetX = this.pixelOffset_.width; var iwOffsetY = this.pixelOffset_.height; var iwWidth = this.div_.offsetWidth; var iwHeight = this.div_.offsetHeight; var padX = this.infoBoxClearance_.width; var padY = this.infoBoxClearance_.height; var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_); if (pixPosition.x < (-iwOffsetX + padX)) { xOffset = pixPosition.x + iwOffsetX - padX; } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) { xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth; } if (this.alignBottom_) { if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) { yOffset = pixPosition.y + iwOffsetY - padY - iwHeight; } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) { yOffset = pixPosition.y + iwOffsetY + padY - mapHeight; } } else { if (pixPosition.y < (-iwOffsetY + padY)) { yOffset = pixPosition.y + iwOffsetY - padY; } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) { yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight; } } if (!(xOffset === 0 && yOffset === 0)) { // Move the map to the shifted center. // var c = map.getCenter(); map.panBy(xOffset, yOffset); } } } }; /** * Sets the style of the InfoBox by setting the style sheet and applying * other specific styles requested. * @private */ InfoBox.prototype.setBoxStyle_ = function () { var i, boxStyle; if (this.div_) { // Apply style values from the style sheet defined in the boxClass parameter: this.div_.className = this.boxClass_; // Clear existing inline style values: this.div_.style.cssText = ""; // Apply style values defined in the boxStyle parameter: boxStyle = this.boxStyle_; for (i in boxStyle) { if (boxStyle.hasOwnProperty(i)) { this.div_.style[i] = boxStyle[i]; } } // Fix up opacity style for benefit of MSIE: // if (typeof this.div_.style.opacity !== "undefined" && this.div_.style.opacity !== "") { this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")"; } // Apply required styles: // this.div_.style.position = "absolute"; this.div_.style.visibility = 'hidden'; if (this.zIndex_ !== null) { this.div_.style.zIndex = this.zIndex_; } } }; /** * Get the widths of the borders of the InfoBox. * @private * @return {Object} widths object (top, bottom left, right) */ InfoBox.prototype.getBoxWidths_ = function () { var computedStyle; var bw = {top: 0, bottom: 0, left: 0, right: 0}; var box = this.div_; if (document.defaultView && document.defaultView.getComputedStyle) { computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, ""); if (computedStyle) { // The computed styles are always in pixel units (good!) bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0; bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0; bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0; bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0; } } else if (document.documentElement.currentStyle) { // MSIE if (box.currentStyle) { // The current styles may not be in pixel units, but assume they are (bad!) bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0; bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0; bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0; bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0; } } return bw; }; /** * Invoked when <tt>close</tt> is called. Do not call it directly. */ InfoBox.prototype.onRemove = function () { if (this.div_) { this.div_.parentNode.removeChild(this.div_); this.div_ = null; } }; /** * Draws the InfoBox based on the current map projection and zoom level. */ InfoBox.prototype.draw = function () { this.createInfoBoxDiv_(); var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_); this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px"; if (this.alignBottom_) { this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + "px"; } else { this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px"; } if (this.isHidden_) { this.div_.style.visibility = 'hidden'; } else { this.div_.style.visibility = "visible"; } }; /** * Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>, * <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt> * properties have no affect until the current InfoBox is <tt>close</tt>d and a new one * is <tt>open</tt>ed. * @param {InfoBoxOptions} opt_opts */ InfoBox.prototype.setOptions = function (opt_opts) { if (typeof opt_opts.boxClass !== "undefined") { // Must be first this.boxClass_ = opt_opts.boxClass; this.setBoxStyle_(); } if (typeof opt_opts.boxStyle !== "undefined") { // Must be second this.boxStyle_ = opt_opts.boxStyle; this.setBoxStyle_(); } if (typeof opt_opts.content !== "undefined") { this.setContent(opt_opts.content); } if (typeof opt_opts.disableAutoPan !== "undefined") { this.disableAutoPan_ = opt_opts.disableAutoPan; } if (typeof opt_opts.maxWidth !== "undefined") { this.maxWidth_ = opt_opts.maxWidth; } if (typeof opt_opts.pixelOffset !== "undefined") { this.pixelOffset_ = opt_opts.pixelOffset; } if (typeof opt_opts.alignBottom !== "undefined") { this.alignBottom_ = opt_opts.alignBottom; } if (typeof opt_opts.position !== "undefined") { this.setPosition(opt_opts.position); } if (typeof opt_opts.zIndex !== "undefined") { this.setZIndex(opt_opts.zIndex); } if (typeof opt_opts.closeBoxMargin !== "undefined") { this.closeBoxMargin_ = opt_opts.closeBoxMargin; } if (typeof opt_opts.closeBoxURL !== "undefined") { this.closeBoxURL_ = opt_opts.closeBoxURL; } if (typeof opt_opts.infoBoxClearance !== "undefined") { this.infoBoxClearance_ = opt_opts.infoBoxClearance; } if (typeof opt_opts.isHidden !== "undefined") { this.isHidden_ = opt_opts.isHidden; } if (typeof opt_opts.visible !== "undefined") { this.isHidden_ = !opt_opts.visible; } if (typeof opt_opts.enableEventPropagation !== "undefined") { this.enableEventPropagation_ = opt_opts.enableEventPropagation; } if (this.div_) { this.draw(); } }; /** * Sets the content of the InfoBox. * The content can be plain text or an HTML DOM node. * @param {string|Node} content */ InfoBox.prototype.setContent = function (content) { this.content_ = content; if (this.div_) { if (this.closeListener_) { google.maps.event.removeListener(this.closeListener_); this.closeListener_ = null; } // Odd code required to make things work with MSIE. // if (!this.fixedWidthSet_) { this.div_.style.width = ""; } if (typeof content.nodeType === "undefined") { this.div_.innerHTML = this.getCloseBoxImg_() + content; } else { this.div_.innerHTML = this.getCloseBoxImg_(); this.div_.appendChild(content); } // Perverse code required to make things work with MSIE. // (Ensures the close box does, in fact, float to the right.) // if (!this.fixedWidthSet_) { this.div_.style.width = this.div_.offsetWidth + "px"; if (typeof content.nodeType === "undefined") { this.div_.innerHTML = this.getCloseBoxImg_() + content; } else { this.div_.innerHTML = this.getCloseBoxImg_(); this.div_.appendChild(content); } } this.addClickHandler_(); } /** * This event is fired when the content of the InfoBox changes. * @name InfoBox#content_changed * @event */ google.maps.event.trigger(this, "content_changed"); }; /** * Sets the geographic location of the InfoBox. * @param {LatLng} latlng */ InfoBox.prototype.setPosition = function (latlng) { this.position_ = latlng; if (this.div_) { this.draw(); } /** * This event is fired when the position of the InfoBox changes. * @name InfoBox#position_changed * @event */ google.maps.event.trigger(this, "position_changed"); }; /** * Sets the zIndex style for the InfoBox. * @param {number} index */ InfoBox.prototype.setZIndex = function (index) { this.zIndex_ = index; if (this.div_) { this.div_.style.zIndex = index; } /** * This event is fired when the zIndex of the InfoBox changes. * @name InfoBox#zindex_changed * @event */ google.maps.event.trigger(this, "zindex_changed"); }; /** * Sets the visibility of the InfoBox. * @param {boolean} isVisible */ InfoBox.prototype.setVisible = function (isVisible) { this.isHidden_ = !isVisible; if (this.div_) { this.div_.style.visibility = (this.isHidden_ ? "hidden" : "visible"); } }; /** * Returns the content of the InfoBox. * @returns {string} */ InfoBox.prototype.getContent = function () { return this.content_; }; /** * Returns the geographic location of the InfoBox. * @returns {LatLng} */ InfoBox.prototype.getPosition = function () { return this.position_; }; /** * Returns the zIndex for the InfoBox. * @returns {number} */ InfoBox.prototype.getZIndex = function () { return this.zIndex_; }; /** * Returns a flag indicating whether the InfoBox is visible. * @returns {boolean} */ InfoBox.prototype.getVisible = function () { var isVisible; if ((typeof this.getMap() === "undefined") || (this.getMap() === null)) { isVisible = false; } else { isVisible = !this.isHidden_; } return isVisible; }; /** * Shows the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.] */ InfoBox.prototype.show = function () { this.isHidden_ = false; if (this.div_) { this.div_.style.visibility = "visible"; } }; /** * Hides the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.] */ InfoBox.prototype.hide = function () { this.isHidden_ = true; if (this.div_) { this.div_.style.visibility = "hidden"; } }; /** * Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt> * (usually a <tt>google.maps.Marker</tt>) is specified, the position * of the InfoBox is set to the position of the <tt>anchor</tt>. If the * anchor is dragged to a new location, the InfoBox moves as well. * @param {Map|StreetViewPanorama} map * @param {MVCObject} [anchor] */ InfoBox.prototype.open = function (map, anchor) { var me = this; if (anchor) { this.position_ = anchor.getPosition(); this.moveListener_ = google.maps.event.addListener(anchor, "position_changed", function () { me.setPosition(this.getPosition()); }); } this.setMap(map); if (this.div_) { this.panBox_(); } }; /** * Removes the InfoBox from the map. */ InfoBox.prototype.close = function () { var i; if (this.closeListener_) { google.maps.event.removeListener(this.closeListener_); this.closeListener_ = null; } if (this.eventListeners_) { for (i = 0; i < this.eventListeners_.length; i++) { google.maps.event.removeListener(this.eventListeners_[i]); } this.eventListeners_ = null; } if (this.moveListener_) { google.maps.event.removeListener(this.moveListener_); this.moveListener_ = null; } if (this.contextListener_) { google.maps.event.removeListener(this.contextListener_); this.contextListener_ = null; } this.setMap(null); };;/** * @name MarkerClustererPlus for Google Maps V3 * @version 2.1.1 [November 4, 2013] * @author Gary Little * @fileoverview * The library creates and manages per-zoom-level clusters for large amounts of markers. * <p> * This is an enhanced V3 implementation of the * <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/" * >V2 MarkerClusterer</a> by Xiaoxi Wu. It is based on the * <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/" * >V3 MarkerClusterer</a> port by Luke Mahe. MarkerClustererPlus was created by Gary Little. * <p> * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>, * and <code>calculator</code> properties as well as support for four more events. It also allows * greater control over the styling of the text that appears on the cluster marker. The * documentation has been significantly improved and the overall code has been simplified and * polished. Very large numbers of markers can now be managed without causing Javascript timeout * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been * deprecated. The new name is <code>click</code>, so please change your application code now. */ /** * 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. */ /** * @name ClusterIconStyle * @class This class represents the object for values in the <code>styles</code> array passed * to the {@link MarkerClusterer} constructor. The element in this array that is used to * style the cluster icon is determined by calling the <code>calculator</code> function. * * @property {string} url The URL of the cluster icon image file. Required. * @property {number} height The display height (in pixels) of the cluster icon. Required. * @property {number} width The display width (in pixels) of the cluster icon. Required. * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code> * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code> * increases to the right of center. The default is <code>[0, 0]</code>. * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the * spot on the cluster icon that is to be aligned with the cluster position. The format is * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default * anchor position is the center of the cluster icon. * @property {string} [textColor="black"] The color of the label text shown on the * cluster icon. * @property {number} [textSize=11] The size (in pixels) of the label text shown on the * cluster icon. * @property {string} [textDecoration="none"] The value of the CSS <code>text-decoration</code> * property for the label text shown on the cluster icon. * @property {string} [fontWeight="bold"] The value of the CSS <code>font-weight</code> * property for the label text shown on the cluster icon. * @property {string} [fontStyle="normal"] The value of the CSS <code>font-style</code> * property for the label text shown on the cluster icon. * @property {string} [fontFamily="Arial,sans-serif"] The value of the CSS <code>font-family</code> * property for the label text shown on the cluster icon. * @property {string} [backgroundPosition="0 0"] The position of the cluster icon image * within the image defined by <code>url</code>. The format is <code>"xpos ypos"</code> * (the same format as for the CSS <code>background-position</code> property). You must set * this property appropriately when the image defined by <code>url</code> represents a sprite * containing multiple images. Note that the position <i>must</i> be specified in px units. */ /** * @name ClusterIconInfo * @class This class is an object containing general information about a cluster icon. This is * the object that a <code>calculator</code> function returns. * * @property {string} text The text of the label to be shown on the cluster icon. * @property {number} index The index plus 1 of the element in the <code>styles</code> * array to be used to style the cluster icon. * @property {string} title The tooltip to display when the mouse moves over the cluster icon. * If this value is <code>undefined</code> or <code>""</code>, <code>title</code> is set to the * value of the <code>title</code> property passed to the MarkerClusterer. */ /** * A cluster icon. * * @constructor * @extends google.maps.OverlayView * @param {Cluster} cluster The cluster with which the icon is to be associated. * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons * to use for various cluster sizes. * @private */ function ClusterIcon(cluster, styles) { cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView); this.cluster_ = cluster; this.className_ = cluster.getMarkerClusterer().getClusterClass(); this.styles_ = styles; this.center_ = null; this.div_ = null; this.sums_ = null; this.visible_ = false; this.setMap(cluster.getMap()); // Note: this causes onAdd to be called } /** * Adds the icon to the DOM. */ ClusterIcon.prototype.onAdd = function () { var cClusterIcon = this; var cMouseDownInCluster; var cDraggingMapByCluster; this.div_ = document.createElement("div"); this.div_.className = this.className_; if (this.visible_) { this.show(); } this.getPanes().overlayMouseTarget.appendChild(this.div_); // Fix for Issue 157 this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), "bounds_changed", function () { cDraggingMapByCluster = cMouseDownInCluster; }); google.maps.event.addDomListener(this.div_, "mousedown", function () { cMouseDownInCluster = true; cDraggingMapByCluster = false; }); google.maps.event.addDomListener(this.div_, "click", function (e) { cMouseDownInCluster = false; if (!cDraggingMapByCluster) { var theBounds; var mz; var mc = cClusterIcon.cluster_.getMarkerClusterer(); /** * This event is fired when a cluster marker is clicked. * @name MarkerClusterer#click * @param {Cluster} c The cluster that was clicked. * @event */ google.maps.event.trigger(mc, "click", cClusterIcon.cluster_); google.maps.event.trigger(mc, "clusterclick", cClusterIcon.cluster_); // deprecated name // The default click handler follows. Disable it by setting // the zoomOnClick property to false. if (mc.getZoomOnClick()) { // Zoom into the cluster. mz = mc.getMaxZoom(); theBounds = cClusterIcon.cluster_.getBounds(); mc.getMap().fitBounds(theBounds); // There is a fix for Issue 170 here: setTimeout(function () { mc.getMap().fitBounds(theBounds); // Don't zoom beyond the max zoom level if (mz !== null && (mc.getMap().getZoom() > mz)) { mc.getMap().setZoom(mz + 1); } }, 100); } // Prevent event propagation to the map: e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } } }); google.maps.event.addDomListener(this.div_, "mouseover", function () { var mc = cClusterIcon.cluster_.getMarkerClusterer(); /** * This event is fired when the mouse moves over a cluster marker. * @name MarkerClusterer#mouseover * @param {Cluster} c The cluster that the mouse moved over. * @event */ google.maps.event.trigger(mc, "mouseover", cClusterIcon.cluster_); }); google.maps.event.addDomListener(this.div_, "mouseout", function () { var mc = cClusterIcon.cluster_.getMarkerClusterer(); /** * This event is fired when the mouse moves out of a cluster marker. * @name MarkerClusterer#mouseout * @param {Cluster} c The cluster that the mouse moved out of. * @event */ google.maps.event.trigger(mc, "mouseout", cClusterIcon.cluster_); }); }; /** * Removes the icon from the DOM. */ ClusterIcon.prototype.onRemove = function () { if (this.div_ && this.div_.parentNode) { this.hide(); google.maps.event.removeListener(this.boundsChangedListener_); google.maps.event.clearInstanceListeners(this.div_); this.div_.parentNode.removeChild(this.div_); this.div_ = null; } }; /** * Draws the icon. */ ClusterIcon.prototype.draw = function () { if (this.visible_) { var pos = this.getPosFromLatLng_(this.center_); this.div_.style.top = pos.y + "px"; this.div_.style.left = pos.x + "px"; } }; /** * Hides the icon. */ ClusterIcon.prototype.hide = function () { if (this.div_) { this.div_.style.display = "none"; } this.visible_ = false; }; /** * Positions and shows the icon. */ ClusterIcon.prototype.show = function () { if (this.div_) { var img = ""; // NOTE: values must be specified in px units var bp = this.backgroundPosition_.split(" "); var spriteH = parseInt(bp[0].trim(), 10); var spriteV = parseInt(bp[1].trim(), 10); var pos = this.getPosFromLatLng_(this.center_); this.div_.style.cssText = this.createCss(pos); img = "<img src='" + this.url_ + "' style='position: absolute; top: " + spriteV + "px; left: " + spriteH + "px; "; if (!this.cluster_.getMarkerClusterer().enableRetinaIcons_) { img += "clip: rect(" + (-1 * spriteV) + "px, " + ((-1 * spriteH) + this.width_) + "px, " + ((-1 * spriteV) + this.height_) + "px, " + (-1 * spriteH) + "px);"; } img += "'>"; this.div_.innerHTML = img + "<div style='" + "position: absolute;" + "top: " + this.anchorText_[0] + "px;" + "left: " + this.anchorText_[1] + "px;" + "color: " + this.textColor_ + ";" + "font-size: " + this.textSize_ + "px;" + "font-family: " + this.fontFamily_ + ";" + "font-weight: " + this.fontWeight_ + ";" + "font-style: " + this.fontStyle_ + ";" + "text-decoration: " + this.textDecoration_ + ";" + "text-align: center;" + "width: " + this.width_ + "px;" + "line-height:" + this.height_ + "px;" + "'>" + this.sums_.text + "</div>"; if (typeof this.sums_.title === "undefined" || this.sums_.title === "") { this.div_.title = this.cluster_.getMarkerClusterer().getTitle(); } else { this.div_.title = this.sums_.title; } this.div_.style.display = ""; } this.visible_ = true; }; /** * Sets the icon styles to the appropriate element in the styles array. * * @param {ClusterIconInfo} sums The icon label text and styles index. */ ClusterIcon.prototype.useStyle = function (sums) { this.sums_ = sums; var index = Math.max(0, sums.index - 1); index = Math.min(this.styles_.length - 1, index); var style = this.styles_[index]; this.url_ = style.url; this.height_ = style.height; this.width_ = style.width; this.anchorText_ = style.anchorText || [0, 0]; this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)]; this.textColor_ = style.textColor || "black"; this.textSize_ = style.textSize || 11; this.textDecoration_ = style.textDecoration || "none"; this.fontWeight_ = style.fontWeight || "bold"; this.fontStyle_ = style.fontStyle || "normal"; this.fontFamily_ = style.fontFamily || "Arial,sans-serif"; this.backgroundPosition_ = style.backgroundPosition || "0 0"; }; /** * Sets the position at which to center the icon. * * @param {google.maps.LatLng} center The latlng to set as the center. */ ClusterIcon.prototype.setCenter = function (center) { this.center_ = center; }; /** * Creates the cssText style parameter based on the position of the icon. * * @param {google.maps.Point} pos The position of the icon. * @return {string} The CSS style text. */ ClusterIcon.prototype.createCss = function (pos) { var style = []; style.push("cursor: pointer;"); style.push("position: absolute; top: " + pos.y + "px; left: " + pos.x + "px;"); style.push("width: " + this.width_ + "px; height: " + this.height_ + "px;"); return style.join(""); }; /** * Returns the position at which to place the DIV depending on the latlng. * * @param {google.maps.LatLng} latlng The position in latlng. * @return {google.maps.Point} The position in pixels. */ ClusterIcon.prototype.getPosFromLatLng_ = function (latlng) { var pos = this.getProjection().fromLatLngToDivPixel(latlng); pos.x -= this.anchorIcon_[1]; pos.y -= this.anchorIcon_[0]; pos.x = parseInt(pos.x, 10); pos.y = parseInt(pos.y, 10); return pos; }; /** * Creates a single cluster that manages a group of proximate markers. * Used internally, do not call this constructor directly. * @constructor * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this * cluster is associated. */ function Cluster(mc) { this.markerClusterer_ = mc; this.map_ = mc.getMap(); this.gridSize_ = mc.getGridSize(); this.minClusterSize_ = mc.getMinimumClusterSize(); this.averageCenter_ = mc.getAverageCenter(); this.markers_ = []; this.center_ = null; this.bounds_ = null; this.clusterIcon_ = new ClusterIcon(this, mc.getStyles()); } /** * Returns the number of markers managed by the cluster. You can call this from * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler * for the <code>MarkerClusterer</code> object. * * @return {number} The number of markers in the cluster. */ Cluster.prototype.getSize = function () { return this.markers_.length; }; /** * Returns the array of markers managed by the cluster. You can call this from * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler * for the <code>MarkerClusterer</code> object. * * @return {Array} The array of markers in the cluster. */ Cluster.prototype.getMarkers = function () { return this.markers_; }; /** * Returns the center of the cluster. You can call this from * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler * for the <code>MarkerClusterer</code> object. * * @return {google.maps.LatLng} The center of the cluster. */ Cluster.prototype.getCenter = function () { return this.center_; }; /** * Returns the map with which the cluster is associated. * * @return {google.maps.Map} The map. * @ignore */ Cluster.prototype.getMap = function () { return this.map_; }; /** * Returns the <code>MarkerClusterer</code> object with which the cluster is associated. * * @return {MarkerClusterer} The associated marker clusterer. * @ignore */ Cluster.prototype.getMarkerClusterer = function () { return this.markerClusterer_; }; /** * Returns the bounds of the cluster. * * @return {google.maps.LatLngBounds} the cluster bounds. * @ignore */ Cluster.prototype.getBounds = function () { var i; var bounds = new google.maps.LatLngBounds(this.center_, this.center_); var markers = this.getMarkers(); for (i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } return bounds; }; /** * Removes the cluster from the map. * * @ignore */ Cluster.prototype.remove = function () { this.clusterIcon_.setMap(null); this.markers_ = []; delete this.markers_; }; /** * Adds a marker to the cluster. * * @param {google.maps.Marker} marker The marker to be added. * @return {boolean} True if the marker was added. * @ignore */ Cluster.prototype.addMarker = function (marker) { var i; var mCount; var mz; if (this.isMarkerAlreadyAdded_(marker)) { return false; } if (!this.center_) { this.center_ = marker.getPosition(); this.calculateBounds_(); } else { if (this.averageCenter_) { var l = this.markers_.length + 1; var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l; var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l; this.center_ = new google.maps.LatLng(lat, lng); this.calculateBounds_(); } } marker.isAdded = true; this.markers_.push(marker); mCount = this.markers_.length; mz = this.markerClusterer_.getMaxZoom(); if (mz !== null && this.map_.getZoom() > mz) { // Zoomed in past max zoom, so show the marker. if (marker.getMap() !== this.map_) { marker.setMap(this.map_); } } else if (mCount < this.minClusterSize_) { // Min cluster size not reached so show the marker. if (marker.getMap() !== this.map_) { marker.setMap(this.map_); } } else if (mCount === this.minClusterSize_) { // Hide the markers that were showing. for (i = 0; i < mCount; i++) { this.markers_[i].setMap(null); } } else { marker.setMap(null); } this.updateIcon_(); return true; }; /** * Determines if a marker lies within the cluster's bounds. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker lies in the bounds. * @ignore */ Cluster.prototype.isMarkerInClusterBounds = function (marker) { return this.bounds_.contains(marker.getPosition()); }; /** * Calculates the extended bounds of the cluster with the grid. */ Cluster.prototype.calculateBounds_ = function () { var bounds = new google.maps.LatLngBounds(this.center_, this.center_); this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds); }; /** * Updates the cluster icon. */ Cluster.prototype.updateIcon_ = function () { var mCount = this.markers_.length; var mz = this.markerClusterer_.getMaxZoom(); if (mz !== null && this.map_.getZoom() > mz) { this.clusterIcon_.hide(); return; } if (mCount < this.minClusterSize_) { // Min cluster size not yet reached. this.clusterIcon_.hide(); return; } var numStyles = this.markerClusterer_.getStyles().length; var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles); this.clusterIcon_.setCenter(this.center_); this.clusterIcon_.useStyle(sums); this.clusterIcon_.show(); }; /** * Determines if a marker has already been added to the cluster. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker has already been added. */ Cluster.prototype.isMarkerAlreadyAdded_ = function (marker) { var i; if (this.markers_.indexOf) { return this.markers_.indexOf(marker) !== -1; } else { for (i = 0; i < this.markers_.length; i++) { if (marker === this.markers_[i]) { return true; } } } return false; }; /** * @name MarkerClustererOptions * @class This class represents the optional parameter passed to * the {@link MarkerClusterer} constructor. * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square. * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or * <code>null</code> if clustering is to be enabled at all zoom levels. * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is * clicked. You may want to set this to <code>false</code> if you have installed a handler * for the <code>click</code> event and it deals with zooming on its own. * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be * the average position of all markers in the cluster. If set to <code>false</code>, the * cluster marker is positioned at the location of the first marker added to the cluster. * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster * before the markers are hidden and a cluster marker appears. * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You * may want to set this to <code>true</code> to ensure that hidden markers are not included * in the marker count that appears on a cluster marker (this count is the value of the * <code>text</code> property of the result returned by the default <code>calculator</code>). * If set to <code>true</code> and you change the visibility of a marker being clustered, be * sure to also call <code>MarkerClusterer.repaint()</code>. * @property {string} [title=""] The tooltip to display when the mouse moves over a cluster * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a * different tooltip for each cluster marker.) * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine * the text to be displayed on a cluster marker and the index indicating which style to use * for the cluster marker. The input parameters for the function are (1) the array of markers * represented by a cluster marker and (2) the number of cluster icon styles. It returns a * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a * <code>text</code> property which is the number of markers in the cluster and an * <code>index</code> property which is one higher than the lowest integer such that * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles * array, whichever is less. The <code>styles</code> array element used has an index of * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a * <code>text</code> value of <code>"125"</code> and an <code>index</code> of <code>3</code> * for a cluster icon representing 125 markers so the element used in the <code>styles</code> * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code> * property that contains the text of the tooltip to be used for the cluster marker. If * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code> * property for the MarkerClusterer. * @property {string} [clusterClass="cluster"] The name of the CSS class defining general styles * for the cluster markers. Use this class to define CSS styles that are not set up by the code * that processes the <code>styles</code> array. * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles * of the cluster markers to be used. The element to be used to style a given cluster marker * is determined by the function defined by the <code>calculator</code> property. * The default is an array of {@link ClusterIconStyle} elements whose properties are derived * from the values for <code>imagePath</code>, <code>imageExtension</code>, and * <code>imageSizes</code>. * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that * have sizes that are some multiple (typically double) of their actual display size. Icons such * as these look better when viewed on high-resolution monitors such as Apple's Retina displays. * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons. * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the * number of markers to be processed in a single batch when using a browser other than * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead). * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is * being used, markers are processed in several batches with a small delay inserted between * each batch in an attempt to avoid Javascript timeout errors. Set this property to the * number of markers to be processed in a single batch; select as high a number as you can * without causing a timeout error in the browser. This number might need to be as low as 100 * if 15,000 markers are being managed, for example. * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH] * The full URL of the root name of the group of image files to use for cluster icons. * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code> * where n is the image file number (1, 2, etc.). * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION] * The extension name for the cluster icon image files (e.g., <code>"png"</code> or * <code>"jpg"</code>). * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES] * An array of numbers containing the widths of the group of * <code>imagePath</code>n.<code>imageExtension</code> image files. * (The images are assumed to be square.) */ /** * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}. * @constructor * @extends google.maps.OverlayView * @param {google.maps.Map} map The Google map to attach to. * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster. * @param {MarkerClustererOptions} [opt_options] The optional parameters. */ function MarkerClusterer(map, opt_markers, opt_options) { // MarkerClusterer implements google.maps.OverlayView interface. We use the // extend function to extend MarkerClusterer with google.maps.OverlayView // because it might not always be available when the code is defined so we // look for it at the last possible moment. If it doesn't exist now then // there is no point going ahead :) this.extend(MarkerClusterer, google.maps.OverlayView); opt_markers = opt_markers || []; opt_options = opt_options || {}; this.markers_ = []; this.clusters_ = []; this.listeners_ = []; this.activeMap_ = null; this.ready_ = false; this.gridSize_ = opt_options.gridSize || 60; this.minClusterSize_ = opt_options.minimumClusterSize || 2; this.maxZoom_ = opt_options.maxZoom || null; this.styles_ = opt_options.styles || []; this.title_ = opt_options.title || ""; this.zoomOnClick_ = true; if (opt_options.zoomOnClick !== undefined) { this.zoomOnClick_ = opt_options.zoomOnClick; } this.averageCenter_ = false; if (opt_options.averageCenter !== undefined) { this.averageCenter_ = opt_options.averageCenter; } this.ignoreHidden_ = false; if (opt_options.ignoreHidden !== undefined) { this.ignoreHidden_ = opt_options.ignoreHidden; } this.enableRetinaIcons_ = false; if (opt_options.enableRetinaIcons !== undefined) { this.enableRetinaIcons_ = opt_options.enableRetinaIcons; } this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH; this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION; this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES; this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR; this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE; this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE; this.clusterClass_ = opt_options.clusterClass || "cluster"; if (navigator.userAgent.toLowerCase().indexOf("msie") !== -1) { // Try to avoid IE timeout when processing a huge number of markers: this.batchSize_ = this.batchSizeIE_; } this.setupStyles_(); this.addMarkers(opt_markers, true); this.setMap(map); // Note: this causes onAdd to be called } /** * Implementation of the onAdd interface method. * @ignore */ MarkerClusterer.prototype.onAdd = function () { var cMarkerClusterer = this; this.activeMap_ = this.getMap(); this.ready_ = true; this.repaint(); // Add the map event listeners this.listeners_ = [ google.maps.event.addListener(this.getMap(), "zoom_changed", function () { cMarkerClusterer.resetViewport_(false); // Workaround for this Google bug: when map is at level 0 and "-" of // zoom slider is clicked, a "zoom_changed" event is fired even though // the map doesn't zoom out any further. In this situation, no "idle" // event is triggered so the cluster markers that have been removed // do not get redrawn. Same goes for a zoom in at maxZoom. if (this.getZoom() === (this.get("minZoom") || 0) || this.getZoom() === this.get("maxZoom")) { google.maps.event.trigger(this, "idle"); } }), google.maps.event.addListener(this.getMap(), "idle", function () { cMarkerClusterer.redraw_(); }) ]; }; /** * Implementation of the onRemove interface method. * Removes map event listeners and all cluster icons from the DOM. * All managed markers are also put back on the map. * @ignore */ MarkerClusterer.prototype.onRemove = function () { var i; // Put all the managed markers back on the map: for (i = 0; i < this.markers_.length; i++) { if (this.markers_[i].getMap() !== this.activeMap_) { this.markers_[i].setMap(this.activeMap_); } } // Remove all clusters: for (i = 0; i < this.clusters_.length; i++) { this.clusters_[i].remove(); } this.clusters_ = []; // Remove map event listeners: for (i = 0; i < this.listeners_.length; i++) { google.maps.event.removeListener(this.listeners_[i]); } this.listeners_ = []; this.activeMap_ = null; this.ready_ = false; }; /** * Implementation of the draw interface method. * @ignore */ MarkerClusterer.prototype.draw = function () {}; /** * Sets up the styles object. */ MarkerClusterer.prototype.setupStyles_ = function () { var i, size; if (this.styles_.length > 0) { return; } for (i = 0; i < this.imageSizes_.length; i++) { size = this.imageSizes_[i]; this.styles_.push({ url: this.imagePath_ + (i + 1) + "." + this.imageExtension_, height: size, width: size }); } }; /** * Fits the map to the bounds of the markers managed by the clusterer. */ MarkerClusterer.prototype.fitMapToMarkers = function () { var i; var markers = this.getMarkers(); var bounds = new google.maps.LatLngBounds(); for (i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } this.getMap().fitBounds(bounds); }; /** * Returns the value of the <code>gridSize</code> property. * * @return {number} The grid size. */ MarkerClusterer.prototype.getGridSize = function () { return this.gridSize_; }; /** * Sets the value of the <code>gridSize</code> property. * * @param {number} gridSize The grid size. */ MarkerClusterer.prototype.setGridSize = function (gridSize) { this.gridSize_ = gridSize; }; /** * Returns the value of the <code>minimumClusterSize</code> property. * * @return {number} The minimum cluster size. */ MarkerClusterer.prototype.getMinimumClusterSize = function () { return this.minClusterSize_; }; /** * Sets the value of the <code>minimumClusterSize</code> property. * * @param {number} minimumClusterSize The minimum cluster size. */ MarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) { this.minClusterSize_ = minimumClusterSize; }; /** * Returns the value of the <code>maxZoom</code> property. * * @return {number} The maximum zoom level. */ MarkerClusterer.prototype.getMaxZoom = function () { return this.maxZoom_; }; /** * Sets the value of the <code>maxZoom</code> property. * * @param {number} maxZoom The maximum zoom level. */ MarkerClusterer.prototype.setMaxZoom = function (maxZoom) { this.maxZoom_ = maxZoom; }; /** * Returns the value of the <code>styles</code> property. * * @return {Array} The array of styles defining the cluster markers to be used. */ MarkerClusterer.prototype.getStyles = function () { return this.styles_; }; /** * Sets the value of the <code>styles</code> property. * * @param {Array.<ClusterIconStyle>} styles The array of styles to use. */ MarkerClusterer.prototype.setStyles = function (styles) { this.styles_ = styles; }; /** * Returns the value of the <code>title</code> property. * * @return {string} The content of the title text. */ MarkerClusterer.prototype.getTitle = function () { return this.title_; }; /** * Sets the value of the <code>title</code> property. * * @param {string} title The value of the title property. */ MarkerClusterer.prototype.setTitle = function (title) { this.title_ = title; }; /** * Returns the value of the <code>zoomOnClick</code> property. * * @return {boolean} True if zoomOnClick property is set. */ MarkerClusterer.prototype.getZoomOnClick = function () { return this.zoomOnClick_; }; /** * Sets the value of the <code>zoomOnClick</code> property. * * @param {boolean} zoomOnClick The value of the zoomOnClick property. */ MarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) { this.zoomOnClick_ = zoomOnClick; }; /** * Returns the value of the <code>averageCenter</code> property. * * @return {boolean} True if averageCenter property is set. */ MarkerClusterer.prototype.getAverageCenter = function () { return this.averageCenter_; }; /** * Sets the value of the <code>averageCenter</code> property. * * @param {boolean} averageCenter The value of the averageCenter property. */ MarkerClusterer.prototype.setAverageCenter = function (averageCenter) { this.averageCenter_ = averageCenter; }; /** * Returns the value of the <code>ignoreHidden</code> property. * * @return {boolean} True if ignoreHidden property is set. */ MarkerClusterer.prototype.getIgnoreHidden = function () { return this.ignoreHidden_; }; /** * Sets the value of the <code>ignoreHidden</code> property. * * @param {boolean} ignoreHidden The value of the ignoreHidden property. */ MarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) { this.ignoreHidden_ = ignoreHidden; }; /** * Returns the value of the <code>enableRetinaIcons</code> property. * * @return {boolean} True if enableRetinaIcons property is set. */ MarkerClusterer.prototype.getEnableRetinaIcons = function () { return this.enableRetinaIcons_; }; /** * Sets the value of the <code>enableRetinaIcons</code> property. * * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property. */ MarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) { this.enableRetinaIcons_ = enableRetinaIcons; }; /** * Returns the value of the <code>imageExtension</code> property. * * @return {string} The value of the imageExtension property. */ MarkerClusterer.prototype.getImageExtension = function () { return this.imageExtension_; }; /** * Sets the value of the <code>imageExtension</code> property. * * @param {string} imageExtension The value of the imageExtension property. */ MarkerClusterer.prototype.setImageExtension = function (imageExtension) { this.imageExtension_ = imageExtension; }; /** * Returns the value of the <code>imagePath</code> property. * * @return {string} The value of the imagePath property. */ MarkerClusterer.prototype.getImagePath = function () { return this.imagePath_; }; /** * Sets the value of the <code>imagePath</code> property. * * @param {string} imagePath The value of the imagePath property. */ MarkerClusterer.prototype.setImagePath = function (imagePath) { this.imagePath_ = imagePath; }; /** * Returns the value of the <code>imageSizes</code> property. * * @return {Array} The value of the imageSizes property. */ MarkerClusterer.prototype.getImageSizes = function () { return this.imageSizes_; }; /** * Sets the value of the <code>imageSizes</code> property. * * @param {Array} imageSizes The value of the imageSizes property. */ MarkerClusterer.prototype.setImageSizes = function (imageSizes) { this.imageSizes_ = imageSizes; }; /** * Returns the value of the <code>calculator</code> property. * * @return {function} the value of the calculator property. */ MarkerClusterer.prototype.getCalculator = function () { return this.calculator_; }; /** * Sets the value of the <code>calculator</code> property. * * @param {function(Array.<google.maps.Marker>, number)} calculator The value * of the calculator property. */ MarkerClusterer.prototype.setCalculator = function (calculator) { this.calculator_ = calculator; }; /** * Returns the value of the <code>batchSizeIE</code> property. * * @return {number} the value of the batchSizeIE property. */ MarkerClusterer.prototype.getBatchSizeIE = function () { return this.batchSizeIE_; }; /** * Sets the value of the <code>batchSizeIE</code> property. * * @param {number} batchSizeIE The value of the batchSizeIE property. */ MarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) { this.batchSizeIE_ = batchSizeIE; }; /** * Returns the value of the <code>clusterClass</code> property. * * @return {string} the value of the clusterClass property. */ MarkerClusterer.prototype.getClusterClass = function () { return this.clusterClass_; }; /** * Sets the value of the <code>clusterClass</code> property. * * @param {string} clusterClass The value of the clusterClass property. */ MarkerClusterer.prototype.setClusterClass = function (clusterClass) { this.clusterClass_ = clusterClass; }; /** * Returns the array of markers managed by the clusterer. * * @return {Array} The array of markers managed by the clusterer. */ MarkerClusterer.prototype.getMarkers = function () { return this.markers_; }; /** * Returns the number of markers managed by the clusterer. * * @return {number} The number of markers. */ MarkerClusterer.prototype.getTotalMarkers = function () { return this.markers_.length; }; /** * Returns the current array of clusters formed by the clusterer. * * @return {Array} The array of clusters formed by the clusterer. */ MarkerClusterer.prototype.getClusters = function () { return this.clusters_; }; /** * Returns the number of clusters formed by the clusterer. * * @return {number} The number of clusters formed by the clusterer. */ MarkerClusterer.prototype.getTotalClusters = function () { return this.clusters_.length; }; /** * Adds a marker to the clusterer. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. * * @param {google.maps.Marker} marker The marker to add. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. */ MarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) { this.pushMarkerTo_(marker); if (!opt_nodraw) { this.redraw_(); } }; /** * Adds an array of markers to the clusterer. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. * * @param {Array.<google.maps.Marker>} markers The markers to add. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. */ MarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) { var key; for (key in markers) { if (markers.hasOwnProperty(key)) { this.pushMarkerTo_(markers[key]); } } if (!opt_nodraw) { this.redraw_(); } }; /** * Pushes a marker to the clusterer. * * @param {google.maps.Marker} marker The marker to add. */ MarkerClusterer.prototype.pushMarkerTo_ = function (marker) { // If the marker is draggable add a listener so we can update the clusters on the dragend: if (marker.getDraggable()) { var cMarkerClusterer = this; google.maps.event.addListener(marker, "dragend", function () { if (cMarkerClusterer.ready_) { this.isAdded = false; cMarkerClusterer.repaint(); } }); } marker.isAdded = false; this.markers_.push(marker); }; /** * Removes a marker from the cluster. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the * marker was removed from the clusterer. * * @param {google.maps.Marker} marker The marker to remove. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. * @return {boolean} True if the marker was removed from the clusterer. */ MarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) { var removed = this.removeMarker_(marker); if (!opt_nodraw && removed) { this.repaint(); } return removed; }; /** * Removes an array of markers from the cluster. The clusters are redrawn unless * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers * were removed from the clusterer. * * @param {Array.<google.maps.Marker>} markers The markers to remove. * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing. * @return {boolean} True if markers were removed from the clusterer. */ MarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) { var i, r; var removed = false; for (i = 0; i < markers.length; i++) { r = this.removeMarker_(markers[i]); removed = removed || r; } if (!opt_nodraw && removed) { this.repaint(); } return removed; }; /** * Removes a marker and returns true if removed, false if not. * * @param {google.maps.Marker} marker The marker to remove * @return {boolean} Whether the marker was removed or not */ MarkerClusterer.prototype.removeMarker_ = function (marker) { var i; var index = -1; if (this.markers_.indexOf) { index = this.markers_.indexOf(marker); } else { for (i = 0; i < this.markers_.length; i++) { if (marker === this.markers_[i]) { index = i; break; } } } if (index === -1) { // Marker is not in our list of markers, so do nothing: return false; } marker.setMap(null); this.markers_.splice(index, 1); // Remove the marker from the list of managed markers return true; }; /** * Removes all clusters and markers from the map and also removes all markers * managed by the clusterer. */ MarkerClusterer.prototype.clearMarkers = function () { this.resetViewport_(true); this.markers_ = []; }; /** * Recalculates and redraws all the marker clusters from scratch. * Call this after changing any properties. */ MarkerClusterer.prototype.repaint = function () { var oldClusters = this.clusters_.slice(); this.clusters_ = []; this.resetViewport_(false); this.redraw_(); // Remove the old clusters. // Do it in a timeout to prevent blinking effect. setTimeout(function () { var i; for (i = 0; i < oldClusters.length; i++) { oldClusters[i].remove(); } }, 0); }; /** * Returns the current bounds extended by the grid size. * * @param {google.maps.LatLngBounds} bounds The bounds to extend. * @return {google.maps.LatLngBounds} The extended bounds. * @ignore */ MarkerClusterer.prototype.getExtendedBounds = function (bounds) { var projection = this.getProjection(); // Turn the bounds into latlng. var tr = new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng()); var bl = new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()); // Convert the points to pixels and the extend out by the grid size. var trPix = projection.fromLatLngToDivPixel(tr); trPix.x += this.gridSize_; trPix.y -= this.gridSize_; var blPix = projection.fromLatLngToDivPixel(bl); blPix.x -= this.gridSize_; blPix.y += this.gridSize_; // Convert the pixel points back to LatLng var ne = projection.fromDivPixelToLatLng(trPix); var sw = projection.fromDivPixelToLatLng(blPix); // Extend the bounds to contain the new bounds. bounds.extend(ne); bounds.extend(sw); return bounds; }; /** * Redraws all the clusters. */ MarkerClusterer.prototype.redraw_ = function () { this.createClusters_(0); }; /** * Removes all clusters from the map. The markers are also removed from the map * if <code>opt_hide</code> is set to <code>true</code>. * * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers * from the map. */ MarkerClusterer.prototype.resetViewport_ = function (opt_hide) { var i, marker; // Remove all the clusters for (i = 0; i < this.clusters_.length; i++) { this.clusters_[i].remove(); } this.clusters_ = []; // Reset the markers to not be added and to be removed from the map. for (i = 0; i < this.markers_.length; i++) { marker = this.markers_[i]; marker.isAdded = false; if (opt_hide) { marker.setMap(null); } } }; /** * Calculates the distance between two latlng locations in km. * * @param {google.maps.LatLng} p1 The first lat lng point. * @param {google.maps.LatLng} p2 The second lat lng point. * @return {number} The distance between the two points in km. * @see http://www.movable-type.co.uk/scripts/latlong.html */ MarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) { var R = 6371; // Radius of the Earth in km var dLat = (p2.lat() - p1.lat()) * Math.PI / 180; var dLon = (p2.lng() - p1.lng()) * Math.PI / 180; var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); var d = R * c; return d; }; /** * Determines if a marker is contained in a bounds. * * @param {google.maps.Marker} marker The marker to check. * @param {google.maps.LatLngBounds} bounds The bounds to check against. * @return {boolean} True if the marker is in the bounds. */ MarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) { return bounds.contains(marker.getPosition()); }; /** * Adds a marker to a cluster, or creates a new cluster. * * @param {google.maps.Marker} marker The marker to add. */ MarkerClusterer.prototype.addToClosestCluster_ = function (marker) { var i, d, cluster, center; var distance = 40000; // Some large number var clusterToAddTo = null; for (i = 0; i < this.clusters_.length; i++) { cluster = this.clusters_[i]; center = cluster.getCenter(); if (center) { d = this.distanceBetweenPoints_(center, marker.getPosition()); if (d < distance) { distance = d; clusterToAddTo = cluster; } } } if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) { clusterToAddTo.addMarker(marker); } else { cluster = new Cluster(this); cluster.addMarker(marker); this.clusters_.push(cluster); } }; /** * Creates the clusters. This is done in batches to avoid timeout errors * in some browsers when there is a huge number of markers. * * @param {number} iFirst The index of the first marker in the batch of * markers to be added to clusters. */ MarkerClusterer.prototype.createClusters_ = function (iFirst) { var i, marker; var mapBounds; var cMarkerClusterer = this; if (!this.ready_) { return; } // Cancel previous batch processing if we're working on the first batch: if (iFirst === 0) { /** * This event is fired when the <code>MarkerClusterer</code> begins * clustering markers. * @name MarkerClusterer#clusteringbegin * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered. * @event */ google.maps.event.trigger(this, "clusteringbegin", this); if (typeof this.timerRefStatic !== "undefined") { clearTimeout(this.timerRefStatic); delete this.timerRefStatic; } } // Get our current map view bounds. // Create a new bounds object so we don't affect the map. // // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug: if (this.getMap().getZoom() > 3) { mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(), this.getMap().getBounds().getNorthEast()); } else { mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625)); } var bounds = this.getExtendedBounds(mapBounds); var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length); for (i = iFirst; i < iLast; i++) { marker = this.markers_[i]; if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) { if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) { this.addToClosestCluster_(marker); } } } if (iLast < this.markers_.length) { this.timerRefStatic = setTimeout(function () { cMarkerClusterer.createClusters_(iLast); }, 0); } else { delete this.timerRefStatic; /** * This event is fired when the <code>MarkerClusterer</code> stops * clustering markers. * @name MarkerClusterer#clusteringend * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered. * @event */ google.maps.event.trigger(this, "clusteringend", this); } }; /** * Extends an object's prototype by another's. * * @param {Object} obj1 The object to be extended. * @param {Object} obj2 The object to extend with. * @return {Object} The new extended object. * @ignore */ MarkerClusterer.prototype.extend = function (obj1, obj2) { return (function (object) { var property; for (property in object.prototype) { this.prototype[property] = object.prototype[property]; } return this; }).apply(obj1, [obj2]); }; /** * The default function for determining the label text and style * for a cluster icon. * * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster. * @param {number} numStyles The number of marker styles available. * @return {ClusterIconInfo} The information resource for the cluster. * @constant * @ignore */ MarkerClusterer.CALCULATOR = function (markers, numStyles) { var index = 0; var title = ""; var count = markers.length.toString(); var dv = count; while (dv !== 0) { dv = parseInt(dv / 10, 10); index++; } index = Math.min(index, numStyles); return { text: count, index: index, title: title }; }; /** * The number of markers to process in one batch. * * @type {number} * @constant */ MarkerClusterer.BATCH_SIZE = 2000; /** * The number of markers to process in one batch (IE only). * * @type {number} * @constant */ MarkerClusterer.BATCH_SIZE_IE = 500; /** * The default root name for the marker cluster images. * * @type {string} * @constant */ MarkerClusterer.IMAGE_PATH = "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m"; /** * The default extension name for the marker cluster images. * * @type {string} * @constant */ MarkerClusterer.IMAGE_EXTENSION = "png"; /** * The default array of sizes for the marker cluster images. * * @type {Array.<number>} * @constant */ MarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90]; if (typeof String.prototype.trim !== 'function') { /** * IE hack since trim() doesn't exist in all browsers * @return {string} The string with removed whitespace */ String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } } ;/** * 1.1.9-patched * @name MarkerWithLabel for V3 * @version 1.1.8 [February 26, 2013] * @author Gary Little (inspired by code from Marc Ridey of Google). * @copyright Copyright 2012 Gary Little [gary at luxcentral.com] * @fileoverview MarkerWithLabel extends the Google Maps JavaScript API V3 * <code>google.maps.Marker</code> class. * <p> * MarkerWithLabel allows you to define markers with associated labels. As you would expect, * if the marker is draggable, so too will be the label. In addition, a marker with a label * responds to all mouse events in the same manner as a regular marker. It also fires mouse * events and "property changed" events just as a regular marker would. Version 1.1 adds * support for the raiseOnDrag feature introduced in API V3.3. * <p> * If you drag a marker by its label, you can cancel the drag and return the marker to its * original position by pressing the <code>Esc</code> key. This doesn't work if you drag the marker * itself because this feature is not (yet) supported in the <code>google.maps.Marker</code> class. */ /*! * * 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. */ /*jslint browser:true */ /*global document,google */ /** * @param {Function} childCtor Child class. * @param {Function} parentCtor Parent class. */ function inherits(childCtor, parentCtor) { /** @constructor */ function tempCtor() {} tempCtor.prototype = parentCtor.prototype; childCtor.superClass_ = parentCtor.prototype; childCtor.prototype = new tempCtor(); /** @override */ childCtor.prototype.constructor = childCtor; } /** * This constructor creates a label and associates it with a marker. * It is for the private use of the MarkerWithLabel class. * @constructor * @param {Marker} marker The marker with which the label is to be associated. * @param {string} crossURL The URL of the cross image =. * @param {string} handCursor The URL of the hand cursor. * @private */ function MarkerLabel_(marker, crossURL, handCursorURL) { this.marker_ = marker; this.handCursorURL_ = marker.handCursorURL; this.labelDiv_ = document.createElement("div"); this.labelDiv_.style.cssText = "position: absolute; overflow: hidden;"; // Set up the DIV for handling mouse events in the label. This DIV forms a transparent veil // in the "overlayMouseTarget" pane, a veil that covers just the label. This is done so that // events can be captured even if the label is in the shadow of a google.maps.InfoWindow. // Code is included here to ensure the veil is always exactly the same size as the label. this.eventDiv_ = document.createElement("div"); this.eventDiv_.style.cssText = this.labelDiv_.style.cssText; // This is needed for proper behavior on MSIE: this.eventDiv_.setAttribute("onselectstart", "return false;"); this.eventDiv_.setAttribute("ondragstart", "return false;"); // Get the DIV for the "X" to be displayed when the marker is raised. this.crossDiv_ = MarkerLabel_.getSharedCross(crossURL); } inherits(MarkerLabel_, google.maps.OverlayView); /** * Returns the DIV for the cross used when dragging a marker when the * raiseOnDrag parameter set to true. One cross is shared with all markers. * @param {string} crossURL The URL of the cross image =. * @private */ MarkerLabel_.getSharedCross = function (crossURL) { var div; if (typeof MarkerLabel_.getSharedCross.crossDiv === "undefined") { div = document.createElement("img"); div.style.cssText = "position: absolute; z-index: 1000002; display: none;"; // Hopefully Google never changes the standard "X" attributes: div.style.marginLeft = "-8px"; div.style.marginTop = "-9px"; div.src = crossURL; MarkerLabel_.getSharedCross.crossDiv = div; } return MarkerLabel_.getSharedCross.crossDiv; }; /** * Adds the DIV representing the label to the DOM. This method is called * automatically when the marker's <code>setMap</code> method is called. * @private */ MarkerLabel_.prototype.onAdd = function () { var me = this; var cMouseIsDown = false; var cDraggingLabel = false; var cSavedZIndex; var cLatOffset, cLngOffset; var cIgnoreClick; var cRaiseEnabled; var cStartPosition; var cStartCenter; // Constants: var cRaiseOffset = 20; var cDraggingCursor = "url(" + this.handCursorURL_ + ")"; // Stops all processing of an event. // var cAbortEvent = function (e) { if (e.preventDefault) { e.preventDefault(); } e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } }; var cStopBounce = function () { me.marker_.setAnimation(null); }; this.getPanes().overlayImage.appendChild(this.labelDiv_); this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_); // One cross is shared with all markers, so only add it once: if (typeof MarkerLabel_.getSharedCross.processed === "undefined") { this.getPanes().overlayImage.appendChild(this.crossDiv_); MarkerLabel_.getSharedCross.processed = true; } this.listeners_ = [ google.maps.event.addDomListener(this.eventDiv_, "mouseover", function (e) { if (me.marker_.getDraggable() || me.marker_.getClickable()) { this.style.cursor = "pointer"; google.maps.event.trigger(me.marker_, "mouseover", e); } }), google.maps.event.addDomListener(this.eventDiv_, "mouseout", function (e) { if ((me.marker_.getDraggable() || me.marker_.getClickable()) && !cDraggingLabel) { this.style.cursor = me.marker_.getCursor(); google.maps.event.trigger(me.marker_, "mouseout", e); } }), google.maps.event.addDomListener(this.eventDiv_, "mousedown", function (e) { cDraggingLabel = false; if (me.marker_.getDraggable()) { cMouseIsDown = true; this.style.cursor = cDraggingCursor; } if (me.marker_.getDraggable() || me.marker_.getClickable()) { google.maps.event.trigger(me.marker_, "mousedown", e); cAbortEvent(e); // Prevent map pan when starting a drag on a label } }), google.maps.event.addDomListener(document, "mouseup", function (mEvent) { var position; if (cMouseIsDown) { cMouseIsDown = false; me.eventDiv_.style.cursor = "pointer"; google.maps.event.trigger(me.marker_, "mouseup", mEvent); } if (cDraggingLabel) { if (cRaiseEnabled) { // Lower the marker & label position = me.getProjection().fromLatLngToDivPixel(me.marker_.getPosition()); position.y += cRaiseOffset; me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position)); // This is not the same bouncing style as when the marker portion is dragged, // but it will have to do: try { // Will fail if running Google Maps API earlier than V3.3 me.marker_.setAnimation(google.maps.Animation.BOUNCE); setTimeout(cStopBounce, 1406); } catch (e) {} } me.crossDiv_.style.display = "none"; me.marker_.setZIndex(cSavedZIndex); cIgnoreClick = true; // Set flag to ignore the click event reported after a label drag cDraggingLabel = false; mEvent.latLng = me.marker_.getPosition(); google.maps.event.trigger(me.marker_, "dragend", mEvent); } }), google.maps.event.addListener(me.marker_.getMap(), "mousemove", function (mEvent) { var position; if (cMouseIsDown) { if (cDraggingLabel) { // Change the reported location from the mouse position to the marker position: mEvent.latLng = new google.maps.LatLng(mEvent.latLng.lat() - cLatOffset, mEvent.latLng.lng() - cLngOffset); position = me.getProjection().fromLatLngToDivPixel(mEvent.latLng); if (cRaiseEnabled) { me.crossDiv_.style.left = position.x + "px"; me.crossDiv_.style.top = position.y + "px"; me.crossDiv_.style.display = ""; position.y -= cRaiseOffset; } me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position)); if (cRaiseEnabled) { // Don't raise the veil; this hack needed to make MSIE act properly me.eventDiv_.style.top = (position.y + cRaiseOffset) + "px"; } google.maps.event.trigger(me.marker_, "drag", mEvent); } else { // Calculate offsets from the click point to the marker position: cLatOffset = mEvent.latLng.lat() - me.marker_.getPosition().lat(); cLngOffset = mEvent.latLng.lng() - me.marker_.getPosition().lng(); cSavedZIndex = me.marker_.getZIndex(); cStartPosition = me.marker_.getPosition(); cStartCenter = me.marker_.getMap().getCenter(); cRaiseEnabled = me.marker_.get("raiseOnDrag"); cDraggingLabel = true; me.marker_.setZIndex(1000000); // Moves the marker & label to the foreground during a drag mEvent.latLng = me.marker_.getPosition(); google.maps.event.trigger(me.marker_, "dragstart", mEvent); } } }), google.maps.event.addDomListener(document, "keydown", function (e) { if (cDraggingLabel) { if (e.keyCode === 27) { // Esc key cRaiseEnabled = false; me.marker_.setPosition(cStartPosition); me.marker_.getMap().setCenter(cStartCenter); google.maps.event.trigger(document, "mouseup", e); } } }), google.maps.event.addDomListener(this.eventDiv_, "click", function (e) { if (me.marker_.getDraggable() || me.marker_.getClickable()) { if (cIgnoreClick) { // Ignore the click reported when a label drag ends cIgnoreClick = false; } else { google.maps.event.trigger(me.marker_, "click", e); cAbortEvent(e); // Prevent click from being passed on to map } } }), google.maps.event.addDomListener(this.eventDiv_, "dblclick", function (e) { if (me.marker_.getDraggable() || me.marker_.getClickable()) { google.maps.event.trigger(me.marker_, "dblclick", e); cAbortEvent(e); // Prevent map zoom when double-clicking on a label } }), google.maps.event.addListener(this.marker_, "dragstart", function (mEvent) { if (!cDraggingLabel) { cRaiseEnabled = this.get("raiseOnDrag"); } }), google.maps.event.addListener(this.marker_, "drag", function (mEvent) { if (!cDraggingLabel) { if (cRaiseEnabled) { me.setPosition(cRaiseOffset); // During a drag, the marker's z-index is temporarily set to 1000000 to // ensure it appears above all other markers. Also set the label's z-index // to 1000000 (plus or minus 1 depending on whether the label is supposed // to be above or below the marker). me.labelDiv_.style.zIndex = 1000000 + (this.get("labelInBackground") ? -1 : +1); } } }), google.maps.event.addListener(this.marker_, "dragend", function (mEvent) { if (!cDraggingLabel) { if (cRaiseEnabled) { me.setPosition(0); // Also restores z-index of label } } }), google.maps.event.addListener(this.marker_, "position_changed", function () { me.setPosition(); }), google.maps.event.addListener(this.marker_, "zindex_changed", function () { me.setZIndex(); }), google.maps.event.addListener(this.marker_, "visible_changed", function () { me.setVisible(); }), google.maps.event.addListener(this.marker_, "labelvisible_changed", function () { me.setVisible(); }), google.maps.event.addListener(this.marker_, "title_changed", function () { me.setTitle(); }), google.maps.event.addListener(this.marker_, "labelcontent_changed", function () { me.setContent(); }), google.maps.event.addListener(this.marker_, "labelanchor_changed", function () { me.setAnchor(); }), google.maps.event.addListener(this.marker_, "labelclass_changed", function () { me.setStyles(); }), google.maps.event.addListener(this.marker_, "labelstyle_changed", function () { me.setStyles(); }) ]; }; /** * Removes the DIV for the label from the DOM. It also removes all event handlers. * This method is called automatically when the marker's <code>setMap(null)</code> * method is called. * @private */ MarkerLabel_.prototype.onRemove = function () { var i; if (this.labelDiv_.parentNode !== null) this.labelDiv_.parentNode.removeChild(this.labelDiv_); if (this.eventDiv_.parentNode !== null) this.eventDiv_.parentNode.removeChild(this.eventDiv_); // Remove event listeners: for (i = 0; i < this.listeners_.length; i++) { google.maps.event.removeListener(this.listeners_[i]); } }; /** * Draws the label on the map. * @private */ MarkerLabel_.prototype.draw = function () { this.setContent(); this.setTitle(); this.setStyles(); }; /** * Sets the content of the label. * The content can be plain text or an HTML DOM node. * @private */ MarkerLabel_.prototype.setContent = function () { var content = this.marker_.get("labelContent"); if (typeof content.nodeType === "undefined") { this.labelDiv_.innerHTML = content; this.eventDiv_.innerHTML = this.labelDiv_.innerHTML; } else { this.labelDiv_.innerHTML = ""; // Remove current content this.labelDiv_.appendChild(content); content = content.cloneNode(true); this.eventDiv_.appendChild(content); } }; /** * Sets the content of the tool tip for the label. It is * always set to be the same as for the marker itself. * @private */ MarkerLabel_.prototype.setTitle = function () { this.eventDiv_.title = this.marker_.getTitle() || ""; }; /** * Sets the style of the label by setting the style sheet and applying * other specific styles requested. * @private */ MarkerLabel_.prototype.setStyles = function () { var i, labelStyle; // Apply style values from the style sheet defined in the labelClass parameter: this.labelDiv_.className = this.marker_.get("labelClass"); this.eventDiv_.className = this.labelDiv_.className; // Clear existing inline style values: this.labelDiv_.style.cssText = ""; this.eventDiv_.style.cssText = ""; // Apply style values defined in the labelStyle parameter: labelStyle = this.marker_.get("labelStyle"); for (i in labelStyle) { if (labelStyle.hasOwnProperty(i)) { this.labelDiv_.style[i] = labelStyle[i]; this.eventDiv_.style[i] = labelStyle[i]; } } this.setMandatoryStyles(); }; /** * Sets the mandatory styles to the DIV representing the label as well as to the * associated event DIV. This includes setting the DIV position, z-index, and visibility. * @private */ MarkerLabel_.prototype.setMandatoryStyles = function () { this.labelDiv_.style.position = "absolute"; this.labelDiv_.style.overflow = "hidden"; // Make sure the opacity setting causes the desired effect on MSIE: if (typeof this.labelDiv_.style.opacity !== "undefined" && this.labelDiv_.style.opacity !== "") { this.labelDiv_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(opacity=" + (this.labelDiv_.style.opacity * 100) + ")\""; this.labelDiv_.style.filter = "alpha(opacity=" + (this.labelDiv_.style.opacity * 100) + ")"; } this.eventDiv_.style.position = this.labelDiv_.style.position; this.eventDiv_.style.overflow = this.labelDiv_.style.overflow; this.eventDiv_.style.opacity = 0.01; // Don't use 0; DIV won't be clickable on MSIE this.eventDiv_.style.MsFilter = "\"progid:DXImageTransform.Microsoft.Alpha(opacity=1)\""; this.eventDiv_.style.filter = "alpha(opacity=1)"; // For MSIE this.setAnchor(); this.setPosition(); // This also updates z-index, if necessary. this.setVisible(); }; /** * Sets the anchor point of the label. * @private */ MarkerLabel_.prototype.setAnchor = function () { var anchor = this.marker_.get("labelAnchor"); this.labelDiv_.style.marginLeft = -anchor.x + "px"; this.labelDiv_.style.marginTop = -anchor.y + "px"; this.eventDiv_.style.marginLeft = -anchor.x + "px"; this.eventDiv_.style.marginTop = -anchor.y + "px"; }; /** * Sets the position of the label. The z-index is also updated, if necessary. * @private */ MarkerLabel_.prototype.setPosition = function (yOffset) { var position = this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition()); if (typeof yOffset === "undefined") { yOffset = 0; } this.labelDiv_.style.left = Math.round(position.x) + "px"; this.labelDiv_.style.top = Math.round(position.y - yOffset) + "px"; this.eventDiv_.style.left = this.labelDiv_.style.left; this.eventDiv_.style.top = this.labelDiv_.style.top; this.setZIndex(); }; /** * Sets the z-index of the label. If the marker's z-index property has not been defined, the z-index * of the label is set to the vertical coordinate of the label. This is in keeping with the default * stacking order for Google Maps: markers to the south are in front of markers to the north. * @private */ MarkerLabel_.prototype.setZIndex = function () { var zAdjust = (this.marker_.get("labelInBackground") ? -1 : +1); if (typeof this.marker_.getZIndex() === "undefined") { this.labelDiv_.style.zIndex = parseInt(this.labelDiv_.style.top, 10) + zAdjust; this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex; } else { this.labelDiv_.style.zIndex = this.marker_.getZIndex() + zAdjust; this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex; } }; /** * Sets the visibility of the label. The label is visible only if the marker itself is * visible (i.e., its visible property is true) and the labelVisible property is true. * @private */ MarkerLabel_.prototype.setVisible = function () { if (this.marker_.get("labelVisible")) { this.labelDiv_.style.display = this.marker_.getVisible() ? "block" : "none"; } else { this.labelDiv_.style.display = "none"; } this.eventDiv_.style.display = this.labelDiv_.style.display; }; /** * @name MarkerWithLabelOptions * @class This class represents the optional parameter passed to the {@link MarkerWithLabel} constructor. * The properties available are the same as for <code>google.maps.Marker</code> with the addition * of the properties listed below. To change any of these additional properties after the labeled * marker has been created, call <code>google.maps.Marker.set(propertyName, propertyValue)</code>. * <p> * When any of these properties changes, a property changed event is fired. The names of these * events are derived from the name of the property and are of the form <code>propertyname_changed</code>. * For example, if the content of the label changes, a <code>labelcontent_changed</code> event * is fired. * <p> * @property {string|Node} [labelContent] The content of the label (plain text or an HTML DOM node). * @property {Point} [labelAnchor] By default, a label is drawn with its anchor point at (0,0) so * that its top left corner is positioned at the anchor point of the associated marker. Use this * property to change the anchor point of the label. For example, to center a 50px-wide label * beneath a marker, specify a <code>labelAnchor</code> of <code>google.maps.Point(25, 0)</code>. * (Note: x-values increase to the right and y-values increase to the top.) * @property {string} [labelClass] The name of the CSS class defining the styles for the label. * Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>, * <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and * <code>marginTop</code> are ignored; these styles are for internal use only. * @property {Object} [labelStyle] An object literal whose properties define specific CSS * style values to be applied to the label. Style values defined here override those that may * be defined in the <code>labelClass</code> style sheet. If this property is changed after the * label has been created, all previously set styles (except those defined in the style sheet) * are removed from the label before the new style values are applied. * Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>, * <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and * <code>marginTop</code> are ignored; these styles are for internal use only. * @property {boolean} [labelInBackground] A flag indicating whether a label that overlaps its * associated marker should appear in the background (i.e., in a plane below the marker). * The default is <code>false</code>, which causes the label to appear in the foreground. * @property {boolean} [labelVisible] A flag indicating whether the label is to be visible. * The default is <code>true</code>. Note that even if <code>labelVisible</code> is * <code>true</code>, the label will <i>not</i> be visible unless the associated marker is also * visible (i.e., unless the marker's <code>visible</code> property is <code>true</code>). * @property {boolean} [raiseOnDrag] A flag indicating whether the label and marker are to be * raised when the marker is dragged. The default is <code>true</code>. If a draggable marker is * being created and a version of Google Maps API earlier than V3.3 is being used, this property * must be set to <code>false</code>. * @property {boolean} [optimized] A flag indicating whether rendering is to be optimized for the * marker. <b>Important: The optimized rendering technique is not supported by MarkerWithLabel, * so the value of this parameter is always forced to <code>false</code>. * @property {string} [crossImage="http://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"] * The URL of the cross image to be displayed while dragging a marker. * @property {string} [handCursor="http://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"] * The URL of the cursor to be displayed while dragging a marker. */ /** * Creates a MarkerWithLabel with the options specified in {@link MarkerWithLabelOptions}. * @constructor * @param {MarkerWithLabelOptions} [opt_options] The optional parameters. */ function MarkerWithLabel(opt_options) { opt_options = opt_options || {}; opt_options.labelContent = opt_options.labelContent || ""; opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0); opt_options.labelClass = opt_options.labelClass || "markerLabels"; opt_options.labelStyle = opt_options.labelStyle || {}; opt_options.labelInBackground = opt_options.labelInBackground || false; if (typeof opt_options.labelVisible === "undefined") { opt_options.labelVisible = true; } if (typeof opt_options.raiseOnDrag === "undefined") { opt_options.raiseOnDrag = true; } if (typeof opt_options.clickable === "undefined") { opt_options.clickable = true; } if (typeof opt_options.draggable === "undefined") { opt_options.draggable = false; } if (typeof opt_options.optimized === "undefined") { opt_options.optimized = false; } opt_options.crossImage = opt_options.crossImage || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"; opt_options.handCursor = opt_options.handCursor || "http" + (document.location.protocol === "https:" ? "s" : "") + "://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"; opt_options.optimized = false; // Optimized rendering is not supported this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor); // Bind the label to the marker // Call the parent constructor. It calls Marker.setValues to initialize, so all // the new parameters are conveniently saved and can be accessed with get/set. // Marker.set triggers a property changed event (called "propertyname_changed") // that the marker label listens for in order to react to state changes. google.maps.Marker.apply(this, arguments); } inherits(MarkerWithLabel, google.maps.Marker); /** * Overrides the standard Marker setMap function. * @param {Map} theMap The map to which the marker is to be added. * @private */ MarkerWithLabel.prototype.setMap = function (theMap) { // Call the inherited function... google.maps.Marker.prototype.setMap.apply(this, arguments); // ... then deal with the label: this.label.setMap(theMap); };;/* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ (function() { angular.module("google-maps.wrapped", []); angular.module("google-maps.extensions", ["google-maps.wrapped"]); angular.module("google-maps.directives.api.utils", ['google-maps.extensions']); angular.module("google-maps.directives.api.managers", []); angular.module("google-maps.directives.api.models.child", ["google-maps.directives.api.utils"]); angular.module("google-maps.directives.api.models.parent", ["google-maps.directives.api.managers", "google-maps.directives.api.models.child"]); angular.module("google-maps.directives.api", ["google-maps.directives.api.models.parent"]); angular.module("google-maps", ["google-maps.directives.api"]).factory("debounce", [ "$timeout", function($timeout) { return function(fn) { var nthCall; nthCall = 0; return function() { var argz, later, that; that = this; argz = arguments; nthCall++; later = (function(version) { return function() { if (version === nthCall) { return fn.apply(that, argz); } }; })(nthCall); return $timeout(later, 0, true); }; }; } ]); }).call(this); (function() { angular.module("google-maps.extensions").service('ExtendGWin', function() { return { init: _.once(function() { if (!(google || (typeof google !== "undefined" && google !== null ? google.maps : void 0) || (google.maps.InfoWindow != null))) { return; } google.maps.InfoWindow.prototype._open = google.maps.InfoWindow.prototype.open; google.maps.InfoWindow.prototype._close = google.maps.InfoWindow.prototype.close; google.maps.InfoWindow.prototype._isOpen = false; google.maps.InfoWindow.prototype.open = function(map, anchor) { this._isOpen = true; this._open(map, anchor); }; google.maps.InfoWindow.prototype.close = function() { this._isOpen = false; this._close(); }; google.maps.InfoWindow.prototype.isOpen = function(val) { if (val == null) { val = void 0; } if (val == null) { return this._isOpen; } else { return this._isOpen = val; } }; /* Do the same for InfoBox TODO: Clean this up so the logic is defined once, wait until develop becomes master as this will be easier */ if (!window.InfoBox) { return; } window.InfoBox.prototype._open = window.InfoBox.prototype.open; window.InfoBox.prototype._close = window.InfoBox.prototype.close; window.InfoBox.prototype._isOpen = false; window.InfoBox.prototype.open = function(map, anchor) { this._isOpen = true; this._open(map, anchor); }; window.InfoBox.prototype.close = function() { this._isOpen = false; this._close(); }; window.InfoBox.prototype.isOpen = function(val) { if (val == null) { val = void 0; } if (val == null) { return this._isOpen; } else { return this._isOpen = val; } }; MarkerLabel_.prototype.setContent = function() { var content; content = this.marker_.get("labelContent"); if (!content || _.isEqual(this.oldContent, content)) { return; } if (typeof (content != null ? content.nodeType : void 0) === "undefined") { this.labelDiv_.innerHTML = content; this.eventDiv_.innerHTML = this.labelDiv_.innerHTML; this.oldContent = content; } else { this.labelDiv_.innerHTML = ""; this.labelDiv_.appendChild(content); content = content.cloneNode(true); this.eventDiv_.appendChild(content); this.oldContent = content; } }; /* Removes the DIV for the label from the DOM. It also removes all event handlers. This method is called automatically when the marker's <code>setMap(null)</code> method is called. @private */ return MarkerLabel_.prototype.onRemove = function() { if (this.labelDiv_.parentNode != null) { this.labelDiv_.parentNode.removeChild(this.labelDiv_); } if (this.eventDiv_.parentNode != null) { this.eventDiv_.parentNode.removeChild(this.eventDiv_); } if (!this.listeners_) { return; } if (!this.listeners_.length) { return; } this.listeners_.forEach(function(l) { return google.maps.event.removeListener(l); }); }; }) }; }); }).call(this); /* Author Nick McCready Intersection of Objects if the arrays have something in common each intersecting object will be returned in an new array. */ (function() { _.intersectionObjects = function(array1, array2, comparison) { var res, _this = this; if (comparison == null) { comparison = void 0; } res = _.map(array1, function(obj1) { return _.find(array2, function(obj2) { if (comparison != null) { return comparison(obj1, obj2); } else { return _.isEqual(obj1, obj2); } }); }); return _.filter(res, function(o) { return o != null; }); }; _.containsObject = _.includeObject = function(obj, target, comparison) { var _this = this; if (comparison == null) { comparison = void 0; } if (obj === null) { return false; } return _.any(obj, function(value) { if (comparison != null) { return comparison(value, target); } else { return _.isEqual(value, target); } }); }; _.differenceObjects = function(array1, array2, comparison) { if (comparison == null) { comparison = void 0; } return _.filter(array1, function(value) { return !_.containsObject(array2, value, comparison); }); }; _.withoutObjects = _.differenceObjects; _.indexOfObject = function(array, item, comparison, isSorted) { var i, length; if (array == null) { return -1; } i = 0; length = array.length; if (isSorted) { if (typeof isSorted === "number") { i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); } else { i = _.sortedIndex(array, item); return (array[i] === item ? i : -1); } } while (i < length) { if (comparison != null) { if (comparison(array[i], item)) { return i; } } else { if (_.isEqual(array[i], item)) { return i; } } i++; } return -1; }; _["extends"] = function(arrayOfObjectsToCombine) { return _.reduce(arrayOfObjectsToCombine, function(combined, toAdd) { return _.extend(combined, toAdd); }, {}); }; _.isNullOrUndefined = function(thing) { return _.isNull(thing || _.isUndefined(thing)); }; }).call(this); (function() { String.prototype.contains = function(value, fromIndex) { return this.indexOf(value, fromIndex) !== -1; }; String.prototype.flare = function(flare) { if (flare == null) { flare = 'nggmap'; } return flare + this; }; String.prototype.ns = String.prototype.flare; }).call(this); /* Author: Nicholas McCready & jfriend00 _async handles things asynchronous-like :), to allow the UI to be free'd to do other things Code taken from http://stackoverflow.com/questions/10344498/best-way-to-iterate-over-an-array-without-blocking-the-ui The design of any funcitonality of _async is to be like lodash/underscore and replicate it but call things asynchronously underneath. Each should be sufficient for most things to be derrived from. TODO: Handle Object iteration like underscore and lodash as well.. not that important right now */ (function() { var async; async = { each: function(array, callback, doneCallBack, pausedCallBack, chunk, index, pause) { var doChunk; if (chunk == null) { chunk = 20; } if (index == null) { index = 0; } if (pause == null) { pause = 1; } if (!pause) { throw "pause (delay) must be set from _async!"; return; } if (array === void 0 || (array != null ? array.length : void 0) <= 0) { doneCallBack(); return; } doChunk = function() { var cnt, i; cnt = chunk; i = index; while (cnt-- && i < (array ? array.length : i + 1)) { callback(array[i], i); ++i; } if (array) { if (i < array.length) { index = i; if (pausedCallBack != null) { pausedCallBack(); } return setTimeout(doChunk, pause); } else { if (doneCallBack) { return doneCallBack(); } } } }; return doChunk(); }, map: function(objs, iterator, doneCallBack, pausedCallBack, chunk) { var results; results = []; if (objs == null) { return results; } return _async.each(objs, function(o) { return results.push(iterator(o)); }, function() { return doneCallBack(results); }, pausedCallBack, chunk); } }; window._async = async; angular.module("google-maps.directives.api.utils").factory("async", function() { return window._async; }); }).call(this); (function() { var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; angular.module("google-maps.directives.api.utils").factory("BaseObject", function() { var BaseObject, baseObjectKeywords; baseObjectKeywords = ['extended', 'included']; BaseObject = (function() { function BaseObject() {} BaseObject.extend = function(obj) { var key, value, _ref; for (key in obj) { value = obj[key]; if (__indexOf.call(baseObjectKeywords, key) < 0) { this[key] = value; } } if ((_ref = obj.extended) != null) { _ref.apply(this); } return this; }; BaseObject.include = function(obj) { var key, value, _ref; for (key in obj) { value = obj[key]; if (__indexOf.call(baseObjectKeywords, key) < 0) { this.prototype[key] = value; } } if ((_ref = obj.included) != null) { _ref.apply(this); } return this; }; return BaseObject; })(); return BaseObject; }); }).call(this); /* Useful function callbacks that should be defined at later time. Mainly to be used for specs to verify creation / linking. This is to lead a common design in notifying child stuff. */ (function() { angular.module("google-maps.directives.api.utils").factory("ChildEvents", function() { return { onChildCreation: function(child) {} }; }); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service('CtrlHandle', [ '$q', function($q) { var CtrlHandle; return CtrlHandle = { handle: function($scope, $element) { $scope.deferred = $q.defer(); return { getScope: function() { return $scope; } }; }, mapPromise: function(scope, ctrl) { var mapScope; mapScope = ctrl.getScope(); mapScope.deferred.promise.then(function(map) { return scope.map = map; }); return mapScope.deferred.promise; } }; } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("EventsHelper", [ "Logger", function($log) { return { setEvents: function(gObject, scope, model, ignores) { if (angular.isDefined(scope.events) && (scope.events != null) && angular.isObject(scope.events)) { return _.compact(_.map(scope.events, function(eventHandler, eventName) { var doIgnore; if (ignores) { doIgnore = _(ignores).contains(eventName); } if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName]) && !doIgnore) { return google.maps.event.addListener(gObject, eventName, function() { return eventHandler.apply(scope, [gObject, eventName, model, arguments]); }); } else { return $log.info("EventHelper: invalid event listener " + eventName); } })); } }, removeEvents: function(listeners) { return listeners != null ? listeners.forEach(function(l) { return google.maps.event.removeListener(l); }) : void 0; } }; } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.utils").factory("FitHelper", [ "BaseObject", "Logger", function(BaseObject, $log) { var FitHelper, _ref; return FitHelper = (function(_super) { __extends(FitHelper, _super); function FitHelper() { _ref = FitHelper.__super__.constructor.apply(this, arguments); return _ref; } FitHelper.prototype.fit = function(gMarkers, gMap) { var bounds, everSet, _this = this; if (gMap && gMarkers && gMarkers.length > 0) { bounds = new google.maps.LatLngBounds(); everSet = false; return _async.each(gMarkers, function(gMarker) { if (gMarker) { if (!everSet) { everSet = true; } return bounds.extend(gMarker.getPosition()); } }, function() { if (everSet) { return gMap.fitBounds(bounds); } }); } }; return FitHelper; })(BaseObject); } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("GmapUtil", [ "Logger", "$compile", function(Logger, $compile) { var getCoords, getLatitude, getLongitude, setCoordsFromEvent, validateCoords; getLatitude = function(value) { if (Array.isArray(value) && value.length === 2) { return value[1]; } else if (angular.isDefined(value.type) && value.type === "Point") { return value.coordinates[1]; } else { return value.latitude; } }; getLongitude = function(value) { if (Array.isArray(value) && value.length === 2) { return value[0]; } else if (angular.isDefined(value.type) && value.type === "Point") { return value.coordinates[0]; } else { return value.longitude; } }; getCoords = function(value) { if (!value) { return; } if (Array.isArray(value) && value.length === 2) { return new google.maps.LatLng(value[1], value[0]); } else if (angular.isDefined(value.type) && value.type === "Point") { return new google.maps.LatLng(value.coordinates[1], value.coordinates[0]); } else { return new google.maps.LatLng(value.latitude, value.longitude); } }; setCoordsFromEvent = function(prevValue, newLatLon) { if (!prevValue) { return; } if (Array.isArray(prevValue) && prevValue.length === 2) { prevValue[1] = newLatLon.lat(); prevValue[0] = newLatLon.lng(); } else if (angular.isDefined(prevValue.type) && prevValue.type === "Point") { prevValue.coordinates[1] = newLatLon.lat(); prevValue.coordinates[0] = newLatLon.lng(); } else { prevValue.latitude = newLatLon.lat(); prevValue.longitude = newLatLon.lng(); } return prevValue; }; validateCoords = function(coords) { if (angular.isUndefined(coords)) { return false; } if (_.isArray(coords)) { if (coords.length === 2) { return true; } } else if ((coords != null) && (coords != null ? coords.type : void 0)) { if (coords.type === "Point" && _.isArray(coords.coordinates) && coords.coordinates.length === 2) { return true; } } if (coords && angular.isDefined((coords != null ? coords.latitude : void 0) && angular.isDefined(coords != null ? coords.longitude : void 0))) { return true; } return false; }; return { getLabelPositionPoint: function(anchor) { var xPos, yPos; if (anchor === void 0) { return void 0; } anchor = /^([-\d\.]+)\s([-\d\.]+)$/.exec(anchor); xPos = parseFloat(anchor[1]); yPos = parseFloat(anchor[2]); if ((xPos != null) && (yPos != null)) { return new google.maps.Point(xPos, yPos); } }, createMarkerOptions: function(coords, icon, defaults, map) { var opts; if (map == null) { map = void 0; } if (defaults == null) { defaults = {}; } opts = angular.extend({}, defaults, { position: defaults.position != null ? defaults.position : getCoords(coords), icon: defaults.icon != null ? defaults.icon : icon, visible: defaults.visible != null ? defaults.visible : validateCoords(coords) }); if (map != null) { opts.map = map; } return opts; }, createWindowOptions: function(gMarker, scope, content, defaults) { if ((content != null) && (defaults != null) && ($compile != null)) { return angular.extend({}, defaults, { content: this.buildContent(scope, defaults, content), position: defaults.position != null ? defaults.position : angular.isObject(gMarker) ? gMarker.getPosition() : getCoords(scope.coords) }); } else { if (!defaults) { Logger.error("infoWindow defaults not defined"); if (!content) { return Logger.error("infoWindow content not defined"); } } else { return defaults; } } }, buildContent: function(scope, defaults, content) { var parsed, ret; if (defaults.content != null) { ret = defaults.content; } else { if ($compile != null) { parsed = $compile(content)(scope); if (parsed.length > 0) { ret = parsed[0]; } } else { ret = content; } } return ret; }, defaultDelay: 50, isTrue: function(val) { return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true"; }, isFalse: function(value) { return ['false', 'FALSE', 0, 'n', 'N', 'no', 'NO'].indexOf(value) !== -1; }, getCoords: getCoords, validateCoords: validateCoords, equalCoords: function(coord1, coord2) { return getLatitude(coord1) === getLatitude(coord2) && getLongitude(coord1) === getLongitude(coord2); }, validatePath: function(path) { var array, i, polygon, trackMaxVertices; i = 0; if (angular.isUndefined(path.type)) { if (!Array.isArray(path) || path.length < 2) { return false; } while (i < path.length) { if (!((angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) || (typeof path[i].lat === "function" && typeof path[i].lng === "function"))) { return false; } i++; } return true; } else { if (angular.isUndefined(path.coordinates)) { return false; } if (path.type === "Polygon") { if (path.coordinates[0].length < 4) { return false; } array = path.coordinates[0]; } else if (path.type === "MultiPolygon") { trackMaxVertices = { max: 0, index: 0 }; _.forEach(path.coordinates, function(polygon, index) { if (polygon[0].length > this.max) { this.max = polygon[0].length; return this.index = index; } }, trackMaxVertices); polygon = path.coordinates[trackMaxVertices.index]; array = polygon[0]; if (array.length < 4) { return false; } } else if (path.type === "LineString") { if (path.coordinates.length < 2) { return false; } array = path.coordinates; } else { return false; } while (i < array.length) { if (array[i].length !== 2) { return false; } i++; } return true; } }, convertPathPoints: function(path) { var array, i, latlng, result, trackMaxVertices; i = 0; result = new google.maps.MVCArray(); if (angular.isUndefined(path.type)) { while (i < path.length) { latlng; if (angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) { latlng = new google.maps.LatLng(path[i].latitude, path[i].longitude); } else if (typeof path[i].lat === "function" && typeof path[i].lng === "function") { latlng = path[i]; } result.push(latlng); i++; } } else { array; if (path.type === "Polygon") { array = path.coordinates[0]; } else if (path.type === "MultiPolygon") { trackMaxVertices = { max: 0, index: 0 }; _.forEach(path.coordinates, function(polygon, index) { if (polygon[0].length > this.max) { this.max = polygon[0].length; return this.index = index; } }, trackMaxVertices); array = path.coordinates[trackMaxVertices.index][0]; } else if (path.type === "LineString") { array = path.coordinates; } while (i < array.length) { result.push(new google.maps.LatLng(array[i][1], array[i][0])); i++; } } return result; }, extendMapBounds: function(map, points) { var bounds, i; bounds = new google.maps.LatLngBounds(); i = 0; while (i < points.length) { bounds.extend(points.getAt(i)); i++; } return map.fitBounds(bounds); }, getPath: function(object, key) { var obj; obj = object; _.each(key.split("."), function(value) { if (obj) { return obj = obj[value]; } }); return obj; }, setCoordsFromEvent: setCoordsFromEvent }; } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("IsReady".ns(), [ '$q', '$timeout', function($q, $timeout) { var ctr, promises, proms; ctr = 0; proms = []; promises = function() { return $q.all(proms); }; return { spawn: function() { var d; d = $q.defer(); proms.push(d.promise); ctr += 1; return { instance: ctr, deferred: d }; }, promises: promises, instances: function() { return ctr; }, promise: function(expect) { var d, ohCrap; if (expect == null) { expect = 1; } d = $q.defer(); ohCrap = function() { return $timeout(function() { if (ctr !== expect) { return ohCrap(); } else { return d.resolve(promises()); } }); }; ohCrap(); return d.promise; } }; } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.utils").factory("Linked", [ "BaseObject", function(BaseObject) { var Linked; Linked = (function(_super) { __extends(Linked, _super); function Linked(scope, element, attrs, ctrls) { this.scope = scope; this.element = element; this.attrs = attrs; this.ctrls = ctrls; } return Linked; })(BaseObject); return Linked; } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").service("Logger", [ "$log", function($log) { return { doLog: false, info: function(msg) { if (this.doLog) { if ($log != null) { return $log.info(msg); } else { return console.info(msg); } } }, error: function(msg) { if (this.doLog) { if ($log != null) { return $log.error(msg); } else { return console.error(msg); } } }, warn: function(msg) { if (this.doLog) { if ($log != null) { return $log.warn(msg); } else { return console.warn(msg); } } } }; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.utils").factory("ModelKey", [ "BaseObject", "GmapUtil", function(BaseObject, GmapUtil) { var ModelKey; return ModelKey = (function(_super) { __extends(ModelKey, _super); function ModelKey(scope) { this.scope = scope; this.setIdKey = __bind(this.setIdKey, this); this.modelKeyComparison = __bind(this.modelKeyComparison, this); ModelKey.__super__.constructor.call(this); this.defaultIdKey = "id"; this.idKey = void 0; } ModelKey.prototype.evalModelHandle = function(model, modelKey) { if (model === void 0 || modelKey === void 0) { return void 0; } if (modelKey === 'self') { return model; } else { return GmapUtil.getPath(model, modelKey); } }; ModelKey.prototype.modelKeyComparison = function(model1, model2) { var scope; scope = this.scope.coords != null ? this.scope : this.parentScope; if (scope == null) { throw "No scope or parentScope set!"; } return GmapUtil.equalCoords(this.evalModelHandle(model1, scope.coords), this.evalModelHandle(model2, scope.coords)); }; ModelKey.prototype.setIdKey = function(scope) { return this.idKey = scope.idKey != null ? scope.idKey : this.defaultIdKey; }; ModelKey.prototype.setVal = function(model, key, newValue) { var thingToSet; thingToSet = this.modelOrKey(model, key); thingToSet = newValue; return model; }; ModelKey.prototype.modelOrKey = function(model, key) { var thing; thing = key !== 'self' ? model[key] : model; return thing; }; return ModelKey; })(BaseObject); } ]); }).call(this); (function() { angular.module("google-maps.directives.api.utils").factory("ModelsWatcher", [ "Logger", function(Logger) { return { figureOutState: function(idKey, scope, childObjects, comparison, callBack) { var adds, mappedScopeModelIds, removals, updates, _this = this; adds = []; mappedScopeModelIds = {}; removals = []; updates = []; return _async.each(scope.models, function(m) { var child; if (m[idKey] != null) { mappedScopeModelIds[m[idKey]] = {}; if (childObjects[m[idKey]] == null) { return adds.push(m); } else { child = childObjects[m[idKey]]; if (!comparison(m, child.model)) { return updates.push({ model: m, child: child }); } } } else { return Logger.error("id missing for model " + (m.toString()) + ", can not use do comparison/insertion"); } }, function() { return _async.each(childObjects.values(), function(c) { var id; if (c == null) { Logger.error("child undefined in ModelsWatcher."); return; } if (c.model == null) { Logger.error("child.model undefined in ModelsWatcher."); return; } id = c.model[idKey]; if (mappedScopeModelIds[id] == null) { return removals.push(c); } }, function() { return callBack({ adds: adds, removals: removals, updates: updates }); }); }); } }; } ]); }).call(this); /* Simple Object Map with a lenght property to make it easy to track length/size */ (function() { var propsToPop, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; propsToPop = ['get', 'put', 'remove', 'values', 'keys', 'length', 'push', 'didValueStateChange', 'didKeyStateChange', 'slice', 'removeAll', 'allVals', 'allKeys', 'stateChanged']; window.PropMap = (function() { function PropMap() { this.removeAll = __bind(this.removeAll, this); this.slice = __bind(this.slice, this); this.push = __bind(this.push, this); this.keys = __bind(this.keys, this); this.values = __bind(this.values, this); this.remove = __bind(this.remove, this); this.put = __bind(this.put, this); this.stateChanged = __bind(this.stateChanged, this); this.get = __bind(this.get, this); this.length = 0; this.didValueStateChange = false; this.didKeyStateChange = false; this.allVals = []; this.allKeys = []; } PropMap.prototype.get = function(key) { return this[key]; }; PropMap.prototype.stateChanged = function() { this.didValueStateChange = true; return this.didKeyStateChange = true; }; PropMap.prototype.put = function(key, value) { if (this.get(key) == null) { this.length++; } this.stateChanged(); return this[key] = value; }; PropMap.prototype.remove = function(key, isSafe) { var value; if (isSafe == null) { isSafe = false; } if (isSafe && !this.get(key)) { return void 0; } value = this[key]; delete this[key]; this.length--; this.stateChanged(); return value; }; PropMap.prototype.values = function() { var all, _this = this; if (!this.didValueStateChange) { return this.allVals; } all = []; this.keys().forEach(function(key) { if (_.indexOf(propsToPop, key) === -1) { return all.push(_this[key]); } }); all; this.didValueStateChange = false; this.keys(); return this.allVals = all; }; PropMap.prototype.keys = function() { var all, keys, _this = this; if (!this.didKeyStateChange) { return this.allKeys; } keys = _.keys(this); all = []; _.each(keys, function(prop) { if (_.indexOf(propsToPop, prop) === -1) { return all.push(prop); } }); this.didKeyStateChange = false; this.values(); return this.allKeys = all; }; PropMap.prototype.push = function(obj, key) { if (key == null) { key = "key"; } return this.put(obj[key], obj); }; PropMap.prototype.slice = function() { var _this = this; return this.keys().map(function(k) { return _this.remove(k); }); }; PropMap.prototype.removeAll = function() { return this.slice(); }; return PropMap; })(); angular.module("google-maps.directives.api.utils").factory("PropMap", function() { return window.PropMap; }); }).call(this); (function() { angular.module("google-maps.directives.api.utils").factory("nggmap-PropertyAction", [ "Logger", function(Logger) { var PropertyAction; PropertyAction = function(setterFn, isFirstSet) { var _this = this; this.setIfChange = function(newVal, oldVal) { if (!_.isEqual(oldVal, newVal || isFirstSet)) { return setterFn(newVal); } }; this.sic = function(oldVal, newVal) { return _this.setIfChange(oldVal, newVal); }; return this; }; return PropertyAction; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.managers").factory("ClustererMarkerManager", [ "Logger", "FitHelper", "PropMap", function($log, FitHelper, PropMap) { var ClustererMarkerManager; ClustererMarkerManager = (function(_super) { __extends(ClustererMarkerManager, _super); function ClustererMarkerManager(gMap, opt_markers, opt_options, opt_events) { var self; this.opt_events = opt_events; this.checkSync = __bind(this.checkSync, this); this.getGMarkers = __bind(this.getGMarkers, this); this.fit = __bind(this.fit, this); this.destroy = __bind(this.destroy, this); this.clear = __bind(this.clear, this); this.draw = __bind(this.draw, this); this.removeMany = __bind(this.removeMany, this); this.remove = __bind(this.remove, this); this.addMany = __bind(this.addMany, this); this.add = __bind(this.add, this); ClustererMarkerManager.__super__.constructor.call(this); self = this; this.opt_options = opt_options; if ((opt_options != null) && opt_markers === void 0) { this.clusterer = new NgMapMarkerClusterer(gMap, void 0, opt_options); } else if ((opt_options != null) && (opt_markers != null)) { this.clusterer = new NgMapMarkerClusterer(gMap, opt_markers, opt_options); } else { this.clusterer = new NgMapMarkerClusterer(gMap); } this.propMapGMarkers = new PropMap(); this.attachEvents(this.opt_events, "opt_events"); this.clusterer.setIgnoreHidden(true); this.noDrawOnSingleAddRemoves = true; $log.info(this); } ClustererMarkerManager.prototype.checkKey = function(gMarker) { var msg; if (gMarker.key == null) { msg = "gMarker.key undefined and it is REQUIRED!!"; return Logger.error(msg); } }; ClustererMarkerManager.prototype.add = function(gMarker) { var exists; this.checkKey(gMarker); exists = this.propMapGMarkers.get(gMarker.key) != null; this.clusterer.addMarker(gMarker, this.noDrawOnSingleAddRemoves); this.propMapGMarkers.put(gMarker.key, gMarker); return this.checkSync(); }; ClustererMarkerManager.prototype.addMany = function(gMarkers) { var _this = this; return gMarkers.forEach(function(gMarker) { return _this.add(gMarker); }); }; ClustererMarkerManager.prototype.remove = function(gMarker) { var exists; this.checkKey(gMarker); exists = this.propMapGMarkers.get(gMarker.key); if (exists) { this.clusterer.removeMarker(gMarker, this.noDrawOnSingleAddRemoves); this.propMapGMarkers.remove(gMarker.key); } return this.checkSync(); }; ClustererMarkerManager.prototype.removeMany = function(gMarkers) { var _this = this; return gMarkers.forEach(function(gMarker) { return _this.remove(gMarker); }); }; ClustererMarkerManager.prototype.draw = function() { return this.clusterer.repaint(); }; ClustererMarkerManager.prototype.clear = function() { this.removeMany(this.getGMarkers()); return this.clusterer.repaint(); }; ClustererMarkerManager.prototype.attachEvents = function(options, optionsName) { var eventHandler, eventName, _results; if (angular.isDefined(options) && (options != null) && angular.isObject(options)) { _results = []; for (eventName in options) { eventHandler = options[eventName]; if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) { $log.info("" + optionsName + ": Attaching event: " + eventName + " to clusterer"); _results.push(google.maps.event.addListener(this.clusterer, eventName, options[eventName])); } else { _results.push(void 0); } } return _results; } }; ClustererMarkerManager.prototype.clearEvents = function(options) { var eventHandler, eventName, _results; if (angular.isDefined(options) && (options != null) && angular.isObject(options)) { _results = []; for (eventName in options) { eventHandler = options[eventName]; if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) { $log.info("" + optionsName + ": Clearing event: " + eventName + " to clusterer"); _results.push(google.maps.event.clearListeners(this.clusterer, eventName)); } else { _results.push(void 0); } } return _results; } }; ClustererMarkerManager.prototype.destroy = function() { this.clearEvents(this.opt_events); this.clearEvents(this.opt_internal_events); return this.clear(); }; ClustererMarkerManager.prototype.fit = function() { return ClustererMarkerManager.__super__.fit.call(this, this.getGMarkers(), this.clusterer.getMap()); }; ClustererMarkerManager.prototype.getGMarkers = function() { return this.clusterer.getMarkers().values(); }; ClustererMarkerManager.prototype.checkSync = function() { if (this.getGMarkers().length !== this.propMapGMarkers.length) { throw "GMarkers out of Sync in MarkerClusterer"; } }; return ClustererMarkerManager; })(FitHelper); return ClustererMarkerManager; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.managers").factory("MarkerManager", [ "Logger", "FitHelper", "PropMap", function(Logger, FitHelper, PropMap) { var MarkerManager; MarkerManager = (function(_super) { __extends(MarkerManager, _super); MarkerManager.include(FitHelper); function MarkerManager(gMap, opt_markers, opt_options) { this.getGMarkers = __bind(this.getGMarkers, this); this.fit = __bind(this.fit, this); this.handleOptDraw = __bind(this.handleOptDraw, this); this.clear = __bind(this.clear, this); this.draw = __bind(this.draw, this); this.removeMany = __bind(this.removeMany, this); this.remove = __bind(this.remove, this); this.addMany = __bind(this.addMany, this); this.add = __bind(this.add, this); MarkerManager.__super__.constructor.call(this); this.gMap = gMap; this.gMarkers = new PropMap(); this.$log = Logger; this.$log.info(this); } MarkerManager.prototype.add = function(gMarker, optDraw) { var exists, msg; if (optDraw == null) { optDraw = true; } if (gMarker.key == null) { msg = "gMarker.key undefined and it is REQUIRED!!"; Logger.error(msg); throw msg; } exists = (this.gMarkers.get(gMarker.key)) != null; if (!exists) { this.handleOptDraw(gMarker, optDraw, true); return this.gMarkers.put(gMarker.key, gMarker); } }; MarkerManager.prototype.addMany = function(gMarkers) { var _this = this; return gMarkers.forEach(function(gMarker) { return _this.add(gMarker); }); }; MarkerManager.prototype.remove = function(gMarker, optDraw) { if (optDraw == null) { optDraw = true; } this.handleOptDraw(gMarker, optDraw, false); if (this.gMarkers.get(gMarker.key)) { return this.gMarkers.remove(gMarker.key); } }; MarkerManager.prototype.removeMany = function(gMarkers) { var _this = this; return this.gMarkers.values().forEach(function(marker) { return _this.remove(marker); }); }; MarkerManager.prototype.draw = function() { var deletes, _this = this; deletes = []; this.gMarkers.values().forEach(function(gMarker) { if (!gMarker.isDrawn) { if (gMarker.doAdd) { gMarker.setMap(_this.gMap); return gMarker.isDrawn = true; } else { return deletes.push(gMarker); } } }); return deletes.forEach(function(gMarker) { gMarker.isDrawn = false; return _this.remove(gMarker, true); }); }; MarkerManager.prototype.clear = function() { this.gMarkers.values().forEach(function(gMarker) { return gMarker.setMap(null); }); delete this.gMarkers; return this.gMarkers = new PropMap(); }; MarkerManager.prototype.handleOptDraw = function(gMarker, optDraw, doAdd) { if (optDraw === true) { if (doAdd) { gMarker.setMap(this.gMap); } else { gMarker.setMap(null); } return gMarker.isDrawn = true; } else { gMarker.isDrawn = false; return gMarker.doAdd = doAdd; } }; MarkerManager.prototype.fit = function() { return MarkerManager.__super__.fit.call(this, this.getGMarkers(), this.gMap); }; MarkerManager.prototype.getGMarkers = function() { return this.gMarkers.values(); }; return MarkerManager; })(FitHelper); return MarkerManager; } ]); }).call(this); (function() { angular.module("google-maps").factory("array-sync", [ "add-events", function(mapEvents) { return function(mapArray, scope, pathEval, pathChangedFn) { var geojsonArray, geojsonHandlers, geojsonWatcher, isSetFromScope, legacyHandlers, legacyWatcher, mapArrayListener, scopePath, watchListener; isSetFromScope = false; scopePath = scope.$eval(pathEval); if (!scope["static"]) { legacyHandlers = { set_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return scopePath[index] = value; } else { scopePath[index].latitude = value.lat(); return scopePath[index].longitude = value.lng(); } }, insert_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return scopePath.splice(index, 0, value); } else { return scopePath.splice(index, 0, { latitude: value.lat(), longitude: value.lng() }); } }, remove_at: function(index) { if (isSetFromScope) { return; } return scopePath.splice(index, 1); } }; geojsonArray; if (scopePath.type === "Polygon") { geojsonArray = scopePath.coordinates[0]; } else if (scopePath.type === "LineString") { geojsonArray = scopePath.coordinates; } geojsonHandlers = { set_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return; } geojsonArray[index][1] = value.lat(); return geojsonArray[index][0] = value.lng(); }, insert_at: function(index) { var value; if (isSetFromScope) { return; } value = mapArray.getAt(index); if (!value) { return; } if (!value.lng || !value.lat) { return; } return geojsonArray.splice(index, 0, [value.lng(), value.lat()]); }, remove_at: function(index) { if (isSetFromScope) { return; } return geojsonArray.splice(index, 1); } }; mapArrayListener = mapEvents(mapArray, angular.isUndefined(scopePath.type) ? legacyHandlers : geojsonHandlers); } legacyWatcher = function(newPath) { var changed, i, l, newLength, newValue, oldArray, oldLength, oldValue; isSetFromScope = true; oldArray = mapArray; changed = false; if (newPath) { i = 0; oldLength = oldArray.getLength(); newLength = newPath.length; l = Math.min(oldLength, newLength); newValue = void 0; while (i < l) { oldValue = oldArray.getAt(i); newValue = newPath[i]; if (typeof newValue.equals === "function") { if (!newValue.equals(oldValue)) { oldArray.setAt(i, newValue); changed = true; } } else { if ((oldValue.lat() !== newValue.latitude) || (oldValue.lng() !== newValue.longitude)) { oldArray.setAt(i, new google.maps.LatLng(newValue.latitude, newValue.longitude)); changed = true; } } i++; } while (i < newLength) { newValue = newPath[i]; if (typeof newValue.lat === "function" && typeof newValue.lng === "function") { oldArray.push(newValue); } else { oldArray.push(new google.maps.LatLng(newValue.latitude, newValue.longitude)); } changed = true; i++; } while (i < oldLength) { oldArray.pop(); changed = true; i++; } } isSetFromScope = false; if (changed) { return pathChangedFn(oldArray); } }; geojsonWatcher = function(newPath) { var array, changed, i, l, newLength, newValue, oldArray, oldLength, oldValue; isSetFromScope = true; oldArray = mapArray; changed = false; if (newPath) { array; if (scopePath.type === "Polygon") { array = newPath.coordinates[0]; } else if (scopePath.type === "LineString") { array = newPath.coordinates; } i = 0; oldLength = oldArray.getLength(); newLength = array.length; l = Math.min(oldLength, newLength); newValue = void 0; while (i < l) { oldValue = oldArray.getAt(i); newValue = array[i]; if ((oldValue.lat() !== newValue[1]) || (oldValue.lng() !== newValue[0])) { oldArray.setAt(i, new google.maps.LatLng(newValue[1], newValue[0])); changed = true; } i++; } while (i < newLength) { newValue = array[i]; oldArray.push(new google.maps.LatLng(newValue[1], newValue[0])); changed = true; i++; } while (i < oldLength) { oldArray.pop(); changed = true; i++; } } isSetFromScope = false; if (changed) { return pathChangedFn(oldArray); } }; watchListener; if (!scope["static"]) { if (angular.isUndefined(scopePath.type)) { watchListener = scope.$watchCollection(pathEval, legacyWatcher); } else { watchListener = scope.$watch(pathEval, geojsonWatcher, true); } } return function() { if (mapArrayListener) { mapArrayListener(); mapArrayListener = null; } if (watchListener) { watchListener(); return watchListener = null; } }; }; } ]); }).call(this); (function() { angular.module("google-maps").factory("add-events", [ "$timeout", function($timeout) { var addEvent, addEvents; addEvent = function(target, eventName, handler) { return google.maps.event.addListener(target, eventName, function() { handler.apply(this, arguments); return $timeout((function() {}), true); }); }; addEvents = function(target, eventName, handler) { var remove; if (handler) { return addEvent(target, eventName, handler); } remove = []; angular.forEach(eventName, function(_handler, key) { return remove.push(addEvent(target, key, _handler)); }); return function() { angular.forEach(remove, function(listener) { return google.maps.event.removeListener(listener); }); return remove = null; }; }; return addEvents; } ]); }).call(this); /* angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicholas McCready - https://twitter.com/nmccready Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawing-freehand , & http://jsfiddle.net/YsQdh/88/ */ (function() { angular.module("google-maps.directives.api.models.child").factory("DrawFreeHandChildModel", [ 'Logger', '$q', function($log, $q) { var drawFreeHand, freeHandMgr; drawFreeHand = function(map, polys, enable) { var move, poly; this.polys = polys; poly = new google.maps.Polyline({ map: map, clickable: false }); move = google.maps.event.addListener(map, 'mousemove', function(e) { return poly.getPath().push(e.latLng); }); google.maps.event.addListenerOnce(map, 'mouseup', function(e) { var path; google.maps.event.removeListener(move); path = poly.getPath(); poly.setMap(null); polys.push(new google.maps.Polygon({ map: map, path: path })); poly = null; google.maps.event.clearListeners(map.getDiv(), 'mousedown'); return enable(); }); return void 0; }; freeHandMgr = function(map) { var disableMap, enable, _this = this; this.map = map; enable = function() { var _ref; if ((_ref = _this.deferred) != null) { _ref.resolve(); } return _this.map.setOptions(_this.oldOptions); }; disableMap = function() { $log.info('disabling map move'); _this.oldOptions = map.getOptions(); return _this.map.setOptions({ draggable: false, zoomControl: false, scrollwheel: false, disableDoubleClickZoom: false }); }; this.engage = function(polys) { _this.polys = polys; _this.deferred = $q.defer(); disableMap(); $log.info('DrawFreeHandChildModel is engaged (drawing).'); google.maps.event.addDomListener(_this.map.getDiv(), 'mousedown', function(e) { return drawFreeHand(_this.map, _this.polys, enable); }); return _this.deferred.promise; }; return this; }; return freeHandMgr; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.child").factory("MarkerLabelChildModel", [ "BaseObject", "GmapUtil", function(BaseObject, GmapUtil) { var MarkerLabelChildModel; MarkerLabelChildModel = (function(_super) { __extends(MarkerLabelChildModel, _super); MarkerLabelChildModel.include(GmapUtil); function MarkerLabelChildModel(gMarker, options, map) { this.destroy = __bind(this.destroy, this); this.setOptions = __bind(this.setOptions, this); var self; MarkerLabelChildModel.__super__.constructor.call(this); self = this; this.gMarker = gMarker; this.setOptions(options); this.gMarkerLabel = new MarkerLabel_(this.gMarker, options.crossImage, options.handCursor); this.gMarker.set("setMap", function(theMap) { self.gMarkerLabel.setMap(theMap); return google.maps.Marker.prototype.setMap.apply(this, arguments); }); this.gMarker.setMap(map); } MarkerLabelChildModel.prototype.setOption = function(optStr, content) { /* COMENTED CODE SHOWS AWFUL CHROME BUG in Google Maps SDK 3, still happens in version 3.16 any animation will cause markers to disappear */ return this.gMarker.set(optStr, content); }; MarkerLabelChildModel.prototype.setOptions = function(options) { var _ref, _ref1; if (options != null ? options.labelContent : void 0) { this.gMarker.set("labelContent", options.labelContent); } if (options != null ? options.labelAnchor : void 0) { this.gMarker.set("labelAnchor", this.getLabelPositionPoint(options.labelAnchor)); } this.gMarker.set("labelClass", options.labelClass || 'labels'); this.gMarker.set("labelStyle", options.labelStyle || { opacity: 100 }); this.gMarker.set("labelInBackground", options.labelInBackground || false); if (!options.labelVisible) { this.gMarker.set("labelVisible", true); } if (!options.raiseOnDrag) { this.gMarker.set("raiseOnDrag", true); } if (!options.clickable) { this.gMarker.set("clickable", true); } if (!options.draggable) { this.gMarker.set("draggable", false); } if (!options.optimized) { this.gMarker.set("optimized", false); } options.crossImage = (_ref = options.crossImage) != null ? _ref : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png"; return options.handCursor = (_ref1 = options.handCursor) != null ? _ref1 : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur"; }; MarkerLabelChildModel.prototype.destroy = function() { if ((this.gMarkerLabel.labelDiv_.parentNode != null) && (this.gMarkerLabel.eventDiv_.parentNode != null)) { return this.gMarkerLabel.onRemove(); } }; return MarkerLabelChildModel; })(BaseObject); return MarkerLabelChildModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.child").factory("MarkerChildModel", [ "ModelKey", "GmapUtil", "Logger", "$injector", "EventsHelper", function(ModelKey, GmapUtil, $log, $injector, EventsHelper) { var MarkerChildModel; MarkerChildModel = (function(_super) { __extends(MarkerChildModel, _super); MarkerChildModel.include(GmapUtil); MarkerChildModel.include(EventsHelper); function MarkerChildModel(model, parentScope, gMap, $timeout, defaults, doClick, gMarkerManager, idKey, doDrawSelf) { var _this = this; this.model = model; this.parentScope = parentScope; this.gMap = gMap; this.$timeout = $timeout; this.defaults = defaults; this.doClick = doClick; this.gMarkerManager = gMarkerManager; this.idKey = idKey != null ? idKey : "id"; this.doDrawSelf = doDrawSelf != null ? doDrawSelf : true; this.watchDestroy = __bind(this.watchDestroy, this); this.internalEvents = __bind(this.internalEvents, this); this.setLabelOptions = __bind(this.setLabelOptions, this); this.setOptions = __bind(this.setOptions, this); this.setIcon = __bind(this.setIcon, this); this.setCoords = __bind(this.setCoords, this); this.destroy = __bind(this.destroy, this); this.maybeSetScopeValue = __bind(this.maybeSetScopeValue, this); this.createMarker = __bind(this.createMarker, this); this.setMyScope = __bind(this.setMyScope, this); if (this.model[this.idKey] != null) { this.id = this.model[this.idKey]; } this.iconKey = this.parentScope.icon; this.coordsKey = this.parentScope.coords; this.clickKey = this.parentScope.click(); this.optionsKey = this.parentScope.options; this.needRedraw = false; MarkerChildModel.__super__.constructor.call(this, this.parentScope.$new(false)); this.scope.model = this.model; this.setMyScope(this.model, void 0, true); this.createMarker(this.model); this.scope.$watch('model', function(newValue, oldValue) { if (newValue !== oldValue) { _this.setMyScope(newValue, oldValue); return _this.needRedraw = true; } }, true); $log.info(this); this.watchDestroy(this.scope); } MarkerChildModel.prototype.setMyScope = function(model, oldModel, isInit) { var _this = this; if (oldModel == null) { oldModel = void 0; } if (isInit == null) { isInit = false; } this.maybeSetScopeValue('icon', model, oldModel, this.iconKey, this.evalModelHandle, isInit, this.setIcon); this.maybeSetScopeValue('coords', model, oldModel, this.coordsKey, this.evalModelHandle, isInit, this.setCoords); if (_.isFunction(this.clickKey) && $injector) { return this.scope.click = function() { return $injector.invoke(_this.clickKey, void 0, { "$markerModel": model }); }; } else { this.maybeSetScopeValue('click', model, oldModel, this.clickKey, this.evalModelHandle, isInit); return this.createMarker(model, oldModel, isInit); } }; MarkerChildModel.prototype.createMarker = function(model, oldModel, isInit) { if (oldModel == null) { oldModel = void 0; } if (isInit == null) { isInit = false; } this.maybeSetScopeValue('options', model, oldModel, this.optionsKey, this.evalModelHandle, isInit, this.setOptions); if (this.parentScope.options && !this.scope.options) { return $log.error('Options not found on model!'); } }; MarkerChildModel.prototype.maybeSetScopeValue = function(scopePropName, model, oldModel, modelKey, evaluate, isInit, gSetter) { var newValue, oldVal; if (gSetter == null) { gSetter = void 0; } if (oldModel === void 0) { this.scope[scopePropName] = evaluate(model, modelKey); if (!isInit) { if (gSetter != null) { gSetter(this.scope); } } return; } oldVal = evaluate(oldModel, modelKey); newValue = evaluate(model, modelKey); if (newValue !== oldVal) { this.scope[scopePropName] = newValue; if (!isInit) { if (gSetter != null) { gSetter(this.scope); } if (this.doDrawSelf) { return this.gMarkerManager.draw(); } } } }; MarkerChildModel.prototype.destroy = function() { var _ref, _this = this; if (this.gMarker != null) { _(this.internalEvents()).each(function(event, name) { return google.maps.event.clearListeners(_this.gMarker, name); }); if (((_ref = this.parentScope) != null ? _ref.events : void 0) && _.isArray(this.parentScope.events)) { _(this.parentScope.events).each(function(event, eventName) { return google.maps.event.clearListeners(_this.gMarker, eventName); }); } this.gMarkerManager.remove(this.gMarker, true); delete this.gMarker; return this.scope.$destroy(); } }; MarkerChildModel.prototype.setCoords = function(scope) { if (scope.$id !== this.scope.$id || this.gMarker === void 0) { return; } if (scope.coords != null) { if (!this.validateCoords(this.scope.coords)) { $log.error("MarkerChildMarker cannot render marker as scope.coords as no position on marker: " + (JSON.stringify(this.model))); return; } this.gMarker.setPosition(this.getCoords(scope.coords)); this.gMarker.setVisible(this.validateCoords(scope.coords)); return this.gMarkerManager.add(this.gMarker); } else { return this.gMarkerManager.remove(this.gMarker); } }; MarkerChildModel.prototype.setIcon = function(scope) { if (scope.$id !== this.scope.$id || this.gMarker === void 0) { return; } this.gMarkerManager.remove(this.gMarker); this.gMarker.setIcon(scope.icon); this.gMarkerManager.add(this.gMarker); this.gMarker.setPosition(this.getCoords(scope.coords)); return this.gMarker.setVisible(this.validateCoords(scope.coords)); }; MarkerChildModel.prototype.setOptions = function(scope) { var ignore, _ref; if (scope.$id !== this.scope.$id) { return; } if (this.gMarker != null) { this.gMarkerManager.remove(this.gMarker); delete this.gMarker; } if (!((_ref = scope.coords) != null ? _ref : typeof scope.icon === "function" ? scope.icon(scope.options != null) : void 0)) { return; } this.opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options); delete this.gMarker; if (scope.isLabel) { this.gMarker = new MarkerWithLabel(this.setLabelOptions(this.opts)); } else { this.gMarker = new google.maps.Marker(this.opts); } this.setEvents(this.gMarker, this.parentScope, this.model, ignore = ['dragend']); this.setEvents(this.gMarker, { events: this.internalEvents() }, this.model); if (this.id != null) { this.gMarker.key = this.id; } return this.gMarkerManager.add(this.gMarker); }; MarkerChildModel.prototype.setLabelOptions = function(opts) { opts.labelAnchor = this.getLabelPositionPoint(opts.labelAnchor); return opts; }; MarkerChildModel.prototype.internalEvents = function() { var _this = this; return { dragend: function(marker, eventName, model, mousearg) { var newCoords, _ref, _ref1; newCoords = _this.setCoordsFromEvent(_this.modelOrKey(_this.scope.model, _this.coordsKey), _this.gMarker.getPosition()); _this.scope.model = _this.setVal(model, _this.coordsKey, newCoords); if (((_ref = _this.parentScope.events) != null ? _ref.dragend : void 0) != null) { if ((_ref1 = _this.parentScope.events) != null) { _ref1.dragend(marker, eventName, _this.scope.model, mousearg); } } return _this.scope.$apply(); }, click: function() { if (_this.doClick && (_this.scope.click != null)) { _this.scope.click(); return _this.scope.$apply(); } } }; }; MarkerChildModel.prototype.watchDestroy = function(scope) { return scope.$on("$destroy", this.destroy); }; return MarkerChildModel; })(ModelKey); return MarkerChildModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("PolylineChildModel", [ "BaseObject", "Logger", "$timeout", "array-sync", "GmapUtil", "EventsHelper", function(BaseObject, $log, $timeout, arraySync, GmapUtil, EventsHelper) { var PolylineChildModel; return PolylineChildModel = (function(_super) { __extends(PolylineChildModel, _super); PolylineChildModel.include(GmapUtil); PolylineChildModel.include(EventsHelper); function PolylineChildModel(scope, attrs, map, defaults, model) { var _this = this; this.scope = scope; this.attrs = attrs; this.map = map; this.defaults = defaults; this.model = model; this.clean = __bind(this.clean, this); this.buildOpts = __bind(this.buildOpts, this); scope.$watch('path', function(newValue, oldValue) { var pathPoints; if (!_.isEqual(newValue, oldValue) || !_this.polyline) { pathPoints = _this.convertPathPoints(scope.path); if (pathPoints.length > 0) { _this.polyline = new google.maps.Polyline(_this.buildOpts(pathPoints)); } if (_this.polyline) { if (scope.fit) { _this.extendMapBounds(map, pathPoints); } arraySync(_this.polyline.getPath(), scope, "path", function(pathPoints) { if (scope.fit) { return _this.extendMapBounds(map, pathPoints); } }); return _this.listeners = _this.model ? _this.setEvents(_this.polyline, scope, _this.model) : _this.setEvents(_this.polyline, scope, scope); } } }); if (!scope["static"] && angular.isDefined(scope.editable)) { scope.$watch("editable", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setEditable(newValue) : void 0; } }); } if (angular.isDefined(scope.draggable)) { scope.$watch("draggable", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setDraggable(newValue) : void 0; } }); } if (angular.isDefined(scope.visible)) { scope.$watch("visible", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setVisible(newValue) : void 0; } }); } if (angular.isDefined(scope.geodesic)) { scope.$watch("geodesic", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0; } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) { scope.$watch("stroke.weight", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0; } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) { scope.$watch("stroke.color", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0; } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) { scope.$watch("stroke.opacity", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0; } }); } if (angular.isDefined(scope.icons)) { scope.$watch("icons", function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { return (_ref = _this.polyline) != null ? _ref.setOptions(_this.buildOpts(_this.polyline.getPath())) : void 0; } }); } scope.$on("$destroy", function() { _this.clean(); return _this.scope = null; }); $log.info(this); } PolylineChildModel.prototype.buildOpts = function(pathPoints) { var opts, _this = this; opts = angular.extend({}, this.defaults, { map: this.map, path: pathPoints, icons: this.scope.icons, strokeColor: this.scope.stroke && this.scope.stroke.color, strokeOpacity: this.scope.stroke && this.scope.stroke.opacity, strokeWeight: this.scope.stroke && this.scope.stroke.weight }); angular.forEach({ clickable: true, draggable: false, editable: false, geodesic: false, visible: true, "static": false, fit: false }, function(defaultValue, key) { if (angular.isUndefined(_this.scope[key]) || _this.scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = _this.scope[key]; } }); if (opts["static"]) { opts.editable = false; } return opts; }; PolylineChildModel.prototype.clean = function() { var arraySyncer; this.removeEvents(this.listeners); this.polyline.setMap(null); this.polyline = null; if (arraySyncer) { arraySyncer(); return arraySyncer = null; } }; PolylineChildModel.prototype.destroy = function() { return this.scope.$destroy(); }; return PolylineChildModel; })(BaseObject); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.child").factory("WindowChildModel", [ "BaseObject", "GmapUtil", "Logger", "$compile", "$http", "$templateCache", function(BaseObject, GmapUtil, Logger, $compile, $http, $templateCache) { var WindowChildModel; WindowChildModel = (function(_super) { __extends(WindowChildModel, _super); WindowChildModel.include(GmapUtil); function WindowChildModel(model, scope, opts, isIconVisibleOnClick, mapCtrl, markerCtrl, element, needToManualDestroy, markerIsVisibleAfterWindowClose) { var _this = this; this.model = model; this.scope = scope; this.opts = opts; this.isIconVisibleOnClick = isIconVisibleOnClick; this.mapCtrl = mapCtrl; this.markerCtrl = markerCtrl; this.element = element; this.needToManualDestroy = needToManualDestroy != null ? needToManualDestroy : false; this.markerIsVisibleAfterWindowClose = markerIsVisibleAfterWindowClose != null ? markerIsVisibleAfterWindowClose : true; this.destroy = __bind(this.destroy, this); this.remove = __bind(this.remove, this); this.hideWindow = __bind(this.hideWindow, this); this.getLatestPosition = __bind(this.getLatestPosition, this); this.showWindow = __bind(this.showWindow, this); this.handleClick = __bind(this.handleClick, this); this.watchCoords = __bind(this.watchCoords, this); this.watchShow = __bind(this.watchShow, this); this.createGWin = __bind(this.createGWin, this); this.watchElement = __bind(this.watchElement, this); this.googleMapsHandles = []; this.$log = Logger; this.createGWin(); if (this.markerCtrl != null) { this.markerCtrl.setClickable(true); } this.watchElement(); this.watchShow(); this.watchCoords(); this.scope.$on("$destroy", function() { return _this.destroy(); }); this.$log.info(this); } WindowChildModel.prototype.watchElement = function() { var _this = this; return this.scope.$watch(function() { var _ref; if (!_this.element || !_this.html) { return; } if (_this.html !== _this.element.html()) { if (_this.gWin) { if ((_ref = _this.opts) != null) { _ref.content = void 0; } _this.remove(); _this.createGWin(); return _this.showHide(); } } }); }; WindowChildModel.prototype.createGWin = function() { var defaults, _this = this; if (this.gWin == null) { defaults = {}; if (this.opts != null) { if (this.scope.coords) { this.opts.position = this.getCoords(this.scope.coords); } defaults = this.opts; } if (this.element) { this.html = _.isObject(this.element) ? this.element.html() : this.element; } this.opts = this.createWindowOptions(this.markerCtrl, this.scope, this.html, defaults); } if ((this.opts != null) && !this.gWin) { if (this.opts.boxClass && (window.InfoBox && typeof window.InfoBox === 'function')) { this.gWin = new window.InfoBox(this.opts); } else { this.gWin = new google.maps.InfoWindow(this.opts); } if (this.gWin) { this.handleClick(); } return this.googleMapsHandles.push(google.maps.event.addListener(this.gWin, 'closeclick', function() { if (_this.markerCtrl) { _this.markerCtrl.setAnimation(_this.oldMarkerAnimation); if (_this.markerIsVisibleAfterWindowClose) { _.delay(function() { _this.markerCtrl.setVisible(false); return _this.markerCtrl.setVisible(_this.markerIsVisibleAfterWindowClose); }, 250); } } _this.gWin.isOpen(false); if (_this.scope.closeClick != null) { return _this.scope.closeClick(); } })); } }; WindowChildModel.prototype.watchShow = function() { var _this = this; return this.scope.$watch('show', function(newValue, oldValue) { if (newValue !== oldValue) { if (newValue) { return _this.showWindow(); } else { return _this.hideWindow(); } } else { if (_this.gWin != null) { if (newValue && !_this.gWin.getMap()) { return _this.showWindow(); } } } }, true); }; WindowChildModel.prototype.watchCoords = function() { var scope, _this = this; scope = this.markerCtrl != null ? this.scope.$parent : this.scope; return scope.$watch('coords', function(newValue, oldValue) { var pos; if (newValue !== oldValue) { if (newValue == null) { return _this.hideWindow(); } else { if (!_this.validateCoords(newValue)) { _this.$log.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: " + (JSON.stringify(_this.model))); return; } pos = _this.getCoords(newValue); _this.gWin.setPosition(pos); if (_this.opts) { return _this.opts.position = pos; } } } }, true); }; WindowChildModel.prototype.handleClick = function(forceClick) { var click, _this = this; click = function() { var pos; if (_this.gWin == null) { _this.createGWin(); } pos = _this.markerCtrl.getPosition(); if (_this.gWin != null) { _this.gWin.setPosition(pos); if (_this.opts) { _this.opts.position = pos; } _this.showWindow(); } _this.initialMarkerVisibility = _this.markerCtrl.getVisible(); _this.oldMarkerAnimation = _this.markerCtrl.getAnimation(); return _this.markerCtrl.setVisible(_this.isIconVisibleOnClick); }; if (this.markerCtrl != null) { if (forceClick) { click(); } return this.googleMapsHandles.push(google.maps.event.addListener(this.markerCtrl, 'click', click)); } }; WindowChildModel.prototype.showWindow = function() { var show, _this = this; show = function() { if (_this.gWin) { if ((_this.scope.show || (_this.scope.show == null)) && !_this.gWin.isOpen()) { return _this.gWin.open(_this.mapCtrl); } } }; if (this.scope.templateUrl) { if (this.gWin) { $http.get(this.scope.templateUrl, { cache: $templateCache }).then(function(content) { var compiled, templateScope; templateScope = _this.scope.$new(); if (angular.isDefined(_this.scope.templateParameter)) { templateScope.parameter = _this.scope.templateParameter; } compiled = $compile(content.data)(templateScope); return _this.gWin.setContent(compiled[0]); }); } return show(); } else { return show(); } }; WindowChildModel.prototype.showHide = function() { if (this.scope.show || (this.scope.show == null)) { return this.showWindow(); } else { return this.hideWindow(); } }; WindowChildModel.prototype.getLatestPosition = function(overridePos) { if ((this.gWin != null) && (this.markerCtrl != null) && !overridePos) { return this.gWin.setPosition(this.markerCtrl.getPosition()); } else { if (overridePos) { return this.gWin.setPosition(overridePos); } } }; WindowChildModel.prototype.hideWindow = function() { if ((this.gWin != null) && this.gWin.isOpen()) { return this.gWin.close(); } }; WindowChildModel.prototype.remove = function() { this.hideWindow(); _.each(this.googleMapsHandles, function(h) { return google.maps.event.removeListener(h); }); this.googleMapsHandles.length = 0; delete this.gWin; return delete this.opts; }; WindowChildModel.prototype.destroy = function(manualOverride) { var self; if (manualOverride == null) { manualOverride = false; } this.remove(); if ((this.scope != null) && (this.needToManualDestroy || manualOverride)) { this.scope.$destroy(); } return self = void 0; }; return WindowChildModel; })(BaseObject); return WindowChildModel; } ]); }).call(this); /* - interface for all markers to derrive from - to enforce a minimum set of requirements - attributes - coords - icon - implementation needed on watches */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("IMarkerParentModel", [ "ModelKey", "Logger", function(ModelKey, Logger) { var IMarkerParentModel; IMarkerParentModel = (function(_super) { __extends(IMarkerParentModel, _super); IMarkerParentModel.prototype.DEFAULTS = {}; function IMarkerParentModel(scope, element, attrs, map, $timeout) { var self, _this = this; this.scope = scope; this.element = element; this.attrs = attrs; this.map = map; this.$timeout = $timeout; this.onDestroy = __bind(this.onDestroy, this); this.onWatch = __bind(this.onWatch, this); this.watch = __bind(this.watch, this); this.validateScope = __bind(this.validateScope, this); IMarkerParentModel.__super__.constructor.call(this, this.scope); self = this; this.$log = Logger; if (!this.validateScope(scope)) { throw new String("Unable to construct IMarkerParentModel due to invalid scope"); } this.doClick = angular.isDefined(attrs.click); if (scope.options != null) { this.DEFAULTS = scope.options; } this.watch('coords', this.scope); this.watch('icon', this.scope); this.watch('options', this.scope); scope.$on("$destroy", function() { return _this.onDestroy(scope); }); } IMarkerParentModel.prototype.validateScope = function(scope) { var ret; if (scope == null) { this.$log.error(this.constructor.name + ": invalid scope used"); return false; } ret = scope.coords != null; if (!ret) { this.$log.error(this.constructor.name + ": no valid coords attribute found"); return false; } return ret; }; IMarkerParentModel.prototype.watch = function(propNameToWatch, scope) { var _this = this; return scope.$watch(propNameToWatch, function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { return _this.onWatch(propNameToWatch, scope, newValue, oldValue); } }, true); }; IMarkerParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) { throw new String("OnWatch Not Implemented!!"); }; IMarkerParentModel.prototype.onDestroy = function(scope) { throw new String("OnDestroy Not Implemented!!"); }; return IMarkerParentModel; })(ModelKey); return IMarkerParentModel; } ]); }).call(this); /* - interface directive for all window(s) to derrive from */ (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("IWindowParentModel", [ "ModelKey", "GmapUtil", "Logger", function(ModelKey, GmapUtil, Logger) { var IWindowParentModel; IWindowParentModel = (function(_super) { __extends(IWindowParentModel, _super); IWindowParentModel.include(GmapUtil); IWindowParentModel.prototype.DEFAULTS = {}; function IWindowParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache) { var self; IWindowParentModel.__super__.constructor.call(this, scope); self = this; this.$log = Logger; this.$timeout = $timeout; this.$compile = $compile; this.$http = $http; this.$templateCache = $templateCache; if (scope.options != null) { this.DEFAULTS = scope.options; } } return IWindowParentModel; })(ModelKey); return IWindowParentModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("LayerParentModel", [ "BaseObject", "Logger", '$timeout', function(BaseObject, Logger, $timeout) { var LayerParentModel; LayerParentModel = (function(_super) { __extends(LayerParentModel, _super); function LayerParentModel(scope, element, attrs, gMap, onLayerCreated, $log) { var _this = this; this.scope = scope; this.element = element; this.attrs = attrs; this.gMap = gMap; this.onLayerCreated = onLayerCreated != null ? onLayerCreated : void 0; this.$log = $log != null ? $log : Logger; this.createGoogleLayer = __bind(this.createGoogleLayer, this); if (this.attrs.type == null) { this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"); return; } this.createGoogleLayer(); this.doShow = true; if (angular.isDefined(this.attrs.show)) { this.doShow = this.scope.show; } if (this.doShow && (this.gMap != null)) { this.layer.setMap(this.gMap); } this.scope.$watch("show", function(newValue, oldValue) { if (newValue !== oldValue) { _this.doShow = newValue; if (newValue) { return _this.layer.setMap(_this.gMap); } else { return _this.layer.setMap(null); } } }, true); this.scope.$watch("options", function(newValue, oldValue) { if (newValue !== oldValue) { _this.layer.setMap(null); _this.layer = null; return _this.createGoogleLayer(); } }, true); this.scope.$on("$destroy", function() { return _this.layer.setMap(null); }); } LayerParentModel.prototype.createGoogleLayer = function() { var fn; if (this.attrs.options == null) { this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type]() : new google.maps[this.attrs.namespace][this.attrs.type](); } else { this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type](this.scope.options) : new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options); } if ((this.layer != null) && (this.onLayerCreated != null)) { fn = this.onLayerCreated(this.scope, this.layer); if (fn) { return fn(this.layer); } } }; return LayerParentModel; })(BaseObject); return LayerParentModel; } ]); }).call(this); /* Basic Directive api for a marker. Basic in the sense that this directive contains 1:1 on scope and model. Thus there will be one html element per marker within the directive. */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("MarkerParentModel", [ "IMarkerParentModel", "GmapUtil", "EventsHelper", "ModelKey", function(IMarkerParentModel, GmapUtil, EventsHelper) { var MarkerParentModel; MarkerParentModel = (function(_super) { __extends(MarkerParentModel, _super); MarkerParentModel.include(GmapUtil); MarkerParentModel.include(EventsHelper); function MarkerParentModel(scope, element, attrs, map, $timeout, gMarkerManager, doFit) { var opts, _this = this; this.gMarkerManager = gMarkerManager; this.doFit = doFit; this.onDestroy = __bind(this.onDestroy, this); this.setGMarker = __bind(this.setGMarker, this); this.onWatch = __bind(this.onWatch, this); MarkerParentModel.__super__.constructor.call(this, scope, element, attrs, map, $timeout); opts = this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.map); this.setGMarker(new google.maps.Marker(opts)); this.listener = google.maps.event.addListener(this.scope.gMarker, 'click', function() { if (_this.doClick && (scope.click != null)) { return _this.scope.click(); } }); this.setEvents(this.scope.gMarker, scope, scope); this.$log.info(this); } MarkerParentModel.prototype.onWatch = function(propNameToWatch, scope) { var old, pos, _ref; switch (propNameToWatch) { case 'coords': if (this.validateCoords(scope.coords) && (this.scope.gMarker != null)) { pos = (_ref = this.scope.gMarker) != null ? _ref.getPosition() : void 0; if (pos.lat() === this.scope.coords.latitude && this.scope.coords.longitude === pos.lng()) { return; } old = this.scope.gMarker.getAnimation(); this.scope.gMarker.setMap(this.map); this.scope.gMarker.setPosition(this.getCoords(scope.coords)); this.scope.gMarker.setVisible(this.validateCoords(scope.coords)); return this.scope.gMarker.setAnimation(old); } else { return this.scope.gMarker.setMap(null); } break; case 'icon': if ((scope.icon != null) && this.validateCoords(scope.coords) && (this.scope.gMarker != null)) { this.scope.gMarker.setIcon(scope.icon); this.scope.gMarker.setMap(null); this.scope.gMarker.setMap(this.map); this.scope.gMarker.setPosition(this.getCoords(scope.coords)); return this.scope.gMarker.setVisible(this.validateCoords(scope.coords)); } break; case 'options': if (this.validateCoords(scope.coords) && (scope.icon != null) && scope.options) { if (this.scope.gMarker != null) { this.scope.gMarker.setMap(null); } return this.setGMarker(new google.maps.Marker(this.createMarkerOptions(scope.coords, scope.icon, scope.options, this.map))); } } }; MarkerParentModel.prototype.setGMarker = function(gMarker) { if (this.scope.gMarker) { delete this.scope.gMarker; this.gMarkerManager.remove(this.scope.gMarker, false); } this.scope.gMarker = gMarker; if (this.scope.gMarker) { this.scope.gMarker.key = this.scope.idKey; this.gMarkerManager.add(this.scope.gMarker, false); if (this.doFit) { return this.gMarkerManager.fit(); } } }; MarkerParentModel.prototype.onDestroy = function(scope) { var self; if (!this.scope.gMarker) { self = void 0; return; } this.scope.gMarker.setMap(null); google.maps.event.removeListener(this.listener); this.listener = null; this.gMarkerManager.remove(this.scope.gMarker, false); delete this.scope.gMarker; return self = void 0; }; return MarkerParentModel; })(IMarkerParentModel); return MarkerParentModel; } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("MarkersParentModel", [ "IMarkerParentModel", "ModelsWatcher", "PropMap", "MarkerChildModel", "ClustererMarkerManager", "MarkerManager", function(IMarkerParentModel, ModelsWatcher, PropMap, MarkerChildModel, ClustererMarkerManager, MarkerManager) { var MarkersParentModel; MarkersParentModel = (function(_super) { __extends(MarkersParentModel, _super); MarkersParentModel.include(ModelsWatcher); function MarkersParentModel(scope, element, attrs, map, $timeout) { this.onDestroy = __bind(this.onDestroy, this); this.newChildMarker = __bind(this.newChildMarker, this); this.updateChild = __bind(this.updateChild, this); this.pieceMeal = __bind(this.pieceMeal, this); this.reBuildMarkers = __bind(this.reBuildMarkers, this); this.createMarkersFromScratch = __bind(this.createMarkersFromScratch, this); this.validateScope = __bind(this.validateScope, this); this.onWatch = __bind(this.onWatch, this); var self, _this = this; MarkersParentModel.__super__.constructor.call(this, scope, element, attrs, map, $timeout); self = this; this.scope.markerModels = new PropMap(); this.$timeout = $timeout; this.$log.info(this); this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false; this.setIdKey(scope); this.scope.$watch('doRebuildAll', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.doRebuildAll = newValue; } }); this.watch('models', scope); this.watch('doCluster', scope); this.watch('clusterOptions', scope); this.watch('clusterEvents', scope); this.watch('fit', scope); this.watch('idKey', scope); this.gMarkerManager = void 0; this.createMarkersFromScratch(scope); } MarkersParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) { if (propNameToWatch === "idKey" && newValue !== oldValue) { this.idKey = newValue; } if (this.doRebuildAll) { return this.reBuildMarkers(scope); } else { return this.pieceMeal(scope); } }; MarkersParentModel.prototype.validateScope = function(scope) { var modelsNotDefined; modelsNotDefined = angular.isUndefined(scope.models) || scope.models === void 0; if (modelsNotDefined) { this.$log.error(this.constructor.name + ": no valid models attribute found"); } return MarkersParentModel.__super__.validateScope.call(this, scope) || modelsNotDefined; }; MarkersParentModel.prototype.createMarkersFromScratch = function(scope) { var _this = this; if (scope.doCluster) { if (scope.clusterEvents) { this.clusterInternalOptions = _.once(function() { var self, _ref, _ref1, _ref2; self = _this; if (!_this.origClusterEvents) { _this.origClusterEvents = { click: (_ref = scope.clusterEvents) != null ? _ref.click : void 0, mouseout: (_ref1 = scope.clusterEvents) != null ? _ref1.mouseout : void 0, mouseover: (_ref2 = scope.clusterEvents) != null ? _ref2.mouseover : void 0 }; return _.extend(scope.clusterEvents, { click: function(cluster) { return self.maybeExecMappedEvent(cluster, 'click'); }, mouseout: function(cluster) { return self.maybeExecMappedEvent(cluster, 'mouseout'); }, mouseover: function(cluster) { return self.maybeExecMappedEvent(cluster, 'mouseover'); } }); } })(); } if (scope.clusterOptions || scope.clusterEvents) { if (this.gMarkerManager === void 0) { this.gMarkerManager = new ClustererMarkerManager(this.map, void 0, scope.clusterOptions, this.clusterInternalOptions); } else { if (this.gMarkerManager.opt_options !== scope.clusterOptions) { this.gMarkerManager = new ClustererMarkerManager(this.map, void 0, scope.clusterOptions, this.clusterInternalOptions); } } } else { this.gMarkerManager = new ClustererMarkerManager(this.map); } } else { this.gMarkerManager = new MarkerManager(this.map); } return _async.each(scope.models, function(model) { return _this.newChildMarker(model, scope); }, function() { _this.gMarkerManager.draw(); if (scope.fit) { return _this.gMarkerManager.fit(); } }); }; MarkersParentModel.prototype.reBuildMarkers = function(scope) { if (!scope.doRebuild && scope.doRebuild !== void 0) { return; } this.onDestroy(scope); return this.createMarkersFromScratch(scope); }; MarkersParentModel.prototype.pieceMeal = function(scope) { var _this = this; if ((this.scope.models != null) && this.scope.models.length > 0 && this.scope.markerModels.length > 0) { return this.figureOutState(this.idKey, scope, this.scope.markerModels, this.modelKeyComparison, function(state) { var payload; payload = state; return _async.each(payload.removals, function(child) { if (child != null) { if (child.destroy != null) { child.destroy(); } return _this.scope.markerModels.remove(child.id); } }, function() { return _async.each(payload.adds, function(modelToAdd) { return _this.newChildMarker(modelToAdd, scope); }, function() { return _async.each(payload.updates, function(update) { return _this.updateChild(update.child, update.model); }, function() { if (payload.adds.length > 0 || payload.removals.length > 0 || payload.updates.length > 0) { _this.gMarkerManager.draw(); return scope.markerModels = _this.scope.markerModels; } }); }); }); }); } else { return this.reBuildMarkers(scope); } }; MarkersParentModel.prototype.updateChild = function(child, model) { if (model[this.idKey] == null) { this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } return child.setMyScope(model, child.model, false); }; MarkersParentModel.prototype.newChildMarker = function(model, scope) { var child, doDrawSelf; if (model[this.idKey] == null) { this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } this.$log.info('child', child, 'markers', this.scope.markerModels); child = new MarkerChildModel(model, scope, this.map, this.$timeout, this.DEFAULTS, this.doClick, this.gMarkerManager, this.idKey, doDrawSelf = false); this.scope.markerModels.put(model[this.idKey], child); return child; }; MarkersParentModel.prototype.onDestroy = function(scope) { _.each(this.scope.markerModels.values(), function(model) { if (model != null) { return model.destroy(); } }); delete this.scope.markerModels; this.scope.markerModels = new PropMap(); if (this.gMarkerManager != null) { return this.gMarkerManager.clear(); } }; MarkersParentModel.prototype.maybeExecMappedEvent = function(cluster, fnName) { var pair, _ref; if (_.isFunction((_ref = this.scope.clusterEvents) != null ? _ref[fnName] : void 0)) { pair = this.mapClusterToMarkerModels(cluster); if (this.origClusterEvents[fnName]) { return this.origClusterEvents[fnName](pair.cluster, pair.mapped); } } }; MarkersParentModel.prototype.mapClusterToMarkerModels = function(cluster) { var gMarkers, mapped, _this = this; gMarkers = cluster.getMarkers().values(); mapped = gMarkers.map(function(g) { return _this.scope.markerModels[g.key].model; }); return { cluster: cluster, mapped: mapped }; }; return MarkersParentModel; })(IMarkerParentModel); return MarkersParentModel; } ]); }).call(this); /* Windows directive where many windows map to the models property */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("PolylinesParentModel", [ "$timeout", "Logger", "ModelKey", "ModelsWatcher", "PropMap", "PolylineChildModel", function($timeout, Logger, ModelKey, ModelsWatcher, PropMap, PolylineChildModel) { var PolylinesParentModel; return PolylinesParentModel = (function(_super) { __extends(PolylinesParentModel, _super); PolylinesParentModel.include(ModelsWatcher); function PolylinesParentModel(scope, element, attrs, gMap, defaults) { var self, _this = this; this.scope = scope; this.element = element; this.attrs = attrs; this.gMap = gMap; this.defaults = defaults; this.modelKeyComparison = __bind(this.modelKeyComparison, this); this.setChildScope = __bind(this.setChildScope, this); this.createChild = __bind(this.createChild, this); this.pieceMeal = __bind(this.pieceMeal, this); this.createAllNew = __bind(this.createAllNew, this); this.watchIdKey = __bind(this.watchIdKey, this); this.createChildScopes = __bind(this.createChildScopes, this); this.watchOurScope = __bind(this.watchOurScope, this); this.watchDestroy = __bind(this.watchDestroy, this); this.rebuildAll = __bind(this.rebuildAll, this); this.doINeedToWipe = __bind(this.doINeedToWipe, this); this.watchModels = __bind(this.watchModels, this); this.watch = __bind(this.watch, this); PolylinesParentModel.__super__.constructor.call(this, scope); self = this; this.$log = Logger; this.plurals = new PropMap(); this.scopePropNames = ['path', 'stroke', 'clickable', 'draggable', 'editable', 'geodesic', 'icons', 'visible']; _.each(this.scopePropNames, function(name) { return _this[name + 'Key'] = void 0; }); this.models = void 0; this.firstTime = true; this.$log.info(this); this.watchOurScope(scope); this.createChildScopes(); } PolylinesParentModel.prototype.watch = function(scope, name, nameKey) { var _this = this; return scope.$watch(name, function(newValue, oldValue) { if (newValue !== oldValue) { _this[nameKey] = typeof newValue === 'function' ? newValue() : newValue; return _async.each(_.values(_this.plurals), function(model) { return model.scope[name] = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; }, function() {}); } }); }; PolylinesParentModel.prototype.watchModels = function(scope) { var _this = this; return scope.$watch('models', function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { if (_this.doINeedToWipe(newValue)) { return _this.rebuildAll(scope, true, true); } else { return _this.createChildScopes(false); } } }, true); }; PolylinesParentModel.prototype.doINeedToWipe = function(newValue) { var newValueIsEmpty; newValueIsEmpty = newValue != null ? newValue.length === 0 : true; return this.plurals.length > 0 && newValueIsEmpty; }; PolylinesParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) { var _this = this; return _async.each(this.plurals.values(), function(model) { return model.destroy(); }, function() { if (doDelete) { delete _this.plurals; } _this.plurals = new PropMap(); if (doCreate) { return _this.createChildScopes(); } }); }; PolylinesParentModel.prototype.watchDestroy = function(scope) { var _this = this; return scope.$on("$destroy", function() { return _this.rebuildAll(scope, false, true); }); }; PolylinesParentModel.prototype.watchOurScope = function(scope) { var _this = this; return _.each(this.scopePropNames, function(name) { var nameKey; nameKey = name + 'Key'; _this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name]; return _this.watch(scope, name, nameKey); }); }; PolylinesParentModel.prototype.createChildScopes = function(isCreatingFromScratch) { if (isCreatingFromScratch == null) { isCreatingFromScratch = true; } if (angular.isUndefined(this.scope.models)) { this.$log.error("No models to create polylines from! I Need direct models!"); return; } if (this.gMap != null) { if (this.scope.models != null) { this.watchIdKey(this.scope); if (isCreatingFromScratch) { return this.createAllNew(this.scope, false); } else { return this.pieceMeal(this.scope, false); } } } }; PolylinesParentModel.prototype.watchIdKey = function(scope) { var _this = this; this.setIdKey(scope); return scope.$watch('idKey', function(newValue, oldValue) { if (newValue !== oldValue && (newValue == null)) { _this.idKey = newValue; return _this.rebuildAll(scope, true, true); } }); }; PolylinesParentModel.prototype.createAllNew = function(scope, isArray) { var _this = this; if (isArray == null) { isArray = false; } this.models = scope.models; if (this.firstTime) { this.watchModels(scope); this.watchDestroy(scope); } return _async.each(scope.models, function(model) { return _this.createChild(model, _this.gMap); }, function() { return _this.firstTime = false; }); }; PolylinesParentModel.prototype.pieceMeal = function(scope, isArray) { var _this = this; if (isArray == null) { isArray = true; } this.models = scope.models; if ((scope != null) && (scope.models != null) && scope.models.length > 0 && this.plurals.length > 0) { return this.figureOutState(this.idKey, scope, this.plurals, this.modelKeyComparison, function(state) { var payload; payload = state; return _async.each(payload.removals, function(id) { var child; child = _this.plurals[id]; if (child != null) { child.destroy(); return _this.plurals.remove(id); } }, function() { return _async.each(payload.adds, function(modelToAdd) { return _this.createChild(modelToAdd, _this.gMap); }, function() {}); }); }); } else { return this.rebuildAll(this.scope, true, true); } }; PolylinesParentModel.prototype.createChild = function(model, gMap) { var child, childScope, _this = this; childScope = this.scope.$new(false); this.setChildScope(childScope, model); childScope.$watch('model', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.setChildScope(childScope, newValue); } }, true); childScope["static"] = this.scope["static"]; child = new PolylineChildModel(childScope, this.attrs, gMap, this.defaults, model); if (model[this.idKey] == null) { this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } this.plurals.put(model[this.idKey], child); return child; }; PolylinesParentModel.prototype.setChildScope = function(childScope, model) { var _this = this; _.each(this.scopePropNames, function(name) { var nameKey, newValue; nameKey = name + 'Key'; newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; if (newValue !== childScope[name]) { return childScope[name] = newValue; } }); return childScope.model = model; }; PolylinesParentModel.prototype.modelKeyComparison = function(model1, model2) { return _.isEqual(this.evalModelHandle(model1, this.scope.path), this.evalModelHandle(model2, this.scope.path)); }; return PolylinesParentModel; })(ModelKey); } ]); }).call(this); /* Windows directive where many windows map to the models property */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api.models.parent").factory("WindowsParentModel", [ "IWindowParentModel", "ModelsWatcher", "PropMap", "WindowChildModel", "Linked", function(IWindowParentModel, ModelsWatcher, PropMap, WindowChildModel, Linked) { var WindowsParentModel; WindowsParentModel = (function(_super) { __extends(WindowsParentModel, _super); WindowsParentModel.include(ModelsWatcher); function WindowsParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache, $interpolate) { var mapScope, self, _this = this; this.$interpolate = $interpolate; this.interpolateContent = __bind(this.interpolateContent, this); this.setChildScope = __bind(this.setChildScope, this); this.createWindow = __bind(this.createWindow, this); this.setContentKeys = __bind(this.setContentKeys, this); this.pieceMealWindows = __bind(this.pieceMealWindows, this); this.createAllNewWindows = __bind(this.createAllNewWindows, this); this.watchIdKey = __bind(this.watchIdKey, this); this.createChildScopesWindows = __bind(this.createChildScopesWindows, this); this.watchOurScope = __bind(this.watchOurScope, this); this.watchDestroy = __bind(this.watchDestroy, this); this.rebuildAll = __bind(this.rebuildAll, this); this.doINeedToWipe = __bind(this.doINeedToWipe, this); this.watchModels = __bind(this.watchModels, this); this.watch = __bind(this.watch, this); this.go = __bind(this.go, this); WindowsParentModel.__super__.constructor.call(this, scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache); self = this; this.windows = new PropMap(); this.scopePropNames = ['show', 'coords', 'templateUrl', 'templateParameter', 'isIconVisibleOnClick', 'closeClick']; _.each(this.scopePropNames, function(name) { return _this[name + 'Key'] = void 0; }); this.linked = new Linked(scope, element, attrs, ctrls); this.models = void 0; this.contentKeys = void 0; this.isIconVisibleOnClick = void 0; this.firstTime = true; this.$log.info(self); this.parentScope = void 0; mapScope = ctrls[0].getScope(); mapScope.deferred.promise.then(function(map) { var markerCtrl; _this.gMap = map; markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0; if (!markerCtrl) { _this.go(scope); return; } return markerCtrl.getScope().deferred.promise.then(function() { _this.markerScope = markerCtrl.getScope(); return _this.go(scope); }); }); } WindowsParentModel.prototype.go = function(scope) { var _this = this; this.watchOurScope(scope); this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false; scope.$watch('doRebuildAll', function(newValue, oldValue) { if (newValue !== oldValue) { return _this.doRebuildAll = newValue; } }); return this.createChildScopesWindows(); }; WindowsParentModel.prototype.watch = function(scope, name, nameKey) { var _this = this; return scope.$watch(name, function(newValue, oldValue) { if (newValue !== oldValue) { _this[nameKey] = typeof newValue === 'function' ? newValue() : newValue; return _async.each(_.values(_this.windows), function(model) { return model.scope[name] = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; }, function() {}); } }); }; WindowsParentModel.prototype.watchModels = function(scope) { var _this = this; return scope.$watch('models', function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { if (_this.doRebuildAll || _this.doINeedToWipe(newValue)) { return _this.rebuildAll(scope, true, true); } else { return _this.createChildScopesWindows(false); } } }); }; WindowsParentModel.prototype.doINeedToWipe = function(newValue) { var newValueIsEmpty; newValueIsEmpty = newValue != null ? newValue.length === 0 : true; return this.windows.length > 0 && newValueIsEmpty; }; WindowsParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) { var _this = this; return _async.each(this.windows.values(), function(model) { return model.destroy(); }, function() { if (doDelete) { delete _this.windows; } _this.windows = new PropMap(); if (doCreate) { return _this.createChildScopesWindows(); } }); }; WindowsParentModel.prototype.watchDestroy = function(scope) { var _this = this; return scope.$on("$destroy", function() { return _this.rebuildAll(scope, false, true); }); }; WindowsParentModel.prototype.watchOurScope = function(scope) { var _this = this; return _.each(this.scopePropNames, function(name) { var nameKey; nameKey = name + 'Key'; _this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name]; return _this.watch(scope, name, nameKey); }); }; WindowsParentModel.prototype.createChildScopesWindows = function(isCreatingFromScratch) { var markersScope, modelsNotDefined; if (isCreatingFromScratch == null) { isCreatingFromScratch = true; } /* being that we cannot tell the difference in Key String vs. a normal value string (TemplateUrl) we will assume that all scope values are string expressions either pointing to a key (propName) or using 'self' to point the model as container/object of interest. This may force redundant information into the model, but this appears to be the most flexible approach. */ this.isIconVisibleOnClick = true; if (angular.isDefined(this.linked.attrs.isiconvisibleonclick)) { this.isIconVisibleOnClick = this.linked.scope.isIconVisibleOnClick; } markersScope = this.markerScope; modelsNotDefined = angular.isUndefined(this.linked.scope.models); if (modelsNotDefined && (markersScope === void 0 || (markersScope.markerModels === void 0 || markersScope.models === void 0))) { this.$log.error("No models to create windows from! Need direct models or models derrived from markers!"); return; } if (this.gMap != null) { if (this.linked.scope.models != null) { this.watchIdKey(this.linked.scope); if (isCreatingFromScratch) { return this.createAllNewWindows(this.linked.scope, false); } else { return this.pieceMealWindows(this.linked.scope, false); } } else { this.parentScope = markersScope; this.watchIdKey(this.parentScope); if (isCreatingFromScratch) { return this.createAllNewWindows(markersScope, true, 'markerModels', false); } else { return this.pieceMealWindows(markersScope, true, 'markerModels', false); } } } }; WindowsParentModel.prototype.watchIdKey = function(scope) { var _this = this; this.setIdKey(scope); return scope.$watch('idKey', function(newValue, oldValue) { if (newValue !== oldValue && (newValue == null)) { _this.idKey = newValue; return _this.rebuildAll(scope, true, true); } }); }; WindowsParentModel.prototype.createAllNewWindows = function(scope, hasGMarker, modelsPropToIterate, isArray) { var _this = this; if (modelsPropToIterate == null) { modelsPropToIterate = 'models'; } if (isArray == null) { isArray = false; } this.models = scope.models; if (this.firstTime) { this.watchModels(scope); this.watchDestroy(scope); } this.setContentKeys(scope.models); return _async.each(scope.models, function(model) { var gMarker; gMarker = hasGMarker ? scope[modelsPropToIterate][[model[_this.idKey]]].gMarker : void 0; return _this.createWindow(model, gMarker, _this.gMap); }, function() { return _this.firstTime = false; }); }; WindowsParentModel.prototype.pieceMealWindows = function(scope, hasGMarker, modelsPropToIterate, isArray) { var _this = this; if (modelsPropToIterate == null) { modelsPropToIterate = 'models'; } if (isArray == null) { isArray = true; } this.models = scope.models; if ((scope != null) && (scope.models != null) && scope.models.length > 0 && this.windows.length > 0) { return this.figureOutState(this.idKey, scope, this.windows, this.modelKeyComparison, function(state) { var payload; payload = state; return _async.each(payload.removals, function(child) { if (child != null) { if (child.destroy != null) { child.destroy(); } return _this.windows.remove(child.id); } }, function() { return _async.each(payload.adds, function(modelToAdd) { var gMarker; gMarker = scope[modelsPropToIterate][modelToAdd[_this.idKey]].gMarker; return _this.createWindow(modelToAdd, gMarker, _this.gMap); }, function() {}); }); }); } else { return this.rebuildAll(this.scope, true, true); } }; WindowsParentModel.prototype.setContentKeys = function(models) { if (models.length > 0) { return this.contentKeys = Object.keys(models[0]); } }; WindowsParentModel.prototype.createWindow = function(model, gMarker, gMap) { var child, childScope, fakeElement, opts, _this = this; childScope = this.linked.scope.$new(false); this.setChildScope(childScope, model); childScope.$watch('model', function(newValue, oldValue) { if (newValue !== oldValue) { _this.setChildScope(childScope, newValue); if (_this.markerScope) { return _this.windows[newValue[_this.idKey]].markerCtrl = _this.markerScope.markerModels[newValue[_this.idKey]].gMarker; } } }, true); fakeElement = { html: function() { return _this.interpolateContent(_this.linked.element.html(), model); } }; opts = this.createWindowOptions(gMarker, childScope, fakeElement.html(), this.DEFAULTS); child = new WindowChildModel(model, childScope, opts, this.isIconVisibleOnClick, gMap, gMarker, fakeElement, true, true); if (model[this.idKey] == null) { this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."); return; } this.windows.put(model[this.idKey], child); return child; }; WindowsParentModel.prototype.setChildScope = function(childScope, model) { var _this = this; _.each(this.scopePropNames, function(name) { var nameKey, newValue; nameKey = name + 'Key'; newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]]; if (newValue !== childScope[name]) { return childScope[name] = newValue; } }); return childScope.model = model; }; WindowsParentModel.prototype.interpolateContent = function(content, model) { var exp, interpModel, key, _i, _len, _ref; if (this.contentKeys === void 0 || this.contentKeys.length === 0) { return; } exp = this.$interpolate(content); interpModel = {}; _ref = this.contentKeys; for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; interpModel[key] = model[key]; } return exp(interpModel); }; return WindowsParentModel; })(IWindowParentModel); return WindowsParentModel; } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Control", [ "IControl", "$http", "$templateCache", "$compile", "$controller", function(IControl, $http, $templateCache, $compile, $controller) { var Control; return Control = (function(_super) { __extends(Control, _super); function Control() { var self; Control.__super__.constructor.call(this); self = this; } Control.prototype.link = function(scope, element, attrs, ctrl) { var index, position, _this = this; if (angular.isUndefined(scope.template)) { this.$log.error('mapControl: could not find a valid template property'); return; } index = angular.isDefined(scope.index && !isNaN(parseInt(scope.index))) ? parseInt(scope.index) : void 0; position = angular.isDefined(scope.position) ? scope.position.toUpperCase().replace(/-/g, '_') : 'TOP_CENTER'; if (!google.maps.ControlPosition[position]) { this.$log.error('mapControl: invalid position property'); return; } return IControl.mapPromise(scope, ctrl).then(function(map) { var control, controlDiv; control = void 0; controlDiv = angular.element('<div></div>'); return $http.get(scope.template, { cache: $templateCache }).success(function(template) { var templateCtrl, templateScope; templateScope = scope.$new(); controlDiv.append(template); if (index) { controlDiv[0].index = index; } if (angular.isDefined(scope.controller)) { templateCtrl = $controller(scope.controller, { $scope: templateScope }); controlDiv.children().data('$ngControllerController', templateCtrl); } return control = $compile(controlDiv.contents())(templateScope); }).error(function(error) { return _this.$log.error('mapControl: template could not be found'); }).then(function() { return map.controls[google.maps.ControlPosition[position]].push(control[0]); }); }); }; return Control; })(IControl); } ]); }).call(this); /* - Link up Polygons to be sent back to a controller - inject the draw function into a controllers scope so that controller can call the directive to draw on demand - draw function creates the DrawFreeHandChildModel which manages itself */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory('FreeDrawPolygons', [ 'Logger', 'BaseObject', 'CtrlHandle', 'DrawFreeHandChildModel', function($log, BaseObject, CtrlHandle, DrawFreeHandChildModel) { var FreeDrawPolygons, _ref; return FreeDrawPolygons = (function(_super) { __extends(FreeDrawPolygons, _super); function FreeDrawPolygons() { this.link = __bind(this.link, this); _ref = FreeDrawPolygons.__super__.constructor.apply(this, arguments); return _ref; } FreeDrawPolygons.include(CtrlHandle); FreeDrawPolygons.prototype.restrict = 'EA'; FreeDrawPolygons.prototype.replace = true; FreeDrawPolygons.prototype.require = '^googleMap'; FreeDrawPolygons.prototype.scope = { polygons: '=', draw: '=' }; FreeDrawPolygons.prototype.link = function(scope, element, attrs, ctrl) { var _this = this; return this.mapPromise(scope, ctrl).then(function(map) { var freeHand, listener; if (!scope.polygons) { return $log.error("No polygons to bind to!"); } if (!_.isArray(scope.polygons)) { return $log.error("Free Draw Polygons must be of type Array!"); } freeHand = new DrawFreeHandChildModel(map, scope.originalMapOpts); listener = void 0; return scope.draw = function() { if (typeof listener === "function") { listener(); } return freeHand.engage(scope.polygons).then(function() { var firstTime; firstTime = true; return listener = scope.$watch('polygons', function(newValue, oldValue) { var removals; if (firstTime) { firstTime = false; return; } removals = _.differenceObjects(oldValue, newValue); return removals.forEach(function(p) { return p.setMap(null); }); }); }); }; }); }; return FreeDrawPolygons; })(BaseObject); } ]); }).call(this); /* - interface for all controls to derive from - to enforce a minimum set of requirements - attributes - template - position - controller - index */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IControl", [ "BaseObject", "Logger", "CtrlHandle", function(BaseObject, Logger, CtrlHandle) { var IControl; return IControl = (function(_super) { __extends(IControl, _super); IControl.extend(CtrlHandle); function IControl() { this.link = __bind(this.link, this); this.restrict = 'EA'; this.replace = true; this.require = '^googleMap'; this.scope = { template: '@template', position: '@position', controller: '@controller', index: '@index' }; this.$log = Logger; } IControl.prototype.link = function(scope, element, attrs, ctrl) { throw new Exception("Not implemented!!"); }; return IControl; })(BaseObject); } ]); }).call(this); /* - interface for all labels to derrive from - to enforce a minimum set of requirements - attributes - content - anchor - implementation needed on watches */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("ILabel", [ "BaseObject", "Logger", function(BaseObject, Logger) { var ILabel; return ILabel = (function(_super) { __extends(ILabel, _super); function ILabel($timeout) { this.link = __bind(this.link, this); var self; self = this; this.restrict = 'EMA'; this.replace = true; this.template = void 0; this.require = void 0; this.transclude = true; this.priority = -100; this.scope = { labelContent: '=content', labelAnchor: '@anchor', labelClass: '@class', labelStyle: '=style' }; this.$log = Logger; this.$timeout = $timeout; } ILabel.prototype.link = function(scope, element, attrs, ctrl) { throw new Exception("Not Implemented!!"); }; return ILabel; })(BaseObject); } ]); }).call(this); /* - interface for all markers to derrive from - to enforce a minimum set of requirements - attributes - coords - icon - implementation needed on watches */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IMarker", [ "Logger", "BaseObject", "CtrlHandle", function(Logger, BaseObject, CtrlHandle) { var IMarker; return IMarker = (function(_super) { __extends(IMarker, _super); IMarker.extend(CtrlHandle); function IMarker() { this.link = __bind(this.link, this); this.$log = Logger; this.restrict = 'EMA'; this.require = '^googleMap'; this.priority = -1; this.transclude = true; this.replace = true; this.scope = { coords: '=coords', icon: '=icon', click: '&click', options: '=options', events: '=events', fit: '=fit', idKey: '=idkey', control: '=control' }; } IMarker.prototype.link = function(scope, element, attrs, ctrl) { if (!ctrl) { throw new Error("No Map Control! Marker Directive Must be inside the map!"); } }; return IMarker; })(BaseObject); } ]); }).call(this); (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IPolyline", [ "GmapUtil", "BaseObject", "Logger", 'CtrlHandle', function(GmapUtil, BaseObject, Logger, CtrlHandle) { var IPolyline; return IPolyline = (function(_super) { __extends(IPolyline, _super); IPolyline.include(GmapUtil); IPolyline.extend(CtrlHandle); function IPolyline() {} IPolyline.prototype.restrict = "EA"; IPolyline.prototype.replace = true; IPolyline.prototype.require = "^googleMap"; IPolyline.prototype.scope = { path: "=", stroke: "=", clickable: "=", draggable: "=", editable: "=", geodesic: "=", icons: "=", visible: "=", "static": "=", fit: "=", events: "=" }; IPolyline.prototype.DEFAULTS = {}; IPolyline.prototype.$log = Logger; return IPolyline; })(BaseObject); } ]); }).call(this); /* - interface directive for all window(s) to derive from */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("IWindow", [ "BaseObject", "ChildEvents", "Logger", function(BaseObject, ChildEvents, Logger) { var IWindow; return IWindow = (function(_super) { __extends(IWindow, _super); IWindow.include(ChildEvents); function IWindow($timeout, $compile, $http, $templateCache) { this.$timeout = $timeout; this.$compile = $compile; this.$http = $http; this.$templateCache = $templateCache; this.link = __bind(this.link, this); this.restrict = 'EMA'; this.template = void 0; this.transclude = true; this.priority = -100; this.require = void 0; this.replace = true; this.scope = { coords: '=coords', show: '=show', templateUrl: '=templateurl', templateParameter: '=templateparameter', isIconVisibleOnClick: '=isiconvisibleonclick', closeClick: '&closeclick', options: '=options', control: '=control' }; this.$log = Logger; } IWindow.prototype.link = function(scope, element, attrs, ctrls) { throw new Exception("Not Implemented!!"); }; return IWindow; })(BaseObject); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Map", [ "$timeout", '$q', 'Logger', "GmapUtil", "BaseObject", "ExtendGWin", "CtrlHandle", 'IsReady'.ns(), "uuid".ns(), function($timeout, $q, Logger, GmapUtil, BaseObject, ExtendGWin, CtrlHandle, IsReady, uuid) { "use strict"; var $log, DEFAULTS, Map; $log = Logger; DEFAULTS = { mapTypeId: google.maps.MapTypeId.ROADMAP }; return Map = (function(_super) { __extends(Map, _super); Map.include(GmapUtil); function Map() { this.link = __bind(this.link, this); var ctrlFn, self; ctrlFn = function($scope) { var ctrlObj; ctrlObj = CtrlHandle.handle($scope); $scope.ctrlType = 'Map'; $scope.deferred.promise.then(function() { return ExtendGWin.init(); }); return _.extend(ctrlObj, { getMap: function() { return $scope.map; } }); }; this.controller = ["$scope", ctrlFn]; self = this; } Map.prototype.restrict = "EMA"; Map.prototype.transclude = true; Map.prototype.replace = false; Map.prototype.template = '<div class="angular-google-map"><div class="angular-google-map-container"></div><div ng-transclude style="display: none"></div></div>'; Map.prototype.scope = { center: "=", zoom: "=", dragging: "=", control: "=", windows: "=", options: "=", events: "=", styles: "=", bounds: "=" }; /* @param scope @param element @param attrs */ Map.prototype.link = function(scope, element, attrs) { var dragging, el, eventName, getEventHandler, mapOptions, opts, resolveSpawned, settingCenterFromScope, spawned, type, _m, _this = this; spawned = IsReady.spawn(); resolveSpawned = function() { return spawned.deferred.resolve({ instance: spawned.instance, map: _m }); }; if (!this.validateCoords(scope.center)) { $log.error("angular-google-maps: could not find a valid center property"); return; } if (!angular.isDefined(scope.zoom)) { $log.error("angular-google-maps: map zoom property not set"); return; } el = angular.element(element); el.addClass("angular-google-map"); opts = { options: {} }; if (attrs.options) { opts.options = scope.options; } if (attrs.styles) { opts.styles = scope.styles; } if (attrs.type) { type = attrs.type.toUpperCase(); if (google.maps.MapTypeId.hasOwnProperty(type)) { opts.mapTypeId = google.maps.MapTypeId[attrs.type.toUpperCase()]; } else { $log.error("angular-google-maps: invalid map type \"" + attrs.type + "\""); } } mapOptions = angular.extend({}, DEFAULTS, opts, { center: this.getCoords(scope.center), draggable: this.isTrue(attrs.draggable), zoom: scope.zoom, bounds: scope.bounds }); _m = new google.maps.Map(el.find("div")[1], mapOptions); _m.nggmap_id = uuid.generate(); dragging = false; if (!_m) { google.maps.event.addListener(_m, 'tilesloaded ', function(map) { scope.deferred.resolve(map); return resolveSpawned(); }); } else { scope.deferred.resolve(_m); resolveSpawned(); } google.maps.event.addListener(_m, "dragstart", function() { dragging = true; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); google.maps.event.addListener(_m, "dragend", function() { dragging = false; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); google.maps.event.addListener(_m, "drag", function() { var c; c = _m.center; return _.defer(function() { return scope.$apply(function(s) { if (angular.isDefined(s.center.type)) { s.center.coordinates[1] = c.lat(); return s.center.coordinates[0] = c.lng(); } else { s.center.latitude = c.lat(); return s.center.longitude = c.lng(); } }); }); }); google.maps.event.addListener(_m, "zoom_changed", function() { if (scope.zoom !== _m.zoom) { return _.defer(function() { return scope.$apply(function(s) { return s.zoom = _m.zoom; }); }); } }); settingCenterFromScope = false; google.maps.event.addListener(_m, "center_changed", function() { var c; c = _m.center; if (settingCenterFromScope) { return; } return _.defer(function() { return scope.$apply(function(s) { if (!_m.dragging) { if (angular.isDefined(s.center.type)) { if (s.center.coordinates[1] !== c.lat()) { s.center.coordinates[1] = c.lat(); } if (s.center.coordinates[0] !== c.lng()) { return s.center.coordinates[0] = c.lng(); } } else { if (s.center.latitude !== c.lat()) { s.center.latitude = c.lat(); } if (s.center.longitude !== c.lng()) { return s.center.longitude = c.lng(); } } } }); }); }); google.maps.event.addListener(_m, "idle", function() { var b, ne, sw; b = _m.getBounds(); ne = b.getNorthEast(); sw = b.getSouthWest(); return _.defer(function() { return scope.$apply(function(s) { if (s.bounds !== null && s.bounds !== undefined && s.bounds !== void 0) { s.bounds.northeast = { latitude: ne.lat(), longitude: ne.lng() }; return s.bounds.southwest = { latitude: sw.lat(), longitude: sw.lng() }; } }); }); }); if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) { getEventHandler = function(eventName) { return function() { return scope.events[eventName].apply(scope, [_m, eventName, arguments]); }; }; for (eventName in scope.events) { if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) { google.maps.event.addListener(_m, eventName, getEventHandler(eventName)); } } } _m.getOptions = function() { return mapOptions; }; scope.map = _m; if ((attrs.control != null) && (scope.control != null)) { scope.control.refresh = function(maybeCoords) { var coords; if (_m == null) { return; } google.maps.event.trigger(_m, "resize"); if (((maybeCoords != null ? maybeCoords.latitude : void 0) != null) && ((maybeCoords != null ? maybeCoords.latitude : void 0) != null)) { coords = _this.getCoords(maybeCoords); if (_this.isTrue(attrs.pan)) { return _m.panTo(coords); } else { return _m.setCenter(coords); } } }; /* I am sure you all will love this. You want the instance here you go.. BOOM! */ scope.control.getGMap = function() { return _m; }; scope.control.getMapOptions = function() { return mapOptions; }; } scope.$watch("center", (function(newValue, oldValue) { var coords; coords = _this.getCoords(newValue); if (coords.lat() === _m.center.lat() && coords.lng() === _m.center.lng()) { return; } settingCenterFromScope = true; if (!dragging) { if (!_this.validateCoords(newValue)) { $log.error("Invalid center for newValue: " + (JSON.stringify(newValue))); } if (_this.isTrue(attrs.pan) && scope.zoom === _m.zoom) { _m.panTo(coords); } else { _m.setCenter(coords); } } return settingCenterFromScope = false; }), true); scope.$watch("zoom", function(newValue, oldValue) { if (newValue === _m.zoom) { return; } return _.defer(function() { return _m.setZoom(newValue); }); }); scope.$watch("bounds", function(newValue, oldValue) { var bounds, ne, sw; if (newValue === oldValue) { return; } if ((newValue.northeast.latitude == null) || (newValue.northeast.longitude == null) || (newValue.southwest.latitude == null) || (newValue.southwest.longitude == null)) { $log.error("Invalid map bounds for new value: " + (JSON.stringify(newValue))); return; } ne = new google.maps.LatLng(newValue.northeast.latitude, newValue.northeast.longitude); sw = new google.maps.LatLng(newValue.southwest.latitude, newValue.southwest.longitude); bounds = new google.maps.LatLngBounds(sw, ne); return _m.fitBounds(bounds); }); scope.$watch("options", function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { opts.options = newValue; if (_m != null) { return _m.setOptions(opts); } } }, true); return scope.$watch("styles", function(newValue, oldValue) { if (!_.isEqual(newValue, oldValue)) { opts.styles = newValue; if (_m != null) { return _m.setOptions(opts); } } }, true); }; return Map; })(BaseObject); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Marker", [ "IMarker", "MarkerParentModel", "MarkerManager", function(IMarker, MarkerParentModel, MarkerManager) { var Marker; return Marker = (function(_super) { var _this = this; __extends(Marker, _super); function Marker() { this.link = __bind(this.link, this); Marker.__super__.constructor.call(this); this.template = '<span class="angular-google-map-marker" ng-transclude></span>'; this.$log.info(this); } Marker.prototype.controller = [ '$scope', '$element', function($scope, $element) { $scope.ctrlType = 'Marker'; return IMarker.handle($scope, $element); } ]; Marker.prototype.link = function(scope, element, attrs, ctrl) { var doFit, _this = this; if (scope.fit) { doFit = true; } return IMarker.mapPromise(scope, ctrl).then(function(map) { if (!_this.gMarkerManager) { _this.gMarkerManager = new MarkerManager(map); } new MarkerParentModel(scope, element, attrs, map, _this.$timeout, _this.gMarkerManager, doFit); scope.deferred.resolve(); if (scope.control != null) { return scope.control.getGMarkers = _this.gMarkerManager.getGMarkers; } }); }; return Marker; }).call(this, IMarker); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Markers", [ "IMarker", "MarkersParentModel", function(IMarker, MarkersParentModel) { var Markers; return Markers = (function(_super) { __extends(Markers, _super); function Markers($timeout) { this.link = __bind(this.link, this); Markers.__super__.constructor.call(this, $timeout); this.template = '<span class="angular-google-map-markers" ng-transclude></span>'; this.scope = _.extend(this.scope || {}, { idKey: '=idkey', doRebuildAll: '=dorebuildall', models: '=models', doCluster: '=docluster', clusterOptions: '=clusteroptions', clusterEvents: '=clusterevents', isLabel: '=islabel' }); this.$timeout = $timeout; this.$log.info(this); } Markers.prototype.controller = [ '$scope', '$element', function($scope, $element) { $scope.ctrlType = 'Markers'; return IMarker.handle($scope, $element); } ]; Markers.prototype.link = function(scope, element, attrs, ctrl) { var _this = this; return IMarker.mapPromise(scope, ctrl).then(function(map) { var parentModel; parentModel = new MarkersParentModel(scope, element, attrs, map, _this.$timeout); scope.deferred.resolve(); if (scope.control != null) { scope.control.getGMarkers = function() { var _ref; return (_ref = parentModel.gMarkerManager) != null ? _ref.getGMarkers() : void 0; }; return scope.control.getChildMarkers = function() { return parentModel.markerModels; }; } }); }; return Markers; })(IMarker); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Polyline", [ "IPolyline", "$timeout", "array-sync", "PolylineChildModel", function(IPolyline, $timeout, arraySync, PolylineChildModel) { var Polyline, _ref; return Polyline = (function(_super) { __extends(Polyline, _super); function Polyline() { this.link = __bind(this.link, this); _ref = Polyline.__super__.constructor.apply(this, arguments); return _ref; } Polyline.prototype.link = function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.path) || scope.path === null || !this.validatePath(scope.path)) { this.$log.error("polyline: no valid path attribute found"); return; } return IPolyline.mapPromise(scope, mapCtrl).then(function(map) { return new PolylineChildModel(scope, attrs, map, _this.DEFAULTS); }); }; return Polyline; })(IPolyline); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Polylines", [ "IPolyline", "$timeout", "array-sync", "PolylinesParentModel", function(IPolyline, $timeout, arraySync, PolylinesParentModel) { var Polylines; return Polylines = (function(_super) { __extends(Polylines, _super); function Polylines() { this.link = __bind(this.link, this); Polylines.__super__.constructor.call(this); this.scope.idKey = '=idkey'; this.scope.models = '=models'; this.$log.info(this); } Polylines.prototype.link = function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.path) || scope.path === null) { this.$log.error("polylines: no valid path attribute found"); return; } if (!scope.models) { this.$log.error("polylines: no models found to create from"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { return new PolylinesParentModel(scope, element, attrs, map, _this.DEFAULTS); }); }; return Polylines; })(IPolyline); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Window", [ "IWindow", "GmapUtil", "WindowChildModel", function(IWindow, GmapUtil, WindowChildModel) { var Window; return Window = (function(_super) { __extends(Window, _super); Window.include(GmapUtil); function Window($timeout, $compile, $http, $templateCache) { this.init = __bind(this.init, this); this.link = __bind(this.link, this); Window.__super__.constructor.call(this, $timeout, $compile, $http, $templateCache); this.require = ['^googleMap', '^?marker']; this.template = '<span class="angular-google-maps-window" ng-transclude></span>'; this.$log.info(this); this.childWindows = []; } Window.prototype.link = function(scope, element, attrs, ctrls) { var mapScope, _this = this; mapScope = ctrls[0].getScope(); return mapScope.deferred.promise.then(function(mapCtrl) { var isIconVisibleOnClick, markerCtrl, markerScope; isIconVisibleOnClick = true; if (angular.isDefined(attrs.isiconvisibleonclick)) { isIconVisibleOnClick = scope.isIconVisibleOnClick; } markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0; if (!markerCtrl) { _this.init(scope, element, isIconVisibleOnClick, mapCtrl); return; } markerScope = markerCtrl.getScope(); return markerScope.deferred.promise.then(function() { return _this.init(scope, element, isIconVisibleOnClick, mapCtrl, markerScope); }); }); }; Window.prototype.init = function(scope, element, isIconVisibleOnClick, mapCtrl, markerScope) { var defaults, gMarker, hasScopeCoords, opts, window, _this = this; defaults = scope.options != null ? scope.options : {}; hasScopeCoords = (scope != null) && this.validateCoords(scope.coords); if (markerScope != null) { gMarker = markerScope.gMarker; markerScope.$watch('coords', function(newValue, oldValue) { if ((markerScope.gMarker != null) && !window.markerCtrl) { window.markerCtrl = gMarker; window.handleClick(true); } if (!_this.validateCoords(newValue)) { return window.hideWindow(); } if (!angular.equals(newValue, oldValue)) { return window.getLatestPosition(_this.getCoords(newValue)); } }, true); } opts = hasScopeCoords ? this.createWindowOptions(gMarker, scope, element.html(), defaults) : defaults; if (mapCtrl != null) { window = new WindowChildModel({}, scope, opts, isIconVisibleOnClick, mapCtrl, gMarker, element); this.childWindows.push(window); scope.$on("$destroy", function() { return _this.childWindows = _.withoutObjects(_this.childWindows, [window], function(child1, child2) { return child1.scope.$id === child2.scope.$id; }); }); } if (scope.control != null) { scope.control.getGWindows = function() { return _this.childWindows.map(function(child) { return child.gWin; }); }; scope.control.getChildWindows = function() { return _this.childWindows; }; } if ((this.onChildCreation != null) && (window != null)) { return this.onChildCreation(window); } }; return Window; })(IWindow); } ]); }).call(this); (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps.directives.api").factory("Windows", [ "IWindow", "WindowsParentModel", function(IWindow, WindowsParentModel) { /* Windows directive where many windows map to the models property */ var Windows; return Windows = (function(_super) { __extends(Windows, _super); function Windows($timeout, $compile, $http, $templateCache, $interpolate) { this.link = __bind(this.link, this); var self; Windows.__super__.constructor.call(this, $timeout, $compile, $http, $templateCache); self = this; this.$interpolate = $interpolate; this.require = ['^googleMap', '^?markers']; this.template = '<span class="angular-google-maps-windows" ng-transclude></span>'; this.scope.idKey = '=idkey'; this.scope.doRebuildAll = '=dorebuildall'; this.scope.models = '=models'; this.$log.info(this); } Windows.prototype.link = function(scope, element, attrs, ctrls) { var parentModel, _this = this; parentModel = new WindowsParentModel(scope, element, attrs, ctrls, this.$timeout, this.$compile, this.$http, this.$templateCache, this.$interpolate); if (scope.control != null) { scope.control.getGWindows = function() { return parentModel.windows.map(function(child) { return child.gWin; }); }; return scope.control.getChildWindows = function() { return parentModel.windows; }; } }; return Windows; })(IWindow); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready Nick Baugh - https://github.com/niftylettuce */ (function() { angular.module("google-maps").directive("googleMap", [ "Map", function(Map) { return new Map(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map marker directive This directive is used to create a marker on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute icon optional} string url to image used for marker icon {attribute animate optional} if set to false, the marker won't be animated (on by default) */ (function() { angular.module("google-maps").directive("marker", [ "$timeout", "Marker", function($timeout, Marker) { return new Marker($timeout); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map marker directive This directive is used to create a marker on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute icon optional} string url to image used for marker icon {attribute animate optional} if set to false, the marker won't be animated (on by default) */ (function() { angular.module("google-maps").directive("markers", [ "$timeout", "Markers", function($timeout, Markers) { return new Markers($timeout); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Bruno Queiroz, [email protected] */ /* Marker label directive This directive is used to create a marker label on an existing map. {attribute content required} content of the label {attribute anchor required} string that contains the x and y point position of the label {attribute class optional} class to DOM object {attribute style optional} style for the label */ /* Basic Directive api for a label. Basic in the sense that this directive contains 1:1 on scope and model. Thus there will be one html element per marker within the directive. */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; angular.module("google-maps").directive("markerLabel", [ "$timeout", "ILabel", "MarkerLabelChildModel", "GmapUtil", "nggmap-PropertyAction", function($timeout, ILabel, MarkerLabelChildModel, GmapUtil, PropertyAction) { var Label; Label = (function(_super) { __extends(Label, _super); function Label($timeout) { this.init = __bind(this.init, this); this.link = __bind(this.link, this); var self; Label.__super__.constructor.call(this, $timeout); self = this; this.require = '^marker'; this.template = '<span class="angular-google-maps-marker-label" ng-transclude></span>'; this.$log.info(this); } Label.prototype.link = function(scope, element, attrs, ctrl) { var markerScope, _this = this; markerScope = ctrl.getScope(); if (markerScope) { return markerScope.deferred.promise.then(function() { return _this.init(markerScope, scope); }); } }; Label.prototype.init = function(markerScope, scope) { var createLabel, isFirstSet, label; label = null; createLabel = function() { if (!label) { return label = new MarkerLabelChildModel(markerScope.gMarker, scope, markerScope.map); } }; isFirstSet = true; return markerScope.$watch('gMarker', function(newVal, oldVal) { var anchorAction, classAction, contentAction, styleAction; if (markerScope.gMarker != null) { contentAction = new PropertyAction(function(newVal) { createLabel(); if (scope.labelContent) { return label != null ? label.setOption('labelContent', scope.labelContent) : void 0; } }, isFirstSet); anchorAction = new PropertyAction(function(newVal) { createLabel(); return label != null ? label.setOption('labelAnchor', scope.labelAnchor) : void 0; }, isFirstSet); classAction = new PropertyAction(function(newVal) { createLabel(); return label != null ? label.setOption('labelClass', scope.labelClass) : void 0; }, isFirstSet); styleAction = new PropertyAction(function(newVal) { createLabel(); return label != null ? label.setOption('labelStyle', scope.labelStyle) : void 0; }, isFirstSet); scope.$watch('labelContent', contentAction.sic); scope.$watch('labelAnchor', anchorAction.sic); scope.$watch('labelClass', classAction.sic); scope.$watch('labelStyle', styleAction.sic); isFirstSet = false; } return scope.$on('$destroy', function() { return label != null ? label.destroy() : void 0; }); }); }; return Label; })(ILabel); return new Label($timeout); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready Rick Huizinga - https://plus.google.com/+RickHuizinga */ (function() { angular.module("google-maps").directive("polygon", [ "$log", "$timeout", "array-sync", "GmapUtil", function($log, $timeout, arraySync, GmapUtil) { /* Check if a value is true */ var DEFAULTS, isTrue; isTrue = function(val) { return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true"; }; "use strict"; DEFAULTS = {}; return { restrict: "EA", replace: true, require: "^googleMap", scope: { path: "=path", stroke: "=stroke", clickable: "=", draggable: "=", editable: "=", geodesic: "=", fill: "=", icons: "=icons", visible: "=", "static": "=", events: "=", zIndex: "=zindex", fit: "=" }, link: function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.path) || scope.path === null || !GmapUtil.validatePath(scope.path)) { $log.error("polygon: no valid path attribute found"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { var arraySyncer, buildOpts, eventName, getEventHandler, pathPoints, polygon; buildOpts = function(pathPoints) { var opts; opts = angular.extend({}, DEFAULTS, { map: map, path: pathPoints, strokeColor: scope.stroke && scope.stroke.color, strokeOpacity: scope.stroke && scope.stroke.opacity, strokeWeight: scope.stroke && scope.stroke.weight, fillColor: scope.fill && scope.fill.color, fillOpacity: scope.fill && scope.fill.opacity }); angular.forEach({ clickable: true, draggable: false, editable: false, geodesic: false, visible: true, "static": false, fit: false, zIndex: 0 }, function(defaultValue, key) { if (angular.isUndefined(scope[key]) || scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = scope[key]; } }); if (opts["static"]) { opts.editable = false; } return opts; }; pathPoints = GmapUtil.convertPathPoints(scope.path); polygon = new google.maps.Polygon(buildOpts(pathPoints)); if (scope.fit) { GmapUtil.extendMapBounds(map, pathPoints); } if (!scope["static"] && angular.isDefined(scope.editable)) { scope.$watch("editable", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setEditable(newValue); } }); } if (angular.isDefined(scope.draggable)) { scope.$watch("draggable", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setDraggable(newValue); } }); } if (angular.isDefined(scope.visible)) { scope.$watch("visible", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setVisible(newValue); } }); } if (angular.isDefined(scope.geodesic)) { scope.$watch("geodesic", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) { scope.$watch("stroke.opacity", function(newValue, oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) { scope.$watch("stroke.weight", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) { scope.$watch("stroke.color", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.color)) { scope.$watch("fill.color", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.opacity)) { scope.$watch("fill.opacity", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.zIndex)) { scope.$watch("zIndex", function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(buildOpts(polygon.getPath())); } }); } if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) { getEventHandler = function(eventName) { return function() { return scope.events[eventName].apply(scope, [polygon, eventName, arguments]); }; }; for (eventName in scope.events) { if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) { polygon.addListener(eventName, getEventHandler(eventName)); } } } arraySyncer = arraySync(polygon.getPath(), scope, "path", function(pathPoints) { if (scope.fit) { return GmapUtil.extendMapBounds(map, pathPoints); } }); return scope.$on("$destroy", function() { polygon.setMap(null); if (arraySyncer) { arraySyncer(); return arraySyncer = null; } }); }); } }; } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @authors Julian Popescu - https://github.com/jpopesculian Rick Huizinga - https://plus.google.com/+RickHuizinga */ (function() { angular.module("google-maps").directive("circle", [ "$log", "$timeout", "GmapUtil", "EventsHelper", function($log, $timeout, GmapUtil, EventsHelper) { "use strict"; var DEFAULTS; DEFAULTS = {}; return { restrict: "EA", replace: true, require: "^googleMap", scope: { center: "=center", radius: "=radius", stroke: "=stroke", fill: "=fill", clickable: "=", draggable: "=", editable: "=", geodesic: "=", icons: "=icons", visible: "=", events: "=" }, link: function(scope, element, attrs, mapCtrl) { var _this = this; return mapCtrl.getScope().deferred.promise.then(function(map) { var buildOpts, circle; buildOpts = function() { var opts; if (!GmapUtil.validateCoords(scope.center)) { $log.error("circle: no valid center attribute found"); return; } opts = angular.extend({}, DEFAULTS, { map: map, center: GmapUtil.getCoords(scope.center), radius: scope.radius, strokeColor: scope.stroke && scope.stroke.color, strokeOpacity: scope.stroke && scope.stroke.opacity, strokeWeight: scope.stroke && scope.stroke.weight, fillColor: scope.fill && scope.fill.color, fillOpacity: scope.fill && scope.fill.opacity }); angular.forEach({ clickable: true, draggable: false, editable: false, geodesic: false, visible: true }, function(defaultValue, key) { if (angular.isUndefined(scope[key]) || scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = scope[key]; } }); return opts; }; circle = new google.maps.Circle(buildOpts()); scope.$watchCollection('center', function(newVals, oldVals) { if (newVals !== oldVals) { return circle.setOptions(buildOpts()); } }); scope.$watchCollection('stroke', function(newVals, oldVals) { if (newVals !== oldVals) { return circle.setOptions(buildOpts()); } }); scope.$watchCollection('fill', function(newVals, oldVals) { if (newVals !== oldVals) { return circle.setOptions(buildOpts()); } }); scope.$watch('radius', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('clickable', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('editable', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('draggable', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('visible', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); scope.$watch('geodesic', function(newVal, oldVal) { if (newVal !== oldVal) { return circle.setOptions(buildOpts()); } }); EventsHelper.setEvents(circle, scope, scope); google.maps.event.addListener(circle, 'radius_changed', function() { scope.radius = circle.getRadius(); return $timeout(function() { return scope.$apply(); }); }); google.maps.event.addListener(circle, 'center_changed', function() { if (angular.isDefined(scope.center.type)) { scope.center.coordinates[1] = circle.getCenter().lat(); scope.center.coordinates[0] = circle.getCenter().lng(); } else { scope.center.latitude = circle.getCenter().lat(); scope.center.longitude = circle.getCenter().lng(); } return $timeout(function() { return scope.$apply(); }); }); return scope.$on("$destroy", function() { return circle.setMap(null); }); }); } }; } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ (function() { angular.module("google-maps").directive("polyline", [ "Polyline", function(Polyline) { return new Polyline(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ (function() { angular.module("google-maps").directive("polylines", [ "Polylines", function(Polylines) { return new Polylines(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready Chentsu Lin - https://github.com/ChenTsuLin */ (function() { angular.module("google-maps").directive("rectangle", [ "$log", "$timeout", function($log, $timeout) { var DEFAULTS, convertBoundPoints, fitMapBounds, isTrue, validateBoundPoints; validateBoundPoints = function(bounds) { if (angular.isUndefined(bounds.sw.latitude) || angular.isUndefined(bounds.sw.longitude) || angular.isUndefined(bounds.ne.latitude) || angular.isUndefined(bounds.ne.longitude)) { return false; } return true; }; convertBoundPoints = function(bounds) { var result; result = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.sw.latitude, bounds.sw.longitude), new google.maps.LatLng(bounds.ne.latitude, bounds.ne.longitude)); return result; }; fitMapBounds = function(map, bounds) { return map.fitBounds(bounds); }; /* Check if a value is true */ isTrue = function(val) { return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true"; }; "use strict"; DEFAULTS = {}; return { restrict: "ECA", require: "^googleMap", replace: true, scope: { bounds: "=", stroke: "=", clickable: "=", draggable: "=", editable: "=", fill: "=", visible: "=" }, link: function(scope, element, attrs, mapCtrl) { var _this = this; if (angular.isUndefined(scope.bounds) || scope.bounds === null || angular.isUndefined(scope.bounds.sw) || scope.bounds.sw === null || angular.isUndefined(scope.bounds.ne) || scope.bounds.ne === null || !validateBoundPoints(scope.bounds)) { $log.error("rectangle: no valid bound attribute found"); return; } return mapCtrl.getScope().deferred.promise.then(function(map) { var buildOpts, dragging, rectangle, settingBoundsFromScope; buildOpts = function(bounds) { var opts; opts = angular.extend({}, DEFAULTS, { map: map, bounds: bounds, strokeColor: scope.stroke && scope.stroke.color, strokeOpacity: scope.stroke && scope.stroke.opacity, strokeWeight: scope.stroke && scope.stroke.weight, fillColor: scope.fill && scope.fill.color, fillOpacity: scope.fill && scope.fill.opacity }); angular.forEach({ clickable: true, draggable: false, editable: false, visible: true }, function(defaultValue, key) { if (angular.isUndefined(scope[key]) || scope[key] === null) { return opts[key] = defaultValue; } else { return opts[key] = scope[key]; } }); return opts; }; rectangle = new google.maps.Rectangle(buildOpts(convertBoundPoints(scope.bounds))); if (isTrue(attrs.fit)) { fitMapBounds(map, bounds); } dragging = false; google.maps.event.addListener(rectangle, "mousedown", function() { google.maps.event.addListener(rectangle, "mousemove", function() { dragging = true; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); google.maps.event.addListener(rectangle, "mouseup", function() { google.maps.event.clearListeners(rectangle, 'mousemove'); google.maps.event.clearListeners(rectangle, 'mouseup'); dragging = false; return _.defer(function() { return scope.$apply(function(s) { if (s.dragging != null) { return s.dragging = dragging; } }); }); }); }); settingBoundsFromScope = false; google.maps.event.addListener(rectangle, "bounds_changed", function() { var b, ne, sw; b = rectangle.getBounds(); ne = b.getNorthEast(); sw = b.getSouthWest(); if (settingBoundsFromScope) { return; } return _.defer(function() { return scope.$apply(function(s) { if (!rectangle.dragging) { if (s.bounds !== null && s.bounds !== undefined && s.bounds !== void 0) { s.bounds.ne = { latitude: ne.lat(), longitude: ne.lng() }; s.bounds.sw = { latitude: sw.lat(), longitude: sw.lng() }; } } }); }); }); scope.$watch("bounds", (function(newValue, oldValue) { var bounds; if (_.isEqual(newValue, oldValue)) { return; } settingBoundsFromScope = true; if (!dragging) { if ((newValue.sw.latitude == null) || (newValue.sw.longitude == null) || (newValue.ne.latitude == null) || (newValue.ne.longitude == null)) { $log.error("Invalid bounds for newValue: " + (JSON.stringify(newValue))); } bounds = new google.maps.LatLngBounds(new google.maps.LatLng(newValue.sw.latitude, newValue.sw.longitude), new google.maps.LatLng(newValue.ne.latitude, newValue.ne.longitude)); rectangle.setBounds(bounds); } return settingBoundsFromScope = false; }), true); if (angular.isDefined(scope.editable)) { scope.$watch("editable", function(newValue, oldValue) { return rectangle.setEditable(newValue); }); } if (angular.isDefined(scope.draggable)) { scope.$watch("draggable", function(newValue, oldValue) { return rectangle.setDraggable(newValue); }); } if (angular.isDefined(scope.visible)) { scope.$watch("visible", function(newValue, oldValue) { return rectangle.setVisible(newValue); }); } if (angular.isDefined(scope.stroke)) { if (angular.isDefined(scope.stroke.color)) { scope.$watch("stroke.color", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } if (angular.isDefined(scope.stroke.weight)) { scope.$watch("stroke.weight", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } if (angular.isDefined(scope.stroke.opacity)) { scope.$watch("stroke.opacity", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } } if (angular.isDefined(scope.fill)) { if (angular.isDefined(scope.fill.color)) { scope.$watch("fill.color", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } if (angular.isDefined(scope.fill.opacity)) { scope.$watch("fill.opacity", function(newValue, oldValue) { return rectangle.setOptions(buildOpts(rectangle.getBounds())); }); } } return scope.$on("$destroy", function() { return rectangle.setMap(null); }); }); } }; } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map info window directive This directive is used to create an info window on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute show optional} map will show when this expression returns true */ (function() { angular.module("google-maps").directive("window", [ "$timeout", "$compile", "$http", "$templateCache", "Window", function($timeout, $compile, $http, $templateCache, Window) { return new Window($timeout, $compile, $http, $templateCache); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicolas Laplante - https://plus.google.com/108189012221374960701 Nicholas McCready - https://twitter.com/nmccready */ /* Map info window directive This directive is used to create an info window on an existing map. This directive creates a new scope. {attribute coords required} object containing latitude and longitude properties {attribute show optional} map will show when this expression returns true */ (function() { angular.module("google-maps").directive("windows", [ "$timeout", "$compile", "$http", "$templateCache", "$interpolate", "Windows", function($timeout, $compile, $http, $templateCache, $interpolate, Windows) { return new Windows($timeout, $compile, $http, $templateCache, $interpolate); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors: - Nicolas Laplante https://plus.google.com/108189012221374960701 - Nicholas McCready - https://twitter.com/nmccready */ /* Map Layer directive This directive is used to create any type of Layer from the google maps sdk. This directive creates a new scope. {attribute show optional} true (default) shows the trafficlayer otherwise it is hidden */ (function() { var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; angular.module("google-maps").directive("layer", [ "$timeout", "Logger", "LayerParentModel", function($timeout, Logger, LayerParentModel) { var Layer; Layer = (function() { function Layer() { this.link = __bind(this.link, this); this.$log = Logger; this.restrict = "EMA"; this.require = "^googleMap"; this.priority = -1; this.transclude = true; this.template = '<span class=\"angular-google-map-layer\" ng-transclude></span>'; this.replace = true; this.scope = { show: "=show", type: "=type", namespace: "=namespace", options: '=options', onCreated: '&oncreated' }; } Layer.prototype.link = function(scope, element, attrs, mapCtrl) { var _this = this; return mapCtrl.getScope().deferred.promise.then(function(map) { if (scope.onCreated != null) { return new LayerParentModel(scope, element, attrs, map, scope.onCreated); } else { return new LayerParentModel(scope, element, attrs, map); } }); }; return Layer; })(); return new Layer(); } ]); }).call(this); /* ! The MIT License Copyright (c) 2010-2013 Google, Inc. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Adam Kreitals, [email protected] */ /* mapControl directive This directive is used to create a custom control element on an existing map. This directive creates a new scope. {attribute template required} string url of the template to be used for the control {attribute position optional} string position of the control of the form top-left or TOP_LEFT defaults to TOP_CENTER {attribute controller optional} string controller to be applied to the template {attribute index optional} number index for controlling the order of similarly positioned mapControl elements */ (function() { angular.module("google-maps").directive("mapControl", [ "Control", function(Control) { return new Control(); } ]); }).call(this); /* angular-google-maps https://github.com/nlaplante/angular-google-maps @authors Nicholas McCready - https://twitter.com/nmccready # Brunt of the work is in DrawFreeHandChildModel */ (function() { angular.module('google-maps').directive('FreeDrawPolygons'.ns(), [ 'FreeDrawPolygons', function(FreeDrawPolygons) { return new FreeDrawPolygons(); } ]); }).call(this); ;angular.module("google-maps.wrapped").service("uuid".ns(), function(){ /* Version: core-1.0 The MIT License: Copyright (c) 2012 LiosK. */ function UUID(){}UUID.generate=function(){var a=UUID._gri,b=UUID._ha;return b(a(32),8)+"-"+b(a(16),4)+"-"+b(16384|a(12),4)+"-"+b(32768|a(14),4)+"-"+b(a(48),12)};UUID._gri=function(a){return 0>a?NaN:30>=a?0|Math.random()*(1<<a):53>=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<<a-30)):NaN};UUID._ha=function(a,b){for(var c=a.toString(16),d=b-c.length,e="0";0<d;d>>>=1,e+=e)d&1&&(c=e+c);return c}; return UUID; });;/** * Performance overrides on MarkerClusterer custom to Angular Google Maps * * Created by Petr Bruna ccg1415 and Nick McCready on 7/13/14. */ (function () { var __hasProp = {}.hasOwnProperty, __extends = function (child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; window.NgMapCluster = (function (_super) { __extends(NgMapCluster, _super); function NgMapCluster(opts) { NgMapCluster.__super__.constructor.call(this, opts); this.markers_ = new window.PropMap(); } /** * Adds a marker to the cluster. * * @param {google.maps.Marker} marker The marker to be added. * @return {boolean} True if the marker was added. * @ignore */ NgMapCluster.prototype.addMarker = function (marker) { var i; var mCount; var mz; if (this.isMarkerAlreadyAdded_(marker)) { var oldMarker = this.markers_.get(marker.key); if (oldMarker.getPosition().lat() == marker.getPosition().lat() && oldMarker.getPosition().lon() == marker.getPosition().lon()) //if nothing has changed return false; } if (!this.center_) { this.center_ = marker.getPosition(); this.calculateBounds_(); } else { if (this.averageCenter_) { var l = this.markers_.length + 1; var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l; var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l; this.center_ = new google.maps.LatLng(lat, lng); this.calculateBounds_(); } } marker.isAdded = true; this.markers_.push(marker); mCount = this.markers_.length; mz = this.markerClusterer_.getMaxZoom(); if (mz !== null && this.map_.getZoom() > mz) { // Zoomed in past max zoom, so show the marker. if (marker.getMap() !== this.map_) { marker.setMap(this.map_); } } else if (mCount < this.minClusterSize_) { // Min cluster size not reached so show the marker. if (marker.getMap() !== this.map_) { marker.setMap(this.map_); } } else if (mCount === this.minClusterSize_) { // Hide the markers that were showing. this.markers_.values().forEach(function(m){ m.setMap(null); }); } else { marker.setMap(null); } // this.updateIcon_(); return true; }; /** * Determines if a marker has already been added to the cluster. * * @param {google.maps.Marker} marker The marker to check. * @return {boolean} True if the marker has already been added. */ NgMapCluster.prototype.isMarkerAlreadyAdded_ = function (marker) { return _.isNullOrUndefined(this.markers_.get(marker.key)); }; /** * Returns the bounds of the cluster. * * @return {google.maps.LatLngBounds} the cluster bounds. * @ignore */ NgMapCluster.prototype.getBounds = function () { var i; var bounds = new google.maps.LatLngBounds(this.center_, this.center_); var markers = this.getMarkers().values(); for (i = 0; i < markers.length; i++) { bounds.extend(markers[i].getPosition()); } return bounds; }; /** * Removes the cluster from the map. * * @ignore */ NgMapCluster.prototype.remove = function () { this.clusterIcon_.setMap(null); this.markers_ = new PropMap(); delete this.markers_; }; return NgMapCluster; })(Cluster); window.NgMapMarkerClusterer = (function (_super) { __extends(NgMapMarkerClusterer, _super); function NgMapMarkerClusterer(map, opt_markers, opt_options) { NgMapMarkerClusterer.__super__.constructor.call(this, map, opt_markers, opt_options); this.markers_ = new window.PropMap(); } /** * Removes all clusters and markers from the map and also removes all markers * managed by the clusterer. */ NgMapMarkerClusterer.prototype.clearMarkers = function () { this.resetViewport_(true); this.markers_ = new PropMap(); }; /** * Removes a marker and returns true if removed, false if not. * * @param {google.maps.Marker} marker The marker to remove * @return {boolean} Whether the marker was removed or not */ NgMapMarkerClusterer.prototype.removeMarker_ = function (marker) { if (!this.markers_.get(marker.key)) { return false; } marker.setMap(null); this.markers_.remove(marker.key); // Remove the marker from the list of managed markers return true; }; /** * Creates the clusters. This is done in batches to avoid timeout errors * in some browsers when there is a huge number of markers. * * @param {number} iFirst The index of the first marker in the batch of * markers to be added to clusters. */ NgMapMarkerClusterer.prototype.createClusters_ = function (iFirst) { var i, marker; var mapBounds; var cMarkerClusterer = this; if (!this.ready_) { return; } // Cancel previous batch processing if we're working on the first batch: if (iFirst === 0) { /** * This event is fired when the <code>MarkerClusterer</code> begins * clustering markers. * @name MarkerClusterer#clusteringbegin * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered. * @event */ google.maps.event.trigger(this, "clusteringbegin", this); if (typeof this.timerRefStatic !== "undefined") { clearTimeout(this.timerRefStatic); delete this.timerRefStatic; } } // Get our current map view bounds. // Create a new bounds object so we don't affect the map. // // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug: if (this.getMap().getZoom() > 3) { mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(), this.getMap().getBounds().getNorthEast()); } else { mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625)); } var bounds = this.getExtendedBounds(mapBounds); var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length); for (i = iFirst; i < iLast; i++) { marker = this.markers_.values()[i]; if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) { if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) { this.addToClosestCluster_(marker); } } } if (iLast < this.markers_.length) { this.timerRefStatic = setTimeout(function () { cMarkerClusterer.createClusters_(iLast); }, 0); } else { // custom addition by ngmaps // update icon for all clusters for (i = 0; i < this.clusters_.length; i++) { this.clusters_[i].updateIcon_(); } delete this.timerRefStatic; /** * This event is fired when the <code>MarkerClusterer</code> stops * clustering markers. * @name MarkerClusterer#clusteringend * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered. * @event */ google.maps.event.trigger(this, "clusteringend", this); } }; /** * Adds a marker to a cluster, or creates a new cluster. * * @param {google.maps.Marker} marker The marker to add. */ NgMapMarkerClusterer.prototype.addToClosestCluster_ = function (marker) { var i, d, cluster, center; var distance = 40000; // Some large number var clusterToAddTo = null; for (i = 0; i < this.clusters_.length; i++) { cluster = this.clusters_[i]; center = cluster.getCenter(); if (center) { d = this.distanceBetweenPoints_(center, marker.getPosition()); if (d < distance) { distance = d; clusterToAddTo = cluster; } } } if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) { clusterToAddTo.addMarker(marker); } else { cluster = new NgMapCluster(this); cluster.addMarker(marker); this.clusters_.push(cluster); } }; /** * Redraws all the clusters. */ NgMapMarkerClusterer.prototype.redraw_ = function () { this.createClusters_(0); }; /** * Removes all clusters from the map. The markers are also removed from the map * if <code>opt_hide</code> is set to <code>true</code>. * * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers * from the map. */ NgMapMarkerClusterer.prototype.resetViewport_ = function (opt_hide) { var i, marker; // Remove all the clusters for (i = 0; i < this.clusters_.length; i++) { this.clusters_[i].remove(); } this.clusters_ = []; // Reset the markers to not be added and to be removed from the map. this.markers_.values().forEach(function (marker) { marker.isAdded = false; if (opt_hide) { marker.setMap(null); } }); }; /** * Extends an object's prototype by another's. * * @param {Object} obj1 The object to be extended. * @param {Object} obj2 The object to extend with. * @return {Object} The new extended object. * @ignore */ MarkerClusterer.prototype.extend = function (obj1, obj2) { return (function (object) { var property; for (property in object.prototype) { if(property !== 'constructor') this.prototype[property] = object.prototype[property]; } return this; }).apply(obj1, [obj2]); }; return NgMapMarkerClusterer; })(MarkerClusterer); }).call(this);
packages/material-ui/src/NativeSelect/NativeSelectInput.js
Kagami/material-ui
import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { componentPropType } from '@material-ui/utils'; /** * @ignore - internal component. */ function NativeSelectInput(props) { const { children, classes, className, disabled, IconComponent, inputRef, name, onChange, value, variant, ...other } = props; return ( <div className={classes.root}> <select className={classNames( classes.select, { [classes.filled]: variant === 'filled', [classes.outlined]: variant === 'outlined', [classes.disabled]: disabled, }, className, )} name={name} disabled={disabled} onChange={onChange} value={value} ref={inputRef} {...other} > {children} </select> <IconComponent className={classes.icon} /> </div> ); } NativeSelectInput.propTypes = { /** * The option elements to populate the select with. * Can be some `<option>` elements. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css-api) below for more details. */ classes: PropTypes.object.isRequired, /** * The CSS class name of the select element. */ className: PropTypes.string, /** * If `true`, the select will be disabled. */ disabled: PropTypes.bool, /** * The icon that displays the arrow. */ IconComponent: componentPropType, /** * Use that property to pass a ref callback to the native select element. */ inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), /** * Name attribute of the `select` or hidden `input` element. */ name: PropTypes.string, /** * Callback function fired when a menu item is selected. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value`. */ onChange: PropTypes.func, /** * The input value. */ value: PropTypes.oneOfType([ PropTypes.string, PropTypes.number, PropTypes.bool, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool])), ]), /** * The variant to use. */ variant: PropTypes.oneOf(['standard', 'outlined', 'filled']), }; export default NativeSelectInput;
client/containers/messages.js
nearform/vidi-dashboard
'use strict' import React from 'react' import {connect} from 'react-redux' import {Link} from 'react-router' import {Panel, PageHeader, HealthPanel, InfoCell} from '../components/index' import ChartistGraph from 'react-chartist' import {subscribe, unsubscribe} from '../actions/vidi' import _ from 'lodash' export const Overview = React.createClass({ componentDidMount () { this.props.dispatch(subscribe('messages')) }, componentWillUnmount () { this.props.dispatch(unsubscribe('messages')) }, render () { var sections = [] var groups = _.groupBy(this.props.messages, 'pattern') var sortedKeys = _.keys(groups).sort() _.each(sortedKeys, (theKey) => { var group = groups[theKey] if (group) { var proc_sections = [] var data = _.orderBy(group, ['pid'], ['desc']) var count = data.length var tag = '' var key _.each(data, (message) => { if (message) { key = message.pattern.replace(/:/, '_').replace(/,/, '_ ') tag = message.pattern proc_sections.push(makeMessageSections(message)) } }) sections.push( <div key={key} className="process-group panel"> <div className="panel-heading cf"> <h3 className="m0 fl-left"><strong>{tag}</strong></h3> <a href="" className="fl-right icon icon-collapse"></a> </div> <div className="panel-body"> <HealthPanel count={count}/> {proc_sections} </div> </div> ) } }) return ( <div className="page page-processes"> <div className="container-fluid"> <PageHeader title={'Messages'} /> </div> <div className="container-fluid"> {sections} </div> </div> ) } }) export default connect((state) => { var vidi = state.vidi var messages = vidi.messages || {data: [null]} return { messages: messages.data } })(Overview) function makeMessageSections (messages) { var section = [] var now = messages.latest var link = `/process/${now.pid}` return ( <div key={now.pid} className="process-card"> <div className="process-heading has-icon"> <span className="status status-healthy status-small" title="Status: healthy"></span> <Link to={link}>{`${now.pid} - ${now.tag}`}</Link> </div> <div className="row middle-xs"> <div className="col-xs-12 mtb"> <ChartistGraph type={'Line'} data={{labels: messages.series.time, series: [messages.series.rate]}} options={{ fullWidth: true, showArea: false, showLine: true, showPoint: false, chartPadding: {right: 30}, axisY: {onlyInteger: true}, axisX: {labelOffset: {x: -15}, labelInterpolationFnc: (val) => { if (_.last(val) == '0') return val else return null }}, }}/> </div> </div> </div> ) }
js/src/index.js
romainberger/reddjent
import React from 'react' import Router from 'react-router' import routes from './routes' import ScrollBehavior from './scroll-behavior' const AppRouter = Router.create({ routes: routes, scrollBehavior: ScrollBehavior }) AppRouter.run(function(Handler, State) { React.render(<Handler />, document.body) })
ajax/libs/fluentui-react/8.29.2/fluentui-react.js
cdnjs/cdnjs
/*! For license information please see fluentui-react.js.LICENSE.txt */ var FluentUIReact;!function(){"use strict";var e={d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{ActionButton:function(){return Nd},ActivityItem:function(){return zi},AnimationClassNames:function(){return Ze},AnimationDirection:function(){return Ap},AnimationStyles:function(){return He},AnimationVariables:function(){return Le},Announced:function(){return na},AnnouncedBase:function(){return oa},Async:function(){return Zi},AutoScroll:function(){return TS},Autofill:function(){return Qi},BaseButton:function(){return Wu},BaseComponent:function(){return zs},BaseExtendedPeoplePicker:function(){return T_},BaseExtendedPicker:function(){return I_},BaseFloatingPeoplePicker:function(){return yC},BaseFloatingPicker:function(){return bC},BasePeoplePicker:function(){return Nx},BasePeopleSelectedItemsList:function(){return tw},BasePicker:function(){return Cx},BasePickerListBelow:function(){return Sx},BaseSelectedItemsList:function(){return Lk},BaseSlots:function(){return DD},Breadcrumb:function(){return Dd},BreadcrumbBase:function(){return Sd},Button:function(){return Ld},ButtonGrid:function(){return Gd},ButtonGridCell:function(){return Xd},ButtonType:function(){return md},COACHMARK_ATTRIBUTE_NAME:function(){return bm},Calendar:function(){return Ch},Callout:function(){return Cc},CalloutContent:function(){return oc},CalloutContentBase:function(){return Ql},Check:function(){return Eh},CheckBase:function(){return Dh},Checkbox:function(){return Ah},CheckboxBase:function(){return Mh},CheckboxVisibility:function(){return tv},ChoiceGroup:function(){return rm},ChoiceGroupBase:function(){return tm},ChoiceGroupOption:function(){return Xh},Coachmark:function(){return xm},CoachmarkBase:function(){return Cm},CollapseAllVisibility:function(){return Xf},ColorClassNames:function(){return to},ColorPicker:function(){return Yg},ColorPickerBase:function(){return Wg},ColorPickerGridCell:function(){return SI},ColorPickerGridCellBase:function(){return _I},ColumnActionsMode:function(){return Qf},ColumnDragEndLocation:function(){return $f},ComboBox:function(){return lf},CommandBar:function(){return Lf},CommandBarBase:function(){return Af},CommandBarButton:function(){return Od},CommandButton:function(){return zd},CommunicationColors:function(){return ZI},CompactPeoplePicker:function(){return zx},CompactPeoplePickerBase:function(){return Ax},CompoundButton:function(){return Fd},ConstrainMode:function(){return Jf},ContextualMenu:function(){return Au},ContextualMenuBase:function(){return Mu},ContextualMenuItem:function(){return Oc},ContextualMenuItemBase:function(){return Tc},ContextualMenuItemType:function(){return Us},Customizations:function(){return Dt},Customizer:function(){return ic},CustomizerContext:function(){return On},DATAKTP_ARIA_TARGET:function(){return jc},DATAKTP_EXECUTE_TARGET:function(){return Gc},DATAKTP_TARGET:function(){return Uc},DATA_IS_SCROLLABLE_ATTRIBUTE:function(){return qa},DATA_PORTAL_ATTRIBUTE:function(){return ts},DAYS_IN_WEEK:function(){return Qd},DEFAULT_CELL_STYLE_PROPS:function(){return dv},DEFAULT_MASK_CHAR:function(){return JI},DEFAULT_ROW_HEIGHTS:function(){return pv},DatePicker:function(){return jf},DatePickerBase:function(){return Wf},DateRangeType:function(){return Zd},DayOfWeek:function(){return jd},DefaultButton:function(){return Md},DefaultEffects:function(){return Ot},DefaultFontStyles:function(){return pt},DefaultPalette:function(){return vt},DefaultSpacing:function(){return Gt},DelayedRender:function(){return ea},Depths:function(){return St},DetailsColumnBase:function(){return Dv},DetailsHeader:function(){return Lv},DetailsHeaderBase:function(){return Rv},DetailsList:function(){return Ib},DetailsListBase:function(){return Cb},DetailsListLayoutMode:function(){return ev},DetailsRow:function(){return Gv},DetailsRowBase:function(){return Wv},DetailsRowCheck:function(){return xv},DetailsRowFields:function(){return Hv},DetailsRowGlobalClassNames:function(){return uv},Dialog:function(){return ry},DialogBase:function(){return oy},DialogContent:function(){return Jb},DialogContentBase:function(){return Xb},DialogFooter:function(){return qb},DialogFooterBase:function(){return Gb},DialogType:function(){return kb},DirectionalHint:function(){return qs},DocumentCard:function(){return hy},DocumentCardActions:function(){return vy},DocumentCardActivity:function(){return yy},DocumentCardDetails:function(){return xy},DocumentCardImage:function(){return Ry},DocumentCardLocation:function(){return wy},DocumentCardLogo:function(){return Hy},DocumentCardPreview:function(){return Dy},DocumentCardStatus:function(){return Vy},DocumentCardTitle:function(){return By},DocumentCardType:function(){return Kb},DragDropHelper:function(){return kv},Dropdown:function(){return S_},DropdownBase:function(){return p_},DropdownMenuItemType:function(){return Gg},EdgeChromiumHighContrastSelector:function(){return so},ElementType:function(){return hd},EventGroup:function(){return Os},ExpandingCard:function(){return MC},ExpandingCardBase:function(){return PC},ExpandingCardMode:function(){return IC},ExtendedPeoplePicker:function(){return E_},ExtendedSelectedItem:function(){return Xk},Fabric:function(){return dc},FabricBase:function(){return lc},FabricPerformance:function(){return jD},FabricSlots:function(){return TD},Facepile:function(){return z_},FacepileBase:function(){return H_},FirstWeekOfYear:function(){return Yd},FloatingPeoplePicker:function(){return _C},FluentTheme:function(){return fD},FocusRects:function(){return ks},FocusTrapCallout:function(){return wh},FocusTrapZone:function(){return xh},FocusZone:function(){return vs},FocusZoneDirection:function(){return $i},FocusZoneTabbableElements:function(){return ra},FontClassNames:function(){return ft},FontIcon:function(){return ti},FontSizes:function(){return je},FontWeights:function(){return qe},GlobalSettings:function(){return yt},GroupFooter:function(){return cb},GroupHeader:function(){return nb},GroupShowAll:function(){return ab},GroupSpacer:function(){return sv},GroupedList:function(){return gb},GroupedListBase:function(){return mb},GroupedListSection:function(){return ub},HEX_REGEX:function(){return Bm},HighContrastSelector:function(){return ro},HighContrastSelectorBlack:function(){return ao},HighContrastSelectorWhite:function(){return io},HoverCard:function(){return HC},HoverCardBase:function(){return LC},HoverCardType:function(){return kC},Icon:function(){return ii},IconBase:function(){return ri},IconButton:function(){return Zu},IconFontSizes:function(){return Ye},IconType:function(){return Er},Image:function(){return Ur},ImageBase:function(){return Vr},ImageCoverStyle:function(){return Mr},ImageFit:function(){return Pr},ImageIcon:function(){return js},ImageLoadState:function(){return Rr},InjectionMode:function(){return v},IsFocusVisibleClassName:function(){return wo},KTP_ARIA_SEPARATOR:function(){return Yc},KTP_FULL_PREFIX:function(){return Kc},KTP_LAYER_ID:function(){return qc},KTP_PREFIX:function(){return Wc},KTP_SEPARATOR:function(){return Vc},KeyCodes:function(){return Un},KeyboardSpinDirection:function(){return Ow},Keytip:function(){return cS},KeytipData:function(){return ou},KeytipEvents:function(){return Sc},KeytipLayer:function(){return SS},KeytipLayerBase:function(){return CS},KeytipManager:function(){return Zc},Label:function(){return Oh},LabelBase:function(){return Hh},Layer:function(){return _c},LayerBase:function(){return vc},LayerHost:function(){return wS},Link:function(){return Rs},LinkBase:function(){return Ps},List:function(){return Sf},ListPeoplePicker:function(){return Wx},ListPeoplePickerBase:function(){return Lx},LocalizedFontFamilies:function(){return Ge},LocalizedFontNames:function(){return Ue},MAX_COLOR_ALPHA:function(){return Em},MAX_COLOR_HUE:function(){return wm},MAX_COLOR_RGB:function(){return Dm},MAX_COLOR_RGBA:function(){return Tm},MAX_COLOR_SATURATION:function(){return km},MAX_COLOR_VALUE:function(){return Im},MAX_HEX_LENGTH:function(){return Mm},MAX_RGBA_LENGTH:function(){return Nm},MIN_HEX_LENGTH:function(){return Pm},MIN_RGBA_LENGTH:function(){return Rm},MarqueeSelection:function(){return AS},MaskedTextField:function(){return $I},MeasuredContext:function(){return Ju},MemberListPeoplePicker:function(){return Bx},MessageBar:function(){return XS},MessageBarBase:function(){return US},MessageBarButton:function(){return Vd},MessageBarType:function(){return NS},Modal:function(){return Vb},ModalBase:function(){return Wb},MonthOfYear:function(){return qd},MotionAnimations:function(){return oD},MotionDurations:function(){return eD},MotionTimings:function(){return tD},Nav:function(){return nx},NavBase:function(){return ox},NeutralColors:function(){return XI},NormalPeoplePicker:function(){return Ox},NormalPeoplePickerBase:function(){return Fx},OpenCardMode:function(){return xC},OverflowButtonType:function(){return D_},OverflowSet:function(){return Nf},OverflowSetBase:function(){return Mf},Overlay:function(){return Rb},OverlayBase:function(){return Pb},Panel:function(){return l_},PanelBase:function(){return Jy},PanelType:function(){return iy},PeoplePickerItem:function(){return Ix},PeoplePickerItemBase:function(){return wx},PeoplePickerItemSuggestion:function(){return Px},PeoplePickerItemSuggestionBase:function(){return Ex},Persona:function(){return A_},PersonaBase:function(){return B_},PersonaCoin:function(){return Oi},PersonaCoinBase:function(){return Fi},PersonaInitialsColor:function(){return Xr},PersonaPresence:function(){return Zr},PersonaSize:function(){return Yr},Pivot:function(){return lk},PivotBase:function(){return nk},PivotItem:function(){return $x},PivotLinkFormat:function(){return rk},PivotLinkSize:function(){return ik},PlainCard:function(){return FC},PlainCardBase:function(){return BC},Popup:function(){return Ul},Position:function(){return Xs},PositioningContainer:function(){return hm},PrimaryButton:function(){return Ad},ProgressIndicator:function(){return gk},ProgressIndicatorBase:function(){return dk},PulsingBeaconAnimationStyles:function(){return Lo},RGBA_REGEX:function(){return Fm},Rating:function(){return Sk},RatingBase:function(){return Ck},RatingSize:function(){return ck},Rectangle:function(){return rl},RectangleEdge:function(){return Zs},ResizeGroup:function(){return id},ResizeGroupBase:function(){return nd},ResizeGroupDirection:function(){return Ku},ResponsiveMode:function(){return pu},SELECTION_CHANGE:function(){return qf},ScreenWidthMaxLarge:function(){return vo},ScreenWidthMaxMedium:function(){return fo},ScreenWidthMaxSmall:function(){return go},ScreenWidthMaxXLarge:function(){return bo},ScreenWidthMaxXXLarge:function(){return yo},ScreenWidthMinLarge:function(){return uo},ScreenWidthMinMedium:function(){return co},ScreenWidthMinSmall:function(){return lo},ScreenWidthMinUhfMobile:function(){return _o},ScreenWidthMinXLarge:function(){return po},ScreenWidthMinXXLarge:function(){return ho},ScreenWidthMinXXXLarge:function(){return mo},ScrollToMode:function(){return vf},ScrollablePane:function(){return Tk},ScrollablePaneBase:function(){return Dk},ScrollablePaneContext:function(){return wk},ScrollbarVisibility:function(){return kk},SearchBox:function(){return Ak},SearchBoxBase:function(){return Bk},SelectAllVisibility:function(){return Sv},SelectableOptionMenuItemType:function(){return Gg},SelectedPeopleList:function(){return ow},Selection:function(){return Yf},SelectionDirection:function(){return Uf},SelectionMode:function(){return Kf},SelectionZone:function(){return av},SemanticColorSlots:function(){return ED},Separator:function(){return iw},SeparatorBase:function(){return rw},Shade:function(){return ig},SharedColors:function(){return QI},Shimmer:function(){return Pw},ShimmerBase:function(){return Ew},ShimmerCircle:function(){return Sw},ShimmerCircleBase:function(){return Cw},ShimmerElementType:function(){return aw},ShimmerElementsDefaultHeights:function(){return sw},ShimmerElementsGroup:function(){return Dw},ShimmerElementsGroupBase:function(){return kw},ShimmerGap:function(){return bw},ShimmerGapBase:function(){return fw},ShimmerLine:function(){return mw},ShimmerLineBase:function(){return pw},ShimmeredDetailsList:function(){return Nw},ShimmeredDetailsListBase:function(){return Rw},Slider:function(){return Ww},SliderBase:function(){return Hw},SpinButton:function(){return Qw},Spinner:function(){return $v},SpinnerBase:function(){return Xv},SpinnerSize:function(){return Kv},SpinnerType:function(){return Uv},Stack:function(){return gI},StackItem:function(){return cI},Sticky:function(){return fI},StickyPositionType:function(){return aI},Stylesheet:function(){return C},SuggestionActionType:function(){return ex},SuggestionItemType:function(){return aC},Suggestions:function(){return cx},SuggestionsControl:function(){return fC},SuggestionsController:function(){return ux},SuggestionsCore:function(){return iC},SuggestionsHeaderFooterItem:function(){return gC},SuggestionsItem:function(){return oC},SuggestionsStore:function(){return SC},SwatchColorPicker:function(){return DI},SwatchColorPickerBase:function(){return wI},TagItem:function(){return Gx},TagItemBase:function(){return Ux},TagItemSuggestion:function(){return Zx},TagItemSuggestionBase:function(){return Yx},TagPicker:function(){return Qx},TagPickerBase:function(){return Xx},TeachingBubble:function(){return OI},TeachingBubbleBase:function(){return HI},TeachingBubbleContent:function(){return FI},TeachingBubbleContentBase:function(){return EI},Text:function(){return VI},TextField:function(){return Pg},TextFieldBase:function(){return wg},TextStyles:function(){return WI},TextView:function(){return zI},ThemeContext:function(){return vD},ThemeGenerator:function(){return PD},ThemeProvider:function(){return ID},ThemeSettingName:function(){return Zt},TimeConstants:function(){return ep},TimePicker:function(){return AD},Toggle:function(){return UD},ToggleBase:function(){return VD},Tooltip:function(){return pd},TooltipBase:function(){return dd},TooltipDelay:function(){return cd},TooltipHost:function(){return bd},TooltipHostBase:function(){return fd},TooltipOverflowMode:function(){return rd},ValidationState:function(){return rx},VerticalDivider:function(){return su},VirtualizedComboBox:function(){return kf},WeeklyDayPicker:function(){return uT},WindowContext:function(){return Hl},WindowProvider:function(){return Wl},ZIndexes:function(){return ko},addDays:function(){return tp},addDirectionalKeyCode:function(){return _s},addElementAtIndex:function(){return da},addMonths:function(){return np},addWeeks:function(){return op},addYears:function(){return rp},allowOverscrollOnElement:function(){return Za},allowScrollOnElement:function(){return Ya},anchorProperties:function(){return dr},appendFunction:function(){return Vi},arraysEqual:function(){return ha},asAsync:function(){return YD},assertNever:function(){return ZD},assign:function(){return Bs},audioProperties:function(){return sr},baseElementEvents:function(){return nr},baseElementProperties:function(){return rr},buildClassMap:function(){return Q},buildColumns:function(){return Sb},buildKeytipConfigMap:function(){return xS},buttonProperties:function(){return pr},calculatePrecision:function(){return MS},canAnyMenuItemsCheck:function(){return Eu},clamp:function(){return Wm},classNamesFunction:function(){return Jn},colGroupProperties:function(){return Cr},colProperties:function(){return Sr},compareDatePart:function(){return dp},compareDates:function(){return up},composeComponentAs:function(){return If},composeRenderFunction:function(){return Wh},concatStyleSets:function(){return kn},concatStyleSetsWithProps:function(){return wn},constructKeytip:function(){return kS},correctHSV:function(){return ng},correctHex:function(){return rg},correctRGB:function(){return og},createArray:function(){return sa},createFontStyles:function(){return et},createGenericItem:function(){return Hx},createItem:function(){return CC},createMemoizer:function(){return qo},createMergedRef:function(){return ga},createTheme:function(){return jt},css:function(){return qr},cssColor:function(){return Om},customizable:function(){return Vu},defaultCalendarNavigationIcons:function(){return Xp},defaultCalendarStrings:function(){return Yp},defaultDatePickerStrings:function(){return Hf},defaultDayPickerStrings:function(){return Zp},defaultWeeklyDayPickerNavigationIcons:function(){return aT},defaultWeeklyDayPickerStrings:function(){return iT},disableBodyScroll:function(){return Qa},divProperties:function(){return Dr},doesElementContainFocus:function(){return Na},elementContains:function(){return Ca},elementContainsAttribute:function(){return _a},enableBodyScroll:function(){return Ja},extendComponent:function(){return Ki},filteredAssign:function(){return Fs},find:function(){return aa},findElementRecursive:function(){return ya},findIndex:function(){return ia},findScrollableParent:function(){return es},fitContentToBounds:function(){return PS},flatten:function(){return pa},focusAsync:function(){return Aa},focusClear:function(){return Eo},focusFirstChild:function(){return Ia},fontFace:function(){return Xe},formProperties:function(){return xr},format:function(){return wp},getAllSelectedOptions:function(){return nf},getAriaDescribedBy:function(){return eu},getBackgroundShade:function(){return yg},getBoundsFromTargetWindow:function(){return Fl},getChildren:function(){return XD},getColorFromHSV:function(){return Xm},getColorFromRGBA:function(){return Ym},getColorFromString:function(){return Zm},getContrastRatio:function(){return _g},getDatePartHashValue:function(){return yp},getDateRangeArray:function(){return pp},getDetailsRowStyles:function(){return mv},getDistanceBetweenPoints:function(){return ES},getDocument:function(){return nt},getEdgeChromiumNoHighContrastAdjustSelector:function(){return xo},getElementIndexPath:function(){return Ha},getEndDateOfWeek:function(){return vp},getFadedOverflowStyle:function(){return rn},getFirstFocusable:function(){return Sa},getFirstTabbable:function(){return ka},getFocusOutlineStyle:function(){return Po},getFocusStyle:function(){return To},getFocusableByIndexPath:function(){return La},getFontIcon:function(){return oi},getFullColorString:function(){return Qm},getGlobalClassNames:function(){return Qo},getHighContrastNoAdjustStyle:function(){return So},getIcon:function(){return vn},getIconClassName:function(){return xn},getIconContent:function(){return ei},getId:function(){return Va},getInitialResponsiveMode:function(){return _u},getInitials:function(){return Hr},getInputFocusStyle:function(){return Mo},getLanguage:function(){return ut},getLastFocusable:function(){return xa},getLastTabbable:function(){return wa},getMaxHeight:function(){return Nl},getMeasurementCache:function(){return Xu},getMenuItemStyles:function(){return Nc},getMonthEnd:function(){return ap},getMonthStart:function(){return ip},getNativeElementProps:function(){return cv},getNativeProps:function(){return Tr},getNextElement:function(){return Ta},getNextResizeGroupStateProvider:function(){return Qu},getOppositeEdge:function(){return Bl},getParent:function(){return ba},getPersonaInitialsColor:function(){return Ci},getPlaceholderStyles:function(){return sn},getPreviousElement:function(){return Da},getPropsWithDefaults:function(){return tr},getRTL:function(){return jn},getRTLSafeKeyCode:function(){return Yn},getRect:function(){return fb},getResourceUrl:function(){return oT},getResponsiveMode:function(){return Su},getScreenSelector:function(){return Co},getScrollbarWidth:function(){return $a},getShade:function(){return bg},getSplitButtonClassNames:function(){return Ou},getStartDateOfWeek:function(){return fp},getSubmenuItems:function(){return Tu},getTheme:function(){return Qt},getThemedContext:function(){return tn},getVirtualParent:function(){return va},getWeekNumber:function(){return gp},getWeekNumbersInMonth:function(){return mp},getWindow:function(){return at},getYearEnd:function(){return lp},getYearStart:function(){return sp},hasHorizontalOverflow:function(){return ad},hasOverflow:function(){return ld},hasVerticalOverflow:function(){return sd},hiddenContentStyle:function(){return Ro},hoistMethods:function(){return uu},hoistStatics:function(){return mu},hsl2hsv:function(){return Am},hsl2rgb:function(){return Hm},hsv2hex:function(){return Um},hsv2hsl:function(){return jm},hsv2rgb:function(){return Lm},htmlElementProperties:function(){return ir},iframeProperties:function(){return kr},imageProperties:function(){return Ir},imgProperties:function(){return wr},initializeComponentRef:function(){return Ui},initializeFocusRects:function(){return QD},initializeIcons:function(){return rS},initializeResponsiveMode:function(){return yu},inputProperties:function(){return hr},isControlled:function(){return wi},isDark:function(){return vg},isDirectionalKeyCode:function(){return ys},isElementFocusSubZone:function(){return Ra},isElementFocusZone:function(){return Ma},isElementTabbable:function(){return Pa},isElementVisible:function(){return Ea},isIE11:function(){return Wi},isIOS:function(){return Qs},isInDateRangeArray:function(){return hp},isMac:function(){return Ys},isRelativeUrl:function(){return $S},isValidShade:function(){return mg},isVirtualElement:function(){return fa},keyframes:function(){return J},ktpTargetFromId:function(){return $c},ktpTargetFromSequences:function(){return Jc},labelProperties:function(){return ar},liProperties:function(){return ur},loadTheme:function(){return eo},makeStyles:function(){return SD},mapEnumByName:function(){return As},memoize:function(){return Go},memoizeFunction:function(){return jo},merge:function(){return zt},mergeAriaAttributeValues:function(){return Ks},mergeCustomizations:function(){return rc},mergeOverflows:function(){return Qc},mergeScopedSettings:function(){return $o},mergeSettings:function(){return Jo},mergeStyleSets:function(){return In},mergeStyles:function(){return Z},mergeThemes:function(){return Ut},modalize:function(){return Sh},noWrap:function(){return nn},normalize:function(){return on},nullRender:function(){return Vs},olProperties:function(){return cr},omit:function(){return Hs},on:function(){return ol},optionProperties:function(){return fr},personaPresenceSize:function(){return $r},personaSize:function(){return Jr},portalContainsElement:function(){return ns},positionCallout:function(){return Ml},positionCard:function(){return Rl},positionElement:function(){return Pl},precisionRound:function(){return RS},presenceBoolean:function(){return li},raiseClick:function(){return Ua},registerDefaultFontFaces:function(){return gt},registerIconAlias:function(){return fn},registerIcons:function(){return mn},registerOnThemeChangeCallback:function(){return Jt},removeIndex:function(){return ca},removeOnThemeChangeCallback:function(){return $t},replaceElement:function(){return ua},resetControlledWarnings:function(){return Ii},resetIds:function(){return Ka},resetMemoizations:function(){return Uo},rgb2hex:function(){return Vm},rgb2hsv:function(){return Gm},safeRequestAnimationFrame:function(){return Ky},safeSetTimeout:function(){return rT},selectProperties:function(){return gr},sequencesToID:function(){return Xc},setBaseUrl:function(){return nT},setFocusVisibility:function(){return Do},setIconOptions:function(){return bn},setLanguage:function(){return dt},setMemoizeWeakMap:function(){return Ko},setMonth:function(){return cp},setPortalAttribute:function(){return os},setRTL:function(){return qn},setResponsiveMode:function(){return bu},setSSR:function(){return ot},setVirtualParent:function(){return pc},setWarningCallback:function(){return un},shallowCompare:function(){return Ns},shouldWrapFocus:function(){return Ba},sizeBoolean:function(){return ai},sizeToPixels:function(){return si},styled:function(){return Vn},tableProperties:function(){return vr},tdProperties:function(){return _r},textAreaProperties:function(){return mr},thProperties:function(){return yr},themeRulesStandardCreator:function(){return MD},toMatrix:function(){return la},trProperties:function(){return br},transitionKeysAreEqual:function(){return gS},transitionKeysContain:function(){return fS},unhoistMethods:function(){return du},unregisterIcons:function(){return gn},updateA:function(){return tg},updateH:function(){return $m},updateRGB:function(){return eg},updateSV:function(){return Jm},updateT:function(){return Cg},useCustomizationSettings:function(){return zn},useDocument:function(){return zl},useFocusRects:function(){return xs},useHeightOffset:function(){return pm},useKeytipRef:function(){return uS},useResponsiveMode:function(){return xu},useTheme:function(){return bD},useWindow:function(){return Ol},values:function(){return Ls},videoProperties:function(){return lr},warn:function(){return cn},warnConditionallyRequiredProps:function(){return Si},warnControlledUsage:function(){return Di},warnDeprecations:function(){return xi},warnMutuallyExclusive:function(){return ki},withResponsiveMode:function(){return Cu}});var o={};e.r(o),e.d(o,{pickerInput:function(){return k_},pickerText:function(){return x_}});var n={};e.r(n),e.d(n,{callout:function(){return W_}});var r={};e.r(r),e.d(r,{actionButton:function(){return q_},buttonSelected:function(){return Y_},closeButton:function(){return U_},itemButton:function(){return j_},root:function(){return V_},suggestionsAvailable:function(){return $_},suggestionsContainer:function(){return X_},suggestionsItem:function(){return K_},suggestionsItemIsSuggested:function(){return G_},suggestionsNone:function(){return Q_},suggestionsSpinner:function(){return J_},suggestionsTitle:function(){return Z_}});var i={};e.r(i),e.d(i,{suggestionsContainer:function(){return nC}});var a={};e.r(a),e.d(a,{actionButton:function(){return lC},buttonSelected:function(){return cC},itemButton:function(){return pC},root:function(){return sC},screenReaderOnly:function(){return hC},suggestionsSpinner:function(){return dC},suggestionsTitle:function(){return uC}});var s={};e.r(s),e.d(s,{inputDisabled:function(){return gx},inputFocused:function(){return mx},pickerInput:function(){return fx},pickerItems:function(){return vx},pickerText:function(){return hx},screenReaderOnly:function(){return bx}});var l={};e.r(l),e.d(l,{actionButton:function(){return zk},expandButton:function(){return Gk},hover:function(){return Ok},itemContainer:function(){return Yk},itemContent:function(){return Kk},personaContainer:function(){return Hk},personaContainerIsSelected:function(){return Wk},personaDetails:function(){return qk},personaWrapper:function(){return jk},removeButton:function(){return Uk},validationError:function(){return Vk}});var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(e,t)};function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var d=function(){return(d=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function p(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}function h(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a}function m(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var n=Array(e),r=0;for(t=0;t<o;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)n[r]=i[a];return n}Object.create,Object.create;var g,f=React,v={none:0,insertNode:1,appendChild:2},b="undefined"!=typeof navigator&&/rv:11.0/.test(navigator.userAgent),y={};try{y=window}catch(P){}var _,C=function(){function e(e){this._rules=[],this._preservedRules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._onResetCallbacks=[],this._classNameToArgs={},this._config=d({injectionMode:v.insertNode,defaultPrefix:"css",namespace:void 0,cspSettings:void 0},e),this._keyToClassName=this._config.classNameCache||{}}return e.getInstance=function(){if(!(g=y.__stylesheet__)||g._lastStyleElement&&g._lastStyleElement.ownerDocument!==document){var t=(null==y?void 0:y.FabricConfig)||{};g=y.__stylesheet__=new e(t.mergeStyles)}return g},e.prototype.setConfig=function(e){this._config=d(d({},this._config),e)},e.prototype.onReset=function(e){this._onResetCallbacks.push(e)},e.prototype.getClassName=function(e){var t=this._config.namespace;return(t?t+"-":"")+(e||this._config.defaultPrefix)+"-"+this._counter++},e.prototype.cacheClassName=function(e,t,o,n){this._keyToClassName[t]=e,this._classNameToArgs[e]={args:o,rules:n}},e.prototype.classNameFromKey=function(e){return this._keyToClassName[e]},e.prototype.getClassNameCache=function(){return this._keyToClassName},e.prototype.argsFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.args},e.prototype.insertedRulesFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.rules},e.prototype.insertRule=function(e,t){var o=this._config.injectionMode!==v.none?this._getStyleElement():void 0;if(t&&this._preservedRules.push(e),o)switch(this._config.injectionMode){case v.insertNode:var n=o.sheet;try{n.insertRule(e,n.cssRules.length)}catch(e){}break;case v.appendChild:o.appendChild(document.createTextNode(e))}else this._rules.push(e);this._config.onInsertRule&&this._config.onInsertRule(e)},e.prototype.getRules=function(e){return(e?this._preservedRules.join(""):"")+this._rules.join("")+this._rulesToInsert.join("")},e.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={},this._onResetCallbacks.forEach((function(e){return e()}))},e.prototype.resetKeys=function(){this._keyToClassName={}},e.prototype._getStyleElement=function(){var e=this;return this._styleElement||"undefined"==typeof document||(this._styleElement=this._createStyleElement(),b||window.requestAnimationFrame((function(){e._styleElement=void 0}))),this._styleElement},e.prototype._createStyleElement=function(){var e=document.head,t=document.createElement("style");t.setAttribute("data-merge-styles","true");var o=this._config.cspSettings;if(o&&o.nonce&&t.setAttribute("nonce",o.nonce),this._lastStyleElement)e.insertBefore(t,this._lastStyleElement.nextElementSibling);else{var n=this._findPlaceholderStyleTag();n?e.insertBefore(t,n.nextElementSibling):e.insertBefore(t,e.childNodes[0])}return this._lastStyleElement=t,t},e.prototype._findPlaceholderStyleTag=function(){var e=document.head;return e?e.querySelector("style[data-merge-styles]"):null},e}();function S(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=[],n=[],r=C.getInstance();function i(e){for(var t=0,a=e;t<a.length;t++){var s=a[t];if(s)if("string"==typeof s)if(s.indexOf(" ")>=0)i(s.split(" "));else{var l=r.argsFromClassName(s);l?i(l):-1===o.indexOf(s)&&o.push(s)}else Array.isArray(s)?i(s):"object"==typeof s&&n.push(s)}}return i(e),{classes:o,objects:n}}function x(e){_!==e&&(_=e)}function k(){return void 0===_&&(_="undefined"!=typeof document&&!!document.documentElement&&"rtl"===document.documentElement.getAttribute("dir")),_}function w(){return{rtl:k()}}_=k();var I,D={},T={"user-select":1};function E(e,t){var o=function(){var e;if(!I){var t="undefined"!=typeof document?document:void 0,o="undefined"!=typeof navigator?navigator:void 0,n=null===(e=null==o?void 0:o.userAgent)||void 0===e?void 0:e.toLowerCase();I=t?{isWebkit:!(!t||!("WebkitAppearance"in t.documentElement.style)),isMoz:!!(n&&n.indexOf("firefox")>-1),isOpera:!!(n&&n.indexOf("opera")>-1),isMs:!(!o||!/rv:11.0/i.test(o.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent))}:{isWebkit:!0,isMoz:!0,isOpera:!0,isMs:!0}}return I}(),n=e[t];if(T[n]){var r=e[t+1];T[n]&&(o.isWebkit&&e.push("-webkit-"+n,r),o.isMoz&&e.push("-moz-"+n,r),o.isMs&&e.push("-ms-"+n,r),o.isOpera&&e.push("-o-"+n,r))}}var P,M=["column-count","font-weight","flex","flex-grow","flex-shrink","fill-opacity","opacity","order","z-index","zoom"];function R(e,t){var o=e[t],n=e[t+1];if("number"==typeof n){var r=M.indexOf(o)>-1,i=o.indexOf("--")>-1,a=r||i?"":"px";e[t+1]=""+n+a}}var N="left",B="right",F=((P={}).left=B,P.right=N,P),A={"w-resize":"e-resize","sw-resize":"se-resize","nw-resize":"ne-resize"};function L(e,t,o){if(e.rtl){var n=t[o];if(!n)return;var r=t[o+1];if("string"==typeof r&&r.indexOf("@noflip")>=0)t[o+1]=r.replace(/\s*(?:\/\*\s*)?\@noflip\b(?:\s*\*\/)?\s*?/g,"");else if(n.indexOf(N)>=0)t[o]=n.replace(N,B);else if(n.indexOf(B)>=0)t[o]=n.replace(B,N);else if(String(r).indexOf(N)>=0)t[o+1]=r.replace(N,B);else if(String(r).indexOf(B)>=0)t[o+1]=r.replace(B,N);else if(F[n])t[o]=F[n];else if(A[r])t[o+1]=A[r];else switch(n){case"margin":case"padding":t[o+1]=function(e){if("string"==typeof e){var t=e.split(" ");if(4===t.length)return t[0]+" "+t[3]+" "+t[2]+" "+t[1]}return e}(r);break;case"box-shadow":t[o+1]=function(e,t){var o=e.split(" "),n=parseInt(o[0],10);return o[0]=o[0].replace(String(n),String(-1*n)),o.join(" ")}(r)}}}function H(e){var t=e&&e["&"];return t?t.displayName:void 0}var O=/\:global\((.+?)\)/g;function z(e,t){return e.indexOf(":global(")>=0?e.replace(O,"$1"):0===e.indexOf(":")?t+e:e.indexOf("&")<0?t+" "+e:e}function W(e,t,o,n){void 0===t&&(t={__order:[]}),0===o.indexOf("@")?V([n],t,o=o+"{"+e):o.indexOf(",")>-1?function(e){if(!O.test(e))return e;for(var t=[],o=/\:global\((.+?)\)/g,n=null;n=o.exec(e);)n[1].indexOf(",")>-1&&t.push([n.index,n.index+n[0].length,n[1].split(",").map((function(e){return":global("+e.trim()+")"})).join(", ")]);return t.reverse().reduce((function(e,t){var o=t[0],n=t[1],r=t[2];return e.slice(0,o)+r+e.slice(n)}),e)}(o).split(",").map((function(e){return e.trim()})).forEach((function(o){return V([n],t,z(o,e))})):V([n],t,z(o,e))}function V(e,t,o){void 0===t&&(t={__order:[]}),void 0===o&&(o="&");var n=C.getInstance(),r=t[o];r||(r={},t[o]=r,t.__order.push(o));for(var i=0,a=e;i<a.length;i++){var s=a[i];if("string"==typeof s){var l=n.argsFromClassName(s);l&&V(l,t,o)}else if(Array.isArray(s))V(s,t,o);else for(var c in s)if(s.hasOwnProperty(c)){var u=s[c];if("selectors"===c){var d=s.selectors;for(var p in d)d.hasOwnProperty(p)&&W(o,t,p,d[p])}else"object"==typeof u?null!==u&&W(o,t,c,u):void 0!==u&&("margin"===c||"padding"===c?K(r,c,u):r[c]=u)}}return t}function K(e,t,o){var n="string"==typeof o?function(e){for(var t=[],o=0,n=0,r=0;r<e.length;r++)switch(e[r]){case"(":n++;break;case")":n&&n--;break;case"\t":case" ":n||(r>o&&t.push(e.substring(o,r)),o=r+1)}return o<e.length&&t.push(e.substring(o)),t}(o):[o];0===n.length&&n.push(o),"!important"===n[n.length-1]&&(n=n.slice(0,-1).map((function(e){return e+" !important"}))),e[t+"Top"]=n[0],e[t+"Right"]=n[1]||n[0],e[t+"Bottom"]=n[2]||n[0],e[t+"Left"]=n[3]||n[1]||n[0]}function U(e,t){for(var o=[e.rtl?"rtl":"ltr"],n=!1,r=0,i=t.__order;r<i.length;r++){var a=i[r];o.push(a);var s=t[a];for(var l in s)s.hasOwnProperty(l)&&void 0!==s[l]&&(n=!0,o.push(l,s[l]))}return n?o.join(""):void 0}function G(e,t){return t<=0?"":1===t?e:e+G(e,t-1)}function j(e,t){if(!t)return"";var o,n,r,i=[];for(var a in t)t.hasOwnProperty(a)&&"displayName"!==a&&void 0!==t[a]&&i.push(a,t[a]);for(var s=0;s<i.length;s+=2)r=void 0,"-"!==(r=(o=i)[n=s]).charAt(0)&&(o[n]=D[r]=D[r]||r.replace(/([A-Z])/g,"-$1").toLowerCase()),R(i,s),L(e,i,s),E(i,s);for(s=1;s<i.length;s+=4)i.splice(s,1,":",i[s],";");return i.join("")}function q(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var n=V(t),r=U(e,n);if(r){var i=C.getInstance(),a={className:i.classNameFromKey(r),key:r,args:t};if(!a.className){a.className=i.getClassName(H(n));for(var s=[],l=0,c=n.__order;l<c.length;l++){var u=c[l];s.push(u,j(e,n[u]))}a.rulesToInsert=s}return a}}function Y(e,t){void 0===t&&(t=1);var o=C.getInstance(),n=e.className,r=e.key,i=e.args,a=e.rulesToInsert;if(a){for(var s=0;s<a.length;s+=2){var l=a[s+1];if(l){var c=a[s],u=(c=c.replace(/&/g,G("."+e.className,t)))+"{"+l+"}"+(0===c.indexOf("@")?"}":"");o.insertRule(u)}}o.cacheClassName(n,r,i,a)}}function Z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return X(e,w())}function X(e,t){var o=S(e instanceof Array?e:[e]),n=o.classes,r=o.objects;return r.length&&n.push(function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var n=q.apply(void 0,m([e],t));return n?(Y(n,e.specificityMultiplier),n.className):""}(t||{},r)),n.join(" ")}function Q(e){var t={},o=function(o){var n;e.hasOwnProperty(o)&&Object.defineProperty(t,o,{get:function(){return void 0===n&&(n=Z(e[o]).toString()),n},enumerable:!0,configurable:!0})};for(var n in e)o(n);return t}function J(e){var t=C.getInstance(),o=t.getClassName(),n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(r,"{",j(w(),e[r]),"}");var i=n.join("");return t.insertRule("@keyframes "+o+"{"+i+"}",!0),t.cacheClassName(o,i,[],["keyframes",i]),o}var $="cubic-bezier(.1,.9,.2,1)",ee="cubic-bezier(.1,.25,.75,.9)",te="0.167s",oe="0.267s",ne="0.367s",re="0.467s",ie=J({from:{opacity:0},to:{opacity:1}}),ae=J({from:{opacity:1},to:{opacity:0,visibility:"hidden"}}),se=ze(-10),le=ze(-20),ce=ze(-40),ue=ze(-400),de=ze(10),pe=ze(20),he=ze(40),me=ze(400),ge=We(10),fe=We(20),ve=We(-10),be=We(-20),ye=Ve(10),_e=Ve(20),Ce=Ve(40),Se=Ve(400),xe=Ve(-10),ke=Ve(-20),we=Ve(-40),Ie=Ve(-400),De=Ke(-10),Te=Ke(-20),Ee=Ke(10),Pe=Ke(20),Me=J({from:{transform:"scale3d(.98,.98,1)"},to:{transform:"scale3d(1,1,1)"}}),Re=J({from:{transform:"scale3d(1,1,1)"},to:{transform:"scale3d(.98,.98,1)"}}),Ne=J({from:{transform:"scale3d(1.03,1.03,1)"},to:{transform:"scale3d(1,1,1)"}}),Be=J({from:{transform:"scale3d(1,1,1)"},to:{transform:"scale3d(1.03,1.03,1)"}}),Fe=J({from:{transform:"rotateZ(0deg)"},to:{transform:"rotateZ(90deg)"}}),Ae=J({from:{transform:"rotateZ(0deg)"},to:{transform:"rotateZ(-90deg)"}}),Le={easeFunction1:$,easeFunction2:ee,durationValue1:te,durationValue2:oe,durationValue3:ne,durationValue4:re},He={slideRightIn10:Oe(ie+","+se,ne,$),slideRightIn20:Oe(ie+","+le,ne,$),slideRightIn40:Oe(ie+","+ce,ne,$),slideRightIn400:Oe(ie+","+ue,ne,$),slideLeftIn10:Oe(ie+","+de,ne,$),slideLeftIn20:Oe(ie+","+pe,ne,$),slideLeftIn40:Oe(ie+","+he,ne,$),slideLeftIn400:Oe(ie+","+me,ne,$),slideUpIn10:Oe(ie+","+ge,ne,$),slideUpIn20:Oe(ie+","+fe,ne,$),slideDownIn10:Oe(ie+","+ve,ne,$),slideDownIn20:Oe(ie+","+be,ne,$),slideRightOut10:Oe(ae+","+ye,ne,$),slideRightOut20:Oe(ae+","+_e,ne,$),slideRightOut40:Oe(ae+","+Ce,ne,$),slideRightOut400:Oe(ae+","+Se,ne,$),slideLeftOut10:Oe(ae+","+xe,ne,$),slideLeftOut20:Oe(ae+","+ke,ne,$),slideLeftOut40:Oe(ae+","+we,ne,$),slideLeftOut400:Oe(ae+","+Ie,ne,$),slideUpOut10:Oe(ae+","+De,ne,$),slideUpOut20:Oe(ae+","+Te,ne,$),slideDownOut10:Oe(ae+","+Ee,ne,$),slideDownOut20:Oe(ae+","+Pe,ne,$),scaleUpIn100:Oe(ie+","+Me,ne,$),scaleDownIn100:Oe(ie+","+Ne,ne,$),scaleUpOut103:Oe(ae+","+Be,te,ee),scaleDownOut98:Oe(ae+","+Re,te,ee),fadeIn100:Oe(ie,te,ee),fadeIn200:Oe(ie,oe,ee),fadeIn400:Oe(ie,ne,ee),fadeIn500:Oe(ie,re,ee),fadeOut100:Oe(ae,te,ee),fadeOut200:Oe(ae,oe,ee),fadeOut400:Oe(ae,ne,ee),fadeOut500:Oe(ae,re,ee),rotate90deg:Oe(Fe,"0.1s",ee),rotateN90deg:Oe(Ae,"0.1s",ee)};function Oe(e,t,o){return{animationName:e,animationDuration:t,animationTimingFunction:o,animationFillMode:"both"}}function ze(e){return J({from:{transform:"translate3d("+e+"px,0,0)",pointerEvents:"none"},to:{transform:"translate3d(0,0,0)",pointerEvents:"auto"}})}function We(e){return J({from:{transform:"translate3d(0,"+e+"px,0)",pointerEvents:"none"},to:{transform:"translate3d(0,0,0)",pointerEvents:"auto"}})}function Ve(e){return J({from:{transform:"translate3d(0,0,0)"},to:{transform:"translate3d("+e+"px,0,0)"}})}function Ke(e){return J({from:{transform:"translate3d(0,0,0)"},to:{transform:"translate3d(0,"+e+"px,0)"}})}var Ue,Ge,je,qe,Ye,Ze=Q(He);function Xe(e){C.getInstance().insertRule("@font-face{"+j(w(),e)+"}",!0)}!function(e){e.Arabic="Segoe UI Web (Arabic)",e.Cyrillic="Segoe UI Web (Cyrillic)",e.EastEuropean="Segoe UI Web (East European)",e.Greek="Segoe UI Web (Greek)",e.Hebrew="Segoe UI Web (Hebrew)",e.Thai="Leelawadee UI Web",e.Vietnamese="Segoe UI Web (Vietnamese)",e.WestEuropean="Segoe UI Web (West European)",e.Selawik="Selawik Web",e.Armenian="Segoe UI Web (Armenian)",e.Georgian="Segoe UI Web (Georgian)"}(Ue||(Ue={})),function(e){e.Arabic="'"+Ue.Arabic+"'",e.ChineseSimplified="'Microsoft Yahei UI', Verdana, Simsun",e.ChineseTraditional="'Microsoft Jhenghei UI', Pmingliu",e.Cyrillic="'"+Ue.Cyrillic+"'",e.EastEuropean="'"+Ue.EastEuropean+"'",e.Greek="'"+Ue.Greek+"'",e.Hebrew="'"+Ue.Hebrew+"'",e.Hindi="'Nirmala UI'",e.Japanese="'Yu Gothic UI', 'Meiryo UI', Meiryo, 'MS Pgothic', Osaka",e.Korean="'Malgun Gothic', Gulim",e.Selawik="'"+Ue.Selawik+"'",e.Thai="'Leelawadee UI Web', 'Kmer UI'",e.Vietnamese="'"+Ue.Vietnamese+"'",e.WestEuropean="'"+Ue.WestEuropean+"'",e.Armenian="'"+Ue.Armenian+"'",e.Georgian="'"+Ue.Georgian+"'"}(Ge||(Ge={})),function(e){e.size10="10px",e.size12="12px",e.size14="14px",e.size16="16px",e.size18="18px",e.size20="20px",e.size24="24px",e.size28="28px",e.size32="32px",e.size42="42px",e.size68="68px",e.mini="10px",e.xSmall="10px",e.small="12px",e.smallPlus="12px",e.medium="14px",e.mediumPlus="16px",e.icon="16px",e.large="18px",e.xLarge="20px",e.xLargePlus="24px",e.xxLarge="28px",e.xxLargePlus="32px",e.superLarge="42px",e.mega="68px"}(je||(je={})),function(e){e.light=100,e.semilight=300,e.regular=400,e.semibold=600,e.bold=700}(qe||(qe={})),function(e){e.xSmall="10px",e.small="12px",e.medium="16px",e.large="20px"}(Ye||(Ye={}));var Qe="'Segoe UI', '"+Ue.WestEuropean+"'",Je={ar:Ge.Arabic,bg:Ge.Cyrillic,cs:Ge.EastEuropean,el:Ge.Greek,et:Ge.EastEuropean,he:Ge.Hebrew,hi:Ge.Hindi,hr:Ge.EastEuropean,hu:Ge.EastEuropean,ja:Ge.Japanese,kk:Ge.EastEuropean,ko:Ge.Korean,lt:Ge.EastEuropean,lv:Ge.EastEuropean,pl:Ge.EastEuropean,ru:Ge.Cyrillic,sk:Ge.EastEuropean,"sr-latn":Ge.EastEuropean,th:Ge.Thai,tr:Ge.EastEuropean,uk:Ge.Cyrillic,vi:Ge.Vietnamese,"zh-hans":Ge.ChineseSimplified,"zh-hant":Ge.ChineseTraditional,hy:Ge.Armenian,ka:Ge.Georgian};function $e(e,t,o){return{fontFamily:o,MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontSize:e,fontWeight:t}}function et(e){var t=function(e){for(var t in Je)if(Je.hasOwnProperty(t)&&e&&0===t.indexOf(e))return Je[t];return Qe}(e)+", 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif";return{tiny:$e(je.mini,qe.regular,t),xSmall:$e(je.xSmall,qe.regular,t),small:$e(je.small,qe.regular,t),smallPlus:$e(je.smallPlus,qe.regular,t),medium:$e(je.medium,qe.regular,t),mediumPlus:$e(je.mediumPlus,qe.regular,t),large:$e(je.large,qe.regular,t),xLarge:$e(je.xLarge,qe.semibold,t),xLargePlus:$e(je.xLargePlus,qe.semibold,t),xxLarge:$e(je.xxLarge,qe.semibold,t),xxLargePlus:$e(je.xxLargePlus,qe.semibold,t),superLarge:$e(je.superLarge,qe.semibold,t),mega:$e(je.mega,qe.semibold,t)}}var tt=!1;function ot(e){tt=e}function nt(e){if(!tt&&"undefined"!=typeof document){var t=e;return t&&t.ownerDocument?t.ownerDocument:document}}var rt,it=void 0;try{it=window}catch(e){}function at(e){if(!tt&&void 0!==it){var t=e;return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:it}}function st(e){var t=null;try{var o=at();t=o?o.sessionStorage.getItem(e):null}catch(e){}return t}function lt(e,t){var o;try{null===(o=at())||void 0===o||o.sessionStorage.setItem(e,t)}catch(e){}}var ct="language";function ut(e){if(void 0===e&&(e="sessionStorage"),void 0===rt){var t=nt(),o="localStorage"===e?function(e){var t=null;try{var o=at();t=o?o.localStorage.getItem("language"):null}catch(e){}return t}():"sessionStorage"===e?st(ct):void 0;o&&(rt=o),void 0===rt&&t&&(rt=t.documentElement.getAttribute("lang")),void 0===rt&&(rt="en")}return rt}function dt(e,t){var o=nt();o&&o.documentElement.setAttribute("lang",e);var n=!0===t?"none":t||"sessionStorage";"localStorage"===n?function(e,t){try{var o=at();o&&o.localStorage.setItem("language",t)}catch(e){}}(0,e):"sessionStorage"===n&&lt(ct,e),rt=e}var pt=et(ut());function ht(e,t,o,n){Xe({fontFamily:e="'"+e+"'",src:(void 0!==n?"local('"+n+"'),":"")+"url('"+t+".woff2') format('woff2'),url('"+t+".woff') format('woff')",fontWeight:o,fontStyle:"normal",fontDisplay:"swap"})}function mt(e,t,o,n,r){void 0===n&&(n="segoeui");var i=e+"/"+o+"/"+n;ht(t,i+"-light",qe.light,r&&r+" Light"),ht(t,i+"-semilight",qe.semilight,r&&r+" SemiLight"),ht(t,i+"-regular",qe.regular,r),ht(t,i+"-semibold",qe.semibold,r&&r+" SemiBold"),ht(t,i+"-bold",qe.bold,r&&r+" Bold")}function gt(e){if(e){var t=e+"/fonts";mt(t,Ue.Thai,"leelawadeeui-thai","leelawadeeui"),mt(t,Ue.Arabic,"segoeui-arabic"),mt(t,Ue.Cyrillic,"segoeui-cyrillic"),mt(t,Ue.EastEuropean,"segoeui-easteuropean"),mt(t,Ue.Greek,"segoeui-greek"),mt(t,Ue.Hebrew,"segoeui-hebrew"),mt(t,Ue.Vietnamese,"segoeui-vietnamese"),mt(t,Ue.WestEuropean,"segoeui-westeuropean","segoeui","Segoe UI"),mt(t,Ge.Selawik,"selawik","selawik"),mt(t,Ue.Armenian,"segoeui-armenian"),mt(t,Ue.Georgian,"segoeui-georgian"),ht("Leelawadee UI Web",t+"/leelawadeeui-thai/leelawadeeui-semilight",qe.light),ht("Leelawadee UI Web",t+"/leelawadeeui-thai/leelawadeeui-bold",qe.semibold)}}gt(function(){var e,t,o=null===(e=at())||void 0===e?void 0:e.FabricConfig;return null!==(t=null==o?void 0:o.fontBaseUrl)&&void 0!==t?t:"https://static2.sharepointonline.com/files/fabric/assets"}());var ft=Q(pt),vt={themeDarker:"#004578",themeDark:"#005a9e",themeDarkAlt:"#106ebe",themePrimary:"#0078d4",themeSecondary:"#2b88d8",themeTertiary:"#71afe5",themeLight:"#c7e0f4",themeLighter:"#deecf9",themeLighterAlt:"#eff6fc",black:"#000000",blackTranslucent40:"rgba(0,0,0,.4)",neutralDark:"#201f1e",neutralPrimary:"#323130",neutralPrimaryAlt:"#3b3a39",neutralSecondary:"#605e5c",neutralSecondaryAlt:"#8a8886",neutralTertiary:"#a19f9d",neutralTertiaryAlt:"#c8c6c4",neutralQuaternary:"#d2d0ce",neutralQuaternaryAlt:"#e1dfdd",neutralLight:"#edebe9",neutralLighter:"#f3f2f1",neutralLighterAlt:"#faf9f8",accent:"#0078d4",white:"#ffffff",whiteTranslucent40:"rgba(255,255,255,.4)",yellowDark:"#d29200",yellow:"#ffb900",yellowLight:"#fff100",orange:"#d83b01",orangeLight:"#ea4300",orangeLighter:"#ff8c00",redDark:"#a4262c",red:"#e81123",magentaDark:"#5c005c",magenta:"#b4009e",magentaLight:"#e3008c",purpleDark:"#32145a",purple:"#5c2d91",purpleLight:"#b4a0ff",blueDark:"#002050",blueMid:"#00188f",blue:"#0078d4",blueLight:"#00bcf2",tealDark:"#004b50",teal:"#008272",tealLight:"#00b294",greenDark:"#004b1c",green:"#107c10",greenLight:"#bad80a"},bt=0,yt=function(){function e(){}return e.getValue=function(e,t){var o=_t();return void 0===o[e]&&(o[e]="function"==typeof t?t():t),o[e]},e.setValue=function(e,t){var o=_t(),n=o.__callbacks__,r=o[e];if(t!==r){o[e]=t;var i={oldValue:r,value:t,key:e};for(var a in n)n.hasOwnProperty(a)&&n[a](i)}return t},e.addChangeListener=function(e){var t=e.__id__,o=Ct();t||(t=e.__id__=String(bt++)),o[t]=e},e.removeChangeListener=function(e){delete Ct()[e.__id__]},e}();function _t(){var e,t=at()||{};return t.__globalSettings__||(t.__globalSettings__=((e={}).__callbacks__={},e)),t.__globalSettings__}function Ct(){return _t().__callbacks__}var St,xt,kt={settings:{},scopedSettings:{},inCustomizerContext:!1},wt=yt.getValue("customizations",{settings:{},scopedSettings:{},inCustomizerContext:!1}),It=[],Dt=function(){function e(){}return e.reset=function(){wt.settings={},wt.scopedSettings={}},e.applySettings=function(t){wt.settings=d(d({},wt.settings),t),e._raiseChange()},e.applyScopedSettings=function(t,o){wt.scopedSettings[t]=d(d({},wt.scopedSettings[t]),o),e._raiseChange()},e.getSettings=function(e,t,o){void 0===o&&(o=kt);for(var n={},r=t&&o.scopedSettings[t]||{},i=t&&wt.scopedSettings[t]||{},a=0,s=e;a<s.length;a++){var l=s[a];n[l]=r[l]||o.settings[l]||i[l]||wt.settings[l]}return n},e.applyBatchedUpdates=function(t,o){e._suppressUpdates=!0;try{t()}catch(e){}e._suppressUpdates=!1,o||e._raiseChange()},e.observe=function(e){It.push(e)},e.unobserve=function(e){It=It.filter((function(t){return t!==e}))},e._raiseChange=function(){e._suppressUpdates||It.forEach((function(e){return e()}))},e}(),Tt=function(){return(Tt=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Et="undefined"==typeof window?e.g:window,Pt=Et&&Et.CSPSettings&&Et.CSPSettings.nonce,Mt=((xt=Et.__themeState__||{theme:void 0,lastStyleElement:void 0,registeredStyles:[]}).runState||(xt=Tt({},xt,{perf:{count:0,duration:0},runState:{flushTimer:0,mode:0,buffer:[]}})),xt.registeredThemableStyles||(xt=Tt({},xt,{registeredThemableStyles:[]})),Et.__themeState__=xt,xt),Rt=/[\'\"]\[theme:\s*(\w+)\s*(?:\,\s*default:\s*([\\"\']?[\.\,\(\)\#\-\s\w]*[\.\,\(\)\#\-\w][\"\']?))?\s*\][\'\"]/g,Nt=function(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()};function Bt(e){var t=Nt();e();var o=Nt();Mt.perf.duration+=o-t}function Ft(e,t){void 0===t&&(t=!1),Bt((function(){var o=Array.isArray(e)?e:function(e){var t=[];if(e){for(var o=0,n=void 0;n=Rt.exec(e);){var r=n.index;r>o&&t.push({rawString:e.substring(o,r)}),t.push({theme:n[1],defaultValue:n[2]}),o=Rt.lastIndex}t.push({rawString:e.substring(o)})}return t}(e),n=Mt.runState,r=n.mode,i=n.buffer,a=n.flushTimer;t||1===r?(i.push(o),a||(Mt.runState.flushTimer=setTimeout((function(){Mt.runState.flushTimer=0,Bt((function(){var e=Mt.runState.buffer.slice();Mt.runState.buffer=[];var t=[].concat.apply([],e);t.length>0&&At(t)}))}),0))):At(o)}))}function At(e,t){Mt.loadStyles?Mt.loadStyles(Ht(e).styleString,e):function(e){if("undefined"!=typeof document){var t=document.getElementsByTagName("head")[0],o=document.createElement("style"),n=Ht(e),r=n.styleString,i=n.themable;o.setAttribute("data-load-themed-styles","true"),o.type="text/css",Pt&&o.setAttribute("nonce",Pt),o.appendChild(document.createTextNode(r)),Mt.perf.count++,t.appendChild(o);var a=document.createEvent("HTMLEvents");a.initEvent("styleinsert",!0,!1),a.args={newStyle:o},document.dispatchEvent(a);var s={styleElement:o,themableStyle:e};i?Mt.registeredThemableStyles.push(s):Mt.registeredStyles.push(s)}}(e)}function Lt(e){e.forEach((function(e){var t=e&&e.styleElement;t&&t.parentElement&&t.parentElement.removeChild(t)}))}function Ht(e){var t=Mt.theme,o=!1;return{styleString:(e||[]).map((function(e){var n=e.theme;if(n){o=!0;var r=t?t[n]:void 0,i=e.defaultValue||"inherit";return t&&!r&&console&&!(n in t)&&"undefined"!=typeof DEBUG&&DEBUG&&console.warn('Theming value not provided for "'+n+'". Falling back to "'+i+'".'),r||i}return e.rawString})).join(""),themable:o}}!function(e){e.depth0="0 0 0 0 transparent",e.depth4="0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108)",e.depth8="0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108)",e.depth16="0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108)",e.depth64="0 25.6px 57.6px 0 rgba(0, 0, 0, 0.22), 0 4.8px 14.4px 0 rgba(0, 0, 0, 0.18)"}(St||(St={}));var Ot={elevation4:St.depth4,elevation8:St.depth8,elevation16:St.depth16,elevation64:St.depth64,roundedCorner2:"2px",roundedCorner4:"4px",roundedCorner6:"6px"};function zt(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];for(var n=0,r=t;n<r.length;n++){var i=r[n];Wt(e||{},i)}return e}function Wt(e,t,o){for(var n in void 0===o&&(o=[]),o.push(t),t)if(t.hasOwnProperty(n)&&"__proto__"!==n&&"constructor"!==n&&"prototype"!==n){var r=t[n];if("object"!=typeof r||null===r||Array.isArray(r))e[n]=r;else{var i=o.indexOf(r)>-1;e[n]=i?r:Wt(e[n]||{},r,o)}}return o.pop(),e}function Vt(e,t,o,n,r){return void 0===r&&(r=!1),function(e,t){var o="";return!0===t&&(o=" /* @deprecated */"),e.listTextColor=e.listText+o,e.menuItemBackgroundChecked+=o,e.warningHighlight+=o,e.warningText=e.messageText+o,e.successText+=o,e}(Kt(e,t,d({primaryButtonBorder:"transparent",errorText:n?"#F1707B":"#a4262c",messageText:n?"#F3F2F1":"#323130",messageLink:n?"#6CB8F6":"#005A9E",messageLinkHovered:n?"#82C7FF":"#004578",infoIcon:n?"#C8C6C4":"#605e5c",errorIcon:n?"#F1707B":"#A80000",blockingIcon:n?"#442726":"#FDE7E9",warningIcon:n?"#C8C6C4":"#797775",severeWarningIcon:n?"#FCE100":"#D83B01",successIcon:n?"#92C353":"#107C10",infoBackground:n?"#323130":"#f3f2f1",errorBackground:n?"#442726":"#FDE7E9",blockingBackground:n?"#442726":"#FDE7E9",warningBackground:n?"#433519":"#FFF4CE",severeWarningBackground:n?"#4F2A0F":"#FED9CC",successBackground:n?"#393D1B":"#DFF6DD",warningHighlight:n?"#fff100":"#ffb900",successText:n?"#92c353":"#107C10"},o),n),r)}function Kt(e,t,o,n,r){void 0===r&&(r=!1);var i={},a=e||{},s=a.white,l=a.black,c=a.themePrimary,u=a.themeDark,p=a.themeDarker,h=a.themeDarkAlt,m=a.themeLighter,g=a.neutralLight,f=a.neutralLighter,v=a.neutralDark,b=a.neutralQuaternary,y=a.neutralQuaternaryAlt,_=a.neutralPrimary,C=a.neutralSecondary,S=a.neutralSecondaryAlt,x=a.neutralTertiary,k=a.neutralTertiaryAlt,w=a.neutralLighterAlt,I=a.accent;return s&&(i.bodyBackground=s,i.bodyFrameBackground=s,i.accentButtonText=s,i.buttonBackground=s,i.primaryButtonText=s,i.primaryButtonTextHovered=s,i.primaryButtonTextPressed=s,i.inputBackground=s,i.inputForegroundChecked=s,i.listBackground=s,i.menuBackground=s,i.cardStandoutBackground=s),l&&(i.bodyTextChecked=l,i.buttonTextCheckedHovered=l),c&&(i.link=c,i.primaryButtonBackground=c,i.inputBackgroundChecked=c,i.inputIcon=c,i.inputFocusBorderAlt=c,i.menuIcon=c,i.menuHeader=c,i.accentButtonBackground=c),u&&(i.primaryButtonBackgroundPressed=u,i.inputBackgroundCheckedHovered=u,i.inputIconHovered=u),p&&(i.linkHovered=p),h&&(i.primaryButtonBackgroundHovered=h),m&&(i.inputPlaceholderBackgroundChecked=m),g&&(i.bodyBackgroundChecked=g,i.bodyFrameDivider=g,i.bodyDivider=g,i.variantBorder=g,i.buttonBackgroundCheckedHovered=g,i.buttonBackgroundPressed=g,i.listItemBackgroundChecked=g,i.listHeaderBackgroundPressed=g,i.menuItemBackgroundPressed=g,i.menuItemBackgroundChecked=g),f&&(i.bodyBackgroundHovered=f,i.buttonBackgroundHovered=f,i.buttonBackgroundDisabled=f,i.buttonBorderDisabled=f,i.primaryButtonBackgroundDisabled=f,i.disabledBackground=f,i.listItemBackgroundHovered=f,i.listHeaderBackgroundHovered=f,i.menuItemBackgroundHovered=f),b&&(i.primaryButtonTextDisabled=b,i.disabledSubtext=b),y&&(i.listItemBackgroundCheckedHovered=y),x&&(i.disabledBodyText=x,i.variantBorderHovered=(null==o?void 0:o.variantBorderHovered)||x,i.buttonTextDisabled=x,i.inputIconDisabled=x,i.disabledText=x),_&&(i.bodyText=_,i.actionLink=_,i.buttonText=_,i.inputBorderHovered=_,i.inputText=_,i.listText=_,i.menuItemText=_),w&&(i.bodyStandoutBackground=w,i.defaultStateBackground=w),v&&(i.actionLinkHovered=v,i.buttonTextHovered=v,i.buttonTextChecked=v,i.buttonTextPressed=v,i.inputTextHovered=v,i.menuItemTextHovered=v),C&&(i.bodySubtext=C,i.focusBorder=C,i.inputBorder=C,i.smallInputBorder=C,i.inputPlaceholderText=C),S&&(i.buttonBorder=S),k&&(i.disabledBodySubtext=k,i.disabledBorder=k,i.buttonBackgroundChecked=k,i.menuDivider=k),I&&(i.accentButtonBackground=I),(null==t?void 0:t.elevation4)&&(i.cardShadow=t.elevation4),!n&&(null==t?void 0:t.elevation8)?i.cardShadowHovered=t.elevation8:i.variantBorderHovered&&(i.cardShadowHovered="0 0 1px "+i.variantBorderHovered),d(d({},i),o)}function Ut(e,t){var o,n,r;void 0===t&&(t={});var i=zt({},e,t,{semanticColors:Kt(t.palette,t.effects,t.semanticColors,void 0===t.isInverted?e.isInverted:t.isInverted)});if((null===(o=t.palette)||void 0===o?void 0:o.themePrimary)&&!(null===(n=t.palette)||void 0===n?void 0:n.accent)&&(i.palette.accent=t.palette.themePrimary),t.defaultFontStyle)for(var a=0,s=Object.keys(i.fonts);a<s.length;a++){var l=s[a];i.fonts[l]=zt(i.fonts[l],t.defaultFontStyle,null===(r=null==t?void 0:t.fonts)||void 0===r?void 0:r[l])}return i}var Gt={s2:"4px",s1:"8px",m:"16px",l1:"20px",l2:"32px"};function jt(e,t){void 0===e&&(e={}),void 0===t&&(t=!1);var o=!!e.isInverted;return Ut({palette:vt,effects:Ot,fonts:pt,spacing:Gt,isInverted:o,disableGlobalClassNames:!1,semanticColors:Vt(vt,Ot,void 0,o,t),rtl:void 0},e)}var qt=jt({}),Yt=[],Zt="theme";function Xt(){var e,t;if(!Dt.getSettings([Zt]).theme){var o=at();(null===(t=null==o?void 0:o.FabricConfig)||void 0===t?void 0:t.theme)&&(qt=jt(o.FabricConfig.theme)),Dt.applySettings(((e={})[Zt]=qt,e))}}function Qt(e){return void 0===e&&(e=!1),!0===e&&(qt=jt({},e)),qt}function Jt(e){-1===Yt.indexOf(e)&&Yt.push(e)}function $t(e){var t=Yt.indexOf(e);-1!==t&&Yt.splice(t,1)}function eo(e,t){var o;return void 0===t&&(t=!1),qt=jt(e,t),function(e){Mt.theme=e,function(){if(Mt.theme){for(var e=[],t=0,o=Mt.registeredThemableStyles;t<o.length;t++){var n=o[t];e.push(n.themableStyle)}e.length>0&&(void 0===(r=1)&&(r=3),3!==r&&2!==r||(Lt(Mt.registeredStyles),Mt.registeredStyles=[]),3!==r&&1!==r||(Lt(Mt.registeredThemableStyles),Mt.registeredThemableStyles=[]),At([].concat.apply([],e)))}var r}()}(d(d(d(d({},qt.palette),qt.semanticColors),qt.effects),function(e){for(var t={},o=0,n=Object.keys(e.fonts);o<n.length;o++)for(var r=n[o],i=e.fonts[r],a=0,s=Object.keys(i);a<s.length;a++){var l=s[a],c=r+l.charAt(0).toUpperCase()+l.slice(1),u=i[l];"fontSize"===l&&"number"==typeof u&&(u+="px"),t[c]=u}return t}(qt))),Dt.applySettings(((o={})[Zt]=qt,o)),Yt.forEach((function(e){try{e(qt)}catch(e){}})),qt}Xt();var to={};for(var oo in vt)vt.hasOwnProperty(oo)&&(no(to,oo,"",!1,"color"),no(to,oo,"Hover",!0,"color"),no(to,oo,"Background",!1,"background"),no(to,oo,"BackgroundHover",!0,"background"),no(to,oo,"Border",!1,"borderColor"),no(to,oo,"BorderHover",!0,"borderColor"));function no(e,t,o,n,r){Object.defineProperty(e,t+o,{get:function(){var e,o=((e={})[r]=Qt().palette[t],e);return Z(n?{selectors:{":hover":o}}:o).toString()},enumerable:!0,configurable:!0})}var ro="@media screen and (-ms-high-contrast: active), (forced-colors: active)",io="@media screen and (-ms-high-contrast: black-on-white), (forced-colors: black-on-white)",ao="@media screen and (-ms-high-contrast: white-on-black), (forced-colors: white-on-black)",so="@media screen and (forced-colors: active)",lo=320,co=480,uo=640,po=1024,ho=1366,mo=1920,go=co-1,fo=uo-1,vo=po-1,bo=ho-1,yo=mo-1,_o=768;function Co(e,t){return"@media only screen"+("number"==typeof e?" and (min-width: "+e+"px)":"")+("number"==typeof t?" and (max-width: "+t+"px)":"")}function So(){return{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}}function xo(){var e;return(e={})[so]={forcedColorAdjust:"none"},e}var ko,wo="ms-Fabric--isFocusVisible",Io="ms-Fabric--isFocusHidden";function Do(e,t){var o=t?at(t):at();if(o){var n=o.document.body.classList;n.add(e?wo:Io),n.remove(e?Io:wo)}}function To(e,t,o,n,r,i,a){return function(e,t){var o,n;void 0===t&&(t={});var r=t.inset,i=void 0===r?0:r,a=t.width,s=void 0===a?1:a,l=t.position,c=void 0===l?"relative":l,u=t.highContrastStyle,d=t.borderColor,p=void 0===d?e.palette.white:d,h=t.outlineColor,m=void 0===h?e.palette.neutralSecondary:h,g=t.isFocusedOnly;return{outline:"transparent",position:c,selectors:(o={"::-moz-focus-inner":{border:"0"}},o["."+wo+" &"+(void 0===g||g?":focus":"")+":after"]={content:'""',position:"absolute",left:i+1,top:i+1,bottom:i+1,right:i+1,border:s+"px solid "+p,outline:s+"px solid "+m,zIndex:ko.FocusStyle,selectors:(n={},n[ro]=u,n)},o)}}(e,"number"!=typeof t&&t?t:{inset:t,position:o,highContrastStyle:n,borderColor:r,outlineColor:i,isFocusedOnly:a})}function Eo(){return{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}}}function Po(e,t,o,n){var r;return void 0===t&&(t=0),void 0===o&&(o=1),{selectors:(r={},r[":global("+wo+") &:focus"]={outline:o+" solid "+(n||e.palette.neutralSecondary),outlineOffset:-t+"px"},r)}}!function(e){e.Nav=1,e.ScrollablePane=1,e.FocusStyle=1,e.Coachmark=1e3,e.Layer=1e6,e.KeytipLayer=1000001}(ko||(ko={}));var Mo=function(e,t,o,n){var r,i,a;void 0===o&&(o="border"),void 0===n&&(n=-1);var s="borderBottom"===o;return{borderColor:e,selectors:{":after":(r={pointerEvents:"none",content:"''",position:"absolute",left:s?0:n,top:n,bottom:n,right:s?0:n},r[o]="2px solid "+e,r.borderRadius=t,r.width="borderBottom"===o?"100%":void 0,r.selectors=(i={},i[ro]=(a={},a["border"===o?"borderColor":"borderBottomColor"]="Highlight",a),i),r)}}},Ro={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden",whiteSpace:"nowrap"};function No(e,t){return{borderColor:e,borderWidth:"0px",width:t,height:t}}function Bo(e){return{opacity:1,borderWidth:e}}function Fo(e,t){return{borderWidth:"0",width:t,height:t,opacity:0,borderColor:e}}function Ao(e,t){return d(d({},No(e,t)),{opacity:0})}var Lo={continuousPulseAnimationDouble:function(e,t,o,n,r){return J({"0%":No(e,o),"1.42%":Bo(r),"3.57%":{opacity:1},"7.14%":Fo(t,n),"8%":Ao(e,o),"29.99%":Ao(e,o),"30%":No(e,o),"31.42%":Bo(r),"33.57%":{opacity:1},"37.14%":Fo(t,n),"38%":Ao(e,o),"79.42%":Ao(e,o),79.43:No(e,o),81.85:Bo(r),83.42:{opacity:1},"87%":Fo(t,n),"100%":{}})},continuousPulseAnimationSingle:function(e,t,o,n,r){return J({"0%":No(e,o),"14.2%":Bo(r),"35.7%":{opacity:1},"71.4%":Fo(t,n),"100%":{}})},createDefaultAnimation:function(e,t){return{animationName:e,animationIterationCount:"1",animationDuration:"14s",animationDelay:t||"2s"}}},Ho=!1,Oo=0,zo={empty:!0},Wo={},Vo="undefined"==typeof WeakMap?null:WeakMap;function Ko(e){Vo=e}function Uo(){Oo++}function Go(e,t,o){var n=jo(o.value&&o.value.bind(null));return{configurable:!0,get:function(){return n}}}function jo(e,t,o){if(void 0===t&&(t=100),void 0===o&&(o=!1),!Vo)return e;if(!Ho){var n=C.getInstance();n&&n.onReset&&C.getInstance().onReset(Uo),Ho=!0}var r,i=0,a=Oo;return function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];var l=r;(void 0===r||a!==Oo||t>0&&i>t)&&(r=Zo(),i=0,a=Oo),l=r;for(var c=0;c<n.length;c++){var u=Yo(n[c]);l.map.has(u)||l.map.set(u,Zo()),l=l.map.get(u)}return l.hasOwnProperty("value")||(l.value=e.apply(void 0,n),i++),!o||null!==l.value&&void 0!==l.value||(l.value=e.apply(void 0,n)),l.value}}function qo(e){if(!Vo)return e;var t=new Vo;return function(o){if(!o||"function"!=typeof o&&"object"!=typeof o)return e(o);if(t.has(o))return t.get(o);var n=e(o);return t.set(o,n),n}}function Yo(e){return e?"object"==typeof e||"function"==typeof e?e:(Wo[e]||(Wo[e]={val:e}),Wo[e]):zo}function Zo(){return{map:Vo?new Vo:null}}var Xo=jo((function(e,t){var o=C.getInstance();return t?Object.keys(e).reduce((function(t,n){return t[n]=o.getClassName(e[n]),t}),{}):e}));function Qo(e,t,o){return Xo(e,void 0!==o?o:t.disableGlobalClassNames)}function Jo(e,t){return void 0===e&&(e={}),(en(t)?t:function(e){return function(t){return e?d(d({},t),e):t}}(t))(e)}function $o(e,t){return void 0===e&&(e={}),(en(t)?t:(void 0===(o=t)&&(o={}),function(e){var t=d({},e);for(var n in o)o.hasOwnProperty(n)&&(t[n]=d(d({},e[n]),o[n]));return t}))(e);var o}function en(e){return"function"==typeof e}function tn(e,t,o){var n,r=e,i=o||Dt.getSettings(["theme"],void 0,e.customizations).theme;o&&(n={theme:o});var a=t&&i&&i.schemes&&i.schemes[t];return i&&a&&i!==a&&((n={theme:a}).theme.schemes=i.schemes),n&&(r={customizations:{settings:Jo(e.customizations.settings,n),scopedSettings:e.customizations.scopedSettings}}),r}var on={boxShadow:"none",margin:0,padding:0,boxSizing:"border-box"},nn={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function rn(e,t,o,n,r){void 0===t&&(t="bodyBackground"),void 0===o&&(o="horizontal"),void 0===n&&(n=an("width",o)),void 0===r&&(r=an("height",o));var i=e.semanticColors[t]||e.palette[t],a=function(e){if("#"===e[0])return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16)};if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2]}}return{r:255,g:255,b:255}}(i);return{content:'""',position:"absolute",right:0,bottom:0,width:n,height:r,pointerEvents:"none",backgroundImage:"linear-gradient("+("vertical"===o?"to bottom":"to right")+", rgba("+a.r+", "+a.g+", "+a.b+", 0) 0%, "+i+" 100%)"}}function an(e,t){return"width"===e?"horizontal"===t?20:"100%":"vertical"===t?"50%":"100%"}function sn(e){return{selectors:{"::placeholder":e,":-ms-input-placeholder":e,"::-ms-input-placeholder":e}}}var ln=void 0;function cn(e){ln?ln(e):console&&console.warn&&console.warn(e)}function un(e){ln=e}var dn=yt.getValue("icons",{__options:{disableWarnings:!1,warnOnMissingIcons:!0},__remapped:{}}),pn=C.getInstance();pn&&pn.onReset&&pn.onReset((function(){for(var e in dn)dn.hasOwnProperty(e)&&dn[e].subset&&(dn[e].subset.className=void 0)}));var hn=function(e){return e.toLowerCase()};function mn(e,t){var o=d(d({},e),{isRegistered:!1,className:void 0}),n=e.icons;for(var r in t=t?d(d({},dn.__options),t):dn.__options,n)if(n.hasOwnProperty(r)){var i=n[r],a=hn(r);dn[a]?Cn(r):dn[a]={code:i,subset:o}}}function gn(e){for(var t=dn.__options,o=function(e){var o=hn(e);dn[o]?delete dn[o]:t.disableWarnings||cn('The icon "'+e+'" tried to unregister but was not registered.'),dn.__remapped[o]&&delete dn.__remapped[o],Object.keys(dn.__remapped).forEach((function(e){dn.__remapped[e]===o&&delete dn.__remapped[e]}))},n=0,r=e;n<r.length;n++)o(r[n])}function fn(e,t){dn.__remapped[hn(e)]=hn(t)}function vn(e){var t=void 0,o=dn.__options;if(e=e?hn(e):"",e=dn.__remapped[e]||e)if(t=dn[e]){var n=t.subset;n&&n.fontFace&&(n.isRegistered||(Xe(n.fontFace),n.isRegistered=!0),n.className||(n.className=Z(n.style,{fontFamily:n.fontFace.fontFamily,fontWeight:n.fontFace.fontWeight||"normal",fontStyle:n.fontFace.fontStyle||"normal"})))}else!o.disableWarnings&&o.warnOnMissingIcons&&cn('The icon "'+e+'" was used but not registered. See https://github.com/microsoft/fluentui/wiki/Using-icons for more information.');return t}function bn(e){dn.__options=d(d({},dn.__options),e)}var yn=[],_n=void 0;function Cn(e){dn.__options.disableWarnings||(yn.push(e),void 0===_n&&(_n=setTimeout((function(){cn("Some icons were re-registered. Applications should only call registerIcons for any given icon once. Redefining what an icon is may have unintended consequences. Duplicates include: \n"+yn.slice(0,10).join(", ")+(yn.length>10?" (+ "+(yn.length-10)+" more)":"")),_n=void 0,yn=[]}),2e3)))}var Sn={display:"inline-block"};function xn(e){var t="",o=vn(e);return o&&(t=Z(o.subset.className,Sn,{selectors:{"::before":{content:'"'+o.code+'"'}}})),t}function kn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e&&1===e.length&&e[0]&&!e[0].subComponentStyles)return e[0];for(var o={},n={},r=0,i=e;r<i.length;r++){var a=i[r];if(a)for(var s in a)if(a.hasOwnProperty(s)){if("subComponentStyles"===s&&void 0!==a.subComponentStyles){var l=a.subComponentStyles;for(var c in l)l.hasOwnProperty(c)&&(n.hasOwnProperty(c)?n[c].push(l[c]):n[c]=[l[c]]);continue}var u=o[s],d=a[s];o[s]=void 0===u?d:m(Array.isArray(u)?u:[u],Array.isArray(d)?d:[d])}}if(Object.keys(n).length>0){o.subComponentStyles={};var p=o.subComponentStyles,h=function(e){if(n.hasOwnProperty(e)){var t=n[e];p[e]=function(e){return kn.apply(void 0,t.map((function(t){return"function"==typeof t?t(e):t})))}}};for(var c in n)h(c)}return o}function wn(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];for(var n=[],r=0,i=t;r<i.length;r++){var a=i[r];a&&n.push("function"==typeof a?a(e):a)}return 1===n.length?n[0]:n.length?kn.apply(void 0,n):{}}function In(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn(e,w())}function Dn(e,t){var o={subComponentStyles:{}};if(!e[0]&&e.length<=1)return{subComponentStyles:{}};var n=kn.apply(void 0,e),r=[];for(var i in n)if(n.hasOwnProperty(i)){if("subComponentStyles"===i){o.subComponentStyles=n.subComponentStyles||{};continue}var a=S(n[i]),s=a.classes,l=a.objects;(null==l?void 0:l.length)?(d=q(t||{},{displayName:i},l))&&(r.push(d),o[i]=s.concat([d.className]).join(" ")):o[i]=s.join(" ")}for(var c=0,u=r;c<u.length;c++){var d;(d=u[c])&&Y(d,null==t?void 0:t.specificityMultiplier)}return o}var Tn={},En=void 0;try{En=window}catch(e){}function Pn(e,t){if(void 0!==En){var o=En.__packages__=En.__packages__||{};o[e]&&Tn[e]||(Tn[e]=t,(o[e]=o[e]||[]).push(t))}}Pn("@fluentui/set-version","6.0.0"),Pn("@fluentui/style-utilities","8.3.1"),Xt();var Mn=jo((function(e,t,o,n){return{root:Z("ms-ActivityItem",t,e.root,n&&e.isCompactRoot),pulsingBeacon:Z("ms-ActivityItem-pulsingBeacon",e.pulsingBeacon),personaContainer:Z("ms-ActivityItem-personaContainer",e.personaContainer,n&&e.isCompactPersonaContainer),activityPersona:Z("ms-ActivityItem-activityPersona",e.activityPersona,n&&e.isCompactPersona,!n&&o&&2===o.length&&e.doublePersona),activityTypeIcon:Z("ms-ActivityItem-activityTypeIcon",e.activityTypeIcon,n&&e.isCompactIcon),activityContent:Z("ms-ActivityItem-activityContent",e.activityContent,n&&e.isCompactContent),activityText:Z("ms-ActivityItem-activityText",e.activityText),commentText:Z("ms-ActivityItem-commentText",e.commentText),timeStamp:Z("ms-ActivityItem-timeStamp",e.timeStamp,n&&e.isCompactTimeStamp)}})),Rn="32px",Nn="16px",Bn="16px",Fn="13px",An=jo((function(){return J({from:{opacity:0},to:{opacity:1}})})),Ln=jo((function(){return J({from:{transform:"translateX(-10px)"},to:{transform:"translateX(0)"}})})),Hn=jo((function(e,t,o,n,r,i){var a;void 0===e&&(e=Qt());var s={animationName:Lo.continuousPulseAnimationSingle(n||e.palette.themePrimary,r||e.palette.themeTertiary,"4px","28px","4px"),animationIterationCount:"1",animationDuration:".8s",zIndex:1},l={animationName:Ln(),animationIterationCount:"1",animationDuration:".5s"},c={animationName:An(),animationIterationCount:"1",animationDuration:".5s"};return kn({root:[e.fonts.small,{display:"flex",justifyContent:"flex-start",alignItems:"flex-start",boxSizing:"border-box",color:e.palette.neutralSecondary},i&&o&&c],pulsingBeacon:[{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"0px",height:"0px",borderRadius:"225px",borderStyle:"solid",opacity:0},i&&o&&s],isCompactRoot:{alignItems:"center"},personaContainer:{display:"flex",flexWrap:"wrap",minWidth:Rn,width:Rn,height:Rn},isCompactPersonaContainer:{display:"inline-flex",flexWrap:"nowrap",flexBasis:"auto",height:Nn,width:"auto",minWidth:"0",paddingRight:"6px"},activityTypeIcon:{height:Rn,fontSize:Bn,lineHeight:Bn,marginTop:"3px"},isCompactIcon:{height:Nn,minWidth:Nn,fontSize:Fn,lineHeight:Fn,color:e.palette.themePrimary,marginTop:"1px",position:"relative",display:"flex",justifyContent:"center",alignItems:"center",selectors:{".ms-Persona-imageArea":{margin:"-2px 0 0 -2px",border:"2px solid"+e.palette.white,borderRadius:"50%",selectors:(a={},a[ro]={border:"none",margin:"0"},a)}}},activityPersona:{display:"block"},doublePersona:{selectors:{":first-child":{alignSelf:"flex-end"}}},isCompactPersona:{display:"inline-block",width:"8px",minWidth:"8px",overflow:"visible"},activityContent:[{padding:"0 8px"},i&&o&&l],activityText:{display:"inline"},isCompactContent:{flex:"1",padding:"0 4px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflowX:"hidden"},commentText:{color:e.palette.neutralPrimary},timeStamp:[e.fonts.tiny,{fontWeight:400,color:e.palette.neutralSecondary}],isCompactTimeStamp:{display:"inline-block",paddingLeft:"0.3em",fontSize:"1em"}},t)})),On=f.createContext({customizations:{inCustomizerContext:!1,settings:{},scopedSettings:{}}});function zn(e,t){var o,n=(o=f.useState(0)[1],function(){return o((function(e){return++e}))}),r=f.useContext(On).customizations,i=r.inCustomizerContext;return f.useEffect((function(){return i||Dt.observe(n),function(){i||Dt.unobserve(n)}}),[i]),Dt.getSettings(e,t,r)}var Wn=["theme","styles"];function Vn(e,t,o,n,r){var i=(n=n||{scope:"",fields:void 0}).scope,a=n.fields,s=void 0===a?Wn:a,l=f.forwardRef((function(n,r){var a=f.useRef(),l=zn(s,i),c=l.styles,u=(l.dir,p(l,["styles","dir"])),h=o?o(n):void 0,m=a.current&&a.current.__cachedInputs__||[];if(!a.current||c!==m[1]||n.styles!==m[2]){var g=function(e){return wn(e,t,c,n.styles)};g.__cachedInputs__=[t,c,n.styles],g.__noStyleOverride__=!c&&!n.styles,a.current=g}return f.createElement(e,d({ref:r},u,h,n,{styles:a.current}))}));l.displayName="Styled"+(e.displayName||e.name);var c=r?f.memo(l):l;return l.displayName&&(c.displayName=l.displayName),c}var Kn,Un={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pauseBreak:19,capslock:20,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,del:46,zero:48,one:49,two:50,three:51,four:52,five:53,six:54,seven:55,eight:56,nine:57,colon:58,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftWindow:91,rightWindow:92,select:93,zero_numpad:96,one_numpad:97,two_numpad:98,three_numpad:99,four_numpad:100,five_numpad:101,six_numpad:102,seven_numpad:103,eight_numpad:104,nine_numpad:105,multiply:106,add:107,subtract:109,decimalPoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrollLock:145,semicolon:186,equalSign:187,comma:188,dash:189,period:190,forwardSlash:191,graveAccent:192,openBracket:219,backSlash:220,closeBracket:221,singleQuote:222},Gn="isRTL";function jn(e){if(void 0===e&&(e={}),void 0!==e.rtl)return e.rtl;if(void 0===Kn){var t=st(Gn);null!==t&&qn(Kn="1"===t);var o=nt();void 0===Kn&&o&&x(Kn="rtl"===(o.body&&o.body.getAttribute("dir")||o.documentElement.getAttribute("dir")))}return!!Kn}function qn(e,t){void 0===t&&(t=!1);var o=nt();o&&o.documentElement.setAttribute("dir",e?"rtl":"ltr"),t&&lt(Gn,e?"1":"0"),x(Kn=e)}function Yn(e,t){return void 0===t&&(t={}),jn(t)&&(e===Un.left?e=Un.right:e===Un.right&&(e=Un.left)),e}var Zn=0,Xn=C.getInstance();Xn&&Xn.onReset&&Xn.onReset((function(){return Zn++}));var Qn="__retval__";function Jn(e){void 0===e&&(e={});var t=new Map,o=0,n=0,r=Zn;return function(i,a){var s;if(void 0===a&&(a={}),e.useStaticStyles&&"function"==typeof i&&i.__noStyleOverride__)return i(a);n++;var l=t,c=a.theme,u=c&&void 0!==c.rtl?c.rtl:jn(),d=e.disableCaching;if(r!==Zn&&(r=Zn,t=new Map,o=0),e.disableCaching||(l=er(t,i),l=er(l,a)),!d&&l[Qn]||(l[Qn]=void 0===i?{}:Dn(["function"==typeof i?i(a):i],{rtl:!!u,specificityMultiplier:e.useStaticStyles?5:void 0}),d||o++),o>(e.cacheSize||50)){var p=at();(null===(s=null==p?void 0:p.FabricConfig)||void 0===s?void 0:s.enableClassNameCacheFullWarning)&&(console.warn("Styles are being recalculated too frequently. Cache miss rate is "+o+"/"+n+"."),console.trace()),t.clear(),o=0,e.disableCaching=!0}return l[Qn]}}function $n(e,t){return t=function(e){switch(e){case void 0:return"__undefined__";case null:return"__null__";default:return e}}(t),e.has(t)||e.set(t,new Map),e.get(t)}function er(e,t){if("function"==typeof t)if(t.__cachedInputs__)for(var o=0,n=t.__cachedInputs__;o<n.length;o++)e=$n(e,n[o]);else e=$n(e,t);else if("object"==typeof t)for(var r in t)t.hasOwnProperty(r)&&(e=$n(e,t[r]));return e}function tr(e,t){for(var o=d({},t),n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];void 0===o[i]&&(o[i]=e[i])}return o}var or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o={},n=0,r=e;n<r.length;n++)for(var i=r[n],a=Array.isArray(i)?i:Object.keys(i),s=0,l=a;s<l.length;s++){var c=l[s];o[c]=1}return o},nr=or(["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onInput","onSubmit","onLoad","onError","onKeyDown","onKeyDownCapture","onKeyPress","onKeyUp","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onClick","onClickCapture","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onMouseUpCapture","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onPointerCancel","onPointerDown","onPointerEnter","onPointerLeave","onPointerMove","onPointerOut","onPointerOver","onPointerUp","onGotPointerCapture","onLostPointerCapture"]),rr=or(["accessKey","children","className","contentEditable","dir","draggable","hidden","htmlFor","id","lang","ref","role","style","tabIndex","title","translate","spellCheck","name"]),ir=or(rr,nr),ar=or(ir,["form"]),sr=or(ir,["height","loop","muted","preload","src","width"]),lr=or(sr,["poster"]),cr=or(ir,["start"]),ur=or(ir,["value"]),dr=or(ir,["download","href","hrefLang","media","rel","target","type"]),pr=or(ir,["autoFocus","disabled","form","formAction","formEncType","formMethod","formNoValidate","formTarget","type","value"]),hr=or(pr,["accept","alt","autoCapitalize","autoComplete","checked","dirname","form","height","inputMode","list","max","maxLength","min","multiple","pattern","placeholder","readOnly","required","src","step","size","type","value","width"]),mr=or(pr,["autoCapitalize","cols","dirname","form","maxLength","placeholder","readOnly","required","rows","wrap"]),gr=or(pr,["form","multiple","required"]),fr=or(ir,["selected","value"]),vr=or(ir,["cellPadding","cellSpacing"]),br=ir,yr=or(ir,["rowSpan","scope"]),_r=or(ir,["colSpan","headers","rowSpan","scope"]),Cr=or(ir,["span"]),Sr=or(ir,["span"]),xr=or(ir,["acceptCharset","action","encType","encType","method","noValidate","target"]),kr=or(ir,["allow","allowFullScreen","allowPaymentRequest","allowTransparency","csp","height","importance","referrerPolicy","sandbox","src","srcDoc","width"]),wr=or(ir,["alt","crossOrigin","height","src","srcSet","useMap","width"]),Ir=wr,Dr=ir;function Tr(e,t,o){for(var n=Array.isArray(t),r={},i=0,a=Object.keys(e);i<a.length;i++){var s=a[i];!(!n&&t[s]||n&&t.indexOf(s)>=0||0===s.indexOf("data-")||0===s.indexOf("aria-"))||o&&-1!==(null==o?void 0:o.indexOf(s))||(r[s]=e[s])}return r}var Er,Pr,Mr,Rr,Nr=/[\(\[\{\<][^\)\]\}\>]*[\)\]\}\>]/g,Br=/[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g,Fr=/^\d+[\d\s]*(:?ext|x|)\s*\d+$/i,Ar=/\s+/g,Lr=/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;function Hr(e,t,o){return e?(e=function(e){return(e=(e=(e=e.replace(Nr,"")).replace(Br,"")).replace(Ar," ")).trim()}(e),Lr.test(e)||!o&&Fr.test(e)?"":function(e,t){var o="",n=e.split(" ");return 2===n.length?(o+=n[0].charAt(0).toUpperCase(),o+=n[1].charAt(0).toUpperCase()):3===n.length?(o+=n[0].charAt(0).toUpperCase(),o+=n[2].charAt(0).toUpperCase()):0!==n.length&&(o+=n[0].charAt(0).toUpperCase()),t&&o.length>1?o.charAt(1)+o.charAt(0):o}(e,t)):""}function Or(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=f.useCallback((function(t){o.current=t;for(var n=0,r=e;n<r.length;n++){var i=r[n];"function"==typeof i?i(t):i&&(i.current=t)}}),m(e));return o}!function(e){e[e.default=0]="default",e[e.image=1]="image",e[e.Default=1e5]="Default",e[e.Image=100001]="Image"}(Er||(Er={})),function(e){e[e.center=0]="center",e[e.contain=1]="contain",e[e.cover=2]="cover",e[e.none=3]="none",e[e.centerCover=4]="centerCover",e[e.centerContain=5]="centerContain"}(Pr||(Pr={})),function(e){e[e.landscape=0]="landscape",e[e.portrait=1]="portrait"}(Mr||(Mr={})),function(e){e[e.notLoaded=0]="notLoaded",e[e.loaded=1]="loaded",e[e.error=2]="error",e[e.errorLoaded=3]="errorLoaded"}(Rr||(Rr={}));var zr=Jn(),Wr=/\.svg$/i,Vr=f.forwardRef((function(e,t){var o=f.useRef(),n=f.useRef(),r=function(e,t){var o=e.onLoadingStateChange,n=e.onLoad,r=e.onError,i=e.src,a=f.useState(Rr.notLoaded),s=a[0],l=a[1];f.useLayoutEffect((function(){l(Rr.notLoaded)}),[i]),f.useEffect((function(){s===Rr.notLoaded&&t.current&&(i&&t.current.naturalWidth>0&&t.current.naturalHeight>0||t.current.complete&&Wr.test(i))&&l(Rr.loaded)})),f.useEffect((function(){null==o||o(s)}),[s]);var c=f.useCallback((function(e){null==n||n(e),i&&l(Rr.loaded)}),[i,n]),u=f.useCallback((function(e){null==r||r(e),l(Rr.error)}),[r]);return[s,c,u]}(e,n),i=r[0],a=r[1],s=r[2],l=Tr(e,wr,["width","height"]),c=e.src,u=e.alt,p=e.width,h=e.height,m=e.shouldFadeIn,g=void 0===m||m,v=e.shouldStartVisible,b=e.className,y=e.imageFit,_=e.role,C=e.maximizeFrame,S=e.styles,x=e.theme,k=e.loading,w=function(e,t,o,n){var r=f.useRef(t),i=f.useRef();return(void 0===i||r.current===Rr.notLoaded&&t===Rr.loaded)&&(i.current=function(e,t,o,n){var r=e.imageFit,i=e.width,a=e.height;if(void 0!==e.coverStyle)return e.coverStyle;if(t===Rr.loaded&&(r===Pr.cover||r===Pr.contain||r===Pr.centerContain||r===Pr.centerCover)&&o.current&&n.current){var s;if(s="number"==typeof i&&"number"==typeof a&&r!==Pr.centerContain&&r!==Pr.centerCover?i/a:n.current.clientWidth/n.current.clientHeight,o.current.naturalWidth/o.current.naturalHeight>s)return Mr.landscape}return Mr.portrait}(e,t,o,n)),r.current=t,i.current}(e,i,n,o),I=zr(S,{theme:x,className:b,width:p,height:h,maximizeFrame:C,shouldFadeIn:g,shouldStartVisible:v,isLoaded:i===Rr.loaded||i===Rr.notLoaded&&e.shouldStartVisible,isLandscape:w===Mr.landscape,isCenter:y===Pr.center,isCenterContain:y===Pr.centerContain,isCenterCover:y===Pr.centerCover,isContain:y===Pr.contain,isCover:y===Pr.cover,isNone:y===Pr.none,isError:i===Rr.error,isNotImageFit:void 0===y});return f.createElement("div",{className:I.root,style:{width:p,height:h},ref:o},f.createElement("img",d({},l,{onLoad:a,onError:s,key:"fabricImage"+e.src||"",className:I.image,ref:Or(n,t),src:c,alt:u,role:_,loading:k})))}));Vr.displayName="ImageBase";var Kr={root:"ms-Image",rootMaximizeFrame:"ms-Image--maximizeFrame",image:"ms-Image-image",imageCenter:"ms-Image-image--center",imageContain:"ms-Image-image--contain",imageCover:"ms-Image-image--cover",imageCenterContain:"ms-Image-image--centerContain",imageCenterCover:"ms-Image-image--centerCover",imageNone:"ms-Image-image--none",imageLandscape:"ms-Image-image--landscape",imagePortrait:"ms-Image-image--portrait"},Ur=Vn(Vr,(function(e){var t=e.className,o=e.width,n=e.height,r=e.maximizeFrame,i=e.isLoaded,a=e.shouldFadeIn,s=e.shouldStartVisible,l=e.isLandscape,c=e.isCenter,u=e.isContain,d=e.isCover,p=e.isCenterContain,h=e.isCenterCover,m=e.isNone,g=e.isError,f=e.isNotImageFit,v=e.theme,b=Qo(Kr,v),y={position:"absolute",left:"50% /* @noflip */",top:"50%",transform:"translate(-50%,-50%)"},_=at(),C=void 0!==_&&void 0===_.navigator.msMaxTouchPoints,S=u&&l||d&&!l?{width:"100%",height:"auto"}:{width:"auto",height:"100%"};return{root:[b.root,v.fonts.medium,{overflow:"hidden"},r&&[b.rootMaximizeFrame,{height:"100%",width:"100%"}],i&&a&&!s&&Ze.fadeIn400,(c||u||d||p||h)&&{position:"relative"},t],image:[b.image,{display:"block",opacity:0},i&&["is-loaded",{opacity:1}],c&&[b.imageCenter,y],u&&[b.imageContain,C&&{width:"100%",height:"100%",objectFit:"contain"},!C&&S,!C&&y],d&&[b.imageCover,C&&{width:"100%",height:"100%",objectFit:"cover"},!C&&S,!C&&y],p&&[b.imageCenterContain,l&&{maxWidth:"100%"},!l&&{maxHeight:"100%"},y],h&&[b.imageCenterCover,l&&{maxHeight:"100%"},!l&&{maxWidth:"100%"},y],m&&[b.imageNone,{width:"auto",height:"auto"}],f&&[!!o&&!n&&{height:"auto",width:"100%"},!o&&!!n&&{height:"100%",width:"auto"},!!o&&!!n&&{height:"100%",width:"100%"}],l&&b.imageLandscape,!l&&b.imagePortrait,!i&&"is-notLoaded",a&&"is-fadeIn",g&&"is-error"]}}),void 0,{scope:"Image"},!0);Ur.displayName="Image";var Gr=In({root:{display:"inline-block"},placeholder:["ms-Icon-placeHolder",{width:"1em"}],image:["ms-Icon-imageContainer",{overflow:"hidden"}]}),jr="ms-Icon";function qr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=[],n=0,r=e;n<r.length;n++){var i=r[n];if(i)if("string"==typeof i)o.push(i);else if(i.hasOwnProperty("toString")&&"function"==typeof i.toString)o.push(i.toString());else for(var a in i)i[a]&&o.push(a)}return o.join(" ")}var Yr,Zr,Xr,Qr,Jr,$r,ei=jo((function(e){var t=vn(e)||{subset:{},code:void 0},o=t.code,n=t.subset;return o?{children:o,iconClassName:n.className,fontFamily:n.fontFace&&n.fontFace.fontFamily,mergeImageProps:n.mergeImageProps}:null}),void 0,!0),ti=function(e){var t=e.iconName,o=e.className,n=e.style,r=void 0===n?{}:n,i=ei(t)||{},a=i.iconClassName,s=i.children,l=i.fontFamily,c=i.mergeImageProps,u=Tr(e,ir),p=e["aria-label"]||e.title,h=e["aria-label"]||e["aria-labelledby"]||e.title?{role:c?void 0:"img"}:{"aria-hidden":!0},m=s;return c&&"object"==typeof s&&"object"==typeof s.props&&p&&(m=f.cloneElement(s,{alt:p})),f.createElement("i",d({"data-icon-name":t},h,u,c?{title:void 0,"aria-label":void 0}:{},{className:qr(jr,Gr.root,a,!t&&Gr.placeholder,o),style:d({fontFamily:l},r)}),m)},oi=jo((function(e,t,o){return ti({iconName:e,className:t,"aria-label":o})})),ni=Jn({cacheSize:100}),ri=function(e){function t(t){var o=e.call(this,t)||this;return o._onImageLoadingStateChange=function(e){o.props.imageProps&&o.props.imageProps.onLoadingStateChange&&o.props.imageProps.onLoadingStateChange(e),e===Rr.error&&o.setState({imageLoadError:!0})},o.state={imageLoadError:!1},o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.children,o=e.className,n=e.styles,r=e.iconName,i=e.imageErrorAs,a=e.theme,s="string"==typeof r&&0===r.length,l=!!this.props.imageProps||this.props.iconType===Er.image||this.props.iconType===Er.Image,c=ei(r)||{},u=c.iconClassName,p=c.children,h=c.mergeImageProps,m=ni(n,{theme:a,className:o,iconClassName:u,isImage:l,isPlaceholder:s}),g=l?"span":"i",v=Tr(this.props,ir,["aria-label"]),b=this.state.imageLoadError,y=d(d({},this.props.imageProps),{onLoadingStateChange:this._onImageLoadingStateChange}),_=b&&i||Ur,C=this.props["aria-label"]||this.props.ariaLabel,S=y.alt||C||this.props.title,x=S||this.props["aria-labelledby"]||y["aria-label"]||y["aria-labelledby"]?{role:l||h?void 0:"img","aria-label":l||h?void 0:S}:{"aria-hidden":!0},k=p;return h&&p&&"object"==typeof p&&S&&(k=f.cloneElement(p,{alt:S})),f.createElement(g,d({"data-icon-name":r},x,v,h?{title:void 0,"aria-label":void 0}:{},{className:m.root}),l?f.createElement(_,d({},y)):t||k)},t}(f.Component),ii=Vn(ri,(function(e){var t=e.className,o=e.iconClassName,n=e.isPlaceholder,r=e.isImage,i=e.styles;return{root:[n&&Gr.placeholder,Gr.root,r&&Gr.image,o,t,i&&i.root,i&&i.imageContainer]}}),void 0,{scope:"Icon"},!0);ii.displayName="Icon",function(e){e[e.tiny=0]="tiny",e[e.extraExtraSmall=1]="extraExtraSmall",e[e.extraSmall=2]="extraSmall",e[e.small=3]="small",e[e.regular=4]="regular",e[e.large=5]="large",e[e.extraLarge=6]="extraLarge",e[e.size8=17]="size8",e[e.size10=9]="size10",e[e.size16=8]="size16",e[e.size24=10]="size24",e[e.size28=7]="size28",e[e.size32=11]="size32",e[e.size40=12]="size40",e[e.size48=13]="size48",e[e.size56=16]="size56",e[e.size72=14]="size72",e[e.size100=15]="size100",e[e.size120=18]="size120"}(Yr||(Yr={})),function(e){e[e.none=0]="none",e[e.offline=1]="offline",e[e.online=2]="online",e[e.away=3]="away",e[e.dnd=4]="dnd",e[e.blocked=5]="blocked",e[e.busy=6]="busy"}(Zr||(Zr={})),function(e){e[e.lightBlue=0]="lightBlue",e[e.blue=1]="blue",e[e.darkBlue=2]="darkBlue",e[e.teal=3]="teal",e[e.lightGreen=4]="lightGreen",e[e.green=5]="green",e[e.darkGreen=6]="darkGreen",e[e.lightPink=7]="lightPink",e[e.pink=8]="pink",e[e.magenta=9]="magenta",e[e.purple=10]="purple",e[e.black=11]="black",e[e.orange=12]="orange",e[e.red=13]="red",e[e.darkRed=14]="darkRed",e[e.transparent=15]="transparent",e[e.violet=16]="violet",e[e.lightRed=17]="lightRed",e[e.gold=18]="gold",e[e.burgundy=19]="burgundy",e[e.warmGray=20]="warmGray",e[e.coolGray=21]="coolGray",e[e.gray=22]="gray",e[e.cyan=23]="cyan",e[e.rust=24]="rust"}(Xr||(Xr={})),function(e){e.size8="20px",e.size10="20px",e.size16="16px",e.size24="24px",e.size28="28px",e.size32="32px",e.size40="40px",e.size48="48px",e.size56="56px",e.size72="72px",e.size100="100px",e.size120="120px"}(Jr||(Jr={})),function(e){e.size6="6px",e.size8="8px",e.size12="12px",e.size16="16px",e.size20="20px",e.size28="28px",e.size32="32px",e.border="2px"}($r||($r={}));var ai=function(e){return{isSize8:e===Yr.size8,isSize10:e===Yr.size10||e===Yr.tiny,isSize16:e===Yr.size16,isSize24:e===Yr.size24||e===Yr.extraExtraSmall,isSize28:e===Yr.size28||e===Yr.extraSmall,isSize32:e===Yr.size32,isSize40:e===Yr.size40||e===Yr.small,isSize48:e===Yr.size48||e===Yr.regular,isSize56:e===Yr.size56,isSize72:e===Yr.size72||e===Yr.large,isSize100:e===Yr.size100||e===Yr.extraLarge,isSize120:e===Yr.size120}},si=((Qr={})[Yr.tiny]=10,Qr[Yr.extraExtraSmall]=24,Qr[Yr.extraSmall]=28,Qr[Yr.small]=40,Qr[Yr.regular]=48,Qr[Yr.large]=72,Qr[Yr.extraLarge]=100,Qr[Yr.size8]=8,Qr[Yr.size10]=10,Qr[Yr.size16]=16,Qr[Yr.size24]=24,Qr[Yr.size28]=28,Qr[Yr.size32]=32,Qr[Yr.size40]=40,Qr[Yr.size48]=48,Qr[Yr.size56]=56,Qr[Yr.size72]=72,Qr[Yr.size100]=100,Qr[Yr.size120]=120,Qr),li=function(e){return{isAvailable:e===Zr.online,isAway:e===Zr.away,isBlocked:e===Zr.blocked,isBusy:e===Zr.busy,isDoNotDisturb:e===Zr.dnd,isOffline:e===Zr.offline}},ci=Jn({cacheSize:100}),ui=f.forwardRef((function(e,t){var o=e.coinSize,n=e.isOutOfOffice,r=e.styles,i=e.presence,a=e.theme,s=e.presenceTitle,l=e.presenceColors,c=Or(t,f.useRef(null)),u=ai(e.size),d=!(u.isSize8||u.isSize10||u.isSize16||u.isSize24||u.isSize28||u.isSize32)&&(!o||o>32),p=o?o/3<40?o/3+"px":"40px":"",h=o?{fontSize:o?o/6<20?o/6+"px":"20px":"",lineHeight:p}:void 0,m=o?{width:p,height:p}:void 0,g=ci(r,{theme:a,presence:i,size:e.size,isOutOfOffice:n,presenceColors:l});return i===Zr.none?null:f.createElement("div",{role:"presentation",className:g.presence,style:m,title:s,ref:c},d&&f.createElement(ii,{className:g.presenceIcon,iconName:di(e.presence,e.isOutOfOffice),style:h}))}));function di(e,t){if(e){var o="SkypeArrow";switch(Zr[e]){case"online":return"SkypeCheck";case"away":return t?o:"SkypeClock";case"dnd":return"SkypeMinus";case"offline":return t?o:""}return""}}ui.displayName="PersonaPresenceBase";var pi={presence:"ms-Persona-presence",presenceIcon:"ms-Persona-presenceIcon"};function hi(e){return{color:e,borderColor:e}}function mi(e,t){return{selectors:{":before":{border:e+" solid "+t}}}}function gi(e){return{height:e,width:e}}function fi(e){return{backgroundColor:e}}var vi,bi=Vn(ui,(function(e){var t,o,n,r,i,a,s=e.theme,l=e.presenceColors,c=s.semanticColors,u=s.fonts,p=Qo(pi,s),h=ai(e.size),m=li(e.presence),g=l&&l.available||"#6BB700",f=l&&l.away||"#FFAA44",v=l&&l.busy||"#C43148",b=l&&l.dnd||"#C50F1F",y=l&&l.offline||"#8A8886",_=l&&l.oof||"#B4009E",C=l&&l.background||c.bodyBackground,S=m.isOffline||e.isOutOfOffice&&(m.isAvailable||m.isBusy||m.isAway||m.isDoNotDisturb),x=h.isSize72||h.isSize100?"2px":"1px";return{presence:[p.presence,d(d({position:"absolute",height:$r.size12,width:$r.size12,borderRadius:"50%",top:"auto",right:"-2px",bottom:"-2px",border:"2px solid "+C,textAlign:"center",boxSizing:"content-box",backgroundClip:"border-box"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:(t={},t[ro]={borderColor:"Window",backgroundColor:"WindowText"},t)}),(h.isSize8||h.isSize10)&&{right:"auto",top:"7px",left:0,border:0,selectors:(o={},o[ro]={top:"9px",border:"1px solid WindowText"},o)},(h.isSize8||h.isSize10||h.isSize24||h.isSize28||h.isSize32)&&gi($r.size8),(h.isSize40||h.isSize48)&&gi($r.size12),h.isSize16&&{height:$r.size6,width:$r.size6,borderWidth:"1.5px"},h.isSize56&&gi($r.size16),h.isSize72&&gi($r.size20),h.isSize100&&gi($r.size28),h.isSize120&&gi($r.size32),m.isAvailable&&{backgroundColor:g,selectors:(n={},n[ro]=fi("Highlight"),n)},m.isAway&&fi(f),m.isBlocked&&[{selectors:(r={":after":h.isSize40||h.isSize48||h.isSize72||h.isSize100?{content:'""',width:"100%",height:x,backgroundColor:v,transform:"translateY(-50%) rotate(-45deg)",position:"absolute",top:"50%",left:0}:void 0},r[ro]={selectors:{":after":{width:"calc(100% - 4px)",left:"2px",backgroundColor:"Window"}}},r)}],m.isBusy&&fi(v),m.isDoNotDisturb&&fi(b),m.isOffline&&fi(y),(S||m.isBlocked)&&[{backgroundColor:C,selectors:(i={":before":{content:'""',width:"100%",height:"100%",position:"absolute",top:0,left:0,border:x+" solid "+v,borderRadius:"50%",boxSizing:"border-box"}},i[ro]={backgroundColor:"WindowText",selectors:{":before":{width:"calc(100% - 2px)",height:"calc(100% - 2px)",top:"1px",left:"1px",borderColor:"Window"}}},i)}],S&&m.isAvailable&&mi(x,g),S&&m.isBusy&&mi(x,v),S&&m.isAway&&mi(x,_),S&&m.isDoNotDisturb&&mi(x,b),S&&m.isOffline&&mi(x,y),S&&m.isOffline&&e.isOutOfOffice&&mi(x,_)],presenceIcon:[p.presenceIcon,{color:C,fontSize:"6px",lineHeight:$r.size12,verticalAlign:"top",selectors:(a={},a[ro]={color:"Window"},a)},h.isSize56&&{fontSize:"8px",lineHeight:$r.size16},h.isSize72&&{fontSize:u.small.fontSize,lineHeight:$r.size20},h.isSize100&&{fontSize:u.medium.fontSize,lineHeight:$r.size28},h.isSize120&&{fontSize:u.medium.fontSize,lineHeight:$r.size32},m.isAway&&{position:"relative",left:S?void 0:"1px"},S&&m.isAvailable&&hi(g),S&&m.isBusy&&hi(v),S&&m.isAway&&hi(_),S&&m.isDoNotDisturb&&hi(b),S&&m.isOffline&&hi(y),S&&m.isOffline&&e.isOutOfOffice&&hi(_)]}}),void 0,{scope:"PersonaPresence"}),yi=[Xr.lightBlue,Xr.blue,Xr.darkBlue,Xr.teal,Xr.green,Xr.darkGreen,Xr.lightPink,Xr.pink,Xr.magenta,Xr.purple,Xr.orange,Xr.lightRed,Xr.darkRed,Xr.violet,Xr.gold,Xr.burgundy,Xr.warmGray,Xr.cyan,Xr.rust,Xr.coolGray],_i=yi.length;function Ci(e){var t=e.primaryText,o=e.text,n=e.initialsColor;return"string"==typeof n?n:function(e){switch(e){case Xr.lightBlue:return"#4F6BED";case Xr.blue:return"#0078D4";case Xr.darkBlue:return"#004E8C";case Xr.teal:return"#038387";case Xr.lightGreen:case Xr.green:return"#498205";case Xr.darkGreen:return"#0B6A0B";case Xr.lightPink:return"#C239B3";case Xr.pink:return"#E3008C";case Xr.magenta:return"#881798";case Xr.purple:return"#5C2E91";case Xr.orange:return"#CA5010";case Xr.red:return"#EE1111";case Xr.lightRed:return"#D13438";case Xr.darkRed:return"#A4262C";case Xr.transparent:return"transparent";case Xr.violet:return"#8764B8";case Xr.gold:return"#986F0B";case Xr.burgundy:return"#750B1C";case Xr.warmGray:return"#7A7574";case Xr.cyan:return"#005B70";case Xr.rust:return"#8E562E";case Xr.coolGray:return"#69797E";case Xr.black:return"#1D1D1D";case Xr.gray:return"#393939"}}(n=void 0!==n?n:function(e){var t=Xr.blue;if(!e)return t;for(var o=0,n=e.length-1;n>=0;n--){var r=e.charCodeAt(n),i=n%8;o^=(r<<i)+(r>>8-i)}return yi[o%_i]}(o||t))}function Si(e,t,o,n,r){if(!0===r)for(var i=0,a=o;i<a.length;i++){var s=a[i];s in t||cn(e+" property '"+s+"' is required when '"+n+"' is used.'")}}function xi(e,t,o){for(var n in o)if(t&&n in t){var r=e+" property '"+n+"' was used but has been deprecated.",i=o[n];i&&(r+=" Use '"+i+"' instead."),cn(r)}}function ki(e,t,o){for(var n in o)if(t&&void 0!==t[n]){var r=o[n];r&&void 0!==t[r]&&cn(e+" property '"+n+"' is mutually exclusive with '"+o[n]+"'. Use one or the other.")}}function wi(e,t){return void 0!==e[t]&&null!==e[t]}function Ii(){vi.valueOnChange={},vi.valueDefaultValue={},vi.controlledToUncontrolled={},vi.uncontrolledToControlled={}}function Di(e){var t=e.componentId,o=e.componentName,n=e.defaultValueProp,r=e.props,i=e.oldProps,a=e.onChangeProp,s=e.readOnlyProp,l=e.valueProp,c=i?wi(i,l):void 0,u=wi(r,l);if(u){var d=!!r[a],p=!(!s||!r[s]);d||p||vi.valueOnChange[t]||(vi.valueOnChange[t]=!0,cn("Warning: You provided a '"+l+"' prop to a "+o+" without an '"+a+"' handler. This will render a read-only field. If the field should be mutable use '"+n+"'. Otherwise, set '"+a+"'"+(s?" or '"+s+"'":"")+".")),null==r[n]||vi.valueDefaultValue[t]||(vi.valueDefaultValue[t]=!0,cn("Warning: You provided both '"+l+"' and '"+n+"' to a "+o+". Form fields must be either controlled or uncontrolled (specify either the '"+l+"' prop, or the '"+n+"' prop, but not both). Decide between using a controlled or uncontrolled "+o+" and remove one of these props. More info: https://fb.me/react-controlled-components"))}if(i&&u!==c){var h=c?"a controlled":"an uncontrolled",m=c?"uncontrolled":"controlled",g=c?vi.controlledToUncontrolled:vi.uncontrolledToControlled;g[t]||(g[t]=!0,cn("Warning: A component is changing "+h+" "+o+" to be "+m+". "+o+"s should not switch from controlled to uncontrolled (or vice versa). Decide between using controlled or uncontrolled for the lifetime of the component. More info: https://fb.me/react-controlled-components"))}}function Ti(e){var t=(0,f.useRef)();return(0,f.useEffect)((function(){t.current=e})),t.current}function Ei(e){var t=f.useRef();return void 0===t.current&&(t.current={value:"function"==typeof e?e():e}),t.current.value}vi={valueOnChange:{},valueDefaultValue:{},controlledToUncontrolled:{},uncontrolledToControlled:{}};var Pi=0;function Mi(e){var t=e.name,o=e.props,n=e.other,r=void 0===n?[]:n,i=e.conditionallyRequired,a=e.deprecations,s=e.mutuallyExclusive,l=e.controlledUsage,c=f.useRef(!1),u=Ei((function(){return"useWarnings_"+Pi++})),p=Ti(o);if(!c.current){c.current=!0;for(var h=0,m=r;h<m.length;h++)cn(m[h]);if(i)for(var g=0,v=i;g<v.length;g++){var b=v[g];Si(t,o,b.requiredProps,b.conditionalPropName,b.condition)}a&&xi(t,o,a),s&&ki(t,o,s)}l&&Di(d(d({},l),{componentId:u,props:o,componentName:t,oldProps:p}))}var Ri=Jn({cacheSize:100}),Ni=jo((function(e,t,o,n,r,i){return Z(e,!i&&{backgroundColor:Ci({text:n,initialsColor:t,primaryText:r}),color:o})})),Bi={size:Yr.size48,presence:Zr.none,imageAlt:""},Fi=f.forwardRef((function(e,t){var o=tr(Bi,e);!function(e){Mi({name:"PersonaCoin",props:e,deprecations:{primaryText:"text"}})}(o);var n=function(e){var t=e.onPhotoLoadingStateChange,o=e.imageUrl,n=f.useState(Rr.notLoaded),r=n[0],i=n[1];return f.useEffect((function(){i(Rr.notLoaded)}),[o]),[r,function(e){i(e),null==t||t(e)}]}(o),r=n[0],i=n[1],a=Ai(i),s=o.className,l=o.coinProps,c=o.showUnknownPersonaCoin,u=o.coinSize,p=o.styles,h=o.imageUrl,m=o.initialsColor,g=o.initialsTextColor,v=o.isOutOfOffice,b=o.onRenderCoin,y=void 0===b?a:b,_=o.onRenderPersonaCoin,C=void 0===_?y:_,S=o.onRenderInitials,x=void 0===S?Li:S,k=o.presence,w=o.presenceTitle,I=o.presenceColors,D=o.primaryText,T=o.showInitialsUntilImageLoads,E=o.text,P=o.theme,M=o.size,R=Tr(o,Dr),N=Tr(l||{},Dr),B=u?{width:u,height:u}:void 0,F=c,A={coinSize:u,isOutOfOffice:v,presence:k,presenceTitle:w,presenceColors:I,size:M,theme:P},L=Ri(p,{theme:P,className:l&&l.className?l.className:s,size:M,coinSize:u,showUnknownPersonaCoin:c}),H=Boolean(r!==Rr.loaded&&(T&&h||!h||r===Rr.error||F));return f.createElement("div",d({role:"presentation"},R,{className:L.coin,ref:t}),M!==Yr.size8&&M!==Yr.size10&&M!==Yr.tiny?f.createElement("div",d({role:"presentation"},N,{className:L.imageArea,style:B}),H&&f.createElement("div",{className:Ni(L.initials,m,g,E,D,c),style:B,"aria-hidden":"true"},x(o,Li)),!F&&C(o,a),f.createElement(bi,d({},A))):o.presence?f.createElement(bi,d({},A)):f.createElement(ii,{iconName:"Contact",className:L.size10WithoutPresenceIcon}),o.children)}));Fi.displayName="PersonaCoinBase";var Ai=function(e){return function(t){var o=t.coinSize,n=t.styles,r=t.imageUrl,i=t.imageAlt,a=t.imageShouldFadeIn,s=t.imageShouldStartVisible,l=t.theme,c=t.showUnknownPersonaCoin,u=t.size,d=void 0===u?Bi.size:u;if(!r)return null;var p=Ri(n,{theme:l,size:d,showUnknownPersonaCoin:c}),h=o||si[d];return f.createElement(Ur,{className:p.image,imageFit:Pr.cover,src:r,width:h,height:h,alt:i,shouldFadeIn:a,shouldStartVisible:s,onLoadingStateChange:e})}},Li=function(e){var t=e.imageInitials,o=e.allowPhoneInitials,n=e.showUnknownPersonaCoin,r=e.text,i=e.primaryText,a=e.theme;if(n)return f.createElement(ii,{iconName:"Help"});var s=jn(a);return""!==(t=t||Hr(r||i||"",s,o))?f.createElement("span",null,t):f.createElement(ii,{iconName:"Contact"})},Hi={coin:"ms-Persona-coin",imageArea:"ms-Persona-imageArea",image:"ms-Persona-image",initials:"ms-Persona-initials",size8:"ms-Persona--size8",size10:"ms-Persona--size10",size16:"ms-Persona--size16",size24:"ms-Persona--size24",size28:"ms-Persona--size28",size32:"ms-Persona--size32",size40:"ms-Persona--size40",size48:"ms-Persona--size48",size56:"ms-Persona--size56",size72:"ms-Persona--size72",size100:"ms-Persona--size100",size120:"ms-Persona--size120"},Oi=Vn(Fi,(function(e){var t,o=e.className,n=e.theme,r=e.coinSize,i=n.palette,a=n.fonts,s=ai(e.size),l=Qo(Hi,n),c=r||e.size&&si[e.size]||48;return{coin:[l.coin,a.medium,s.isSize8&&l.size8,s.isSize10&&l.size10,s.isSize16&&l.size16,s.isSize24&&l.size24,s.isSize28&&l.size28,s.isSize32&&l.size32,s.isSize40&&l.size40,s.isSize48&&l.size48,s.isSize56&&l.size56,s.isSize72&&l.size72,s.isSize100&&l.size100,s.isSize120&&l.size120,o],size10WithoutPresenceIcon:{fontSize:a.xSmall.fontSize,position:"absolute",top:"5px",right:"auto",left:0},imageArea:[l.imageArea,{position:"relative",textAlign:"center",flex:"0 0 auto",height:c,width:c},c<=10&&{overflow:"visible",background:"transparent",height:0,width:0}],image:[l.image,{marginRight:"10px",position:"absolute",top:0,left:0,width:"100%",height:"100%",border:0,borderRadius:"50%",perspective:"1px"},c<=10&&{overflow:"visible",background:"transparent",height:0,width:0},c>10&&{height:c,width:c}],initials:[l.initials,{borderRadius:"50%",color:e.showUnknownPersonaCoin?"rgb(168, 0, 0)":i.white,fontSize:a.large.fontSize,fontWeight:qe.semibold,lineHeight:48===c?46:c,height:c,selectors:(t={},t[ro]=d(d({border:"1px solid WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{color:"WindowText",boxSizing:"border-box",backgroundColor:"Window !important"}),t.i={fontWeight:qe.semibold},t)},e.showUnknownPersonaCoin&&{backgroundColor:"rgb(234, 234, 234)"},c<32&&{fontSize:a.xSmall.fontSize},c>=32&&c<40&&{fontSize:a.medium.fontSize},c>=40&&c<56&&{fontSize:a.mediumPlus.fontSize},c>=56&&c<72&&{fontSize:a.xLarge.fontSize},c>=72&&c<100&&{fontSize:a.xxLarge.fontSize},c>=100&&{fontSize:a.superLarge.fontSize}]}}),void 0,{scope:"PersonaCoin"}),zi=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderIcon=function(e){return e.activityPersonas?o._onRenderPersonaArray(e):o.props.activityIcon},o._onRenderActivityDescription=function(e){var t=o._getClassNames(e),n=e.activityDescription||e.activityDescriptionText;return n?f.createElement("span",{className:t.activityText},n):null},o._onRenderComments=function(e){var t=o._getClassNames(e),n=e.comments||e.commentText;return!e.isCompact&&n?f.createElement("div",{className:t.commentText},n):null},o._onRenderTimeStamp=function(e){var t=o._getClassNames(e);return!e.isCompact&&e.timeStamp?f.createElement("div",{className:t.timeStamp},e.timeStamp):null},o._onRenderPersonaArray=function(e){var t=o._getClassNames(e),n=null,r=e.activityPersonas;if(r[0].imageUrl||r[0].imageInitials){var i=[],a=r.length>1||e.isCompact,s=e.isCompact?3:4,l=void 0;e.isCompact&&(l={display:"inline-block",width:"10px",minWidth:"10px",overflow:"visible"}),r.filter((function(e,t){return t<s})).forEach((function(e,o){i.push(f.createElement(Oi,d({},e,{key:e.key||o,className:t.activityPersona,size:a?Yr.size16:Yr.size32,style:l})))})),n=f.createElement("div",{className:t.personaContainer},i)}return n},o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.onRenderIcon,o=void 0===t?this._onRenderIcon:t,n=e.onRenderActivityDescription,r=void 0===n?this._onRenderActivityDescription:n,i=e.onRenderComments,a=void 0===i?this._onRenderComments:i,s=e.onRenderTimeStamp,l=void 0===s?this._onRenderTimeStamp:s,c=e.animateBeaconSignal,u=e.isCompact,d=this._getClassNames(this.props);return f.createElement("div",{className:d.root,style:this.props.style},(this.props.activityPersonas||this.props.activityIcon||this.props.onRenderIcon)&&f.createElement("div",{className:d.activityTypeIcon},c&&u&&f.createElement("div",{className:d.pulsingBeacon}),o(this.props)),f.createElement("div",{className:d.activityContent},r(this.props,this._onRenderActivityDescription),a(this.props,this._onRenderComments),l(this.props,this._onRenderTimeStamp)))},t.prototype._getClassNames=function(e){return Mn(Hn(void 0,e.styles,e.animateBeaconSignal,e.beaconColorOne,e.beaconColorTwo,e.isCompact),e.className,e.activityPersonas,e.isCompact)},t}(f.Component),Wi=function(){var e,t=at();return!!(null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.userAgent)&&t.navigator.userAgent.indexOf("rv:11.0")>-1};function Vi(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return t.length<2?t[0]:function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];t.forEach((function(t){return t&&t.apply(e,o)}))}}function Ki(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=Vi(e,e[o],t[o]))}function Ui(e){Ki(e,{componentDidMount:Gi,componentDidUpdate:ji,componentWillUnmount:qi})}function Gi(){Yi(this.props.componentRef,this)}function ji(e){e.componentRef!==this.props.componentRef&&(Yi(e.componentRef,null),Yi(this.props.componentRef,this))}function qi(){Yi(this.props.componentRef,null)}function Yi(e,t){e&&("object"==typeof e?e.current=t:"function"==typeof e&&e(t))}var Zi=function(){function e(e,t){this._timeoutIds=null,this._immediateIds=null,this._intervalIds=null,this._animationFrameIds=null,this._isDisposed=!1,this._parent=e||null,this._onErrorHandler=t,this._noop=function(){}}return e.prototype.dispose=function(){var e;if(this._isDisposed=!0,this._parent=null,this._timeoutIds){for(e in this._timeoutIds)this._timeoutIds.hasOwnProperty(e)&&this.clearTimeout(parseInt(e,10));this._timeoutIds=null}if(this._immediateIds){for(e in this._immediateIds)this._immediateIds.hasOwnProperty(e)&&this.clearImmediate(parseInt(e,10));this._immediateIds=null}if(this._intervalIds){for(e in this._intervalIds)this._intervalIds.hasOwnProperty(e)&&this.clearInterval(parseInt(e,10));this._intervalIds=null}if(this._animationFrameIds){for(e in this._animationFrameIds)this._animationFrameIds.hasOwnProperty(e)&&this.cancelAnimationFrame(parseInt(e,10));this._animationFrameIds=null}},e.prototype.setTimeout=function(e,t){var o=this,n=0;return this._isDisposed||(this._timeoutIds||(this._timeoutIds={}),n=setTimeout((function(){try{o._timeoutIds&&delete o._timeoutIds[n],e.apply(o._parent)}catch(e){o._logError(e)}}),t),this._timeoutIds[n]=!0),n},e.prototype.clearTimeout=function(e){this._timeoutIds&&this._timeoutIds[e]&&(clearTimeout(e),delete this._timeoutIds[e])},e.prototype.setImmediate=function(e,t){var o=this,n=0,r=at(t);return this._isDisposed||(this._immediateIds||(this._immediateIds={}),n=r.setTimeout((function(){try{o._immediateIds&&delete o._immediateIds[n],e.apply(o._parent)}catch(e){o._logError(e)}}),0),this._immediateIds[n]=!0),n},e.prototype.clearImmediate=function(e,t){var o=at(t);this._immediateIds&&this._immediateIds[e]&&(o.clearTimeout(e),delete this._immediateIds[e])},e.prototype.setInterval=function(e,t){var o=this,n=0;return this._isDisposed||(this._intervalIds||(this._intervalIds={}),n=setInterval((function(){try{e.apply(o._parent)}catch(e){o._logError(e)}}),t),this._intervalIds[n]=!0),n},e.prototype.clearInterval=function(e){this._intervalIds&&this._intervalIds[e]&&(clearInterval(e),delete this._intervalIds[e])},e.prototype.throttle=function(e,t,o){var n=this;if(this._isDisposed)return this._noop;var r,i,a=t||0,s=!0,l=!0,c=0,u=null;o&&"boolean"==typeof o.leading&&(s=o.leading),o&&"boolean"==typeof o.trailing&&(l=o.trailing);var d=function(t){var o=Date.now(),p=o-c,h=s?a-p:a;return p>=a&&(!t||s)?(c=o,u&&(n.clearTimeout(u),u=null),r=e.apply(n._parent,i)):null===u&&l&&(u=n.setTimeout(d,h)),r};return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i=e,d(!0)}},e.prototype.debounce=function(e,t,o){var n=this;if(this._isDisposed){var r=function(){};return r.cancel=function(){},r.flush=function(){return null},r.pending=function(){return!1},r}var i,a,s=t||0,l=!1,c=!0,u=null,d=0,p=Date.now(),h=null;o&&"boolean"==typeof o.leading&&(l=o.leading),o&&"boolean"==typeof o.trailing&&(c=o.trailing),o&&"number"==typeof o.maxWait&&!isNaN(o.maxWait)&&(u=o.maxWait);var m=function(e){h&&(n.clearTimeout(h),h=null),p=e},g=function(t){m(t),i=e.apply(n._parent,a)},f=function(e){var t=Date.now(),o=!1;e&&(l&&t-d>=s&&(o=!0),d=t);var r=t-d,a=s-r,m=t-p,v=!1;return null!==u&&(m>=u&&h?v=!0:a=Math.min(a,u-m)),r>=s||v||o?g(t):null!==h&&e||!c||(h=n.setTimeout(f,a)),i},v=function(){return!!h},b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a=e,f(!0)};return b.cancel=function(){v()&&m(Date.now())},b.flush=function(){return v()&&g(Date.now()),i},b.pending=v,b},e.prototype.requestAnimationFrame=function(e,t){var o=this,n=0,r=at(t);if(!this._isDisposed){this._animationFrameIds||(this._animationFrameIds={});var i=function(){try{o._animationFrameIds&&delete o._animationFrameIds[n],e.apply(o._parent)}catch(e){o._logError(e)}};n=r.requestAnimationFrame?r.requestAnimationFrame(i):r.setTimeout(i,0),this._animationFrameIds[n]=!0}return n},e.prototype.cancelAnimationFrame=function(e,t){var o=at(t);this._animationFrameIds&&this._animationFrameIds[e]&&(o.cancelAnimationFrame?o.cancelAnimationFrame(e):o.clearTimeout(e),delete this._animationFrameIds[e])},e.prototype._logError=function(e){this._onErrorHandler&&this._onErrorHandler(e)},e}(),Xi="backward",Qi=function(e){function t(t){var o=e.call(this,t)||this;return o._inputElement=f.createRef(),o._autoFillEnabled=!0,o._isComposing=!1,o._onCompositionStart=function(e){o._isComposing=!0,o._autoFillEnabled=!1},o._onCompositionUpdate=function(){Wi()&&o._updateValue(o._getCurrentInputValue(),!0)},o._onCompositionEnd=function(e){var t=o._getCurrentInputValue();o._tryEnableAutofill(t,o.value,!1,!0),o._isComposing=!1,o._async.setTimeout((function(){o._updateValue(o._getCurrentInputValue(),!1)}),0)},o._onClick=function(){o.value&&""!==o.value&&o._autoFillEnabled&&(o._autoFillEnabled=!1)},o._onKeyDown=function(e){if(o.props.onKeyDown&&o.props.onKeyDown(e),!e.nativeEvent.isComposing)switch(e.which){case Un.backspace:o._autoFillEnabled=!1;break;case Un.left:case Un.right:o._autoFillEnabled&&(o.setState({inputValue:o.props.suggestedDisplayValue||""}),o._autoFillEnabled=!1);break;default:o._autoFillEnabled||-1!==o.props.enableAutofillOnKeyPress.indexOf(e.which)&&(o._autoFillEnabled=!0)}},o._onInputChanged=function(e){var t=o._getCurrentInputValue(e);if(o._isComposing||o._tryEnableAutofill(t,o.value,e.nativeEvent.isComposing),!Wi()||!o._isComposing){var n=e.nativeEvent.isComposing,r=void 0===n?o._isComposing:n;o._updateValue(t,r)}},o._onChanged=function(){},o._updateValue=function(e,t){if(e||e!==o.value){var n=o.props,r=n.onInputChange,i=n.onInputValueChange;r&&(e=(null==r?void 0:r(e,t))||""),o.setState({inputValue:e},(function(){return null==i?void 0:i(e,t)}))}},Ui(o),o._async=new Zi(o),o.state={inputValue:t.defaultVisibleValue||""},o}return u(t,e),t.getDerivedStateFromProps=function(e,t){if(e.updateValueInWillReceiveProps){var o=e.updateValueInWillReceiveProps();if(null!==o&&o!==t.inputValue)return{inputValue:o}}return null},Object.defineProperty(t.prototype,"cursorLocation",{get:function(){if(this._inputElement.current){var e=this._inputElement.current;return"forward"!==e.selectionDirection?e.selectionEnd:e.selectionStart}return-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isValueSelected",{get:function(){return Boolean(this.inputElement&&this.inputElement.selectionStart!==this.inputElement.selectionEnd)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._getControlledValue()||this.state.inputValue||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._inputElement.current?this._inputElement.current.selectionStart:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._inputElement.current?this._inputElement.current.selectionEnd:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inputElement",{get:function(){return this._inputElement.current},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e,t,o){var n=this.props,r=n.suggestedDisplayValue,i=n.shouldSelectFullInputValueInComponentDidUpdate,a=0;if(!n.preventValueSelection)if(this._autoFillEnabled&&this.value&&r&&Ji(r,this.value)){var s=!1;if(i&&(s=i()),s&&this._inputElement.current)this._inputElement.current.setSelectionRange(0,r.length,Xi);else{for(;a<this.value.length&&this.value[a].toLocaleLowerCase()===r[a].toLocaleLowerCase();)a++;a>0&&this._inputElement.current&&this._inputElement.current.setSelectionRange(a,r.length,Xi)}}else this._inputElement.current&&(null===o||this._autoFillEnabled||this._inputElement.current.setSelectionRange(o.start,o.end,o.dir))},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.render=function(){var e=Tr(this.props,hr),t=d(d({},this.props.style),{fontFamily:"inherit"});return f.createElement("input",d({autoCapitalize:"off",autoComplete:"off","aria-autocomplete":"both"},e,{style:t,ref:this._inputElement,value:this._getDisplayValue(),onCompositionStart:this._onCompositionStart,onCompositionUpdate:this._onCompositionUpdate,onCompositionEnd:this._onCompositionEnd,onChange:this._onChanged,onInput:this._onInputChanged,onKeyDown:this._onKeyDown,onClick:this.props.onClick?this.props.onClick:this._onClick,"data-lpignore":!0}))},t.prototype.focus=function(){this._inputElement.current&&this._inputElement.current.focus()},t.prototype.clear=function(){this._autoFillEnabled=!0,this._updateValue("",!1),this._inputElement.current&&this._inputElement.current.setSelectionRange(0,0)},t.prototype.getSnapshotBeforeUpdate=function(){var e,t,o=this._inputElement.current;return o&&o.selectionStart!==this.value.length?{start:null!==(e=o.selectionStart)&&void 0!==e?e:o.value.length,end:null!==(t=o.selectionEnd)&&void 0!==t?t:o.value.length,dir:o.selectionDirection||"backward"}:null},t.prototype._getCurrentInputValue=function(e){return e&&e.target&&e.target.value?e.target.value:this.inputElement&&this.inputElement.value?this.inputElement.value:""},t.prototype._tryEnableAutofill=function(e,t,o,n){!o&&e&&this._inputElement.current&&this._inputElement.current.selectionStart===e.length&&!this._autoFillEnabled&&(e.length>t.length||n)&&(this._autoFillEnabled=!0)},t.prototype._getDisplayValue=function(){return this._autoFillEnabled?(e=this.value,t=this.props.suggestedDisplayValue,o=e,t&&e&&Ji(t,o)&&(o=t),o):this.value;var e,t,o},t.prototype._getControlledValue=function(){var e=this.props.value;return void 0===e||"string"==typeof e?e:(console.warn("props.value of Autofill should be a string, but it is "+e+" with type of "+typeof e),e.toString())},t.defaultProps={enableAutofillOnKeyPress:[Un.down,Un.up]},t}(f.Component);function Ji(e,t){if(!e||!t)return!1;for(var o=0,n=[e,t];o<n.length;o++){var r=n[o];if("string"!=typeof r)throw new Error(Qi.name+' received non-string value "'+r+'" of type '+typeof r+" from either input's value or suggestedDisplayValue")}return 0===e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())}var $i,ea=function(e){function t(t){var o=e.call(this,t)||this;return o.state={isRendered:!1},o}return u(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.delay;this._timeoutId=window.setTimeout((function(){e.setState({isRendered:!0})}),t)},t.prototype.componentWillUnmount=function(){this._timeoutId&&clearTimeout(this._timeoutId)},t.prototype.render=function(){return this.state.isRendered?f.Children.only(this.props.children):null},t.defaultProps={delay:0},t}(f.Component),ta=Jn(),oa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.message,o=e.styles,n=e.as,r=void 0===n?"div":n,i=e.className,a=ta(o,{className:i});return f.createElement(r,d({role:"status",className:a.root},Tr(this.props,Dr,["className"])),f.createElement(ea,null,f.createElement("div",{className:a.screenReaderText},t)))},t.defaultProps={"aria-live":"polite"},t}(f.Component),na=Vn(oa,(function(e){return{root:e.className,screenReaderText:Ro}})),ra={none:0,all:1,inputOnly:2};function ia(e,t,o){void 0===o&&(o=0);for(var n=-1,r=o;e&&r<e.length;r++)if(t(e[r],r)){n=r;break}return n}function aa(e,t){var o=ia(e,t);if(!(o<0))return e[o]}function sa(e,t){for(var o=[],n=0;n<e;n++)o.push(t(n));return o}function la(e,t){return e.reduce((function(e,o,n){return n%t==0?e.push([o]):e[e.length-1].push(o),e}),[])}function ca(e,t){return e.filter((function(e,o){return t!==o}))}function ua(e,t,o){var n=e.slice();return n[o]=t,n}function da(e,t,o){var n=e.slice();return n.splice(t,0,o),n}function pa(e){var t=[];return e.forEach((function(e){return t=t.concat(e)})),t}function ha(e,t){if(e.length!==t.length)return!1;for(var o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}!function(e){e[e.vertical=0]="vertical",e[e.horizontal=1]="horizontal",e[e.bidirectional=2]="bidirectional",e[e.domOrder=3]="domOrder"}($i||($i={}));var ma=function(e){return function(t){for(var o=0,n=e.refs;o<n.length;o++){var r=n[o];"function"==typeof r?r(t):r&&(r.current=t)}}},ga=function(e){var t={refs:[]};return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return t.resolver&&ha(t.refs,e)||(t.resolver=ma(t)),t.refs=e,t.resolver}};function fa(e){return e&&!!e._virtual}function va(e){var t;return e&&fa(e)&&(t=e._virtual.parent),t}function ba(e,t){return void 0===t&&(t=!0),e&&(t&&va(e)||e.parentNode&&e.parentNode)}function ya(e,t){return e&&e!==document.body?t(e)?e:ya(ba(e),t):null}function _a(e,t){var o=ya(e,(function(e){return e.hasAttribute(t)}));return o&&o.getAttribute(t)}function Ca(e,t,o){void 0===o&&(o=!0);var n=!1;if(e&&t)if(o)if(e===t)n=!0;else for(n=!1;t;){var r=ba(t);if(r===e){n=!0;break}t=r}else e.contains&&(n=e.contains(t));return n}function Sa(e,t,o){return Ta(e,t,!0,!1,!1,o)}function xa(e,t,o){return Da(e,t,!0,!1,!0,o)}function ka(e,t,o,n){return void 0===n&&(n=!0),Ta(e,t,n,!1,!1,o,!1,!0)}function wa(e,t,o,n){return void 0===n&&(n=!0),Da(e,t,n,!1,!0,o,!1,!0)}function Ia(e){var t=Ta(e,e,!0,!1,!1,!0);return!!t&&(Aa(t),!0)}function Da(e,t,o,n,r,i,a,s){if(!t||!a&&t===e)return null;var l=Ea(t);if(r&&l&&(i||!Ma(t)&&!Ra(t))){var c=Da(e,t.lastElementChild,!0,!0,!0,i,a,s);if(c){if(s&&Pa(c,!0)||!s)return c;var u=Da(e,c.previousElementSibling,!0,!0,!0,i,a,s);if(u)return u;for(var d=c.parentElement;d&&d!==t;){var p=Da(e,d.previousElementSibling,!0,!0,!0,i,a,s);if(p)return p;d=d.parentElement}}}return o&&l&&Pa(t,s)?t:Da(e,t.previousElementSibling,!0,!0,!0,i,a,s)||(n?null:Da(e,t.parentElement,!0,!1,!1,i,a,s))}function Ta(e,t,o,n,r,i,a,s){if(!t||t===e&&r&&!a)return null;var l=Ea(t);if(o&&l&&Pa(t,s))return t;if(!r&&l&&(i||!Ma(t)&&!Ra(t))){var c=Ta(e,t.firstElementChild,!0,!0,!1,i,a,s);if(c)return c}return t===e?null:Ta(e,t.nextElementSibling,!0,!0,!1,i,a,s)||(n?null:Ta(e,t.parentElement,!1,!1,!0,i,a,s))}function Ea(e){if(!e||!e.getAttribute)return!1;var t=e.getAttribute("data-is-visible");return null!=t?"true"===t:0!==e.offsetHeight||null!==e.offsetParent||!0===e.isVisible}function Pa(e,t){if(!e||e.disabled)return!1;var o=0,n=null;e&&e.getAttribute&&(n=e.getAttribute("tabIndex"))&&(o=parseInt(n,10));var r=e.getAttribute?e.getAttribute("data-is-focusable"):null,i=null!==n&&o>=0,a=!!e&&"false"!==r&&("A"===e.tagName||"BUTTON"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||"true"===r||i);return t?-1!==o&&a:a}function Ma(e){return!!(e&&e.getAttribute&&e.getAttribute("data-focuszone-id"))}function Ra(e){return!(!e||!e.getAttribute||"true"!==e.getAttribute("data-is-sub-focuszone"))}function Na(e){var t=nt(e),o=t&&t.activeElement;return!(!o||!Ca(e,o))}function Ba(e,t){return"true"!==_a(e,t)}var Fa=void 0;function Aa(e){if(e){if(Fa)return void(Fa=e);Fa=e;var t=at(e);t&&t.requestAnimationFrame((function(){Fa&&Fa.focus(),Fa=void 0}))}}function La(e,t){for(var o=e,n=0,r=t;n<r.length;n++){var i=r[n],a=o.children[Math.min(i,o.children.length-1)];if(!a)break;o=a}return Pa(o)&&Ea(o)?o:Ta(e,o,!0)||Da(e,o)}function Ha(e,t){for(var o=[];t&&e&&t!==e;){var n=ba(t,!0);if(null===n)return[];o.unshift(Array.prototype.indexOf.call(n.children,t)),t=n}return o}var Oa=at()||{};void 0===Oa.__currentId__&&(Oa.__currentId__=0);var za,Wa=!1;function Va(e){if(!Wa){var t=C.getInstance();t&&t.onReset&&t.onReset(Ka),Wa=!0}return(void 0===e?"id__":e)+Oa.__currentId__++}function Ka(e){void 0===e&&(e=0),Oa.__currentId__=e}function Ua(e){var t=function(e){var t;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t}("MouseEvents");t.initEvent("click",!0,!0),e.dispatchEvent(t)}var Ga=0,ja=Z({overflow:"hidden !important"}),qa="data-is-scrollable",Ya=function(e,t){if(e){var o=0,n=null;t.on(e,"touchstart",(function(e){1===e.targetTouches.length&&(o=e.targetTouches[0].clientY)}),{passive:!1}),t.on(e,"touchmove",(function(e){if(1===e.targetTouches.length&&(e.stopPropagation(),n)){var t=e.targetTouches[0].clientY-o,r=es(e.target);r&&(n=r),0===n.scrollTop&&t>0&&e.preventDefault(),n.scrollHeight-Math.ceil(n.scrollTop)<=n.clientHeight&&t<0&&e.preventDefault()}}),{passive:!1}),n=e}},Za=function(e,t){e&&t.on(e,"touchmove",(function(e){e.stopPropagation()}),{passive:!1})},Xa=function(e){e.preventDefault()};function Qa(){var e=nt();e&&e.body&&!Ga&&(e.body.classList.add(ja),e.body.addEventListener("touchmove",Xa,{passive:!1,capture:!1})),Ga++}function Ja(){if(Ga>0){var e=nt();e&&e.body&&1===Ga&&(e.body.classList.remove(ja),e.body.removeEventListener("touchmove",Xa)),Ga--}}function $a(){if(void 0===za){var e=document.createElement("div");e.style.setProperty("width","100px"),e.style.setProperty("height","100px"),e.style.setProperty("overflow","scroll"),e.style.setProperty("position","absolute"),e.style.setProperty("top","-9999px"),document.body.appendChild(e),za=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return za}function es(e){for(var t=e,o=nt(e);t&&t!==o.body;){if("true"===t.getAttribute(qa))return t;t=t.parentElement}for(t=e;t&&t!==o.body;){if("false"!==t.getAttribute(qa)){var n=getComputedStyle(t),r=n?n.getPropertyValue("overflow-y"):"";if(r&&("scroll"===r||"auto"===r))return t}t=t.parentElement}return t&&t!==o.body||(t=at(e)),t}var ts="data-portal-element";function os(e){e.setAttribute(ts,"true")}function ns(e,t){var o=ya(e,(function(e){return t===e||e.hasAttribute(ts)}));return null!==o&&o.hasAttribute(ts)}var rs,is,as="data-is-focusable",ss="data-focuszone-id",ls="tabindex",cs="data-no-vertical-wrap",us="data-no-horizontal-wrap",ds=999999999,ps=-999999999,hs={},ms=new Set,gs=["text","number","password","email","tel","url","search"],fs=!1,vs=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._mergedRef=ga(),o._onFocus=function(e){if(!o._portalContainsElement(e.target)){var t,n=o.props,r=n.onActiveElementChanged,i=n.doNotAllowFocusEventToPropagate,a=n.stopFocusPropagation,s=n.onFocusNotification,l=n.onFocus,c=n.shouldFocusInnerElementWhenReceivedFocus,u=n.defaultTabbableElement,d=o._isImmediateDescendantOfZone(e.target);if(d)t=e.target;else for(var p=e.target;p&&p!==o._root.current;){if(Pa(p)&&o._isImmediateDescendantOfZone(p)){t=p;break}p=ba(p,fs)}if(c&&e.target===o._root.current){var h=u&&"function"==typeof u&&u(o._root.current);h&&Pa(h)?(t=h,h.focus()):(o.focus(!0),o._activeElement&&(t=null))}var m=!o._activeElement;t&&t!==o._activeElement&&((d||m)&&o._setFocusAlignment(t,!0,!0),o._activeElement=t,m&&o._updateTabIndexes()),r&&r(o._activeElement,e),(a||i)&&e.stopPropagation(),l?l(e):s&&s()}},o._onBlur=function(){o._setParkedFocus(!1)},o._onMouseDown=function(e){if(!o._portalContainsElement(e.target)&&!o.props.disabled){for(var t=e.target,n=[];t&&t!==o._root.current;)n.push(t),t=ba(t,fs);for(;n.length&&((t=n.pop())&&Pa(t)&&o._setActiveElement(t,!0),!Ma(t)););}},o._onKeyDown=function(e,t){if(!o._portalContainsElement(e.target)){var n=o.props,r=n.direction,i=n.disabled,a=n.isInnerZoneKeystroke,s=n.pagingSupportDisabled,l=n.shouldEnterInnerZone;if(!(i||(o.props.onKeyDown&&o.props.onKeyDown(e),e.isDefaultPrevented()||o._getDocument().activeElement===o._root.current&&o._isInnerZone))){if((l&&l(e)||a&&a(e))&&o._isImmediateDescendantOfZone(e.target)){var c=o._getFirstInnerZone();if(c){if(!c.focus(!0))return}else{if(!Ra(e.target))return;if(!o.focusElement(Ta(e.target,e.target.firstChild,!0)))return}}else{if(e.altKey)return;switch(e.which){case Un.space:if(o._tryInvokeClickForFocusable(e.target))break;return;case Un.left:if(r!==$i.vertical&&(o._preventDefaultWhenHandled(e),o._moveFocusLeft(t)))break;return;case Un.right:if(r!==$i.vertical&&(o._preventDefaultWhenHandled(e),o._moveFocusRight(t)))break;return;case Un.up:if(r!==$i.horizontal&&(o._preventDefaultWhenHandled(e),o._moveFocusUp()))break;return;case Un.down:if(r!==$i.horizontal&&(o._preventDefaultWhenHandled(e),o._moveFocusDown()))break;return;case Un.pageDown:if(!s&&o._moveFocusPaging(!0))break;return;case Un.pageUp:if(!s&&o._moveFocusPaging(!1))break;return;case Un.tab:if(o.props.allowTabKey||o.props.handleTabKey===ra.all||o.props.handleTabKey===ra.inputOnly&&o._isElementInput(e.target)){var u=!1;if(o._processingTabKey=!0,u=r!==$i.vertical&&o._shouldWrapFocus(o._activeElement,us)?(jn(t)?!e.shiftKey:e.shiftKey)?o._moveFocusLeft(t):o._moveFocusRight(t):e.shiftKey?o._moveFocusUp():o._moveFocusDown(),o._processingTabKey=!1,u)break;o.props.shouldResetActiveElementWhenTabFromZone&&(o._activeElement=null)}return;case Un.home:if(o._isContentEditableElement(e.target)||o._isElementInput(e.target)&&!o._shouldInputLoseFocus(e.target,!1))return!1;var d=o._root.current&&o._root.current.firstChild;if(o._root.current&&d&&o.focusElement(Ta(o._root.current,d,!0)))break;return;case Un.end:if(o._isContentEditableElement(e.target)||o._isElementInput(e.target)&&!o._shouldInputLoseFocus(e.target,!0))return!1;var p=o._root.current&&o._root.current.lastChild;if(o._root.current&&o.focusElement(Da(o._root.current,p,!0,!0,!0)))break;return;case Un.enter:if(o._tryInvokeClickForFocusable(e.target))break;return;default:return}}e.preventDefault(),e.stopPropagation()}}},o._getHorizontalDistanceFromCenter=function(e,t,n){var r=o._focusAlignment.left||o._focusAlignment.x||0,i=Math.floor(n.top),a=Math.floor(t.bottom),s=Math.floor(n.bottom),l=Math.floor(t.top);return e&&i>a||!e&&s<l?r>=n.left&&r<=n.left+n.width?0:Math.abs(n.left+n.width/2-r):o._shouldWrapFocus(o._activeElement,cs)?ds:ps},Ui(o),xi("FocusZone",t,{rootProps:void 0,allowTabKey:"handleTabKey",elementType:"as",ariaDescribedBy:"aria-describedby",ariaLabelledBy:"aria-labelledby"}),o._id=Va("FocusZone"),o._focusAlignment={left:0,top:0},o._processingTabKey=!1,o}return u(t,e),t.getOuterZones=function(){return ms.size},t._onKeyDownCapture=function(e){e.which===Un.tab&&ms.forEach((function(e){return e._updateTabIndexes()}))},t.prototype.componentDidMount=function(){var e=this._root.current;if(hs[this._id]=this,e){this._windowElement=at(e);for(var o=ba(e,fs);o&&o!==this._getDocument().body&&1===o.nodeType;){if(Ma(o)){this._isInnerZone=!0;break}o=ba(o,fs)}this._isInnerZone||(ms.add(this),this._windowElement&&1===ms.size&&this._windowElement.addEventListener("keydown",t._onKeyDownCapture,!0)),this._root.current&&this._root.current.addEventListener("blur",this._onBlur,!0),this._updateTabIndexes(),this.props.defaultTabbableElement&&"string"==typeof this.props.defaultTabbableElement?this._activeElement=this._getDocument().querySelector(this.props.defaultTabbableElement):this.props.defaultActiveElement&&(this._activeElement=this._getDocument().querySelector(this.props.defaultActiveElement)),this.props.shouldFocusOnMount&&this.focus()}},t.prototype.componentDidUpdate=function(){var e=this._root.current,t=this._getDocument();if(t&&this._lastIndexPath&&(t.activeElement===t.body||null===t.activeElement||!this.props.preventFocusRestoration&&t.activeElement===e)){var o=La(e,this._lastIndexPath);o?(this._setActiveElement(o,!0),o.focus(),this._setParkedFocus(!1)):this._setParkedFocus(!0)}},t.prototype.componentWillUnmount=function(){delete hs[this._id],this._isInnerZone||(ms.delete(this),this._windowElement&&0===ms.size&&this._windowElement.removeEventListener("keydown",t._onKeyDownCapture,!0)),this._root.current&&this._root.current.removeEventListener("blur",this._onBlur,!0),this._activeElement=null,this._defaultFocusElement=null},t.prototype.render=function(){var e=this,t=this.props,o=t.as,n=t.elementType,r=t.rootProps,i=t.ariaDescribedBy,a=t.ariaLabelledBy,s=t.className,l=Tr(this.props,ir),c=o||n||"div";this._evaluateFocusBeforeRender();var u=Qt();return f.createElement(c,d({"aria-labelledby":a,"aria-describedby":i},l,r,{className:qr((rs||(rs=Z({selectors:{":focus":{outline:"none"}}},"ms-FocusZone")),rs),s),ref:this._mergedRef(this.props.elementRef,this._root),"data-focuszone-id":this._id,onKeyDown:function(t){return e._onKeyDown(t,u)},onFocus:this._onFocus,onMouseDownCapture:this._onMouseDown}),this.props.children)},t.prototype.focus=function(e){if(void 0===e&&(e=!1),this._root.current){if(!e&&"true"===this._root.current.getAttribute(as)&&this._isInnerZone){var t=this._getOwnerZone(this._root.current);if(t!==this._root.current){var o=hs[t.getAttribute(ss)];return!!o&&o.focusElement(this._root.current)}return!1}if(!e&&this._activeElement&&Ca(this._root.current,this._activeElement)&&Pa(this._activeElement))return this._activeElement.focus(),!0;var n=this._root.current.firstChild;return this.focusElement(Ta(this._root.current,n,!0))}return!1},t.prototype.focusLast=function(){if(this._root.current){var e=this._root.current&&this._root.current.lastChild;return this.focusElement(Da(this._root.current,e,!0,!0,!0))}return!1},t.prototype.focusElement=function(e,t){var o=this.props,n=o.onBeforeFocus,r=o.shouldReceiveFocus;return!(r&&!r(e)||n&&!n(e)||!e||(this._setActiveElement(e,t),this._activeElement&&this._activeElement.focus(),0))},t.prototype.setFocusAlignment=function(e){this._focusAlignment=e},t.prototype._evaluateFocusBeforeRender=function(){var e=this._root.current,t=this._getDocument();if(t){var o=t.activeElement;if(o!==e){var n=Ca(e,o,!1);this._lastIndexPath=n?Ha(e,o):void 0}}},t.prototype._setParkedFocus=function(e){var t=this._root.current;t&&this._isParked!==e&&(this._isParked=e,e?(this.props.allowFocusRoot||(this._parkedTabIndex=t.getAttribute("tabindex"),t.setAttribute("tabindex","-1")),t.focus()):this.props.allowFocusRoot||(this._parkedTabIndex?(t.setAttribute("tabindex",this._parkedTabIndex),this._parkedTabIndex=void 0):t.removeAttribute("tabindex")))},t.prototype._setActiveElement=function(e,t){var o=this._activeElement;this._activeElement=e,o&&(Ma(o)&&this._updateTabIndexes(o),o.tabIndex=-1),this._activeElement&&(this._focusAlignment&&!t||this._setFocusAlignment(e,!0,!0),this._activeElement.tabIndex=0)},t.prototype._preventDefaultWhenHandled=function(e){this.props.preventDefaultWhenHandled&&e.preventDefault()},t.prototype._tryInvokeClickForFocusable=function(e){if(e===this._root.current||!this.props.shouldRaiseClicks)return!1;do{if("BUTTON"===e.tagName||"A"===e.tagName||"INPUT"===e.tagName||"TEXTAREA"===e.tagName)return!1;if(this._isImmediateDescendantOfZone(e)&&"true"===e.getAttribute(as)&&"true"!==e.getAttribute("data-disable-click-on-enter"))return Ua(e),!0;e=ba(e,fs)}while(e!==this._root.current);return!1},t.prototype._getFirstInnerZone=function(e){if(!(e=e||this._activeElement||this._root.current))return null;if(Ma(e))return hs[e.getAttribute(ss)];for(var t=e.firstElementChild;t;){if(Ma(t))return hs[t.getAttribute(ss)];var o=this._getFirstInnerZone(t);if(o)return o;t=t.nextElementSibling}return null},t.prototype._moveFocus=function(e,t,o,n){void 0===n&&(n=!0);var r=this._activeElement,i=-1,a=void 0,s=!1,l=this.props.direction===$i.bidirectional;if(!r||!this._root.current)return!1;if(this._isElementInput(r)&&!this._shouldInputLoseFocus(r,e))return!1;var c=l?r.getBoundingClientRect():null;do{if(r=e?Ta(this._root.current,r):Da(this._root.current,r),!l){a=r;break}if(r){var u=t(c,r.getBoundingClientRect());if(-1===u&&-1===i){a=r;break}if(u>-1&&(-1===i||u<i)&&(i=u,a=r),i>=0&&u<0)break}}while(r);if(a&&a!==this._activeElement)s=!0,this.focusElement(a);else if(this.props.isCircularNavigation&&n)return e?this.focusElement(Ta(this._root.current,this._root.current.firstElementChild,!0)):this.focusElement(Da(this._root.current,this._root.current.lastElementChild,!0,!0,!0));return s},t.prototype._moveFocusDown=function(){var e=this,t=-1,o=this._focusAlignment.left||this._focusAlignment.x||0;return!!this._moveFocus(!0,(function(n,r){var i=-1,a=Math.floor(r.top),s=Math.floor(n.bottom);return a<s?e._shouldWrapFocus(e._activeElement,cs)?ds:ps:((-1===t&&a>=s||a===t)&&(t=a,i=o>=r.left&&o<=r.left+r.width?0:Math.abs(r.left+r.width/2-o)),i)}))&&(this._setFocusAlignment(this._activeElement,!1,!0),!0)},t.prototype._moveFocusUp=function(){var e=this,t=-1,o=this._focusAlignment.left||this._focusAlignment.x||0;return!!this._moveFocus(!1,(function(n,r){var i=-1,a=Math.floor(r.bottom),s=Math.floor(r.top),l=Math.floor(n.top);return a>l?e._shouldWrapFocus(e._activeElement,cs)?ds:ps:((-1===t&&a<=l||s===t)&&(t=s,i=o>=r.left&&o<=r.left+r.width?0:Math.abs(r.left+r.width/2-o)),i)}))&&(this._setFocusAlignment(this._activeElement,!1,!0),!0)},t.prototype._moveFocusLeft=function(e){var t=this,o=this._shouldWrapFocus(this._activeElement,us);return!!this._moveFocus(jn(e),(function(n,r){var i=-1;return(jn(e)?parseFloat(r.top.toFixed(3))<parseFloat(n.bottom.toFixed(3)):parseFloat(r.bottom.toFixed(3))>parseFloat(n.top.toFixed(3)))&&r.right<=n.right&&t.props.direction!==$i.vertical?i=n.right-r.right:o||(i=ps),i}),void 0,o)&&(this._setFocusAlignment(this._activeElement,!0,!1),!0)},t.prototype._moveFocusRight=function(e){var t=this,o=this._shouldWrapFocus(this._activeElement,us);return!!this._moveFocus(!jn(e),(function(n,r){var i=-1;return(jn(e)?parseFloat(r.bottom.toFixed(3))>parseFloat(n.top.toFixed(3)):parseFloat(r.top.toFixed(3))<parseFloat(n.bottom.toFixed(3)))&&r.left>=n.left&&t.props.direction!==$i.vertical?i=r.left-n.left:o||(i=ps),i}),void 0,o)&&(this._setFocusAlignment(this._activeElement,!0,!1),!0)},t.prototype._moveFocusPaging=function(e,t){void 0===t&&(t=!0);var o=this._activeElement;if(!o||!this._root.current)return!1;if(this._isElementInput(o)&&!this._shouldInputLoseFocus(o,e))return!1;var n=es(o);if(!n)return!1;var r=-1,i=void 0,a=-1,s=-1,l=n.clientHeight,c=o.getBoundingClientRect();do{if(o=e?Ta(this._root.current,o):Da(this._root.current,o)){var u=o.getBoundingClientRect(),d=Math.floor(u.top),p=Math.floor(c.bottom),h=Math.floor(u.bottom),m=Math.floor(c.top),g=this._getHorizontalDistanceFromCenter(e,c,u);if(e&&d>p+l||!e&&h<m-l)break;g>-1&&(e&&d>a?(a=d,r=g,i=o):!e&&h<s?(s=h,r=g,i=o):(-1===r||g<=r)&&(r=g,i=o))}}while(o);var f=!1;if(i&&i!==this._activeElement)f=!0,this.focusElement(i),this._setFocusAlignment(i,!1,!0);else if(this.props.isCircularNavigation&&t)return e?this.focusElement(Ta(this._root.current,this._root.current.firstElementChild,!0)):this.focusElement(Da(this._root.current,this._root.current.lastElementChild,!0,!0,!0));return f},t.prototype._setFocusAlignment=function(e,t,o){if(this.props.direction===$i.bidirectional&&(!this._focusAlignment||t||o)){var n=e.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2;this._focusAlignment||(this._focusAlignment={left:r,top:i}),t&&(this._focusAlignment.left=r),o&&(this._focusAlignment.top=i)}},t.prototype._isImmediateDescendantOfZone=function(e){return this._getOwnerZone(e)===this._root.current},t.prototype._getOwnerZone=function(e){for(var t=ba(e,fs);t&&t!==this._root.current&&t!==this._getDocument().body;){if(Ma(t))return t;t=ba(t,fs)}return t},t.prototype._updateTabIndexes=function(e){!this._activeElement&&this.props.defaultTabbableElement&&"function"==typeof this.props.defaultTabbableElement&&(this._activeElement=this.props.defaultTabbableElement(this._root.current)),!e&&this._root.current&&(this._defaultFocusElement=null,e=this._root.current,this._activeElement&&!Ca(e,this._activeElement)&&(this._activeElement=null)),this._activeElement&&!Pa(this._activeElement)&&(this._activeElement=null);for(var t=e&&e.children,o=0;t&&o<t.length;o++){var n=t[o];Ma(n)?"true"===n.getAttribute(as)&&(this._isInnerZone||(this._activeElement||this._defaultFocusElement)&&this._activeElement!==n?"-1"!==n.getAttribute(ls)&&n.setAttribute(ls,"-1"):(this._defaultFocusElement=n,"0"!==n.getAttribute(ls)&&n.setAttribute(ls,"0"))):(n.getAttribute&&"false"===n.getAttribute(as)&&n.setAttribute(ls,"-1"),Pa(n)?this.props.disabled?n.setAttribute(ls,"-1"):this._isInnerZone||(this._activeElement||this._defaultFocusElement)&&this._activeElement!==n?"-1"!==n.getAttribute(ls)&&n.setAttribute(ls,"-1"):(this._defaultFocusElement=n,"0"!==n.getAttribute(ls)&&n.setAttribute(ls,"0")):"svg"===n.tagName&&"false"!==n.getAttribute("focusable")&&n.setAttribute("focusable","false")),this._updateTabIndexes(n)}},t.prototype._isContentEditableElement=function(e){return e&&"true"===e.getAttribute("contenteditable")},t.prototype._isElementInput=function(e){return!(!e||!e.tagName||"input"!==e.tagName.toLowerCase()&&"textarea"!==e.tagName.toLowerCase())},t.prototype._shouldInputLoseFocus=function(e,t){if(!this._processingTabKey&&e&&e.type&&gs.indexOf(e.type.toLowerCase())>-1){var o=e.selectionStart,n=o!==e.selectionEnd,r=e.value,i=e.readOnly;if(n||o>0&&!t&&!i||o!==r.length&&t&&!i||this.props.handleTabKey&&(!this.props.shouldInputLoseFocusOnArrowKey||!this.props.shouldInputLoseFocusOnArrowKey(e)))return!1}return!0},t.prototype._shouldWrapFocus=function(e,t){return!this.props.checkForNoWrap||Ba(e,t)},t.prototype._portalContainsElement=function(e){return e&&!!this._root.current&&ns(e,this._root.current)},t.prototype._getDocument=function(){return nt(this._root.current)},t.defaultProps={isCircularNavigation:!1,direction:$i.bidirectional,shouldRaiseClicks:!0},t}(f.Component),bs=((is={})[Un.up]=1,is[Un.down]=1,is[Un.left]=1,is[Un.right]=1,is[Un.home]=1,is[Un.end]=1,is[Un.tab]=1,is[Un.pageUp]=1,is[Un.pageDown]=1,is);function ys(e){return!!bs[e]}function _s(e){bs[e]=1}var Cs=new WeakMap;function Ss(e,t){var o,n=Cs.get(e);return o=n?n+t:1,Cs.set(e,o),o}function xs(e){f.useEffect((function(){var t,o=at(null==e?void 0:e.current);if(o&&!0!==(null===(t=o.FabricConfig)||void 0===t?void 0:t.disableFocusRects)){var n=Ss(o,1);return n<=1&&(o.addEventListener("mousedown",ws,!0),o.addEventListener("pointerdown",Is,!0),o.addEventListener("keydown",Ds,!0)),function(){var e;o&&!0!==(null===(e=o.FabricConfig)||void 0===e?void 0:e.disableFocusRects)&&0===(n=Ss(o,-1))&&(o.removeEventListener("mousedown",ws,!0),o.removeEventListener("pointerdown",Is,!0),o.removeEventListener("keydown",Ds,!0))}}}),[e])}var ks=function(e){return xs(e.rootRef),null};function ws(e){Do(!1,e.target)}function Is(e){"mouse"!==e.pointerType&&Do(!1,e.target)}function Ds(e){ys(e.which)&&Do(!0,e.target)}var Ts=Jn(),Es=function(e,t){t.as;var o=t.disabled,n=t.target,r=t.href,i=(t.theme,t.getStyles,t.styles,t.componentRef,t.underline,p(t,["as","disabled","target","href","theme","getStyles","styles","componentRef","underline"]));return"string"==typeof e?"a"===e?d({target:n,href:o?void 0:r},i):"button"===e?d({type:"button",disabled:o},i):d(d({},i),{disabled:o}):d({target:n,href:r,disabled:o},i)},Ps=f.forwardRef((function(e,t){var o=function(e,t){var o=e.as,n=e.className,r=e.disabled,i=e.href,a=e.onClick,s=e.styles,l=e.theme,c=e.underline,u=f.useRef(null),p=Or(u,t);(function(e,t){f.useImperativeHandle(e.componentRef,(function(){return{focus:function(){t.current&&t.current.focus()}}}),[t])})(e,u),xs(u);var h=Ts(s,{className:n,isButton:!i,isDisabled:r,isUnderlined:c,theme:l}),m=o||(i?"a":"button");return{state:{},slots:{root:m},slotProps:{root:d(d({},Es(m,e)),{"aria-disabled":r,className:h.root,onClick:function(e){r?e.preventDefault():a&&a(e)},ref:p})}}}(e,t),n=o.slots,r=o.slotProps;return f.createElement(n.root,d({},r.root))}));Ps.displayName="LinkBase";var Ms={root:"ms-Link"},Rs=Vn(Ps,(function(e){var t,o,n,r,i,a,s=e.className,l=e.isButton,c=e.isDisabled,u=e.isUnderlined,d=e.theme,p=d.semanticColors,h=p.link,m=p.linkHovered,g=p.disabledText,f=p.focusBorder,v=Qo(Ms,d);return{root:[v.root,d.fonts.medium,{color:h,outline:"none",fontSize:"inherit",fontWeight:"inherit",textDecoration:u?"underline":"none",selectors:(t={".ms-Fabric--isFocusVisible &:focus":{boxShadow:"0 0 0 1px "+f+" inset",outline:"1px auto "+f,selectors:(o={},o[ro]={outline:"1px solid WindowText"},o)}},t[ro]={borderBottom:"none"},t)},l&&{background:"none",backgroundColor:"transparent",border:"none",cursor:"pointer",display:"inline",margin:0,overflow:"inherit",padding:0,textAlign:"left",textOverflow:"inherit",userSelect:"text",borderBottom:"1px solid transparent",selectors:(n={},n[ro]={color:"LinkText",forcedColorAdjust:"none"},n)},!l&&{selectors:(r={},r[ro]={MsHighContrastAdjust:"auto",forcedColorAdjust:"auto"},r)},c&&["is-disabled",{color:g,cursor:"default"},{selectors:{"&:link, &:visited":{pointerEvents:"none"}}}],!c&&{selectors:{"&:active, &:hover, &:active:hover":{color:m,textDecoration:"underline",selectors:(i={},i[ro]={color:"LinkText"},i)},"&:focus":{color:h,selectors:(a={},a[ro]={color:"LinkText"},a)}}},v.root,s]}}),void 0,{scope:"Link"});function Ns(e,t){for(var o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||t[o]!==e[o]))return!1;for(var o in t)if(t.hasOwnProperty(o)&&!e.hasOwnProperty(o))return!1;return!0}function Bs(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return Fs.apply(this,[null,e].concat(t))}function Fs(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];t=t||{};for(var r=0,i=o;r<i.length;r++){var a=i[r];if(a)for(var s in a)!a.hasOwnProperty(s)||e&&!e(s)||(t[s]=a[s])}return t}function As(e,t){return Object.keys(e).map((function(o){if(String(Number(o))!==o)return t(o,e[o])})).filter((function(e){return!!e}))}function Ls(e){return Object.keys(e).reduce((function(t,o){return t.push(e[o]),t}),[])}function Hs(e,t){var o={};for(var n in e)-1===t.indexOf(n)&&e.hasOwnProperty(n)&&(o[n]=e[n]);return o}var Os=function(){function e(t){this._id=e._uniqueId++,this._parent=t,this._eventRecords=[]}return e.raise=function(t,o,n,r){var i;if(e._isElement(t)){if("undefined"!=typeof document&&document.createEvent){var a=document.createEvent("HTMLEvents");a.initEvent(o,r||!1,!0),Bs(a,n),i=t.dispatchEvent(a)}else if("undefined"!=typeof document&&document.createEventObject){var s=document.createEventObject(n);t.fireEvent("on"+o,s)}}else for(;t&&!1!==i;){var l=t.__events__,c=l?l[o]:null;if(c)for(var u in c)if(c.hasOwnProperty(u))for(var d=c[u],p=0;!1!==i&&p<d.length;p++){var h=d[p];h.objectCallback&&(i=h.objectCallback.call(h.parent,n))}t=r?t.parent:null}return i},e.isObserved=function(e,t){var o=e&&e.__events__;return!!o&&!!o[t]},e.isDeclared=function(e,t){var o=e&&e.__declaredEvents;return!!o&&!!o[t]},e.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},e._isElement=function(e){return!!e&&(!!e.addEventListener||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement)},e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this.off(),this._parent=null)},e.prototype.onAll=function(e,t,o){for(var n in t)t.hasOwnProperty(n)&&this.on(e,n,t[n],o)},e.prototype.on=function(t,o,n,r){var i=this;if(o.indexOf(",")>-1)for(var a=o.split(/[ ,]+/),s=0;s<a.length;s++)this.on(t,a[s],n,r);else{var l=this._parent,c={target:t,eventName:o,parent:l,callback:n,options:r};if((a=t.__events__=t.__events__||{})[o]=a[o]||{count:0},a[o][this._id]=a[o][this._id]||[],a[o][this._id].push(c),a[o].count++,e._isElement(t)){var u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!i._isDisposed){var o;try{if(!1===(o=n.apply(l,e))&&e[0]){var r=e[0];r.preventDefault&&r.preventDefault(),r.stopPropagation&&r.stopPropagation(),r.cancelBubble=!0}}catch(r){}return o}};c.elementCallback=u,t.addEventListener?t.addEventListener(o,u,r):t.attachEvent&&t.attachEvent("on"+o,u)}else c.objectCallback=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!i._isDisposed)return n.apply(l,e)};this._eventRecords.push(c)}},e.prototype.off=function(e,t,o,n){for(var r=0;r<this._eventRecords.length;r++){var i=this._eventRecords[r];if(!(e&&e!==i.target||t&&t!==i.eventName||o&&o!==i.callback||"boolean"==typeof n&&n!==i.options)){var a=i.target.__events__,s=a[i.eventName],l=s?s[this._id]:null;l&&(1!==l.length&&o?(s.count--,l.splice(l.indexOf(i),1)):(s.count-=l.length,delete a[i.eventName][this._id]),s.count||delete a[i.eventName]),i.elementCallback&&(i.target.removeEventListener?i.target.removeEventListener(i.eventName,i.elementCallback,i.options):i.target.detachEvent&&i.target.detachEvent("on"+i.eventName,i.elementCallback)),this._eventRecords.splice(r--,1)}}},e.prototype.raise=function(t,o,n){return e.raise(this._parent,t,o,n)},e.prototype.declare=function(e){var t=this._parent.__declaredEvents=this._parent.__declaredEvents||{};if("string"==typeof e)t[e]=!0;else for(var o=0;o<e.length;o++)t[e[o]]=!0},e._uniqueId=0,e}(),zs=function(e){function t(o,n){var r=e.call(this,o,n)||this;return function(e,t,o){for(var n=0,r=o.length;n<r;n++)Ws(e,t,o[n])}(r,t.prototype,["componentDidMount","shouldComponentUpdate","getSnapshotBeforeUpdate","render","componentDidUpdate","componentWillUnmount"]),r}return u(t,e),t.prototype.componentDidUpdate=function(e,t){this._updateComponentRef(e,this.props)},t.prototype.componentDidMount=function(){this._setComponentRef(this.props.componentRef,this)},t.prototype.componentWillUnmount=function(){if(this._setComponentRef(this.props.componentRef,null),this.__disposables){for(var e=0,t=this._disposables.length;e<t;e++){var o=this.__disposables[e];o.dispose&&o.dispose()}this.__disposables=null}},Object.defineProperty(t.prototype,"className",{get:function(){if(!this.__className){var e=/function (.{1,})\(/.exec(this.constructor.toString());this.__className=e&&e.length>1?e[1]:""}return this.__className},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_disposables",{get:function(){return this.__disposables||(this.__disposables=[]),this.__disposables},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_async",{get:function(){return this.__async||(this.__async=new Zi(this),this._disposables.push(this.__async)),this.__async},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_events",{get:function(){return this.__events||(this.__events=new Os(this),this._disposables.push(this.__events)),this.__events},enumerable:!1,configurable:!0}),t.prototype._resolveRef=function(e){var t=this;return this.__resolves||(this.__resolves={}),this.__resolves[e]||(this.__resolves[e]=function(o){return t[e]=o}),this.__resolves[e]},t.prototype._updateComponentRef=function(e,t){void 0===t&&(t={}),e&&t&&e.componentRef!==t.componentRef&&(this._setComponentRef(e.componentRef,null),this._setComponentRef(t.componentRef,this))},t.prototype._warnDeprecations=function(e){xi(this.className,this.props,e)},t.prototype._warnMutuallyExclusive=function(e){ki(this.className,this.props,e)},t.prototype._warnConditionallyRequiredProps=function(e,t,o){Si(this.className,this.props,e,t,o)},t.prototype._setComponentRef=function(e,t){!this._skipComponentRefResolution&&e&&("function"==typeof e&&e(t),"object"==typeof e&&(e.current=t))},t}(f.Component);function Ws(e,t,o){var n=e[o],r=t[o];(n||r)&&(e[o]=function(){for(var e,t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return r&&(e=r.apply(this,t)),n!==r&&(e=n.apply(this,t)),e})}function Vs(){return null}function Ks(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=e.filter((function(e){return e})).join(" ").trim();return""===o?void 0:o}var Us,Gs,js=function(e){var t=e.className,o=e.imageProps,n=Tr(e,ir,["aria-label","aria-labelledby","title","aria-describedby"]),r=o.alt||e["aria-label"],i=r||e["aria-labelledby"]||e.title||o["aria-label"]||o["aria-labelledby"]||o.title,a={"aria-labelledby":e["aria-labelledby"],"aria-describedby":e["aria-describedby"],title:e.title},s=i?{}:{"aria-hidden":!0};return f.createElement("div",d({},s,n,{className:qr(jr,Gr.root,Gr.image,t)}),f.createElement(Ur,d({},a,o,{alt:i?r:""})))},qs={topLeftEdge:0,topCenter:1,topRightEdge:2,topAutoEdge:3,bottomLeftEdge:4,bottomCenter:5,bottomRightEdge:6,bottomAutoEdge:7,leftTopEdge:8,leftCenter:9,leftBottomEdge:10,rightTopEdge:11,rightCenter:12,rightBottomEdge:13};function Ys(e){if(void 0===Gs||e){var t=at(),o=t&&t.navigator.userAgent;Gs=!!o&&-1!==o.indexOf("Macintosh")}return!!Gs}!function(e){e[e.Normal=0]="Normal",e[e.Divider=1]="Divider",e[e.Header=2]="Header",e[e.Section=3]="Section"}(Us||(Us={}));var Zs,Xs,Qs=function(){return!!(window&&window.navigator&&window.navigator.userAgent)&&/iPad|iPhone|iPod/i.test(window.navigator.userAgent)};function Js(e){return e.canCheck?!(!e.isChecked&&!e.checked):"boolean"==typeof e.isChecked?e.isChecked:"boolean"==typeof e.checked?e.checked:null}function $s(e){return!(!e.subMenuProps&&!e.items)}function el(e){return!(!e.isDisabled&&!e.disabled)}function tl(e){return null!==Js(e)?"menuitemcheckbox":"menuitem"}function ol(e,t,o,n){return e.addEventListener(t,o,n),function(){return e.removeEventListener(t,o,n)}}!function(e){e[e.top=1]="top",e[e.bottom=-1]="bottom",e[e.left=2]="left",e[e.right=-2]="right"}(Zs||(Zs={})),function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.start=2]="start",e[e.end=3]="end"}(Xs||(Xs={}));var nl,rl=function(){function e(e,t,o,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===o&&(o=0),void 0===n&&(n=0),this.top=o,this.bottom=n,this.left=e,this.right=t}return Object.defineProperty(e.prototype,"width",{get:function(){return this.right-this.left},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.bottom-this.top},enumerable:!1,configurable:!0}),e.prototype.equals=function(e){return parseFloat(this.top.toFixed(4))===parseFloat(e.top.toFixed(4))&&parseFloat(this.bottom.toFixed(4))===parseFloat(e.bottom.toFixed(4))&&parseFloat(this.left.toFixed(4))===parseFloat(e.left.toFixed(4))&&parseFloat(this.right.toFixed(4))===parseFloat(e.right.toFixed(4))},e}();function il(e,t,o){return{targetEdge:e,alignmentEdge:t,isAuto:o}}var al=((nl={})[qs.topLeftEdge]=il(Zs.top,Zs.left),nl[qs.topCenter]=il(Zs.top),nl[qs.topRightEdge]=il(Zs.top,Zs.right),nl[qs.topAutoEdge]=il(Zs.top,void 0,!0),nl[qs.bottomLeftEdge]=il(Zs.bottom,Zs.left),nl[qs.bottomCenter]=il(Zs.bottom),nl[qs.bottomRightEdge]=il(Zs.bottom,Zs.right),nl[qs.bottomAutoEdge]=il(Zs.bottom,void 0,!0),nl[qs.leftTopEdge]=il(Zs.left,Zs.top),nl[qs.leftCenter]=il(Zs.left),nl[qs.leftBottomEdge]=il(Zs.left,Zs.bottom),nl[qs.rightTopEdge]=il(Zs.right,Zs.top),nl[qs.rightCenter]=il(Zs.right),nl[qs.rightBottomEdge]=il(Zs.right,Zs.bottom),nl);function sl(e,t){return!(e.top<t.top||e.bottom>t.bottom||e.left<t.left||e.right>t.right)}function ll(e,t){var o=[];return e.top<t.top&&o.push(Zs.top),e.bottom>t.bottom&&o.push(Zs.bottom),e.left<t.left&&o.push(Zs.left),e.right>t.right&&o.push(Zs.right),o}function cl(e,t){return e[Zs[t]]}function ul(e,t,o){return e[Zs[t]]=o,e}function dl(e,t){var o=Cl(t);return(cl(e,o.positiveEdge)+cl(e,o.negativeEdge))/2}function pl(e,t){return e>0?t:-1*t}function hl(e,t){return pl(e,cl(t,e))}function ml(e,t,o){return pl(o,cl(e,o)-cl(t,o))}function gl(e,t,o){var n=cl(e,t)-o;return e=ul(e,t,o),ul(e,-1*t,cl(e,-1*t)-n)}function fl(e,t,o,n){return void 0===n&&(n=0),gl(e,o,cl(t,o)+pl(o,n))}function vl(e,t,o){return hl(o,e)>hl(o,t)}function bl(e,t,o){for(var n=0,r=e;n<r.length;n++){var i=r[n];t.elementRectangle=fl(t.elementRectangle,o,i)}return t}function yl(e,t,o){var n=Cl(t).positiveEdge;return gl(e,n,o-(dl(e,t)-cl(e,n)))}function _l(e,t,o,n,r){var i;void 0===n&&(n=0);var a=o.alignmentEdge,s=o.targetEdge,l=r?s:-1*s;return i=r?fl(e,t,s,n):function(e,t,o,n){void 0===n&&(n=0);var r=pl(-1*o,n);return gl(e,-1*o,cl(t,o)+r)}(e,t,s,n),i=a?fl(i,t,a):yl(i,l,dl(t,s))}function Cl(e){return e===Zs.top||e===Zs.bottom?{positiveEdge:Zs.left,negativeEdge:Zs.right}:{positiveEdge:Zs.top,negativeEdge:Zs.bottom}}function Sl(e,t,o){return o&&Math.abs(ml(e,o,t))>Math.abs(ml(e,o,-1*t))?-1*t:t}function xl(e,t,o){var n=dl(t,e),r=dl(o,e),i=Cl(e),a=i.positiveEdge,s=i.negativeEdge;return n<=r?a:s}function kl(e,t,o,n,r,i,a){var s=_l(e,t,n,r,a);return sl(s,o)?{elementRectangle:s,targetEdge:n.targetEdge,alignmentEdge:n.alignmentEdge}:function(e,t,o,n,r,i,a){void 0===r&&(r=0);var s=n.alignmentEdge,l=n.alignTargetEdge,c={elementRectangle:e,targetEdge:n.targetEdge,alignmentEdge:s};i||a||(c=function(e,t,o,n,r){void 0===r&&(r=0);var i=[Zs.left,Zs.right,Zs.bottom,Zs.top];jn()&&(i[0]*=-1,i[1]*=-1);for(var a=e,s=n.targetEdge,l=n.alignmentEdge,c=0;c<4;c++){if(vl(a,o,s))return{elementRectangle:a,targetEdge:s,alignmentEdge:l};i.splice(i.indexOf(s),1),i.length>0&&(i.indexOf(-1*s)>-1?s*=-1:(l=s,s=i.slice(-1)[0]),a=_l(e,t,{targetEdge:s,alignmentEdge:l},r))}return{elementRectangle:e,targetEdge:n.targetEdge,alignmentEdge:n.alignmentEdge}}(e,t,o,n,r));var u=ll(e,o);if(l){if(c.alignmentEdge&&u.indexOf(-1*c.alignmentEdge)>-1){var d=function(e,t,o,n){var r=e.alignmentEdge,i=e.targetEdge,a=-1*r;return{elementRectangle:_l(e.elementRectangle,t,{targetEdge:i,alignmentEdge:a},o,n),targetEdge:i,alignmentEdge:a}}(c,t,r,a);if(sl(d.elementRectangle,o))return d;c=bl(ll(d.elementRectangle,o),c,o)}}else c=bl(u,c,o);return c}(e,t,o,n,r,i,a)}function wl(e){var t=e.getBoundingClientRect();return new rl(t.left,t.right,t.top,t.bottom)}function Il(e){return new rl(e.left,e.right,e.top,e.bottom)}function Dl(e,t,o,n){var r=e.gapSpace?e.gapSpace:0,i=function(e,t){var o;if(t){if(t.preventDefault){var n=t;o=new rl(n.clientX,n.clientX,n.clientY,n.clientY)}else if(t.getBoundingClientRect)o=wl(t);else{var r=t,i=r.left||r.x,a=r.top||r.y,s=r.right||i,l=r.bottom||a;o=new rl(i,s,a,l)}if(!sl(o,e))for(var c=0,u=ll(o,e);c<u.length;c++){var d=u[c];o[Zs[d]]=e[Zs[d]]}}else o=new rl(0,0,0,0);return o}(o,e.target),a=function(e,t,o,n,r){return e.isAuto&&(e.alignmentEdge=xl(e.targetEdge,t,o)),e.alignTargetEdge=r,e}(function(e,t,o){if(void 0===e&&(e=qs.bottomAutoEdge),o)return{alignmentEdge:o.alignmentEdge,isAuto:o.isAuto,targetEdge:o.targetEdge};var n=d({},al[e]);return jn()?(n.alignmentEdge&&n.alignmentEdge%2==0&&(n.alignmentEdge=-1*n.alignmentEdge),void 0!==t?al[t]:n):n}(e.directionalHint,e.directionalHintForRTL,n),i,o,e.coverTarget,e.alignTargetEdge),s=kl(wl(t),i,o,a,r,e.directionalHintFixed,e.coverTarget);return d(d({},s),{targetRectangle:i})}function Tl(e,t,o,n,r){return{elementPosition:function(e,t,o,n,r,i,a){var s={},l=wl(t),c=i?o:-1*o,u=Zs[c],d=r||Cl(o).positiveEdge;return a||(d=Sl(e,d,n)),s[u]=ml(e,l,c),s[Zs[d]]=ml(e,l,d),s}(e.elementRectangle,t,e.targetEdge,o,e.alignmentEdge,n,r),targetEdge:e.targetEdge,alignmentEdge:e.alignmentEdge}}function El(e,t,o,n,r){var i=e.isBeakVisible&&e.beakWidth||0,a=function(e){return Math.sqrt(e*e*2)}(i)/2+(e.gapSpace?e.gapSpace:0),s=e;s.gapSpace=a;var l,c,u,p,h,m,g,f=e.bounds?Il(e.bounds):new rl(0,window.innerWidth-$a(),0,window.innerHeight),v=Dl(s,o,f,n),b=(l=v,c=function(e,t){var o=t.targetRectangle,n=Cl(t.targetEdge),r=n.positiveEdge,i=n.negativeEdge,a=dl(o,t.targetEdge),s=new rl(e/2,t.elementRectangle.width-e/2,e/2,t.elementRectangle.height-e/2),l=new rl(0,e,0,e);return vl(l=yl(l=gl(l,-1*t.targetEdge,-e/2),-1*t.targetEdge,a-hl(r,t.elementRectangle)),s,r)?vl(l,s,i)||(l=fl(l,s,i)):l=fl(l,s,r),l}(i,v),u=f,p=-1*l.targetEdge,h=new rl(0,l.elementRectangle.width,0,l.elementRectangle.height),m={},g=Sl(l.elementRectangle,l.alignmentEdge?l.alignmentEdge:Cl(p).positiveEdge,u),m[Zs[p]]=cl(c,p),m[Zs[g]]=ml(c,h,g),{elementPosition:d({},m),closestEdge:xl(l.targetEdge,c,h),targetEdge:p});return d(d({},Tl(v,t,f,e.coverTarget,r)),{beakPosition:b})}function Pl(e,t,o,n){return function(e,t,o,n){var r=e.bounds?Il(e.bounds):new rl(0,window.innerWidth-$a(),0,window.innerHeight);return Tl(Dl(e,o,r,n),t,r,e.coverTarget)}(e,t,o,n)}function Ml(e,t,o,n){return El(e,t,o,n)}function Rl(e,t,o,n){return function(e,t,o,n){return El(e,t,o,n,!0)}(e,t,o,n)}function Nl(e,t,o,n,r){void 0===o&&(o=0);var i=e,a=e,s=e,l=n?Il(n):new rl(0,window.innerWidth-$a(),0,window.innerHeight),c=s.left||s.x,u=s.top||s.y,d=s.right||c,p=s.bottom||u;return function(e,t,o,n,r){var i,a=al[t],s=r?-1*a.targetEdge:a.targetEdge;return(i=s===Zs.top?cl(e,a.targetEdge)-n.top-o:s===Zs.bottom?n.bottom-cl(e,a.targetEdge)-o:n.bottom-e.top-o)>0?i:n.height}(i.stopPropagation?new rl(i.clientX,i.clientX,i.clientY,i.clientY):void 0!==c&&void 0!==u?new rl(c,d,u,p):wl(a),t,o,l,r)}function Bl(e){return-1*e}function Fl(e,t){return function(e,t){var o=void 0;if(t.getWindowSegments&&(o=t.getWindowSegments()),void 0===o||o.length<=1)return{top:0,left:0,right:t.innerWidth,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight};var n=0,r=0;if(null!==e&&e.getBoundingClientRect){var i=e.getBoundingClientRect();n=(i.left+i.right)/2,r=(i.top+i.bottom)/2}else null!==e&&(n=e.left||e.x,r=e.top||e.y);for(var a={top:0,left:0,right:0,bottom:0,width:0,height:0},s=0,l=o;s<l.length;s++){var c=l[s];n&&c.left<=n&&c.right>=n&&r&&c.top<=r&&c.bottom>=r&&(a={top:c.top,left:c.left,right:c.right,bottom:c.bottom,width:c.width,height:c.height})}return a}(e,t)}function Al(){var e=Ei((function(){return new Zi}));return f.useEffect((function(){return function(){return e.dispose()}}),[e]),e}function Ll(e,t,o,n){var r=f.useRef(o);r.current=o,f.useEffect((function(){var o=e&&"current"in e?e.current:e;if(o)return ol(o,t,(function(e){return r.current(e)}),n)}),[e,t,n])}var Hl=f.createContext({window:"object"==typeof window?window:void 0}),Ol=function(){return f.useContext(Hl).window},zl=function(){var e;return null===(e=f.useContext(Hl).window)||void 0===e?void 0:e.document},Wl=function(e){return f.createElement(Hl.Provider,{value:e},e.children)};function Vl(e){var t=e.originalElement,o=e.containsFocus;t&&o&&t!==at()&&setTimeout((function(){var e;null===(e=t.focus)||void 0===e||e.call(t)}),0)}var Kl,Ul=f.forwardRef((function(e,t){e=d({shouldRestoreFocus:!0},e);var o=f.useRef(),n=Or(o,t);!function(e){var t=e["aria-modal"];f.useEffect((function(){var e=nt();if(t&&e){for(var o=e.body.children,n=[],r=0;r<o.length-1;r++)n.push(o[r]);return(n=n.filter((function(e){return"TEMPLATE"!==e.tagName&&"SCRIPT"!==e.tagName&&"STYLE"!==e.tagName&&!e.hasAttribute("aria-hidden")}))).forEach((function(e){return e.setAttribute("aria-hidden","true")})),function(){return n.forEach((function(e){return e.removeAttribute("aria-hidden")}))}}}),[t])}(e),function(e,t){var o=e.onRestoreFocus,n=void 0===o?Vl:o,r=f.useRef(),i=f.useRef(!1);f.useEffect((function(){return r.current=nt().activeElement,Na(t.current)&&(i.current=!0),function(){var e;null==n||n({originalElement:r.current,containsFocus:i.current,documentContainsFocus:(null===(e=nt())||void 0===e?void 0:e.hasFocus())||!1}),r.current=void 0}}),[]),Ll(t,"focus",f.useCallback((function(){i.current=!0}),[]),!0),Ll(t,"blur",f.useCallback((function(e){t.current&&e.relatedTarget&&!t.current.contains(e.relatedTarget)&&(i.current=!1)}),[]),!0)}(e,o);var r=e.role,i=e.className,a=e.ariaLabel,s=e.ariaLabelledBy,l=e.ariaDescribedBy,c=e.style,u=e.children,p=e.onDismiss,h=function(e,t){var o=Al(),n=f.useState(!1),r=n[0],i=n[1];return f.useEffect((function(){return o.requestAnimationFrame((function(){var o;if(!e.style||!e.style.overflowY){var n=!1;if(t&&t.current&&(null===(o=t.current)||void 0===o?void 0:o.firstElementChild)){var a=t.current.clientHeight,s=t.current.firstElementChild.clientHeight;a>0&&s>a&&(n=s-a>1)}r!==n&&i(n)}})),function(){return o.dispose()}})),r}(e,o),m=f.useCallback((function(e){switch(e.which){case Un.escape:p&&(p(e),e.preventDefault(),e.stopPropagation())}}),[p]);return Ll(Ol(),"keydown",m),f.createElement("div",d({ref:n},Tr(e,Dr),{className:i,role:r,"aria-label":a,"aria-labelledby":s,"aria-describedby":l,onKeyDown:m,style:d({overflowY:h?"scroll":void 0,outline:"none"},c)}),u)}));function Gl(e,t){var o=f.useRef(),n=f.useRef(null),r=Ol();if(!e||e!==o.current||"string"==typeof e){var i=null==t?void 0:t.current;if(e)if("string"==typeof e){var a=nt(i);n.current=a?a.querySelector(e):null}else n.current="stopPropagation"in e||"getBoundingClientRect"in e?e:"current"in e?e.current:e;o.current=e}return[n,r]}var jl=((Kl={})[Zs.top]=Ze.slideUpIn10,Kl[Zs.bottom]=Ze.slideDownIn10,Kl[Zs.left]=Ze.slideLeftIn10,Kl[Zs.right]=Ze.slideRightIn10,Kl),ql={opacity:0,filter:"opacity(0)",pointerEvents:"none"},Yl=["role","aria-roledescription"],Zl={preventDismissOnLostFocus:!1,preventDismissOnScroll:!1,preventDismissOnResize:!1,isBeakVisible:!0,beakWidth:16,gapSpace:0,minPagePadding:8,directionalHint:qs.bottomAutoEdge},Xl=Jn({disableCaching:!0});var Ql=f.memo(f.forwardRef((function(e,t){var o=tr(Zl,e),n=o.styles,r=o.style,i=o.ariaLabel,a=o.ariaDescribedBy,s=o.ariaLabelledBy,l=o.className,c=o.isBeakVisible,u=o.children,p=o.beakWidth,h=o.calloutWidth,m=o.calloutMaxWidth,g=o.calloutMinWidth,v=o.doNotLayer,b=o.finalHeight,y=o.hideOverflow,_=void 0===y?!!b:y,C=o.backgroundColor,S=o.calloutMaxHeight,x=o.onScroll,k=o.shouldRestoreFocus,w=void 0===k||k,I=o.target,D=o.hidden,T=o.onLayerMounted,E=f.useRef(null),P=f.useRef(null),M=Or(E,t),R=Gl(o.target,P),N=R[0],B=R[1],F=function(e,t,o){var n=e.bounds,r=e.minPagePadding,i=void 0===r?Zl.minPagePadding:r,a=e.target,s=f.useRef();return f.useCallback((function(){if(!s.current){var e="function"==typeof n?o?n(a,o):void 0:n;!e&&o&&(e={top:(e=Fl(t.current,o)).top+i,left:e.left+i,right:e.right-i,bottom:e.bottom-i,width:e.width-2*i,height:e.height-2*i}),s.current=e}return s.current}),[n,i,a,t,o])}(o,N,B),A=function(e,t,o){var n=e.beakWidth,r=e.coverTarget,i=e.directionalHint,a=e.directionalHintFixed,s=e.gapSpace,l=e.isBeakVisible,c=e.hidden,u=f.useState(),d=u[0],p=u[1],h=Al(),m=t.current;return f.useEffect((function(){var e;if(d||c)c&&p(void 0);else if(a&&m){var u=(null!=s?s:0)+(l&&n?n:0);h.requestAnimationFrame((function(){t.current&&p(Nl(t.current,i,u,o(),r))}))}else p(null===(e=o())||void 0===e?void 0:e.height)}),[t,m,s,n,o,c,h,r,i,a,l,d]),d}(o,N,F),L=function(e,t){var o=e.finalHeight,n=e.hidden,r=f.useState(0),i=r[0],a=r[1],s=Al(),l=f.useRef(),c=f.useCallback((function(){t.current&&o&&(l.current=s.requestAnimationFrame((function(){var e,n=null===(e=t.current)||void 0===e?void 0:e.lastChild;if(n){var r=n.scrollHeight-n.offsetHeight;a((function(e){return e+r})),n.offsetHeight<o?c():s.cancelAnimationFrame(l.current,t.current)}}),t.current))}),[s,t,o]);return f.useEffect((function(){n||c()}),[o,n,c]),i}(o,P),H=function(e,t,o,n,r){var i=f.useState(),a=i[0],s=i[1],l=f.useRef(0),c=f.useRef(),u=Al(),p=e.hidden,h=e.target,m=e.finalHeight,g=e.onPositioned,v=e.directionalHint;return f.useEffect((function(){if(!p){var i=u.requestAnimationFrame((function(){var i,u,p=!!h;if(t.current&&o.current&&(!p||n.current)){var f=d(d({},e),{target:n.current,bounds:r()}),v=c.current===h?a:void 0,b=m?Rl(f,t.current,o.current,v):Ml(f,t.current,o.current,v);!a&&b||a&&b&&(u=b,!$l((i=a).elementPosition,u.elementPosition)||!$l(i.beakPosition.elementPosition,u.beakPosition.elementPosition))&&l.current<5?(l.current++,s(b)):l.current>0&&(l.current=0,null==g||g(a))}}),o.current);return function(){return u.cancelAnimationFrame(i)}}}),[p,v,u,o,t,n,m,r,g,a,e,h]),c.current=h,a}(o,E,P,N,F),O=function(e,t,o,n,r){var i=e.hidden,a=e.onDismiss,s=e.preventDismissOnScroll,l=e.preventDismissOnResize,c=e.preventDismissOnLostFocus,u=e.dismissOnTargetClick,d=e.shouldDismissOnWindowFocus,p=e.preventDismissOnEvent,h=f.useRef(!1),m=Al(),g=Ei([function(){h.current=!0},function(){h.current=!1}]),v=!!t;return f.useEffect((function(){var e=function(e){v&&!s&&f(e)},t=function(e){l||p&&p(e)||null==a||a(e)},g=function(e){c||f(e)},f=function(e){var t=e.target,i=o.current&&!Ca(o.current,t);if(i&&h.current)h.current=!1;else if(!n.current&&i||e.target!==r&&i&&(!n.current||"stopPropagation"in n.current||u||t!==n.current&&!Ca(n.current,t))){if(p&&p(e))return;null==a||a(e)}},b=function(e){d&&((!p||p(e))&&(p||c)||(null==r?void 0:r.document.hasFocus())||null!==e.relatedTarget||null==a||a(e))},y=new Promise((function(o){m.setTimeout((function(){if(!i&&r){var n=[ol(r,"scroll",e,!0),ol(r,"resize",t,!0),ol(r.document.documentElement,"focus",g,!0),ol(r.document.documentElement,"click",g,!0),ol(r,"blur",b,!0)];o((function(){n.forEach((function(e){return e()}))}))}}),0)}));return function(){y.then((function(e){return e()}))}}),[i,m,o,n,r,a,d,u,c,l,s,v,p]),g}(o,H,E,N,B),z=O[0],W=O[1];if(function(e,t,o){var n=e.hidden,r=e.setInitialFocus,i=Al(),a=!!t;f.useEffect((function(){if(!n&&r&&a&&o.current){var e=i.requestAnimationFrame((function(){return Ia(o.current)}),o.current);return function(){return i.cancelAnimationFrame(e)}}}),[n,a,i,o,r])}(o,H,P),f.useEffect((function(){D||null==T||T()}),[D]),!B)return null;var V=S||(A?A+L:void 0),K=_,U=c&&!!I,G=Xl(n,{theme:o.theme,className:l,overflowYHidden:K,calloutWidth:h,positions:H,beakWidth:p,backgroundColor:C,calloutMaxWidth:m,calloutMinWidth:g,doNotLayer:v}),j=d(d({maxHeight:V},r),K&&{overflowY:"hidden"}),q=o.hidden?{visibility:"hidden"}:void 0;return f.createElement("div",{ref:M,className:G.container,style:q},f.createElement("div",d({},Tr(o,Dr,Yl),{className:qr(G.root,H&&H.targetEdge&&jl[H.targetEdge]),style:H?H.elementPosition:ql,tabIndex:-1,ref:P}),U&&f.createElement("div",{className:G.beak,style:Jl(H)}),U&&f.createElement("div",{className:G.beakCurtain}),f.createElement(Ul,d({},Tr(o,Yl),{ariaDescribedBy:a,ariaLabel:i,ariaLabelledBy:s,className:G.calloutMain,onDismiss:o.onDismiss,onMouseDown:z,onMouseUp:W,onRestoreFocus:o.onRestoreFocus,onScroll:x,shouldRestoreFocus:w,style:j}),u)))})),(function(e,t){return!(t.shouldUpdateWhenHidden||!e.hidden||!t.hidden)||Ns(e,t)}));function Jl(e){var t,o=d({},null===(t=null==e?void 0:e.beakPosition)||void 0===t?void 0:t.elementPosition);return o.top||o.bottom||o.left||o.right||(o.left=0,o.top=0),o}function $l(e,t){for(var o in t)if(t.hasOwnProperty(o)){var n=e[o],r=t[o];if(void 0===n||void 0===r)return!1;if(n.toFixed(2)!==r.toFixed(2))return!1}return!0}function ec(e){return{height:e,width:e}}Ql.displayName="CalloutContentBase";var tc={container:"ms-Callout-container",root:"ms-Callout",beak:"ms-Callout-beak",beakCurtain:"ms-Callout-beakCurtain",calloutMain:"ms-Callout-main"},oc=Vn(Ql,(function(e){var t,o=e.theme,n=e.className,r=e.overflowYHidden,i=e.calloutWidth,a=e.beakWidth,s=e.backgroundColor,l=e.calloutMaxWidth,c=e.calloutMinWidth,u=e.doNotLayer,d=Qo(tc,o),p=o.semanticColors,h=o.effects;return{container:[d.container,{position:"relative"}],root:[d.root,o.fonts.medium,{position:"absolute",zIndex:u?ko.Layer:void 0,boxSizing:"border-box",borderRadius:h.roundedCorner2,boxShadow:h.elevation16,selectors:(t={},t[ro]={borderWidth:1,borderStyle:"solid",borderColor:"WindowText"},t)},{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}},n,!!i&&{width:i},!!l&&{maxWidth:l},!!c&&{minWidth:c}],beak:[d.beak,{position:"absolute",backgroundColor:p.menuBackground,boxShadow:"inherit",border:"inherit",boxSizing:"border-box",transform:"rotate(45deg)"},ec(a),s&&{backgroundColor:s}],beakCurtain:[d.beakCurtain,{position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:p.menuBackground,borderRadius:h.roundedCorner2}],calloutMain:[d.calloutMain,{backgroundColor:p.menuBackground,overflowX:"hidden",overflowY:"auto",position:"relative",borderRadius:h.roundedCorner2},r&&{overflowY:"hidden"},s&&{backgroundColor:s}]}}),void 0,{scope:"CalloutContent"}),nc=ReactDOM;function rc(e,t){var o=(t||{}).customizations,n=void 0===o?{settings:{},scopedSettings:{}}:o;return{customizations:{settings:Jo(n.settings,e.settings),scopedSettings:$o(n.scopedSettings,e.scopedSettings),inCustomizerContext:!0}}}var ic=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onCustomizationChange=function(){return t.forceUpdate()},t}return u(t,e),t.prototype.componentDidMount=function(){Dt.observe(this._onCustomizationChange)},t.prototype.componentWillUnmount=function(){Dt.unobserve(this._onCustomizationChange)},t.prototype.render=function(){var e=this,t=this.props.contextTransform;return f.createElement(On.Consumer,null,(function(o){var n=rc(e.props,o);return t&&(n=t(n)),f.createElement(On.Provider,{value:n},e.props.children)}))},t}(f.Component),ac=Jn(),sc=jo((function(e,t){return jt(d(d({},e),{rtl:t}))})),lc=f.forwardRef((function(e,t){var o=e.className,n=e.theme,r=e.applyTheme,i=e.applyThemeToBody,a=e.styles,s=ac(a,{theme:n,applyTheme:r,className:o}),l=f.useRef(null);return function(e,t,o){var n=t.bodyThemed;f.useEffect((function(){if(e){var t=nt(o.current);if(t)return t.body.classList.add(n),function(){t.body.classList.remove(n)}}}),[n,e,o])}(i,s,l),xs(l),f.createElement(f.Fragment,null,function(e,t,o,n){var r=t.root,i=e.as,a=void 0===i?"div":i,s=e.dir,l=e.theme,c=Tr(e,Dr,["dir"]),u=function(e){var t=e.theme,o=e.dir,n=jn(t)?"rtl":"ltr",r=jn()?"rtl":"ltr",i=o||n;return{rootDir:i!==n||i!==r?i:o,needsTheme:i!==n}}(e),p=u.rootDir,h=u.needsTheme,m=f.createElement(a,d({dir:p},c,{className:r,ref:Or(o,n)}));return h&&(m=f.createElement(ic,{settings:{theme:sc(l,"rtl"===s)}},m)),m}(e,s,l,t))}));lc.displayName="FabricBase";var cc={fontFamily:"inherit"},uc={root:"ms-Fabric",bodyThemed:"ms-Fabric-bodyThemed"},dc=Vn(lc,(function(e){var t=e.theme,o=e.className,n=e.applyTheme;return{root:[Qo(uc,t).root,t.fonts.medium,{color:t.palette.neutralPrimary,selectors:{"& button":cc,"& input":cc,"& textarea":cc}},n&&{color:t.semanticColors.bodyText,backgroundColor:t.semanticColors.bodyBackground},o],bodyThemed:[{backgroundColor:t.semanticColors.bodyBackground}]}}),void 0,{scope:"Fabric"});function pc(e,t){var o=e,n=t;o._virtual||(o._virtual={children:[]});var r=o._virtual.parent;if(r&&r!==t){var i=r._virtual.children.indexOf(o);i>-1&&r._virtual.children.splice(i,1)}o._virtual.parent=n||void 0,n&&(n._virtual||(n._virtual={children:[]}),n._virtual.children.push(o))}var hc={};function mc(e){hc[e]&&hc[e].forEach((function(e){return e()}))}var gc,fc=Jn(),vc=f.forwardRef((function(e,t){var o=f.useState(),n=o[0],r=o[1],i=f.useRef(n);i.current=n;var a=f.useRef(null),s=Or(a,t),l=zl(),c=e.eventBubblingEnabled,u=e.styles,p=e.theme,h=e.className,m=e.children,g=e.hostId,v=e.onLayerDidMount,b=void 0===v?function(){}:v,y=e.onLayerMounted,_=void 0===y?function(){}:y,C=e.onLayerWillUnmount,S=e.insertFirst,x=fc(u,{theme:p,className:h,isNotHost:!g}),k=function(){null==C||C();var e=i.current;if(e&&e.parentNode){var t=e.parentNode;t&&t.removeChild(e)}},w=function(){var e=function(){if(l)return g?l.getElementById(g):l.body}();if(l&&e){k();var t=l.createElement("div");t.className=x.root,os(t),pc(t,a.current),S?e.insertBefore(t,e.firstChild):e.appendChild(t),r(t),null==_||_(),null==b||b()}};return f.useLayoutEffect((function(){return w(),g&&function(e,t){hc[e]||(hc[e]=[]),hc[e].push(t)}(g,w),function(){k(),g&&function(e,t){if(hc[e]){var o=hc[e].indexOf(t);o>=0&&(hc[e].splice(o,1),0===hc[e].length&&delete hc[e])}}(g,w)}}),[g]),function(e){Mi({name:"Layer",props:e,deprecations:{onLayerMounted:"onLayerDidMount"}})}(e),f.createElement("span",{className:"ms-layer",ref:s},n&&nc.createPortal(f.createElement(dc,d({},!c&&(gc||(gc={},["onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOver","onMouseOut","onMouseUp","onTouchMove","onTouchStart","onTouchCancel","onTouchEnd","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onInvalid","onSubmit"].forEach((function(e){return gc[e]=bc}))),gc),{className:x.content}),m),n))}));vc.displayName="LayerBase";var bc=function(e){e.eventPhase===Event.BUBBLING_PHASE&&"mouseenter"!==e.type&&"mouseleave"!==e.type&&"touchstart"!==e.type&&"touchend"!==e.type&&e.stopPropagation()},yc={root:"ms-Layer",rootNoHost:"ms-Layer--fixed",content:"ms-Layer-content"},_c=Vn(vc,(function(e){var t=e.className,o=e.isNotHost,n=e.theme,r=Qo(yc,n);return{root:[r.root,n.fonts.medium,o&&[r.rootNoHost,{position:"fixed",zIndex:ko.Layer,top:0,left:0,bottom:0,right:0,visibility:"hidden"}],t],content:[r.content,{visibility:"visible"}]}}),void 0,{scope:"Layer",fields:["hostId","theme","styles"]}),Cc=f.forwardRef((function(e,t){var o=e.layerProps,n=e.doNotLayer,r=p(e,["layerProps","doNotLayer"]),i=f.createElement(oc,d({},r,{doNotLayer:n,ref:t}));return n?i:f.createElement(_c,d({},o),i)}));Cc.displayName="Callout";var Sc,xc=function(e){var t=e.item,o=e.hasIcons,n=e.classNames,r=t.iconProps;return o?t.onRenderIcon?t.onRenderIcon(e):f.createElement(ii,d({},r,{className:n.icon})):null},kc=function(e){var t=e.onCheckmarkClick,o=e.item,n=e.classNames,r=Js(o);return t?f.createElement(ii,{iconName:!1!==o.canCheck&&r?"CheckMark":"",className:n.checkmarkIcon,onClick:function(e){return t(o,e)}}):null},wc=function(e){var t=e.item,o=e.classNames;return t.text||t.name?f.createElement("span",{className:o.label},t.text||t.name):null},Ic=function(e){var t=e.item,o=e.classNames;return t.secondaryText?f.createElement("span",{className:o.secondaryText},t.secondaryText):null},Dc=function(e){var t=e.item,o=e.classNames,n=e.theme;return $s(t)?f.createElement(ii,d({iconName:jn(n)?"ChevronLeft":"ChevronRight"},t.submenuIconProps,{className:o.subMenuIcon})):null},Tc=function(e){function t(t){var o=e.call(this,t)||this;return o.openSubMenu=function(){var e=o.props,t=e.item,n=e.openSubMenu,r=e.getSubmenuTarget;if(r){var i=r();$s(t)&&n&&i&&n(t,i)}},o.dismissSubMenu=function(){var e=o.props,t=e.item,n=e.dismissSubMenu;$s(t)&&n&&n()},o.dismissMenu=function(e){var t=o.props.dismissMenu;t&&t(void 0,e)},Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.item,o=e.classNames,n=t.onRenderContent||this._renderLayout;return f.createElement("div",{className:t.split?o.linkContentMenu:o.linkContent},n(this.props,{renderCheckMarkIcon:kc,renderItemIcon:xc,renderItemName:wc,renderSecondaryText:Ic,renderSubMenuIcon:Dc}))},t.prototype._renderLayout=function(e,t){return f.createElement(f.Fragment,null,t.renderCheckMarkIcon(e),t.renderItemIcon(e),t.renderItemName(e),t.renderSecondaryText(e),t.renderSubMenuIcon(e))},t}(f.Component),Ec=jo((function(e){return In({wrapper:{display:"inline-flex",height:"100%",alignItems:"center"},divider:{width:1,height:"100%",backgroundColor:e.palette.neutralTertiaryAlt}})})),Pc=36,Mc=Co(0,fo),Rc=jo((function(){var e;return{selectors:(e={},e[ro]=d({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),e)}})),Nc=jo((function(e){var t,o,n,r,i,a,s,l=e.semanticColors,c=e.fonts,u=e.palette,p=l.menuItemBackgroundHovered,h=l.menuItemTextHovered,m=l.menuItemBackgroundPressed,g=l.bodyDivider;return kn({item:[c.medium,{color:l.bodyText,position:"relative",boxSizing:"border-box"}],divider:{display:"block",height:"1px",backgroundColor:g,position:"relative"},root:[To(e),c.medium,{color:l.bodyText,backgroundColor:"transparent",border:"none",width:"100%",height:Pc,lineHeight:Pc,display:"block",cursor:"pointer",padding:"0px 8px 0 4px",textAlign:"left"}],rootDisabled:{color:l.disabledBodyText,cursor:"default",pointerEvents:"none",selectors:(t={},t[ro]=d({color:"GrayText",opacity:1},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},rootHovered:d({backgroundColor:p,color:h,selectors:{".ms-ContextualMenu-icon":{color:u.themeDarkAlt},".ms-ContextualMenu-submenuIcon":{color:u.neutralPrimary}}},Rc()),rootFocused:d({backgroundColor:u.white},Rc()),rootChecked:d({selectors:{".ms-ContextualMenu-checkmarkIcon":{color:u.neutralPrimary}}},Rc()),rootPressed:d({backgroundColor:m,selectors:{".ms-ContextualMenu-icon":{color:u.themeDark},".ms-ContextualMenu-submenuIcon":{color:u.neutralPrimary}}},Rc()),rootExpanded:d({backgroundColor:m,color:l.bodyTextChecked},Rc()),linkContent:{whiteSpace:"nowrap",height:"inherit",display:"flex",alignItems:"center",maxWidth:"100%"},anchorLink:{padding:"0px 8px 0 4px",textRendering:"auto",color:"inherit",letterSpacing:"normal",wordSpacing:"normal",textTransform:"none",textIndent:"0px",textShadow:"none",textDecoration:"none",boxSizing:"border-box"},label:{margin:"0 4px",verticalAlign:"middle",display:"inline-block",flexGrow:"1",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},secondaryText:{color:e.palette.neutralSecondary,paddingLeft:"20px",textAlign:"right"},icon:{display:"inline-block",minHeight:"1px",maxHeight:Pc,fontSize:Ye.medium,width:Ye.medium,margin:"0 4px",verticalAlign:"middle",flexShrink:"0",selectors:(o={},o[Mc]={fontSize:Ye.large,width:Ye.large},o)},iconColor:{color:l.menuIcon,selectors:(n={},n[ro]={color:"inherit"},n["$root:hover &"]={selectors:(r={},r[ro]={color:"HighlightText"},r)},n["$root:focus &"]={selectors:(i={},i[ro]={color:"HighlightText"},i)},n)},iconDisabled:{color:l.disabledBodyText},checkmarkIcon:{color:l.bodySubtext,selectors:(a={},a[ro]={color:"HighlightText"},a)},subMenuIcon:{height:Pc,lineHeight:Pc,color:u.neutralSecondary,textAlign:"center",display:"inline-block",verticalAlign:"middle",flexShrink:"0",fontSize:Ye.small,selectors:(s={":hover":{color:u.neutralPrimary},":active":{color:u.neutralPrimary}},s[Mc]={fontSize:Ye.medium},s[ro]={color:"HighlightText"},s)},splitButtonFlexContainer:[To(e),{display:"flex",height:Pc,flexWrap:"nowrap",justifyContent:"center",alignItems:"flex-start"}]})})),Bc=Co(0,fo),Fc=jo((function(e){var t;return In(Ec(e),{wrapper:{position:"absolute",right:28,selectors:(t={},t[Bc]={right:32},t)},divider:{height:16,width:1}})})),Ac={item:"ms-ContextualMenu-item",divider:"ms-ContextualMenu-divider",root:"ms-ContextualMenu-link",isChecked:"is-checked",isExpanded:"is-expanded",isDisabled:"is-disabled",linkContent:"ms-ContextualMenu-linkContent",linkContentMenu:"ms-ContextualMenu-linkContent",icon:"ms-ContextualMenu-icon",iconColor:"ms-ContextualMenu-iconColor",checkmarkIcon:"ms-ContextualMenu-checkmarkIcon",subMenuIcon:"ms-ContextualMenu-submenuIcon",label:"ms-ContextualMenu-itemText",secondaryText:"ms-ContextualMenu-secondaryText",splitMenu:"ms-ContextualMenu-splitMenu",screenReaderText:"ms-ContextualMenu-screenReaderText"},Lc=jo((function(e,t,o,n,r,i,a,s,l,c,u,d){var p,h,m,g,f=Nc(e),v=Qo(Ac,e);return In({item:[v.item,f.item,a],divider:[v.divider,f.divider,s],root:[v.root,f.root,n&&[v.isChecked,f.rootChecked],r&&f.anchorLink,o&&[v.isExpanded,f.rootExpanded],t&&[v.isDisabled,f.rootDisabled],!t&&!o&&[{selectors:(p={":hover":f.rootHovered,":active":f.rootPressed},p["."+wo+" &:focus, ."+wo+" &:focus:hover"]=f.rootFocused,p["."+wo+" &:hover"]={background:"inherit;"},p)}],d],splitPrimary:[f.root,{width:"calc(100% - 28px)"},n&&["is-checked",f.rootChecked],(t||u)&&["is-disabled",f.rootDisabled],!(t||u)&&!n&&[{selectors:(h={":hover":f.rootHovered},h[":hover ~ ."+v.splitMenu]=f.rootHovered,h[":active"]=f.rootPressed,h["."+wo+" &:focus, ."+wo+" &:focus:hover"]=f.rootFocused,h["."+wo+" &:hover"]={background:"inherit;"},h)}]],splitMenu:[v.splitMenu,f.root,{flexBasis:"0",padding:"0 8px",minWidth:"28px"},o&&["is-expanded",f.rootExpanded],t&&["is-disabled",f.rootDisabled],!t&&!o&&[{selectors:(m={":hover":f.rootHovered,":active":f.rootPressed},m["."+wo+" &:focus, ."+wo+" &:focus:hover"]=f.rootFocused,m["."+wo+" &:hover"]={background:"inherit;"},m)}]],anchorLink:f.anchorLink,linkContent:[v.linkContent,f.linkContent],linkContentMenu:[v.linkContentMenu,f.linkContent,{justifyContent:"center"}],icon:[v.icon,i&&f.iconColor,f.icon,l,t&&[v.isDisabled,f.iconDisabled]],iconColor:f.iconColor,checkmarkIcon:[v.checkmarkIcon,i&&f.checkmarkIcon,f.icon,l],subMenuIcon:[v.subMenuIcon,f.subMenuIcon,c,o&&{color:e.palette.neutralPrimary},t&&[f.iconDisabled]],label:[v.label,f.label],secondaryText:[v.secondaryText,f.secondaryText],splitContainer:[f.splitButtonFlexContainer,!t&&!n&&[{selectors:(g={},g["."+wo+" &:focus, ."+wo+" &:focus:hover"]=f.rootFocused,g)}]],screenReaderText:[v.screenReaderText,f.screenReaderText,Ro,{visibility:"hidden"}]})})),Hc=function(e){var t=e.theme,o=e.disabled,n=e.expanded,r=e.checked,i=e.isAnchorLink,a=e.knownIcon,s=e.itemClassName,l=e.dividerClassName,c=e.iconClassName,u=e.subMenuClassName,d=e.primaryDisabled,p=e.className;return Lc(t,o,n,r,i,a,s,l,c,u,d,p)},Oc=Vn(Tc,Hc,void 0,{scope:"ContextualMenuItem"}),zc=function(e){function t(t){var o=e.call(this,t)||this;return o._onItemMouseEnter=function(e){var t=o.props,n=t.item,r=t.onItemMouseEnter;r&&r(n,e,e.currentTarget)},o._onItemClick=function(e){var t=o.props,n=t.item,r=t.onItemClickBase;r&&r(n,e,e.currentTarget)},o._onItemMouseLeave=function(e){var t=o.props,n=t.item,r=t.onItemMouseLeave;r&&r(n,e)},o._onItemKeyDown=function(e){var t=o.props,n=t.item,r=t.onItemKeyDown;r&&r(n,e)},o._onItemMouseMove=function(e){var t=o.props,n=t.item,r=t.onItemMouseMove;r&&r(n,e,e.currentTarget)},o._getSubmenuTarget=function(){},Ui(o),o}return u(t,e),t.prototype.shouldComponentUpdate=function(e){return!Ns(e,this.props)},t}(f.Component),Wc="ktp",Vc="-",Kc=Wc+Vc,Uc="data-ktp-target",Gc="data-ktp-execute-target",jc="data-ktp-aria-target",qc="ktp-layer-id",Yc=", ";!function(e){e.KEYTIP_ADDED="keytipAdded",e.KEYTIP_REMOVED="keytipRemoved",e.KEYTIP_UPDATED="keytipUpdated",e.PERSISTED_KEYTIP_ADDED="persistedKeytipAdded",e.PERSISTED_KEYTIP_REMOVED="persistedKeytipRemoved",e.PERSISTED_KEYTIP_EXECUTE="persistedKeytipExecute",e.ENTER_KEYTIP_MODE="enterKeytipMode",e.EXIT_KEYTIP_MODE="exitKeytipMode"}(Sc||(Sc={}));var Zc=function(){function e(){this.keytips={},this.persistedKeytips={},this.sequenceMapping={},this.inKeytipMode=!1,this.shouldEnterKeytipMode=!0,this.delayUpdatingKeytipChange=!1}return e.getInstance=function(){return this._instance},e.prototype.init=function(e){this.delayUpdatingKeytipChange=e},e.prototype.register=function(e,t){void 0===t&&(t=!1);var o=e;t||(o=this.addParentOverflow(e),this.sequenceMapping[o.keySequences.toString()]=o);var n=this._getUniqueKtp(o);if(t?this.persistedKeytips[n.uniqueID]=n:this.keytips[n.uniqueID]=n,this.inKeytipMode||!this.delayUpdatingKeytipChange){var r=t?Sc.PERSISTED_KEYTIP_ADDED:Sc.KEYTIP_ADDED;Os.raise(this,r,{keytip:o,uniqueID:n.uniqueID})}return n.uniqueID},e.prototype.update=function(e,t){var o=this.addParentOverflow(e),n=this._getUniqueKtp(o,t),r=this.keytips[t];r&&(n.keytip.visible=r.keytip.visible,this.keytips[t]=n,delete this.sequenceMapping[r.keytip.keySequences.toString()],this.sequenceMapping[n.keytip.keySequences.toString()]=n.keytip,!this.inKeytipMode&&this.delayUpdatingKeytipChange||Os.raise(this,Sc.KEYTIP_UPDATED,{keytip:n.keytip,uniqueID:n.uniqueID}))},e.prototype.unregister=function(e,t,o){void 0===o&&(o=!1),o?delete this.persistedKeytips[t]:delete this.keytips[t],!o&&delete this.sequenceMapping[e.keySequences.toString()];var n=o?Sc.PERSISTED_KEYTIP_REMOVED:Sc.KEYTIP_REMOVED;!this.inKeytipMode&&this.delayUpdatingKeytipChange||Os.raise(this,n,{keytip:e,uniqueID:t})},e.prototype.enterKeytipMode=function(){Os.raise(this,Sc.ENTER_KEYTIP_MODE)},e.prototype.exitKeytipMode=function(){Os.raise(this,Sc.EXIT_KEYTIP_MODE)},e.prototype.getKeytips=function(){var e=this;return Object.keys(this.keytips).map((function(t){return e.keytips[t].keytip}))},e.prototype.addParentOverflow=function(e){var t=m(e.keySequences);if(t.pop(),0!==t.length){var o=this.sequenceMapping[t.toString()];if(o&&o.overflowSetSequence)return d(d({},e),{overflowSetSequence:o.overflowSetSequence})}return e},e.prototype.menuExecute=function(e,t){Os.raise(this,Sc.PERSISTED_KEYTIP_EXECUTE,{overflowButtonSequences:e,keytipSequences:t})},e.prototype._getUniqueKtp=function(e,t){return void 0===t&&(t=Va()),{keytip:d({},e),uniqueID:t}},e._instance=new e,e}();function Xc(e){return e.reduce((function(e,t){return e+Vc+t.split("").join(Vc)}),Wc)}function Qc(e,t){var o=t.length,n=m(t).pop();return da(m(e),o-1,n)}function Jc(e){return"["+Uc+'="'+Xc(e)+'"]'}function $c(e){return"["+Gc+'="'+e+'"]'}function eu(e){var t=" "+qc;return e.length?t+" "+Xc(e):t}function tu(e){var t=f.useRef(),o=e.keytipProps?d({disabled:e.disabled},e.keytipProps):void 0,n=Ei(Zc.getInstance()),r=Ti(e);f.useLayoutEffect((function(){t.current&&o&&((null==r?void 0:r.keytipProps)!==e.keytipProps||(null==r?void 0:r.disabled)!==e.disabled)&&n.update(o,t.current)})),f.useLayoutEffect((function(){return o&&(t.current=n.register(o)),function(){o&&n.unregister(o,t.current)}}),[]);var i={ariaDescribedBy:void 0,keytipId:void 0};return o&&(i=function(e,t,o){var n=e.addParentOverflow(t),r=Ks(o,eu(n.keySequences)),i=m(n.keySequences);return n.overflowSetSequence&&(i=Qc(i,n.overflowSetSequence)),{ariaDescribedBy:r,keytipId:Xc(i)}}(n,o,e.ariaDescribedBy)),i}var ou=function(e){var t,o=e.children,n=tu(p(e,["children"])),r=n.keytipId,i=n.ariaDescribedBy;return o(((t={})[Uc]=r,t[Gc]=r,t["aria-describedby"]=i,t))},nu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._anchor=f.createRef(),t._getMemoizedMenuButtonKeytipProps=jo((function(e){return d(d({},e),{hasMenu:!0})})),t._getSubmenuTarget=function(){return t._anchor.current?t._anchor.current:void 0},t._onItemClick=function(e){var o=t.props,n=o.item,r=o.onItemClick;r&&r(n,e)},t._renderAriaDescription=function(e,o){return e?f.createElement("span",{id:t._ariaDescriptionId,className:o},e):null},t}return u(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.item,n=t.classNames,r=t.index,i=t.focusableElementIndex,a=t.totalItemCount,s=t.hasCheckmarks,l=t.hasIcons,c=t.contextualMenuItemAs,u=void 0===c?Oc:c,p=t.expandedMenuItemKey,h=t.onItemClick,m=t.openSubMenu,g=t.dismissSubMenu,v=t.dismissMenu,b=o.rel;o.target&&"_blank"===o.target.toLowerCase()&&(b=b||"nofollow noopener noreferrer");var y=$s(o),_=Tr(o,dr),C=el(o),S=o.itemProps,x=o.ariaDescription,k=o.keytipProps;k&&y&&(k=this._getMemoizedMenuButtonKeytipProps(k)),x&&(this._ariaDescriptionId=Va());var w=Ks(o.ariaDescribedBy,x?this._ariaDescriptionId:void 0,_["aria-describedby"]),I={"aria-describedby":w};return f.createElement("div",null,f.createElement(ou,{keytipProps:o.keytipProps,ariaDescribedBy:w,disabled:C},(function(t){return f.createElement("a",d({},I,_,t,{ref:e._anchor,href:o.href,target:o.target,rel:b,className:n.root,role:"menuitem","aria-haspopup":y||void 0,"aria-expanded":y?o.key===p:void 0,"aria-posinset":i+1,"aria-setsize":a,"aria-disabled":el(o),style:o.style,onClick:e._onItemClick,onMouseEnter:e._onItemMouseEnter,onMouseLeave:e._onItemMouseLeave,onMouseMove:e._onItemMouseMove,onKeyDown:y?e._onItemKeyDown:void 0}),f.createElement(u,d({componentRef:o.componentRef,item:o,classNames:n,index:r,onCheckmarkClick:s&&h?h:void 0,hasIcons:l,openSubMenu:m,dismissSubMenu:g,dismissMenu:v,getSubmenuTarget:e._getSubmenuTarget},S)),e._renderAriaDescription(x,n.screenReaderText))})))},t}(zc),ru=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._btn=f.createRef(),t._getMemoizedMenuButtonKeytipProps=jo((function(e){return d(d({},e),{hasMenu:!0})})),t._renderAriaDescription=function(e,o){return e?f.createElement("span",{id:t._ariaDescriptionId,className:o},e):null},t._getSubmenuTarget=function(){return t._btn.current?t._btn.current:void 0},t}return u(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.item,n=t.classNames,r=t.index,i=t.focusableElementIndex,a=t.totalItemCount,s=t.hasCheckmarks,l=t.hasIcons,c=t.contextualMenuItemAs,u=void 0===c?Oc:c,p=t.expandedMenuItemKey,h=t.onItemMouseDown,m=t.onItemClick,g=t.openSubMenu,v=t.dismissSubMenu,b=t.dismissMenu,y=Js(o),_=null!==y,C=tl(o),S=$s(o),x=o.itemProps,k=o.ariaLabel,w=o.ariaDescription,I=Tr(o,pr);delete I.disabled;var D=o.role||C;w&&(this._ariaDescriptionId=Va());var T=Ks(o.ariaDescribedBy,w?this._ariaDescriptionId:void 0,I["aria-describedby"]),E={className:n.root,onClick:this._onItemClick,onKeyDown:S?this._onItemKeyDown:void 0,onMouseEnter:this._onItemMouseEnter,onMouseLeave:this._onItemMouseLeave,onMouseDown:function(e){return h?h(o,e):void 0},onMouseMove:this._onItemMouseMove,href:o.href,title:o.title,"aria-label":k,"aria-describedby":T,"aria-haspopup":S||void 0,"aria-expanded":S?o.key===p:void 0,"aria-posinset":i+1,"aria-setsize":a,"aria-disabled":el(o),"aria-checked":"menuitemcheckbox"!==D&&"menuitemradio"!==D||!_?void 0:!!y,"aria-selected":"menuitem"===D&&_?!!y:void 0,role:D,style:o.style},P=o.keytipProps;return P&&S&&(P=this._getMemoizedMenuButtonKeytipProps(P)),f.createElement(ou,{keytipProps:P,ariaDescribedBy:T,disabled:el(o)},(function(t){return f.createElement("button",d({ref:e._btn},I,E,t),f.createElement(u,d({componentRef:o.componentRef,item:o,classNames:n,index:r,onCheckmarkClick:s&&m?m:void 0,hasIcons:l,openSubMenu:g,dismissSubMenu:v,dismissMenu:b,getSubmenuTarget:e._getSubmenuTarget},x)),e._renderAriaDescription(w,n.screenReaderText))}))},t}(zc),iu=Jn(),au=f.forwardRef((function(e,t){var o=e.styles,n=e.theme,r=e.getClassNames,i=e.className,a=iu(o,{theme:n,getClassNames:r,className:i});return f.createElement("span",{className:a.wrapper,ref:t},f.createElement("span",{className:a.divider}))}));au.displayName="VerticalDividerBase";var su=Vn(au,(function(e){var t=e.theme,o=e.getClassNames,n=e.className;if(!t)throw new Error("Theme is undefined or null.");if(o){var r=o(t);return{wrapper:[r.wrapper],divider:[r.divider]}}return{wrapper:[{display:"inline-flex",height:"100%",alignItems:"center"},n],divider:[{width:1,height:"100%",backgroundColor:t.palette.neutralTertiaryAlt}]}}),void 0,{scope:"VerticalDivider"}),lu=function(e){function t(t){var o=e.call(this,t)||this;return o._getMemoizedMenuButtonKeytipProps=jo((function(e){return d(d({},e),{hasMenu:!0})})),o._onItemKeyDown=function(e){var t=o.props,n=t.item,r=t.onItemKeyDown;e.which===Un.enter?(o._executeItemClick(e),e.preventDefault(),e.stopPropagation()):r&&r(n,e)},o._getSubmenuTarget=function(){return o._splitButton},o._renderAriaDescription=function(e,t){return e?f.createElement("span",{id:o._ariaDescriptionId,className:t},e):null},o._onItemMouseEnterPrimary=function(e){var t=o.props,n=t.item,r=t.onItemMouseEnter;r&&r(d(d({},n),{subMenuProps:void 0,items:void 0}),e,o._splitButton)},o._onItemMouseEnterIcon=function(e){var t=o.props,n=t.item,r=t.onItemMouseEnter;r&&r(n,e,o._splitButton)},o._onItemMouseMovePrimary=function(e){var t=o.props,n=t.item,r=t.onItemMouseMove;r&&r(d(d({},n),{subMenuProps:void 0,items:void 0}),e,o._splitButton)},o._onItemMouseMoveIcon=function(e){var t=o.props,n=t.item,r=t.onItemMouseMove;r&&r(n,e,o._splitButton)},o._onIconItemClick=function(e){var t=o.props,n=t.item,r=t.onItemClickBase;r&&r(n,e,o._splitButton?o._splitButton:e.currentTarget)},o._executeItemClick=function(e){var t=o.props,n=t.item,r=t.executeItemClick,i=t.onItemClick;if(!n.disabled&&!n.isDisabled)return o._processingTouch&&i?i(n,e):void(r&&r(n,e))},o._onTouchStart=function(e){o._splitButton&&!("onpointerdown"in o._splitButton)&&o._handleTouchAndPointerEvent(e)},o._onPointerDown=function(e){"touch"===e.pointerType&&(o._handleTouchAndPointerEvent(e),e.preventDefault(),e.stopImmediatePropagation())},o._async=new Zi(o),o._events=new Os(o),o}return u(t,e),t.prototype.componentDidMount=function(){this._splitButton&&"onpointerdown"in this._splitButton&&this._events.on(this._splitButton,"pointerdown",this._onPointerDown,!0)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this,t=this.props,o=t.item,n=t.classNames,r=t.index,i=t.focusableElementIndex,a=t.totalItemCount,s=t.hasCheckmarks,l=t.hasIcons,c=t.onItemMouseLeave,u=t.expandedMenuItemKey,p=$s(o),h=o.keytipProps;h&&(h=this._getMemoizedMenuButtonKeytipProps(h));var m=o.ariaDescription;return m&&(this._ariaDescriptionId=Va()),f.createElement(ou,{keytipProps:h,disabled:el(o)},(function(t){return f.createElement("div",{"data-ktp-target":t["data-ktp-target"],ref:function(t){return e._splitButton=t},role:tl(o),"aria-label":o.ariaLabel,className:n.splitContainer,"aria-disabled":el(o),"aria-expanded":p?o.key===u:void 0,"aria-haspopup":!0,"aria-describedby":Ks(o.ariaDescribedBy,m?e._ariaDescriptionId:void 0,t["aria-describedby"]),"aria-checked":o.isChecked||o.checked,"aria-posinset":i+1,"aria-setsize":a,onMouseEnter:e._onItemMouseEnterPrimary,onMouseLeave:c?c.bind(e,d(d({},o),{subMenuProps:null,items:null})):void 0,onMouseMove:e._onItemMouseMovePrimary,onKeyDown:e._onItemKeyDown,onClick:e._executeItemClick,onTouchStart:e._onTouchStart,tabIndex:0,"data-is-focusable":!0,"aria-roledescription":o["aria-roledescription"]},e._renderSplitPrimaryButton(o,n,r,s,l),e._renderSplitDivider(o),e._renderSplitIconButton(o,n,r,t),e._renderAriaDescription(m,n.screenReaderText))}))},t.prototype._renderSplitPrimaryButton=function(e,t,o,n,r){var i=this.props,a=i.contextualMenuItemAs,s=void 0===a?Oc:a,l=i.onItemClick,c={key:e.key,disabled:el(e)||e.primaryDisabled,name:e.name,text:e.text||e.name,secondaryText:e.secondaryText,className:t.splitPrimary,canCheck:e.canCheck,isChecked:e.isChecked,checked:e.checked,iconProps:e.iconProps,onRenderIcon:e.onRenderIcon,data:e.data,"data-is-focusable":!1},u=e.itemProps;return f.createElement("button",d({},Tr(c,pr)),f.createElement(s,d({"data-is-focusable":!1,item:c,classNames:t,index:o,onCheckmarkClick:n&&l?l:void 0,hasIcons:r},u)))},t.prototype._renderSplitDivider=function(e){var t=e.getSplitButtonVerticalDividerClassNames||Fc;return f.createElement(su,{getClassNames:t})},t.prototype._renderSplitIconButton=function(e,t,o,n){var r=this.props,i=r.contextualMenuItemAs,a=void 0===i?Oc:i,s=r.onItemMouseLeave,l=r.onItemMouseDown,c=r.openSubMenu,u=r.dismissSubMenu,p=r.dismissMenu,h={onClick:this._onIconItemClick,disabled:el(e),className:t.splitMenu,subMenuProps:e.subMenuProps,submenuIconProps:e.submenuIconProps,split:!0,key:e.key},m=d(d({},Tr(h,pr)),{onMouseEnter:this._onItemMouseEnterIcon,onMouseLeave:s?s.bind(this,e):void 0,onMouseDown:function(t){return l?l(e,t):void 0},onMouseMove:this._onItemMouseMoveIcon,"data-is-focusable":!1,"data-ktp-execute-target":n["data-ktp-execute-target"],"aria-hidden":!0}),g=e.itemProps;return f.createElement("button",d({},m),f.createElement(a,d({componentRef:e.componentRef,item:h,classNames:t,index:o,hasIcons:!1,openSubMenu:c,dismissSubMenu:u,dismissMenu:p,getSubmenuTarget:this._getSubmenuTarget},g)))},t.prototype._handleTouchAndPointerEvent=function(e){var t=this,o=this.props.onTap;o&&o(e),this._lastTouchTimeoutId&&(this._async.clearTimeout(this._lastTouchTimeoutId),this._lastTouchTimeoutId=void 0),this._processingTouch=!0,this._lastTouchTimeoutId=this._async.setTimeout((function(){t._processingTouch=!1,t._lastTouchTimeoutId=void 0}),500)},t}(zc),cu=["setState","render","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","getSnapshotBeforeUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount"];function uu(e,t,o){void 0===o&&(o=cu);var n=[],r=function(r){"function"!=typeof t[r]||void 0!==e[r]||o&&-1!==o.indexOf(r)||(n.push(r),e[r]=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t[r].apply(t,e)})};for(var i in t)r(i);return n}function du(e,t){t.forEach((function(t){return delete e[t]}))}var pu,hu=function(e){function t(t){var o=e.call(this,t)||this;return o._updateComposedComponentRef=o._updateComposedComponentRef.bind(o),o}return u(t,e),t.prototype._updateComposedComponentRef=function(e){this._composedComponentInstance=e,e?this._hoisted=uu(this,e):this._hoisted&&du(this,this._hoisted)},t}(f.Component);function mu(e,t){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);return t}!function(e){e[e.small=0]="small",e[e.medium=1]="medium",e[e.large=2]="large",e[e.xLarge=3]="xLarge",e[e.xxLarge=4]="xxLarge",e[e.xxxLarge=5]="xxxLarge",e[e.unknown=999]="unknown"}(pu||(pu={}));var gu,fu,vu=[479,639,1023,1365,1919,99999999];function bu(e){gu=e}function yu(e){var t=at(e);t&&Su(t)}function _u(){return gu||fu||pu.large}function Cu(e){var t,o=((t=function(t){function o(e){var o=t.call(this,e)||this;return o._onResize=function(){var e=Su(o.context.window);e!==o.state.responsiveMode&&o.setState({responsiveMode:e})},o._events=new Os(o),o._updateComposedComponentRef=o._updateComposedComponentRef.bind(o),o.state={responsiveMode:_u()},o}return u(o,t),o.prototype.componentDidMount=function(){this._events.on(this.context.window,"resize",this._onResize),this._onResize()},o.prototype.componentWillUnmount=function(){this._events.dispose()},o.prototype.render=function(){var t=this.state.responsiveMode;return t===pu.unknown?null:f.createElement(e,d({ref:this._updateComposedComponentRef,responsiveMode:t},this.props))},o}(hu)).contextType=Hl,t);return mu(e,o)}function Su(e){var t=pu.small;if(e){try{for(;e.innerWidth>vu[t];)t++}catch(e){t=_u()}fu=t}else{if(void 0===gu)throw new Error("Content was rendered in a server environment without providing a default responsive mode. Call setResponsiveMode to define what the responsive mode is.");t=gu}return t}var xu=function(e,t){var o=f.useState(_u()),n=o[0],r=o[1],i=f.useCallback((function(){var t=Su(at(e.current));n!==t&&r(t)}),[e,n]);return Ll(Ol(),"resize",i),f.useEffect((function(){void 0===t&&i()}),[t]),null!=t?t:n},ku=f.createContext({}),wu=Jn(),Iu=Jn(),Du={items:[],shouldFocusOnMount:!0,gapSpace:0,directionalHint:qs.bottomAutoEdge,beakWidth:16};function Tu(e){return e.subMenuProps?e.subMenuProps.items:e.items}function Eu(e){return e.some((function(e){return!!e.canCheck||!(!e.sectionProps||!e.sectionProps.items.some((function(e){return!0===e.canCheck})))}))}var Pu=jo((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return wn.apply(void 0,m([t,Hc],e))}})),Mu=f.forwardRef((function(e,t){var o=tr(Du,e),n=(o.ref,p(o,["ref"])),r=f.useRef(null),i=Gl(n.target,r),a=i[0],s=i[1],l=function(e){var t=e.hidden,o=f.useState(),n=o[0],r=o[1],i=f.useState(),a=i[0],s=i[1],l=f.useState(),c=l[0],u=l[1],d=f.useCallback((function(){u(void 0),r(void 0),s(void 0)}),[]),p=f.useCallback((function(e,t,o){var i=e.key;n!==i&&(t.focus(),u(o),r(i),s(t))}),[n]);return f.useEffect((function(){t&&d()}),[t,d]),[n,a,c,p,d]}(n),c=l[0],u=l[1],h=l[2],m=l[3],g=l[4],v=function(e){var t=e.delayUpdateFocusOnHover,o=e.hidden,n=f.useRef(!t),r=f.useRef(!1);f.useEffect((function(){n.current=!t,r.current=!o&&!t&&r.current}),[t,o]);var i=f.useCallback((function(){t&&(n.current=!0)}),[t]);return[n,r,i]}(n),b=v[0],y=v[1],_=v[2],C=xu(r,n.responsiveMode);return function(e,t){var o=e.hidden,n=void 0!==o&&o,r=e.onMenuDismissed,i=e.onMenuOpened,a=Ti(n),s=f.useRef(i),l=f.useRef(r),c=f.useRef(e);s.current=i,l.current=r,c.current=e,f.useEffect((function(){var e,t;n&&!1===a?null===(e=l.current)||void 0===e||e.call(l,c.current):n||!1===a||null===(t=s.current)||void 0===t||t.call(s,c.current)}),[n,a]),f.useEffect((function(){return function(){var e;return null===(e=l.current)||void 0===e?void 0:e.call(l,c.current)}}),[])}(n),f.createElement(Ru,d({},n,{hoisted:{hostElement:r,forwardedRef:t,targetRef:a,targetWindow:s,expandedMenuItemKey:c,submenuTarget:u,expandedByMouseClick:h,openSubMenu:m,closeSubMenu:g,shouldUpdateFocusOnMouseEvent:b,gotMouseMove:y,onMenuFocusCapture:_},responsiveMode:C}))}));Mu.displayName="ContextualMenuBase";var Ru=function(e){function t(t){var o=e.call(this,t)||this;return o._mounted=!1,o.dismiss=function(e,t){var n=o.props.onDismiss;n&&n(e,t)},o._tryFocusPreviousActiveElement=function(e){var t,n;o.props.onRestoreFocus?o.props.onRestoreFocus(e):e&&e.documentContainsFocus&&o._previousActiveElement&&(null===(n=(t=o._previousActiveElement).focus)||void 0===n||n.call(t))},o._onRenderMenuList=function(e,t){var n=0,r=e.items,i=e.totalItemCount,a=e.hasCheckmarks,s=e.hasIcons;return f.createElement("ul",{className:o._classNames.list,onKeyDown:o._onKeyDown,onKeyUp:o._onKeyUp,role:"presentation"},r.map((function(e,t){var r=o._renderMenuItem(e,t,n,i,a,s);if(e.itemType!==Us.Divider&&e.itemType!==Us.Header){var l=e.customOnRenderListLength?e.customOnRenderListLength:1;n+=l}return r})))},o._renderMenuItem=function(e,t,n,r,i,a){var s,l,c=[],u=e.iconProps||{iconName:"None"},d=e.getItemClassNames,p=e.itemProps,h=p?p.styles:void 0,m=o.props.hoisted.expandedMenuItemKey,g=e.itemType===Us.Divider?e.className:void 0,v=e.submenuIconProps?e.submenuIconProps.className:"";if(d)l=d(o.props.theme,el(e),m===e.key,!!Js(e),!!e.href,"None"!==u.iconName,e.className,g,u.className,v,e.primaryDisabled);else{var b={theme:o.props.theme,disabled:el(e),expanded:m===e.key,checked:!!Js(e),isAnchorLink:!!e.href,knownIcon:"None"!==u.iconName,itemClassName:e.className,dividerClassName:g,iconClassName:u.className,subMenuClassName:v,primaryDisabled:e.primaryDisabled};l=Iu(Pu(null===(s=o._classNames.subComponentStyles)||void 0===s?void 0:s.menuItem,h),b)}switch("-"!==e.text&&"-"!==e.name||(e.itemType=Us.Divider),e.itemType){case Us.Divider:c.push(o._renderSeparator(t,l));break;case Us.Header:c.push(o._renderSeparator(t,l));var y=o._renderHeaderMenuItem(e,l,t,i,a);c.push(o._renderListItem(y,e.key||t,l,e.title));break;case Us.Section:c.push(o._renderSectionItem(e,l,t,i,a));break;default:var _=o._renderNormalItem(e,l,t,n,r,i,a);c.push(o._renderListItem(_,e.key||t,l,e.title))}return f.createElement(f.Fragment,{key:e.key},c)},o._defaultMenuItemRenderer=function(e){var t=e.index,n=e.focusableElementIndex,r=e.totalItemCount,i=e.hasCheckmarks,a=e.hasIcons;return o._renderMenuItem(e,t,n,r,i,a)},o._onKeyDown=function(e){o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e);var t=e.which===Un.escape&&(Ys()||Qs());return o._keyHandler(e,o._shouldHandleKeyDown,t)},o._shouldHandleKeyDown=function(e){return e.which===Un.escape||o._shouldCloseSubMenu(e)||e.which===Un.up&&(e.altKey||e.metaKey)},o._onKeyUp=function(e){return o._keyHandler(e,o._shouldHandleKeyUp,!0)},o._shouldHandleKeyUp=function(e){var t=o._lastKeyDownWasAltOrMeta&&o._isAltOrMeta(e);return o._lastKeyDownWasAltOrMeta=!1,!!t&&!(Qs()||Ys())},o._keyHandler=function(e,t,n){var r=!1;return t(e)&&(o.dismiss(e,n),e.preventDefault(),e.stopPropagation(),r=!0),r},o._shouldCloseSubMenu=function(e){var t=jn(o.props.theme)?Un.right:Un.left;return!(e.which!==t||!o.props.isSubMenu||o._adjustedFocusZoneProps.direction!==$i.vertical&&(!o._adjustedFocusZoneProps.checkForNoWrap||Ba(e.target,"data-no-horizontal-wrap")))},o._onMenuKeyDown=function(e){var t=o._onKeyDown(e),n=o.props.hoisted.hostElement;if(!t&&n.current){var r=!(!e.altKey&&!e.metaKey),i=e.which===Un.up,a=e.which===Un.down;if(!r&&(i||a)){var s=i?xa(n.current,n.current.lastChild,!0):Sa(n.current,n.current.firstChild,!0);s&&(s.focus(),e.preventDefault(),e.stopPropagation())}}},o._onScroll=function(){o._isScrollIdle||void 0===o._scrollIdleTimeoutId?o._isScrollIdle=!1:(o._async.clearTimeout(o._scrollIdleTimeoutId),o._scrollIdleTimeoutId=void 0),o._scrollIdleTimeoutId=o._async.setTimeout((function(){o._isScrollIdle=!0}),250)},o._onItemMouseEnterBase=function(e,t,n){o._shouldIgnoreMouseEvent()||o._updateFocusOnMouseEvent(e,t,n)},o._onItemMouseMoveBase=function(e,t,n){var r=t.currentTarget,i=o.props.hoisted,a=i.shouldUpdateFocusOnMouseEvent,s=i.gotMouseMove,l=i.targetWindow;a.current&&(s.current=!0,o._isScrollIdle&&void 0===o._enterTimerId&&r!==(null==l?void 0:l.document.activeElement)&&o._updateFocusOnMouseEvent(e,t,n))},o._onMouseItemLeave=function(e,t){var n,r=o.props.hoisted,i=r.expandedMenuItemKey,a=r.hostElement;if(!o._shouldIgnoreMouseEvent()&&(void 0!==o._enterTimerId&&(o._async.clearTimeout(o._enterTimerId),o._enterTimerId=void 0),void 0===i))if(a.current.setActive)try{a.current.setActive()}catch(e){}else null===(n=a.current)||void 0===n||n.focus()},o._onItemMouseDown=function(e,t){e.onMouseDown&&e.onMouseDown(e,t)},o._onItemClick=function(e,t){o._onItemClickBase(e,t,t.currentTarget)},o._onItemClickBase=function(e,t,n){var r=Tu(e),i=o.props.hoisted,a=i.expandedMenuItemKey,s=i.openSubMenu;o._cancelSubMenuTimer(),$s(e)||r&&r.length?e.key!==a&&s(e,n,0!==t.nativeEvent.detail||"mouse"===t.nativeEvent.pointerType):o._executeItemClick(e,t),t.stopPropagation(),t.preventDefault()},o._onAnchorClick=function(e,t){o._executeItemClick(e,t),t.stopPropagation()},o._executeItemClick=function(e,t){if(!e.disabled&&!e.isDisabled){var n=!1;e.onClick?n=!!e.onClick(t,e):o.props.onItemClick&&(n=!!o.props.onItemClick(t,e)),!n&&t.defaultPrevented||o.dismiss(t,!0)}},o._onItemKeyDown=function(e,t){var n=jn(o.props.theme)?Un.left:Un.right;e.disabled||t.which!==n&&t.which!==Un.enter&&(t.which!==Un.down||!t.altKey&&!t.metaKey)||(o.props.hoisted.openSubMenu(e,t.currentTarget,!1),t.preventDefault())},o._cancelSubMenuTimer=function(){void 0!==o._enterTimerId&&(o._async.clearTimeout(o._enterTimerId),o._enterTimerId=void 0)},o._onSubMenuDismiss=function(e,t){t?o.dismiss(e,t):o._mounted&&o.props.hoisted.closeSubMenu()},o._onPointerAndTouchEvent=function(e){o._cancelSubMenuTimer()},o._async=new Zi(o),o._events=new Os(o),Ui(o),xi("ContextualMenu",t,{getMenuClassNames:"styles"}),o.state={contextualMenuItems:void 0,subMenuId:Va("ContextualMenu")},o._id=t.id||Va("ContextualMenu"),o._isScrollIdle=!0,o}return u(t,e),t.prototype.shouldComponentUpdate=function(e,t){return!(!e.shouldUpdateWhenHidden&&this.props.hidden&&e.hidden||Ns(this.props,e)&&Ns(this.state,t))},t.prototype.getSnapshotBeforeUpdate=function(e){var t=this.props.hoisted;return this._isHidden(e)!==this._isHidden(this.props)&&(this._isHidden(this.props)?this._onMenuClosed():this._previousActiveElement=t.targetWindow?t.targetWindow.document.activeElement:void 0),null},t.prototype.componentDidMount=function(){var e=this.props,t=e.hidden,o=e.hoisted;t||(this._previousActiveElement=o.targetWindow?o.targetWindow.document.activeElement:void 0),this._mounted=!0},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose(),this._mounted=!1},t.prototype.render=function(){var e=this,t=this.props.isBeakVisible,o=this.props,n=o.items,r=o.labelElementId,i=o.id,a=o.className,s=o.beakWidth,l=o.directionalHint,c=o.directionalHintForRTL,u=o.alignTargetEdge,p=o.gapSpace,h=o.coverTarget,m=o.ariaLabel,g=o.doNotLayer,v=o.target,b=o.bounds,y=o.useTargetWidth,_=o.useTargetAsMinWidth,C=o.directionalHintFixed,S=o.shouldFocusOnMount,x=o.shouldFocusOnContainer,k=o.title,w=o.styles,I=o.theme,D=o.calloutProps,T=o.onRenderSubMenu,E=void 0===T?this._onRenderSubMenu:T,P=o.onRenderMenuList,M=void 0===P?this._onRenderMenuList:P,R=o.focusZoneProps,N=o.getMenuClassNames,B=o.hoisted,F=B.expandedMenuItemKey,A=B.targetRef,L=B.onMenuFocusCapture,H=B.hostElement,O=B.forwardedRef;this._classNames=N?N(I,a):wu(w,{theme:I,className:a});var z=function e(t){for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.iconProps)return!0;if(r.itemType===Us.Section&&r.sectionProps&&e(r.sectionProps.items))return!0}return!1}(n);this._adjustedFocusZoneProps=d(d({},R),{className:this._classNames.root,isCircularNavigation:!0,handleTabKey:ra.all,direction:this._getFocusZoneDirection()});var W,V=Eu(n),K=F&&!0!==this.props.hidden?this._getSubmenuProps():null;t=void 0===t?this.props.responsiveMode<=pu.medium:t;var U=A.current;if((y||_)&&U&&U.offsetWidth){var G=U.getBoundingClientRect().width-2;y?W={width:G}:_&&(W={minWidth:G})}if(n&&n.length>0){for(var j=0,q=0,Y=n;q<Y.length;q++){var Z=Y[q];if(Z.itemType!==Us.Divider&&Z.itemType!==Us.Header){var X=Z.customOnRenderListLength?Z.customOnRenderListLength:1;j+=X}}var Q=this._classNames.subComponentStyles?this._classNames.subComponentStyles.callout:void 0;return f.createElement(ku.Consumer,null,(function(o){return f.createElement(Cc,d({styles:Q,onRestoreFocus:e._tryFocusPreviousActiveElement},D,{target:v||o.target,isBeakVisible:t,beakWidth:s,directionalHint:l,directionalHintForRTL:c,gapSpace:p,coverTarget:h,doNotLayer:g,className:qr("ms-ContextualMenu-Callout",D&&D.className),setInitialFocus:S,onDismiss:e.props.onDismiss||o.onDismiss,onScroll:e._onScroll,bounds:b,directionalHintFixed:C,alignTargetEdge:u,hidden:e.props.hidden||o.hidden,ref:O}),f.createElement("div",{style:W,ref:H,id:i,className:e._classNames.container,tabIndex:x?0:-1,onKeyDown:e._onMenuKeyDown,onKeyUp:e._onKeyUp,onFocusCapture:L,"aria-label":m,"aria-labelledby":r,role:"menu"},k&&f.createElement("div",{className:e._classNames.title}," ",k," "),n&&n.length?e._renderFocusZone(M({ariaLabel:m,items:n,totalItemCount:j,hasCheckmarks:V,hasIcons:z,defaultMenuItemRenderer:e._defaultMenuItemRenderer,labelElementId:r},e._onRenderMenuList)):null,K&&E(K,e._onRenderSubMenu)))}))}return null},t.prototype._onMenuClosed=function(){var e,t;null===(e=this._tryFocusPreviousActiveElement)||void 0===e||e.call(this,{originalElement:this._previousActiveElement,containsFocus:!0,documentContainsFocus:(null===(t=nt())||void 0===t?void 0:t.hasFocus())||!1})},t.prototype._isHidden=function(e){return!!e.hidden},t.prototype._getFocusZoneDirection=function(){var e=this.props.focusZoneProps;return e&&void 0!==e.direction?e.direction:$i.vertical},t.prototype._onRenderSubMenu=function(e,t){throw Error("ContextualMenuBase: onRenderSubMenu callback is null or undefined. Please ensure to set `onRenderSubMenu` property either manually or with `styled` helper.")},t.prototype._renderFocusZone=function(e){var t=this.props.focusZoneAs,o=void 0===t?vs:t;return f.createElement(o,d({},this._adjustedFocusZoneProps),e)},t.prototype._renderSectionItem=function(e,t,o,n,r){var i=this,a=e.sectionProps;if(a){var s,l;if(a.title){var c=void 0,u="";if("string"==typeof a.title){var p=this._id+a.title.replace(/\s/g,"");c={key:"section-"+a.title+"-title",itemType:Us.Header,text:a.title,id:p},u=p}else p=a.title.id||this._id+a.title.key.replace(/\s/g,""),c=d(d({},a.title),{id:p}),u=p;c&&(l={role:"group","aria-labelledby":u},s=this._renderHeaderMenuItem(c,t,o,n,r))}return a.items&&a.items.length>0?f.createElement("li",{role:"presentation",key:a.key||e.key||"section-"+o},f.createElement("div",d({},l),f.createElement("ul",{className:this._classNames.list,role:"presentation"},a.topDivider&&this._renderSeparator(o,t,!0,!0),s&&this._renderListItem(s,e.key||o,t,e.title),a.items.map((function(e,t){return i._renderMenuItem(e,t,t,a.items.length,n,r)})),a.bottomDivider&&this._renderSeparator(o,t,!1,!0)))):void 0}},t.prototype._renderListItem=function(e,t,o,n){return f.createElement("li",{role:"presentation",title:n,key:t,className:o.item},e)},t.prototype._renderSeparator=function(e,t,o,n){return n||e>0?f.createElement("li",{role:"separator",key:"separator-"+e+(void 0===o?"":o?"-top":"-bottom"),className:t.divider,"aria-hidden":"true"}):null},t.prototype._renderNormalItem=function(e,t,o,n,r,i,a){return e.onRender?e.onRender(d({"aria-posinset":n+1,"aria-setsize":r},e),this.dismiss):e.href?this._renderAnchorMenuItem(e,t,o,n,r,i,a):e.split&&$s(e)?this._renderSplitButton(e,t,o,n,r,i,a):this._renderButtonItem(e,t,o,n,r,i,a)},t.prototype._renderHeaderMenuItem=function(e,t,o,n,r){var i=this.props.contextualMenuItemAs,a=void 0===i?Oc:i,s=e.itemProps,l=e.id,c=s&&Tr(s,Dr);return f.createElement("div",d({id:l,className:this._classNames.header},c,{style:e.style}),f.createElement(a,d({item:e,classNames:t,index:o,onCheckmarkClick:n?this._onItemClick:void 0,hasIcons:r},s)))},t.prototype._renderAnchorMenuItem=function(e,t,o,n,r,i,a){var s=this.props,l=s.contextualMenuItemAs,c=s.hoisted,u=c.expandedMenuItemKey,d=c.openSubMenu;return f.createElement(nu,{item:e,classNames:t,index:o,focusableElementIndex:n,totalItemCount:r,hasCheckmarks:i,hasIcons:a,contextualMenuItemAs:l,onItemMouseEnter:this._onItemMouseEnterBase,onItemMouseLeave:this._onMouseItemLeave,onItemMouseMove:this._onItemMouseMoveBase,onItemMouseDown:this._onItemMouseDown,executeItemClick:this._executeItemClick,onItemClick:this._onAnchorClick,onItemKeyDown:this._onItemKeyDown,expandedMenuItemKey:u,openSubMenu:d,dismissSubMenu:this._onSubMenuDismiss,dismissMenu:this.dismiss})},t.prototype._renderButtonItem=function(e,t,o,n,r,i,a){var s=this.props,l=s.contextualMenuItemAs,c=s.hoisted,u=c.expandedMenuItemKey,d=c.openSubMenu;return f.createElement(ru,{item:e,classNames:t,index:o,focusableElementIndex:n,totalItemCount:r,hasCheckmarks:i,hasIcons:a,contextualMenuItemAs:l,onItemMouseEnter:this._onItemMouseEnterBase,onItemMouseLeave:this._onMouseItemLeave,onItemMouseMove:this._onItemMouseMoveBase,onItemMouseDown:this._onItemMouseDown,executeItemClick:this._executeItemClick,onItemClick:this._onItemClick,onItemClickBase:this._onItemClickBase,onItemKeyDown:this._onItemKeyDown,expandedMenuItemKey:u,openSubMenu:d,dismissSubMenu:this._onSubMenuDismiss,dismissMenu:this.dismiss})},t.prototype._renderSplitButton=function(e,t,o,n,r,i,a){var s=this.props,l=s.contextualMenuItemAs,c=s.hoisted,u=c.expandedMenuItemKey,d=c.openSubMenu;return f.createElement(lu,{item:e,classNames:t,index:o,focusableElementIndex:n,totalItemCount:r,hasCheckmarks:i,hasIcons:a,contextualMenuItemAs:l,onItemMouseEnter:this._onItemMouseEnterBase,onItemMouseLeave:this._onMouseItemLeave,onItemMouseMove:this._onItemMouseMoveBase,onItemMouseDown:this._onItemMouseDown,executeItemClick:this._executeItemClick,onItemClick:this._onItemClick,onItemClickBase:this._onItemClickBase,onItemKeyDown:this._onItemKeyDown,openSubMenu:d,dismissSubMenu:this._onSubMenuDismiss,dismissMenu:this.dismiss,expandedMenuItemKey:u,onTap:this._onPointerAndTouchEvent})},t.prototype._isAltOrMeta=function(e){return e.which===Un.alt||"Meta"===e.key},t.prototype._shouldIgnoreMouseEvent=function(){return!this._isScrollIdle||!this.props.hoisted.gotMouseMove.current},t.prototype._updateFocusOnMouseEvent=function(e,t,o){var n=this,r=o||t.currentTarget,i=this.props,a=i.subMenuHoverDelay,s=void 0===a?250:a,l=i.hoisted,c=l.expandedMenuItemKey,u=l.openSubMenu;e.key!==c&&(void 0!==this._enterTimerId&&(this._async.clearTimeout(this._enterTimerId),this._enterTimerId=void 0),void 0===c&&r.focus(),$s(e)?(t.stopPropagation(),this._enterTimerId=this._async.setTimeout((function(){r.focus(),u(e,r,!0),n._enterTimerId=void 0}),s)):this._enterTimerId=this._async.setTimeout((function(){n._onSubMenuDismiss(t),r.focus(),n._enterTimerId=void 0}),s))},t.prototype._getSubmenuProps=function(){var e=this.props.hoisted,t=e.submenuTarget,o=e.expandedMenuItemKey,n=e.expandedByMouseClick,r=this._findItemByKey(o),i=null;return r&&(i={items:Tu(r),target:t,onDismiss:this._onSubMenuDismiss,isSubMenu:!0,id:this.state.subMenuId,shouldFocusOnMount:!0,shouldFocusOnContainer:n,directionalHint:jn(this.props.theme)?qs.leftTopEdge:qs.rightTopEdge,className:this.props.className,gapSpace:0,isBeakVisible:!1},r.subMenuProps&&Bs(i,r.subMenuProps)),i},t.prototype._findItemByKey=function(e){var t=this.props.items;return this._findItemByKeyFromItems(e,t)},t.prototype._findItemByKeyFromItems=function(e,t){for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.itemType===Us.Section&&r.sectionProps){var i=this._findItemByKeyFromItems(e,r.sectionProps.items);if(i)return i}else if(r.key&&r.key===e)return r}},t}(f.Component),Nu={root:"ms-ContextualMenu",container:"ms-ContextualMenu-container",list:"ms-ContextualMenu-list",header:"ms-ContextualMenu-header",title:"ms-ContextualMenu-title",isopen:"is-open"};function Bu(e){return f.createElement(Fu,d({},e))}var Fu=Vn(Mu,(function(e){var t=e.className,o=e.theme,n=Qo(Nu,o),r=o.fonts,i=o.semanticColors,a=o.effects;return{root:[o.fonts.medium,n.root,n.isopen,{backgroundColor:i.menuBackground,minWidth:"180px"},t],container:[n.container,{selectors:{":focus":{outline:0}}}],list:[n.list,n.isopen,{listStyleType:"none",margin:"0",padding:"0"}],header:[n.header,r.small,{fontWeight:qe.semibold,color:i.menuHeader,background:"none",backgroundColor:"transparent",border:"none",height:Pc,lineHeight:Pc,cursor:"default",padding:"0px 6px",userSelect:"none",textAlign:"left"}],title:[n.title,{fontSize:r.mediumPlus.fontSize,paddingRight:"14px",paddingLeft:"14px",paddingBottom:"5px",paddingTop:"5px",backgroundColor:i.menuItemBackgroundPressed}],subComponentStyles:{callout:{root:{boxShadow:a.elevation8}},menuItem:{}}}}),(function(){return{onRenderSubMenu:Bu}}),{scope:"ContextualMenu"}),Au=Fu;Au.displayName="ContextualMenu";var Lu={msButton:"ms-Button",msButtonHasMenu:"ms-Button--hasMenu",msButtonIcon:"ms-Button-icon",msButtonMenuIcon:"ms-Button-menuIcon",msButtonLabel:"ms-Button-label",msButtonDescription:"ms-Button-description",msButtonScreenReaderText:"ms-Button-screenReaderText",msButtonFlexContainer:"ms-Button-flexContainer",msButtonTextContainer:"ms-Button-textContainer"},Hu=jo((function(e,t,o,n,r,i,a,s,l,c,u){var d,p,h=Qo(Lu,e||{}),m=c&&!u;return In({root:[h.msButton,t.root,n,l&&["is-checked",t.rootChecked],m&&["is-expanded",t.rootExpanded,{selectors:(d={},d[":hover ."+h.msButtonIcon]=t.iconExpandedHovered,d[":hover ."+h.msButtonMenuIcon]=t.menuIconExpandedHovered||t.rootExpandedHovered,d[":hover"]=t.rootExpandedHovered,d)}],s&&[Lu.msButtonHasMenu,t.rootHasMenu],a&&["is-disabled",t.rootDisabled],!a&&!m&&!l&&{selectors:(p={":hover":t.rootHovered},p[":hover ."+h.msButtonLabel]=t.labelHovered,p[":hover ."+h.msButtonIcon]=t.iconHovered,p[":hover ."+h.msButtonDescription]=t.descriptionHovered,p[":hover ."+h.msButtonMenuIcon]=t.menuIconHovered,p[":focus"]=t.rootFocused,p[":active"]=t.rootPressed,p[":active ."+h.msButtonIcon]=t.iconPressed,p[":active ."+h.msButtonDescription]=t.descriptionPressed,p[":active ."+h.msButtonMenuIcon]=t.menuIconPressed,p)},a&&l&&[t.rootCheckedDisabled],!a&&l&&{selectors:{":hover":t.rootCheckedHovered,":active":t.rootCheckedPressed}},o],flexContainer:[h.msButtonFlexContainer,t.flexContainer],textContainer:[h.msButtonTextContainer,t.textContainer],icon:[h.msButtonIcon,r,t.icon,m&&t.iconExpanded,l&&t.iconChecked,a&&t.iconDisabled],label:[h.msButtonLabel,t.label,l&&t.labelChecked,a&&t.labelDisabled],menuIcon:[h.msButtonMenuIcon,i,t.menuIcon,l&&t.menuIconChecked,a&&!u&&t.menuIconDisabled,!a&&!m&&!l&&{selectors:{":hover":t.menuIconHovered,":active":t.menuIconPressed}},m&&["is-expanded",t.menuIconExpanded]],description:[h.msButtonDescription,t.description,l&&t.descriptionChecked,a&&t.descriptionDisabled],screenReaderText:[h.msButtonScreenReaderText,t.screenReaderText]})})),Ou=jo((function(e,t,o,n,r){return{root:Z(e.splitButtonMenuButton,o&&[e.splitButtonMenuButtonExpanded],t&&[e.splitButtonMenuButtonDisabled],n&&!t&&[e.splitButtonMenuButtonChecked],r&&!t&&[{selectors:{":focus":e.splitButtonMenuFocused}}]),splitButtonContainer:Z(e.splitButtonContainer,!t&&n&&[e.splitButtonContainerChecked,{selectors:{":hover":e.splitButtonContainerCheckedHovered}}],!t&&!n&&[{selectors:{":hover":e.splitButtonContainerHovered,":focus":e.splitButtonContainerFocused}}],t&&e.splitButtonContainerDisabled),icon:Z(e.splitButtonMenuIcon,t&&e.splitButtonMenuIconDisabled,!t&&r&&e.splitButtonMenuIcon),flexContainer:Z(e.splitButtonFlexContainer),divider:Z(e.splitButtonDivider,(r||t)&&e.splitButtonDividerDisabled)}})),zu="BaseButton",Wu=function(e){function t(t){var o=e.call(this,t)||this;return o._buttonElement=f.createRef(),o._splitButtonContainer=f.createRef(),o._mergedRef=ga(),o._renderedVisibleMenu=!1,o._getMemoizedMenuButtonKeytipProps=jo((function(e){return d(d({},e),{hasMenu:!0})})),o._onRenderIcon=function(e,t){var n=o.props.iconProps;if(n&&(void 0!==n.iconName||n.imageProps)){var r=n.className,i=n.imageProps,a=p(n,["className","imageProps"]);if(n.styles)return f.createElement(ii,d({className:qr(o._classNames.icon,r),imageProps:i},a));if(n.iconName)return f.createElement(ti,d({className:qr(o._classNames.icon,r)},a));if(i)return f.createElement(js,d({className:qr(o._classNames.icon,r),imageProps:i},a))}return null},o._onRenderTextContents=function(){var e=o.props,t=e.text,n=e.children,r=e.secondaryText,i=void 0===r?o.props.description:r,a=e.onRenderText,s=void 0===a?o._onRenderText:a,l=e.onRenderDescription,c=void 0===l?o._onRenderDescription:l;return t||"string"==typeof n||i?f.createElement("span",{className:o._classNames.textContainer},s(o.props,o._onRenderText),c(o.props,o._onRenderDescription)):[s(o.props,o._onRenderText),c(o.props,o._onRenderDescription)]},o._onRenderText=function(){var e=o.props.text,t=o.props.children;return void 0===e&&"string"==typeof t&&(e=t),o._hasText()?f.createElement("span",{key:o._labelId,className:o._classNames.label,id:o._labelId},e):null},o._onRenderChildren=function(){var e=o.props.children;return"string"==typeof e?null:e},o._onRenderDescription=function(e){var t=e.secondaryText,n=void 0===t?o.props.description:t;return n?f.createElement("span",{key:o._descriptionId,className:o._classNames.description,id:o._descriptionId},n):null},o._onRenderAriaDescription=function(){var e=o.props.ariaDescription;return e?f.createElement("span",{className:o._classNames.screenReaderText,id:o._ariaDescriptionId},e):null},o._onRenderMenuIcon=function(e){var t=o.props.menuIconProps;return f.createElement(ti,d({iconName:"ChevronDown"},t,{className:o._classNames.menuIcon}))},o._onRenderMenu=function(e){var t=o.props.persistMenu,n=o.state.menuHidden,r=o.props.menuAs||Au;return e.ariaLabel||e.labelElementId||!o._hasText()||(e=d(d({},e),{labelElementId:o._labelId})),f.createElement(r,d({id:o._labelId+"-menu",directionalHint:qs.bottomLeftEdge},e,{shouldFocusOnContainer:o._menuShouldFocusOnContainer,shouldFocusOnMount:o._menuShouldFocusOnMount,hidden:t?n:void 0,className:qr("ms-BaseButton-menuhost",e.className),target:o._isSplitButton?o._splitButtonContainer.current:o._buttonElement.current,onDismiss:o._onDismissMenu}))},o._onDismissMenu=function(e){var t=o.props.menuProps;t&&t.onDismiss&&t.onDismiss(e),e&&e.defaultPrevented||o._dismissMenu()},o._dismissMenu=function(){o._menuShouldFocusOnMount=void 0,o._menuShouldFocusOnContainer=void 0,o.setState({menuHidden:!0})},o._openMenu=function(e,t){void 0===t&&(t=!0),o.props.menuProps&&(o._menuShouldFocusOnContainer=e,o._menuShouldFocusOnMount=t,o._renderedVisibleMenu=!0,o.setState({menuHidden:!1}))},o._onToggleMenu=function(e){var t=!0;o.props.menuProps&&!1===o.props.menuProps.shouldFocusOnMount&&(t=!1),o.state.menuHidden?o._openMenu(e,t):o._dismissMenu()},o._onSplitContainerFocusCapture=function(e){var t=o._splitButtonContainer.current;!t||e.target&&ns(e.target,t)||t.focus()},o._onSplitButtonPrimaryClick=function(e){o.state.menuHidden||o._dismissMenu(),!o._processingTouch&&o.props.onClick?o.props.onClick(e):o._processingTouch&&o._onMenuClick(e)},o._onKeyDown=function(e){!o.props.disabled||e.which!==Un.enter&&e.which!==Un.space?o.props.disabled||(o.props.menuProps?o._onMenuKeyDown(e):void 0!==o.props.onKeyDown&&o.props.onKeyDown(e)):(e.preventDefault(),e.stopPropagation())},o._onKeyUp=function(e){o.props.disabled||void 0===o.props.onKeyUp||o.props.onKeyUp(e)},o._onKeyPress=function(e){o.props.disabled||void 0===o.props.onKeyPress||o.props.onKeyPress(e)},o._onMouseUp=function(e){o.props.disabled||void 0===o.props.onMouseUp||o.props.onMouseUp(e)},o._onMouseDown=function(e){o.props.disabled||void 0===o.props.onMouseDown||o.props.onMouseDown(e)},o._onClick=function(e){o.props.disabled||(o.props.menuProps?o._onMenuClick(e):void 0!==o.props.onClick&&o.props.onClick(e))},o._onSplitButtonContainerKeyDown=function(e){e.which===Un.enter||e.which===Un.space?o._buttonElement.current&&(o._buttonElement.current.click(),e.preventDefault(),e.stopPropagation()):o._onMenuKeyDown(e)},o._onMenuKeyDown=function(e){if(!o.props.disabled){o.props.onKeyDown&&o.props.onKeyDown(e);var t=e.which===Un.up,n=e.which===Un.down;if(!e.defaultPrevented&&o._isValidMenuOpenKey(e)){var r=o.props.onMenuClick;r&&r(e,o.props),o._onToggleMenu(!1),e.preventDefault(),e.stopPropagation()}e.which!==Un.enter&&e.which!==Un.space||Do(!0,e.target),e.altKey||e.metaKey||!t&&!n||!o.state.menuHidden&&o.props.menuProps&&((void 0!==o._menuShouldFocusOnMount?o._menuShouldFocusOnMount:o.props.menuProps.shouldFocusOnMount)||(e.preventDefault(),e.stopPropagation(),o._menuShouldFocusOnMount=!0,o.forceUpdate()))}},o._onTouchStart=function(){o._isSplitButton&&o._splitButtonContainer.current&&!("onpointerdown"in o._splitButtonContainer.current)&&o._handleTouchAndPointerEvent()},o._onMenuClick=function(e){var t=o.props.onMenuClick;if(t&&t(e,o.props),!e.defaultPrevented){var n=0!==e.nativeEvent.detail||"mouse"===e.nativeEvent.pointerType;o._onToggleMenu(n),e.preventDefault(),e.stopPropagation()}},Ui(o),o._async=new Zi(o),o._events=new Os(o),Si(zu,t,["menuProps","onClick"],"split",o.props.split),xi(zu,t,{rootProps:void 0,description:"secondaryText",toggled:"checked"}),o._labelId=Va(),o._descriptionId=Va(),o._ariaDescriptionId=Va(),o.state={menuHidden:!0},o}return u(t,e),Object.defineProperty(t.prototype,"_isSplitButton",{get:function(){return!!this.props.menuProps&&!!this.props.onClick&&!0===this.props.split},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e,t=this.props,o=t.ariaDescription,n=t.ariaLabel,r=t.ariaHidden,i=t.className,a=t.disabled,s=t.allowDisabledFocus,l=t.primaryDisabled,c=t.secondaryText,u=void 0===c?this.props.description:c,d=t.href,p=t.iconProps,h=t.menuIconProps,m=t.styles,g=t.checked,f=t.variantClassName,v=t.theme,b=t.toggle,y=t.getClassNames,_=t.role,C=this.state.menuHidden,S=a||l;this._classNames=y?y(v,i,f,p&&p.className,h&&h.className,S,g,!C,!!this.props.menuProps,this.props.split,!!s):Hu(v,m,i,f,p&&p.className,h&&h.className,S,!!this.props.menuProps,g,!C,this.props.split);var x=this,k=x._ariaDescriptionId,w=x._labelId,I=x._descriptionId,D=!S&&!!d,T=D?"a":"button",E=Tr(Bs(D?{}:{type:"button"},this.props.rootProps,this.props),D?dr:pr,["disabled"]),P=n||E["aria-label"],M=void 0;o?M=k:u&&this.props.onRenderDescription!==Vs?M=I:E["aria-describedby"]&&(M=E["aria-describedby"]);var R=void 0;E["aria-labelledby"]?R=E["aria-labelledby"]:M&&!P&&(R=this._hasText()?w:void 0);var N=!(!1===this.props["data-is-focusable"]||a&&!s||this._isSplitButton),B="menuitemcheckbox"===_||"checkbox"===_,F=B||!0===b?!!g:void 0,A=Bs(E,((e={className:this._classNames.root,ref:this._mergedRef(this.props.elementRef,this._buttonElement),disabled:S&&!s,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseDown:this._onMouseDown,onMouseUp:this._onMouseUp,onClick:this._onClick,"aria-label":P,"aria-labelledby":R,"aria-describedby":M,"aria-disabled":S,"data-is-focusable":N})[B?"aria-checked":"aria-pressed"]=F,e));if(r&&(A["aria-hidden"]=!0),this._isSplitButton)return this._onRenderSplitButtonContent(T,A);if(this.props.menuProps){var L=this.props.menuProps.id,H=void 0===L?this._labelId+"-menu":L;Bs(A,{"aria-expanded":!C,"aria-controls":C?null:H,"aria-haspopup":!0})}return this._onRenderContent(T,A)},t.prototype.componentDidMount=function(){this._isSplitButton&&this._splitButtonContainer.current&&("onpointerdown"in this._splitButtonContainer.current&&this._events.on(this._splitButtonContainer.current,"pointerdown",this._onPointerDown,!0),"onpointerup"in this._splitButtonContainer.current&&this.props.onPointerUp&&this._events.on(this._splitButtonContainer.current,"pointerup",this.props.onPointerUp,!0))},t.prototype.componentDidUpdate=function(e,t){this.props.onAfterMenuDismiss&&!t.menuHidden&&this.state.menuHidden&&this.props.onAfterMenuDismiss()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.focus=function(){this._isSplitButton&&this._splitButtonContainer.current?(Do(!0),this._splitButtonContainer.current.focus()):this._buttonElement.current&&(Do(!0),this._buttonElement.current.focus())},t.prototype.dismissMenu=function(){this._dismissMenu()},t.prototype.openMenu=function(e,t){this._openMenu(e,t)},t.prototype._onRenderContent=function(e,t){var o=this,n=this.props,r=e,i=n.menuIconProps,a=n.menuProps,s=n.onRenderIcon,l=void 0===s?this._onRenderIcon:s,c=n.onRenderAriaDescription,u=void 0===c?this._onRenderAriaDescription:c,p=n.onRenderChildren,h=void 0===p?this._onRenderChildren:p,m=n.onRenderMenu,g=void 0===m?this._onRenderMenu:m,v=n.onRenderMenuIcon,b=void 0===v?this._onRenderMenuIcon:v,y=n.disabled,_=n.keytipProps;_&&a&&(_=this._getMemoizedMenuButtonKeytipProps(_));var C=function(e){return f.createElement(r,d({},t,e),f.createElement("span",{className:o._classNames.flexContainer,"data-automationid":"splitbuttonprimary"},l(n,o._onRenderIcon),o._onRenderTextContents(),u(n,o._onRenderAriaDescription),h(n,o._onRenderChildren),!o._isSplitButton&&(a||i||o.props.onRenderMenuIcon)&&b(o.props,o._onRenderMenuIcon),a&&!a.doNotLayer&&o._shouldRenderMenu()&&g(a,o._onRenderMenu)))},S=_?f.createElement(ou,{keytipProps:this._isSplitButton?void 0:_,ariaDescribedBy:t["aria-describedby"],disabled:y},(function(e){return C(e)})):C();return a&&a.doNotLayer?f.createElement(f.Fragment,null,S,this._shouldRenderMenu()&&g(a,this._onRenderMenu)):f.createElement(f.Fragment,null,S,f.createElement(ks,null))},t.prototype._shouldRenderMenu=function(){var e=this.state.menuHidden,t=this.props,o=t.persistMenu,n=t.renderPersistedMenuHiddenOnMount;return!e||!(!o||!this._renderedVisibleMenu&&!n)},t.prototype._hasText=function(){return null!==this.props.text&&(void 0!==this.props.text||"string"==typeof this.props.children)},t.prototype._onRenderSplitButtonContent=function(e,t){var o=this,n=this.props,r=n.styles,i=void 0===r?{}:r,a=n.disabled,s=n.allowDisabledFocus,l=n.checked,c=n.getSplitButtonClassNames,u=n.primaryDisabled,p=n.menuProps,h=n.toggle,m=n.role,g=n.primaryActionButtonProps,v=this.props.keytipProps,b=this.state.menuHidden,y=c?c(!!a,!b,!!l,!!s):i&&Ou(i,!!a,!b,!!l,!!u);Bs(t,{onClick:void 0,onPointerDown:void 0,onPointerUp:void 0,tabIndex:-1,"data-is-focusable":!1}),v&&p&&(v=this._getMemoizedMenuButtonKeytipProps(v));var _=Tr(t,[],["disabled"]);g&&Bs(t,g);var C=function(n){return f.createElement("div",d({},_,{"data-ktp-target":n?n["data-ktp-target"]:void 0,role:m||"button","aria-disabled":a,"aria-haspopup":!0,"aria-expanded":!b,"aria-pressed":h?!!l:void 0,"aria-describedby":Ks(t["aria-describedby"],n?n["aria-describedby"]:void 0),className:y&&y.splitButtonContainer,onKeyDown:o._onSplitButtonContainerKeyDown,onTouchStart:o._onTouchStart,ref:o._splitButtonContainer,"data-is-focusable":!0,onClick:a||u?void 0:o._onSplitButtonPrimaryClick,tabIndex:!a&&!u||s?0:void 0,"aria-roledescription":t["aria-roledescription"],onFocusCapture:o._onSplitContainerFocusCapture}),f.createElement("span",{style:{display:"flex"}},o._onRenderContent(e,t),o._onRenderSplitButtonMenuButton(y,n),o._onRenderSplitButtonDivider(y)))};return v?f.createElement(ou,{keytipProps:v,disabled:a},(function(e){return C(e)})):C()},t.prototype._onRenderSplitButtonDivider=function(e){return e&&e.divider?f.createElement("span",{className:e.divider,"aria-hidden":!0,onClick:function(e){e.stopPropagation()}}):null},t.prototype._onRenderSplitButtonMenuButton=function(e,o){var n=this.props,r=n.allowDisabledFocus,i=n.checked,a=n.disabled,s=n.splitButtonMenuProps,l=n.splitButtonAriaLabel,c=n.primaryDisabled,u=this.state.menuHidden,p=this.props.menuIconProps;void 0===p&&(p={iconName:"ChevronDown"});var h=d(d({},s),{styles:e,checked:i,disabled:a,allowDisabledFocus:r,onClick:this._onMenuClick,menuProps:void 0,iconProps:d(d({},p),{className:this._classNames.menuIcon}),ariaLabel:l,"aria-haspopup":!0,"aria-expanded":!u,"data-is-focusable":!1});return f.createElement(t,d({},h,{"data-ktp-execute-target":o?o["data-ktp-execute-target"]:o,onMouseDown:this._onMouseDown,tabIndex:c&&!r?0:-1}))},t.prototype._onPointerDown=function(e){var t=this.props.onPointerDown;t&&t(e),"touch"===e.pointerType&&(this._handleTouchAndPointerEvent(),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._handleTouchAndPointerEvent=function(){var e=this;void 0!==this._lastTouchTimeoutId&&(this._async.clearTimeout(this._lastTouchTimeoutId),this._lastTouchTimeoutId=void 0),this._processingTouch=!0,this._lastTouchTimeoutId=this._async.setTimeout((function(){e._processingTouch=!1,e._lastTouchTimeoutId=void 0,e.focus()}),500)},t.prototype._isValidMenuOpenKey=function(e){return this.props.menuTriggerKeyCode?e.which===this.props.menuTriggerKeyCode:!!this.props.menuProps&&e.which===Un.down&&(e.altKey||e.metaKey)},t.defaultProps={baseClassName:"ms-Button",styles:{},split:!1},t}(f.Component);function Vu(e,t,o){return function(n){var r,i=((r=function(r){function i(e){var t=r.call(this,e)||this;return t._styleCache={},t._onSettingChanged=t._onSettingChanged.bind(t),t}return u(i,r),i.prototype.componentDidMount=function(){Dt.observe(this._onSettingChanged)},i.prototype.componentWillUnmount=function(){Dt.unobserve(this._onSettingChanged)},i.prototype.render=function(){var r=this;return f.createElement(On.Consumer,null,(function(i){var a=Dt.getSettings(t,e,i.customizations),s=r.props;if(a.styles&&"function"==typeof a.styles&&(a.styles=a.styles(d(d({},a),s))),o&&a.styles){if(r._styleCache.default!==a.styles||r._styleCache.component!==s.styles){var l=kn(a.styles,s.styles);r._styleCache.default=a.styles,r._styleCache.component=s.styles,r._styleCache.merged=l}return f.createElement(n,d({},a,s,{styles:r._styleCache.merged}))}return f.createElement(n,d({},a,s))}))},i.prototype._onSettingChanged=function(){this.forceUpdate()},i}(f.Component)).displayName="Customized"+e,r);return mu(n,i)}}var Ku,Uu={outline:0},Gu=function(e){return{fontSize:e,margin:"0 4px",height:"16px",lineHeight:"16px",textAlign:"center",flexShrink:0}},ju=jo((function(e){var t,o,n=e.semanticColors,r=e.effects,i=e.fonts,a=n.buttonBorder,s=n.disabledBackground,l=n.disabledText,c={left:-2,top:-2,bottom:-2,right:-2,outlineColor:"ButtonText"};return{root:[To(e,{inset:1,highContrastStyle:c,borderColor:"transparent"}),e.fonts.medium,{boxSizing:"border-box",border:"1px solid "+a,userSelect:"none",display:"inline-block",textDecoration:"none",textAlign:"center",cursor:"pointer",padding:"0 16px",borderRadius:r.roundedCorner2,selectors:{":active > *":{position:"relative",left:0,top:0}}}],rootDisabled:[To(e,{inset:1,highContrastStyle:c,borderColor:"transparent"}),{backgroundColor:s,borderColor:s,color:l,cursor:"default",selectors:{":hover":Uu,":focus":Uu}}],iconDisabled:{color:l,selectors:(t={},t[ro]={color:"GrayText"},t)},menuIconDisabled:{color:l,selectors:(o={},o[ro]={color:"GrayText"},o)},flexContainer:{display:"flex",height:"100%",flexWrap:"nowrap",justifyContent:"center",alignItems:"center"},description:{display:"block"},textContainer:{flexGrow:1,display:"block"},icon:Gu(i.mediumPlus.fontSize),menuIcon:Gu(i.small.fontSize),label:{margin:"0 4px",lineHeight:"100%",display:"block"},screenReaderText:Ro}})),qu=jo((function(e,t){var o,n,r,i,a,s,l,c,u,p,h,m,g,f=e.effects,v=e.palette,b=e.semanticColors,y={left:-2,top:-2,bottom:-2,right:-2,border:"none"},_={position:"absolute",width:1,right:31,top:8,bottom:8};return kn({splitButtonContainer:[To(e,{highContrastStyle:y,inset:2}),{display:"inline-flex",selectors:{".ms-Button--default":{borderTopRightRadius:"0",borderBottomRightRadius:"0",borderRight:"none"},".ms-Button--primary":{borderTopRightRadius:"0",borderBottomRightRadius:"0",border:"none",selectors:(o={},o[ro]=d({color:"WindowText",backgroundColor:"Window",border:"1px solid WindowText",borderRightWidth:"0"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)},".ms-Button--primary + .ms-Button":{border:"none",selectors:(n={},n[ro]={border:"1px solid WindowText",borderLeftWidth:"0"},n)}}}],splitButtonContainerHovered:{selectors:{".ms-Button--primary":{selectors:(r={},r[ro]={color:"Window",backgroundColor:"Highlight"},r)},".ms-Button.is-disabled":{color:b.buttonTextDisabled,selectors:(i={},i[ro]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},i)}}},splitButtonContainerChecked:{selectors:{".ms-Button--primary":{selectors:(a={},a[ro]=d({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a)}}},splitButtonContainerCheckedHovered:{selectors:{".ms-Button--primary":{selectors:(s={},s[ro]=d({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s)}}},splitButtonContainerFocused:{outline:"none!important"},splitButtonMenuButton:(l={padding:6,height:"auto",boxSizing:"border-box",borderRadius:0,borderTopRightRadius:f.roundedCorner2,borderBottomRightRadius:f.roundedCorner2,border:"1px solid "+v.neutralSecondaryAlt,borderLeft:"none",outline:"transparent",userSelect:"none",display:"inline-block",textDecoration:"none",textAlign:"center",cursor:"pointer",verticalAlign:"top",width:32,marginLeft:-1,marginTop:0,marginRight:0,marginBottom:0},l[ro]={".ms-Button-menuIcon":{color:"WindowText"}},l),splitButtonDivider:d(d({},_),{selectors:(c={},c[ro]={backgroundColor:"WindowText"},c)}),splitButtonDividerDisabled:d(d({},_),{selectors:(u={},u[ro]={backgroundColor:"GrayText"},u)}),splitButtonMenuButtonDisabled:{pointerEvents:"none",border:"none",selectors:(p={":hover":{cursor:"default"},".ms-Button--primary":{selectors:(h={},h[ro]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},h)},".ms-Button-menuIcon":{selectors:(m={},m[ro]={color:"GrayText"},m)}},p[ro]={color:"GrayText",border:"1px solid GrayText",backgroundColor:"Window"},p)},splitButtonFlexContainer:{display:"flex",height:"100%",flexWrap:"nowrap",justifyContent:"center",alignItems:"center"},splitButtonContainerDisabled:{outline:"none",border:"none",selectors:(g={},g[ro]=d({color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),g)},splitButtonMenuFocused:d({},To(e,{highContrastStyle:y,inset:2}))},t)})),Yu=jo((function(e,t){var o,n=ju(e),r=qu(e),i=e.palette;return kn(n,{root:{padding:"0 4px",width:"32px",height:"32px",backgroundColor:"transparent",border:"none",color:e.semanticColors.link},rootHovered:{color:i.themeDarkAlt,backgroundColor:i.neutralLighter,selectors:(o={},o[ro]={borderColor:"Highlight",color:"Highlight"},o)},rootHasMenu:{width:"auto"},rootPressed:{color:i.themeDark,backgroundColor:i.neutralLight},rootExpanded:{color:i.themeDark,backgroundColor:i.neutralLight},rootChecked:{color:i.themeDark,backgroundColor:i.neutralLight},rootCheckedHovered:{color:i.themeDark,backgroundColor:i.neutralQuaternaryAlt},rootDisabled:{color:i.neutralTertiaryAlt}},r,t)})),Zu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return f.createElement(Wu,d({},this.props,{variantClassName:"ms-Button--icon",styles:Yu(o,t),onRenderText:Vs,onRenderDescription:Vs}))},h([Vu("IconButton",["theme","styles"],!0)],t)}(f.Component);!function(e){e[e.horizontal=0]="horizontal",e[e.vertical=1]="vertical"}(Ku||(Ku={}));var Xu=function(){var e={};return{getCachedMeasurement:function(t){if(t&&t.cacheKey&&e.hasOwnProperty(t.cacheKey))return e[t.cacheKey]},addMeasurementToCache:function(t,o){t.cacheKey&&(e[t.cacheKey]=o)}}},Qu=function(e){void 0===e&&(e=Xu());var t,o=e;function n(e,t){var n=o.getCachedMeasurement(e);if(void 0!==n)return n;var r=t();return o.addMeasurementToCache(e,r),r}function r(e,r,i){for(var a=e,s=n(e,i);s>t;){var l=r(a);if(void 0===l)return{renderedData:a,resizeDirection:void 0,dataToMeasure:void 0};if(void 0===(s=o.getCachedMeasurement(l)))return{dataToMeasure:l,resizeDirection:"shrink"};a=l}return{renderedData:a,resizeDirection:void 0,dataToMeasure:void 0}}return{getNextState:function(e,i,a,s){if(void 0!==s||void 0!==i.dataToMeasure){if(s){if(t&&i.renderedData&&!i.dataToMeasure)return d(d({},i),function(e,o,n,r){var i;return i=e>t?r?{resizeDirection:"grow",dataToMeasure:r(n)}:{resizeDirection:"shrink",dataToMeasure:o}:{resizeDirection:"shrink",dataToMeasure:n},t=e,d(d({},i),{measureContainer:!1})}(s,e.data,i.renderedData,e.onGrowData));t=s}var l=d(d({},i),{measureContainer:!1});return i.dataToMeasure&&(l="grow"===i.resizeDirection&&e.onGrowData?d(d({},l),function(e,i,a,s){for(var l=e,c=n(e,a);c<t;){var u=i(l);if(void 0===u)return{renderedData:l,resizeDirection:void 0,dataToMeasure:void 0};if(void 0===(c=o.getCachedMeasurement(u)))return{dataToMeasure:u};l=u}return d({resizeDirection:"shrink"},r(l,s,a))}(i.dataToMeasure,e.onGrowData,a,e.onReduceData)):d(d({},l),r(i.dataToMeasure,e.onReduceData,a))),l}},shouldRenderDataForMeasurement:function(e){return!(!e||void 0!==o.getCachedMeasurement(e))},getInitialResizeGroupState:function(e){return{dataToMeasure:d({},e),resizeDirection:"grow",measureContainer:!0}}}},Ju=f.createContext({isMeasured:!1}),$u={position:"fixed",visibility:"hidden"},ed={position:"relative"};function td(e,t){var o;switch(t.type){case"resizeData":return d({},t.value);case"dataToMeasure":return d(d({},e),{dataToMeasure:t.value,resizeDirection:"grow",measureContainer:!0});default:return d(d({},e),((o={})[t.type]=t.value,o))}}var od={isMeasured:!0},nd=f.forwardRef((function(e,t){var o=f.useRef(null),n=Or(o,t),r=function(e,t){var o=Ei(Qu),n=f.useRef(null),r=f.useRef(null),i=f.useRef(!1),a=Al(),s=function(e,t,o){var n=Ei((function(){return t.getInitialResizeGroupState(e.data)})),r=f.useReducer(td,n),i=r[0],a=r[1];f.useEffect((function(){a({type:"dataToMeasure",value:e.data})}),[e.data]);var s=f.useRef(n);return s.current=d({},i),[s,f.useCallback((function(e){e&&a({type:"resizeData",value:e})}),[]),f.useCallback((function(){o.current&&a({type:"measureContainer",value:!0})}),[o])]}(e,o,t),l=s[0],c=s[1],u=s[2];f.useEffect((function(){var t;l.current.renderedData&&(i.current=!0,null===(t=e.dataDidRender)||void 0===t||t.call(e,l.current.renderedData))})),f.useEffect((function(){a.requestAnimationFrame((function(){var a=void 0;if(l.current.measureContainer&&t.current){var s=t.current.getBoundingClientRect();a=e.direction===Ku.vertical?s.height:s.width}var u=o.getNextState(e,l.current,(function(){var t=i.current?r:n;return t.current?e.direction===Ku.vertical?t.current.scrollHeight:t.current.scrollWidth:0}),a);c(u)}))})),Ll(Ol(),"resize",a.debounce(u,16,{leading:!0}));var p=o.shouldRenderDataForMeasurement(l.current.dataToMeasure),h=!i.current&&p;return[l.current.dataToMeasure,l.current.renderedData,u,n,r,p,h]}(e,o),i=r[0],a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],p=r[6];f.useImperativeHandle(e.componentRef,(function(){return{remeasure:s}}),[s]),function(e){Mi({name:"ResizeGroup",props:e,deprecations:{styles:"className"}})}(e);var h=e.className,m=e.onRenderData,g=Tr(e,Dr,["data"]);return f.createElement("div",d({},g,{className:h,ref:n}),f.createElement("div",{style:ed},u&&!p&&f.createElement("div",{style:$u,ref:c},f.createElement(Ju.Provider,{value:od},m(i))),f.createElement("div",{ref:l,style:p?$u:void 0,"data-automation-id":"visibleContent"},p?m(i):a&&m(a))))}));nd.displayName="ResizeGroupBase";var rd,id=nd;function ad(e){return e.clientWidth<e.scrollWidth}function sd(e){return e.clientHeight<e.scrollHeight}function ld(e){return ad(e)||sd(e)}!function(e){e[e.Parent=0]="Parent",e[e.Self=1]="Self"}(rd||(rd={}));var cd,ud=Jn(),dd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._onRenderContent=function(e){return"string"==typeof e.content?f.createElement("p",{className:t._classNames.subText},e.content):f.createElement("div",{className:t._classNames.subText},e.content)},t}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.calloutProps,n=e.directionalHint,r=e.directionalHintForRTL,i=e.styles,a=e.id,s=e.maxWidth,l=e.onRenderContent,c=void 0===l?this._onRenderContent:l,u=e.targetElement,p=e.theme;return this._classNames=ud(i,{theme:p,className:t||o&&o.className,beakWidth:o&&o.beakWidth,gapSpace:o&&o.gapSpace,maxWidth:s}),f.createElement(Cc,d({target:u,directionalHint:n,directionalHintForRTL:r},o,Tr(this.props,Dr,["id"]),{className:this._classNames.root}),f.createElement("div",{className:this._classNames.content,id:a,role:"tooltip",onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},c(this.props,this._onRenderContent)))},t.defaultProps={directionalHint:qs.topCenter,maxWidth:"364px",calloutProps:{isBeakVisible:!0,beakWidth:16,gapSpace:0,setInitialFocus:!0,doNotLayer:!1}},t}(f.Component),pd=Vn(dd,(function(e){var t=e.className,o=e.beakWidth,n=void 0===o?16:o,r=e.gapSpace,i=void 0===r?0:r,a=e.maxWidth,s=e.theme,l=s.semanticColors,c=s.fonts,u=s.effects,d=-(Math.sqrt(n*n/2)+i)+1/window.devicePixelRatio;return{root:["ms-Tooltip",s.fonts.medium,Ze.fadeIn200,{background:l.menuBackground,boxShadow:u.elevation8,padding:"8px",maxWidth:a,selectors:{":after":{content:"''",position:"absolute",bottom:d,left:d,right:d,top:d,zIndex:0}}},t],content:["ms-Tooltip-content",c.small,{position:"relative",zIndex:1,color:l.menuItemText,wordWrap:"break-word",overflowWrap:"break-word",overflow:"hidden"}],subText:["ms-Tooltip-subtext",{fontSize:"inherit",fontWeight:"inherit",color:"inherit",margin:0}]}}),void 0,{scope:"Tooltip"});!function(e){e[e.zero=0]="zero",e[e.medium=1]="medium",e[e.long=2]="long"}(cd||(cd={}));var hd,md,gd=Jn(),fd=function(e){function t(o){var n=e.call(this,o)||this;return n._tooltipHost=f.createRef(),n._defaultTooltipId=Va("tooltip"),n.show=function(){n._toggleTooltip(!0)},n.dismiss=function(){n._hideTooltip()},n._getTargetElement=function(){if(n._tooltipHost.current){var e=n.props.overflowMode;if(void 0!==e)switch(e){case rd.Parent:return n._tooltipHost.current.parentElement;case rd.Self:return n._tooltipHost.current}return n._tooltipHost.current}},n._onTooltipFocus=function(e){n._ignoreNextFocusEvent?n._ignoreNextFocusEvent=!1:n._onTooltipMouseEnter(e)},n._onTooltipBlur=function(e){n._ignoreNextFocusEvent=(null===document||void 0===document?void 0:document.activeElement)===e.target,n._hideTooltip()},n._onTooltipMouseEnter=function(e){var o=n.props,r=o.overflowMode,i=o.delay;if(t._currentVisibleTooltip&&t._currentVisibleTooltip!==n&&t._currentVisibleTooltip.dismiss(),t._currentVisibleTooltip=n,void 0!==r){var a=n._getTargetElement();if(a&&!ld(a))return}if(!e.target||!ns(e.target,n._getTargetElement()))if(n._clearDismissTimer(),n._clearOpenTimer(),i!==cd.zero){n.setState({isAriaPlaceholderRendered:!0});var s=n._getDelayTime(i);n._openTimerId=n._async.setTimeout((function(){n._toggleTooltip(!0)}),s)}else n._toggleTooltip(!0)},n._onTooltipMouseLeave=function(e){var o=n.props.closeDelay;n._clearDismissTimer(),n._clearOpenTimer(),o?n._dismissTimerId=n._async.setTimeout((function(){n._toggleTooltip(!1)}),o):n._toggleTooltip(!1),t._currentVisibleTooltip===n&&(t._currentVisibleTooltip=void 0)},n._onTooltipKeyDown=function(e){(e.which===Un.escape||e.ctrlKey)&&n.state.isTooltipVisible&&(n._hideTooltip(),e.stopPropagation())},n._clearDismissTimer=function(){n._async.clearTimeout(n._dismissTimerId)},n._clearOpenTimer=function(){n._async.clearTimeout(n._openTimerId)},n._hideTooltip=function(){n._clearOpenTimer(),n._clearDismissTimer(),n._toggleTooltip(!1)},n._toggleTooltip=function(e){n.state.isTooltipVisible!==e&&n.setState({isAriaPlaceholderRendered:!1,isTooltipVisible:e},(function(){return n.props.onTooltipToggle&&n.props.onTooltipToggle(e)}))},n._getDelayTime=function(e){switch(e){case cd.medium:return 300;case cd.long:return 500;default:return 0}},Ui(n),n.state={isAriaPlaceholderRendered:!1,isTooltipVisible:!1},n._async=new Zi(n),n}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.calloutProps,o=e.children,n=e.content,r=e.directionalHint,i=e.directionalHintForRTL,a=e.hostClassName,s=e.id,l=e.setAriaDescribedBy,c=void 0===l||l,u=e.tooltipProps,p=e.styles,h=e.theme;this._classNames=gd(p,{theme:h,className:a});var m=this.state,g=m.isAriaPlaceholderRendered,v=m.isTooltipVisible,b=s||this._defaultTooltipId,y=!!(n||u&&u.onRenderContent&&u.onRenderContent()),_=v&&y,C=c&&v&&y?b:void 0;return f.createElement("div",d({className:this._classNames.root,ref:this._tooltipHost},{onFocusCapture:this._onTooltipFocus},{onBlurCapture:this._onTooltipBlur},{onMouseEnter:this._onTooltipMouseEnter,onMouseLeave:this._onTooltipMouseLeave,onKeyDown:this._onTooltipKeyDown,role:"none","aria-describedby":C}),o,_&&f.createElement(pd,d({id:b,content:n,targetElement:this._getTargetElement(),directionalHint:r,directionalHintForRTL:i,calloutProps:Bs({},t,{onDismiss:this._hideTooltip,onMouseEnter:this._onTooltipMouseEnter,onMouseLeave:this._onTooltipMouseLeave}),onMouseEnter:this._onTooltipMouseEnter,onMouseLeave:this._onTooltipMouseLeave},Tr(this.props,Dr),u)),g&&f.createElement("div",{id:b,role:"none",style:Ro},n))},t.prototype.componentWillUnmount=function(){t._currentVisibleTooltip&&t._currentVisibleTooltip===this&&(t._currentVisibleTooltip=void 0),this._async.dispose()},t.defaultProps={delay:cd.medium},t}(f.Component),vd={root:"ms-TooltipHost",ariaPlaceholder:"ms-TooltipHost-aria-placeholder"},bd=Vn(fd,(function(e){var t=e.className,o=e.theme;return{root:[Qo(vd,o).root,{display:"inline"},t]}}),void 0,{scope:"TooltipHost"}),yd=Jn(),_d=function(){return null},Cd={styles:function(e){return{root:{selectors:{"&.is-disabled":{color:e.theme.semanticColors.bodyText}}}}}},Sd=function(e){function t(t){var o=e.call(this,t)||this;return o._focusZone=f.createRef(),o._onReduceData=function(e){var t=e.renderedItems,o=e.renderedOverflowItems,n=e.props.overflowIndex,r=t[n];if(r)return(t=m(t)).splice(n,1),o=m(o,[r]),d(d({},e),{renderedItems:t,renderedOverflowItems:o})},o._onGrowData=function(e){var t=e.renderedItems,o=e.renderedOverflowItems,n=e.props,r=n.overflowIndex,i=n.maxDisplayedItems,a=(o=m(o)).pop();if(a&&!(t.length>=i))return(t=m(t)).splice(r,0,a),d(d({},e),{renderedItems:t,renderedOverflowItems:o})},o._onRenderBreadcrumb=function(e){var t=e.props,n=t.ariaLabel,r=t.dividerAs,i=void 0===r?ii:r,a=t.onRenderItem,s=void 0===a?o._onRenderItem:a,l=t.overflowAriaLabel,c=t.overflowIndex,u=t.onRenderOverflowIcon,p=t.overflowButtonAs,h=e.renderedOverflowItems,m=e.renderedItems,g=h.map((function(e){var t=!(!e.onClick&&!e.href);return{text:e.text,name:e.text,key:e.key,onClick:e.onClick?o._onBreadcrumbClicked.bind(o,e):null,href:e.href,disabled:!t,itemProps:t?void 0:Cd}})),v=m.length-1,b=h&&0!==h.length,y=m.map((function(e,t){return f.createElement("li",{className:o._classNames.listItem,key:e.key||String(t)},s(e,o._onRenderItem),(t!==v||b&&t===c-1)&&f.createElement(i,{className:o._classNames.chevron,iconName:jn(o.props.theme)?"ChevronLeft":"ChevronRight",item:e}))}));if(b){var _=u?{}:{iconName:"More"},C=u||_d,S=p||Zu;y.splice(c,0,f.createElement("li",{className:o._classNames.overflow,key:"overflow"},f.createElement(S,{className:o._classNames.overflowButton,iconProps:_,role:"button","aria-haspopup":"true",ariaLabel:l,onRenderMenuIcon:C,menuProps:{items:g,directionalHint:qs.bottomLeftEdge}}),c!==v+1&&f.createElement(i,{className:o._classNames.chevron,iconName:jn(o.props.theme)?"ChevronLeft":"ChevronRight",item:h[h.length-1]})))}var x=Tr(o.props,ir,["className"]);return f.createElement("div",d({className:o._classNames.root,role:"navigation","aria-label":n},x),f.createElement(vs,d({componentRef:o._focusZone,direction:$i.horizontal},o.props.focusZoneProps),f.createElement("ol",{className:o._classNames.list},y)))},o._onRenderItem=function(e){var t=e.as,n=e.href,r=e.onClick,i=e.isCurrentItem,a=e.text,s=p(e,["as","href","onClick","isCurrentItem","text"]);if(r||n)return f.createElement(Rs,d({},s,{as:t,className:o._classNames.itemLink,href:n,"aria-current":i?"page":void 0,onClick:o._onBreadcrumbClicked.bind(o,e)}),f.createElement(bd,d({content:a,overflowMode:rd.Parent},o.props.tooltipHostProps),a));var l=t||"span";return f.createElement(l,d({},s,{className:o._classNames.item}),f.createElement(bd,d({content:a,overflowMode:rd.Parent},o.props.tooltipHostProps),a))},o._onBreadcrumbClicked=function(e,t){e.onClick&&e.onClick(t,e)},Ui(o),o._validateProps(t),o}return u(t,e),t.prototype.focus=function(){this._focusZone.current&&this._focusZone.current.focus()},t.prototype.render=function(){this._validateProps(this.props);var e=this.props,t=e.onReduceData,o=void 0===t?this._onReduceData:t,n=e.onGrowData,r=void 0===n?this._onGrowData:n,i=e.overflowIndex,a=e.maxDisplayedItems,s=e.items,l=e.className,c=e.theme,u=e.styles,d=m(s),p=d.splice(i,d.length-a),h={props:this.props,renderedItems:d,renderedOverflowItems:p};return this._classNames=yd(u,{className:l,theme:c}),f.createElement(id,{onRenderData:this._onRenderBreadcrumb,onReduceData:o,onGrowData:r,data:h})},t.prototype._validateProps=function(e){var t=e.maxDisplayedItems,o=e.overflowIndex,n=e.items;if(o<0||t>1&&o>t-1||n.length>0&&o>n.length-1)throw new Error("Breadcrumb: overflowIndex out of range")},t.defaultProps={items:[],maxDisplayedItems:999,overflowIndex:0},t}(f.Component),xd={root:"ms-Breadcrumb",list:"ms-Breadcrumb-list",listItem:"ms-Breadcrumb-listItem",chevron:"ms-Breadcrumb-chevron",overflow:"ms-Breadcrumb-overflow",overflowButton:"ms-Breadcrumb-overflowButton",itemLink:"ms-Breadcrumb-itemLink",item:"ms-Breadcrumb-item"},kd={whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},wd=Co(0,go),Id=Co(co,fo),Dd=Vn(Sd,(function(e){var t,o,n,r,i=e.className,a=e.theme,s=a.palette,l=a.semanticColors,c=a.fonts,u=Qo(xd,a),p=l.menuItemBackgroundHovered,h=l.menuItemBackgroundPressed,m=s.neutralSecondary,g=qe.regular,f=s.neutralPrimary,v=s.neutralPrimary,b=qe.semibold,y=s.neutralSecondary,_=s.neutralSecondary,C={fontWeight:b,color:v},S={":hover":{color:f,backgroundColor:p,cursor:"pointer",selectors:(t={},t[ro]={color:"Highlight"},t)},":active":{backgroundColor:h,color:f},"&:active:hover":{color:f,backgroundColor:h},"&:active, &:hover, &:active:hover":{textDecoration:"none"}},x={color:m,padding:"0 8px",lineHeight:36,fontSize:18,fontWeight:g};return{root:[u.root,c.medium,{margin:"11px 0 1px"},i],list:[u.list,{whiteSpace:"nowrap",padding:0,margin:0,display:"flex",alignItems:"stretch"}],listItem:[u.listItem,{listStyleType:"none",margin:"0",padding:"0",display:"flex",position:"relative",alignItems:"center",selectors:{"&:last-child .ms-Breadcrumb-itemLink":C,"&:last-child .ms-Breadcrumb-item":C}}],chevron:[u.chevron,{color:y,fontSize:c.small.fontSize,selectors:(o={},o[ro]=d({color:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o[Id]={fontSize:8},o[wd]={fontSize:8},o)}],overflow:[u.overflow,{position:"relative",display:"flex",alignItems:"center"}],overflowButton:[u.overflowButton,To(a),kd,{fontSize:16,color:_,height:"100%",cursor:"pointer",selectors:d(d({},S),(n={},n[wd]={padding:"4px 6px"},n[Id]={fontSize:c.mediumPlus.fontSize},n))}],itemLink:[u.itemLink,To(a),kd,d(d({},x),{selectors:d((r={":focus":{color:s.neutralDark}},r["."+wo+" &:focus"]={outline:"none"},r),S)})],item:[u.item,d(d({},x),{selectors:{":hover":{cursor:"default"}}})]}}),void 0,{scope:"Breadcrumb"});function Td(e){var t,o,n,r,i,a=e.semanticColors,s=e.palette,l=a.buttonBackground,c=a.buttonBackgroundPressed,u=a.buttonBackgroundHovered,p=a.buttonBackgroundDisabled,h=a.buttonText,m=a.buttonTextHovered,g=a.buttonTextDisabled,f=a.buttonTextChecked,v=a.buttonTextCheckedHovered;return{root:{backgroundColor:l,color:h},rootHovered:{backgroundColor:u,color:m,selectors:(t={},t[ro]={borderColor:"Highlight",color:"Highlight"},t)},rootPressed:{backgroundColor:c,color:f},rootExpanded:{backgroundColor:c,color:f},rootChecked:{backgroundColor:c,color:f},rootCheckedHovered:{backgroundColor:c,color:v},rootDisabled:{color:g,backgroundColor:p,selectors:(o={},o[ro]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},o)},splitButtonContainer:{selectors:(n={},n[ro]={border:"none"},n)},splitButtonMenuButton:{color:s.white,backgroundColor:"transparent",selectors:{":hover":{backgroundColor:s.neutralLight,selectors:(r={},r[ro]={color:"Highlight"},r)}}},splitButtonMenuButtonDisabled:{backgroundColor:a.buttonBackgroundDisabled,selectors:{":hover":{backgroundColor:a.buttonBackgroundDisabled}}},splitButtonDivider:d(d({},{position:"absolute",width:1,right:31,top:8,bottom:8}),{backgroundColor:s.neutralTertiaryAlt,selectors:(i={},i[ro]={backgroundColor:"WindowText"},i)}),splitButtonDividerDisabled:{backgroundColor:e.palette.neutralTertiaryAlt},splitButtonMenuButtonChecked:{backgroundColor:s.neutralQuaternaryAlt,selectors:{":hover":{backgroundColor:s.neutralQuaternaryAlt}}},splitButtonMenuButtonExpanded:{backgroundColor:s.neutralQuaternaryAlt,selectors:{":hover":{backgroundColor:s.neutralQuaternaryAlt}}},splitButtonMenuIcon:{color:a.buttonText},splitButtonMenuIconDisabled:{color:a.buttonTextDisabled}}}function Ed(e){var t,o,n,r,i,a,s,l,c,u=e.palette,p=e.semanticColors;return{root:{backgroundColor:p.primaryButtonBackground,border:"1px solid "+p.primaryButtonBackground,color:p.primaryButtonText,selectors:(t={},t[ro]=d({color:"Window",backgroundColor:"WindowText",borderColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t["."+wo+" &:focus"]={selectors:{":after":{border:"none",outlineColor:u.white}}},t)},rootHovered:{backgroundColor:p.primaryButtonBackgroundHovered,border:"1px solid "+p.primaryButtonBackgroundHovered,color:p.primaryButtonTextHovered,selectors:(o={},o[ro]={color:"Window",backgroundColor:"Highlight",borderColor:"Highlight"},o)},rootPressed:{backgroundColor:p.primaryButtonBackgroundPressed,border:"1px solid "+p.primaryButtonBackgroundPressed,color:p.primaryButtonTextPressed,selectors:(n={},n[ro]=d({color:"Window",backgroundColor:"WindowText",borderColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)},rootExpanded:{backgroundColor:p.primaryButtonBackgroundPressed,color:p.primaryButtonTextPressed},rootChecked:{backgroundColor:p.primaryButtonBackgroundPressed,color:p.primaryButtonTextPressed},rootCheckedHovered:{backgroundColor:p.primaryButtonBackgroundPressed,color:p.primaryButtonTextPressed},rootDisabled:{color:p.primaryButtonTextDisabled,backgroundColor:p.primaryButtonBackgroundDisabled,selectors:(r={},r[ro]={color:"GrayText",borderColor:"GrayText",backgroundColor:"Window"},r)},splitButtonContainer:{selectors:(i={},i[ro]={border:"none"},i)},splitButtonDivider:d(d({},{position:"absolute",width:1,right:31,top:8,bottom:8}),{backgroundColor:u.white,selectors:(a={},a[ro]={backgroundColor:"Window"},a)}),splitButtonMenuButton:{backgroundColor:p.primaryButtonBackground,color:p.primaryButtonText,selectors:(s={},s[ro]={backgroundColor:"WindowText"},s[":hover"]={backgroundColor:p.primaryButtonBackgroundHovered,selectors:(l={},l[ro]={color:"Highlight"},l)},s)},splitButtonMenuButtonDisabled:{backgroundColor:p.primaryButtonBackgroundDisabled,selectors:{":hover":{backgroundColor:p.primaryButtonBackgroundDisabled}}},splitButtonMenuButtonChecked:{backgroundColor:p.primaryButtonBackgroundPressed,selectors:{":hover":{backgroundColor:p.primaryButtonBackgroundPressed}}},splitButtonMenuButtonExpanded:{backgroundColor:p.primaryButtonBackgroundPressed,selectors:{":hover":{backgroundColor:p.primaryButtonBackgroundPressed}}},splitButtonMenuIcon:{color:p.primaryButtonText},splitButtonMenuIconDisabled:{color:u.neutralTertiary,selectors:(c={},c[ro]={color:"GrayText"},c)}}}!function(e){e[e.button=0]="button",e[e.anchor=1]="anchor"}(hd||(hd={})),function(e){e[e.normal=0]="normal",e[e.primary=1]="primary",e[e.hero=2]="hero",e[e.compound=3]="compound",e[e.command=4]="command",e[e.icon=5]="icon",e[e.default=6]="default"}(md||(md={}));var Pd=jo((function(e,t,o){var n=ju(e),r=qu(e);return kn(n,{root:{minWidth:"80px",height:"32px"},label:{fontWeight:qe.semibold}},o?Ed(e):Td(e),r,t)})),Md=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.primary,o=void 0!==t&&t,n=e.styles,r=e.theme;return f.createElement(Wu,d({},this.props,{variantClassName:o?"ms-Button--primary":"ms-Button--default",styles:Pd(r,n,o),onRenderDescription:Vs}))},h([Vu("DefaultButton",["theme","styles"],!0)],t)}(f.Component),Rd=jo((function(e,t){var o,n,r;return kn(ju(e),{root:{padding:"0 4px",height:"40px",color:e.palette.neutralPrimary,backgroundColor:"transparent",border:"1px solid transparent",selectors:(o={},o[ro]={borderColor:"Window"},o)},rootHovered:{color:e.palette.themePrimary,selectors:(n={},n[ro]={color:"Highlight"},n)},iconHovered:{color:e.palette.themePrimary},rootPressed:{color:e.palette.black},rootExpanded:{color:e.palette.themePrimary},iconPressed:{color:e.palette.themeDarker},rootDisabled:{color:e.palette.neutralTertiary,backgroundColor:"transparent",borderColor:"transparent",selectors:(r={},r[ro]={color:"GrayText"},r)},rootChecked:{color:e.palette.black},iconChecked:{color:e.palette.themeDarker},flexContainer:{justifyContent:"flex-start"},icon:{color:e.palette.themeDarkAlt},iconDisabled:{color:"inherit"},menuIcon:{color:e.palette.neutralSecondary},textContainer:{flexGrow:0}},t)})),Nd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return f.createElement(Wu,d({},this.props,{variantClassName:"ms-Button--action ms-Button--command",styles:Rd(o,t),onRenderDescription:Vs}))},h([Vu("ActionButton",["theme","styles"],!0)],t)}(f.Component),Bd=jo((function(e,t,o){var n,r,i,a,s,l=e.fonts,c=e.palette,u=ju(e),p=qu(e),h={root:{maxWidth:"280px",minHeight:"72px",height:"auto",padding:"16px 12px"},flexContainer:{flexDirection:"row",alignItems:"flex-start",minWidth:"100%",margin:""},textContainer:{textAlign:"left"},icon:{fontSize:"2em",lineHeight:"1em",height:"1em",margin:"0px 8px 0px 0px",flexBasis:"1em",flexShrink:"0"},label:{margin:"0 0 5px",lineHeight:"100%",fontWeight:qe.semibold},description:[l.small,{lineHeight:"100%"}]},m={description:{color:c.neutralSecondary},descriptionHovered:{color:c.neutralDark},descriptionPressed:{color:"inherit"},descriptionChecked:{color:"inherit"},descriptionDisabled:{color:"inherit"}},g={description:{color:c.white,selectors:(n={},n[ro]=d({backgroundColor:"WindowText",color:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)},descriptionHovered:{color:c.white,selectors:(r={},r[ro]={backgroundColor:"Highlight",color:"Window"},r)},descriptionPressed:{color:"inherit",selectors:(i={},i[ro]=d({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)},descriptionChecked:{color:"inherit",selectors:(a={},a[ro]=d({color:"Window",backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a)},descriptionDisabled:{color:"inherit",selectors:(s={},s[ro]={color:"inherit"},s)}};return kn(u,h,o?Ed(e):Td(e),o?g:m,p,t)})),Fd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.primary,o=void 0!==t&&t,n=e.styles,r=e.theme;return f.createElement(Wu,d({},this.props,{variantClassName:o?"ms-Button--compoundPrimary":"ms-Button--compound",styles:Bd(r,n,o)}))},h([Vu("CompoundButton",["theme","styles"],!0)],t)}(f.Component),Ad=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){return f.createElement(Md,d({},this.props,{primary:!0,onRenderDescription:Vs}))},h([Vu("PrimaryButton",["theme","styles"],!0)],t)}(f.Component),Ld=function(e){function t(t){var o=e.call(this,t)||this;return cn("The Button component has been deprecated. Use specific variants instead. (PrimaryButton, DefaultButton, IconButton, ActionButton, etc.)"),o}return u(t,e),t.prototype.render=function(){var e=this.props;switch(e.buttonType){case md.command:return f.createElement(Nd,d({},e));case md.compound:return f.createElement(Fd,d({},e));case md.icon:return f.createElement(Zu,d({},e));case md.primary:return f.createElement(Ad,d({},e));default:return f.createElement(Md,d({},e))}},t}(f.Component),Hd=jo((function(e,t,o,n){var r,i,a,s,l,c,u,p,h,m,g,f,v,b,y=ju(e),_=qu(e),C=e.palette,S=e.semanticColors;return kn(y,_,{root:[To(e,{inset:2,highContrastStyle:{left:4,top:4,bottom:4,right:4,border:"none"},borderColor:"transparent"}),e.fonts.medium,{minWidth:"40px",backgroundColor:C.white,color:C.neutralPrimary,padding:"0 4px",border:"none",borderRadius:0,selectors:(r={},r[ro]={border:"none"},r)}],rootHovered:{backgroundColor:C.neutralLighter,color:C.neutralDark,selectors:(i={},i[ro]={color:"Highlight"},i["."+Lu.msButtonIcon]={color:C.themeDarkAlt},i["."+Lu.msButtonMenuIcon]={color:C.neutralPrimary},i)},rootPressed:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:(a={},a["."+Lu.msButtonIcon]={color:C.themeDark},a["."+Lu.msButtonMenuIcon]={color:C.neutralPrimary},a)},rootChecked:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:(s={},s["."+Lu.msButtonIcon]={color:C.themeDark},s["."+Lu.msButtonMenuIcon]={color:C.neutralPrimary},s)},rootCheckedHovered:{backgroundColor:C.neutralQuaternaryAlt,selectors:(l={},l["."+Lu.msButtonIcon]={color:C.themeDark},l["."+Lu.msButtonMenuIcon]={color:C.neutralPrimary},l)},rootExpanded:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:(c={},c["."+Lu.msButtonIcon]={color:C.themeDark},c["."+Lu.msButtonMenuIcon]={color:C.neutralPrimary},c)},rootExpandedHovered:{backgroundColor:C.neutralQuaternaryAlt},rootDisabled:{backgroundColor:C.white,selectors:(u={},u["."+Lu.msButtonIcon]={color:S.disabledBodySubtext,selectors:(p={},p[ro]=d({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),p)},u[ro]=d({color:"GrayText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),u)},splitButtonContainer:{height:"100%",selectors:(h={},h[ro]={border:"none"},h)},splitButtonDividerDisabled:{selectors:(m={},m[ro]={backgroundColor:"Window"},m)},splitButtonDivider:{backgroundColor:C.neutralTertiaryAlt},splitButtonMenuButton:{backgroundColor:C.white,border:"none",borderTopRightRadius:"0",borderBottomRightRadius:"0",color:C.neutralSecondary,selectors:{":hover":{backgroundColor:C.neutralLighter,color:C.neutralDark,selectors:(g={},g[ro]={color:"Highlight"},g["."+Lu.msButtonIcon]={color:C.neutralPrimary},g)},":active":{backgroundColor:C.neutralLight,selectors:(f={},f["."+Lu.msButtonIcon]={color:C.neutralPrimary},f)}}},splitButtonMenuButtonDisabled:{backgroundColor:C.white,selectors:(v={},v[ro]=d({color:"GrayText",border:"none",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),v)},splitButtonMenuButtonChecked:{backgroundColor:C.neutralLight,color:C.neutralDark,selectors:{":hover":{backgroundColor:C.neutralQuaternaryAlt}}},splitButtonMenuButtonExpanded:{backgroundColor:C.neutralLight,color:C.black,selectors:{":hover":{backgroundColor:C.neutralQuaternaryAlt}}},splitButtonMenuIcon:{color:C.neutralPrimary},splitButtonMenuIconDisabled:{color:C.neutralTertiary},label:{fontWeight:"normal"},icon:{color:C.themePrimary},menuIcon:(b={color:C.neutralSecondary},b[ro]={color:"GrayText"},b)},t)})),Od=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return f.createElement(Wu,d({},this.props,{variantClassName:"ms-Button--commandBar",styles:Hd(o,t),onRenderDescription:Vs}))},h([Vu("CommandBarButton",["theme","styles"],!0)],t)}(f.Component),zd=Nd,Wd=jo((function(e,t){return kn({root:[To(e,{inset:1,highContrastStyle:{outlineOffset:"-4px",outline:"1px solid Window"},borderColor:"transparent"}),{height:24}]},t)})),Vd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme;return f.createElement(Md,d({},this.props,{styles:Wd(o,t),onRenderDescription:Vs}))},h([Vu("MessageBarButton",["theme","styles"],!0)],t)}(f.Component);function Kd(e,t){var o=f.useRef(t);return o.current||(o.current=Va(e)),o.current}var Ud=Jn(),Gd=Vn(f.forwardRef((function(e,t){var o=Kd(void 0,e.id),n=e.items,r=e.columnCount,i=e.onRenderItem,a=e.ariaPosInSet,s=void 0===a?e.positionInSet:a,l=e.ariaSetSize,c=void 0===l?e.setSize:l,u=e.styles,p=e.doNotContainWithinFocusZone,h=Tr(e,ir,p?[]:["onBlur"]),m=Ud(u,{theme:e.theme}),g=la(n,r),v=f.createElement("table",d({"aria-posinset":s,"aria-setsize":c,id:o,role:"grid"},h,{className:m.root}),f.createElement("tbody",null,g.map((function(e,t){return f.createElement("tr",{role:"row",key:t},e.map((function(e,t){return f.createElement("td",{role:"presentation",key:t+"-cell",className:m.tableCell},i(e,t))})))}))));return p?v:f.createElement(vs,{elementRef:t,isCircularNavigation:e.shouldFocusCircularNavigate,className:m.focusedContainer,onBlur:e.onBlur},v)})),(function(e){return{root:{padding:2,outline:"none"},tableCell:{padding:0}}}));Gd.displayName="ButtonGrid";var jd,qd,Yd,Zd,Xd=function(e){var t,o=Kd("gridCell"),n=e.item,r=e.id,i=void 0===r?o:r,a=e.className,s=e.role,l=e.selected,c=e.disabled,u=void 0!==c&&c,d=e.onRenderItem,p=e.cellDisabledStyle,h=e.cellIsSelectedStyle,m=e.index,g=e.label,v=e.getClassNames,b=e.onClick,y=e.onHover,_=e.onMouseMove,C=e.onMouseLeave,S=e.onMouseEnter,x=e.onFocus,k=f.useCallback((function(){b&&!u&&b(n)}),[u,n,b]),w=f.useCallback((function(e){S&&S(e)||!y||u||y(n)}),[u,n,y,S]),I=f.useCallback((function(e){_&&_(e)||!y||u||y(n)}),[u,n,y,_]),D=f.useCallback((function(e){C&&C(e)||!y||u||y()}),[u,y,C]),T=f.useCallback((function(){x&&!u&&x(n)}),[u,n,x]);return f.createElement(zd,{id:i,"data-index":m,"data-is-focusable":!0,disabled:u,className:qr(a,(t={},t[""+h]=l,t[""+p]=u,t)),onClick:k,onMouseEnter:w,onMouseMove:I,onMouseLeave:D,onFocus:T,role:s,"aria-selected":l,ariaLabel:g,title:g,getClassNames:v},d(n))};!function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(jd||(jd={})),function(e){e[e.January=0]="January",e[e.February=1]="February",e[e.March=2]="March",e[e.April=3]="April",e[e.May=4]="May",e[e.June=5]="June",e[e.July=6]="July",e[e.August=7]="August",e[e.September=8]="September",e[e.October=9]="October",e[e.November=10]="November",e[e.December=11]="December"}(qd||(qd={})),function(e){e[e.FirstDay=0]="FirstDay",e[e.FirstFullWeek=1]="FirstFullWeek",e[e.FirstFourDayWeek=2]="FirstFourDayWeek"}(Yd||(Yd={})),function(e){e[e.Day=0]="Day",e[e.Week=1]="Week",e[e.Month=2]="Month",e[e.WorkWeek=3]="WorkWeek"}(Zd||(Zd={}));var Qd=7,Jd={formatDay:function(e){return e.getDate().toString()},formatMonth:function(e,t){return t.months[e.getMonth()]},formatYear:function(e){return e.getFullYear().toString()},formatMonthDayYear:function(e,t){return t.months[e.getMonth()]+" "+e.getDate()+", "+e.getFullYear()},formatMonthYear:function(e,t){return t.months[e.getMonth()]+" "+e.getFullYear()}},$d=d(d({},{months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["S","M","T","W","T","F","S"]}),{goToToday:"Go to today",weekNumberFormatString:"Week number {0}",prevMonthAriaLabel:"Previous month",nextMonthAriaLabel:"Next month",prevYearAriaLabel:"Previous year",nextYearAriaLabel:"Next year",prevYearRangeAriaLabel:"Previous year range",nextYearRangeAriaLabel:"Next year range",closeButtonAriaLabel:"Close",selectedDateFormatString:"Selected date {0}",todayDateFormatString:"Today's date {0}",monthPickerHeaderAriaLabel:"{0}, change year",yearPickerHeaderAriaLabel:"{0}, change month",dayMarkedAriaLabel:"marked"}),ep={MillisecondsInOneDay:864e5,MillisecondsIn1Sec:1e3,MillisecondsIn1Min:6e4,MillisecondsIn30Mins:18e5,MillisecondsIn1Hour:36e5,MinutesInOneDay:1440,MinutesInOneHour:60,DaysInOneWeek:7,MonthInOneYear:12,HoursInOneDay:24};function tp(e,t){var o=new Date(e.getTime());return o.setDate(o.getDate()+t),o}function op(e,t){return tp(e,t*ep.DaysInOneWeek)}function np(e,t){var o=new Date(e.getTime()),n=o.getMonth()+t;return o.setMonth(n),o.getMonth()!==(n%ep.MonthInOneYear+ep.MonthInOneYear)%ep.MonthInOneYear&&(o=tp(o,-o.getDate())),o}function rp(e,t){var o=new Date(e.getTime());return o.setFullYear(e.getFullYear()+t),o.getMonth()!==(e.getMonth()%ep.MonthInOneYear+ep.MonthInOneYear)%ep.MonthInOneYear&&(o=tp(o,-o.getDate())),o}function ip(e){return new Date(e.getFullYear(),e.getMonth(),1,0,0,0,0)}function ap(e){return new Date(e.getFullYear(),e.getMonth()+1,0,0,0,0,0)}function sp(e){return new Date(e.getFullYear(),0,1,0,0,0,0)}function lp(e){return new Date(e.getFullYear()+1,0,0,0,0,0,0)}function cp(e,t){return np(e,t-e.getMonth())}function up(e,t){return!e&&!t||!(!e||!t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function dp(e,t){return yp(e)-yp(t)}function pp(e,t,o,n,r){void 0===r&&(r=1);var i,a=[],s=null;switch(n||(n=[jd.Monday,jd.Tuesday,jd.Wednesday,jd.Thursday,jd.Friday]),r=Math.max(r,1),t){case Zd.Day:s=tp(i=bp(e),r);break;case Zd.Week:case Zd.WorkWeek:s=tp(i=fp(bp(e),o),ep.DaysInOneWeek);break;case Zd.Month:s=np(i=new Date(e.getFullYear(),e.getMonth(),1),1);break;default:throw new Error("Unexpected object: "+t)}var l=i;do{(t!==Zd.WorkWeek||-1!==n.indexOf(l.getDay()))&&a.push(l),l=tp(l,1)}while(!up(l,s));return a}function hp(e,t){for(var o=0,n=t;o<n.length;o++)if(up(e,n[o]))return!0;return!1}function mp(e,t,o,n){var r=n.getFullYear(),i=n.getMonth(),a=1,s=new Date(r,i,a),l=a+(t+ep.DaysInOneWeek-1)-function(e,t){return e!==jd.Sunday&&t<e?t+ep.DaysInOneWeek:t}(t,s.getDay()),c=new Date(r,i,l);a=c.getDate();for(var u=[],d=0;d<e;d++)u.push(gp(c,t,o)),a+=ep.DaysInOneWeek,c=new Date(r,i,a);return u}function gp(e,t,o){switch(o){case Yd.FirstFullWeek:return _p(e,t,ep.DaysInOneWeek);case Yd.FirstFourDayWeek:return _p(e,t,4);default:return function(e,t){var o=Cp(e)-1,n=(e.getDay()-o%ep.DaysInOneWeek-t+2*ep.DaysInOneWeek)%ep.DaysInOneWeek;return Math.floor((o+n)/ep.DaysInOneWeek+1)}(e,t)}}function fp(e,t){var o=t-e.getDay();return o>0&&(o-=ep.DaysInOneWeek),tp(e,o)}function vp(e,t){var o=(t-1>=0?t-1:ep.DaysInOneWeek-1)-e.getDay();return o<0&&(o+=ep.DaysInOneWeek),tp(e,o)}function bp(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function yp(e){return e.getDate()+(e.getMonth()<<5)+(e.getFullYear()<<9)}function _p(e,t,o){var n=Cp(e)-1,r=e.getDay()-n%ep.DaysInOneWeek,i=Cp(new Date(e.getFullYear()-1,qd.December,31))-1,a=(t-r+2*ep.DaysInOneWeek)%ep.DaysInOneWeek;0!==a&&a>=o&&(a-=ep.DaysInOneWeek);var s=n-a;return s<0&&(0!=(a=(t-(r-=i%ep.DaysInOneWeek)+2*ep.DaysInOneWeek)%ep.DaysInOneWeek)&&a+1>=o&&(a-=ep.DaysInOneWeek),s=i-a),Math.floor(s/ep.DaysInOneWeek+1)}function Cp(e){for(var t=e.getMonth(),o=e.getFullYear(),n=0,r=0;r<t;r++)n+=Sp(r+1,o);return n+e.getDate()}function Sp(e,t){return new Date(t,e,0).getDate()}var xp=/[\{\}]/g,kp=/\{\d+\}/g;function wp(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var n=t;function r(e){var t=n[e.replace(xp,"")];return null==t&&(t=""),t}return e.replace(kp,r)}var Ip=function(e,t,o){var n=m(e);return t&&(n=n.filter((function(e){return dp(e,t)>=0}))),o&&(n=n.filter((function(e){return dp(e,o)<=0}))),n},Dp=function(e,t){var o=t.minDate;return!!o&&dp(o,e)>=1},Tp=function(e,t){var o=t.maxDate;return!!o&&dp(e,o)>=1},Ep=function(e,t){var o=t.restrictedDates,n=t.minDate,r=t.maxDate;return!!(o||n||r)&&(o&&o.some((function(t){return up(t,e)}))||Dp(e,t)||Tp(e,t))},Pp=function(e){var t=e.showWeekNumbers,o=e.strings,n=e.firstDayOfWeek,r=e.allFocusable,i=e.weeksToShow,a=e.weeks,s=e.classNames,l=o.shortDays.slice(),c=ia(a[1],(function(e){return 1===e.originalDate.getDate()}));return 1===i&&c>=0&&(l[(c+n)%Qd]=o.shortMonths[a[1][c].originalDate.getMonth()]),f.createElement("tr",null,t&&f.createElement("th",{className:s.dayCell}),l.map((function(e,t){var i=(t+n)%Qd,a=t===c?o.days[i]+" "+l[i]:o.days[i];return f.createElement("th",{className:qr(s.dayCell,s.weekDayLabelCell),scope:"col",key:l[i]+" "+t,title:a,"aria-label":a,"data-is-focusable":!!r||void 0},l[i])})))},Mp=function(e){var t=e.targetDate,o=e.initialDate,n=e.direction,r=p(e,["targetDate","initialDate","direction"]),i=t;if(!Ep(t,r))return t;for(;0!==dp(o,i)&&Ep(i,r)&&!Tp(i,r)&&!Dp(i,r);)i=tp(i,n);return 0===dp(o,i)||Ep(i,r)?void 0:i},Rp=function(e){var t,o=e.navigatedDate,n=e.dateTimeFormatter,r=e.allFocusable,i=e.strings,a=e.activeDescendantId,s=e.navigatedDayRef,l=e.calculateRoundedStyles,c=e.weeks,u=e.classNames,d=e.day,p=e.dayIndex,h=e.weekIndex,m=e.weekCorners,g=e.ariaHidden,v=e.customDayCellRef,b=e.dateRangeType,y=e.daysToSelectInDayView,_=e.onSelectDate,C=e.restrictedDates,S=e.minDate,x=e.maxDate,k=e.onNavigateDate,w=e.getDayInfosInRangeOfDay,I=e.getRefsFromDayInfos,D=null!==(t=null==m?void 0:m[h+"_"+p])&&void 0!==t?t:"",T=up(o,d.originalDate),E=d.originalDate.getDate()+", "+i.months[d.originalDate.getMonth()]+", "+d.originalDate.getFullYear();return d.isMarked&&(E=E+", "+i.dayMarkedAriaLabel),f.createElement("td",{className:qr(u.dayCell,m&&D,d.isSelected&&u.daySelected,d.isSelected&&"ms-CalendarDay-daySelected",!d.isInBounds&&u.dayOutsideBounds,!d.isInMonth&&u.dayOutsideNavigatedMonth),ref:function(e){null==v||v(e,d.originalDate,u),d.setRef(e)},"aria-hidden":g,onClick:d.isInBounds&&!g?d.onSelected:void 0,onMouseOver:g?void 0:function(e){var t=w(d),o=I(t);o.forEach((function(e,n){var r;if(e&&(e.classList.add("ms-CalendarDay-hoverStyle"),!t[n].isSelected&&b===Zd.Day&&y&&y>1)){e.classList.remove(u.bottomLeftCornerDate,u.bottomRightCornerDate,u.topLeftCornerDate,u.topRightCornerDate);var i=l(u,!1,!1,n>0,n<o.length-1).trim();i&&(r=e.classList).add.apply(r,i.split(" "))}}))},onMouseDown:g?void 0:function(e){var t=w(d);I(t).forEach((function(e){e&&e.classList.add("ms-CalendarDay-pressedStyle")}))},onMouseUp:g?void 0:function(e){var t=w(d);I(t).forEach((function(e){e&&e.classList.remove("ms-CalendarDay-pressedStyle")}))},onMouseOut:g?void 0:function(e){var t=w(d),o=I(t);o.forEach((function(e,n){var r;if(e&&(e.classList.remove("ms-CalendarDay-hoverStyle"),e.classList.remove("ms-CalendarDay-pressedStyle"),!t[n].isSelected&&b===Zd.Day&&y&&y>1)){var i=l(u,!1,!1,n>0,n<o.length-1).trim();i&&(r=e.classList).remove.apply(r,i.split(" "))}}))},role:"presentation"},f.createElement("button",{key:d.key+"button","aria-hidden":g,className:qr(u.dayButton,d.isToday&&u.dayIsToday,d.isToday&&"ms-CalendarDay-dayIsToday"),onKeyDown:g?void 0:function(e){e.which===Un.enter?null==_||_(d.originalDate):function(e,t){var o=void 0,n=1;if(e.which===Un.up?(o=op(t,-1),n=-1):e.which===Un.down?o=op(t,1):e.which===Yn(Un.left)?(o=tp(t,-1),n=-1):e.which===Yn(Un.right)&&(o=tp(t,1)),o){var r={initialDate:t,targetDate:o,direction:n,restrictedDates:C,minDate:S,maxDate:x},i=Mp(r);i||(r.direction=-n,i=Mp(r)),c&&i&&c.slice(1,c.length-1).some((function(e){return e.some((function(e){return up(e.originalDate,i)}))}))||i&&(k(i,!0),e.preventDefault())}}(e,d.originalDate)},"aria-label":E,id:T?a:void 0,"aria-current":d.isSelected?"date":void 0,"aria-selected":d.isInBounds?d.isSelected:void 0,"data-is-focusable":!g&&(r||!!d.isInBounds||void 0),ref:T?s:void 0,disabled:!r&&!d.isInBounds,"aria-disabled":!g&&!d.isInBounds,type:"button",role:"gridcell","aria-readonly":!0,tabIndex:T?0:void 0},f.createElement("span",{"aria-hidden":"true"},n.formatDay(d.originalDate)),d.isMarked&&f.createElement("div",{"aria-hidden":"true",className:u.dayMarker})))},Np=function(e){var t=e.classNames,o=e.week,n=e.weeks,r=e.weekIndex,i=e.rowClassName,a=e.ariaRole,s=e.showWeekNumbers,l=e.firstDayOfWeek,c=e.firstWeekOfYear,u=e.navigatedDate,p=e.strings,h=s?mp(n.length,l,c,u):null,m=h?p.weekNumberFormatString&&wp(p.weekNumberFormatString,h[r]):"";return f.createElement("tr",{role:a,className:i,key:r+"_"+o[0].key},s&&h&&f.createElement("th",{className:t.weekNumberCell,key:r,title:m,"aria-label":m,scope:"row"},f.createElement("span",null,h[r])),o.map((function(t,o){return f.createElement(Rp,d({},e,{key:t.key,day:t,dayIndex:o}))})))},Bp=Jn();function Fp(e,t,o){return f.useMemo((function(){for(var n,r=function(e){var t,o=e.selectedDate,n=e.dateRangeType,r=e.firstDayOfWeek,i=e.today,a=e.minDate,s=e.maxDate,l=e.weeksToShow,c=e.workWeekDays,u=e.daysToSelectInDayView,d=e.restrictedDates,p=e.markedDays,h={minDate:a,maxDate:s,restrictedDates:d},m=i||new Date,g=e.navigatedDate?e.navigatedDate:m;t=l&&l<=4?new Date(g.getFullYear(),g.getMonth(),g.getDate()):new Date(g.getFullYear(),g.getMonth(),1);for(var f=[];t.getDay()!==r;)t.setDate(t.getDate()-1);t=tp(t,-Qd);var v=!1,b=function(e,t,o){return!t||e!==Zd.WorkWeek||function(e,t,o){for(var n=new Set(e),r=0,i=0,a=e;i<a.length;i++){var s=(a[i]+1)%7;(!n.has(s)||o===s)&&r++}return r<2}(t,0,o)&&0!==t.length?e:Zd.Week}(n,c,r),y=[];o&&(y=pp(o,b,r,c,u),y=Ip(y,a,s));for(var _=!0,C=0;_;C++){var S=[];v=!0;for(var x=function(e){var o=new Date(t.getTime()),n={key:t.toString(),date:t.getDate().toString(),originalDate:o,isInMonth:t.getMonth()===g.getMonth(),isToday:up(m,t),isSelected:hp(t,y),isInBounds:!Ep(t,h),isMarked:(null==p?void 0:p.some((function(e){return up(o,e)})))||!1};S.push(n),n.isInMonth&&(v=!1),t.setDate(t.getDate()+1)},k=0;k<Qd;k++)x();_=l?C<l+1:!v||0===C,f.push(S)}return f}(e),i=r[1][0].originalDate,a=r[r.length-1][6].originalDate,s=(null===(n=e.getMarkedDays)||void 0===n?void 0:n.call(e,i,a))||[],l=[],c=0;c<r.length;c++){for(var u=[],p=function(e){var n=r[c][e],i=d(d({onSelected:function(){return t(n.originalDate)},setRef:o(n.key)},n),{isMarked:n.isMarked||(null==s?void 0:s.some((function(e){return up(n.originalDate,e)})))});u.push(i)},h=0;h<Qd;h++)p(h);l.push(u)}return l}),[e])}var Ap,Lp=function(e){var t=f.useRef(null),o=Kd(),n=function(){var e=f.useRef({});return[e,function(t){return function(o){null===o?delete e.current[t]:e.current[t]=o}}]}(),r=n[0],i=n[1],a=Fp(e,(function(t){var o,n,r=e.firstDayOfWeek,i=e.minDate,a=e.maxDate,s=e.workWeekDays,l=e.daysToSelectInDayView,c={minDate:i,maxDate:a,restrictedDates:e.restrictedDates},u=pp(t,g,r,s,l);u=(u=Ip(u,i,a)).filter((function(e){return!Ep(e,c)})),null===(o=e.onSelectDate)||void 0===o||o.call(e,t,u),null===(n=e.onNavigateDate)||void 0===n||n.call(e,t,!0)}),i),s=function(e){var t=Ti(e[0][0].originalDate);return t&&t.getTime()!==e[0][0].originalDate.getTime()?!(t<=e[0][0].originalDate):void 0}(a),l=function(e){var t=function(e,t,o,n,r){var i=[],a=!t&&!r,s=!o&&!n,l=!o&&!r;return!t&&!n&&i.push(jn()?e.topRightCornerDate:e.topLeftCornerDate),a&&i.push(jn()?e.topLeftCornerDate:e.topRightCornerDate),s&&i.push(jn()?e.bottomRightCornerDate:e.bottomLeftCornerDate),l&&i.push(jn()?e.bottomLeftCornerDate:e.bottomRightCornerDate),i.join(" ")},o=function(t,o,n,r){var i=e.dateRangeType,a=e.firstDayOfWeek,s=e.workWeekDays,l=pp(t,i===Zd.WorkWeek?Zd.Week:i,a,s);return n===r&&(!(!n||!r)||l.filter((function(e){return e.getTime()===o.getTime()})).length>0)};return[function(e,n){var r={},i=n.slice(1,n.length-1);return i.forEach((function(n,a){n.forEach((function(n,s){var l=i[a-1]&&i[a-1][s]&&o(i[a-1][s].originalDate,n.originalDate,i[a-1][s].isSelected,n.isSelected),c=i[a+1]&&i[a+1][s]&&o(i[a+1][s].originalDate,n.originalDate,i[a+1][s].isSelected,n.isSelected),u=i[a][s-1]&&o(i[a][s-1].originalDate,n.originalDate,i[a][s-1].isSelected,n.isSelected),d=i[a][s+1]&&o(i[a][s+1].originalDate,n.originalDate,i[a][s+1].isSelected,n.isSelected),p=[];p.push(t(e,l,c,u,d)),p.push(function(e,t,o,n,r){var i=[];return t||i.push(e.datesAbove),o||i.push(e.datesBelow),n||i.push(jn()?e.datesRight:e.datesLeft),r||i.push(jn()?e.datesLeft:e.datesRight),i.join(" ")}(e,l,c,u,d)),r[a+"_"+s]=p.join(" ")}))})),r},t]}(e),c=l[0],u=l[1];f.useImperativeHandle(e.componentRef,(function(){return{focus:function(){var e,o;null===(o=null===(e=t.current)||void 0===e?void 0:e.focus)||void 0===o||o.call(e)}}}),[]);var p=e.styles,h=e.theme,m=e.className,g=e.dateRangeType,v=e.showWeekNumbers,b=e.labelledBy,y=e.lightenDaysOutsideNavigatedMonth,_=e.animationDirection,C=Bp(p,{theme:h,className:m,dateRangeType:g,showWeekNumbers:v,lightenDaysOutsideNavigatedMonth:void 0===y||y,animationDirection:_,animateBackwards:s}),S=c(C,a),x={weeks:a,navigatedDayRef:t,calculateRoundedStyles:u,activeDescendantId:o,classNames:C,weekCorners:S,getDayInfosInRangeOfDay:function(t){var o=function(e,t){if(t&&e===Zd.WorkWeek){for(var o=t.slice().sort(),n=!0,r=1;r<o.length;r++)if(o[r]!==o[r-1]+1){n=!1;break}if(!n||0===t.length)return Zd.Week}return e}(e.dateRangeType,e.workWeekDays),n=pp(t.originalDate,o,e.firstDayOfWeek,e.workWeekDays,e.daysToSelectInDayView).map((function(e){return e.getTime()}));return a.reduce((function(e,t){return e.concat(t.filter((function(e){return-1!==n.indexOf(e.originalDate.getTime())})))}),[])},getRefsFromDayInfos:function(e){return e.map((function(e){return r.current[e.key]}))}};return f.createElement(vs,{className:C.wrapper},f.createElement("table",{className:C.table,"aria-readonly":"true","aria-multiselectable":"false","aria-labelledby":b,"aria-activedescendant":o,role:"grid"},f.createElement("tbody",null,f.createElement(Pp,d({},e,{classNames:C,weeks:a})),f.createElement(Np,d({},e,x,{week:a[0],weekIndex:-1,rowClassName:C.firstTransitionWeek,ariaRole:"presentation",ariaHidden:!0})),a.slice(1,a.length-1).map((function(t,o){return f.createElement(Np,d({},e,x,{key:o,week:t,weekIndex:o,rowClassName:C.weekRow}))})),f.createElement(Np,d({},e,x,{week:a[a.length-1],weekIndex:-2,rowClassName:C.lastTransitionWeek,ariaRole:"presentation",ariaHidden:!0})))))};Lp.displayName="CalendarDayGridBase",function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical"}(Ap||(Ap={}));var Hp={hoverStyle:"ms-CalendarDay-hoverStyle",pressedStyle:"ms-CalendarDay-pressedStyle",dayIsTodayStyle:"ms-CalendarDay-dayIsToday",daySelectedStyle:"ms-CalendarDay-daySelected"},Op=J({"100%":{width:0,height:0,overflow:"hidden"},"99.9%":{width:"100%",height:28,overflow:"visible"},"0%":{width:"100%",height:28,overflow:"visible"}}),zp=Vn(Lp,(function(e){var t,o,n,r,i,a,s,l,c,u,p=e.theme,h=e.dateRangeType,m=e.showWeekNumbers,g=e.lightenDaysOutsideNavigatedMonth,f=e.animateBackwards,v=e.animationDirection,b=p.palette,y=Qo(Hp,p),_={};void 0!==f&&(_=v===Ap.Horizontal?f?He.slideRightIn20:He.slideLeftIn20:f?He.slideDownIn20:He.slideUpIn20);var C={},S={};void 0!==f&&v!==Ap.Horizontal&&(C=f?{animationName:""}:He.slideUpOut20,S=f?He.slideDownOut20:{animationName:""});var x={selectors:{"&, &:disabled, & button":{color:b.neutralTertiaryAlt,pointerEvents:"none"}}};return{wrapper:{paddingBottom:10},table:[{textAlign:"center",borderCollapse:"collapse",borderSpacing:"0",tableLayout:"fixed",fontSize:"inherit",marginTop:4,width:196,position:"relative",paddingBottom:10},m&&{width:226}],dayCell:{margin:0,padding:0,width:28,height:28,lineHeight:28,fontSize:je.small,fontWeight:qe.regular,color:b.neutralPrimary,cursor:"pointer",position:"relative",selectors:(t={},t[ro]=d({color:"WindowText",backgroundColor:"Window",zIndex:0},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t["&."+y.hoverStyle]={backgroundColor:b.neutralLighter,selectors:(o={},o[ro]={zIndex:3,backgroundColor:"Window",outline:"1px solid Highlight"},o)},t["&."+y.pressedStyle]={backgroundColor:b.neutralLight,selectors:(n={},n[ro]={borderColor:"Highlight",color:"Highlight",backgroundColor:"Window"},n)},t["&."+y.pressedStyle+"."+y.hoverStyle]={selectors:(r={},r[ro]={backgroundColor:"Window",outline:"1px solid Highlight"},r)},t)},daySelected:[h!==Zd.Month&&{backgroundColor:b.neutralLight+"!important",selectors:(i={"&:after":{content:'""',position:"absolute",top:0,bottom:0,left:0,right:0}},i["&:hover, &."+y.hoverStyle+", &."+y.pressedStyle]=(a={backgroundColor:b.neutralLight+"!important"},a[ro]={color:"HighlightText!important",background:"Highlight!important"},a),i[ro]=d({background:"Highlight!important",color:"HighlightText!important",borderColor:"Highlight!important"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)}],weekRow:_,weekDayLabelCell:He.fadeIn200,weekNumberCell:{margin:0,padding:0,borderRight:"1px solid",borderColor:b.neutralLight,backgroundColor:b.neutralLighterAlt,color:b.neutralSecondary,boxSizing:"border-box",width:28,height:28,fontWeight:qe.regular,fontSize:je.small},dayOutsideBounds:x,dayOutsideNavigatedMonth:g&&{color:b.neutralSecondary,fontWeight:qe.regular},dayButton:[To(p,{inset:-3}),{width:24,height:24,lineHeight:24,fontSize:je.small,fontWeight:"inherit",borderRadius:2,border:"none",padding:0,color:"inherit",backgroundColor:"transparent",cursor:"pointer",overflow:"visible",selectors:{span:{height:"inherit",lineHeight:"inherit"}}}],dayIsToday:{backgroundColor:b.themePrimary+"!important",borderRadius:"100%",color:b.white+"!important",fontWeight:qe.semibold+"!important",selectors:(s={},s[ro]=d({background:"WindowText!important",color:"Window!important",borderColor:"WindowText!important"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s)},firstTransitionWeek:d(d({position:"absolute",opacity:0,width:0,height:0,overflow:"hidden"},C),{animationName:C.animationName+","+Op}),lastTransitionWeek:d(d({position:"absolute",opacity:0,width:0,height:0,overflow:"hidden",marginTop:-28},S),{animationName:S.animationName+","+Op}),dayMarker:{width:4,height:4,backgroundColor:b.neutralSecondary,borderRadius:"100%",bottom:1,left:0,right:0,position:"absolute",margin:"auto",selectors:(l={},l["."+y.dayIsTodayStyle+" &"]={backgroundColor:b.white,selectors:(c={},c[ro]={backgroundColor:"Window"},c)},l["."+y.daySelectedStyle+" &"]={selectors:(u={},u[ro]={backgroundColor:"HighlightText"},u)},l[ro]=d({backgroundColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),l)},topRightCornerDate:{borderTopRightRadius:"2px"},topLeftCornerDate:{borderTopLeftRadius:"2px"},bottomRightCornerDate:{borderBottomRightRadius:"2px"},bottomLeftCornerDate:{borderBottomLeftRadius:"2px"},datesAbove:{"&:after":{borderTop:"1px solid "+b.neutralSecondary}},datesBelow:{"&:after":{borderBottom:"1px solid "+b.neutralSecondary}},datesLeft:{"&:after":{borderLeft:"1px solid "+b.neutralSecondary}},datesRight:{"&:after":{borderRight:"1px solid "+b.neutralSecondary}}}}),void 0,{scope:"CalendarDayGrid"}),Wp=Jn(),Vp=function(e){var t=f.useRef(null);f.useImperativeHandle(e.componentRef,(function(){return{focus:function(){var e,o;null===(o=null===(e=t.current)||void 0===e?void 0:e.focus)||void 0===o||o.call(e)}}}),[]);var o=e.strings,n=e.navigatedDate,r=e.dateTimeFormatter,i=e.styles,a=e.theme,s=e.className,l=e.onHeaderSelect,c=e.showSixWeeksByDefault,u=e.minDate,p=e.maxDate,h=e.restrictedDates,m=e.onNavigateDate,g=e.showWeekNumbers,v=e.dateRangeType,b=e.animationDirection,y=Kd(),_=Kd(),C=Wp(i,{theme:a,className:s,headerIsClickable:!!l,showWeekNumbers:g,animationDirection:b}),S=r.formatMonthYear(n,o),x=l?"button":"div",k=o.yearPickerHeaderAriaLabel?wp(o.yearPickerHeaderAriaLabel,S):S;return f.createElement("div",{className:C.root,id:y},f.createElement("div",{className:C.header},f.createElement(x,{"aria-live":"polite","aria-atomic":"true","aria-label":l?k:void 0,key:S,className:C.monthAndYear,onClick:l,"data-is-focusable":!!l,tabIndex:l?0:-1,onKeyDown:Up(l),type:"button"},f.createElement("span",{id:_},S)),f.createElement(Kp,d({},e,{classNames:C,dayPickerId:y}))),f.createElement(zp,d({},e,{styles:i,componentRef:t,strings:o,navigatedDate:n,weeksToShow:c?6:void 0,dateTimeFormatter:r,minDate:u,maxDate:p,restrictedDates:h,onNavigateDate:m,labelledBy:_,dateRangeType:v})))};Vp.displayName="CalendarDayBase";var Kp=function(e){var t,o,n=e.minDate,r=e.maxDate,i=e.navigatedDate,a=e.allFocusable,s=e.strings,l=e.navigationIcons,c=e.showCloseButton,u=e.classNames,d=e.dayPickerId,p=e.onNavigateDate,h=e.onDismiss,m=function(){p(np(i,1),!1)},g=function(){p(np(i,-1),!1)},v=l.leftNavigation,b=l.rightNavigation,y=l.closeIcon,_=!n||dp(n,ip(i))<0,C=!r||dp(ap(i),r)<0;return f.createElement("div",{className:u.monthComponents},f.createElement("button",{className:qr(u.headerIconButton,(t={},t[u.disabledStyle]=!_,t)),tabIndex:_?void 0:a?0:-1,"aria-disabled":!_,onClick:_?g:void 0,onKeyDown:_?Up(g):void 0,"aria-controls":d,title:s.prevMonthAriaLabel?s.prevMonthAriaLabel+" "+s.months[np(i,-1).getMonth()]:void 0,type:"button"},f.createElement(ii,{iconName:v})),f.createElement("button",{className:qr(u.headerIconButton,(o={},o[u.disabledStyle]=!C,o)),tabIndex:C?void 0:a?0:-1,"aria-disabled":!C,onClick:C?m:void 0,onKeyDown:C?Up(m):void 0,"aria-controls":d,title:s.nextMonthAriaLabel?s.nextMonthAriaLabel+" "+s.months[np(i,1).getMonth()]:void 0,type:"button"},f.createElement(ii,{iconName:b})),c&&f.createElement("button",{className:qr(u.headerIconButton),onClick:h,onKeyDown:Up(h),title:s.closeButtonAriaLabel,type:"button"},f.createElement(ii,{iconName:y})))};Kp.displayName="CalendarDayNavigationButtons";var Up=function(e){return function(t){switch(t.which){case Un.enter:null==e||e()}}},Gp=Vn(Vp,(function(e){var t=e.className,o=e.theme,n=e.headerIsClickable,r=e.showWeekNumbers,i=o.palette,a={selectors:{"&, &:disabled, & button":{color:i.neutralTertiaryAlt,pointerEvents:"none"}}};return{root:[on,{width:196,padding:12,boxSizing:"content-box"},r&&{width:226},t],header:{position:"relative",display:"inline-flex",height:28,lineHeight:44,width:"100%"},monthAndYear:[To(o,{inset:1}),d(d({},He.fadeIn200),{alignItems:"center",fontSize:je.medium,fontFamily:"inherit",color:i.neutralPrimary,display:"inline-block",flexGrow:1,fontWeight:qe.semibold,padding:"0 4px 0 10px",border:"none",backgroundColor:"transparent",borderRadius:2,lineHeight:28,overflow:"hidden",whiteSpace:"nowrap",textAlign:"left",textOverflow:"ellipsis"}),n&&{selectors:{"&:hover":{cursor:"pointer",background:i.neutralLight,color:i.black}}}],monthComponents:{display:"inline-flex",alignSelf:"flex-end"},headerIconButton:[To(o,{inset:-1}),{width:28,height:28,display:"block",textAlign:"center",lineHeight:28,fontSize:je.small,fontFamily:"inherit",color:i.neutralPrimary,borderRadius:2,position:"relative",backgroundColor:"transparent",border:"none",padding:0,overflow:"visible",selectors:{"&:hover":{color:i.neutralDark,backgroundColor:i.neutralLight,cursor:"pointer",outline:"1px solid transparent"}}}],disabledStyle:a}}),void 0,{scope:"CalendarDay"}),jp=function(e){var t,o,n,r,i,a,s=e.className,l=e.theme,c=e.hasHeaderClickCallback,u=e.highlightCurrent,p=e.highlightSelected,h=e.animateBackwards,m=e.animationDirection,g=l.palette,f={};void 0!==h&&(f=m===Ap.Horizontal?h?He.slideRightIn20:He.slideLeftIn20:h?He.slideDownIn20:He.slideUpIn20);var v=void 0!==h?He.fadeIn200:{};return{root:[on,{width:196,padding:12,boxSizing:"content-box",overflow:"hidden"},s],headerContainer:{display:"flex"},currentItemButton:[To(l,{inset:-1}),d(d({},v),{fontSize:je.medium,fontWeight:qe.semibold,fontFamily:"inherit",textAlign:"left",backgroundColor:"transparent",flexGrow:1,padding:"0 4px 0 10px",border:"none",overflow:"visible"}),c&&{selectors:{"&:hover, &:active":{cursor:c?"pointer":"default",color:g.neutralDark,outline:"1px solid transparent",backgroundColor:g.neutralLight}}}],navigationButtonsContainer:{display:"flex",alignItems:"center"},navigationButton:[To(l,{inset:-1}),{fontFamily:"inherit",width:28,minWidth:28,height:28,minHeight:28,display:"block",textAlign:"center",lineHeight:28,fontSize:je.small,color:g.neutralPrimary,borderRadius:2,position:"relative",backgroundColor:"transparent",border:"none",padding:0,overflow:"visible",selectors:{"&:hover":{color:g.neutralDark,cursor:"pointer",outline:"1px solid transparent",backgroundColor:g.neutralLight}}}],gridContainer:{marginTop:4},buttonRow:d(d({},f),{marginBottom:16,selectors:{"&:nth-child(n + 3)":{marginBottom:0}}}),itemButton:[To(l,{inset:-1}),{width:40,height:40,minWidth:40,minHeight:40,lineHeight:40,fontSize:je.small,fontFamily:"inherit",padding:0,margin:"0 12px 0 0",color:g.neutralPrimary,backgroundColor:"transparent",border:"none",borderRadius:2,overflow:"visible",selectors:{"&:nth-child(4n + 4)":{marginRight:0},"&:nth-child(n + 9)":{marginBottom:0},"& div":{fontWeight:qe.regular},"&:hover":{color:g.neutralDark,backgroundColor:g.neutralLight,cursor:"pointer",outline:"1px solid transparent",selectors:(t={},t[ro]=d({background:"Window",color:"WindowText",outline:"1px solid Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},"&:active":{backgroundColor:g.themeLight,selectors:(o={},o[ro]=d({background:"Window",color:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)}}}],current:u?{color:g.white,backgroundColor:g.themePrimary,selectors:(n={"& div":{fontWeight:qe.semibold},"&:hover":{backgroundColor:g.themePrimary,selectors:(r={},r[ro]=d({backgroundColor:"WindowText",color:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)}},n[ro]=d({backgroundColor:"WindowText",color:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)}:{},selected:p?{color:g.neutralPrimary,backgroundColor:g.themeLight,fontWeight:qe.semibold,selectors:(i={"& div":{fontWeight:qe.semibold},"&:hover, &:active":{backgroundColor:g.themeLight,selectors:(a={},a[ro]=d({color:"Window",background:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a)}},i[ro]=d({background:"Highlight",color:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)}:{},disabled:{selectors:{"&, &:disabled, & button":{color:g.neutralTertiaryAlt,pointerEvents:"none"}}}}},qp=function(e){return jp(e)},Yp=$d,Zp=Yp,Xp={leftNavigation:"Up",rightNavigation:"Down",closeIcon:"CalculatorMultiply"},Qp=Jn(),Jp={prevRangeAriaLabel:void 0,nextRangeAriaLabel:void 0},$p=function(e){var t,o,n=e.styles,r=e.theme,i=e.className,a=e.highlightCurrentYear,s=e.highlightSelectedYear,l=e.year,c=e.selected,u=e.disabled,d=e.componentRef,p=e.onSelectYear,h=e.onRenderYear,m=f.useRef(null);f.useImperativeHandle(d,(function(){return{focus:function(){var e,t;null===(t=null===(e=m.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}}}),[]);var g=Qp(n,{theme:r,className:i,highlightCurrent:a,highlightSelected:s});return f.createElement("button",{className:qr(g.itemButton,(t={},t[g.selected]=c,t[g.disabled]=u,t)),type:"button",role:"gridcell",onClick:u?void 0:function(){null==p||p(l)},onKeyDown:u?void 0:function(e){e.which===Un.enter&&(null==p||p(l))},disabled:u,"aria-selected":c,ref:m,"aria-readonly":!0},null!==(o=null==h?void 0:h(l))&&void 0!==o?o:l)};$p.displayName="CalendarYearGridCell";var eh,th=function(e){var t=e.styles,o=e.theme,n=e.className,r=e.fromYear,i=e.toYear,a=e.animationDirection,s=e.animateBackwards,l=e.minYear,c=e.maxYear,u=e.onSelectYear,p=e.selectedYear,h=e.componentRef,m=f.useRef(null),g=f.useRef(null);f.useImperativeHandle(h,(function(){return{focus:function(){var e,t;null===(t=null===(e=m.current||g.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}}}),[]);for(var v,b,y,_,C=Qp(t,{theme:o,className:n,animateBackwards:s,animationDirection:a}),S=function(t){var o,n;return null!==(n=null===(o=e.onRenderYear)||void 0===o?void 0:o.call(e,t))&&void 0!==n?n:t},x=S(r)+" - "+S(i),k=r,w=[],I=0;I<(i-r+1)/4;I++){w.push([]);for(var D=0;D<4;D++)w[I].push((void 0,void 0,void 0,b=(v=k)===p,y=void 0!==l&&v<l||void 0!==c&&v>c,_=v===(new Date).getFullYear(),f.createElement($p,d({},e,{key:v,year:v,selected:b,current:_,disabled:y,onSelectYear:u,componentRef:b?m:_?g:void 0,theme:o})))),k++}return f.createElement(vs,null,f.createElement("div",{className:C.gridContainer,role:"grid","aria-label":x},w.map((function(e,t){return f.createElement("div",{key:"yearPickerRow_"+t+"_"+r,role:"row",className:C.buttonRow},e)}))))};th.displayName="CalendarYearGrid",function(e){e[e.Previous=0]="Previous",e[e.Next=1]="Next"}(eh||(eh={}));var oh=function(e){var t,o=e.styles,n=e.theme,r=e.className,i=e.navigationIcons,a=void 0===i?Xp:i,s=e.strings,l=void 0===s?Jp:s,c=e.direction,u=e.onSelectPrev,d=e.onSelectNext,p=e.fromYear,h=e.toYear,m=e.maxYear,g=e.minYear,v=Qp(o,{theme:n,className:r}),b=c===eh.Previous?l.prevRangeAriaLabel:l.nextRangeAriaLabel,y=c===eh.Previous?-12:12,_=b?"string"==typeof b?b:b({fromYear:p+y,toYear:h+y}):void 0,C=c===eh.Previous?void 0!==g&&p<g:void 0!==m&&e.fromYear+12>m,S=function(){c===eh.Previous?null==u||u():null==d||d()},x=jn()?c===eh.Next:c===eh.Previous;return f.createElement("button",{className:qr(v.navigationButton,(t={},t[v.disabled]=C,t)),onClick:C?void 0:S,onKeyDown:C?void 0:function(e){e.which===Un.enter&&S()},type:"button",title:_,disabled:C},f.createElement(ii,{iconName:x?a.leftNavigation:a.rightNavigation}))};oh.displayName="CalendarYearNavArrow";var nh=function(e){var t=e.styles,o=e.theme,n=e.className,r=Qp(t,{theme:o,className:n});return f.createElement("div",{className:r.navigationButtonsContainer},f.createElement(oh,d({},e,{direction:eh.Previous})),f.createElement(oh,d({},e,{direction:eh.Next})))};nh.displayName="CalendarYearNav";var rh=function(e){var t=e.styles,o=e.theme,n=e.className,r=e.fromYear,i=e.toYear,a=e.strings,s=void 0===a?Jp:a,l=e.animateBackwards,c=e.animationDirection,u=function(){var t;null===(t=e.onHeaderSelect)||void 0===t||t.call(e,!0)},d=function(t){var o,n;return null!==(n=null===(o=e.onRenderYear)||void 0===o?void 0:o.call(e,t))&&void 0!==n?n:t},p=Qp(t,{theme:o,className:n,hasHeaderClickCallback:!!e.onHeaderSelect,animateBackwards:l,animationDirection:c});if(e.onHeaderSelect){var h=s.rangeAriaLabel,m=s.headerAriaLabelFormatString,g=h?"string"==typeof h?h:h(e):void 0,v=m?wp(m,g):g;return f.createElement("button",{className:p.currentItemButton,onClick:u,onKeyDown:function(e){e.which!==Un.enter&&e.which!==Un.space||u()},"aria-label":v,role:"button",type:"button","aria-atomic":!0,"aria-live":"polite"},d(r)," - ",d(i))}return f.createElement("div",{className:p.current},d(r)," - ",d(i))};rh.displayName="CalendarYearTitle";var ih,ah=function(e){var t,o=e.styles,n=e.theme,r=e.className,i=e.animateBackwards,a=e.animationDirection,s=e.onRenderTitle,l=Qp(o,{theme:n,className:r,hasHeaderClickCallback:!!e.onHeaderSelect,animateBackwards:i,animationDirection:a});return f.createElement("div",{className:l.headerContainer},null!==(t=null==s?void 0:s(e))&&void 0!==t?t:f.createElement(rh,d({},e)),f.createElement(nh,d({},e)))};ah.displayName="CalendarYearHeader",function(e){e[e.Previous=0]="Previous",e[e.Next=1]="Next"}(ih||(ih={}));var sh=function(e){var t=function(e){var t=e.selectedYear,o=e.navigatedYear,n=t||o||(new Date).getFullYear(),r=10*Math.floor(n/10),i=Ti(r);return i&&i!==r?i>r:void 0}(e),o=function(e){var t=e.selectedYear,o=e.navigatedYear,n=f.useReducer((function(e,t){return e+(t===ih.Next?12:-12)}),void 0,(function(){var e=t||o||(new Date).getFullYear();return 10*Math.floor(e/10)})),r=n[0],i=n[1];return[r,r+12-1,function(){return i(ih.Next)},function(){return i(ih.Previous)}]}(e),n=o[0],r=o[1],i=o[2],a=o[3],s=f.useRef(null);f.useImperativeHandle(e.componentRef,(function(){return{focus:function(){var e,t;null===(t=null===(e=s.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}}}));var l=e.styles,c=e.theme,u=e.className,p=Qp(l,{theme:c,className:u});return f.createElement("div",{className:p.root},f.createElement(ah,d({},e,{fromYear:n,toYear:r,onSelectPrev:a,onSelectNext:i,animateBackwards:t})),f.createElement(th,d({},e,{fromYear:n,toYear:r,animateBackwards:t,componentRef:s})))};sh.displayName="CalendarYearBase";var lh=Vn(sh,(function(e){return jp(e)}),void 0,{scope:"CalendarYear"}),ch=Jn(),uh={styles:qp,strings:void 0,navigationIcons:Xp,dateTimeFormatter:Jd,yearPickerHidden:!1},dh=function(e){var t,o,n=tr(uh,e),r=function(e){var t=e.componentRef,o=f.useRef(null),n=f.useRef(null),r=f.useRef(!1),i=f.useCallback((function(){n.current?n.current.focus():o.current&&o.current.focus()}),[]);return f.useImperativeHandle(t,(function(){return{focus:i}}),[i]),f.useEffect((function(){r.current&&(i(),r.current=!1)})),[o,n,function(){r.current=!0}]}(n),i=r[0],a=r[1],s=r[2],l=f.useState(!1),c=l[0],u=l[1],d=function(e){var t=e.navigatedDate.getFullYear(),o=Ti(t);return void 0===o||o===t?void 0:o>t}(n),p=n.navigatedDate,h=n.selectedDate,m=n.strings,g=n.today,v=void 0===g?new Date:g,b=n.navigationIcons,y=n.dateTimeFormatter,_=n.minDate,C=n.maxDate,S=n.theme,x=n.styles,k=n.className,w=n.allFocusable,I=n.highlightCurrentMonth,D=n.highlightSelectedMonth,T=n.animationDirection,E=n.yearPickerHidden,P=n.onNavigateDate,M=function(e){return function(){return B(e)}},R=function(){P(rp(p,1),!1)},N=function(){P(rp(p,-1),!1)},B=function(e){var t;null===(t=n.onHeaderSelect)||void 0===t||t.call(n),P(cp(p,e),!0)},F=function(){var e;E?null===(e=n.onHeaderSelect)||void 0===e||e.call(n):(s(),u(!0))},A=b.leftNavigation,L=b.rightNavigation,H=y,O=!_||dp(_,sp(p))<0,z=!C||dp(lp(p),C)<0,W=ch(x,{theme:S,className:k,hasHeaderClickCallback:!!n.onHeaderSelect||!E,highlightCurrent:I,highlightSelected:D,animateBackwards:d,animationDirection:T});if(c){var V=function(e){var t=e.strings,o=e.navigatedDate,n=e.dateTimeFormatter,r=function(e){if(n){var t=new Date(o.getTime());return t.setFullYear(e),n.formatYear(t)}return String(e)},i=function(e){return r(e.fromYear)+" - "+r(e.toYear)};return[r,{rangeAriaLabel:i,prevRangeAriaLabel:function(e){return t.prevYearRangeAriaLabel?t.prevYearRangeAriaLabel+" "+i(e):""},nextRangeAriaLabel:function(e){return t.nextYearRangeAriaLabel?t.nextYearRangeAriaLabel+" "+i(e):""},headerAriaLabelFormatString:t.yearPickerHeaderAriaLabel}]}(n),K=V[0],U=V[1];return f.createElement(lh,{key:"calendarYear",minYear:_?_.getFullYear():void 0,maxYear:C?C.getFullYear():void 0,onSelectYear:function(e){if(s(),p.getFullYear()!==e){var t=new Date(p.getTime());t.setFullYear(e),C&&t>C?t=cp(t,C.getMonth()):_&&t<_&&(t=cp(t,_.getMonth())),P(t,!0)}u(!1)},navigationIcons:b,onHeaderSelect:function(e){s(),u(!1)},selectedYear:h?h.getFullYear():p?p.getFullYear():void 0,onRenderYear:K,strings:U,componentRef:a,styles:x,highlightCurrentYear:I,highlightSelectedYear:D,animationDirection:T})}for(var G=[],j=0;j<m.shortMonths.length/4;j++)G.push(j);var q=H.formatYear(p),Y=m.monthPickerHeaderAriaLabel?wp(m.monthPickerHeaderAriaLabel,q):q;return f.createElement("div",{className:W.root},f.createElement("div",{className:W.headerContainer},f.createElement("button",{className:W.currentItemButton,onClick:F,onKeyDown:hh(F),"aria-label":Y,"data-is-focusable":!!n.onHeaderSelect||!E,tabIndex:n.onHeaderSelect||!E?0:-1,type:"button","aria-atomic":!0,"aria-live":"polite"},q),f.createElement("div",{className:W.navigationButtonsContainer},f.createElement("button",{className:qr(W.navigationButton,(t={},t[W.disabled]=!O,t)),"aria-disabled":!O,tabIndex:O?void 0:w?0:-1,onClick:O?N:void 0,onKeyDown:O?hh(N):void 0,title:m.prevYearAriaLabel?m.prevYearAriaLabel+" "+H.formatYear(rp(p,-1)):void 0,type:"button"},f.createElement(ii,{iconName:jn()?L:A})),f.createElement("button",{className:qr(W.navigationButton,(o={},o[W.disabled]=!z,o)),"aria-disabled":!z,tabIndex:z?void 0:w?0:-1,onClick:z?R:void 0,onKeyDown:z?hh(R):void 0,title:m.nextYearAriaLabel?m.nextYearAriaLabel+" "+H.formatYear(rp(p,1)):void 0,type:"button"},f.createElement(ii,{iconName:jn()?A:L})))),f.createElement(vs,null,f.createElement("div",{className:W.gridContainer,role:"grid","aria-label":q},G.map((function(e){var t=m.shortMonths.slice(4*e,4*(e+1));return f.createElement("div",{key:"monthRow_"+e+p.getFullYear(),role:"row",className:W.buttonRow},t.map((function(t,o){var n,r=4*e+o,a=cp(p,r),s=p.getMonth()===r,l=h.getMonth()===r,c=h.getFullYear()===p.getFullYear(),u=(!_||dp(_,ap(a))<1)&&(!C||dp(ip(a),C)<1);return f.createElement("button",{ref:s?i:void 0,role:"gridcell",className:qr(W.itemButton,(n={},n[W.current]=I&&ph(r,p.getFullYear(),v),n[W.selected]=D&&l&&c,n[W.disabled]=!u,n)),disabled:!w&&!u,key:r,onClick:u?M(r):void 0,onKeyDown:u?hh(M(r)):void 0,"aria-label":H.formatMonth(a,m),"aria-selected":s,"data-is-focusable":!!u||void 0,type:"button","aria-readonly":!0},t)})))})))))};function ph(e,t,o){return o.getFullYear()===t&&o.getMonth()===e}function hh(e){return function(t){switch(t.which){case Un.enter:e()}}}dh.displayName="CalendarMonthBase";var mh=Vn(dh,qp,void 0,{scope:"CalendarMonth"});function gh(e,t,o){var n=f.useState(t),r=n[0],i=n[1],a=Ei(void 0!==e),s=a?e:r,l=f.useRef(s),c=f.useRef(o);f.useEffect((function(){l.current=s,c.current=o}));var u=Ei((function(){return function(e,t){var o="function"==typeof e?e(l.current):e;c.current&&c.current(t,o),a||i(o)}}));return[s,u]}var fh=Jn(),vh=[jd.Monday,jd.Tuesday,jd.Wednesday,jd.Thursday,jd.Friday],bh={isMonthPickerVisible:!0,isDayPickerVisible:!0,showMonthPickerAsOverlay:!1,today:new Date,firstDayOfWeek:jd.Sunday,dateRangeType:Zd.Day,showGoToToday:!0,strings:$d,highlightCurrentMonth:!1,highlightSelectedMonth:!1,navigationIcons:Xp,showWeekNumbers:!1,firstWeekOfYear:Yd.FirstDay,dateTimeFormatter:Jd,showSixWeeksByDefault:!1,workWeekDays:vh,showCloseButton:!1,allFocusable:!1},yh=f.forwardRef((function(e,t){var o=tr(bh,e),n=function(e){var t=e.value,o=e.today,n=void 0===o?new Date:o,r=e.onSelectDate,i=gh(t,n),a=i[0],s=void 0===a?n:a,l=i[1],c=f.useState(t),u=c[0],d=void 0===u?n:u,p=c[1],h=f.useState(t),m=h[0],g=void 0===m?n:m,v=h[1],b=f.useState(t),y=b[0],_=void 0===y?n:y,C=b[1];return t&&_.valueOf()!==t.valueOf()&&(p(t),v(t),C(t)),[s,d,g,function(e,t){v(e),p(e),l(e),null==r||r(e,t)},function(e){v(e),p(e)},function(e){v(e)}]}(o),r=n[0],i=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=function(e){var t=gh(_h(e)?void 0:e.isMonthPickerVisible,!1),o=t[0],n=void 0===o||o,r=t[1],i=gh(_h(e)?void 0:e.isDayPickerVisible,!0),a=i[0],s=void 0===a||a,l=i[1];return[n,s,function(){r(!n),l(!s)}]}(o),p=u[0],h=u[1],m=u[2],g=function(e,t,o){var n=e.componentRef,r=f.useRef(null),i=f.useRef(null),a=f.useRef(!1),s=f.useCallback((function(){t&&r.current?Aa(r.current):o&&i.current&&Aa(i.current)}),[t,o]);return f.useImperativeHandle(n,(function(){return{focus:s}}),[s]),f.useEffect((function(){a.current&&(s(),a.current=!1)})),[r,i,function(){a.current=!0}]}(o,h,p),v=g[0],b=g[1],y=g[2],_=function(){var e=D;return e&&U&&(e=i.getFullYear()!==U.getFullYear()||i.getMonth()!==U.getMonth()||a.getFullYear()!==U.getFullYear()||a.getMonth()!==U.getMonth()),D&&f.createElement("button",{className:qr("js-goToday",Y.goTodayButton),onClick:S,onKeyDown:x(S),type:"button",disabled:!e},I.goToToday)},C=_h(o)?function(){m(),y()}:void 0,S=function(){l(U),y()},x=function(e){return function(t){switch(t.which){case Un.enter:case Un.space:e()}}},k=o.firstDayOfWeek,w=o.dateRangeType,I=o.strings,D=o.showGoToToday,T=o.highlightCurrentMonth,E=o.highlightSelectedMonth,P=o.navigationIcons,M=o.minDate,R=o.maxDate,N=o.restrictedDates,B=o.className,F=o.showCloseButton,A=o.allFocusable,L=o.styles,H=o.showWeekNumbers,O=o.theme,z=o.calendarDayProps,W=o.calendarMonthProps,V=o.dateTimeFormatter,K=o.today,U=void 0===K?new Date:K,G=_h(o),j=!G&&!h,q=G&&D,Y=fh(L,{theme:O,className:B,isMonthPickerVisible:p,isDayPickerVisible:h,monthPickerOnly:j,showMonthPickerAsOverlay:G,overlaidWithButton:q,overlayedWithButton:q,showGoToToday:D,showWeekNumbers:H}),Z="",X="";V&&I.todayDateFormatString&&(Z=wp(I.todayDateFormatString,V.formatMonthDayYear(U,I))),V&&I.selectedDateFormatString&&(X=wp(I.selectedDateFormatString,V.formatMonthDayYear(r,I)));var Q=X+", "+Z;return f.createElement("div",{ref:t,role:"group","aria-label":Q,className:qr("ms-DatePicker",Y.root,B,"ms-slideDownIn10"),onKeyDown:function(e){var t;switch(e.which){case Un.enter:case Un.backspace:e.preventDefault();break;case Un.escape:null===(t=o.onDismiss)||void 0===t||t.call(o);break;case Un.pageUp:e.ctrlKey?l(rp(i,1)):l(np(i,1)),e.preventDefault();break;case Un.pageDown:e.ctrlKey?l(rp(i,-1)):l(np(i,-1)),e.preventDefault()}}},f.createElement("div",{className:Y.liveRegion,"aria-live":"polite","aria-atomic":"true"},f.createElement("span",null,X)),h&&f.createElement(Gp,d({selectedDate:r,navigatedDate:i,today:o.today,onSelectDate:s,onNavigateDate:function(e,t){l(e),t&&y()},onDismiss:o.onDismiss,firstDayOfWeek:k,dateRangeType:w,strings:I,onHeaderSelect:C,navigationIcons:P,showWeekNumbers:o.showWeekNumbers,firstWeekOfYear:o.firstWeekOfYear,dateTimeFormatter:o.dateTimeFormatter,showSixWeeksByDefault:o.showSixWeeksByDefault,minDate:M,maxDate:R,restrictedDates:N,workWeekDays:o.workWeekDays,componentRef:v,showCloseButton:F,allFocusable:A},z)),h&&p&&f.createElement("div",{className:Y.divider}),p?f.createElement("div",{className:Y.monthPickerWrapper},f.createElement(mh,d({navigatedDate:a,selectedDate:i,strings:I,onNavigateDate:function(e,t){t&&y(),t?(j&&s(e),l(e)):c(e)},today:o.today,highlightCurrentMonth:T,highlightSelectedMonth:E,onHeaderSelect:C,navigationIcons:P,dateTimeFormatter:o.dateTimeFormatter,minDate:M,maxDate:R,componentRef:b},W)),_()):_(),f.createElement(ks,null))}));function _h(e){var t=at();return e.showMonthPickerAsOverlay||t&&t.innerWidth<=440}yh.displayName="CalendarBase";var Ch=Vn(yh,(function(e){var t=e.className,o=e.theme,n=e.isDayPickerVisible,r=e.isMonthPickerVisible,i=e.showWeekNumbers,a=o.palette,s=n&&r?440:220;return i&&n&&(s+=30),{root:[on,{display:"flex",width:s},!r&&{flexDirection:"column"},t],divider:{top:0,borderRight:"1px solid",borderColor:a.neutralLight},monthPickerWrapper:[{display:"flex",flexDirection:"column"}],goTodayButton:[To(o,{inset:-1}),{bottom:0,color:a.neutralPrimary,height:30,lineHeight:30,backgroundColor:"transparent",border:"none",boxSizing:"content-box",padding:"0 4px",alignSelf:"flex-end",marginRight:16,marginTop:3,fontSize:je.small,fontFamily:"inherit",overflow:"visible",selectors:{"& div":{fontSize:je.small},"&:hover":{color:a.themePrimary,backgroundColor:"transparent",cursor:"pointer"},"&:active":{color:a.themeDark},"&:disabled":{color:a.neutralTertiaryAlt,pointerEvents:"none"}}}],liveRegion:{border:0,height:"1px",margin:"-1px",overflow:"hidden",padding:0,width:"1px",position:"absolute"}}}),void 0,{scope:"Calendar"});function Sh(e){for(var t,o=[],n=nt(e)||document;e!==n.body;){for(var r=0,i=e.parentElement.children;r<i.length;r++){var a=i[r];a!==e&&"true"!==(null===(t=a.getAttribute("aria-hidden"))||void 0===t?void 0:t.toLowerCase())&&o.push(a)}if(!e.parentElement)break;e=e.parentElement}return o.forEach((function(e){e.setAttribute("aria-hidden","true")})),function(){!function(e){e.forEach((function(e){e.setAttribute("aria-hidden","false")}))}(o),o=[]}}var xh=f.forwardRef((function(e,t){var o=f.useRef(null),n=f.useRef(null),r=f.useRef(null),i=Or(o,t),a=Kd(void 0,e.id),s=zl(),l=Tr(e,Dr),c=Ei((function(){return{previouslyFocusedElementOutsideTrapZone:void 0,previouslyFocusedElementInTrapZone:void 0,disposeFocusHandler:void 0,disposeClickHandler:void 0,hasFocus:!1,unmodalize:void 0}})),u=e.ariaLabelledBy,p=e.className,h=e.children,m=e.componentRef,g=e.disabled,v=e.disableFirstFocus,b=void 0!==v&&v,y=e.disabled,_=void 0!==y&&y,C=e.elementToFocusOnDismiss,S=e.forceFocusInsideTrap,x=void 0===S||S,k=e.focusPreviouslyFocusedInnerElement,w=e.firstFocusableSelector,I=e.ignoreExternalFocusing,D=e.isClickableOutsideFocusTrap,T=void 0!==D&&D,E=e.onFocus,P=e.onBlur,M=e.onFocusCapture,R=e.onBlurCapture,N=e.enableAriaHiddenSiblings,B={"aria-hidden":!0,style:{pointerEvents:"none",position:"fixed"},tabIndex:g?-1:0,"data-is-visible":!0},F=f.useCallback((function(){if(k&&c.previouslyFocusedElementInTrapZone&&Ca(o.current,c.previouslyFocusedElementInTrapZone))Aa(c.previouslyFocusedElementInTrapZone);else{var e="string"==typeof w?w:w&&w(),t=null;o.current&&(e&&(t=o.current.querySelector("."+e)),t||(t=Ta(o.current,o.current.firstChild,!1,!1,!1,!0))),t&&Aa(t)}}),[w,k,c]),A=f.useCallback((function(e){if(!g){var t=e===c.hasFocus?r.current:n.current;if(o.current){var i=e===c.hasFocus?wa(o.current,t,!0,!1):ka(o.current,t,!0,!1);i&&(i===n.current||i===r.current?F():i.focus())}}}),[g,F,c]),L=f.useCallback((function(e){null==R||R(e);var t=e.relatedTarget;null===e.relatedTarget&&(t=s.activeElement),Ca(o.current,t)||(c.hasFocus=!1)}),[s,c,R]),H=f.useCallback((function(e){null==M||M(e),e.target===n.current?A(!0):e.target===r.current&&A(!1),c.hasFocus=!0,e.target!==e.currentTarget&&e.target!==n.current&&e.target!==r.current&&(c.previouslyFocusedElementInTrapZone=e.target)}),[M,c,A]),O=f.useCallback((function(){if(xh.focusStack=xh.focusStack.filter((function(e){return a!==e})),s){var e=s.activeElement;I||!c.previouslyFocusedElementOutsideTrapZone||"function"!=typeof c.previouslyFocusedElementOutsideTrapZone.focus||!Ca(o.current,e)&&e!==s.body||c.previouslyFocusedElementOutsideTrapZone!==n.current&&c.previouslyFocusedElementOutsideTrapZone!==r.current&&Aa(c.previouslyFocusedElementOutsideTrapZone)}}),[s,a,I,c]),z=f.useCallback((function(e){if(!g&&xh.focusStack.length&&a===xh.focusStack[xh.focusStack.length-1]){var t=e.target;Ca(o.current,t)||(F(),c.hasFocus=!0,e.preventDefault(),e.stopPropagation())}}),[g,a,F,c]),W=f.useCallback((function(e){if(!g&&xh.focusStack.length&&a===xh.focusStack[xh.focusStack.length-1]){var t=e.target;t&&!Ca(o.current,t)&&(F(),c.hasFocus=!0,e.preventDefault(),e.stopPropagation())}}),[g,a,F,c]),V=f.useCallback((function(){x&&!c.disposeFocusHandler?c.disposeFocusHandler=ol(window,"focus",z,!0):!x&&c.disposeFocusHandler&&(c.disposeFocusHandler(),c.disposeFocusHandler=void 0),T||c.disposeClickHandler?T&&c.disposeClickHandler&&(c.disposeClickHandler(),c.disposeClickHandler=void 0):c.disposeClickHandler=ol(window,"click",W,!0)}),[W,z,x,T,c]);return f.useEffect((function(){var e=o.current;return V(),function(){g&&!x&&Ca(e,null==s?void 0:s.activeElement)||O()}}),[V]),f.useEffect((function(){var e=void 0===x||x,t=void 0!==g&&g;if(!t||e){if(_)return;xh.focusStack.push(a),c.previouslyFocusedElementOutsideTrapZone=C||s.activeElement,b||Ca(o.current,c.previouslyFocusedElementOutsideTrapZone)||F(),!c.unmodalize&&o.current&&N&&(c.unmodalize=Sh(o.current))}else e&&!t||(O(),c.unmodalize&&c.unmodalize());C&&c.previouslyFocusedElementOutsideTrapZone!==C&&(c.previouslyFocusedElementOutsideTrapZone=C)}),[C,x,g]),kh((function(){c.disposeClickHandler&&(c.disposeClickHandler(),c.disposeClickHandler=void 0),c.disposeFocusHandler&&(c.disposeFocusHandler(),c.disposeFocusHandler=void 0),c.unmodalize&&c.unmodalize(),delete c.previouslyFocusedElementInTrapZone,delete c.previouslyFocusedElementOutsideTrapZone})),function(e,t,o){f.useImperativeHandle(e,(function(){return{get previouslyFocusedElement(){return t},focus:o}}),[t,o])}(m,c.previouslyFocusedElementInTrapZone,F),f.createElement("div",d({},l,{className:p,ref:i,"aria-labelledby":u,onFocusCapture:H,onFocus:E,onBlur:P,onBlurCapture:L}),f.createElement("div",d({},B,{ref:n})),h,f.createElement("div",d({},B,{ref:r})))})),kh=function(e){var t=f.useRef(e);t.current=e,f.useEffect((function(){return function(){t.current&&t.current()}}),[e])};xh.displayName="FocusTrapZone",xh.focusStack=[];var wh=function(e){return f.createElement(Cc,d({},e),f.createElement(xh,d({disabled:e.hidden},e.focusTrapProps),e.children))},Ih=Jn(),Dh=f.forwardRef((function(e,t){var o=e.checked,n=void 0!==o&&o,r=e.className,i=e.theme,a=e.styles,s=e.useFastIcons,l=void 0===s||s,c=Ih(a,{theme:i,className:r,checked:n}),u=l?ti:ii;return f.createElement("div",{className:c.root,ref:t},f.createElement(u,{iconName:"CircleRing",className:c.circle}),f.createElement(u,{iconName:"StatusCircleCheckmark",className:c.check}))}));Dh.displayName="CheckBase";var Th={root:"ms-Check",circle:"ms-Check-circle",check:"ms-Check-check",checkHost:"ms-Check-checkHost"},Eh=Vn(Dh,(function(e){var t,o,n,r,i,a=e.height,s=void 0===a?e.checkBoxHeight||"18px":a,l=e.checked,c=e.className,u=e.theme,p=u.palette,h=u.semanticColors,m=u.fonts,g=jn(u),f=Qo(Th,u),v={fontSize:s,position:"absolute",left:0,top:0,width:s,height:s,textAlign:"center",display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle"};return{root:[f.root,m.medium,{lineHeight:"1",width:s,height:s,verticalAlign:"top",position:"relative",userSelect:"none",selectors:(t={":before":{content:'""',position:"absolute",top:"1px",right:"1px",bottom:"1px",left:"1px",borderRadius:"50%",opacity:1,background:h.bodyBackground}},t["."+f.checkHost+":hover &, ."+f.checkHost+":focus &, &:hover, &:focus"]={opacity:1},t)},l&&["is-checked",{selectors:{":before":{background:p.themePrimary,opacity:1,selectors:(o={},o[ro]={background:"Window"},o)}}}],c],circle:[f.circle,v,{color:p.neutralSecondary,selectors:(n={},n[ro]={color:"WindowText"},n)},l&&{color:p.white}],check:[f.check,v,{opacity:0,color:p.neutralSecondary,fontSize:Ye.medium,left:g?"-0.5px":".5px",top:"-1px",selectors:(r={":hover":{opacity:1}},r[ro]=d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)},l&&{opacity:1,color:p.white,fontWeight:900,selectors:(i={},i[ro]={border:"none",color:"WindowText"},i)}],checkHost:f.checkHost}}),void 0,{scope:"Check"},!0),Ph=Jn(),Mh=f.forwardRef((function(e,t){var o=e.disabled,n=e.required,r=e.inputProps,i=e.name,a=e.ariaLabel,s=e.ariaLabelledBy,l=e.ariaDescribedBy,c=e.ariaPositionInSet,u=e.ariaSetSize,p=e.title,h=e.checkmarkIconProps,m=e.styles,g=e.theme,v=e.className,b=e.boxSide,y=void 0===b?"start":b,_=Kd("checkbox-",e.id),C=f.useRef(null),S=Or(C,t),x=f.useRef(null),k=gh(e.checked,e.defaultChecked,e.onChange),w=k[0],I=k[1],D=gh(e.indeterminate,e.defaultIndeterminate),T=D[0],E=D[1];xs(C),function(e){Mi({name:"Checkbox",props:e,mutuallyExclusive:{checked:"defaultChecked",indeterminate:"defaultIndeterminate"}})}(e),function(e,t,o,n){f.useImperativeHandle(e.componentRef,(function(){return{get checked(){return!!t},get indeterminate(){return!!o},focus:function(){n.current&&n.current.focus()}}}),[n,t,o])}(e,w,T,x);var P=Ph(m,{theme:g,className:v,disabled:o,indeterminate:T,checked:w,reversed:"start"!==y,isUsingCustomLabelRender:!!e.onRenderLabel}),M=f.useCallback((function(e){return e&&e.label?f.createElement("span",{className:P.text,title:e.title},e.label):null}),[P.text]),R=e.onRenderLabel||M,N=T?"mixed":w?"true":"false",B=d(d({className:P.input,type:"checkbox"},r),{checked:!!w,disabled:o,required:n,name:i,id:_,title:p,onChange:function(e){T?(I(!!w,e),E(!1)):I(!w,e)},"aria-disabled":o,"aria-label":a,"aria-labelledby":s,"aria-describedby":l,"aria-posinset":c,"aria-setsize":u,"aria-checked":N});return f.createElement("div",{className:P.root,title:p,ref:S},f.createElement("input",d({},B,{ref:x,title:p,"data-ktp-execute-target":!0})),f.createElement("label",{className:P.label,htmlFor:_},f.createElement("div",{className:P.checkbox,"data-ktp-target":!0},f.createElement(ii,d({iconName:"CheckMark"},h,{className:P.checkmark}))),R(e,M)))}));Mh.displayName="CheckboxBase";var Rh={root:"ms-Checkbox",label:"ms-Checkbox-label",checkbox:"ms-Checkbox-checkbox",checkmark:"ms-Checkbox-checkmark",text:"ms-Checkbox-text"},Nh="20px",Bh="200ms",Fh="cubic-bezier(.4, 0, .23, 1)",Ah=Vn(Mh,(function(e){var t,o,n,r,i,a,s,l,c,u,p,h,m,g,f,v,b,y,_=e.className,C=e.theme,S=e.reversed,x=e.checked,k=e.disabled,w=e.isUsingCustomLabelRender,I=e.indeterminate,D=C.semanticColors,T=C.effects,E=C.palette,P=C.fonts,M=Qo(Rh,C),R=D.inputForegroundChecked,N=E.neutralSecondary,B=E.neutralPrimary,F=D.inputBackgroundChecked,A=D.inputBackgroundChecked,L=D.disabledBodySubtext,H=D.inputBorderHovered,O=D.inputBackgroundCheckedHovered,z=D.inputBackgroundChecked,W=D.inputBackgroundCheckedHovered,V=D.inputBackgroundCheckedHovered,K=D.inputTextHovered,U=D.disabledBodySubtext,G=D.bodyText,j=D.disabledText,q=[(t={content:'""',borderRadius:T.roundedCorner2,position:"absolute",width:10,height:10,top:4,left:4,boxSizing:"border-box",borderWidth:5,borderStyle:"solid",borderColor:k?L:F,transitionProperty:"border-width, border, border-color",transitionDuration:Bh,transitionTimingFunction:Fh},t[ro]={borderColor:"WindowText"},t)];return{root:[M.root,{position:"relative",display:"flex"},S&&"reversed",x&&"is-checked",!k&&"is-enabled",k&&"is-disabled",!k&&[!x&&(o={},o[":hover ."+M.checkbox]=(n={borderColor:H},n[ro]={borderColor:"Highlight"},n),o[":focus ."+M.checkbox]={borderColor:H},o[":hover ."+M.checkmark]=(r={color:N,opacity:"1"},r[ro]={color:"Highlight"},r),o),x&&!I&&(i={},i[":hover ."+M.checkbox]={background:W,borderColor:V},i[":focus ."+M.checkbox]={background:W,borderColor:V},i[ro]=(a={},a[":hover ."+M.checkbox]={background:"Highlight",borderColor:"Highlight"},a[":focus ."+M.checkbox]={background:"Highlight"},a[":focus:hover ."+M.checkbox]={background:"Highlight"},a[":focus:hover ."+M.checkmark]={color:"Window"},a[":hover ."+M.checkmark]={color:"Window"},a),i),I&&(s={},s[":hover ."+M.checkbox+", :hover ."+M.checkbox+":after"]=(l={borderColor:O},l[ro]={borderColor:"WindowText"},l),s[":focus ."+M.checkbox]={borderColor:O},s[":hover ."+M.checkmark]={opacity:"0"},s),(c={},c[":hover ."+M.text+", :focus ."+M.text]=(u={color:K},u[ro]={color:k?"GrayText":"WindowText"},u),c)],_],input:(p={position:"absolute",background:"none",opacity:0},p["."+wo+" &:focus + label::before"]=(h={outline:"1px solid "+C.palette.neutralSecondary,outlineOffset:"2px"},h[ro]={outline:"1px solid WindowText"},h),p),label:[M.label,C.fonts.medium,{display:"flex",alignItems:w?"center":"flex-start",cursor:k?"default":"pointer",position:"relative",userSelect:"none"},S&&{flexDirection:"row-reverse",justifyContent:"flex-end"},{"&::before":{position:"absolute",left:0,right:0,top:0,bottom:0,content:'""',pointerEvents:"none"}}],checkbox:[M.checkbox,(m={position:"relative",display:"flex",flexShrink:0,alignItems:"center",justifyContent:"center",height:Nh,width:Nh,border:"1px solid "+B,borderRadius:T.roundedCorner2,boxSizing:"border-box",transitionProperty:"background, border, border-color",transitionDuration:Bh,transitionTimingFunction:Fh,overflow:"hidden",":after":I?q:null},m[ro]=d({borderColor:"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),m),I&&{borderColor:F},S?{marginLeft:4}:{marginRight:4},!k&&!I&&x&&(g={background:z,borderColor:A},g[ro]={background:"Highlight",borderColor:"Highlight"},g),k&&(f={borderColor:L},f[ro]={borderColor:"GrayText"},f),x&&k&&(v={background:U,borderColor:L},v[ro]={background:"Window"},v)],checkmark:[M.checkmark,(b={opacity:x?"1":"0",color:R},b[ro]=d({color:k?"GrayText":"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),b)],text:[M.text,(y={color:k?j:G,fontSize:P.medium.fontSize,lineHeight:"20px"},y[ro]=d({color:k?"GrayText":"WindowText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),y),S?{marginRight:4}:{marginLeft:4}]}}),void 0,{scope:"Checkbox"}),Lh=Jn({cacheSize:100}),Hh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.as,o=void 0===t?"label":t,n=e.children,r=e.className,i=e.disabled,a=e.styles,s=e.required,l=e.theme,c=Lh(a,{className:r,disabled:i,required:s,theme:l});return f.createElement(o,d({},Tr(this.props,Dr),{className:c.root}),n)},t}(f.Component),Oh=Vn(Hh,(function(e){var t,o=e.theme,n=e.className,r=e.disabled,i=e.required,a=o.semanticColors,s=qe.semibold,l=a.bodyText,c=a.disabledBodyText,u=a.errorText;return{root:["ms-Label",o.fonts.medium,{fontWeight:s,color:l,boxSizing:"border-box",boxShadow:"none",margin:0,display:"block",padding:"5px 0",wordWrap:"break-word",overflowWrap:"break-word"},r&&{color:c,selectors:(t={},t[ro]=d({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},i&&{selectors:{"::after":{content:"' *'",color:u,paddingRight:12}}},n]}}),void 0,{scope:"Label"}),zh=qo((function(e){return qo((function(t){var o=qo((function(e){return function(o){return t(o,e)}}));return function(n,r){return e(n,r?o(r):t)}}))}));function Wh(e,t){return zh(e)(t)}var Vh=Jn(),Kh={imageSize:{width:32,height:32}},Uh=function(e){var t=tr(d(d({},Kh),{key:e.itemKey}),e),o=t.ariaLabel,n=t.focused,r=t.required,i=t.theme,a=t.iconProps,s=t.imageSrc,l=t.imageSize,c=t.disabled,u=t.checked,h=t.id,m=t.styles,g=t.name,v=p(t,["ariaLabel","focused","required","theme","iconProps","imageSrc","imageSize","disabled","checked","id","styles","name"]),b=Vh(m,{theme:i,hasIcon:!!a,hasImage:!!s,checked:u,disabled:c,imageIsLarge:!!s&&(l.width>71||l.height>71),imageSize:l,focused:n}),y=Tr(v,hr),_=y.className,C=p(y,["className"]),S=function(){return f.createElement("span",{id:t.labelId,className:"ms-ChoiceFieldLabel"},t.text)},x=function(){var e=t.imageAlt,o=void 0===e?"":e,n=t.selectedImageSrc,r=(t.onRenderLabel?Wh(t.onRenderLabel,S):S)(t);return f.createElement("label",{htmlFor:h,className:b.field},s&&f.createElement("div",{className:b.innerField},f.createElement("div",{className:b.imageWrapper},f.createElement(Ur,d({src:s,alt:o},l))),f.createElement("div",{className:b.selectedImageWrapper},f.createElement(Ur,d({src:n,alt:o},l)))),a&&f.createElement("div",{className:b.innerField},f.createElement("div",{className:b.iconWrapper},f.createElement(ii,d({},a)))),s||a?f.createElement("div",{className:b.labelWrapper},r):r)},k=t.onRenderField,w=void 0===k?x:k;return f.createElement("div",{className:b.root},f.createElement("div",{className:b.choiceFieldWrapper},f.createElement("input",d({"aria-label":o,id:h,className:qr(b.input,_),type:"radio",name:g,disabled:c,checked:u,required:r},C,{onChange:function(e){var o;null===(o=t.onChange)||void 0===o||o.call(t,e,t)},onFocus:function(e){var o;null===(o=t.onFocus)||void 0===o||o.call(t,e,t)},onBlur:function(e){var o;null===(o=t.onBlur)||void 0===o||o.call(t,e)}})),w(t,x)))};Uh.displayName="ChoiceGroupOption";var Gh={root:"ms-ChoiceField",choiceFieldWrapper:"ms-ChoiceField-wrapper",input:"ms-ChoiceField-input",field:"ms-ChoiceField-field",innerField:"ms-ChoiceField-innerField",imageWrapper:"ms-ChoiceField-imageWrapper",iconWrapper:"ms-ChoiceField-iconWrapper",labelWrapper:"ms-ChoiceField-labelWrapper",checked:"is-checked"},jh="200ms",qh="cubic-bezier(.4, 0, .23, 1)";function Yh(e,t){var o,n;return["is-inFocus",{selectors:(o={},o["."+wo+" &"]={position:"relative",outline:"transparent",selectors:{"::-moz-focus-inner":{border:0},":after":{content:'""',top:-2,right:-2,bottom:-2,left:-2,pointerEvents:"none",border:"1px solid "+e,position:"absolute",selectors:(n={},n[ro]={borderColor:"WindowText",borderWidth:t?1:2},n)}}},o)}]}function Zh(e,t,o){return[t,{paddingBottom:2,transitionProperty:"opacity",transitionDuration:jh,transitionTimingFunction:"ease",selectors:{".ms-Image":{display:"inline-block",borderStyle:"none"}}},(o?!e:e)&&["is-hidden",{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"hidden",opacity:0}]]}var Xh=Vn(Uh,(function(e){var t,o,n,r,i,a=e.theme,s=e.hasIcon,l=e.hasImage,c=e.checked,u=e.disabled,p=e.imageIsLarge,h=e.focused,m=e.imageSize,g=a.palette,f=a.semanticColors,v=a.fonts,b=Qo(Gh,a),y=g.neutralPrimary,_=f.inputBorderHovered,C=f.inputBackgroundChecked,S=g.themeDark,x=f.disabledBodySubtext,k=f.bodyBackground,w=g.neutralSecondary,I=f.inputBackgroundChecked,D=g.themeDark,T=f.disabledBodySubtext,E=g.neutralDark,P=f.focusBorder,M=f.inputBorderHovered,R=f.inputBackgroundChecked,N=g.themeDark,B=g.neutralLighter,F={selectors:{".ms-ChoiceFieldLabel":{color:E},":before":{borderColor:c?S:_},":after":[!s&&!l&&!c&&{content:'""',transitionProperty:"background-color",left:5,top:5,width:10,height:10,backgroundColor:w},c&&{borderColor:D,background:D}]}},A={borderColor:c?N:M,selectors:{":before":{opacity:1,borderColor:c?S:_}}},L=[{content:'""',display:"inline-block",backgroundColor:k,borderWidth:1,borderStyle:"solid",borderColor:y,width:20,height:20,fontWeight:"normal",position:"absolute",top:0,left:0,boxSizing:"border-box",transitionProperty:"border-color",transitionDuration:jh,transitionTimingFunction:qh,borderRadius:"50%"},u&&{borderColor:x,selectors:(t={},t[ro]=d({borderColor:"GrayText",background:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},c&&{borderColor:u?x:C,selectors:(o={},o[ro]={borderColor:"Highlight",background:"Window",forcedColorAdjust:"none"},o)},(s||l)&&{top:3,right:3,left:"auto",opacity:c?1:0}],H=[{content:'""',width:0,height:0,borderRadius:"50%",position:"absolute",left:10,right:0,transitionProperty:"border-width",transitionDuration:jh,transitionTimingFunction:qh,boxSizing:"border-box"},c&&{borderWidth:5,borderStyle:"solid",borderColor:u?T:I,background:I,left:5,top:5,width:10,height:10,selectors:(n={},n[ro]={borderColor:"Highlight",forcedColorAdjust:"none"},n)},c&&(s||l)&&{top:8,right:8,left:"auto"}];return{root:[b.root,a.fonts.medium,{display:"flex",alignItems:"center",boxSizing:"border-box",color:f.bodyText,minHeight:26,border:"none",position:"relative",marginTop:8,selectors:{".ms-ChoiceFieldLabel":{display:"inline-block"}}},!s&&!l&&{selectors:{".ms-ChoiceFieldLabel":{paddingLeft:"26px"}}},l&&"ms-ChoiceField--image",s&&"ms-ChoiceField--icon",(s||l)&&{display:"inline-flex",fontSize:0,margin:"0 4px 4px 0",paddingLeft:0,backgroundColor:B,height:"100%"}],choiceFieldWrapper:[b.choiceFieldWrapper,h&&Yh(P,s||l)],input:[b.input,{position:"absolute",opacity:0,top:0,right:0,width:"100%",height:"100%",margin:0},u&&"is-disabled"],field:[b.field,c&&b.checked,{display:"inline-block",cursor:"pointer",marginTop:0,position:"relative",verticalAlign:"top",userSelect:"none",minHeight:20,selectors:{":hover":!u&&F,":focus":!u&&F,":before":L,":after":H}},s&&"ms-ChoiceField--icon",l&&"ms-ChoiceField-field--image",(s||l)&&{boxSizing:"content-box",cursor:"pointer",paddingTop:22,margin:0,textAlign:"center",transitionProperty:"all",transitionDuration:jh,transitionTimingFunction:"ease",border:"1px solid transparent",justifyContent:"center",alignItems:"center",display:"flex",flexDirection:"column"},c&&{borderColor:R},(s||l)&&!u&&{selectors:{":hover":A,":focus":A}},u&&{cursor:"default",selectors:{".ms-ChoiceFieldLabel":{color:f.disabledBodyText,selectors:(r={},r[ro]=d({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)}}},c&&u&&{borderColor:B}],innerField:[b.innerField,l&&{height:m.height,width:m.width},(s||l)&&{position:"relative",display:"inline-block",paddingLeft:30,paddingRight:30},(s||l)&&p&&{paddingLeft:24,paddingRight:24},(s||l)&&u&&{opacity:.25,selectors:(i={},i[ro]={color:"GrayText",opacity:1},i)}],imageWrapper:Zh(!1,b.imageWrapper,c),selectedImageWrapper:Zh(!0,b.imageWrapper,c),iconWrapper:[b.iconWrapper,{fontSize:32,lineHeight:32,height:32}],labelWrapper:[b.labelWrapper,v.medium,(s||l)&&{display:"block",position:"relative",margin:"4px 8px 2px 8px",height:32,lineHeight:15,maxWidth:2*m.width,overflow:"hidden",whiteSpace:"pre-wrap"}]}}),void 0,{scope:"ChoiceGroupOption"}),Qh=Jn(),Jh=function(e,t){return t+"-"+e.key},$h=function(e,t){return void 0===t?void 0:aa(e,(function(e){return e.key===t}))},em="ChoiceGroup",tm=f.forwardRef((function(e,t){var o=e.className,n=e.theme,r=e.styles,i=e.options,a=void 0===i?[]:i,s=e.label,l=e.required,c=e.disabled,u=e.name,p=e.defaultSelectedKey,h=e.componentRef,m=e.onChange,g=Kd("ChoiceGroup"),v=Kd("ChoiceGroupLabel"),b=Tr(e,Dr,["onChange","className","required"]),y=Qh(r,{theme:n,className:o,optionsContainIconOrImage:a.some((function(e){return!(!e.iconProps&&!e.imageSrc)}))}),_=e.ariaLabelledBy||(s?v:e["aria-labelledby"]),C=gh(e.selectedKey,p),S=C[0],x=C[1],k=f.useState(),w=k[0],I=k[1];!function(e){Mi({name:em,props:e,mutuallyExclusive:{selectedKey:"defaultSelectedKey"}})}(e),function(e,t,o,n){f.useImperativeHandle(n,(function(){return{get checkedOption(){return $h(e,t)},focus:function(){var n=$h(e,t)||e.filter((function(e){return!e.disabled}))[0],r=n&&document.getElementById(Jh(n,o));r&&(r.focus(),Do(!0,r))}}}),[e,t,o])}(a,S,g,h);var D=f.useCallback((function(e,t){var o;t&&(I(t.itemKey),null===(o=t.onFocus)||void 0===o||o.call(t,e))}),[]),T=f.useCallback((function(e,t){var o;I(void 0),null===(o=null==t?void 0:t.onBlur)||void 0===o||o.call(t,e)}),[]),E=f.useCallback((function(e,t){var o;t&&(x(t.itemKey),null===(o=t.onChange)||void 0===o||o.call(t,e),null==m||m(e,$h(a,t.itemKey)))}),[m,a,x]);return f.createElement("div",d({className:y.root},b,{ref:t}),f.createElement("div",d({role:"radiogroup"},_&&{"aria-labelledby":_}),s&&f.createElement(Oh,{className:y.label,required:l,id:v,disabled:c},s),f.createElement("div",{className:y.flexContainer},a.map((function(e){return f.createElement(Xh,d({itemKey:e.key},e,{key:e.key,onBlur:T,onFocus:D,onChange:E,focused:e.key===w,checked:e.key===S,disabled:e.disabled||c,id:Jh(e,g),labelId:e.labelId||v+"-"+e.key,name:u||g,required:l}))})))))}));tm.displayName=em;var om,nm={root:"ms-ChoiceFieldGroup",flexContainer:"ms-ChoiceFieldGroup-flexContainer"},rm=Vn(tm,(function(e){var t=e.className,o=e.optionsContainIconOrImage,n=e.theme,r=Qo(nm,n);return{root:[t,r.root,n.fonts.medium,{display:"block"}],flexContainer:[r.flexContainer,o&&{display:"flex",flexDirection:"row",flexWrap:"wrap"}]}}),void 0,{scope:"ChoiceGroup"}),im=jo((function(){return J({"0%":{transform:"translate(0, 0)",animationTimingFunction:"linear"},"78.57%":{transform:"translate(0, 0)",animationTimingFunction:"cubic-bezier(0.62, 0, 0.56, 1)"},"82.14%":{transform:"translate(0, -5px)",animationTimingFunction:"cubic-bezier(0.58, 0, 0, 1)"},"84.88%":{transform:"translate(0, 9px)",animationTimingFunction:"cubic-bezier(1, 0, 0.56, 1)"},"88.1%":{transform:"translate(0, -2px)",animationTimingFunction:"cubic-bezier(0.58, 0, 0.67, 1)"},"90.12%":{transform:"translate(0, 0)",animationTimingFunction:"linear"},"100%":{transform:"translate(0, 0)"}})})),am=jo((function(){return J({"0%":{transform:" scale(0)",animationTimingFunction:"linear"},"14.29%":{transform:"scale(0)",animationTimingFunction:"cubic-bezier(0.84, 0, 0.52, 0.99)"},"16.67%":{transform:"scale(1.15)",animationTimingFunction:"cubic-bezier(0.48, -0.01, 0.52, 1.01)"},"19.05%":{transform:"scale(0.95)",animationTimingFunction:"cubic-bezier(0.48, 0.02, 0.52, 0.98)"},"21.43%":{transform:"scale(1)",animationTimingFunction:"linear"},"42.86%":{transform:"scale(1)",animationTimingFunction:"cubic-bezier(0.48, -0.02, 0.52, 1.02)"},"45.71%":{transform:"scale(0.8)",animationTimingFunction:"cubic-bezier(0.48, 0.01, 0.52, 0.99)"},"50%":{transform:"scale(1)",animationTimingFunction:"linear"},"90.12%":{transform:"scale(1)",animationTimingFunction:"cubic-bezier(0.48, -0.02, 0.52, 1.02)"},"92.98%":{transform:"scale(0.8)",animationTimingFunction:"cubic-bezier(0.48, 0.01, 0.52, 0.99)"},"97.26%":{transform:"scale(1)",animationTimingFunction:"linear"},"100%":{transform:"scale(1)"}})})),sm=jo((function(){return J({"0%":{transform:"rotate(0deg)",animationTimingFunction:"linear"},"83.33%":{transform:" rotate(0deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"83.93%":{transform:"rotate(15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"84.52%":{transform:"rotate(-15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"85.12%":{transform:"rotate(15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"85.71%":{transform:"rotate(-15deg)",animationTimingFunction:"cubic-bezier(0.33, 0, 0.67, 1)"},"86.31%":{transform:"rotate(0deg)",animationTimingFunction:"linear"},"100%":{transform:"rotate(0deg)"}})})),lm=jo((function(){var e;return In({root:[{position:"absolute",boxSizing:"border-box",border:"1px solid ${}",selectors:(e={},e[ro]={border:"1px solid WindowText"},e)},{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}}],container:{position:"relative"},main:{backgroundColor:"#ffffff",overflowX:"hidden",overflowY:"hidden",position:"relative"},overFlowYHidden:{overflowY:"hidden"}})})),cm={opacity:0},um=((om={})[Zs.top]="slideUpIn20",om[Zs.bottom]="slideDownIn20",om[Zs.left]="slideLeftIn20",om[Zs.right]="slideRightIn20",om),dm={preventDismissOnScroll:!1,offsetFromTarget:0,minPagePadding:8,directionalHint:qs.bottomAutoEdge};function pm(e,t){var o=e.finalHeight,n=f.useState(0),r=n[0],i=n[1],a=Al(),s=f.useRef(0),l=function(){t&&o&&(s.current=a.requestAnimationFrame((function(){if(t.current){var e=t.current.lastChild,n=e.scrollHeight,c=e.offsetHeight;i(r+(n-c)),e.offsetHeight<o?l():a.cancelAnimationFrame(s.current)}})))};return f.useEffect(l,[o]),r}var hm=f.forwardRef((function(e,t){var o=tr(dm,e),n=f.useRef(null),r=f.useRef(null),i=Or(t,r),a=Gl(o.target,r),s=a[0],l=a[1],c=function(e,t){var o=f.useRef();return function(){if(!o.current){var n=e.bounds;n||(n={top:0+e.minPagePadding,left:0+e.minPagePadding,right:t.innerWidth-e.minPagePadding,bottom:t.innerHeight-e.minPagePadding,width:t.innerWidth-2*e.minPagePadding,height:t.innerHeight-2*e.minPagePadding}),o.current=n}return o.current}}(o,l),u=function(e,t,o,n,r){var i=Al(),a=f.useState(),s=a[0],l=a[1],c=f.useRef(0),u=function(){i.requestAnimationFrame((function(){return p()}))},p=function(){var i=e.offsetFromTarget,a=e.onPositioned,u=t.current,p=o.current;if(u&&p){var h=d({},e);h.bounds=r(),h.target=n.current;var m=h.target;if(m)if(!m.getBoundingClientRect&&!m.preventDefault||document.body.contains(m)){h.gapSpace=i;var g=Pl(h,u,p);!s&&g||s&&g&&!function(e,t){return function(e,t){for(var o in t)if(t.hasOwnProperty(o)){var n=e[o],r=t[o];if(n&&r&&n.toFixed(2)!==r.toFixed(2))return!1}return!0}(e.elementPosition,t.elementPosition)}(s,g)&&c.current<5?(c.current++,l(g),null==a||a(g)):(c.current=0,null==a||a(g))}else void 0!==s&&l(void 0);else void 0!==s&&l(void 0)}};return f.useEffect(u),[s,u]}(o,r,n,s,c),p=u[0],h=u[1],m=function(e,t,o){var n=e.directionalHintFixed,r=e.offsetFromTarget,i=e.directionalHint,a=e.target,s=f.useRef();return"string"==typeof a&&(s.current=void 0),f.useEffect((function(){s.current=void 0}),[a,r]),function(){if(!s.current)if(n&&t.current){var e=r||0;s.current=Nl(t.current,i,e,o())}else s.current=o().height-2;return s.current}}(o,s,c),g=pm(o,n);if(function(e,t,o){var n=e.setInitialFocus,r=f.useRef(!1);f.useEffect((function(){!r.current&&t.current&&n&&o&&(r.current=!0,Ia(t.current))}))}(o,n,p),function(e,t,o,n,r,i){var a=e.onDismiss,s=e.preventDismissOnScroll,l=Al(),c=f.useCallback((function(e){a?a(e):i()}),[a,i]),u=f.useCallback((function(e){var r=e.target,i=t.current&&!Ca(t.current,r);(!n.current&&i||e.target!==o&&i&&(n.current.stopPropagation||!n.current||r!==n.current&&!Ca(n.current,r)))&&c(e)}),[c,t,n,o]),d=f.useCallback((function(e){r&&!s&&u(e)}),[u,r,s]);f.useEffect((function(){var e=new Os({});return l.setTimeout((function(){var t,n;e.on(o,"scroll",l.throttle(d,10),!0),e.on(o,"resize",l.throttle(c,10),!0),e.on(null===(t=null==o?void 0:o.document)||void 0===t?void 0:t.body,"focus",u,!0),e.on(null===(n=null==o?void 0:o.document)||void 0===n?void 0:n.body,"click",u,!0)}),0),function(){return e.dispose()}}),[d])}(o,r,l,s,p,h),f.useEffect((function(){var e;return null===(e=o.onLayerMounted)||void 0===e?void 0:e.call(o)}),[]),!l)return null;var v=o.className,b=o.doNotLayer,y=o.positioningContainerWidth,_=o.positioningContainerMaxHeight,C=o.children,S=lm(),x=p&&p.targetEdge?Ze[um[p.targetEdge]]:"",k=m()+g,w=_&&_>k?k:_,I=f.createElement("div",{ref:i,className:qr("ms-PositioningContainer",S.container)},f.createElement("div",{className:Z("ms-PositioningContainer-layerHost",S.root,v,x,!!y&&{width:y},b&&{zIndex:ko.Layer}),style:p?p.elementPosition:cm,tabIndex:-1,ref:n},C,w));return b?I:f.createElement(_c,null,I)}));function mm(e){var t;return{root:[{position:"absolute",boxShadow:"inherit",border:"none",boxSizing:"border-box",transform:e.transform,width:e.width,height:e.height,left:e.left,top:e.top,right:e.right,bottom:e.bottom}],beak:{fill:e.color,display:"block",selectors:(t={},t[ro]={fill:"windowtext"},t)}}}hm.displayName="PositioningContainer";var gm=f.forwardRef((function(e,t){var o,n,r,i,a,s,l=e.left,c=e.top,u=e.bottom,d=e.right,p=e.color,h=e.direction,m=void 0===h?Zs.top:h;switch(m===Zs.top||m===Zs.bottom?(o=10,n=18):(o=18,n=10),m){case Zs.top:default:r="9, 0",i="18, 10",a="0, 10",s="translateY(-100%)";break;case Zs.right:r="0, 0",i="10, 10",a="0, 18",s="translateX(100%)";break;case Zs.bottom:r="0, 0",i="18, 0",a="9, 10",s="translateY(100%)";break;case Zs.left:r="10, 0",i="0, 10",a="10, 18",s="translateX(-100%)"}var g=Jn()(mm,{left:l,top:c,bottom:u,right:d,height:o+"px",width:n+"px",transform:s,color:p});return f.createElement("div",{className:g.root,role:"presentation",ref:t},f.createElement("svg",{height:o,width:n,className:g.beak},f.createElement("polygon",{points:r+" "+i+" "+a})))}));gm.displayName="Beak";var fm=function(){var e=Ei({});return f.useEffect((function(){return function(){for(var t=0,o=Object.keys(e);t<o.length;t++){var n=o[t];clearTimeout(n)}}}),[e]),Ei({setTimeout:function(t,o){var n=setTimeout(t,o);return e[n]=1,n},clearTimeout:function(t){delete e[t],clearTimeout(t)}})},vm=Jn(),bm="data-coachmarkid",ym={isCollapsed:!0,mouseProximityOffset:10,delayBeforeMouseOpen:3600,delayBeforeCoachmarkAnimation:0,isPositionForced:!0,positioningContainerProps:{directionalHint:qs.bottomAutoEdge}},_m="CoachmarkBase",Cm=f.forwardRef((function(e,t){var o=tr(ym,e),n=f.useRef(null),r=f.useRef(null),i=function(){var e=Al(),t=f.useState(),o=t[0],n=t[1],r=f.useState(),i=r[0],a=r[1];return[o,i,function(t){var o=t.alignmentEdge,r=t.targetEdge;return e.requestAnimationFrame((function(){n(o),a(r)}))}]}(),a=i[0],s=i[1],l=i[2],c=function(e,t){var o=e.isCollapsed,n=e.onAnimationOpenStart,r=e.onAnimationOpenEnd,i=f.useState(!!o),a=i[0],s=i[1],l=fm().setTimeout,c=f.useRef(!a),u=f.useCallback((function(){var e,o;c.current||(s(!1),null==n||n(),null===(o=null===(e=t.current)||void 0===e?void 0:e.addEventListener)||void 0===o||o.call(e,"transitionend",(function(){l((function(){t.current&&Ia(t.current)}),1e3),null==r||r()})),c.current=!0)}),[t,r,n,l]);return f.useEffect((function(){o||u()}),[o]),[a,u]}(o,n),u=c[0],p=c[1],h=function(e,t,o){var n=jn(e.theme);return f.useMemo((function(){var e,r,i=void 0===o?Zs.bottom:Bl(o),a={direction:i},s="3px";switch(i){case Zs.top:case Zs.bottom:t?t===Zs.left?(a.left="7px",e="left"):(a.right="7px",e="right"):(a.left="calc(50% - 9px)",e="center"),i===Zs.top?(a.top=s,r="top"):(a.bottom=s,r="bottom");break;case Zs.left:case Zs.right:t?t===Zs.top?(a.top="7px",r="top"):(a.bottom="7px",r="bottom"):(a.top="calc(50% - 9px)",r="center"),i===Zs.left?(n?a.right=s:a.left=s,e="left"):(n?a.left=s:a.right=s,e="right")}return[a,e+" "+r]}),[t,o,n])}(o,a,s),m=h[0],g=h[1],v=function(e,t){var o=f.useState(!!e.isCollapsed),n=o[0],r=o[1],i=f.useState(e.isCollapsed?{width:0,height:0}:{}),a=i[0],s=i[1],l=Al();return f.useEffect((function(){l.requestAnimationFrame((function(){t.current&&(s({width:t.current.offsetWidth,height:t.current.offsetHeight}),r(!1))}))}),[]),[n,a]}(o,n),b=v[0],y=v[1],_=function(e){var t=e.ariaAlertText,o=Al(),n=f.useState(),r=n[0],i=n[1];return f.useEffect((function(){o.requestAnimationFrame((function(){i(t)}))}),[]),r}(o),C=function(e){var t=e.preventFocusOnMount,o=fm().setTimeout,n=f.useRef(null);return f.useEffect((function(){t||o((function(){var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}),1e3)}),[]),n}(o);!function(e,t,o){var n,r=null===(n=nt())||void 0===n?void 0:n.documentElement;Ll(r,"keydown",(function(e){var n,r;(e.altKey&&e.which===Un.c||e.which===Un.enter&&(null===(r=null===(n=t.current)||void 0===n?void 0:n.contains)||void 0===r?void 0:r.call(n,e.target)))&&o()}),!0);var i=function(o){var n;if(e.preventDismissOnLostFocus){var r=o.target,i=t.current&&!Ca(t.current,r),a=e.target;i&&r!==a&&!Ca(a,r)&&(null===(n=e.onDismiss)||void 0===n||n.call(e,o))}};Ll(r,"click",i,!0),Ll(r,"focus",i,!0)}(o,r,p),function(e){var t=e.onDismiss;f.useImperativeHandle(e.componentRef,(function(e){return{dismiss:function(){null==t||t(e)}}}),[t])}(o),function(e,t,o){var n=fm(),r=n.setTimeout,i=n.clearTimeout,a=f.useRef();f.useEffect((function(){var n=function(){t.current&&(a.current=t.current.getBoundingClientRect())},s=new Os({});return r((function(){var t=e.mouseProximityOffset,l=void 0===t?0:t,c=[];r((function(){n(),s.on(window,"resize",(function(){c.forEach((function(e){i(e)})),c.splice(0,c.length),c.push(r((function(){n()}),100))}))}),10),s.on(document,"mousemove",(function(t){var r,i=t.clientY,s=t.clientX;n(),function(e,t,o,n){return void 0===n&&(n=0),t>e.left-n&&t<e.left+e.width+n&&o>e.top-n&&o<e.top+e.height+n}(a.current,s,i,l)&&o(),null===(r=e.onMouseMove)||void 0===r||r.call(e,t)}))}),e.delayBeforeMouseOpen),function(){return s.dispose()}}),[])}(o,r,p),function(e){Mi({name:_m,props:e,deprecations:{teachingBubbleRef:void 0,collapsed:"isCollapsed",beakWidth:void 0,beakHeight:void 0,width:void 0,height:void 0}})}(o);var S=o.beaconColorOne,x=o.beaconColorTwo,k=o.children,w=o.target,I=o.color,D=o.positioningContainerProps,T=o.ariaDescribedBy,E=o.ariaDescribedByText,P=o.ariaLabelledBy,M=o.ariaLabelledByText,R=o.ariaAlertText,N=o.delayBeforeCoachmarkAnimation,B=o.styles,F=o.theme,A=o.className,L=o.persistentBeak,H=I;!H&&F&&(H=F.semanticColors.primaryButtonBackground);var O=vm(B,{theme:F,beaconColorOne:S,beaconColorTwo:x,className:A,isCollapsed:u,isMeasuring:b,color:H,transformOrigin:g,entityHostHeight:void 0===y.height?void 0:y.height+"px",entityHostWidth:void 0===y.width?void 0:y.width+"px",width:"32px",height:"32px",delayBeforeCoachmarkAnimation:N+"ms"}),z=u?32:y.height;return f.createElement(hm,d({target:w,offsetFromTarget:10,finalHeight:z,ref:t,onPositioned:l,bounds:Sm(o)},D),f.createElement("div",{className:O.root},R&&f.createElement("div",{className:O.ariaContainer,role:"alert","aria-hidden":!u},_),f.createElement("div",{className:O.pulsingBeacon}),f.createElement("div",{className:O.translateAnimationContainer,ref:r},f.createElement("div",{className:O.scaleAnimationLayer},f.createElement("div",{className:O.rotateAnimationLayer},(u||L)&&f.createElement(gm,d({},m,{color:H})),f.createElement("div",{className:O.entityHost,ref:C,tabIndex:-1,"data-is-focusable":!0,role:"dialog","aria-labelledby":P,"aria-describedby":T},u&&[P&&f.createElement("p",{id:P,key:0,className:O.ariaContainer},M),T&&f.createElement("p",{id:T,key:1,className:O.ariaContainer},E)],f.createElement(xh,{isClickableOutsideFocusTrap:!0,forceFocusInsideTrap:!1},f.createElement("div",{className:O.entityInnerHost,ref:n},f.createElement("div",{className:O.childrenContainer,"aria-hidden":u},k)))))))))}));function Sm(e){var t=e.isPositionForced,o=e.positioningContainerProps;return t?!o||o.directionalHint!==qs.topAutoEdge&&o.directionalHint!==qs.bottomAutoEdge?{left:-1/0,top:-1/0,bottom:1/0,right:1/0,width:1/0,height:1/0}:{left:0,top:-1/0,bottom:1/0,right:window.innerWidth,width:window.innerWidth,height:1/0}:void 0}Cm.displayName=_m;var xm=Vn(Cm,(function(e){var t,o=e.theme,n=e.className,r=e.color,i=e.beaconColorOne,a=e.beaconColorTwo,s=e.delayBeforeCoachmarkAnimation,l=e.isCollapsed,c=e.isMeasuring,u=e.entityHostHeight,d=e.entityHostWidth,p=e.transformOrigin;if(!o)throw new Error("theme is undefined or null in base Dropdown getStyles function.");var h=Lo.continuousPulseAnimationDouble(i||o.palette.themePrimary,a||o.palette.themeTertiary,"35px","150px","10px"),m=Lo.createDefaultAnimation(h,s);return{root:[o.fonts.medium,{position:"relative"},n],pulsingBeacon:[{position:"absolute",top:"50%",left:"50%",transform:jn(o)?"translate(50%, -50%)":"translate(-50%, -50%)",width:"0px",height:"0px",borderRadius:"225px",borderStyle:"solid",opacity:"0"},l&&m],translateAnimationContainer:[{width:"100%",height:"100%"},l&&{animationDuration:"14s",animationTimingFunction:"linear",animationDirection:"normal",animationIterationCount:"1",animationDelay:"0s",animationFillMode:"forwards",animationName:im(),transition:"opacity 0.5s ease-in-out"},!l&&{opacity:"1"}],scaleAnimationLayer:[{width:"100%",height:"100%"},l&&{animationDuration:"14s",animationTimingFunction:"linear",animationDirection:"normal",animationIterationCount:"1",animationDelay:"0s",animationFillMode:"forwards",animationName:am()}],rotateAnimationLayer:[{width:"100%",height:"100%"},l&&{animationDuration:"14s",animationTimingFunction:"linear",animationDirection:"normal",animationIterationCount:"1",animationDelay:"0s",animationFillMode:"forwards",animationName:sm()},!l&&{opacity:"1"}],entityHost:[{position:"relative",outline:"none",overflow:"hidden",backgroundColor:r,borderRadius:32,transition:"border-radius 250ms, width 500ms, height 500ms cubic-bezier(0.5, 0, 0, 1)",visibility:"hidden",selectors:(t={},t[ro]={backgroundColor:"Window",border:"2px solid WindowText"},t["."+wo+" &:focus"]={outline:"1px solid "+o.palette.themeTertiary},t)},!c&&l&&{width:32,height:32},!c&&{visibility:"visible"},!l&&{borderRadius:"1px",opacity:"1",width:d,height:u}],entityInnerHost:[{transition:"transform 500ms cubic-bezier(0.5, 0, 0, 1)",transformOrigin:p,transform:"scale(0)"},!l&&{width:d,height:u,transform:"scale(1)"},!c&&{visibility:"visible"}],childrenContainer:[{display:!c&&l?"none":"block"}],ariaContainer:{position:"fixed",opacity:0,height:0,width:0,pointerEvents:"none"}}}),void 0,{scope:"Coachmark"}),km=100,wm=359,Im=100,Dm=255,Tm=Dm,Em=100,Pm=3,Mm=6,Rm=1,Nm=3,Bm=/^[\da-f]{0,6}$/i,Fm=/^\d{0,3}$/;function Am(e,t,o){var n=o+(t*=(o<50?o:100-o)/100);return{h:e,s:0===n?0:2*t/n*100,v:n}}function Lm(e,t,o){var n=[],r=(o/=100)*(t/=100),i=e/60,a=r*(1-Math.abs(i%2-1)),s=o-r;switch(Math.floor(i)){case 0:n=[r,a,0];break;case 1:n=[a,r,0];break;case 2:n=[0,r,a];break;case 3:n=[0,a,r];break;case 4:n=[a,0,r];break;case 5:n=[r,0,a]}return{r:Math.round(Dm*(n[0]+s)),g:Math.round(Dm*(n[1]+s)),b:Math.round(Dm*(n[2]+s))}}function Hm(e,t,o){var n=Am(e,t,o);return Lm(n.h,n.s,n.v)}function Om(e){if(e)return zm(e)||function(e){if("#"===e[0]&&7===e.length&&/^#[\da-fA-F]{6}$/.test(e))return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:Em}}(e)||function(e){if("#"===e[0]&&4===e.length&&/^#[\da-fA-F]{3}$/.test(e))return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:Em}}(e)||function(e){var t=e.match(/^hsl(a?)\(([\d., ]+)\)$/);if(t){var o=!!t[1],n=o?4:3,r=t[2].split(/ *, */).map(Number);if(r.length===n){var i=Hm(r[0],r[1],r[2]);return i.a=o?100*r[3]:Em,i}}}(e)||function(e){if("undefined"!=typeof document){var t=document.createElement("div");t.style.backgroundColor=e,t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.height="1px",t.style.width="1px",document.body.appendChild(t);var o=getComputedStyle(t),n=o&&o.backgroundColor;if(document.body.removeChild(t),"rgba(0, 0, 0, 0)"!==n&&"transparent"!==n)return zm(n);switch(e.trim()){case"transparent":case"#0000":case"#00000000":return{r:0,g:0,b:0,a:0}}}}(e)}function zm(e){if(e){var t=e.match(/^rgb(a?)\(([\d., ]+)\)$/);if(t){var o=!!t[1],n=o?4:3,r=t[2].split(/ *, */).map(Number);if(r.length===n)return{r:r[0],g:r[1],b:r[2],a:o?100*r[3]:Em}}}}function Wm(e,t,o){return void 0===o&&(o=0),e<o?o:e>t?t:e}function Vm(e,t,o){return[Km(e),Km(t),Km(o)].join("")}function Km(e){var t=(e=Wm(e,Dm)).toString(16);return 1===t.length?"0"+t:t}function Um(e,t,o){var n=Lm(e,t,o);return Vm(n.r,n.g,n.b)}function Gm(e,t,o){var n=NaN,r=Math.max(e,t,o),i=r-Math.min(e,t,o);return 0===i?n=0:e===r?n=(t-o)/i%6:t===r?n=(o-e)/i+2:o===r&&(n=(e-t)/i+4),(n=Math.round(60*n))<0&&(n+=360),{h:n,s:Math.round(100*(0===r?0:i/r)),v:Math.round(r/Dm*100)}}function jm(e,t,o){var n=(2-(t/=km))*(o/=Im),r=t*o;return{h:e,s:100*(r=(r/=n<=1?n:2-n)||0),l:100*(n/=2)}}function qm(e,t,o,n,r){return n===Em||"number"!=typeof n?"#"+r:"rgba("+e+", "+t+", "+o+", "+n/Em+")"}function Ym(e){var t=e.a,o=void 0===t?Em:t,n=e.b,r=e.g,i=e.r,a=Gm(i,r,n),s=a.h,l=a.s,c=a.v,u=Vm(i,r,n);return{a:o,b:n,g:r,h:s,hex:u,r:i,s:l,str:qm(i,r,n,o,u),v:c,t:Em-o}}function Zm(e){var t=Om(e);if(t)return d(d({},Ym(t)),{str:e})}function Xm(e,t){var o=e.h,n=e.s,r=e.v;t="number"==typeof t?t:Em;var i=Lm(o,n,r),a=i.r,s=i.g,l=i.b,c=Um(o,n,r);return{a:t,b:l,g:s,h:o,hex:c,r:a,s:n,str:qm(a,s,l,t,c),v:r,t:Em-t}}function Qm(e){return"#"+Um(e.h,km,Im)}function Jm(e,t,o){var n=Lm(e.h,t,o),r=n.r,i=n.g,a=n.b,s=Vm(r,i,a);return d(d({},e),{s:t,v:o,r:r,g:i,b:a,hex:s,str:qm(r,i,a,e.a,s)})}function $m(e,t){var o=Lm(t,e.s,e.v),n=o.r,r=o.g,i=o.b,a=Vm(n,r,i);return d(d({},e),{h:t,r:n,g:r,b:i,hex:a,str:qm(n,r,i,e.a,a)})}function eg(e,t,o){var n;return Ym(((n={r:e.r,g:e.g,b:e.b,a:e.a})[t]=o,n))}function tg(e,t){return d(d({},e),{a:t,t:Em-t,str:qm(e.r,e.g,e.b,t,e.hex)})}function og(e){return{r:Wm(e.r,Dm),g:Wm(e.g,Dm),b:Wm(e.b,Dm),a:"number"==typeof e.a?Wm(e.a,Em):e.a}}function ng(e){return{h:Wm(e.h,wm),s:Wm(e.s,km),v:Wm(e.v,Im)}}function rg(e){return!e||e.length<Pm?"ffffff":e.length>=Mm?e.substring(0,Mm):e.substring(0,Pm)}var ig,ag=[.027,.043,.082,.145,.184,.216,.349,.537],sg=[.537,.45,.349,.216,.184,.145,.082,.043],lg=[.537,.349,.216,.184,.145,.082,.043,.027],cg=[.537,.45,.349,.216,.184,.145,.082,.043],ug=[.88,.77,.66,.55,.44,.33,.22,.11],dg=[.11,.22,.33,.44,.55,.66,.77,.88],pg=[.96,.84,.7,.4,.12],hg=[.1,.24,.44];function mg(e){return"number"==typeof e&&e>=ig.Unshaded&&e<=ig.Shade8}function gg(e,t){return{h:e.h,s:e.s,v:Wm(e.v-e.v*t,100,0)}}function fg(e,t){return{h:e.h,s:Wm(e.s-e.s*t,100,0),v:Wm(e.v+(100-e.v)*t,100,0)}}function vg(e){return jm(e.h,e.s,e.v).l<50}function bg(e,t,o){if(void 0===o&&(o=!1),!e)return null;if(t===ig.Unshaded||!mg(t))return e;var n=jm(e.h,e.s,e.v),r={h:e.h,s:e.s,v:e.v},i=t-1,a=fg,s=gg;return o&&(a=gg,s=fg),Ym(Bs(Lm((r=function(e){return e.r===Dm&&e.g===Dm&&e.b===Dm}(e)?gg(r,lg[i]):function(e){return 0===e.r&&0===e.g&&0===e.b}(e)?fg(r,cg[i]):n.l/100>.8?s(r,dg[i]):n.l/100<.2?a(r,ug[i]):i<pg.length?a(r,pg[i]):s(r,hg[i-pg.length])).h,r.s,r.v),{a:e.a}))}function yg(e,t,o){if(void 0===o&&(o=!1),!e)return null;if(t===ig.Unshaded||!mg(t))return e;var n={h:e.h,s:e.s,v:e.v},r=t-1;return Ym(Bs(Lm((n=o?fg(n,sg[cg.length-1-r]):gg(n,ag[r])).h,n.s,n.v),{a:e.a}))}function _g(e,t){function o(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}var n=.2126*o(e.r/Dm)+.7152*o(e.g/Dm)+.0722*o(e.b/Dm);n+=.05;var r=.2126*o(t.r/Dm)+.7152*o(t.g/Dm)+.0722*o(t.b/Dm);return n/(r+=.05)>1?n/r:r/n}function Cg(e,t){var o=Em-t;return d(d({},e),{t:t,a:o,str:qm(e.r,e.g,e.b,o,e.hex)})}!function(e){e[e.Unshaded=0]="Unshaded",e[e.Shade1=1]="Shade1",e[e.Shade2=2]="Shade2",e[e.Shade3=3]="Shade3",e[e.Shade4=4]="Shade4",e[e.Shade5=5]="Shade5",e[e.Shade6=6]="Shade6",e[e.Shade7=7]="Shade7",e[e.Shade8=8]="Shade8"}(ig||(ig={}));var Sg,xg=Jn(),kg="TextField",wg=function(e){function t(t){var o=e.call(this,t)||this;o._textElement=f.createRef(),o._onFocus=function(e){o.props.onFocus&&o.props.onFocus(e),o.setState({isFocused:!0},(function(){o.props.validateOnFocusIn&&o._validate(o.value)}))},o._onBlur=function(e){o.props.onBlur&&o.props.onBlur(e),o.setState({isFocused:!1},(function(){o.props.validateOnFocusOut&&o._validate(o.value)}))},o._onRenderLabel=function(e){var t=e.label,n=e.required,r=o._classNames.subComponentStyles?o._classNames.subComponentStyles.label:void 0;return t?f.createElement(Oh,{required:n,htmlFor:o._id,styles:r,disabled:e.disabled,id:o._labelId},e.label):null},o._onRenderDescription=function(e){return e.description?f.createElement("span",{className:o._classNames.description},e.description):null},o._onRevealButtonClick=function(e){o.setState((function(e){return{isRevealingPassword:!e.isRevealingPassword}}))},o._onInputChange=function(e){var t,n,r=e.target.value,i=Ig(o.props,o.state)||"";void 0!==r&&r!==o._lastChangeValue&&r!==i?(o._lastChangeValue=r,null===(n=(t=o.props).onChange)||void 0===n||n.call(t,e,r),o._isControlled||o.setState({uncontrolledValue:r})):o._lastChangeValue=void 0},Ui(o),o._async=new Zi(o),ki(kg,t,{errorMessage:"onGetErrorMessage"}),o._fallbackId=Va(kg),o._descriptionId=Va("TextFieldDescription"),o._labelId=Va("TextFieldLabel"),o._warnControlledUsage();var n=t.defaultValue,r=void 0===n?"":n;return"number"==typeof r&&(r=String(r)),o.state={uncontrolledValue:o._isControlled?void 0:r,isFocused:!1,errorMessage:""},o._delayedValidate=o._async.debounce(o._validate,o.props.deferredValidationTime),o._lastValidation=0,o}return u(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return Ig(this.props,this.state)},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this._adjustInputHeight(),this.props.validateOnLoad&&this._validate(this.value)},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.getSnapshotBeforeUpdate=function(e,t){return{selection:[this.selectionStart,this.selectionEnd]}},t.prototype.componentDidUpdate=function(e,t,o){var n=this.props,r=(o||{}).selection,i=void 0===r?[null,null]:r,a=i[0],s=i[1];!!e.multiline!=!!n.multiline&&t.isFocused&&(this.focus(),null!==a&&null!==s&&a>=0&&s>=0&&this.setSelectionRange(a,s)),e.value!==n.value&&(this._lastChangeValue=void 0);var l=Ig(e,t),c=this.value;l!==c&&(this._warnControlledUsage(e),this.state.errorMessage&&!n.errorMessage&&this.setState({errorMessage:""}),this._adjustInputHeight(),Dg(n)&&this._delayedValidate(c))},t.prototype.render=function(){var e=this.props,t=e.borderless,o=e.className,n=e.disabled,r=e.iconProps,i=e.inputClassName,a=e.label,s=e.multiline,l=e.required,c=e.underlined,u=e.prefix,p=e.resizable,h=e.suffix,m=e.theme,g=e.styles,v=e.autoAdjustHeight,b=e.canRevealPassword,y=e.revealPasswordAriaLabel,_=e.type,C=e.onRenderPrefix,S=void 0===C?this._onRenderPrefix:C,x=e.onRenderSuffix,k=void 0===x?this._onRenderSuffix:x,w=e.onRenderLabel,I=void 0===w?this._onRenderLabel:w,D=e.onRenderDescription,T=void 0===D?this._onRenderDescription:D,E=this.state,P=E.isFocused,M=E.isRevealingPassword,R=this._errorMessage,N=!!b&&"password"===_&&function(){if("boolean"!=typeof Sg){var e=at();if(null==e?void 0:e.navigator){var t=/^Edg/.test(e.navigator.userAgent||"");Sg=!(Wi()||t)}else Sg=!0}return Sg}(),B=this._classNames=xg(g,{theme:m,className:o,disabled:n,focused:P,required:l,multiline:s,hasLabel:!!a,hasErrorMessage:!!R,borderless:t,resizable:p,hasIcon:!!r,underlined:c,inputClassName:i,autoAdjustHeight:v,hasRevealButton:N});return f.createElement("div",{ref:this.props.elementRef,className:B.root},f.createElement("div",{className:B.wrapper},I(this.props,this._onRenderLabel),f.createElement("div",{className:B.fieldGroup},(void 0!==u||this.props.onRenderPrefix)&&f.createElement("div",{className:B.prefix},S(this.props,this._onRenderPrefix)),s?this._renderTextArea():this._renderInput(),r&&f.createElement(ii,d({className:B.icon},r)),N&&f.createElement("button",{"aria-label":y,className:B.revealButton,onClick:this._onRevealButtonClick,"aria-pressed":!!M,type:"button"},f.createElement("span",{className:B.revealSpan},f.createElement(ii,{className:B.revealIcon,iconName:M?"Hide":"RedEye"}))),(void 0!==h||this.props.onRenderSuffix)&&f.createElement("div",{className:B.suffix},k(this.props,this._onRenderSuffix)))),this._isDescriptionAvailable&&f.createElement("span",{id:this._descriptionId},T(this.props,this._onRenderDescription),R&&f.createElement("div",{role:"alert"},f.createElement(ea,null,this._renderErrorMessage()))))},t.prototype.focus=function(){this._textElement.current&&this._textElement.current.focus()},t.prototype.blur=function(){this._textElement.current&&this._textElement.current.blur()},t.prototype.select=function(){this._textElement.current&&this._textElement.current.select()},t.prototype.setSelectionStart=function(e){this._textElement.current&&(this._textElement.current.selectionStart=e)},t.prototype.setSelectionEnd=function(e){this._textElement.current&&(this._textElement.current.selectionEnd=e)},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._textElement.current?this._textElement.current.selectionStart:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._textElement.current?this._textElement.current.selectionEnd:-1},enumerable:!1,configurable:!0}),t.prototype.setSelectionRange=function(e,t){this._textElement.current&&this._textElement.current.setSelectionRange(e,t)},t.prototype._warnControlledUsage=function(e){Di({componentId:this._id,componentName:kg,props:this.props,oldProps:e,valueProp:"value",defaultValueProp:"defaultValue",onChangeProp:"onChange",readOnlyProp:"readOnly"}),null!==this.props.value||this._hasWarnedNullValue||(this._hasWarnedNullValue=!0,cn("Warning: 'value' prop on 'TextField' should not be null. Consider using an empty string to clear the component or undefined to indicate an uncontrolled component."))},Object.defineProperty(t.prototype,"_id",{get:function(){return this.props.id||this._fallbackId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isControlled",{get:function(){return wi(this.props,"value")},enumerable:!1,configurable:!0}),t.prototype._onRenderPrefix=function(e){var t=e.prefix;return f.createElement("span",{style:{paddingBottom:"1px"}},t)},t.prototype._onRenderSuffix=function(e){var t=e.suffix;return f.createElement("span",{style:{paddingBottom:"1px"}},t)},Object.defineProperty(t.prototype,"_errorMessage",{get:function(){var e=this.props.errorMessage;return(void 0===e?this.state.errorMessage:e)||""},enumerable:!1,configurable:!0}),t.prototype._renderErrorMessage=function(){var e=this._errorMessage;return e?"string"==typeof e?f.createElement("p",{className:this._classNames.errorMessage},f.createElement("span",{"data-automation-id":"error-message"},e)):f.createElement("div",{className:this._classNames.errorMessage,"data-automation-id":"error-message"},e):null},Object.defineProperty(t.prototype,"_isDescriptionAvailable",{get:function(){var e=this.props;return!!(e.onRenderDescription||e.description||this._errorMessage)},enumerable:!1,configurable:!0}),t.prototype._renderTextArea=function(){var e=Tr(this.props,mr,["defaultValue"]),t=this.props["aria-labelledby"]||(this.props.label?this._labelId:void 0);return f.createElement("textarea",d({id:this._id},e,{ref:this._textElement,value:this.value||"",onInput:this._onInputChange,onChange:this._onInputChange,className:this._classNames.field,"aria-labelledby":t,"aria-describedby":this._isDescriptionAvailable?this._descriptionId:this.props["aria-describedby"],"aria-invalid":!!this._errorMessage,"aria-label":this.props.ariaLabel,readOnly:this.props.readOnly,onFocus:this._onFocus,onBlur:this._onBlur}))},t.prototype._renderInput=function(){var e,t=Tr(this.props,hr,["defaultValue","type"]),o=this.props["aria-labelledby"]||(this.props.label?this._labelId:void 0),n=this.state.isRevealingPassword?"text":null!==(e=this.props.type)&&void 0!==e?e:"text";return f.createElement("input",d({type:n,id:this._id,"aria-labelledby":o},t,{ref:this._textElement,value:this.value||"",onInput:this._onInputChange,onChange:this._onInputChange,className:this._classNames.field,"aria-label":this.props.ariaLabel,"aria-describedby":this._isDescriptionAvailable?this._descriptionId:this.props["aria-describedby"],"aria-invalid":!!this._errorMessage,readOnly:this.props.readOnly,onFocus:this._onFocus,onBlur:this._onBlur}))},t.prototype._validate=function(e){var t=this;if(this._latestValidateValue!==e||!Dg(this.props)){this._latestValidateValue=e;var o=this.props.onGetErrorMessage,n=o&&o(e||"");if(void 0!==n)if("string"!=typeof n&&"then"in n){var r=++this._lastValidation;n.then((function(o){r===t._lastValidation&&t.setState({errorMessage:o}),t._notifyAfterValidate(e,o)}))}else this.setState({errorMessage:n}),this._notifyAfterValidate(e,n);else this._notifyAfterValidate(e,"")}},t.prototype._notifyAfterValidate=function(e,t){e===this.value&&this.props.onNotifyValidationResult&&this.props.onNotifyValidationResult(t,e)},t.prototype._adjustInputHeight=function(){if(this._textElement.current&&this.props.autoAdjustHeight&&this.props.multiline){var e=this._textElement.current;e.style.height="",e.style.height=e.scrollHeight+"px"}},t.defaultProps={resizable:!0,deferredValidationTime:200,validateOnLoad:!0},t}(f.Component);function Ig(e,t){var o=e.value,n=void 0===o?t.uncontrolledValue:o;return"number"==typeof n?String(n):n}function Dg(e){return!(e.validateOnFocusIn||e.validateOnFocusOut)}var Tg={root:"ms-TextField",description:"ms-TextField-description",errorMessage:"ms-TextField-errorMessage",field:"ms-TextField-field",fieldGroup:"ms-TextField-fieldGroup",prefix:"ms-TextField-prefix",suffix:"ms-TextField-suffix",wrapper:"ms-TextField-wrapper",revealButton:"ms-TextField-reveal",multiline:"ms-TextField--multiline",borderless:"ms-TextField--borderless",underlined:"ms-TextField--underlined",unresizable:"ms-TextField--unresizable",required:"is-required",disabled:"is-disabled",active:"is-active"};function Eg(e){var t=e.underlined,o=e.disabled,n=e.focused,r=e.theme,i=r.palette,a=r.fonts;return function(){var e;return{root:[t&&o&&{color:i.neutralTertiary},t&&{fontSize:a.medium.fontSize,marginRight:8,paddingLeft:12,paddingRight:0,lineHeight:"22px",height:32},t&&n&&{selectors:(e={},e[ro]={height:31},e)}]}}}var Pg=Vn(wg,(function(e){var t,o,n,r,i,a,s,l,c,u,p,h,m=e.theme,g=e.className,f=e.disabled,v=e.focused,b=e.required,y=e.multiline,_=e.hasLabel,C=e.borderless,S=e.underlined,x=e.hasIcon,k=e.resizable,w=e.hasErrorMessage,I=e.inputClassName,D=e.autoAdjustHeight,T=e.hasRevealButton,E=m.semanticColors,P=m.effects,M=m.fonts,R=Qo(Tg,m),N={background:E.disabledBackground,color:f?E.disabledText:E.inputPlaceholderText,display:"flex",alignItems:"center",padding:"0 10px",lineHeight:1,whiteSpace:"nowrap",flexShrink:0,selectors:(t={},t[ro]={background:"Window",color:f?"GrayText":"WindowText"},t)},B=[M.medium,{color:E.inputPlaceholderText,opacity:1,selectors:(o={},o[ro]={color:"GrayText"},o)}],F={color:E.disabledText,selectors:(n={},n[ro]={color:"GrayText"},n)};return{root:[R.root,M.medium,b&&R.required,f&&R.disabled,v&&R.active,y&&R.multiline,C&&R.borderless,S&&R.underlined,on,{position:"relative"},g],wrapper:[R.wrapper,S&&[{display:"flex",borderBottom:"1px solid "+(w?E.errorText:E.inputBorder),width:"100%"},f&&{borderBottomColor:E.disabledBackground,selectors:(r={},r[ro]=d({borderColor:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)},!f&&{selectors:{":hover":{borderBottomColor:w?E.errorText:E.inputBorderHovered,selectors:(i={},i[ro]=d({borderBottomColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)}}},v&&[{position:"relative"},Mo(w?E.errorText:E.inputFocusBorderAlt,0,"borderBottom")]]],fieldGroup:[R.fieldGroup,on,{border:"1px solid "+E.inputBorder,borderRadius:P.roundedCorner2,background:E.inputBackground,cursor:"text",height:32,display:"flex",flexDirection:"row",alignItems:"stretch",position:"relative"},y&&{minHeight:"60px",height:"auto",display:"flex"},!v&&!f&&{selectors:{":hover":{borderColor:E.inputBorderHovered,selectors:(a={},a[ro]=d({borderColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),a)}}},v&&!S&&Mo(w?E.errorText:E.inputFocusBorderAlt,P.roundedCorner2),f&&{borderColor:E.disabledBackground,selectors:(s={},s[ro]=d({borderColor:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s),cursor:"default"},C&&{border:"none"},C&&v&&{border:"none",selectors:{":after":{border:"none"}}},S&&{flex:"1 1 0px",border:"none",textAlign:"left"},S&&f&&{backgroundColor:"transparent"},w&&!S&&{borderColor:E.errorText,selectors:{"&:hover":{borderColor:E.errorText}}},!_&&b&&{selectors:(l={":before":{content:"'*'",color:E.errorText,position:"absolute",top:-5,right:-10}},l[ro]={selectors:{":before":{color:"WindowText",right:-14}}},l)}],field:[M.medium,R.field,on,{borderRadius:0,border:"none",background:"none",backgroundColor:"transparent",color:E.inputText,padding:"0 8px",width:"100%",minWidth:0,textOverflow:"ellipsis",outline:0,selectors:(c={"&:active, &:focus, &:hover":{outline:0},"::-ms-clear":{display:"none"}},c[ro]={background:"Window",color:f?"GrayText":"WindowText"},c)},sn(B),y&&!k&&[R.unresizable,{resize:"none"}],y&&{minHeight:"inherit",lineHeight:17,flexGrow:1,paddingTop:6,paddingBottom:6,overflow:"auto",width:"100%"},y&&D&&{overflow:"hidden"},x&&!T&&{paddingRight:24},y&&x&&{paddingRight:40},f&&[{backgroundColor:E.disabledBackground,color:E.disabledText,borderColor:E.disabledBackground},sn(F)],S&&{textAlign:"left"},v&&!C&&{selectors:(u={},u[ro]={paddingLeft:11,paddingRight:11},u)},v&&y&&!C&&{selectors:(p={},p[ro]={paddingTop:4},p)},I],icon:[y&&{paddingRight:24,alignItems:"flex-end"},{pointerEvents:"none",position:"absolute",bottom:6,right:8,top:"auto",fontSize:Ye.medium,lineHeight:18},f&&{color:E.disabledText}],description:[R.description,{color:E.bodySubtext,fontSize:M.xSmall.fontSize}],errorMessage:[R.errorMessage,Ze.slideDownIn20,M.small,{color:E.errorText,margin:0,paddingTop:5,display:"flex",alignItems:"center"}],prefix:[R.prefix,N],suffix:[R.suffix,N],revealButton:[R.revealButton,"ms-Button","ms-Button--icon",To(m,{inset:1}),{height:30,width:32,border:"none",padding:"0px 4px",backgroundColor:"transparent",color:E.link,selectors:{":hover":{outline:0,color:E.primaryButtonBackgroundHovered,backgroundColor:E.buttonBackgroundHovered,selectors:(h={},h[ro]={borderColor:"Highlight",color:"Highlight"},h)},":focus":{outline:0}}},x&&{marginRight:28}],revealSpan:{display:"flex",height:"100%",alignItems:"center"},revealIcon:{margin:"0px 4px",pointerEvents:"none",bottom:6,right:8,top:"auto",fontSize:Ye.medium,lineHeight:18},subComponentStyles:{label:Eg(e)}}}),void 0,{scope:"TextField"}),Mg=Jn(),Rg=function(e){function t(t){var o=e.call(this,t)||this;return o._disposables=[],o._root=f.createRef(),o._isAdjustingSaturation=!0,o._descriptionId=Va("ColorRectangle-description"),o._onKeyDown=function(e){var t=o.state.color,n=t.s,r=t.v,i=e.shiftKey?10:1;switch(e.which){case Un.up:o._isAdjustingSaturation=!1,r+=i;break;case Un.down:o._isAdjustingSaturation=!1,r-=i;break;case Un.left:o._isAdjustingSaturation=!0,n-=i;break;case Un.right:o._isAdjustingSaturation=!0,n+=i;break;default:return}o._updateColor(e,Jm(t,Wm(n,km),Wm(r,Im)))},o._onMouseDown=function(e){o._disposables.push(ol(window,"mousemove",o._onMouseMove,!0),ol(window,"mouseup",o._disposeListeners,!0)),o._onMouseMove(e)},o._onMouseMove=function(e){if(o._root.current){var t=function(e,t,o){var n=o.getBoundingClientRect(),r=(e.clientX-n.left)/n.width,i=(e.clientY-n.top)/n.height;return Jm(t,Wm(Math.round(r*km),km),Wm(Math.round(Im-i*Im),Im))}(e,o.state.color,o._root.current);t&&o._updateColor(e,t)}},o._disposeListeners=function(){o._disposables.forEach((function(e){return e()})),o._disposables=[]},Ui(o),o.state={color:t.color},o}return u(t,e),Object.defineProperty(t.prototype,"color",{get:function(){return this.state.color},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){e!==this.props&&this.props.color&&this.setState({color:this.props.color})},t.prototype.componentWillUnmount=function(){this._disposeListeners()},t.prototype.render=function(){var e=this.props,t=e.minSize,o=e.theme,n=e.className,r=e.styles,i=e.ariaValueFormat,a=e.ariaLabel,s=e.ariaDescription,l=this.state.color,c=Mg(r,{theme:o,className:n,minSize:t}),u=i.replace("{0}",String(l.s)).replace("{1}",String(l.v));return f.createElement("div",{ref:this._root,tabIndex:0,className:c.root,style:{backgroundColor:Qm(l)},onMouseDown:this._onMouseDown,onKeyDown:this._onKeyDown,role:"slider","aria-valuetext":u,"aria-valuenow":this._isAdjustingSaturation?l.s:l.v,"aria-valuemin":0,"aria-valuemax":Im,"aria-label":a,"aria-describedby":this._descriptionId,"data-is-focusable":!0},f.createElement("div",{className:c.description,id:this._descriptionId},s),f.createElement("div",{className:c.light}),f.createElement("div",{className:c.dark}),f.createElement("div",{className:c.thumb,style:{left:l.s+"%",top:Im-l.v+"%",backgroundColor:l.str}}))},t.prototype._updateColor=function(e,t){var o=this.props.onChange,n=this.state.color;t.s===n.s&&t.v===n.v||(o&&o(e,t),e.defaultPrevented||(this.setState({color:t}),e.preventDefault()))},t.defaultProps={minSize:220,ariaLabel:"Saturation and brightness",ariaValueFormat:"Saturation {0} brightness {1}",ariaDescription:"Use left and right arrow keys to set saturation. Use up and down arrow keys to set brightness."},t}(f.Component),Ng=Vn(Rg,(function(e){var t,o=e.className,n=e.theme,r=e.minSize,i=n.palette,a=n.effects;return{root:["ms-ColorPicker-colorRect",{position:"relative",marginBottom:8,border:"1px solid "+i.neutralLighter,borderRadius:a.roundedCorner2,minWidth:r,minHeight:r,outline:"none",selectors:(t={},t[ro]=d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t["."+wo+" &:focus"]={outline:"1px solid "+i.neutralSecondary},t)},o],light:["ms-ColorPicker-light",{position:"absolute",left:0,right:0,top:0,bottom:0,background:"linear-gradient(to right, white 0%, transparent 100%) /*@noflip*/"}],dark:["ms-ColorPicker-dark",{position:"absolute",left:0,right:0,top:0,bottom:0,background:"linear-gradient(to bottom, transparent 0, #000 100%)"}],thumb:["ms-ColorPicker-thumb",{position:"absolute",width:20,height:20,background:"white",border:"1px solid "+i.neutralSecondaryAlt,borderRadius:"50%",boxShadow:a.elevation8,transform:"translate(-50%, -50%)",selectors:{":before":{position:"absolute",left:0,right:0,top:0,bottom:0,border:"2px solid "+i.white,borderRadius:"50%",boxSizing:"border-box",content:'""'}}}],description:Ro}}),void 0,{scope:"ColorRectangle"}),Bg=Jn(),Fg=function(e){function t(t){var o=e.call(this,t)||this;return o._disposables=[],o._root=f.createRef(),o._onKeyDown=function(e){var t=o.value,n=o._maxValue,r=e.shiftKey?10:1;switch(e.which){case Un.left:t-=r;break;case Un.right:t+=r;break;case Un.home:t=0;break;case Un.end:t=n;break;default:return}o._updateValue(e,Wm(t,n))},o._onMouseDown=function(e){var t=at(o);t&&o._disposables.push(ol(t,"mousemove",o._onMouseMove,!0),ol(t,"mouseup",o._disposeListeners,!0)),o._onMouseMove(e)},o._onMouseMove=function(e){if(o._root.current){var t=o._maxValue,n=o._root.current.getBoundingClientRect(),r=(e.clientX-n.left)/n.width,i=Wm(Math.round(r*t),t);o._updateValue(e,i)}},o._disposeListeners=function(){o._disposables.forEach((function(e){return e()})),o._disposables=[]},Ui(o),xi("ColorSlider",t,{thumbColor:"styles.sliderThumb",overlayStyle:"overlayColor",isAlpha:"type",maxValue:"type",minValue:"type"}),"hue"===o._type||t.overlayColor||t.overlayStyle||cn("ColorSlider: 'overlayColor' is required when 'type' is \"alpha\" or \"transparency\""),o.state={currentValue:t.value||0},o}return u(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.state.currentValue},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){e!==this.props&&void 0!==this.props.value&&this.setState({currentValue:this.props.value})},t.prototype.componentWillUnmount=function(){this._disposeListeners()},t.prototype.render=function(){var e=this._type,t=this._maxValue,o=this.props,n=o.overlayStyle,r=o.overlayColor,i=o.theme,a=o.className,s=o.styles,l=o.ariaLabel,c=void 0===l?e:l,u=this.value,d=Bg(s,{theme:i,className:a,type:e}),p=100*u/t;return f.createElement("div",{ref:this._root,className:d.root,tabIndex:0,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,role:"slider","aria-valuenow":u,"aria-valuetext":String(u),"aria-valuemin":0,"aria-valuemax":t,"aria-label":c,"data-is-focusable":!0},!(!r&&!n)&&f.createElement("div",{className:d.sliderOverlay,style:r?{background:"transparency"===e?"linear-gradient(to right, #"+r+", transparent)":"linear-gradient(to right, transparent, #"+r+")"}:n}),f.createElement("div",{className:d.sliderThumb,style:{left:p+"%"}}))},Object.defineProperty(t.prototype,"_type",{get:function(){var e=this.props,t=e.isAlpha,o=e.type;return void 0===o?t?"alpha":"hue":o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_maxValue",{get:function(){return"hue"===this._type?wm:Em},enumerable:!1,configurable:!0}),t.prototype._updateValue=function(e,t){if(t!==this.value){var o=this.props.onChange;o&&o(e,t),e.defaultPrevented||(this.setState({currentValue:t}),e.preventDefault())}},t.defaultProps={value:0},t}(f.Component),Ag={background:"linear-gradient("+["to left","red 0","#f09 10%","#cd00ff 20%","#3200ff 30%","#06f 40%","#00fffd 50%","#0f6 60%","#35ff00 70%","#cdff00 80%","#f90 90%","red 100%"].join(",")+")"},Lg={backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJUlEQVQYV2N89erVfwY0ICYmxoguxjgUFKI7GsTH5m4M3w1ChQC1/Ca8i2n1WgAAAABJRU5ErkJggg==)"},Hg=Vn(Fg,(function(e){var t,o=e.theme,n=e.className,r=e.type,i=void 0===r?"hue":r,a=e.isAlpha,s=void 0===a?"hue"!==i:a,l=o.palette,c=o.effects;return{root:["ms-ColorPicker-slider",{position:"relative",height:20,marginBottom:8,border:"1px solid "+l.neutralLight,borderRadius:c.roundedCorner2,boxSizing:"border-box",outline:"none",selectors:(t={},t["."+wo+" &:focus"]={outline:"1px solid "+l.neutralSecondary},t)},s?Lg:Ag,n],sliderOverlay:["ms-ColorPicker-sliderOverlay",{content:"",position:"absolute",left:0,right:0,top:0,bottom:0}],sliderThumb:["ms-ColorPicker-thumb","is-slider",{position:"absolute",width:20,height:20,background:"white",border:"1px solid "+l.neutralSecondaryAlt,borderRadius:"50%",boxShadow:c.elevation8,transform:"translate(-50%, -50%)",top:"50%"}]}}),void 0,{scope:"ColorSlider"}),Og=Jn(),zg=["hex","r","g","b","a","t"],Wg=function(e){function t(o){var n=e.call(this,o)||this;n._onSVChanged=function(e,t){n._updateColor(e,t)},n._onHChanged=function(e,t){n._updateColor(e,$m(n.state.color,t))},n._onATChanged=function(e,t){var o="transparency"===n.props.alphaType?Cg:tg;n._updateColor(e,o(n.state.color,Math.round(t)))},n._onBlur=function(e){var t,o=n.state,r=o.color,i=o.editingColor;if(i){var a=i.value,s=i.component,l="hex"===s,c="a"===s,u="t"===s,p=l?Pm:Rm;if(a.length>=p&&(l||!isNaN(Number(a)))){var h=void 0;h=l?Zm("#"+rg(a)):c||u?(c?tg:Cg)(r,Wm(Number(a),Em)):Ym(og(d(d({},r),((t={})[s]=Number(a),t)))),n._updateColor(e,h)}else n.setState({editingColor:void 0})}},Ui(n);var r=o.strings;xi("ColorPicker",o,{hexLabel:"strings.hex",redLabel:"strings.red",greenLabel:"strings.green",blueLabel:"strings.blue",alphaLabel:"strings.alpha",alphaSliderHidden:"alphaType"}),r.hue&&cn("ColorPicker property 'strings.hue' was used but has been deprecated. Use 'strings.hueAriaLabel' instead."),n.state={color:Vg(o)||Zm("#ffffff")},n._textChangeHandlers={};for(var i=0,a=zg;i<a.length;i++){var s=a[i];n._textChangeHandlers[s]=n._onTextChange.bind(n,s)}var l=t.defaultProps.strings;return n._textLabels={r:o.redLabel||r.red||l.red,g:o.greenLabel||r.green||l.green,b:o.blueLabel||r.blue||l.blue,a:o.alphaLabel||r.alpha||l.alpha,hex:o.hexLabel||r.hex||l.hex,t:r.transparency||l.transparency},n._strings=d(d(d({},l),{alphaAriaLabel:n._textLabels.a,transparencyAriaLabel:n._textLabels.t}),r),n}return u(t,e),Object.defineProperty(t.prototype,"color",{get:function(){return this.state.color},enumerable:!1,configurable:!0}),t.prototype.componentDidUpdate=function(e,t){if(e!==this.props){var o=Vg(this.props);o&&this._updateColor(void 0,o)}},t.prototype.render=function(){var e=this,t=this.props,o=this._strings,n=this._textLabels,r=t.theme,i=t.className,a=t.styles,s=t.alphaType,l=t.alphaSliderHidden,c=void 0===l?"none"===s:l,u=this.state.color,d="transparency"===s,p=["hex","r","g","b",d?"t":"a"],h=d?u.t:u.a,m=d?n.t:n.a,g=Og(a,{theme:r,className:i,alphaType:s}),v=[n.r,u.r,n.g,u.g,n.b,u.b];c||"number"!=typeof h||v.push(m,h+"%");var b=o.rootAriaLabelFormat.replace("{0}",v.join(" "));return f.createElement("div",{className:g.root,role:"group","aria-label":b},f.createElement("div",{className:g.panel},f.createElement(Ng,{color:u,onChange:this._onSVChanged,ariaLabel:o.svAriaLabel,ariaDescription:o.svAriaDescription,ariaValueFormat:o.svAriaValueFormat,className:g.colorRectangle}),f.createElement("div",{className:g.flexContainer},f.createElement("div",{className:g.flexSlider},f.createElement(Hg,{className:"is-hue",type:"hue",ariaLabel:o.hue||o.hueAriaLabel,value:u.h,onChange:this._onHChanged}),!c&&f.createElement(Hg,{className:"is-alpha",type:s,ariaLabel:d?o.transparencyAriaLabel:o.alphaAriaLabel,overlayColor:u.hex,value:h,onChange:this._onATChanged})),t.showPreview&&f.createElement("div",{className:g.flexPreviewBox},f.createElement("div",{className:g.colorSquare+" is-preview",style:{backgroundColor:u.str}}))),f.createElement("table",{className:g.table,role:"group",cellPadding:"0",cellSpacing:"0"},f.createElement("thead",null,f.createElement("tr",{className:g.tableHeader},f.createElement("td",{className:g.tableHexCell},n.hex),f.createElement("td",null,n.r),f.createElement("td",null,n.g),f.createElement("td",null,n.b),!c&&f.createElement("td",{className:g.tableAlphaCell},m))),f.createElement("tbody",null,f.createElement("tr",null,p.map((function(t){return"a"!==t&&"t"!==t||!c?f.createElement("td",{key:t},f.createElement(Pg,{className:g.input,onChange:e._textChangeHandlers[t],onBlur:e._onBlur,value:e._getDisplayValue(t),spellCheck:!1,ariaLabel:n[t],autoComplete:"off"})):null})))))))},t.prototype._getDisplayValue=function(e){var t=this.state,o=t.color,n=t.editingColor;return n&&n.component===e?n.value:"hex"===e?o[e]||"":"number"!=typeof o[e]||isNaN(o[e])?"":String(o[e])},t.prototype._onTextChange=function(e,t,o){var n,r=this.state.color,i="hex"===e,a="a"===e,s="t"===e;if(o=(o||"").substr(0,i?Mm:Nm),(i?Bm:Fm).test(o))if(""!==o&&(i?o.length===Mm:a||s?Number(o)<=Em:Number(o)<=Dm))if(String(r[e])===o)this.state.editingColor&&this.setState({editingColor:void 0});else{var l=i?Zm("#"+o):s?Cg(r,Number(o)):Ym(d(d({},r),((n={})[e]=Number(o),n)));this._updateColor(t,l)}else this.setState({editingColor:{component:e,value:o}})},t.prototype._updateColor=function(e,t){if(t){var o=this.state,n=o.color,r=o.editingColor;if(t.h!==n.h||t.str!==n.str||r){if(e&&this.props.onChange&&(this.props.onChange(e,t),e.defaultPrevented))return;this.setState({color:t,editingColor:void 0})}}},t.defaultProps={alphaType:"alpha",strings:{rootAriaLabelFormat:"Color picker, {0} selected.",hex:"Hex",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha",transparency:"Transparency",hueAriaLabel:"Hue",svAriaLabel:Rg.defaultProps.ariaLabel,svAriaValueFormat:Rg.defaultProps.ariaValueFormat,svAriaDescription:Rg.defaultProps.ariaDescription}},t}(f.Component);function Vg(e){var t=e.color;return"string"==typeof t?Zm(t):t}var Kg,Ug,Gg,jg,qg,Yg=Vn(Wg,(function(e){var t=e.className,o=e.theme,n=e.alphaType;return{root:["ms-ColorPicker",o.fonts.medium,{position:"relative",maxWidth:300},t],panel:["ms-ColorPicker-panel",{padding:"16px"}],table:["ms-ColorPicker-table",{tableLayout:"fixed",width:"100%",selectors:{"tbody td:last-of-type .ms-ColorPicker-input":{paddingRight:0}}}],tableHeader:[o.fonts.small,{selectors:{td:{paddingBottom:4}}}],tableHexCell:{width:"25%"},tableAlphaCell:"transparency"===n&&{width:"22%"},colorSquare:["ms-ColorPicker-colorSquare",{width:48,height:48,margin:"0 0 0 8px",border:"1px solid #c8c6c4"}],flexContainer:{display:"flex"},flexSlider:{flexGrow:"1"},flexPreviewBox:{flexGrow:"0"},input:["ms-ColorPicker-input",{width:"100%",border:"none",boxSizing:"border-box",height:30,selectors:{"&.ms-TextField":{paddingRight:4},"& .ms-TextField-field":{minWidth:"auto",padding:5,textOverflow:"clip"}}}]}}),void 0,{scope:"ColorPicker"}),Zg=jo((function(e){var t,o=e.semanticColors;return{backgroundColor:o.disabledBackground,color:o.disabledText,cursor:"default",selectors:(t={":after":{borderColor:o.disabledBackground}},t[ro]={color:"GrayText",selectors:{":after":{borderColor:"GrayText"}}},t)}})),Xg={selectors:(Kg={},Kg[ro]=d({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),Kg)},Qg={selectors:(Ug={},Ug[ro]=d({color:"WindowText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),Ug)},Jg=jo((function(e,t,o,n,r,i){var a,s=e.palette,l=e.semanticColors,c={textHoveredColor:l.menuItemTextHovered,textSelectedColor:s.neutralDark,textDisabledColor:l.disabledText,backgroundHoveredColor:l.menuItemBackgroundHovered,backgroundPressedColor:l.menuItemBackgroundPressed};return kn({root:[e.fonts.medium,{backgroundColor:n?c.backgroundHoveredColor:"transparent",boxSizing:"border-box",cursor:"pointer",display:r?"none":"block",width:"100%",height:"auto",minHeight:36,lineHeight:"20px",padding:"0 8px",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:"transparent",borderRadius:0,wordWrap:"break-word",overflowWrap:"break-word",textAlign:"left",selectors:(a={},a[ro]={border:"none",borderColor:"Background"},a["&.ms-Checkbox"]={display:"flex",alignItems:"center"},a["&.ms-Button--command:hover:active"]={backgroundColor:c.backgroundPressedColor},a[".ms-Checkbox-label"]={width:"100%"},a)},i?[{backgroundColor:"transparent",color:c.textSelectedColor,selectors:{":hover":[{backgroundColor:c.backgroundHoveredColor},Xg]}},To(e,{inset:-1,isFocusedOnly:!1}),Xg]:[]],rootHovered:{backgroundColor:c.backgroundHoveredColor,color:c.textHoveredColor},rootFocused:{backgroundColor:c.backgroundHoveredColor},rootDisabled:{color:c.textDisabledColor,cursor:"default"},optionText:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",minWidth:"0px",maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",display:"inline-block"},optionTextWrapper:{maxWidth:"100%",display:"flex",alignItems:"center"}},t,o)})),$g=jo((function(e,t){var o,n,r=e.semanticColors,i=e.fonts,a={buttonTextColor:r.bodySubtext,buttonTextHoveredCheckedColor:r.buttonTextChecked,buttonBackgroundHoveredColor:r.listItemBackgroundHovered,buttonBackgroundCheckedColor:r.listItemBackgroundChecked,buttonBackgroundCheckedHoveredColor:r.listItemBackgroundCheckedHovered},s={selectors:(o={},o[ro]=d({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)};return kn({root:{color:a.buttonTextColor,fontSize:i.small.fontSize,position:"absolute",top:0,height:"100%",lineHeight:30,width:32,textAlign:"center",cursor:"default",selectors:(n={},n[ro]=d({backgroundColor:"ButtonFace",borderColor:"ButtonText",color:"ButtonText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)},icon:{fontSize:i.small.fontSize},rootHovered:[{backgroundColor:a.buttonBackgroundHoveredColor,color:a.buttonTextHoveredCheckedColor,cursor:"pointer"},s],rootPressed:[{backgroundColor:a.buttonBackgroundCheckedColor,color:a.buttonTextHoveredCheckedColor},s],rootChecked:[{backgroundColor:a.buttonBackgroundCheckedColor,color:a.buttonTextHoveredCheckedColor},s],rootCheckedHovered:[{backgroundColor:a.buttonBackgroundCheckedHoveredColor,color:a.buttonTextHoveredCheckedColor},s],rootDisabled:[Zg(e),{position:"absolute"}]},t)})),ef=jo((function(e,t,o){var n,r,i,a,s,l,c=e.semanticColors,u=e.fonts,p=e.effects,h={textColor:c.inputText,borderColor:c.inputBorder,borderHoveredColor:c.inputBorderHovered,borderPressedColor:c.inputFocusBorderAlt,borderFocusedColor:c.inputFocusBorderAlt,backgroundColor:c.inputBackground,erroredColor:c.errorText},m={headerTextColor:c.menuHeader,dividerBorderColor:c.bodyDivider},g={selectors:(n={},n[ro]={color:"GrayText"},n)},f=[{color:c.inputPlaceholderText},g],v=[{color:c.inputTextHovered},g],b=[{color:c.disabledText},g],y=d(d({color:"HighlightText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{":after":{borderColor:"Highlight"}}}),_=Mo(h.borderPressedColor,p.roundedCorner2,"border",0);return kn({container:{},label:{},labelDisabled:{},root:[e.fonts.medium,{boxShadow:"none",marginLeft:"0",paddingRight:32,paddingLeft:9,color:h.textColor,position:"relative",outline:"0",userSelect:"none",backgroundColor:h.backgroundColor,cursor:"text",display:"block",height:32,whiteSpace:"nowrap",textOverflow:"ellipsis",boxSizing:"border-box",selectors:{".ms-Label":{display:"inline-block",marginBottom:"8px"},"&.is-open":{selectors:(r={},r[ro]=y,r)},":after":{pointerEvents:"none",content:"''",position:"absolute",left:0,top:0,bottom:0,right:0,borderWidth:"1px",borderStyle:"solid",borderColor:h.borderColor,borderRadius:p.roundedCorner2}}}],rootHovered:{selectors:(i={":after":{borderColor:h.borderHoveredColor},".ms-ComboBox-Input":[{color:c.inputTextHovered},sn(v),Qg]},i[ro]=d(d({color:"HighlightText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{":after":{borderColor:"Highlight"}}}),i)},rootPressed:[{position:"relative",selectors:(a={},a[ro]=y,a)}],rootFocused:[{selectors:(s={".ms-ComboBox-Input":[{color:c.inputTextHovered},Qg]},s[ro]=y,s)},_],rootDisabled:Zg(e),rootError:{selectors:{":after":{borderColor:h.erroredColor},":hover:after":{borderColor:c.inputBorderHovered}}},rootDisallowFreeForm:{},input:[sn(f),{backgroundColor:h.backgroundColor,color:h.textColor,boxSizing:"border-box",width:"100%",height:"100%",borderStyle:"none",outline:"none",font:"inherit",textOverflow:"ellipsis",padding:"0",selectors:{"::-ms-clear":{display:"none"}}},Qg],inputDisabled:[Zg(e),sn(b)],errorMessage:[e.fonts.small,{color:h.erroredColor,marginTop:"5px"}],callout:{boxShadow:p.elevation8},optionsContainerWrapper:{width:o},optionsContainer:{display:"block"},screenReaderText:Ro,header:[u.medium,{fontWeight:qe.semibold,color:m.headerTextColor,backgroundColor:"none",borderStyle:"none",height:36,lineHeight:36,cursor:"default",padding:"0 8px",userSelect:"none",textAlign:"left",selectors:(l={},l[ro]=d({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),l)}],divider:{height:1,backgroundColor:m.dividerBorderColor}},t)})),tf=jo((function(e,t,o,n,r,i,a,s){return{container:Z("ms-ComboBox-container",t,e.container),label:Z(e.label,n&&e.labelDisabled),root:Z("ms-ComboBox",s?e.rootError:o&&"is-open",r&&"is-required",e.root,!a&&e.rootDisallowFreeForm,s&&!i?e.rootError:!n&&i&&e.rootFocused,!n&&{selectors:{":hover":s?e.rootError:!o&&!i&&e.rootHovered,":active":s?e.rootError:e.rootPressed,":focus":s?e.rootError:e.rootFocused}},n&&["is-disabled",e.rootDisabled]),input:Z("ms-ComboBox-Input",e.input,n&&e.inputDisabled),errorMessage:Z(e.errorMessage),callout:Z("ms-ComboBox-callout",e.callout),optionsContainerWrapper:Z("ms-ComboBox-optionsContainerWrapper",e.optionsContainerWrapper),optionsContainer:Z("ms-ComboBox-optionsContainer",e.optionsContainer),header:Z("ms-ComboBox-header",e.header),divider:Z("ms-ComboBox-divider",e.divider),screenReaderText:Z(e.screenReaderText)}})),of=jo((function(e){return{optionText:Z("ms-ComboBox-optionText",e.optionText),root:Z("ms-ComboBox-option",e.root,{selectors:{":hover":e.rootHovered,":focus":e.rootFocused,":active":e.rootPressed}}),optionTextWrapper:Z(e.optionTextWrapper)}}));function nf(e,t){for(var o=[],n=0,r=t;n<r.length;n++){var i=e[r[n]];i&&o.push(i)}return o}!function(e){e[e.Normal=0]="Normal",e[e.Divider=1]="Divider",e[e.Header=2]="Header"}(Gg||(Gg={})),function(e){e[e.backward=-1]="backward",e[e.none=0]="none",e[e.forward=1]="forward"}(jg||(jg={})),function(e){e[e.clearAll=-2]="clearAll",e[e.default=-1]="default"}(qg||(qg={}));var rf=f.memo((function(e){return(0,e.render)()}),(function(e,t){e.render;var o=p(e,["render"]);return t.render,Ns(o,p(t,["render"]))})),af="ComboBox",sf={options:[],allowFreeform:!1,autoComplete:"on",buttonIconProps:{iconName:"ChevronDown"}};var lf=f.forwardRef((function(e,t){var o=tr(sf,e),n=(o.ref,p(o,["ref"])),r=f.useRef(null),i=Or(r,t),a=function(e){var t=e.options,o=e.defaultSelectedKey,n=e.selectedKey,r=f.useState((function(){return uf(t,function(e,t){var o=df(e);return o.length?o:df(t)}(o,n))})),i=r[0],a=r[1],s=f.useState(t),l=s[0],c=s[1],u=f.useState(),d=u[0],p=u[1];return f.useEffect((function(){if(void 0!==n){var e=df(n),o=uf(t,e);a(o)}c(t)}),[t,n]),f.useEffect((function(){null===n&&p(void 0)}),[n]),[i,a,l,c,d,p]}(n),s=a[0],l=a[1],c=a[2],u=a[3],h=a[4],m=a[5];return f.createElement(cf,d({},n,{hoisted:{mergedRootRef:i,rootRef:r,selectedIndices:s,setSelectedIndices:l,currentOptions:c,setCurrentOptions:u,suggestedDisplayValue:h,setSuggestedDisplayValue:m}}))}));lf.displayName=af;var cf=function(e){function t(t){var o=e.call(this,t)||this;return o._autofill=f.createRef(),o._comboBoxWrapper=f.createRef(),o._comboBoxMenu=f.createRef(),o._selectedElement=f.createRef(),o.focus=function(e,t){o._autofill.current&&(t?Aa(o._autofill.current):o._autofill.current.focus(),e&&o.setState({isOpen:!0})),o._hasFocus()||o.setState({focusState:"focused"})},o.dismissMenu=function(){o.state.isOpen&&o.setState({isOpen:!1})},o._onUpdateValueInAutofillWillReceiveProps=function(){var e=o._autofill.current;if(!e)return null;if(null===e.value||void 0===e.value)return null;var t=pf(o._currentVisibleValue);return e.value!==t?t:e.value},o._renderComboBoxWrapper=function(e,t){var n=o.props,r=n.label,i=n.disabled,a=n.ariaLabel,s=n.ariaDescribedBy,l=n.required,c=n.errorMessage,u=n.buttonIconProps,p=n.isButtonAriaHidden,h=void 0===p||p,m=n.title,g=n.placeholder,v=n.tabIndex,b=n.autofill,y=n.iconButtonProps,_=n.hoisted.suggestedDisplayValue,C=o.state.isOpen,S=o._hasFocus()&&o.props.multiSelect&&e?e:g;return f.createElement("div",{"data-ktp-target":!0,ref:o._comboBoxWrapper,id:o._id+"wrapper",className:o._classNames.root,"aria-owns":C?o._id+"-list":void 0},f.createElement(Qi,d({"data-ktp-execute-target":!0,"data-is-interactable":!i,componentRef:o._autofill,id:o._id+"-input",className:o._classNames.input,type:"text",onFocus:o._onFocus,onBlur:o._onBlur,onKeyDown:o._onInputKeyDown,onKeyUp:o._onInputKeyUp,onClick:o._onAutofillClick,onTouchStart:o._onTouchStart,onInputValueChange:o._onInputChange,"aria-expanded":C,"aria-autocomplete":o._getAriaAutoCompleteValue(),role:"combobox",readOnly:i,"aria-labelledby":r&&o._id+"-label","aria-label":a&&!r?a:void 0,"aria-describedby":void 0!==c?Ks(s,t):s,"aria-activedescendant":o._getAriaActiveDescendantValue(),"aria-required":l,"aria-disabled":i,"aria-controls":C?o._id+"-list":void 0,spellCheck:!1,defaultVisibleValue:o._currentVisibleValue,suggestedDisplayValue:_,updateValueInWillReceiveProps:o._onUpdateValueInAutofillWillReceiveProps,shouldSelectFullInputValueInComponentDidUpdate:o._onShouldSelectFullInputValueInAutofillComponentDidUpdate,title:m,preventValueSelection:!o._hasFocus(),placeholder:S,tabIndex:i?-1:v},b)),f.createElement(Zu,d({className:"ms-ComboBox-CaretDown-button",styles:o._getCaretButtonStyles(),role:"presentation","aria-hidden":h,"data-is-focusable":!1,tabIndex:-1,onClick:o._onComboBoxClick,onBlur:o._onBlur,iconProps:u,disabled:i,checked:C},y)))},o._onShouldSelectFullInputValueInAutofillComponentDidUpdate=function(){return o._currentVisibleValue===o.props.hoisted.suggestedDisplayValue},o._getVisibleValue=function(){var e=o.props,t=e.text,n=e.allowFreeform,r=e.autoComplete,i=e.hoisted,a=i.suggestedDisplayValue,s=i.selectedIndices,l=i.currentOptions,c=o.state,u=c.currentPendingValueValidIndex,d=c.currentPendingValue,p=c.isOpen,h=hf(l,u);if((!p||!h)&&t&&null==d)return t;if(o.props.multiSelect){if(o._hasFocus()){var m=-1;return"on"===r&&h&&(m=u),o._getPendingString(d,l,m)}return o._getMultiselectDisplayString(s,l,a)}return m=o._getFirstSelectedIndex(),n?("on"===r&&h&&(m=u),o._getPendingString(d,l,m)):h&&"on"===r?(m=u,pf(d)):!o.state.isOpen&&d?hf(l,m)?d:pf(a):hf(l,m)?gf(l[m]):pf(a)},o._onInputChange=function(e){o.props.disabled?o._handleInputWhenDisabled(null):o.props.allowFreeform?o._processInputChangeWithFreeform(e):o._processInputChangeWithoutFreeform(e)},o._onFocus=function(){var e,t;null===(t=null===(e=o._autofill.current)||void 0===e?void 0:e.inputElement)||void 0===t||t.select(),o._hasFocus()||o.setState({focusState:"focusing"})},o._onResolveOptions=function(){if(o.props.onResolveOptions){var e=o.props.onResolveOptions(m(o.props.hoisted.currentOptions));if(Array.isArray(e))o.props.hoisted.setCurrentOptions(e);else if(e&&e.then){var t=o._currentPromise=e;t.then((function(e){t===o._currentPromise&&o.props.hoisted.setCurrentOptions(e)}))}}},o._onBlur=function(e){var t,n,r=e.relatedTarget;if(null===e.relatedTarget&&(r=document.activeElement),r){var i=null===(t=o.props.hoisted.rootRef.current)||void 0===t?void 0:t.contains(r),a=null===(n=o._comboBoxMenu.current)||void 0===n?void 0:n.contains(r),s=o._comboBoxMenu.current&&ya(o._comboBoxMenu.current,(function(e){return e===r}));if(i||a||s)return s&&o._hasFocus()&&(!o.props.multiSelect||o.props.allowFreeform)&&o._submitPendingValue(e),e.preventDefault(),void e.stopPropagation()}o._hasFocus()&&(o.setState({focusState:"none"}),o.props.multiSelect&&!o.props.allowFreeform||o._submitPendingValue(e))},o._onRenderContainer=function(e,t){var n=e.onRenderList,r=e.calloutProps,i=e.dropdownWidth,a=e.dropdownMaxWidth,s=e.onRenderUpperContent,l=void 0===s?o._onRenderUpperContent:s,c=e.onRenderLowerContent,u=void 0===c?o._onRenderLowerContent:c,p=e.useComboBoxAsMenuWidth,h=e.persistMenu,m=e.shouldRestoreFocus,g=void 0===m||m,v=o.state.isOpen,b=o._id,y=p&&o._comboBoxWrapper.current?o._comboBoxWrapper.current.clientWidth+2:void 0;return f.createElement(Cc,d({isBeakVisible:!1,gapSpace:0,doNotLayer:!1,directionalHint:qs.bottomLeftEdge,directionalHintFixed:!1},r,{onLayerMounted:o._onLayerMounted,className:qr(o._classNames.callout,null==r?void 0:r.className),target:o._comboBoxWrapper.current,onDismiss:o._onDismiss,onMouseDown:o._onCalloutMouseDown,onScroll:o._onScroll,setInitialFocus:!1,calloutWidth:p&&o._comboBoxWrapper.current?y&&y:i,calloutMaxWidth:a||y,hidden:h?!v:void 0,shouldRestoreFocus:g}),l(o.props,o._onRenderUpperContent),f.createElement("div",{className:o._classNames.optionsContainerWrapper,ref:o._comboBoxMenu},null==n?void 0:n(d(d({},e),{id:b}),o._onRenderList)),u(o.props,o._onRenderLowerContent))},o._onLayerMounted=function(){o._onCalloutLayerMounted(),o.props.calloutProps&&o.props.calloutProps.onLayerMounted&&o.props.calloutProps.onLayerMounted()},o._onRenderLabel=function(e){var t=e.props,n=t.label,r=t.disabled,i=t.required;return n?f.createElement(Oh,{id:o._id+"-label",disabled:r,required:i,className:o._classNames.label},n,e.multiselectAccessibleText&&f.createElement("span",{className:o._classNames.screenReaderText},e.multiselectAccessibleText)):null},o._onRenderList=function(e){var t=e.onRenderItem,n=e.options,r=e.label,i=e.ariaLabel,a=o._id;return f.createElement("div",{id:a+"-list",className:o._classNames.optionsContainer,"aria-labelledby":r&&a+"-label","aria-label":i&&!r?i:void 0,role:"listbox"},n.map((function(e){return null==t?void 0:t(e,o._onRenderItem)})))},o._onRenderItem=function(e){switch(e.itemType){case Gg.Divider:return o._renderSeparator(e);case Gg.Header:return o._renderHeader(e);default:return o._renderOption(e)}},o._onRenderLowerContent=function(){return null},o._onRenderUpperContent=function(){return null},o._renderOption=function(e){var t,n=o.props.onRenderOption,r=void 0===n?o._onRenderOptionContent:n,i=o._id,a=o._isOptionSelected(e.index),s=o._isOptionChecked(e.index),l=o._getCurrentOptionStyles(e),c=of(o._getCurrentOptionStyles(e)),u=null!==(t=e.title)&&void 0!==t?t:gf(e),p=function(){return r(e,o._onRenderOptionContent)};return f.createElement(rf,{key:e.key,index:e.index,disabled:e.disabled,isSelected:a,isChecked:s,text:e.text,render:function(){return o.props.multiSelect?f.createElement(Ah,{id:i+"-list"+e.index,ariaLabel:e.ariaLabel,key:e.key,styles:l,className:"ms-ComboBox-option",onChange:o._onItemClick(e),label:e.text,checked:s,title:u,disabled:e.disabled,onRenderLabel:p,inputProps:d({"aria-selected":s?"true":"false",role:"option"},{"data-index":e.index,"data-is-focusable":!0})}):f.createElement(zd,{id:i+"-list"+e.index,key:e.key,"data-index":e.index,styles:l,checked:a,className:"ms-ComboBox-option",onClick:o._onItemClick(e),onMouseEnter:o._onOptionMouseEnter.bind(o,e.index),onMouseMove:o._onOptionMouseMove.bind(o,e.index),onMouseLeave:o._onOptionMouseLeave,role:"option","aria-selected":s?"true":"false",ariaLabel:e.ariaLabel,disabled:e.disabled,title:u},f.createElement("span",{className:c.optionTextWrapper,ref:a?o._selectedElement:void 0},r(e,o._onRenderOptionContent)))},data:e.data})},o._onCalloutMouseDown=function(e){e.preventDefault()},o._onScroll=function(){o._isScrollIdle||void 0===o._scrollIdleTimeoutId?o._isScrollIdle=!1:(o._async.clearTimeout(o._scrollIdleTimeoutId),o._scrollIdleTimeoutId=void 0),o._scrollIdleTimeoutId=o._async.setTimeout((function(){o._isScrollIdle=!0}),250)},o._onRenderOptionContent=function(e){var t=of(o._getCurrentOptionStyles(e));return f.createElement("span",{className:t.optionText},e.text)},o._onDismiss=function(){var e=o.props.onMenuDismiss;e&&e(),o.props.persistMenu&&o._onCalloutLayerMounted(),o._setOpenStateAndFocusOnClose(!1,!1),o._resetSelectedIndex()},o._onAfterClearPendingInfo=function(){o._processingClearPendingInfo=!1},o._onInputKeyDown=function(e){var t=o.props,n=t.disabled,r=t.allowFreeform,i=t.autoComplete,a=t.hoisted.currentOptions,s=o.state,l=s.isOpen,c=s.currentPendingValueValidIndexOnHover;if(o._lastKeyDownWasAltOrMeta=ff(e),n)o._handleInputWhenDisabled(e);else{var u=o._getPendingSelectedIndex(!1);switch(e.which){case Un.enter:o._autofill.current&&o._autofill.current.inputElement&&o._autofill.current.inputElement.select(),o._submitPendingValue(e),o.props.multiSelect&&l?o.setState({currentPendingValueValidIndex:u}):(l||(!r||void 0===o.state.currentPendingValue||null===o.state.currentPendingValue||o.state.currentPendingValue.length<=0)&&o.state.currentPendingValueValidIndex<0)&&o.setState({isOpen:!l});break;case Un.tab:return o.props.multiSelect||o._submitPendingValue(e),void(l&&o._setOpenStateAndFocusOnClose(!l,!1));case Un.escape:if(o._resetSelectedIndex(),!l)return;o.setState({isOpen:!1});break;case Un.up:if(c===qg.clearAll&&(u=o.props.hoisted.currentOptions.length),e.altKey||e.metaKey){if(l){o._setOpenStateAndFocusOnClose(!l,!0);break}return}o._setPendingInfoFromIndexAndDirection(u,jg.backward);break;case Un.down:e.altKey||e.metaKey?o._setOpenStateAndFocusOnClose(!0,!0):(c===qg.clearAll&&(u=-1),o._setPendingInfoFromIndexAndDirection(u,jg.forward));break;case Un.home:case Un.end:if(r)return;u=-1;var d=jg.forward;e.which===Un.end&&(u=a.length,d=jg.backward),o._setPendingInfoFromIndexAndDirection(u,d);break;case Un.space:if(!r&&"off"===i)break;default:if(e.which>=112&&e.which<=123)return;if(e.keyCode===Un.alt||"Meta"===e.key)return;if(!r&&"on"===i){o._onInputChange(e.key);break}return}e.stopPropagation(),e.preventDefault()}},o._onInputKeyUp=function(e){var t=o.props,n=t.disabled,r=t.allowFreeform,i=t.autoComplete,a=o.state.isOpen,s=o._lastKeyDownWasAltOrMeta&&ff(e);o._lastKeyDownWasAltOrMeta=!1;var l=s&&!(Ys()||Qs());if(n)o._handleInputWhenDisabled(e);else switch(e.which){case Un.space:return void(r||"off"!==i||o._setOpenStateAndFocusOnClose(!a,!!a));default:return void(l&&a?o._setOpenStateAndFocusOnClose(!a,!0):("focusing"===o.state.focusState&&o.props.openOnKeyboardFocus&&o.setState({isOpen:!0}),"focused"!==o.state.focusState&&o.setState({focusState:"focused"})))}},o._onOptionMouseLeave=function(){o._shouldIgnoreMouseEvent()||o.props.persistMenu&&!o.state.isOpen||o.setState({currentPendingValueValidIndexOnHover:qg.clearAll})},o._onComboBoxClick=function(){var e=o.props.disabled,t=o.state.isOpen;e||(o._setOpenStateAndFocusOnClose(!t,!1),o.setState({focusState:"focused"}))},o._onAutofillClick=function(){var e=o.props,t=e.disabled;e.allowFreeform&&!t?o.focus(o.state.isOpen||o._processingTouch):o._onComboBoxClick()},o._onTouchStart=function(){o._comboBoxWrapper.current&&!("onpointerdown"in o._comboBoxWrapper)&&o._handleTouchAndPointerEvent()},o._onPointerDown=function(e){"touch"===e.pointerType&&(o._handleTouchAndPointerEvent(),e.preventDefault(),e.stopImmediatePropagation())},Ui(o),o._async=new Zi(o),o._events=new Os(o),ki(af,t,{defaultSelectedKey:"selectedKey",text:"defaultSelectedKey",selectedKey:"value",dropdownWidth:"useComboBoxAsMenuWidth",ariaLabel:"label"}),o._id=t.id||Va("ComboBox"),o._isScrollIdle=!0,o._processingTouch=!1,o._gotMouseMove=!1,o._processingClearPendingInfo=!1,o.state={isOpen:!1,focusState:"none",currentPendingValueValidIndex:-1,currentPendingValue:void 0,currentPendingValueValidIndexOnHover:qg.default},o}return u(t,e),Object.defineProperty(t.prototype,"selectedOptions",{get:function(){var e=this.props.hoisted;return nf(e.currentOptions,e.selectedIndices)},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this._comboBoxWrapper.current&&!this.props.disabled&&(this._events.on(this._comboBoxWrapper.current,"focus",this._onResolveOptions,!0),"onpointerdown"in this._comboBoxWrapper.current&&this._events.on(this._comboBoxWrapper.current,"pointerdown",this._onPointerDown,!0))},t.prototype.componentDidUpdate=function(e,t){var o=this,n=this.props,r=n.allowFreeform,i=n.text,a=n.onMenuOpen,s=n.onMenuDismissed,l=n.hoisted.selectedIndices,c=this.state,u=c.isOpen,d=c.currentPendingValueValidIndex;!u||t.isOpen&&t.currentPendingValueValidIndex===d||this._async.setTimeout((function(){return o._scrollIntoView()}),0),this._hasFocus()&&(u||t.isOpen&&!u&&this._focusInputAfterClose&&this._autofill.current&&document.activeElement!==this._autofill.current.inputElement)&&this.focus(void 0,!0),this._focusInputAfterClose&&(t.isOpen&&!u||this._hasFocus()&&(!u&&!this.props.multiSelect&&e.hoisted.selectedIndices&&l&&e.hoisted.selectedIndices[0]!==l[0]||!r||i!==e.text))&&this._onFocus(),this._notifyPendingValueChanged(t),u&&!t.isOpen&&a&&a(),!u&&t.isOpen&&s&&s()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this._id+"-error",t=this.props,o=t.className,n=t.disabled,r=t.required,i=t.errorMessage,a=t.onRenderContainer,s=void 0===a?this._onRenderContainer:a,l=t.onRenderLabel,c=void 0===l?this._onRenderLabel:l,u=t.onRenderList,p=void 0===u?this._onRenderList:u,h=t.onRenderItem,m=void 0===h?this._onRenderItem:h,g=t.onRenderOption,v=void 0===g?this._onRenderOptionContent:g,b=t.allowFreeform,y=t.styles,_=t.theme,C=t.persistMenu,S=t.multiSelect,x=t.hoisted,k=x.suggestedDisplayValue,w=x.selectedIndices,I=x.currentOptions,D=this.state.isOpen;this._currentVisibleValue=this._getVisibleValue();var T=S?this._getMultiselectDisplayString(w,I,k):void 0,E=Tr(this.props,Dr,["onChange","value"]),P=!!(i&&i.length>0);this._classNames=this.props.getClassNames?this.props.getClassNames(_,!!D,!!n,!!r,!!this._hasFocus(),!!b,!!P,o):tf(ef(_,y),o,!!D,!!n,!!r,!!this._hasFocus(),!!b,!!P);var M=this._renderComboBoxWrapper(T,e);return f.createElement("div",d({},E,{ref:this.props.hoisted.mergedRootRef,className:this._classNames.container}),c({props:this.props,multiselectAccessibleText:T},this._onRenderLabel),M,(C||D)&&s(d(d({},this.props),{onRenderList:p,onRenderItem:m,onRenderOption:v,options:I.map((function(e,t){return d(d({},e),{index:t})})),onDismiss:this._onDismiss}),this._onRenderContainer),f.createElement("div",d({role:"region","aria-live":"polite","aria-atomic":"true",id:e},P?{className:this._classNames.errorMessage}:{"aria-hidden":!0}),void 0!==i?i:""))},t.prototype._getPendingString=function(e,t,o){return null!=e?e:hf(t,o)?t[o].text:""},t.prototype._getMultiselectDisplayString=function(e,t,o){for(var n=[],r=0;e&&r<e.length;r++){var i=e[r];n.push(hf(t,i)?t[i].text:pf(o))}var a=this.props.multiSelectDelimiter,s=void 0===a?", ":a;return n.join(s)},t.prototype._processInputChangeWithFreeform=function(e){var t=this.props.hoisted.currentOptions,o=-1;if(""===e)return 1===(r=t.map((function(e,t){return d(d({},e),{index:t})})).filter((function(t){return mf(t)&&gf(t)===e}))).length&&(o=r[0].index),void this._setPendingInfo(e,o,e);var n=e;e=e.toLocaleLowerCase();var r,i="";if("on"===this.props.autoComplete){if((r=t.map((function(e,t){return d(d({},e),{index:t})})).filter((function(t){return mf(t)&&0===gf(t).toLocaleLowerCase().indexOf(e)}))).length>0){var a=gf(r[0]);i=a.toLocaleLowerCase()!==e?a:"",o=r[0].index}}else 1===(r=t.map((function(e,t){return d(d({},e),{index:t})})).filter((function(t){return mf(t)&&gf(t).toLocaleLowerCase()===e}))).length&&(o=r[0].index);this._setPendingInfo(n,o,i)},t.prototype._processInputChangeWithoutFreeform=function(e){var t=this,o=this.props.hoisted.currentOptions,n=this.state,r=n.currentPendingValue,i=n.currentPendingValueValidIndex;if("on"===this.props.autoComplete&&""!==e){this._autoCompleteTimeout&&(this._async.clearTimeout(this._autoCompleteTimeout),this._autoCompleteTimeout=void 0,e=pf(r)+e);var a=e;e=e.toLocaleLowerCase();var s=o.map((function(e,t){return d(d({},e),{index:t})})).filter((function(t){return mf(t)&&0===t.text.toLocaleLowerCase().indexOf(e)}));return s.length>0&&this._setPendingInfo(a,s[0].index,gf(s[0])),void(this._autoCompleteTimeout=this._async.setTimeout((function(){t._autoCompleteTimeout=void 0}),1e3))}var l=i>=0?i:this._getFirstSelectedIndex();this._setPendingInfoFromIndex(l)},t.prototype._getFirstSelectedIndex=function(){var e=this.props.hoisted.selectedIndices;return(null==e?void 0:e.length)?e[0]:-1},t.prototype._getNextSelectableIndex=function(e,t){var o=this.props.hoisted.currentOptions,n=e+t;if(!hf(o,n=Math.max(0,Math.min(o.length-1,n))))return-1;var r=o[n];if(!mf(r)||!0===r.hidden){if(t===jg.none||!(n>0&&t<jg.none||n>=0&&n<o.length&&t>jg.none))return e;n=this._getNextSelectableIndex(n,t)}return n},t.prototype._setSelectedIndex=function(e,t,o){void 0===o&&(o=jg.none);var n=this.props,r=n.onChange,i=n.onPendingValueChanged,a=n.hoisted,s=a.selectedIndices,l=a.currentOptions,c=s?s.slice():[];if(hf(l,e=this._getNextSelectableIndex(e,o))){if(this.props.multiSelect||c.length<1||1===c.length&&c[0]!==e){var u=d({},l[e]);if(!u||u.disabled)return;if(this.props.multiSelect?(u.selected=void 0!==u.selected?!u.selected:c.indexOf(e)<0,u.selected&&c.indexOf(e)<0?c.push(e):!u.selected&&c.indexOf(e)>=0&&(c=c.filter((function(t){return t!==e})))):c[0]=e,t.persist(),this.props.selectedKey||null===this.props.selectedKey)this._hasPendingValue&&i&&(i(),this._hasPendingValue=!1),r&&r(t,u,e,void 0);else{var p=l.slice();p[e]=u,this.props.hoisted.setSelectedIndices(c),this.props.hoisted.setCurrentOptions(p),this._hasPendingValue&&i&&(i(),this._hasPendingValue=!1),r&&r(t,u,e,void 0)}}this.props.multiSelect&&this.state.isOpen||this._clearPendingInfo()}},t.prototype._submitPendingValue=function(e){var t,o=this.props,n=o.onChange,r=o.allowFreeform,i=o.autoComplete,a=o.multiSelect,s=o.hoisted,l=s.currentOptions,c=this.state,u=c.currentPendingValue,d=c.currentPendingValueValidIndex,p=c.currentPendingValueValidIndexOnHover,h=this.props.hoisted.selectedIndices;if(!this._processingClearPendingInfo){if(r){if(null==u)return void(p>=0&&(this._setSelectedIndex(p,e),this._clearPendingInfo()));if(hf(l,d)){var m=gf(l[d]).toLocaleLowerCase(),g=this._autofill.current;if(u.toLocaleLowerCase()===m||i&&0===m.indexOf(u.toLocaleLowerCase())&&(null==g?void 0:g.isValueSelected)&&u.length+(g.selectionEnd-g.selectionStart)===m.length||(null===(t=null==g?void 0:g.inputElement)||void 0===t?void 0:t.value.toLocaleLowerCase())===m){if(this._setSelectedIndex(d,e),a&&this.state.isOpen)return;return void this._clearPendingInfo()}}if(n)n&&n(e,void 0,void 0,u);else{var f={key:u||Va(),text:pf(u)};a&&(f.selected=!0);var v=l.concat([f]);h&&(a||(h=[]),h.push(v.length-1)),s.setCurrentOptions(v),s.setSelectedIndices(h)}}else d>=0?this._setSelectedIndex(d,e):p>=0&&this._setSelectedIndex(p,e);this._clearPendingInfo()}},t.prototype._onCalloutLayerMounted=function(){this._gotMouseMove=!1},t.prototype._renderSeparator=function(e){var t=e.index,o=e.key;return t&&t>0?f.createElement("div",{role:"separator",key:o,className:this._classNames.divider}):null},t.prototype._renderHeader=function(e){var t=this.props.onRenderOption,o=void 0===t?this._onRenderOptionContent:t;return f.createElement("div",{key:e.key,className:this._classNames.header},o(e,this._onRenderOptionContent))},t.prototype._isOptionSelected=function(e){return this.state.currentPendingValueValidIndexOnHover!==qg.clearAll&&this._getPendingSelectedIndex(!0)===e},t.prototype._isOptionChecked=function(e){return!(!this.props.multiSelect||void 0===e||!this.props.hoisted.selectedIndices)&&this.props.hoisted.selectedIndices.indexOf(e)>=0},t.prototype._getPendingSelectedIndex=function(e){var t=this.state,o=t.currentPendingValueValidIndexOnHover,n=t.currentPendingValueValidIndex,r=t.currentPendingValue;return o>=0?o:n>=0||e&&null!=r?n:this.props.multiSelect?0:this._getFirstSelectedIndex()},t.prototype._scrollIntoView=function(){var e=this.props,t=e.onScrollToItem,o=e.scrollSelectedToTop,n=this.state,r=n.currentPendingValueValidIndex,i=n.currentPendingValue;if(t)t(r>=0||""!==i?r:this._getFirstSelectedIndex());else if(this._selectedElement.current&&this._selectedElement.current.offsetParent)if(o)this._selectedElement.current.offsetParent.scrollIntoView(!0);else{var a=!0;if(this._comboBoxMenu.current&&this._comboBoxMenu.current.offsetParent){var s=this._comboBoxMenu.current.offsetParent.getBoundingClientRect(),l=this._selectedElement.current.offsetParent.getBoundingClientRect();if(s.top<=l.top&&s.top+s.height>=l.top+l.height)return;s.top+s.height<=l.top+l.height&&(a=!1)}this._selectedElement.current.offsetParent.scrollIntoView(a)}},t.prototype._onItemClick=function(e){var t=this,o=this.props.onItemClick,n=e.index;return function(r){t.props.multiSelect||(t._autofill.current&&t._autofill.current.focus(),t.setState({isOpen:!1})),o&&o(r,e,n),t._setSelectedIndex(n,r)}},t.prototype._resetSelectedIndex=function(){var e=this.props.hoisted.currentOptions;this._clearPendingInfo();var t=this._getFirstSelectedIndex();t>0&&t<e.length?this.props.hoisted.setSuggestedDisplayValue(e[t].text):this.props.text&&this.props.hoisted.setSuggestedDisplayValue(this.props.text)},t.prototype._clearPendingInfo=function(){this._processingClearPendingInfo=!0,this.props.hoisted.setSuggestedDisplayValue(void 0),this.setState({currentPendingValue:void 0,currentPendingValueValidIndex:-1,currentPendingValueValidIndexOnHover:qg.default},this._onAfterClearPendingInfo)},t.prototype._setPendingInfo=function(e,t,o){void 0===t&&(t=-1),this._processingClearPendingInfo||(this.props.hoisted.setSuggestedDisplayValue(o),this.setState({currentPendingValue:pf(e),currentPendingValueValidIndex:t,currentPendingValueValidIndexOnHover:qg.default}))},t.prototype._setPendingInfoFromIndex=function(e){var t=this.props.hoisted.currentOptions;if(e>=0&&e<t.length){var o=t[e];this._setPendingInfo(gf(o),e,gf(o))}else this._clearPendingInfo()},t.prototype._setPendingInfoFromIndexAndDirection=function(e,t){var o=this.props.hoisted.currentOptions;t===jg.forward&&e>=o.length-1?e=-1:t===jg.backward&&e<=0&&(e=o.length);var n=this._getNextSelectableIndex(e,t);e===n?t===jg.forward?e=this._getNextSelectableIndex(-1,t):t===jg.backward&&(e=this._getNextSelectableIndex(o.length,t)):e=n,hf(o,e)&&this._setPendingInfoFromIndex(e)},t.prototype._notifyPendingValueChanged=function(e){var t=this.props.onPendingValueChanged;if(t){var o=this.props.hoisted.currentOptions,n=this.state,r=n.currentPendingValue,i=n.currentPendingValueValidIndex,a=n.currentPendingValueValidIndexOnHover,s=void 0,l=void 0;a!==e.currentPendingValueValidIndexOnHover&&hf(o,a)?s=a:i!==e.currentPendingValueValidIndex&&hf(o,i)?s=i:r!==e.currentPendingValue&&(l=r),(void 0!==s||void 0!==l||this._hasPendingValue)&&(t(void 0!==s?o[s]:void 0,s,l),this._hasPendingValue=void 0!==s||void 0!==l)}},t.prototype._setOpenStateAndFocusOnClose=function(e,t){this._focusInputAfterClose=t,this.setState({isOpen:e})},t.prototype._onOptionMouseEnter=function(e){this._shouldIgnoreMouseEvent()||this.setState({currentPendingValueValidIndexOnHover:e})},t.prototype._onOptionMouseMove=function(e){this._gotMouseMove=!0,this._isScrollIdle&&this.state.currentPendingValueValidIndexOnHover!==e&&this.setState({currentPendingValueValidIndexOnHover:e})},t.prototype._shouldIgnoreMouseEvent=function(){return!this._isScrollIdle||!this._gotMouseMove},t.prototype._handleInputWhenDisabled=function(e){this.props.disabled&&(this.state.isOpen&&this.setState({isOpen:!1}),null!==e&&e.which!==Un.tab&&e.which!==Un.escape&&(e.which<112||e.which>123)&&(e.stopPropagation(),e.preventDefault()))},t.prototype._handleTouchAndPointerEvent=function(){var e=this;void 0!==this._lastTouchTimeoutId&&(this._async.clearTimeout(this._lastTouchTimeoutId),this._lastTouchTimeoutId=void 0),this._processingTouch=!0,this._lastTouchTimeoutId=this._async.setTimeout((function(){e._processingTouch=!1,e._lastTouchTimeoutId=void 0}),500)},t.prototype._getCaretButtonStyles=function(){var e=this.props.caretDownButtonStyles;return $g(this.props.theme,e)},t.prototype._getCurrentOptionStyles=function(e){var t=this.props.comboBoxOptionStyles,o=e.styles;return Jg(this.props.theme,t,o,this._isPendingOption(e),e.hidden,this._isOptionSelected(e.index))},t.prototype._getAriaActiveDescendantValue=function(){var e=this.props.hoisted.selectedIndices,t=this.state,o=t.isOpen,n=t.currentPendingValueValidIndex,r=o&&(null==e?void 0:e.length)?this._id+"-list"+e[0]:void 0;return o&&this._hasFocus()&&-1!==n&&(r=this._id+"-list"+n),r},t.prototype._getAriaAutoCompleteValue=function(){return this.props.disabled||"on"!==this.props.autoComplete?"none":this.props.allowFreeform?"inline":"both"},t.prototype._isPendingOption=function(e){return e&&e.index===this.state.currentPendingValueValidIndex},t.prototype._hasFocus=function(){return"none"!==this.state.focusState},h([Vu("ComboBox",["theme","styles"],!0)],t)}(f.Component);function uf(e,t){if(!e||!t)return[];var o={};e.forEach((function(e,t){e.selected&&(o[t]=!0)}));for(var n=function(t){var n=ia(e,(function(e){return e.key===t}));n>-1&&(o[n]=!0)},r=0,i=t;r<i.length;r++)n(i[r]);return Object.keys(o).map(Number).sort()}function df(e){return void 0===e?[]:e instanceof Array?e:[e]}function pf(e){return e||""}function hf(e,t){return!!e&&t>=0&&t<e.length}function mf(e){return e.itemType!==Gg.Header&&e.itemType!==Gg.Divider}function gf(e){return e.useAriaLabelAsText&&e.ariaLabel?e.ariaLabel:e.text}function ff(e){return e.which===Un.alt||"Meta"===e.key}var vf={auto:0,top:1,bottom:2,center:3},bf={top:-1,bottom:-1,left:-1,right:-1,width:0,height:0},yf=function(e){return e.getBoundingClientRect()},_f=yf,Cf=yf,Sf=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._surface=f.createRef(),o._pageRefs={},o._getDerivedStateFromProps=function(e,t){return e.items!==o.props.items||e.renderCount!==o.props.renderCount||e.startIndex!==o.props.startIndex||e.version!==o.props.version?(o._resetRequiredWindows(),o._requiredRect=null,o._measureVersion++,o._invalidatePageCache(),o._updatePages(e,t)):t},o._onRenderRoot=function(e){var t=e.rootRef,o=e.surfaceElement,n=e.divProps;return f.createElement("div",d({ref:t},n),o)},o._onRenderSurface=function(e){var t=e.surfaceRef,o=e.pageElements,n=e.divProps;return f.createElement("div",d({ref:t},n),o)},o._onRenderPage=function(e,t){for(var n=o.props,r=n.onRenderCell,i=n.role,a=e.page,s=a.items,l=void 0===s?[]:s,c=a.startIndex,u=p(e,["page"]),h=void 0===i?"listitem":"presentation",m=[],g=0;g<l.length;g++){var v=c+g,b=l[g],y=o.props.getKey?o.props.getKey(b,v):b&&b.key;null==y&&(y=v),m.push(f.createElement("div",{role:h,className:"ms-List-cell",key:y,"data-list-index":v,"data-automationid":"ListCell"},r&&r(b,v,o.props.ignoreScrollingState?void 0:o.state.isScrolling)))}return f.createElement("div",d({},u),m)},Ui(o),o.state={pages:[],isScrolling:!1,getDerivedStateFromProps:o._getDerivedStateFromProps},o._async=new Zi(o),o._events=new Os(o),o._estimatedPageHeight=0,o._totalEstimates=0,o._requiredWindowsAhead=0,o._requiredWindowsBehind=0,o._measureVersion=0,o._onAsyncScroll=o._async.debounce(o._onAsyncScroll,100,{leading:!1,maxWait:500}),o._onAsyncIdle=o._async.debounce(o._onAsyncIdle,200,{leading:!1}),o._onAsyncResize=o._async.debounce(o._onAsyncResize,16,{leading:!1}),o._onScrollingDone=o._async.debounce(o._onScrollingDone,500,{leading:!1}),o._cachedPageHeights={},o._estimatedPageHeight=0,o._focusedIndex=-1,o._pageCache={},o}return u(t,e),t.getDerivedStateFromProps=function(e,t){return t.getDerivedStateFromProps(e,t)},Object.defineProperty(t.prototype,"pageRefs",{get:function(){return this._pageRefs},enumerable:!1,configurable:!0}),t.prototype.scrollToIndex=function(e,t,o){void 0===o&&(o=vf.auto);for(var n=this.props.startIndex,r=n+this._getRenderCount(),i=this._allowedRect,a=0,s=1,l=n;l<r;l+=s){var c=this._getPageSpecification(l,i),u=c.height;if(s=c.itemCount,l<=e&&l+s>e){if(t&&this._scrollElement){for(var d=Cf(this._scrollElement),p={top:this._scrollElement.scrollTop,bottom:this._scrollElement.scrollTop+d.height},h=e-l,m=0;m<h;++m)a+=t(l+m);var g=a+t(e);switch(o){case vf.top:return void(this._scrollElement.scrollTop=a);case vf.bottom:return void(this._scrollElement.scrollTop=g-d.height);case vf.center:return void(this._scrollElement.scrollTop=(a+g-d.height)/2);case vf.auto:}if(a>=p.top&&g<=p.bottom)return;a<p.top||g>p.bottom&&(a=g-d.height)}return void(this._scrollElement&&(this._scrollElement.scrollTop=a))}a+=u}},t.prototype.getStartItemIndexInView=function(e){for(var t=0,o=this.state.pages||[];t<o.length;t++){var n=o[t];if(!n.isSpacer&&(this._scrollTop||0)>=n.top&&(this._scrollTop||0)<=n.top+n.height){if(!e){var r=Math.floor(n.height/n.itemCount);return n.startIndex+Math.floor((this._scrollTop-n.top)/r)}for(var i=0,a=n.startIndex;a<n.startIndex+n.itemCount;a++){if(r=e(a),n.top+i<=this._scrollTop&&this._scrollTop<n.top+i+r)return a;i+=r}}}return 0},t.prototype.componentDidMount=function(){this.setState(this._updatePages(this.props,this.state)),this._measureVersion++,this._scrollElement=es(this._root.current),this._events.on(window,"resize",this._onAsyncResize),this._root.current&&this._events.on(this._root.current,"focus",this._onFocus,!0),this._scrollElement&&(this._events.on(this._scrollElement,"scroll",this._onScroll),this._events.on(this._scrollElement,"scroll",this._onAsyncScroll))},t.prototype.componentDidUpdate=function(){var e=this.props,t=this.state;e.getPageHeight?this._onAsyncIdle():this._updatePageMeasurements(t.pages)?(this._materializedRect=null,this._hasCompletedFirstRender?this._onAsyncScroll():(this._hasCompletedFirstRender=!0,this.setState(this._updatePages(e,t)))):this._onAsyncIdle(),e.onPagesUpdated&&e.onPagesUpdated(t.pages)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose(),delete this._scrollElement},t.prototype.shouldComponentUpdate=function(e,t){var o=this.state.pages,n=t.pages,r=!1;if(!t.isScrolling&&this.state.isScrolling)return!0;if(e.version!==this.props.version)return!0;if(e.items===this.props.items&&o.length===n.length)for(var i=0;i<o.length;i++){var a=o[i],s=n[i];if(a.key!==s.key||a.itemCount!==s.itemCount){r=!0;break}}else r=!0;return r},t.prototype.forceUpdate=function(){this._invalidatePageCache(),this._updateRenderRects(this.props,this.state,!0),this.setState(this._updatePages(this.props,this.state)),this._measureVersion++,e.prototype.forceUpdate.call(this)},t.prototype.getTotalListHeight=function(){return this._surfaceRect.height},t.prototype.render=function(){for(var e=this.props,t=e.className,o=e.role,n=void 0===o?"list":o,r=e.onRenderSurface,i=e.onRenderRoot,a=this.state.pages,s=void 0===a?[]:a,l=[],c=Tr(this.props,Dr),u=0,p=s;u<p.length;u++){var h=p[u];l.push(this._renderPage(h))}var m=r?Wh(r,this._onRenderSurface):this._onRenderSurface;return(i?Wh(i,this._onRenderRoot):this._onRenderRoot)({rootRef:this._root,pages:s,surfaceElement:m({surfaceRef:this._surface,pages:s,pageElements:l,divProps:{role:"presentation",className:"ms-List-surface"}}),divProps:d(d({},c),{className:qr("ms-List",t),role:l.length>0?n:void 0})})},t.prototype._shouldVirtualize=function(e){void 0===e&&(e=this.props);var t=e.onShouldVirtualize;return!t||t(e)},t.prototype._invalidatePageCache=function(){this._pageCache={}},t.prototype._renderPage=function(e){var t,o=this,n=this.props.usePageCache;if(n&&(t=this._pageCache[e.key])&&t.pageElement)return t.pageElement;var r=this._getPageStyle(e),i=this.props.onRenderPage,a=(void 0===i?this._onRenderPage:i)({page:e,className:"ms-List-page",key:e.key,ref:function(t){o._pageRefs[e.key]=t},style:r,role:"presentation"},this._onRenderPage);return n&&0===e.startIndex&&(this._pageCache[e.key]={page:e,pageElement:a}),a},t.prototype._getPageStyle=function(e){var t=this.props.getPageStyle;return d(d({},t?t(e):{}),e.items?{}:{height:e.height})},t.prototype._onFocus=function(e){for(var t=e.target;t!==this._surface.current;){var o=t.getAttribute("data-list-index");if(o){this._focusedIndex=Number(o);break}t=ba(t)}},t.prototype._onScroll=function(){this.state.isScrolling||this.props.ignoreScrollingState||this.setState({isScrolling:!0}),this._resetRequiredWindows(),this._onScrollingDone()},t.prototype._resetRequiredWindows=function(){this._requiredWindowsAhead=0,this._requiredWindowsBehind=0},t.prototype._onAsyncScroll=function(){var e,t;this._updateRenderRects(this.props,this.state),this._materializedRect&&(e=this._requiredRect,t=this._materializedRect,e.top>=t.top&&e.left>=t.left&&e.bottom<=t.bottom&&e.right<=t.right)||this.setState(this._updatePages(this.props,this.state))},t.prototype._onAsyncIdle=function(){var e=this.props,t=e.renderedWindowsAhead,o=e.renderedWindowsBehind,n=this._requiredWindowsAhead,r=this._requiredWindowsBehind,i=Math.min(t,n+1),a=Math.min(o,r+1);i===n&&a===r||(this._requiredWindowsAhead=i,this._requiredWindowsBehind=a,this._updateRenderRects(this.props,this.state),this.setState(this._updatePages(this.props,this.state))),(t>i||o>a)&&this._onAsyncIdle()},t.prototype._onScrollingDone=function(){this.props.ignoreScrollingState||this.setState({isScrolling:!1})},t.prototype._onAsyncResize=function(){this.forceUpdate()},t.prototype._updatePages=function(e,t){this._requiredRect||this._updateRenderRects(e,t);var o=this._buildPages(e,t),n=t.pages;return this._notifyPageChanges(n,o.pages,this.props),d(d({},t),o)},t.prototype._notifyPageChanges=function(e,t,o){var n=o.onPageAdded,r=o.onPageRemoved;if(n||r){for(var i={},a=0,s=e;a<s.length;a++)(u=s[a]).items&&(i[u.startIndex]=u);for(var l=0,c=t;l<c.length;l++){var u;(u=c[l]).items&&(i[u.startIndex]?delete i[u.startIndex]:this._onPageAdded(u))}for(var d in i)i.hasOwnProperty(d)&&this._onPageRemoved(i[d])}},t.prototype._updatePageMeasurements=function(e){var t=!1;if(!this._shouldVirtualize())return t;for(var o=0;o<e.length;o++){var n=e[o];n.items&&(t=this._measurePage(n)||t)}return t},t.prototype._measurePage=function(e){var t=!1,o=this._pageRefs[e.key],n=this._cachedPageHeights[e.startIndex];if(o&&this._shouldVirtualize()&&(!n||n.measureVersion!==this._measureVersion)){var r={width:o.clientWidth,height:o.clientHeight};(r.height||r.width)&&(t=e.height!==r.height,e.height=r.height,this._cachedPageHeights[e.startIndex]={height:r.height,measureVersion:this._measureVersion},this._estimatedPageHeight=Math.round((this._estimatedPageHeight*this._totalEstimates+r.height)/(this._totalEstimates+1)),this._totalEstimates++)}return t},t.prototype._onPageAdded=function(e){var t=this.props.onPageAdded;t&&t(e)},t.prototype._onPageRemoved=function(e){var t=this.props.onPageRemoved;t&&t(e)},t.prototype._buildPages=function(e,t){var o=e.renderCount,n=e.items,r=e.startIndex,i=e.getPageHeight;o=this._getRenderCount(e);for(var a=d({},bf),s=[],l=1,c=0,u=null,p=this._focusedIndex,h=r+o,m=this._shouldVirtualize(e),g=0===this._estimatedPageHeight&&!i,f=this._allowedRect,v=function(e){var o=b._getPageSpecification(e,f),i=o.height,d=o.data,v=o.key;l=o.itemCount;var y,_,C=c+i-1,S=ia(t.pages,(function(t){return!!t.items&&t.startIndex===e}))>-1,x=!f||C>=f.top&&c<=f.bottom,k=!b._requiredRect||C>=b._requiredRect.top&&c<=b._requiredRect.bottom;if(!g&&(k||x&&S)||!m||p>=e&&p<e+l||e===r){u&&(s.push(u),u=null);var w=Math.min(l,h-e),I=b._createPage(v,n.slice(e,e+w),e,void 0,void 0,d);I.top=c,I.height=i,b._visibleRect&&b._visibleRect.bottom&&(I.isVisible=C>=b._visibleRect.top&&c<=b._visibleRect.bottom),s.push(I),k&&b._allowedRect&&(y=a,_={top:c,bottom:C,height:i,left:f.left,right:f.right,width:f.width},y.top=_.top<y.top||-1===y.top?_.top:y.top,y.left=_.left<y.left||-1===y.left?_.left:y.left,y.bottom=_.bottom>y.bottom||-1===y.bottom?_.bottom:y.bottom,y.right=_.right>y.right||-1===y.right?_.right:y.right,y.width=y.right-y.left+1,y.height=y.bottom-y.top+1)}else u||(u=b._createPage("spacer-"+e,void 0,e,0,void 0,d,!0)),u.height=(u.height||0)+(C-c)+1,u.itemCount+=l;if(c+=C-c+1,g&&m)return"break"},b=this,y=r;y<h&&"break"!==v(y);y+=l);return u&&(u.key="spacer-end",s.push(u)),this._materializedRect=a,d(d({},t),{pages:s,measureVersion:this._measureVersion})},t.prototype._getPageSpecification=function(e,t){var o=this.props.getPageSpecification;if(o){var n=o(e,t),r=n.itemCount,i=void 0===r?this._getItemCountForPage(e,t):r,a=n.height;return{itemCount:i,height:void 0===a?this._getPageHeight(e,t,i):a,data:n.data,key:n.key}}return{itemCount:i=this._getItemCountForPage(e,t),height:this._getPageHeight(e,t,i)}},t.prototype._getPageHeight=function(e,t,o){if(this.props.getPageHeight)return this.props.getPageHeight(e,t,o);var n=this._cachedPageHeights[e];return n?n.height:this._estimatedPageHeight||30},t.prototype._getItemCountForPage=function(e,t){return(this.props.getItemCountForPage?this.props.getItemCountForPage(e,t):10)||10},t.prototype._createPage=function(e,t,o,n,r,i,a){void 0===o&&(o=-1),void 0===n&&(n=t?t.length:0),void 0===r&&(r={}),e=e||"page-"+o;var s=this._pageCache[e];return s&&s.page?s.page:{key:e,startIndex:o,itemCount:n,items:t,style:r,top:0,height:0,data:i,isSpacer:a||!1}},t.prototype._getRenderCount=function(e){var t=e||this.props,o=t.items,n=t.startIndex,r=t.renderCount;return void 0===r?o?o.length-n:0:r},t.prototype._updateRenderRects=function(e,t,o){var n=e.renderedWindowsAhead,r=e.renderedWindowsBehind,i=t.pages;if(this._shouldVirtualize(e)){var a=this._surfaceRect||d({},bf),s=this._scrollElement&&this._scrollElement.scrollHeight,l=this._scrollElement?this._scrollElement.scrollTop:0;this._surface.current&&(o||!i||!this._surfaceRect||!s||s!==this._scrollHeight||Math.abs(this._scrollTop-l)>this._estimatedPageHeight/3)&&(a=this._surfaceRect=_f(this._surface.current),this._scrollTop=l),!o&&s&&s===this._scrollHeight||this._measureVersion++,this._scrollHeight=s||0;var c=Math.max(0,-a.top),u=at(this._root.current),p={top:c,left:a.left,bottom:c+u.innerHeight,right:a.right,width:a.width,height:u.innerHeight};this._requiredRect=xf(p,this._requiredWindowsBehind,this._requiredWindowsAhead),this._allowedRect=xf(p,r,n),this._visibleRect=p}},t.defaultProps={startIndex:0,onRenderCell:function(e,t,o){return f.createElement(f.Fragment,null,e&&e.name||"")},renderedWindowsAhead:2,renderedWindowsBehind:2},t}(f.Component);function xf(e,t,o){var n=e.top-t*e.height,r=e.height+(t+o)*e.height;return{top:n,bottom:n+r,height:r,left:e.left,right:e.right,width:e.width}}var kf=function(e){function t(t){var o=e.call(this,t)||this;return o._comboBox=f.createRef(),o._list=f.createRef(),o._onRenderList=function(e){var t=e.id,n=e.onRenderItem;return f.createElement(Sf,{componentRef:o._list,role:"listbox",id:t+"-list","aria-labelledby":t+"-label",items:e.options,onRenderCell:n?function(e){return n(e)}:function(){return null}})},o._onScrollToItem=function(e){o._list.current&&o._list.current.scrollToIndex(e)},Ui(o),o}return u(t,e),Object.defineProperty(t.prototype,"selectedOptions",{get:function(){return this._comboBox.current?this._comboBox.current.selectedOptions:[]},enumerable:!1,configurable:!0}),t.prototype.dismissMenu=function(){if(this._comboBox.current)return this._comboBox.current.dismissMenu()},t.prototype.focus=function(e,t){return!!this._comboBox.current&&(this._comboBox.current.focus(e,t),!0)},t.prototype.render=function(){return f.createElement(lf,d({},this.props,{componentRef:this._comboBox,onRenderList:this._onRenderList,onScrollToItem:this._onScrollToItem}))},t}(f.Component),wf=qo((function(e){var t=e;return qo((function(o){if(e===o)throw new Error("Attempted to compose a component with itself.");var n=o,r=qo((function(e){return function(t){return f.createElement(n,d({},t,{defaultRender:e}))}}));return function(e){var o=e.defaultRender;return f.createElement(t,d({},e,{defaultRender:o?r(o):n}))}}))}));function If(e,t){return wf(e)(t)}var Df=function(e,t,o){for(var n=0,r=e;n<r.length;n++){var i=r[n];o[t.register(i,!0)]=i}},Tf=function(e,t){for(var o=0,n=Object.keys(t);o<n.length;o++){var r=n[o];e.unregister(t[r],r,!0),delete t[r]}},Ef=function(e){var t=Zc.getInstance(),o=e.className,n=e.overflowItems,r=e.keytipSequences,i=e.itemSubMenuProvider,a=e.onRenderOverflowButton,s=Ei({}),l=f.useCallback((function(e){return i?i(e):e.subMenuProps?e.subMenuProps.items:void 0}),[i]),c=f.useMemo((function(){var e=[],o=[];return r?null==n||n.forEach((function(n){var i,a=n.keytipProps;if(a){var s={content:a.content,keySequences:a.keySequences,disabled:a.disabled||!(!n.disabled&&!n.isDisabled),hasDynamicChildren:a.hasDynamicChildren,hasMenu:a.hasMenu};a.hasDynamicChildren||l(n)?s.onExecute=t.menuExecute.bind(t,r,null===(i=null==n?void 0:n.keytipProps)||void 0===i?void 0:i.keySequences):s.onExecute=a.onExecute,e.push(s);var c=d(d({},n),{keytipProps:d(d({},a),{overflowSetSequence:r})});null==o||o.push(c)}else null==o||o.push(n)})):o=n,{modifiedOverflowItems:o,keytipsToRegister:e}}),[n,l,t,r]),u=c.modifiedOverflowItems;return function(e,t,o){var n=Ti(e);f.useEffect((function(){n&&(Tf(o,n),Df(t,o,e))})),f.useEffect((function(){return Df(t,o,e),function(){Tf(o,e)}}),[])}(s,c.keytipsToRegister,t),f.createElement("div",{className:o},a(u))},Pf=Jn(),Mf=f.forwardRef((function(e,t){var o=f.useRef(null),n=Or(o,t);!function(e,t){f.useImperativeHandle(e.componentRef,(function(){return{focus:function(){var e=!1;return t.current&&(e=Ia(t.current)),e},focusElement:function(e){var o=!1;return!!e&&(t.current&&Ca(t.current,e)&&(e.focus(),o=document.activeElement===e),o)}}}),[t])}(e,o);var r=e.items,i=e.overflowItems,a=e.className,s=e.styles,l=e.vertical,c=e.role,u=e.overflowSide,p=void 0===u?"end":u,h=e.onRenderItem,m=Pf(s,{className:a,vertical:l}),g=!!i&&i.length>0;return f.createElement("div",d({},Tr(e,Dr),{role:c||"group","aria-orientation":"menubar"===c?!0===l?"vertical":"horizontal":void 0,className:m.root,ref:n}),"start"===p&&g&&f.createElement(Ef,d({},e,{className:m.overflowButton})),r&&r.map((function(e,t){return f.createElement("div",{className:m.item,key:e.key,role:"none"},h(e))})),"end"===p&&g&&f.createElement(Ef,d({},e,{className:m.overflowButton})))}));Mf.displayName="OverflowSet";var Rf={flexShrink:0,display:"inherit"},Nf=Vn(Mf,(function(e){var t=e.className;return{root:["ms-OverflowSet",{position:"relative",display:"flex",flexWrap:"nowrap"},e.vertical&&{flexDirection:"column"},t],item:["ms-OverflowSet-item",Rf],overflowButton:["ms-OverflowSet-overflowButton",Rf]}}),void 0,{scope:"OverflowSet"}),Bf=jo((function(e){var t={height:"100%"},o={whiteSpace:"nowrap"},n=e||{},r=n.root,i=n.label,a=p(n,["root","label"]);return d(d({},a),{root:r?[t,r]:t,label:i?[o,i]:o})})),Ff=Jn(),Af=function(e){function t(t){var o=e.call(this,t)||this;return o._overflowSet=f.createRef(),o._resizeGroup=f.createRef(),o._onRenderData=function(e){var t=o.props,n=t.ariaLabel,r=t.primaryGroupAriaLabel,i=t.farItemsGroupAriaLabel,a=e.farItems&&e.farItems.length>0;return f.createElement(vs,{className:qr(o._classNames.root),direction:$i.horizontal,role:"menubar","aria-label":n},f.createElement(Nf,{role:a?"group":"none","aria-label":a?r:void 0,componentRef:o._overflowSet,className:qr(o._classNames.primarySet),items:e.primaryItems,overflowItems:e.overflowItems.length?e.overflowItems:void 0,onRenderItem:o._onRenderItem,onRenderOverflowButton:o._onRenderOverflowButton}),a&&f.createElement(Nf,{role:"group","aria-label":i,className:qr(o._classNames.secondarySet),items:e.farItems,onRenderItem:o._onRenderItem,onRenderOverflowButton:Vs}))},o._onRenderItem=function(e){if(e.onRender)return e.onRender(e,(function(){}));var t=e.text||e.name,n=d(d({allowDisabledFocus:!0,role:"menuitem"},e),{styles:Bf(e.buttonStyles),className:qr("ms-CommandBarItem-link",e.className),text:e.iconOnly?void 0:t,menuProps:e.subMenuProps,onClick:o._onButtonClick(e)});return e.iconOnly&&(void 0!==t||e.tooltipHostProps)?f.createElement(bd,d({role:"none",content:t,setAriaDescribedBy:!1},e.tooltipHostProps),o._commandButton(e,n)):o._commandButton(e,n)},o._commandButton=function(e,t){var n=o.props.buttonAs,r=e.commandBarButtonAs,i=Od;return r&&(i=If(r,i)),n&&(i=If(n,i)),f.createElement(i,d({},t))},o._onRenderOverflowButton=function(e){var t=o.props.overflowButtonProps,n=void 0===t?{}:t,r=m(n.menuProps?n.menuProps.items:[],e),i=d(d({role:"menuitem"},n),{styles:d({menuIcon:{fontSize:"17px"}},n.styles),className:qr("ms-CommandBar-overflowButton",n.className),menuProps:d(d({},n.menuProps),{items:r}),menuIconProps:d({iconName:"More"},n.menuIconProps)}),a=o.props.overflowButtonAs?If(o.props.overflowButtonAs,Od):Od;return f.createElement(a,d({},i))},o._onReduceData=function(e){var t=o.props,n=t.shiftOnReduce,r=t.onDataReduced,i=e.primaryItems,a=e.overflowItems,s=e.cacheKey,l=i[n?0:i.length-1];if(void 0!==l){l.renderedInOverflow=!0,a=m([l],a),i=n?i.slice(1):i.slice(0,-1);var c=d(d({},e),{primaryItems:i,overflowItems:a});return s=o._computeCacheKey({primaryItems:i,overflow:a.length>0}),r&&r(l),c.cacheKey=s,c}},o._onGrowData=function(e){var t=o.props,n=t.shiftOnReduce,r=t.onDataGrown,i=e.minimumOverflowItems,a=e.primaryItems,s=e.overflowItems,l=e.cacheKey,c=s[0];if(void 0!==c&&s.length>i){c.renderedInOverflow=!1,s=s.slice(1),a=n?m([c],a):m(a,[c]);var u=d(d({},e),{primaryItems:a,overflowItems:s});return l=o._computeCacheKey({primaryItems:a,overflow:s.length>0}),r&&r(c),u.cacheKey=l,u}},Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.items,o=e.overflowItems,n=e.farItems,r=e.styles,i=e.theme,a=e.dataDidRender,s=e.onReduceData,l=void 0===s?this._onReduceData:s,c=e.onGrowData,u=void 0===c?this._onGrowData:c,p=e.resizeGroupAs,h=void 0===p?id:p,g={primaryItems:m(t),overflowItems:m(o),minimumOverflowItems:m(o).length,farItems:n,cacheKey:this._computeCacheKey({primaryItems:m(t),overflow:o&&o.length>0})};this._classNames=Ff(r,{theme:i});var v=Tr(this.props,Dr);return f.createElement(h,d({},v,{componentRef:this._resizeGroup,data:g,onReduceData:l,onGrowData:u,onRenderData:this._onRenderData,dataDidRender:a}))},t.prototype.focus=function(){var e=this._overflowSet.current;e&&e.focus()},t.prototype.remeasure=function(){this._resizeGroup.current&&this._resizeGroup.current.remeasure()},t.prototype._onButtonClick=function(e){return function(t){e.inactive||e.onClick&&e.onClick(t,e)}},t.prototype._computeCacheKey=function(e){var t=e.primaryItems,o=e.overflow;return[t&&t.reduce((function(e,t){var o=t.cacheKey;return e+(void 0===o?t.key:o)}),""),o?"overflow":""].join("")},t.defaultProps={items:[],overflowItems:[]},t}(f.Component),Lf=Vn(Af,(function(e){var t=e.className,o=e.theme,n=o.semanticColors;return{root:[o.fonts.medium,"ms-CommandBar",{display:"flex",backgroundColor:n.bodyBackground,padding:"0 14px 0 24px",height:44},t],primarySet:["ms-CommandBar-primaryCommand",{flexGrow:"1",display:"flex",alignItems:"stretch"}],secondarySet:["ms-CommandBar-secondaryCommand",{flexShrink:"0",display:"flex",alignItems:"stretch"}]}}),void 0,{scope:"CommandBar"}),Hf=d(d({},Yp),{prevMonthAriaLabel:"Go to previous month",nextMonthAriaLabel:"Go to next month",prevYearAriaLabel:"Go to previous year",nextYearAriaLabel:"Go to next year",closeButtonAriaLabel:"Close date picker",isRequiredErrorMessage:"Field is required",invalidInputErrorMessage:"Invalid date format",isResetStatusMessage:'Invalid entry "{0}", date reset to "{1}"'}),Of=Jn(),zf={allowTextInput:!1,formatDate:function(e){return e?e.toDateString():""},parseDateFromString:function(e){var t=Date.parse(e);return t?new Date(t):null},firstDayOfWeek:jd.Sunday,initialPickerDate:new Date,isRequired:!1,isMonthPickerVisible:!0,showMonthPickerAsOverlay:!1,strings:Hf,highlightCurrentMonth:!1,highlightSelectedMonth:!1,borderless:!1,pickerAriaLabel:"Calendar",showWeekNumbers:!1,firstWeekOfYear:Yd.FirstDay,showGoToToday:!0,showCloseButton:!1,underlined:!1,allFocusable:!1},Wf=f.forwardRef((function(e,t){var o=tr(zf,e),n=o.firstDayOfWeek,r=o.strings,i=o.label,a=o.theme,s=o.className,l=o.styles,c=o.initialPickerDate,u=o.isRequired,p=o.disabled,h=o.ariaLabel,m=o.pickerAriaLabel,g=o.placeholder,v=o.allowTextInput,b=o.borderless,y=o.minDate,_=o.maxDate,C=o.showCloseButton,S=o.calendarProps,x=o.calloutProps,k=o.textField,w=o.underlined,I=o.allFocusable,D=o.calendarAs,T=void 0===D?Ch:D,E=o.tabIndex,P=o.disableAutoFocus,M=void 0===P||P,R=Kd("DatePicker",o.id),N=Kd("DatePicker-Callout"),B=f.useRef(null),F=f.useRef(null),A=function(){var e=f.useRef(null),t=f.useRef(!1);return[e,function(){var t,o;null===(o=null===(t=e.current)||void 0===t?void 0:t.focus)||void 0===o||o.call(t)},t,function(){t.current=!0}]}(),L=A[0],H=A[1],O=A[2],z=A[3],W=function(e,t){var o=e.allowTextInput,n=e.onAfterMenuDismiss,r=f.useState(!1),i=r[0],a=r[1],s=f.useRef(!1),l=Al();return f.useEffect((function(){s.current&&!i&&(o&&l.requestAnimationFrame(t),null==n||n()),s.current=!0}),[i]),[i,a]}(o,H),V=W[0],K=W[1],U=function(e){var t=e.formatDate,o=e.value,n=e.onSelectDate,r=gh(o,void 0,(function(e,t){return null==n?void 0:n(t)})),i=r[0],a=r[1],s=f.useState((function(){return o&&t?t(o):""})),l=s[0],c=s[1];return f.useEffect((function(){c(o&&t?t(o):"")}),[t,o]),[i,l,function(e){a(e),c(e&&t?t(e):"")},c]}(o),G=U[0],j=U[1],q=U[2],Y=U[3],Z=function(e,t,o,n,r){var i=e.isRequired,a=e.allowTextInput,s=e.strings,l=e.parseDateFromString,c=e.onSelectDate,u=e.formatDate,d=e.minDate,p=e.maxDate,h=f.useState(),m=h[0],g=h[1],v=f.useState(),b=v[0],y=v[1];return f.useEffect((function(){i&&!t?g(s.isRequiredErrorMessage||" "):t&&Vf(t,d,p)?g(s.isOutOfBoundsErrorMessage||" "):g(void 0)}),[d&&yp(d),p&&yp(p),t&&yp(t),i]),[r?void 0:m,function(e){if(void 0===e&&(e=null),a)if(n||e){if(t&&!m&&u&&u(null!=e?e:t)===n)return;if(!(e=e||l(n))||isNaN(e.getTime())){o(t);var r=u?u(t):"",h=s.isResetStatusMessage?wp(s.isResetStatusMessage,n,r):s.invalidInputErrorMessage||"";y(h)}else Vf(e,d,p)?g(s.isOutOfBoundsErrorMessage||" "):(o(e),g(void 0),y(void 0))}else g(i?s.isRequiredErrorMessage||" ":void 0),null==c||c(e);else i&&!n?g(s.isRequiredErrorMessage||" "):(g(void 0),y(void 0))},g,r?void 0:b,y]}(o,G,q,j,V),X=Z[0],Q=Z[1],J=Z[2],$=Z[3],ee=Z[4],te=f.useCallback((function(){V||(z(),K(!0))}),[V,z,K]);f.useImperativeHandle(o.componentRef,(function(){return{focus:H,reset:function(){K(!1),q(void 0),J(void 0),ee(void 0)},showDatePickerPopup:te}}),[H,J,K,q,ee,te]);var oe=function(e){V&&(K(!1),Q(e),!v&&e&&q(e))},ne=function(e){z(),oe(e)},re=Of(l,{theme:a,className:s,disabled:p,label:!!i,isDatePickerShown:V}),ie=Tr(o,Dr,["value"]),ae=k&&k.iconProps,se=k&&k.id&&k.id!==R?k.id:R+"-label";return f.createElement("div",d({},ie,{className:re.root,ref:t}),f.createElement("div",{ref:F,"aria-owns":V?N:void 0,className:re.wrapper},f.createElement(Pg,d({role:"combobox",label:i,"aria-expanded":V,ariaLabel:h,"aria-haspopup":"dialog","aria-controls":V?N:void 0,required:u,disabled:p,errorMessage:X,placeholder:g,borderless:b,value:j,componentRef:L,underlined:w,tabIndex:E,readOnly:!v},k,{id:se,className:qr(re.textField,k&&k.className),iconProps:d(d({iconName:"Calendar"},ae),{className:qr(re.icon,ae&&ae.className),onClick:function(e){e.stopPropagation(),V||o.disabled?o.allowTextInput&&oe():te()}}),onRenderDescription:function(e,t){return f.createElement(f.Fragment,null,e.description?t(e):null,f.createElement("div",{"aria-live":"assertive",className:re.statusMessage},$))},onKeyDown:function(e){switch(e.which){case Un.enter:e.preventDefault(),e.stopPropagation(),V?o.allowTextInput&&oe():(Q(),te());break;case Un.escape:!function(e){e.stopPropagation(),ne()}(e);break;case Un.down:e.altKey&&!V&&te()}},onFocus:function(){M||v||(O.current||te(),O.current=!1)},onBlur:function(e){Q()},onClick:function(e){!o.openOnClick&&o.disableAutoFocus||V||o.disabled?o.allowTextInput&&oe():te()},onChange:function(e,t){var n,r=o.textField;v&&(V&&oe(),Y(t)),null===(n=null==r?void 0:r.onChange)||void 0===n||n.call(r,e,t)}}))),V&&f.createElement(Cc,d({id:N,role:"dialog",ariaLabel:m,isBeakVisible:!1,gapSpace:0,doNotLayer:!1,target:F.current,directionalHint:qs.bottomLeftEdge},x,{className:qr(re.callout,x&&x.className),onDismiss:function(e){ne()},onPositioned:function(){var e=!0;o.calloutProps&&void 0!==o.calloutProps.setInitialFocus&&(e=o.calloutProps.setInitialFocus),B.current&&e&&B.current.focus()}}),f.createElement(xh,{isClickableOutsideFocusTrap:!0,disableFirstFocus:M},f.createElement(T,d({},S,{onSelectDate:function(e){o.calendarProps&&o.calendarProps.onSelectDate&&o.calendarProps.onSelectDate(e),ne(e)},onDismiss:ne,isMonthPickerVisible:o.isMonthPickerVisible,showMonthPickerAsOverlay:o.showMonthPickerAsOverlay,today:o.today,value:G||c,firstDayOfWeek:n,strings:r,highlightCurrentMonth:o.highlightCurrentMonth,highlightSelectedMonth:o.highlightSelectedMonth,showWeekNumbers:o.showWeekNumbers,firstWeekOfYear:o.firstWeekOfYear,showGoToToday:o.showGoToToday,dateTimeFormatter:o.dateTimeFormatter,minDate:y,maxDate:_,componentRef:B,showCloseButton:C,allFocusable:I})))))}));function Vf(e,t,o){return!!t&&dp(t,e)>0||!!o&&dp(o,e)<0}Wf.displayName="DatePickerBase";var Kf,Uf,Gf={root:"ms-DatePicker",callout:"ms-DatePicker-callout",withLabel:"ms-DatePicker-event--with-label",withoutLabel:"ms-DatePicker-event--without-label",disabled:"msDatePickerDisabled "},jf=Vn(Wf,(function(e){var t=e.className,o=e.theme,n=e.disabled,r=e.label,i=e.isDatePickerShown,a=o.palette,s=o.semanticColors,l=o.fonts,c=Qo(Gf,o),u={color:a.neutralSecondary,fontSize:je.icon,lineHeight:"18px",pointerEvents:"none",position:"absolute",right:"4px",padding:"5px"};return{root:[c.root,o.fonts.large,i&&"is-open",on,t],textField:[{position:"relative",selectors:{"& input[readonly]":{cursor:"pointer"},input:{selectors:{"::-ms-clear":{display:"none"}}}}},n&&{selectors:{"& input[readonly]":{cursor:"default"}}}],callout:[c.callout],icon:[u,r?c.withLabel:c.withoutLabel,{paddingTop:"7px"},!n&&[c.disabled,{pointerEvents:"initial",cursor:"pointer"}],n&&{color:s.disabledText,cursor:"default"}],statusMessage:[l.small,{color:s.errorText,marginTop:5}]}}),void 0,{scope:"DatePicker"}),qf="change";!function(e){e[e.none=0]="none",e[e.single=1]="single",e[e.multiple=2]="multiple"}(Kf||(Kf={})),function(e){e[e.horizontal=0]="horizontal",e[e.vertical=1]="vertical"}(Uf||(Uf={}));var Yf=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=e[0]||{},n=o.onSelectionChanged,r=o.getKey,i=o.canSelectItem,a=void 0===i?function(){return!0}:i,s=o.items,l=o.selectionMode,c=void 0===l?Kf.multiple:l;this.mode=c,this._getKey=r||Zf,this._changeEventSuppressionCount=0,this._exemptedCount=0,this._anchoredIndex=0,this._unselectableCount=0,this._onSelectionChanged=n,this._canSelectItem=a,this._isModal=!1,this.setItems(s||[],!0),this.count=this.getSelectedCount()}return e.prototype.canSelectItem=function(e,t){return!("number"==typeof t&&t<0)&&this._canSelectItem(e,t)},e.prototype.getKey=function(e,t){var o=this._getKey(e,t);return"number"==typeof o||o?""+o:""},e.prototype.setChangeEvents=function(e,t){this._changeEventSuppressionCount+=e?-1:1,0===this._changeEventSuppressionCount&&this._hasChanged&&(this._hasChanged=!1,t||this._change())},e.prototype.isModal=function(){return this._isModal},e.prototype.setModal=function(e){this._isModal!==e&&(this.setChangeEvents(!1),this._isModal=e,e||this.setAllSelected(!1),this._change(),this.setChangeEvents(!0))},e.prototype.setItems=function(e,t){void 0===t&&(t=!0);var o={},n={},r=!1;this.setChangeEvents(!1),this._unselectableCount=0;for(var i=0;i<e.length;i++){if(u=e[i]){var a=this.getKey(u,i);a&&(o[a]=i)}n[i]=u&&!this.canSelectItem(u),n[i]&&this._unselectableCount++}(t||0===e.length)&&this._setAllSelected(!1,!0);var s={},l=0;for(var c in this._exemptedIndices)if(this._exemptedIndices.hasOwnProperty(c)){var u,d=Number(c),p=(u=this._items[d])?this.getKey(u,Number(d)):void 0,h=p?o[p]:d;void 0===h?r=!0:(s[h]=!0,l++,r=r||h!==d)}this._items&&0===this._exemptedCount&&e.length!==this._items.length&&this._isAllSelected&&(r=!0),this._exemptedIndices=s,this._exemptedCount=l,this._keyToIndexMap=o,this._unselectableIndices=n,this._items=e,this._selectedItems=null,r&&(this._updateCount(),this._change()),this.setChangeEvents(!0)},e.prototype.getItems=function(){return this._items},e.prototype.getSelection=function(){if(!this._selectedItems){this._selectedItems=[];var e=this._items;if(e)for(var t=0;t<e.length;t++)this.isIndexSelected(t)&&this._selectedItems.push(e[t])}return this._selectedItems},e.prototype.getSelectedCount=function(){return this._isAllSelected?this._items.length-this._exemptedCount-this._unselectableCount:this._exemptedCount},e.prototype.getSelectedIndices=function(){if(!this._selectedIndices){this._selectedIndices=[];var e=this._items;if(e)for(var t=0;t<e.length;t++)this.isIndexSelected(t)&&this._selectedIndices.push(t)}return this._selectedIndices},e.prototype.isRangeSelected=function(e,t){if(0===t)return!1;for(var o=e+t,n=e;n<o;n++)if(!this.isIndexSelected(n))return!1;return!0},e.prototype.isAllSelected=function(){var e=this._items.length-this._unselectableCount;return this.mode===Kf.single&&(e=Math.min(e,1)),this.count>0&&this._isAllSelected&&0===this._exemptedCount||!this._isAllSelected&&this._exemptedCount===e&&e>0},e.prototype.isKeySelected=function(e){var t=this._keyToIndexMap[e];return this.isIndexSelected(t)},e.prototype.isIndexSelected=function(e){return!!(this.count>0&&this._isAllSelected&&!this._exemptedIndices[e]&&!this._unselectableIndices[e]||!this._isAllSelected&&this._exemptedIndices[e])},e.prototype.setAllSelected=function(e){if(!e||this.mode===Kf.multiple){var t=this._items?this._items.length-this._unselectableCount:0;this.setChangeEvents(!1),t>0&&(this._exemptedCount>0||e!==this._isAllSelected)&&(this._exemptedIndices={},(e!==this._isAllSelected||this._exemptedCount>0)&&(this._exemptedCount=0,this._isAllSelected=e,this._change()),this._updateCount()),this.setChangeEvents(!0)}},e.prototype.setKeySelected=function(e,t,o){var n=this._keyToIndexMap[e];n>=0&&this.setIndexSelected(n,t,o)},e.prototype.setIndexSelected=function(e,t,o){if(this.mode!==Kf.none&&!((e=Math.min(Math.max(0,e),this._items.length-1))<0||e>=this._items.length)){this.setChangeEvents(!1);var n=this._exemptedIndices[e];!this._unselectableIndices[e]&&(t&&this.mode===Kf.single&&this._setAllSelected(!1,!0),n&&(t&&this._isAllSelected||!t&&!this._isAllSelected)&&(delete this._exemptedIndices[e],this._exemptedCount--),!n&&(t&&!this._isAllSelected||!t&&this._isAllSelected)&&(this._exemptedIndices[e]=!0,this._exemptedCount++),o&&(this._anchoredIndex=e)),this._updateCount(),this.setChangeEvents(!0)}},e.prototype.selectToKey=function(e,t){this.selectToIndex(this._keyToIndexMap[e],t)},e.prototype.selectToIndex=function(e,t){if(this.mode!==Kf.none)if(this.mode!==Kf.single){var o=this._anchoredIndex||0,n=Math.min(e,o),r=Math.max(e,o);for(this.setChangeEvents(!1),t&&this._setAllSelected(!1,!0);n<=r;n++)this.setIndexSelected(n,!0,!1);this.setChangeEvents(!0)}else this.setIndexSelected(e,!0,!0)},e.prototype.toggleAllSelected=function(){this.setAllSelected(!this.isAllSelected())},e.prototype.toggleKeySelected=function(e){this.setKeySelected(e,!this.isKeySelected(e),!0)},e.prototype.toggleIndexSelected=function(e){this.setIndexSelected(e,!this.isIndexSelected(e),!0)},e.prototype.toggleRangeSelected=function(e,t){if(this.mode!==Kf.none){var o=this.isRangeSelected(e,t),n=e+t;if(!(this.mode===Kf.single&&t>1)){this.setChangeEvents(!1);for(var r=e;r<n;r++)this.setIndexSelected(r,!o,!1);this.setChangeEvents(!0)}}},e.prototype._updateCount=function(e){void 0===e&&(e=!1);var t=this.getSelectedCount();t!==this.count&&(this.count=t,this._change()),this.count||e||this.setModal(!1)},e.prototype._setAllSelected=function(e,t){if(void 0===t&&(t=!1),!e||this.mode===Kf.multiple){var o=this._items?this._items.length-this._unselectableCount:0;this.setChangeEvents(!1),o>0&&(this._exemptedCount>0||e!==this._isAllSelected)&&(this._exemptedIndices={},(e!==this._isAllSelected||this._exemptedCount>0)&&(this._exemptedCount=0,this._isAllSelected=e,this._change()),this._updateCount(t)),this.setChangeEvents(!0)}},e.prototype._change=function(){0===this._changeEventSuppressionCount?(this._selectedItems=null,this._selectedIndices=void 0,Os.raise(this,qf),this._onSelectionChanged&&this._onSelectionChanged()):this._hasChanged=!0},e}();function Zf(e,t){var o=(e||{}).key;return void 0===o?""+t:o}var Xf,Qf,Jf,$f,ev,tv,ov="data-selection-index",nv="data-selection-toggle",rv="data-selection-invoke",iv="data-selection-all-toggle",av=function(e){function t(t){var o=e.call(this,t)||this;o._root=f.createRef(),o.ignoreNextFocus=function(){o._handleNextFocus(!1)},o._onSelectionChange=function(){var e=o.props.selection,t=e.isModal&&e.isModal();o.setState({isModal:t})},o._onMouseDownCapture=function(e){var t=e.target;if(document.activeElement===t||Ca(document.activeElement,t)){if(Ca(t,o._root.current))for(;t!==o._root.current;){if(o._hasAttribute(t,rv)){o.ignoreNextFocus();break}t=ba(t)}}else o.ignoreNextFocus()},o._onFocus=function(e){var t=e.target,n=o.props.selection,r=o._isCtrlPressed||o._isMetaPressed,i=o._getSelectionMode();if(o._shouldHandleFocus&&i!==Kf.none){var a=o._hasAttribute(t,nv),s=o._findItemRoot(t);if(!a&&s){var l=o._getItemIndex(s);r?(n.setIndexSelected(l,n.isIndexSelected(l),!0),o.props.enterModalOnTouch&&o._isTouch&&n.setModal&&(n.setModal(!0),o._setIsTouch(!1))):o.props.isSelectedOnFocus&&o._onItemSurfaceClick(e,l)}}o._handleNextFocus(!1)},o._onMouseDown=function(e){o._updateModifiers(e);var t=e.target,n=o._findItemRoot(t);if(!o._isSelectionDisabled(t))for(;t!==o._root.current&&!o._hasAttribute(t,iv);){if(n){if(o._hasAttribute(t,nv))break;if(o._hasAttribute(t,rv))break;if(!(t!==n&&!o._shouldAutoSelect(t)||o._isShiftPressed||o._isCtrlPressed||o._isMetaPressed)){o._onInvokeMouseDown(e,o._getItemIndex(n));break}if(o.props.disableAutoSelectOnInputElements&&("A"===t.tagName||"BUTTON"===t.tagName||"INPUT"===t.tagName))return}t=ba(t)}},o._onTouchStartCapture=function(e){o._setIsTouch(!0)},o._onClick=function(e){var t=o.props.enableTouchInvocationTarget,n=void 0!==t&&t;o._updateModifiers(e);for(var r=e.target,i=o._findItemRoot(r),a=o._isSelectionDisabled(r);r!==o._root.current;){if(o._hasAttribute(r,iv)){a||o._onToggleAllClick(e);break}if(i){var s=o._getItemIndex(i);if(o._hasAttribute(r,nv)){a||(o._isShiftPressed?o._onItemSurfaceClick(e,s):o._onToggleClick(e,s));break}if(o._isTouch&&n&&o._hasAttribute(r,"data-selection-touch-invoke")||o._hasAttribute(r,rv)){o._onInvokeClick(e,s);break}if(r===i){a||o._onItemSurfaceClick(e,s);break}if("A"===r.tagName||"BUTTON"===r.tagName||"INPUT"===r.tagName)return}r=ba(r)}},o._onContextMenu=function(e){var t=e.target,n=o.props,r=n.onItemContextMenu,i=n.selection;if(r){var a=o._findItemRoot(t);if(a){var s=o._getItemIndex(a);o._onInvokeMouseDown(e,s),r(i.getItems()[s],s,e.nativeEvent)||e.preventDefault()}}},o._onDoubleClick=function(e){var t=e.target,n=o.props.onItemInvoked,r=o._findItemRoot(t);if(r&&n&&!o._isInputElement(t)){for(var i=o._getItemIndex(r);t!==o._root.current&&!o._hasAttribute(t,nv)&&!o._hasAttribute(t,rv);){if(t===r){o._onInvokeClick(e,i);break}t=ba(t)}t=ba(t)}},o._onKeyDownCapture=function(e){o._updateModifiers(e),o._handleNextFocus(!0)},o._onKeyDown=function(e){o._updateModifiers(e);var t=e.target,n=o._isSelectionDisabled(t),r=o.props.selection,i=e.which===Un.a&&(o._isCtrlPressed||o._isMetaPressed),a=e.which===Un.escape;if(!o._isInputElement(t)){var s=o._getSelectionMode();if(i&&s===Kf.multiple&&!r.isAllSelected())return n||r.setAllSelected(!0),e.stopPropagation(),void e.preventDefault();if(a&&r.getSelectedCount()>0)return n||r.setAllSelected(!1),e.stopPropagation(),void e.preventDefault();var l=o._findItemRoot(t);if(l)for(var c=o._getItemIndex(l);t!==o._root.current&&!o._hasAttribute(t,nv);){if(o._shouldAutoSelect(t)){n||o._onInvokeMouseDown(e,c);break}if(!(e.which!==Un.enter&&e.which!==Un.space||"BUTTON"!==t.tagName&&"A"!==t.tagName&&"INPUT"!==t.tagName))return!1;if(t===l){if(e.which===Un.enter)return o._onInvokeClick(e,c),void e.preventDefault();if(e.which===Un.space)return n||o._onToggleClick(e,c),void e.preventDefault();break}t=ba(t)}}},o._events=new Os(o),o._async=new Zi(o),Ui(o);var n=o.props.selection,r=n.isModal&&n.isModal();return o.state={isModal:r},o}return u(t,e),t.getDerivedStateFromProps=function(e,t){var o=e.selection.isModal&&e.selection.isModal();return d(d({},t),{isModal:o})},t.prototype.componentDidMount=function(){var e=at(this._root.current);this._events.on(e,"keydown, keyup",this._updateModifiers,!0),this._events.on(document,"click",this._findScrollParentAndTryClearOnEmptyClick),this._events.on(document.body,"touchstart",this._onTouchStartCapture,!0),this._events.on(document.body,"touchend",this._onTouchStartCapture,!0),this._events.on(this.props.selection,"change",this._onSelectionChange)},t.prototype.render=function(){var e=this.state.isModal;return f.createElement("div",{className:qr("ms-SelectionZone",this.props.className,{"ms-SelectionZone--modal":!!e}),ref:this._root,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onKeyDownCapture:this._onKeyDownCapture,onClick:this._onClick,role:"presentation",onDoubleClick:this._onDoubleClick,onContextMenu:this._onContextMenu,onMouseDownCapture:this._onMouseDownCapture,onFocusCapture:this._onFocus,"data-selection-is-modal":!!e||void 0},this.props.children,f.createElement(ks,null))},t.prototype.componentDidUpdate=function(e){var t=this.props.selection;t!==e.selection&&(this._events.off(e.selection),this._events.on(t,"change",this._onSelectionChange))},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose()},t.prototype._isSelectionDisabled=function(e){if(this._getSelectionMode()===Kf.none)return!0;for(;e!==this._root.current;){if(this._hasAttribute(e,"data-selection-disabled"))return!0;e=ba(e)}return!1},t.prototype._onToggleAllClick=function(e){var t=this.props.selection;this._getSelectionMode()===Kf.multiple&&(t.toggleAllSelected(),e.stopPropagation(),e.preventDefault())},t.prototype._onToggleClick=function(e,t){var o=this.props.selection,n=this._getSelectionMode();if(o.setChangeEvents(!1),this.props.enterModalOnTouch&&this._isTouch&&!o.isIndexSelected(t)&&o.setModal&&(o.setModal(!0),this._setIsTouch(!1)),n===Kf.multiple)o.toggleIndexSelected(t);else{if(n!==Kf.single)return void o.setChangeEvents(!0);var r=o.isIndexSelected(t),i=o.isModal&&o.isModal();o.setAllSelected(!1),o.setIndexSelected(t,!r,!0),i&&o.setModal&&o.setModal(!0)}o.setChangeEvents(!0),e.stopPropagation()},t.prototype._onInvokeClick=function(e,t){var o=this.props,n=o.selection,r=o.onItemInvoked;r&&(r(n.getItems()[t],t,e.nativeEvent),e.preventDefault(),e.stopPropagation())},t.prototype._onItemSurfaceClick=function(e,t){var o=this.props.selection,n=this._isCtrlPressed||this._isMetaPressed,r=this._getSelectionMode();r===Kf.multiple?this._isShiftPressed&&!this._isTabPressed?o.selectToIndex(t,!n):n?o.toggleIndexSelected(t):this._clearAndSelectIndex(t):r===Kf.single&&this._clearAndSelectIndex(t)},t.prototype._onInvokeMouseDown=function(e,t){this.props.selection.isIndexSelected(t)||this._clearAndSelectIndex(t)},t.prototype._findScrollParentAndTryClearOnEmptyClick=function(e){var t=es(this._root.current);this._events.off(document,"click",this._findScrollParentAndTryClearOnEmptyClick),this._events.on(t,"click",this._tryClearOnEmptyClick),(t&&e.target instanceof Node&&t.contains(e.target)||t===e.target)&&this._tryClearOnEmptyClick(e)},t.prototype._tryClearOnEmptyClick=function(e){!this.props.selectionPreservedOnEmptyClick&&this._isNonHandledClick(e.target)&&this.props.selection.setAllSelected(!1)},t.prototype._clearAndSelectIndex=function(e){var t=this.props.selection;if(1!==t.getSelectedCount()||!t.isIndexSelected(e)){var o=t.isModal&&t.isModal();t.setChangeEvents(!1),t.setAllSelected(!1),t.setIndexSelected(e,!0,!0),(o||this.props.enterModalOnTouch&&this._isTouch)&&(t.setModal&&t.setModal(!0),this._isTouch&&this._setIsTouch(!1)),t.setChangeEvents(!0)}},t.prototype._updateModifiers=function(e){this._isShiftPressed=e.shiftKey,this._isCtrlPressed=e.ctrlKey,this._isMetaPressed=e.metaKey;var t=e.keyCode;this._isTabPressed=!!t&&t===Un.tab},t.prototype._findItemRoot=function(e){for(var t=this.props.selection;e!==this._root.current;){var o=e.getAttribute(ov),n=Number(o);if(null!==o&&n>=0&&n<t.getItems().length)break;e=ba(e)}if(e!==this._root.current)return e},t.prototype._getItemIndex=function(e){return Number(e.getAttribute(ov))},t.prototype._shouldAutoSelect=function(e){return this._hasAttribute(e,"data-selection-select")},t.prototype._hasAttribute=function(e,t){for(var o=!1;!o&&e!==this._root.current;)o="true"===e.getAttribute(t),e=ba(e);return o},t.prototype._isInputElement=function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName},t.prototype._isNonHandledClick=function(e){var t=nt();if(t&&e)for(;e&&e!==t.documentElement;){if(Pa(e))return!1;e=ba(e)}return!0},t.prototype._handleNextFocus=function(e){var t=this;this._shouldHandleFocusTimeoutId&&(this._async.clearTimeout(this._shouldHandleFocusTimeoutId),this._shouldHandleFocusTimeoutId=void 0),this._shouldHandleFocus=e,e&&this._async.setTimeout((function(){t._shouldHandleFocus=!1}),100)},t.prototype._setIsTouch=function(e){var t=this;this._isTouchTimeoutId&&(this._async.clearTimeout(this._isTouchTimeoutId),this._isTouchTimeoutId=void 0),this._isTouch=!0,e&&this._async.setTimeout((function(){t._isTouch=!1}),300)},t.prototype._getSelectionMode=function(){var e=this.props.selection,t=this.props.selectionMode;return void 0===t?e?e.mode:Kf.none:t},t.defaultProps={isSelectedOnFocus:!0,selectionMode:Kf.multiple},t}(f.Component);!function(e){e[e.hidden=0]="hidden",e[e.visible=1]="visible"}(Xf||(Xf={})),function(e){e[e.disabled=0]="disabled",e[e.clickable=1]="clickable",e[e.hasDropdown=2]="hasDropdown"}(Qf||(Qf={})),function(e){e[e.unconstrained=0]="unconstrained",e[e.horizontalConstrained=1]="horizontalConstrained"}(Jf||(Jf={})),function(e){e[e.outside=0]="outside",e[e.surface=1]="surface",e[e.header=2]="header"}($f||($f={})),function(e){e[e.fixedColumns=0]="fixedColumns",e[e.justified=1]="justified"}(ev||(ev={})),function(e){e[e.onHover=0]="onHover",e[e.always=1]="always",e[e.hidden=2]="hidden"}(tv||(tv={}));var sv=function(e){var t=e.count,o=e.indentWidth,n=void 0===o?36:o,r=e.role,i=void 0===r?"presentation":r,a=t*n;return t>0?f.createElement("span",{className:"ms-GroupSpacer",style:{display:"inline-block",width:a},role:i}):null},lv={label:ar,audio:sr,video:lr,ol:cr,li:ur,a:dr,button:pr,input:hr,textarea:mr,select:gr,option:fr,table:vr,tr:br,th:yr,td:_r,colGroup:Cr,col:Sr,form:xr,iframe:kr,img:wr};function cv(e,t,o){return Tr(t,e&&lv[e]||ir,o)}var uv={root:"ms-DetailsRow",compact:"ms-DetailsList--Compact",cell:"ms-DetailsRow-cell",cellAnimation:"ms-DetailsRow-cellAnimation",cellCheck:"ms-DetailsRow-cellCheck",check:"ms-DetailsRow-check",cellMeasurer:"ms-DetailsRow-cellMeasurer",listCellFirstChild:"ms-List-cell:first-child",isContentUnselectable:"is-contentUnselectable",isSelected:"is-selected",isCheckVisible:"is-check-visible",isRowHeader:"is-row-header",fields:"ms-DetailsRow-fields"},dv={cellLeftPadding:12,cellRightPadding:8,cellExtraRightPadding:24},pv={rowHeight:42,compactRowHeight:32},hv=d(d({},pv),{rowVerticalPadding:11,compactRowVerticalPadding:6}),mv=function(e){var t,o,n,r,i,a,s,l,c,u,p,h,m=e.theme,g=e.isSelected,f=e.canSelect,v=e.droppingClassName,b=e.anySelected,y=e.isCheckVisible,_=e.checkboxCellClassName,C=e.compact,S=e.className,x=e.cellStyleProps,k=void 0===x?dv:x,w=e.enableUpdateAnimations,I=m.palette,D=m.fonts,T=I.neutralPrimary,E=I.white,P=I.neutralSecondary,M=I.neutralLighter,R=I.neutralLight,N=I.neutralDark,B=I.neutralQuaternaryAlt,F=m.semanticColors.focusBorder,A=Qo(uv,m),L={defaultHeaderText:T,defaultMetaText:P,defaultBackground:E,defaultHoverHeaderText:N,defaultHoverMetaText:T,defaultHoverBackground:M,selectedHeaderText:N,selectedMetaText:T,selectedBackground:R,selectedHoverHeaderText:N,selectedHoverMetaText:T,selectedHoverBackground:B,focusHeaderText:N,focusMetaText:T,focusBackground:R,focusHoverBackground:B},H=[To(m,{inset:-1,borderColor:F,outlineColor:E,highContrastStyle:{top:2,right:2,bottom:2,left:2}}),A.isSelected,{color:L.selectedMetaText,background:L.selectedBackground,borderBottom:"1px solid "+E,selectors:(t={"&:before":{position:"absolute",display:"block",top:-1,height:1,bottom:0,left:0,right:0,content:"",borderTop:"1px solid "+E},"&:hover":{background:L.selectedHoverBackground,color:L.selectedHoverMetaText,selectors:(o={},o["."+A.cell+" "+ro]={color:"HighlightText",selectors:{"> a":{color:"HighlightText"}}},o["."+A.isRowHeader]={color:L.selectedHoverHeaderText,selectors:(n={},n[ro]={color:"HighlightText"},n)},o[ro]={background:"Highlight"},o)},"&:focus":{background:L.focusBackground,selectors:(r={},r["."+A.cell]={color:L.focusMetaText,selectors:(i={},i[ro]={color:"HighlightText",selectors:{"> a":{color:"HighlightText"}}},i)},r["."+A.isRowHeader]={color:L.focusHeaderText,selectors:(a={},a[ro]={color:"HighlightText"},a)},r[ro]={background:"Highlight"},r)}},t[ro]=d(d({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{a:{color:"HighlightText"}}}),t["&:focus:hover"]={background:L.focusHoverBackground},t)}],O=[A.isContentUnselectable,{userSelect:"none",cursor:"default"}],z={minHeight:hv.compactRowHeight,border:0},W={minHeight:hv.compactRowHeight,paddingTop:hv.compactRowVerticalPadding,paddingBottom:hv.compactRowVerticalPadding,paddingLeft:k.cellLeftPadding+"px"},V=[To(m,{inset:-1}),A.cell,{display:"inline-block",position:"relative",boxSizing:"border-box",minHeight:hv.rowHeight,verticalAlign:"top",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:hv.rowVerticalPadding,paddingBottom:hv.rowVerticalPadding,paddingLeft:k.cellLeftPadding+"px",selectors:(s={"& > button":{maxWidth:"100%"}},s["[data-is-focusable='true']"]=To(m,{inset:-1,borderColor:P,outlineColor:E}),s)},g&&{selectors:(l={},l[ro]=d(d({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{selectors:{a:{color:"HighlightText"}}}),l)},C&&W];return{root:[A.root,Ze.fadeIn400,v,m.fonts.small,y&&A.isCheckVisible,To(m,{borderColor:F,outlineColor:E}),{borderBottom:"1px solid "+M,background:L.defaultBackground,color:L.defaultMetaText,display:"inline-flex",minWidth:"100%",minHeight:hv.rowHeight,whiteSpace:"nowrap",padding:0,boxSizing:"border-box",verticalAlign:"top",textAlign:"left",selectors:(c={},c["."+A.listCellFirstChild+" &:before"]={display:"none"},c["&:hover"]={background:L.defaultHoverBackground,color:L.defaultHoverMetaText,selectors:(u={},u["."+A.isRowHeader]={color:L.defaultHoverHeaderText},u)},c["&:hover ."+A.check]={opacity:1},c["."+wo+" &:focus ."+A.check]={opacity:1},c[".ms-GroupSpacer"]={flexShrink:0,flexGrow:0},c)},g&&H,!f&&O,C&&z,S],cellUnpadded:{paddingRight:k.cellRightPadding+"px"},cellPadded:{paddingRight:k.cellExtraRightPadding+k.cellRightPadding+"px",selectors:(p={},p["&."+A.cellCheck]={paddingRight:0},p)},cell:V,cellAnimation:w&&He.slideLeftIn40,cellMeasurer:[A.cellMeasurer,{overflow:"visible",whiteSpace:"nowrap"}],checkCell:[V,A.cellCheck,_,{padding:0,paddingTop:1,marginTop:-1,flexShrink:0}],checkCover:{position:"absolute",top:-1,left:0,bottom:0,right:0,display:b?"block":"none"},fields:[A.fields,{display:"flex",alignItems:"stretch"}],isRowHeader:[A.isRowHeader,{color:L.defaultHeaderText,fontSize:D.medium.fontSize},g&&{color:L.selectedHeaderText,fontWeight:qe.semibold,selectors:(h={},h[ro]={color:"HighlightText"},h)}],isMultiline:[V,{whiteSpace:"normal",wordBreak:"break-word",textOverflow:"clip"}],check:[A.check]}},gv={tooltipHost:"ms-TooltipHost",root:"ms-DetailsHeader",cell:"ms-DetailsHeader-cell",cellIsCheck:"ms-DetailsHeader-cellIsCheck",collapseButton:"ms-DetailsHeader-collapseButton",isCollapsed:"is-collapsed",isAllSelected:"is-allSelected",isSelectAllHidden:"is-selectAllHidden",isResizingColumn:"is-resizingColumn",cellSizer:"ms-DetailsHeader-cellSizer",isResizing:"is-resizing",dropHintCircleStyle:"ms-DetailsHeader-dropHintCircleStyle",dropHintCaretStyle:"ms-DetailsHeader-dropHintCaretStyle",dropHintLineStyle:"ms-DetailsHeader-dropHintLineStyle",cellTitle:"ms-DetailsHeader-cellTitle",cellName:"ms-DetailsHeader-cellName",filterChevron:"ms-DetailsHeader-filterChevron",gripperBarVertical:"ms-DetailsColumn-gripperBarVertical",checkTooltip:"ms-DetailsHeader-checkTooltip",check:"ms-DetailsHeader-check"},fv=function(e){var t=e.theme,o=e.cellStyleProps,n=void 0===o?dv:o,r=t.semanticColors;return[Qo(gv,t).cell,To(t),{color:r.bodyText,position:"relative",display:"inline-block",boxSizing:"border-box",padding:"0 "+n.cellRightPadding+"px 0 "+n.cellLeftPadding+"px",lineHeight:"inherit",margin:"0",height:42,verticalAlign:"top",whiteSpace:"nowrap",textOverflow:"ellipsis",textAlign:"left"}]},vv={root:"ms-DetailsRow-check",isDisabled:"ms-DetailsRow-check--isDisabled",isHeader:"ms-DetailsRow-check--isHeader"},bv=Jn(),yv=f.memo((function(e){return f.createElement(Eh,{theme:e.theme,checked:e.checked,className:e.className,useFastIcons:!0})}));function _v(e){return f.createElement(Eh,{checked:e.checked})}function Cv(e){return f.createElement(yv,{theme:e.theme,checked:e.checked})}var Sv,xv=Vn((function(e){var t=e.isVisible,o=void 0!==t&&t,n=e.canSelect,r=void 0!==n&&n,i=e.anySelected,a=void 0!==i&&i,s=e.selected,l=void 0!==s&&s,c=e.selectionMode,u=e.isHeader,h=void 0!==u&&u,m=e.className,g=(e.checkClassName,e.styles),v=e.theme,b=e.compact,y=e.onRenderDetailsCheckbox,_=e.useFastIcons,C=void 0===_||_,S=p(e,["isVisible","canSelect","anySelected","selected","selectionMode","isHeader","className","checkClassName","styles","theme","compact","onRenderDetailsCheckbox","useFastIcons"]),x=C?Cv:_v,k=y?Wh(y,x):x,w=bv(g,{theme:v,canSelect:r,selected:l,anySelected:a,className:m,isHeader:h,isVisible:o,compact:b}),I={checked:l,theme:v},D=cv("div",S,["aria-label","aria-labelledby","aria-describedby"]),T=c===Kf.single?"radio":"checkbox";return r?f.createElement("div",d({},S,{role:T,className:qr(w.root,w.check),"aria-checked":l,"data-selection-toggle":!0,"data-automationid":"DetailsRowCheck",tabIndex:-1}),k(I)):f.createElement("div",d({},D,{className:qr(w.root,w.check)}))}),(function(e){var t=e.theme,o=e.className,n=e.isHeader,r=e.selected,i=e.anySelected,a=e.canSelect,s=e.compact,l=e.isVisible,c=Qo(vv,t),u=pv.rowHeight,d=pv.compactRowHeight,p=n?42:s?d:u,h=l||r||i;return{root:[c.root,o],check:[!a&&c.isDisabled,n&&c.isHeader,To(t),t.fonts.small,Th.checkHost,{display:"flex",alignItems:"center",justifyContent:"center",cursor:"default",boxSizing:"border-box",verticalAlign:"top",background:"none",backgroundColor:"transparent",border:"none",opacity:h?1:0,height:p,width:48,padding:0,margin:0}],isDisabled:[]}}),void 0,{scope:"DetailsRowCheck"},!0),kv=function(){function e(e){this._selection=e.selection,this._dragEnterCounts={},this._activeTargets={},this._lastId=0,this._initialized=!1}return e.prototype.dispose=function(){this._events&&this._events.dispose()},e.prototype.subscribe=function(e,t,o){var n=this;if(!this._initialized){this._events=new Os(this);var r=nt();r&&(this._events.on(r.body,"mouseup",this._onMouseUp.bind(this),!0),this._events.on(r,"mouseup",this._onDocumentMouseUp.bind(this),!0)),this._initialized=!0}var i,a,s,l,c,u,d,p,h,m,g=o.key,f=void 0===g?""+ ++this._lastId:g,v=[];if(o&&e){var b=o.eventMap,y=o.context,_=o.updateDropState,C={root:e,options:o,key:f};if(p=this._isDraggable(C),h=this._isDroppable(C),(p||h)&&b)for(var S=0,x=b;S<x.length;S++){var k=x[S],w={callback:k.callback.bind(null,y),eventName:k.eventName};v.push(w),this._events.on(e,w.eventName,w.callback)}h&&(a=function(e){e.isHandled||(e.isHandled=!0,n._dragEnterCounts[f]--,0===n._dragEnterCounts[f]&&_(!1,e))},s=function(e){e.preventDefault(),e.isHandled||(e.isHandled=!0,n._dragEnterCounts[f]++,1===n._dragEnterCounts[f]&&_(!0,e))},l=function(e){n._dragEnterCounts[f]=0,_(!1,e)},c=function(e){n._dragEnterCounts[f]=0,_(!1,e),o.onDrop&&o.onDrop(o.context.data,e)},u=function(e){e.preventDefault(),o.onDragOver&&o.onDragOver(o.context.data,e)},this._dragEnterCounts[f]=0,t.on(e,"dragenter",s),t.on(e,"dragleave",a),t.on(e,"dragend",l),t.on(e,"drop",c),t.on(e,"dragover",u)),p&&(d=this._onMouseDown.bind(this,C),l=this._onDragEnd.bind(this,C),i=function(t){var r=o;r&&r.onDragStart&&r.onDragStart(r.context.data,r.context.index,n._selection.getSelection(),t),n._isDragging=!0,t.dataTransfer&&t.dataTransfer.setData("id",e.id)},t.on(e,"dragstart",i),t.on(e,"mousedown",d),t.on(e,"dragend",l)),m={target:C,dispose:function(){if(n._activeTargets[f]===m&&delete n._activeTargets[f],e){for(var o=0,r=v;o<r.length;o++){var g=r[o];n._events.off(e,g.eventName,g.callback)}h&&(t.off(e,"dragenter",s),t.off(e,"dragleave",a),t.off(e,"dragend",l),t.off(e,"dragover",u),t.off(e,"drop",c)),p&&(t.off(e,"dragstart",i),t.off(e,"mousedown",d),t.off(e,"dragend",l))}}},this._activeTargets[f]=m}return{key:f,dispose:function(){m&&m.dispose()}}},e.prototype.unsubscribe=function(e,t){var o=this._activeTargets[t];o&&o.dispose()},e.prototype._onDragEnd=function(e,t){var o=e.options;o.onDragEnd&&o.onDragEnd(o.context.data,t)},e.prototype._onMouseUp=function(e){if(this._isDragging=!1,this._dragData){for(var t=0,o=Object.keys(this._activeTargets);t<o.length;t++){var n=o[t],r=this._activeTargets[n];r.target.root&&(this._events.off(r.target.root,"mousemove"),this._events.off(r.target.root,"mouseleave"))}this._dragData.dropTarget&&(Os.raise(this._dragData.dropTarget.root,"dragleave"),Os.raise(this._dragData.dropTarget.root,"drop"))}this._dragData=null},e.prototype._onDocumentMouseUp=function(e){var t=nt();t&&e.target===t.documentElement&&this._onMouseUp(e)},e.prototype._onMouseMove=function(e,t){var o=t.buttons,n=void 0===o?1:o;if(this._dragData&&1!==n)this._onMouseUp(t);else{var r=e.root,i=e.key;this._isDragging&&this._isDroppable(e)&&this._dragData&&this._dragData.dropTarget&&this._dragData.dropTarget.key!==i&&!this._isChild(r,this._dragData.dropTarget.root)&&this._dragEnterCounts[this._dragData.dropTarget.key]>0&&(Os.raise(this._dragData.dropTarget.root,"dragleave"),Os.raise(r,"dragenter"),this._dragData.dropTarget=e)}},e.prototype._onMouseLeave=function(e,t){this._isDragging&&this._dragData&&this._dragData.dropTarget&&this._dragData.dropTarget.key===e.key&&(Os.raise(e.root,"dragleave"),this._dragData.dropTarget=void 0)},e.prototype._onMouseDown=function(e,t){if(0===t.button)if(this._isDraggable(e)){this._dragData={clientX:t.clientX,clientY:t.clientY,eventTarget:t.target,dragTarget:e};for(var o=0,n=Object.keys(this._activeTargets);o<n.length;o++){var r=n[o],i=this._activeTargets[r];i.target.root&&(this._events.on(i.target.root,"mousemove",this._onMouseMove.bind(this,i.target)),this._events.on(i.target.root,"mouseleave",this._onMouseLeave.bind(this,i.target)))}}else this._dragData=null},e.prototype._isChild=function(e,t){for(;t&&t.parentElement;){if(t.parentElement===e)return!0;t=t.parentElement}return!1},e.prototype._isDraggable=function(e){var t=e.options;return!(!t.canDrag||!t.canDrag(t.context.data))},e.prototype._isDroppable=function(e){var t=e.options,o=this._dragData&&this._dragData.dragTarget?this._dragData.dragTarget.options.context:void 0;return!(!t.canDrop||!t.canDrop(t.context,o))},e}(),wv=Jn(),Iv=function(e){return function(t){return t?t.column.isIconOnly?f.createElement("span",{className:e.accessibleLabel},t.column.name):f.createElement(f.Fragment,null,t.column.name):null}},Dv=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._onRenderFilterIcon=function(e){return function(e){var t=e.columnProps,o=p(e,["columnProps"]),n=(null==t?void 0:t.useFastIcons)?ti:ii;return f.createElement(n,d({},o))}},o._onRenderColumnHeaderTooltip=function(e){return f.createElement("span",{className:e.hostClassName},e.children)},o._onColumnClick=function(e){var t=o.props,n=t.onColumnClick,r=t.column;r.columnActionsMode!==Qf.disabled&&(r.onColumnClick&&r.onColumnClick(e,r),n&&n(e,r))},o._onDragStart=function(e,t,n,r){var i=o._classNames;t&&(o._updateHeaderDragInfo(t),o._root.current.classList.add(i.borderWhileDragging),o._async.setTimeout((function(){o._root.current&&o._root.current.classList.add(i.noBorderWhileDragging)}),20))},o._onDragEnd=function(e,t){var n=o._classNames;t&&o._updateHeaderDragInfo(-1,t),o._root.current.classList.remove(n.borderWhileDragging),o._root.current.classList.remove(n.noBorderWhileDragging)},o._updateHeaderDragInfo=function(e,t){o.props.setDraggedItemIndex&&o.props.setDraggedItemIndex(e),o.props.updateDragInfo&&o.props.updateDragInfo({itemIndex:e},t)},o._onColumnContextMenu=function(e){var t=o.props,n=t.onColumnContextMenu,r=t.column;r.onColumnContextMenu&&(r.onColumnContextMenu(r,e),e.preventDefault()),n&&(n(r,e),e.preventDefault())},o._onRootMouseDown=function(e){o.props.isDraggable&&0===e.button&&e.stopPropagation()},Ui(o),o._async=new Zi(o),o._events=new Os(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.column,o=e.columnIndex,n=e.parentId,r=e.isDraggable,i=e.styles,a=e.theme,s=e.cellStyleProps,l=void 0===s?dv:s,c=e.useFastIcons,u=void 0===c||c,p=this.props.onRenderColumnHeaderTooltip,h=void 0===p?this._onRenderColumnHeaderTooltip:p;this._classNames=wv(i,{theme:a,headerClassName:t.headerClassName,iconClassName:t.iconClassName,isActionable:t.columnActionsMode!==Qf.disabled,isEmpty:!t.name,isIconVisible:t.isSorted||t.isGrouped||t.isFiltered,isPadded:t.isPadded,isIconOnly:t.isIconOnly,cellStyleProps:l,transitionDurationDrag:200,transitionDurationDrop:1500});var m=this._classNames,g=u?ti:ii,v=t.onRenderFilterIcon?Wh(t.onRenderFilterIcon,this._onRenderFilterIcon(this._classNames)):this._onRenderFilterIcon(this._classNames),b=t.onRenderHeader?Wh(t.onRenderHeader,Iv(this._classNames)):Iv(this._classNames),y=t.columnActionsMode!==Qf.disabled&&(void 0!==t.onColumnClick||void 0!==this.props.onColumnClick),_={"aria-label":t.isIconOnly?t.name:void 0,"aria-labelledby":t.isIconOnly?void 0:n+"-"+t.key+"-name","aria-describedby":!this.props.onRenderColumnHeaderTooltip&&this._hasAccessibleLabel()?n+"-"+t.key+"-tooltip":void 0};return f.createElement(f.Fragment,null,f.createElement("div",d({key:t.key,ref:this._root,role:"columnheader"},!y&&_,{"aria-sort":t.isSorted?t.isSortedDescending?"descending":"ascending":"none","aria-colindex":o,"data-is-focusable":y||t.columnActionsMode===Qf.disabled?void 0:"true",className:m.root,"data-is-draggable":r,draggable:r,style:{width:t.calculatedWidth+l.cellLeftPadding+l.cellRightPadding+(t.isPadded?l.cellExtraRightPadding:0)},"data-automationid":"ColumnsHeaderColumn","data-item-key":t.key}),r&&f.createElement(g,{iconName:"GripperBarVertical",className:m.gripperBarVerticalStyle}),h({hostClassName:m.cellTooltip,id:n+"-"+t.key+"-tooltip",setAriaDescribedBy:!1,column:t,content:t.columnActionsMode!==Qf.disabled?t.ariaLabel:"",children:f.createElement("span",d({id:n+"-"+t.key,className:m.cellTitle,"data-is-focusable":y&&t.columnActionsMode!==Qf.disabled?"true":void 0,role:y?"button":void 0},y&&_,{onContextMenu:this._onColumnContextMenu,onClick:this._onColumnClick,"aria-haspopup":t.columnActionsMode===Qf.hasDropdown?"menu":void 0,"aria-expanded":t.columnActionsMode===Qf.hasDropdown?!!t.isMenuOpen:void 0}),f.createElement("span",{id:n+"-"+t.key+"-name",className:m.cellName},(t.iconName||t.iconClassName)&&f.createElement(g,{className:m.iconClassName,iconName:t.iconName}),b(this.props)),t.isFiltered&&f.createElement(g,{className:m.nearIcon,iconName:"Filter"}),t.isSorted&&f.createElement(g,{className:m.sortIcon,iconName:t.isSortedDescending?"SortDown":"SortUp"}),t.isGrouped&&f.createElement(g,{className:m.nearIcon,iconName:"GroupedDescending"}),t.columnActionsMode===Qf.hasDropdown&&!t.isIconOnly&&v({"aria-hidden":!0,columnProps:this.props,className:m.filterChevron,iconName:"ChevronDown"}))},this._onRenderColumnHeaderTooltip)),this.props.onRenderColumnHeaderTooltip?null:this._renderAccessibleLabel())},t.prototype.componentDidMount=function(){var e=this;this.props.dragDropHelper&&this.props.isDraggable&&this._addDragDropHandling();var t=this._classNames;this.props.isDropped&&(this._root.current&&(this._root.current.classList.add(t.borderAfterDropping),this._async.setTimeout((function(){e._root.current&&e._root.current.classList.add(t.noBorderAfterDropping)}),20)),this._async.setTimeout((function(){e._root.current&&(e._root.current.classList.remove(t.borderAfterDropping),e._root.current.classList.remove(t.noBorderAfterDropping))}),1520))},t.prototype.componentWillUnmount=function(){this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this._async.dispose(),this._events.dispose()},t.prototype.componentDidUpdate=function(){!this._dragDropSubscription&&this.props.dragDropHelper&&this.props.isDraggable&&this._addDragDropHandling(),this._dragDropSubscription&&!this.props.isDraggable&&(this._dragDropSubscription.dispose(),this._events.off(this._root.current,"mousedown"),delete this._dragDropSubscription)},t.prototype._getColumnDragDropOptions=function(){var e=this,t=this.props.columnIndex;return{selectionIndex:t,context:{data:t,index:t},canDrag:function(){return e.props.isDraggable},canDrop:function(){return!1},onDragStart:this._onDragStart,updateDropState:function(){},onDrop:function(){},onDragEnd:this._onDragEnd}},t.prototype._hasAccessibleLabel=function(){var e=this.props.column;return!!(e.ariaLabel||e.filterAriaLabel||e.sortAscendingAriaLabel||e.sortDescendingAriaLabel||e.groupAriaLabel)},t.prototype._renderAccessibleLabel=function(){var e=this.props,t=e.column,o=e.parentId,n=this._classNames;return this._hasAccessibleLabel()&&!this.props.onRenderColumnHeaderTooltip?f.createElement("label",{key:t.key+"_label",id:o+"-"+t.key+"-tooltip",className:n.accessibleLabel},t.ariaLabel,t.isFiltered&&t.filterAriaLabel||null,t.isSorted&&(t.isSortedDescending?t.sortDescendingAriaLabel:t.sortAscendingAriaLabel)||null,t.isGrouped&&t.groupAriaLabel||null):null},t.prototype._addDragDropHandling=function(){this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getColumnDragDropOptions()),this._events.on(this._root.current,"mousedown",this._onRootMouseDown)},t}(f.Component),Tv={isActionable:"is-actionable",cellIsCheck:"ms-DetailsHeader-cellIsCheck",collapseButton:"ms-DetailsHeader-collapseButton",isCollapsed:"is-collapsed",isAllSelected:"is-allSelected",isSelectAllHidden:"is-selectAllHidden",isResizingColumn:"is-resizingColumn",isEmpty:"is-empty",isIconVisible:"is-icon-visible",cellSizer:"ms-DetailsHeader-cellSizer",isResizing:"is-resizing",dropHintCircleStyle:"ms-DetailsHeader-dropHintCircleStyle",dropHintLineStyle:"ms-DetailsHeader-dropHintLineStyle",cellTitle:"ms-DetailsHeader-cellTitle",cellName:"ms-DetailsHeader-cellName",filterChevron:"ms-DetailsHeader-filterChevron",gripperBarVerticalStyle:"ms-DetailsColumn-gripperBar",nearIcon:"ms-DetailsColumn-nearIcon"},Ev=Vn(Dv,(function(e){var t,o=e.theme,n=e.headerClassName,r=e.iconClassName,i=e.isActionable,a=e.isEmpty,s=e.isIconVisible,l=e.isPadded,c=e.isIconOnly,u=e.cellStyleProps,p=void 0===u?dv:u,h=e.transitionDurationDrag,m=e.transitionDurationDrop,g=o.semanticColors,f=o.palette,v=o.fonts,b=Qo(Tv,o),y={iconForegroundColor:g.bodySubtext,headerForegroundColor:g.bodyText,headerBackgroundColor:g.bodyBackground,dropdownChevronForegroundColor:f.neutralSecondary,resizerColor:f.neutralTertiaryAlt},_={color:y.iconForegroundColor,opacity:1,paddingLeft:8},C={outline:"1px solid "+f.themePrimary},S={outlineColor:"transparent"};return{root:[fv(e),v.small,i&&[b.isActionable,{selectors:{":hover":{color:g.bodyText,background:g.listHeaderBackgroundHovered},":active":{background:g.listHeaderBackgroundPressed}}}],a&&[b.isEmpty,{textOverflow:"clip"}],s&&b.isIconVisible,l&&{paddingRight:p.cellExtraRightPadding+p.cellRightPadding},{selectors:{':hover i[data-icon-name="GripperBarVertical"]':{display:"block"}}},n],gripperBarVerticalStyle:{display:"none",position:"absolute",textAlign:"left",color:f.neutralTertiary,left:1},nearIcon:[b.nearIcon,_],sortIcon:[_,{paddingLeft:4,position:"relative",top:1}],iconClassName:[{color:y.iconForegroundColor,opacity:1},r],filterChevron:[b.filterChevron,{color:y.dropdownChevronForegroundColor,paddingLeft:6,verticalAlign:"middle",fontSize:v.small.fontSize}],cellTitle:[b.cellTitle,To(o),d({display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"stretch",boxSizing:"border-box",overflow:"hidden",padding:"0 "+p.cellRightPadding+"px 0 "+p.cellLeftPadding+"px"},c?{alignContent:"flex-end",maxHeight:"100%",flexWrap:"wrap-reverse"}:{})],cellName:[b.cellName,{flex:"0 1 auto",overflow:"hidden",textOverflow:"ellipsis",fontWeight:qe.semibold,fontSize:v.medium.fontSize},c&&{selectors:(t={},t["."+b.nearIcon]={paddingLeft:0},t)}],cellTooltip:{display:"block",position:"absolute",top:0,left:0,bottom:0,right:0},accessibleLabel:Ro,borderWhileDragging:C,noBorderWhileDragging:[S,{transition:"outline "+h+"ms ease"}],borderAfterDropping:C,noBorderAfterDropping:[S,{transition:"outline "+m+"ms ease"}]}}),void 0,{scope:"DetailsColumn"});!function(e){e[e.none=0]="none",e[e.hidden=1]="hidden",e[e.visible=2]="visible"}(Sv||(Sv={}));var Pv=Jn(),Mv=[],Rv=function(e){function t(t){var o=e.call(this,t)||this;return o._rootElement=f.createRef(),o._rootComponent=f.createRef(),o._draggedColumnIndex=-1,o._dropHintDetails={},o._updateDroppingState=function(e,t){o._draggedColumnIndex>=0&&"drop"!==t.type&&!e&&o._resetDropHints()},o._onDragOver=function(e,t){o._draggedColumnIndex>=0&&(t.stopPropagation(),o._computeDropHintToBeShown(t.clientX))},o._onDrop=function(e,t){var n=o._getColumnReorderProps();if(o._draggedColumnIndex>=0&&t){var r=o._draggedColumnIndex>o._currentDropHintIndex?o._currentDropHintIndex:o._currentDropHintIndex-1,i=o._isValidCurrentDropHintIndex();if(t.stopPropagation(),i)if(o._onDropIndexInfo.sourceIndex=o._draggedColumnIndex,o._onDropIndexInfo.targetIndex=r,n.onColumnDrop){var a={draggedIndex:o._draggedColumnIndex,targetIndex:r};n.onColumnDrop(a)}else n.handleColumnReorder&&n.handleColumnReorder(o._draggedColumnIndex,r)}o._resetDropHints(),o._dropHintDetails={},o._draggedColumnIndex=-1},o._updateDragInfo=function(e,t){var n=o._getColumnReorderProps(),r=e.itemIndex;if(r>=0)o._draggedColumnIndex=o._isCheckboxColumnHidden()?r-1:r-2,o._getDropHintPositions(),n.onColumnDragStart&&n.onColumnDragStart(!0);else if(t&&o._draggedColumnIndex>=0&&(o._resetDropHints(),o._draggedColumnIndex=-1,o._dropHintDetails={},n.onColumnDragEnd)){var i=o._isEventOnHeader(t);n.onColumnDragEnd({dropLocation:i},t)}},o._getDropHintPositions=function(){for(var e,t=o.props.columns,n=void 0===t?Mv:t,r=o._getColumnReorderProps(),i=0,a=0,s=r.frozenColumnCountFromStart||0,l=r.frozenColumnCountFromEnd||0,c=s;c<n.length-l+1;c++)if(o._rootElement.current){var u=o._rootElement.current.querySelectorAll("#columnDropHint_"+c)[0];if(u)if(c===s)i=u.offsetLeft,a=u.offsetLeft,e=u;else{var d=(u.offsetLeft+i)/2;o._dropHintDetails[c-1]={originX:i,startX:a,endX:d,dropHintElementRef:e},a=d,e=u,i=u.offsetLeft,c===n.length-l&&(o._dropHintDetails[c]={originX:i,startX:a,endX:u.offsetLeft,dropHintElementRef:e})}}},o._computeDropHintToBeShown=function(e){var t=jn(o.props.theme);if(o._rootElement.current){var n=e-o._rootElement.current.getBoundingClientRect().left,r=o._currentDropHintIndex;if(o._isValidCurrentDropHintIndex()&&Nv(t,n,o._dropHintDetails[r].startX,o._dropHintDetails[r].endX))return;var i=o.props.columns,a=void 0===i?Mv:i,s=o._getColumnReorderProps(),l=s.frozenColumnCountFromStart||0,c=s.frozenColumnCountFromEnd||0,u=l,d=a.length-c,p=-1;if(Bv(t,n,o._dropHintDetails[u].endX)?p=u:Fv(t,n,o._dropHintDetails[d].startX)?p=d:o._isValidCurrentDropHintIndex()&&(o._dropHintDetails[r+1]&&Nv(t,n,o._dropHintDetails[r+1].startX,o._dropHintDetails[r+1].endX)?p=r+1:o._dropHintDetails[r-1]&&Nv(t,n,o._dropHintDetails[r-1].startX,o._dropHintDetails[r-1].endX)&&(p=r-1)),-1===p)for(var h=l,m=d;h<m;){var g=Math.ceil((m+h)/2);if(Nv(t,n,o._dropHintDetails[g].startX,o._dropHintDetails[g].endX)){p=g;break}Bv(t,n,o._dropHintDetails[g].originX)?m=g:Fv(t,n,o._dropHintDetails[g].originX)&&(h=g)}p===o._draggedColumnIndex||p===o._draggedColumnIndex+1?o._isValidCurrentDropHintIndex()&&o._resetDropHints():r!==p&&p>=0&&(o._resetDropHints(),o._updateDropHintElement(o._dropHintDetails[p].dropHintElementRef,"inline-block"),o._currentDropHintIndex=p)}},o._renderColumnSizer=function(e){var t,n=e.columnIndex,r=o.props.columns,i=void 0===r?Mv:r,a=i[n],s=o.state.columnResizeDetails,l=o._classNames;return a.isResizable?f.createElement("div",{key:a.key+"_sizer","aria-hidden":!0,role:"button","data-is-focusable":!1,onClick:Av,"data-sizer-index":n,onBlur:o._onSizerBlur,className:qr(l.cellSizer,n<i.length-1?l.cellSizerStart:l.cellSizerEnd,(t={},t[l.cellIsResizing]=s&&s.columnIndex===n,t)),onDoubleClick:o._onSizerDoubleClick.bind(o,n)}):null},o._onRenderColumnHeaderTooltip=function(e){return f.createElement("span",{className:e.hostClassName},e.children)},o._onSelectAllClicked=function(){var e=o.props.selection;e&&e.toggleAllSelected()},o._onRootMouseDown=function(e){var t=e.target.getAttribute("data-sizer-index"),n=Number(t),r=o.props.columns,i=void 0===r?Mv:r;null!==t&&0===e.button&&(o.setState({columnResizeDetails:{columnIndex:n,columnMinWidth:i[n].calculatedWidth,originX:e.clientX}}),e.preventDefault(),e.stopPropagation())},o._onRootMouseMove=function(e){var t=o.state,n=t.columnResizeDetails,r=t.isSizing;n&&!r&&e.clientX!==n.originX&&o.setState({isSizing:!0})},o._onRootKeyDown=function(e){var t=o.state,n=t.columnResizeDetails,r=t.isSizing,i=o.props,a=i.columns,s=void 0===a?Mv:a,l=i.onColumnResized,c=e.target.getAttribute("data-sizer-index");if(c&&!r){var u=Number(c);if(n){var p=void 0;e.which===Un.enter?(o.setState({columnResizeDetails:void 0}),e.preventDefault(),e.stopPropagation()):e.which===Un.left?p=jn(o.props.theme)?1:-1:e.which===Un.right&&(p=jn(o.props.theme)?-1:1),p&&(e.shiftKey||(p*=10),o.setState({columnResizeDetails:d(d({},n),{columnMinWidth:n.columnMinWidth+p})}),l&&l(s[u],n.columnMinWidth+p,u),e.preventDefault(),e.stopPropagation())}else e.which===Un.enter&&(o.setState({columnResizeDetails:{columnIndex:u,columnMinWidth:s[u].calculatedWidth}}),e.preventDefault(),e.stopPropagation())}},o._onSizerMouseMove=function(e){var t=e.buttons,n=o.props,r=n.onColumnIsSizingChanged,i=n.onColumnResized,a=n.columns,s=void 0===a?Mv:a,l=o.state.columnResizeDetails;if(void 0===t||1===t){if(e.clientX!==l.originX&&r&&r(s[l.columnIndex],!0),i){var c=e.clientX-l.originX;jn(o.props.theme)&&(c=-c),i(s[l.columnIndex],l.columnMinWidth+c,l.columnIndex)}}else o._onSizerMouseUp(e)},o._onSizerBlur=function(e){o.state.columnResizeDetails&&o.setState({columnResizeDetails:void 0,isSizing:!1})},o._onSizerMouseUp=function(e){var t=o.props,n=t.columns,r=void 0===n?Mv:n,i=t.onColumnIsSizingChanged,a=o.state.columnResizeDetails;o.setState({columnResizeDetails:void 0,isSizing:!1}),i&&i(r[a.columnIndex],!1)},o._onToggleCollapseAll=function(){var e=o.props.onToggleCollapseAll,t=!o.state.isAllCollapsed;o.setState({isAllCollapsed:t}),e&&e(t)},Ui(o),o._events=new Os(o),o.state={columnResizeDetails:void 0,isAllCollapsed:o.props.isAllCollapsed,isAllSelected:!!o.props.selection&&o.props.selection.isAllSelected()},o._onDropIndexInfo={sourceIndex:-1,targetIndex:-1},o._id=Va("header"),o._currentDropHintIndex=-1,o._dragDropHelper=new kv({selection:{getSelection:function(){}},minimumPixelsForDrag:o.props.minimumPixelsForDrag}),o}return u(t,e),t.prototype.componentDidMount=function(){var e=this.props.selection;this._events.on(e,qf,this._onSelectionChanged),this._rootElement.current&&(this._events.on(this._rootElement.current,"mousedown",this._onRootMouseDown),this._events.on(this._rootElement.current,"keydown",this._onRootKeyDown),this._getColumnReorderProps()&&(this._subscriptionObject=this._dragDropHelper.subscribe(this._rootElement.current,this._events,this._getHeaderDragDropOptions())))},t.prototype.componentDidUpdate=function(e){if(this._getColumnReorderProps()?!this._subscriptionObject&&this._rootElement.current&&(this._subscriptionObject=this._dragDropHelper.subscribe(this._rootElement.current,this._events,this._getHeaderDragDropOptions())):this._subscriptionObject&&(this._subscriptionObject.dispose(),delete this._subscriptionObject),this.props!==e&&this._onDropIndexInfo.sourceIndex>=0&&this._onDropIndexInfo.targetIndex>=0){var t=e.columns,o=void 0===t?Mv:t,n=this.props.columns,r=void 0===n?Mv:n;o[this._onDropIndexInfo.sourceIndex].key===r[this._onDropIndexInfo.targetIndex].key&&(this._onDropIndexInfo={sourceIndex:-1,targetIndex:-1})}this.props.isAllCollapsed!==e.isAllCollapsed&&this.setState({isAllCollapsed:this.props.isAllCollapsed})},t.prototype.componentWillUnmount=function(){this._subscriptionObject&&(this._subscriptionObject.dispose(),delete this._subscriptionObject),this._dragDropHelper.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this,t=this.props,o=t.columns,n=void 0===o?Mv:o,r=t.ariaLabel,i=t.ariaLabelForToggleAllGroupsButton,a=t.ariaLabelForSelectAllCheckbox,s=t.selectAllVisibility,l=t.ariaLabelForSelectionColumn,c=t.indentWidth,u=t.onColumnClick,d=t.onColumnContextMenu,p=t.onRenderColumnHeaderTooltip,h=void 0===p?this._onRenderColumnHeaderTooltip:p,m=t.styles,g=t.selectionMode,v=t.theme,b=t.onRenderDetailsCheckbox,y=t.groupNestingDepth,_=t.useFastIcons,C=t.checkboxVisibility,S=t.className,x=this.state,k=x.isAllSelected,w=x.columnResizeDetails,I=x.isSizing,D=x.isAllCollapsed,T=s!==Sv.none,E=s===Sv.hidden,P=C===tv.always,M=this._getColumnReorderProps(),R=M&&M.frozenColumnCountFromStart?M.frozenColumnCountFromStart:0,N=M&&M.frozenColumnCountFromEnd?M.frozenColumnCountFromEnd:0;this._classNames=Pv(m,{theme:v,isAllSelected:k,isSelectAllHidden:s===Sv.hidden,isResizingColumn:!!w&&I,isSizing:I,isAllCollapsed:D,isCheckboxHidden:E,className:S});var B=this._classNames,F=_?ti:ii,A=jn(v);return f.createElement(vs,{role:"row","aria-label":r,className:B.root,componentRef:this._rootComponent,elementRef:this._rootElement,onMouseMove:this._onRootMouseMove,"data-automationid":"DetailsHeader",direction:$i.horizontal},T?[f.createElement("div",{key:"__checkbox",className:B.cellIsCheck,"aria-labelledby":this._id+"-checkTooltip",onClick:E?void 0:this._onSelectAllClicked,"aria-colindex":1,role:"columnheader"},h({hostClassName:B.checkTooltip,id:this._id+"-checkTooltip",setAriaDescribedBy:!1,content:a,children:f.createElement(xv,{id:this._id+"-check","aria-label":g===Kf.multiple?a:l,"data-is-focusable":!E||void 0,isHeader:!0,selected:k,anySelected:!1,canSelect:!E,className:B.check,onRenderDetailsCheckbox:b,useFastIcons:_,isVisible:P})},this._onRenderColumnHeaderTooltip)),this.props.onRenderColumnHeaderTooltip?null:a&&!E?f.createElement("label",{key:"__checkboxLabel",id:this._id+"-checkTooltip",className:B.accessibleLabel,"aria-hidden":!0},a):l&&E?f.createElement("label",{key:"__checkboxLabel",id:this._id+"-checkTooltip",className:B.accessibleLabel,"aria-hidden":!0},l):null]:null,y>0&&this.props.collapseAllVisibility===Xf.visible?f.createElement("div",{className:B.cellIsGroupExpander,onClick:this._onToggleCollapseAll,"data-is-focusable":!0,"aria-label":i,"aria-expanded":!D,role:"columnheader"},f.createElement(F,{className:B.collapseButton,iconName:A?"ChevronLeftMed":"ChevronRightMed"})):null,f.createElement(sv,{indentWidth:c,role:"gridcell",count:y-1}),n.map((function(t,o){var r=!!M&&o>=R&&o<n.length-N;return[M&&(r||o===n.length-N)&&e._renderDropHint(o),f.createElement(Ev,{column:t,styles:t.styles,key:t.key,columnIndex:(T?2:1)+o,parentId:e._id,isDraggable:r,updateDragInfo:e._updateDragInfo,dragDropHelper:e._dragDropHelper,onColumnClick:u,onColumnContextMenu:d,onRenderColumnHeaderTooltip:e.props.onRenderColumnHeaderTooltip,isDropped:e._onDropIndexInfo.targetIndex===o,cellStyleProps:e.props.cellStyleProps,useFastIcons:_}),e._renderColumnDivider(o)]})),M&&0===N&&this._renderDropHint(n.length),I&&f.createElement(_c,null,f.createElement("div",{className:B.sizingOverlay,onMouseMove:this._onSizerMouseMove,onMouseUp:this._onSizerMouseUp})))},t.prototype.focus=function(){var e;return!!(null===(e=this._rootComponent.current)||void 0===e?void 0:e.focus())},t.prototype._getColumnReorderProps=function(){var e=this.props,t=e.columnReorderOptions;return e.columnReorderProps||t&&d(d({},t),{onColumnDragEnd:void 0})},t.prototype._getHeaderDragDropOptions=function(){return{selectionIndex:1,context:{data:this,index:0},canDrag:function(){return!1},canDrop:function(){return!0},onDragStart:function(){},updateDropState:this._updateDroppingState,onDrop:this._onDrop,onDragEnd:function(){},onDragOver:this._onDragOver}},t.prototype._isValidCurrentDropHintIndex=function(){return this._currentDropHintIndex>=0},t.prototype._isCheckboxColumnHidden=function(){var e=this.props,t=e.selectionMode,o=e.checkboxVisibility;return t===Kf.none||o===tv.hidden},t.prototype._resetDropHints=function(){this._currentDropHintIndex>=0&&(this._updateDropHintElement(this._dropHintDetails[this._currentDropHintIndex].dropHintElementRef,"none"),this._currentDropHintIndex=-1)},t.prototype._updateDropHintElement=function(e,t){e.childNodes[1].style.display=t,e.childNodes[0].style.display=t},t.prototype._isEventOnHeader=function(e){if(this._rootElement.current){var t=this._rootElement.current.getBoundingClientRect();if(e.clientX>t.left&&e.clientX<t.right&&e.clientY>t.top&&e.clientY<t.bottom)return $f.header}},t.prototype._renderColumnDivider=function(e){var t=this.props.columns,o=(void 0===t?Mv:t)[e],n=o.onRenderDivider;return n?n({column:o,columnIndex:e},this._renderColumnSizer):this._renderColumnSizer({column:o,columnIndex:e})},t.prototype._renderDropHint=function(e){var t=this._classNames,o=this.props.useFastIcons?ti:ii;return f.createElement("div",{key:"dropHintKey",className:t.dropHintStyle,id:"columnDropHint_"+e},f.createElement("div",{role:"presentation",key:"dropHintCircleKey",className:t.dropHintCaretStyle,"data-is-focusable":!1,"data-sizer-index":e,"aria-hidden":!0},f.createElement(o,{iconName:"CircleShapeSolid"})),f.createElement("div",{key:"dropHintLineKey","aria-hidden":!0,"data-is-focusable":!1,"data-sizer-index":e,className:t.dropHintLineStyle}))},t.prototype._onSizerDoubleClick=function(e,t){var o=this.props,n=o.onColumnAutoResized,r=o.columns;n&&n((void 0===r?Mv:r)[e],e)},t.prototype._onSelectionChanged=function(){var e=!!this.props.selection&&this.props.selection.isAllSelected();this.state.isAllSelected!==e&&this.setState({isAllSelected:e})},t.defaultProps={selectAllVisibility:Sv.visible,collapseAllVisibility:Xf.visible,useFastIcons:!0},t}(f.Component);function Nv(e,t,o,n){return e?t<=o&&t>=n:t>=o&&t<=n}function Bv(e,t,o){return e?t>=o:t<=o}function Fv(e,t,o){return e?t<=o:t>=o}function Av(e){e.stopPropagation()}var Lv=Vn(Rv,(function(e){var t,o,n,r,i=e.theme,a=e.className,s=e.isAllSelected,l=e.isResizingColumn,c=e.isSizing,u=e.isAllCollapsed,p=e.cellStyleProps,h=void 0===p?dv:p,m=i.semanticColors,g=i.palette,f=i.fonts,v=Qo(gv,i),b={iconForegroundColor:m.bodySubtext,headerForegroundColor:m.bodyText,headerBackgroundColor:m.bodyBackground,resizerColor:g.neutralTertiaryAlt},y={opacity:1,transition:"opacity 0.3s linear"},_=fv(e);return{root:[v.root,f.small,{display:"inline-block",background:b.headerBackgroundColor,position:"relative",minWidth:"100%",verticalAlign:"top",height:42,lineHeight:42,whiteSpace:"nowrap",boxSizing:"content-box",paddingBottom:"1px",paddingTop:"16px",borderBottom:"1px solid "+m.bodyDivider,cursor:"default",userSelect:"none",selectors:(t={},t["&:hover ."+v.check]={opacity:1},t["& ."+v.tooltipHost+" ."+v.checkTooltip]={display:"block"},t)},s&&v.isAllSelected,l&&v.isResizingColumn,a],check:[v.check,{height:42},{selectors:(o={},o["."+wo+" &:focus"]={opacity:1},o)}],cellWrapperPadded:{paddingRight:h.cellExtraRightPadding+h.cellRightPadding},cellIsCheck:[_,v.cellIsCheck,{position:"relative",padding:0,margin:0,display:"inline-flex",alignItems:"center",border:"none"},s&&{opacity:1}],cellIsGroupExpander:[_,{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:f.small.fontSize,padding:0,border:"none",width:36,color:g.neutralSecondary,selectors:{":hover":{backgroundColor:g.neutralLighter},":active":{backgroundColor:g.neutralLight}}}],cellIsActionable:{selectors:{":hover":{color:m.bodyText,background:m.listHeaderBackgroundHovered},":active":{background:m.listHeaderBackgroundPressed}}},cellIsEmpty:{textOverflow:"clip"},cellSizer:[v.cellSizer,{selectors:{"&::-moz-focus-inner":{border:0},"&":{outline:"transparent"}}},{display:"inline-block",position:"relative",cursor:"ew-resize",bottom:0,top:0,overflow:"hidden",height:"inherit",background:"transparent",zIndex:1,width:16,selectors:(n={":after":{content:'""',position:"absolute",top:0,bottom:0,width:1,background:b.resizerColor,opacity:0,left:"50%"},":focus:after":y,":hover:after":y},n["&."+v.isResizing+":after"]=[y,{boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.4)"}],n)}],cellIsResizing:v.isResizing,cellSizerStart:{margin:"0 -8px"},cellSizerEnd:{margin:0,marginLeft:-16},collapseButton:[v.collapseButton,{transformOrigin:"50% 50%",transition:"transform .1s linear"},u?[v.isCollapsed,{transform:"rotate(0deg)"}]:{transform:jn(i)?"rotate(-90deg)":"rotate(90deg)"}],checkTooltip:v.checkTooltip,sizingOverlay:c&&{position:"absolute",left:0,top:0,right:0,bottom:0,cursor:"ew-resize",background:"rgba(255, 255, 255, 0)",selectors:(r={},r[ro]=d({background:"transparent"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)},accessibleLabel:Ro,dropHintCircleStyle:[v.dropHintCircleStyle,{display:"inline-block",visibility:"hidden",position:"absolute",bottom:0,height:9,width:9,borderRadius:"50%",marginLeft:-5,top:34,overflow:"visible",zIndex:10,border:"1px solid "+g.themePrimary,background:g.white}],dropHintCaretStyle:[v.dropHintCaretStyle,{display:"none",position:"absolute",top:-28,left:-6.5,fontSize:f.medium.fontSize,color:g.themePrimary,overflow:"visible",zIndex:10}],dropHintLineStyle:[v.dropHintLineStyle,{display:"none",position:"absolute",bottom:0,top:0,overflow:"hidden",height:42,width:1,background:g.themePrimary,zIndex:10}],dropHintStyle:{display:"inline-block",position:"absolute"}}}),void 0,{scope:"DetailsHeader"}),Hv=function(e){var t=e.columns,o=e.columnStartIndex,n=e.rowClassNames,r=e.cellStyleProps,i=void 0===r?dv:r,a=e.item,s=e.itemIndex,l=e.onRenderItemColumn,c=e.getCellValueKey,u=e.cellsByColumn,d=e.enableUpdateAnimations,p=e.rowHeaderId,h=f.useRef(),m=h.current||(h.current={});return f.createElement("div",{className:n.fields,"data-automationid":"DetailsRowFields",role:"presentation"},t.map((function(e,t){var r=void 0===e.calculatedWidth?"auto":e.calculatedWidth+i.cellLeftPadding+i.cellRightPadding+(e.isPadded?i.cellExtraRightPadding:0),h=e.onRender,g=void 0===h?l:h,v=e.getValueKey,b=void 0===v?c:v,y=u&&e.key in u?u[e.key]:g?g(a,s,e):function(e,t){var o=e&&t&&t.fieldName?e[t.fieldName]:"";return null==o&&(o=""),"boolean"==typeof o?o.toString():o}(a,e),_=m[e.key],C=d&&b?b(a,s,e):void 0,S=!1;void 0!==C&&void 0!==_&&C!==_&&(S=!0),m[e.key]=C;var x=e.key+(void 0!==C?"-"+C:"");return f.createElement("div",{key:x,id:e.isRowHeader?p:void 0,role:e.isRowHeader?"rowheader":"gridcell","aria-readonly":!0,"aria-colindex":t+o+1,className:qr(e.className,e.isMultiline&&n.isMultiline,e.isRowHeader&&n.isRowHeader,n.cell,e.isPadded?n.cellPadded:n.cellUnpadded,S&&n.cellAnimation),style:{width:r},"data-automationid":"DetailsRowCell","data-automation-key":e.key},y)})))},Ov=Jn(),zv=[],Wv=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._cellMeasurer=f.createRef(),o._focusZone=f.createRef(),o._onSelectionChanged=function(){var e=Vv(o.props);Ns(e,o.state.selectionState)||o.setState({selectionState:e})},o._updateDroppingState=function(e,t){var n=o.state.isDropping,r=o.props,i=r.dragDropEvents,a=r.item;e?i.onDragEnter&&(o._droppingClassNames=i.onDragEnter(a,t)):i.onDragLeave&&i.onDragLeave(a,t),n!==e&&o.setState({isDropping:e})},Ui(o),o._events=new Os(o),o.state={selectionState:Vv(t),columnMeasureInfo:void 0,isDropping:!1},o._droppingClassNames="",o}return u(t,e),t.getDerivedStateFromProps=function(e,t){return d(d({},t),{selectionState:Vv(e)})},t.prototype.componentDidMount=function(){var e=this.props,t=e.dragDropHelper,o=e.selection,n=e.item,r=e.onDidMount;t&&this._root.current&&(this._dragDropSubscription=t.subscribe(this._root.current,this._events,this._getRowDragDropOptions())),o&&this._events.on(o,qf,this._onSelectionChanged),r&&n&&(this._onDidMountCalled=!0,r(this))},t.prototype.componentDidUpdate=function(e){var t=this.state,o=this.props,n=o.item,r=o.onDidMount,i=t.columnMeasureInfo;if(this.props.itemIndex===e.itemIndex&&this.props.item===e.item&&this.props.dragDropHelper===e.dragDropHelper||(this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this.props.dragDropHelper&&this._root.current&&(this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getRowDragDropOptions()))),i&&i.index>=0&&this._cellMeasurer.current){var a=this._cellMeasurer.current.getBoundingClientRect().width;i.onMeasureDone(a),this.setState({columnMeasureInfo:void 0})}n&&r&&!this._onDidMountCalled&&(this._onDidMountCalled=!0,r(this))},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.item,o=e.onWillUnmount;o&&t&&o(this),this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this._events.dispose()},t.prototype.shouldComponentUpdate=function(e,t){if(this.props.useReducedRowRenderer){var o=Vv(e);return this.state.selectionState.isSelected!==o.isSelected||!Ns(this.props,e)}return!0},t.prototype.render=function(){var e=this.props,t=e.className,o=e.columns,n=void 0===o?zv:o,r=e.dragDropEvents,i=e.item,a=e.itemIndex,s=e.id,l=e.flatIndexOffset,c=void 0===l?2:l,u=e.onRenderCheck,p=void 0===u?this._onRenderCheck:u,h=e.onRenderDetailsCheckbox,m=e.onRenderItemColumn,g=e.getCellValueKey,v=e.selectionMode,b=e.rowWidth,y=void 0===b?0:b,_=e.checkboxVisibility,C=e.getRowAriaLabel,S=e.getRowAriaDescribedBy,x=e.checkButtonAriaLabel,k=e.checkboxCellClassName,w=e.rowFieldsAs,I=void 0===w?Hv:w,D=e.selection,T=e.indentWidth,E=e.enableUpdateAnimations,P=e.compact,M=e.theme,R=e.styles,N=e.cellsByColumn,B=e.groupNestingDepth,F=e.useFastIcons,A=void 0===F||F,L=e.cellStyleProps,H=e.group,O=this.state,z=O.columnMeasureInfo,W=O.isDropping,V=this.state.selectionState,K=V.isSelected,U=void 0!==K&&K,G=V.isSelectionModal,j=void 0!==G&&G,q=r?!(!r.canDrag||!r.canDrag(i)):void 0,Y=W?this._droppingClassNames||"is-dropping":"",Z=C?C(i):void 0,X=S?S(i):void 0,Q=!!D&&D.canSelectItem(i,a),J=v===Kf.multiple,$=v!==Kf.none&&_!==tv.hidden,ee=v===Kf.none?void 0:U,te=H?a-H.startIndex+1:void 0,oe=H?H.count:void 0;this._classNames=d(d({},this._classNames),Ov(R,{theme:M,isSelected:U,canSelect:!J,anySelected:j,checkboxCellClassName:k,droppingClassName:Y,className:t,compact:P,enableUpdateAnimations:E,cellStyleProps:L}));var ne={isMultiline:this._classNames.isMultiline,isRowHeader:this._classNames.isRowHeader,cell:this._classNames.cell,cellAnimation:this._classNames.cellAnimation,cellPadded:this._classNames.cellPadded,cellUnpadded:this._classNames.cellUnpadded,fields:this._classNames.fields};Ns(this._rowClassNames||{},ne)||(this._rowClassNames=ne);var re=f.createElement(I,{rowClassNames:this._rowClassNames,rowHeaderId:s+"-header",cellsByColumn:N,columns:n,item:i,itemIndex:a,columnStartIndex:($?1:0)+(B?1:0),onRenderItemColumn:m,getCellValueKey:g,enableUpdateAnimations:E,cellStyleProps:L}),ie=this.props.role?this.props.role:"row";return f.createElement(vs,d({"data-is-focusable":!0},Tr(this.props,Dr),"boolean"==typeof q?{"data-is-draggable":q,draggable:q}:{},{direction:$i.horizontal,elementRef:this._root,componentRef:this._focusZone,role:ie,"aria-label":Z,"aria-describedby":X,className:this._classNames.root,"data-selection-index":a,"data-selection-touch-invoke":!0,"data-item-index":a,"aria-rowindex":void 0===te?a+c:void 0,"aria-level":B&&B+1||void 0,"aria-posinset":te,"aria-setsize":oe,"data-automationid":"DetailsRow",style:{minWidth:y},"aria-selected":ee,allowFocusRoot:!0}),$&&f.createElement("div",{role:"gridcell","aria-colindex":1,"data-selection-toggle":!0,className:this._classNames.checkCell},p({id:s?s+"-checkbox":void 0,selected:U,selectionMode:v,anySelected:j,"aria-label":x,"aria-labelledby":s?s+"-checkbox "+s+"-header":void 0,canSelect:Q,compact:P,className:this._classNames.check,theme:M,isVisible:_===tv.always,onRenderDetailsCheckbox:h,useFastIcons:A})),f.createElement(sv,{indentWidth:T,role:"gridcell",count:B-(this.props.collapseAllVisibility===Xf.hidden?1:0)}),i&&re,z&&f.createElement("span",{role:"presentation",className:qr(this._classNames.cellMeasurer,this._classNames.cell),ref:this._cellMeasurer},f.createElement(I,{rowClassNames:this._rowClassNames,rowHeaderId:s+"-header",columns:[z.column],item:i,itemIndex:a,columnStartIndex:($?1:0)+(B?1:0)+n.length,onRenderItemColumn:m,getCellValueKey:g})),f.createElement("span",{role:"checkbox",className:this._classNames.checkCover,"aria-checked":U,"data-selection-toggle":!0}))},t.prototype.measureCell=function(e,t){var o=this.props.columns,n=d({},(void 0===o?zv:o)[e]);n.minWidth=0,n.maxWidth=999999,delete n.calculatedWidth,this.setState({columnMeasureInfo:{index:e,column:n,onMeasureDone:t}})},t.prototype.focus=function(e){var t;return void 0===e&&(e=!1),!!(null===(t=this._focusZone.current)||void 0===t?void 0:t.focus(e))},t.prototype._onRenderCheck=function(e){return f.createElement(xv,d({},e))},t.prototype._getRowDragDropOptions=function(){var e=this.props,t=e.item,o=e.itemIndex,n=e.dragDropEvents;return{eventMap:e.eventsToRegister,selectionIndex:o,context:{data:t,index:o},canDrag:n.canDrag,canDrop:n.canDrop,onDragStart:n.onDragStart,updateDropState:this._updateDroppingState,onDrop:n.onDrop,onDragEnd:n.onDragEnd,onDragOver:n.onDragOver}},t}(f.Component);function Vv(e){var t,o=e.itemIndex,n=e.selection;return{isSelected:!!(null==n?void 0:n.isIndexSelected(o)),isSelectionModal:!!(null===(t=null==n?void 0:n.isModal)||void 0===t?void 0:t.call(n))}}var Kv,Uv,Gv=Vn(Wv,mv,void 0,{scope:"DetailsRow"}),jv={root:"ms-GroupedList",compact:"ms-GroupedList--Compact",group:"ms-GroupedList-group",link:"ms-Link",listCell:"ms-List-cell"},qv={root:"ms-GroupHeader",compact:"ms-GroupHeader--compact",check:"ms-GroupHeader-check",dropIcon:"ms-GroupHeader-dropIcon",expand:"ms-GroupHeader-expand",isCollapsed:"is-collapsed",title:"ms-GroupHeader-title",isSelected:"is-selected",iconTag:"ms-Icon--Tag",group:"ms-GroupedList-group",isDropping:"is-dropping"},Yv="cubic-bezier(0.390, 0.575, 0.565, 1.000)";!function(e){e[e.xSmall=0]="xSmall",e[e.small=1]="small",e[e.medium=2]="medium",e[e.large=3]="large"}(Kv||(Kv={})),function(e){e[e.normal=0]="normal",e[e.large=1]="large"}(Uv||(Uv={}));var Zv=Jn(),Xv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.type,o=e.size,n=e.ariaLabel,r=e.ariaLive,i=e.styles,a=e.label,s=e.theme,l=e.className,c=e.labelPosition,u=n,p=Tr(this.props,Dr,["size"]),h=o;void 0===h&&void 0!==t&&(h=t===Uv.large?Kv.large:Kv.medium);var m=Zv(i,{theme:s,size:h,className:l,labelPosition:c});return f.createElement("div",d({},p,{className:m.root}),f.createElement("div",{className:m.circle}),a&&f.createElement("div",{className:m.label},a),u&&f.createElement("div",{role:"status","aria-live":r},f.createElement(ea,null,f.createElement("div",{className:m.screenReaderText},u))))},t.defaultProps={size:Kv.medium,ariaLive:"polite",labelPosition:"bottom"},t}(f.Component),Qv={root:"ms-Spinner",circle:"ms-Spinner-circle",label:"ms-Spinner-label"},Jv=jo((function(){return J({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}})})),$v=Vn(Xv,(function(e){var t,o=e.theme,n=e.size,r=e.className,i=e.labelPosition,a=o.palette,s=Qo(Qv,o);return{root:[s.root,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},"top"===i&&{flexDirection:"column-reverse"},"right"===i&&{flexDirection:"row"},"left"===i&&{flexDirection:"row-reverse"},r],circle:[s.circle,{boxSizing:"border-box",borderRadius:"50%",border:"1.5px solid "+a.themeLight,borderTopColor:a.themePrimary,animationName:Jv(),animationDuration:"1.3s",animationIterationCount:"infinite",animationTimingFunction:"cubic-bezier(.53,.21,.29,.67)",selectors:(t={},t[ro]=d({borderTopColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},n===Kv.xSmall&&["ms-Spinner--xSmall",{width:12,height:12}],n===Kv.small&&["ms-Spinner--small",{width:16,height:16}],n===Kv.medium&&["ms-Spinner--medium",{width:20,height:20}],n===Kv.large&&["ms-Spinner--large",{width:28,height:28}]],label:[s.label,o.fonts.small,{color:a.themePrimary,margin:"8px 0 0",textAlign:"center"},"top"===i&&{margin:"0 0 8px"},"right"===i&&{margin:"0 0 0 8px"},"left"===i&&{margin:"0 8px 0 0"}],screenReaderText:Ro}}),void 0,{scope:"Spinner"}),eb=Jn(),tb=function(e){function t(t){var o=e.call(this,t)||this;return o._toggleCollapse=function(){var e=o.props,t=e.group,n=e.onToggleCollapse,r=e.isGroupLoading,i=!o.state.isCollapsed,a=!i&&r&&r(t);o.setState({isCollapsed:i,isLoadingVisible:a}),n&&n(t)},o._onKeyUp=function(e){var t=o.props,n=t.group,r=t.onGroupHeaderKeyUp;if(r&&r(e,n),!e.defaultPrevented){var i=o.state.isCollapsed&&e.which===Yn(Un.right,o.props.theme);(!o.state.isCollapsed&&e.which===Yn(Un.left,o.props.theme)||i)&&(o._toggleCollapse(),e.stopPropagation(),e.preventDefault())}},o._onToggleClick=function(e){o._toggleCollapse(),e.stopPropagation(),e.preventDefault()},o._onToggleSelectGroupClick=function(e){var t=o.props,n=t.onToggleSelectGroup,r=t.group;n&&n(r),e.preventDefault(),e.stopPropagation()},o._onHeaderClick=function(){var e=o.props,t=e.group,n=e.onGroupHeaderClick,r=e.onToggleSelectGroup;n?n(t):r&&r(t)},o._onRenderTitle=function(e){var t=e.group,n=e.ariaColSpan;return t?f.createElement("div",{className:o._classNames.title,id:o._id,role:"gridcell","aria-colspan":n},f.createElement("span",null,t.name),f.createElement("span",{className:o._classNames.headerCount},"(",t.count,t.hasMoreData&&"+",")")):null},o._id=Va("GroupHeader"),o.state={isCollapsed:o.props.group&&o.props.group.isCollapsed,isLoadingVisible:!1},o}return u(t,e),t.getDerivedStateFromProps=function(e,t){if(e.group){var o=e.group.isCollapsed,n=e.isGroupLoading,r=!o&&n&&n(e.group);return d(d({},t),{isCollapsed:o||!1,isLoadingVisible:r||!1})}return t},t.prototype.render=function(){var e=this.props,t=e.group,o=e.groupLevel,n=void 0===o?0:o,r=e.viewport,i=e.selectionMode,a=e.loadingText,s=e.isSelected,l=void 0!==s&&s,c=e.selected,u=void 0!==c&&c,p=e.indentWidth,h=e.onRenderTitle,m=void 0===h?this._onRenderTitle:h,g=e.onRenderGroupHeaderCheckbox,v=e.isCollapsedGroupSelectVisible,b=void 0===v||v,y=e.expandButtonProps,_=e.expandButtonIcon,C=e.selectAllButtonProps,S=e.theme,x=e.styles,k=e.className,w=e.compact,I=e.ariaPosInSet,D=e.ariaSetSize,T=e.ariaRowIndex,E=e.useFastIcons?this._fastDefaultCheckboxRender:this._defaultCheckboxRender,P=g?Wh(g,E):E,M=this.state,R=M.isCollapsed,N=M.isLoadingVisible,B=i===Kf.multiple,F=B&&(b||!(t&&t.isCollapsed)),A=u||l,L=jn(S);return this._classNames=eb(x,{theme:S,className:k,selected:A,isCollapsed:R,compact:w}),t?f.createElement("div",{className:this._classNames.root,style:r?{minWidth:r.width}:{},onClick:this._onHeaderClick,role:"row","aria-setsize":D,"aria-posinset":I,"aria-rowindex":T,"data-is-focusable":!0,onKeyUp:this._onKeyUp,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabel?void 0:this._id,"aria-expanded":!this.state.isCollapsed,"aria-selected":B?A:void 0,"aria-level":n+1},f.createElement("div",{className:this._classNames.groupHeaderContainer,role:"presentation"},F?f.createElement("div",{role:"gridcell"},f.createElement("button",d({"data-is-focusable":!1,type:"button",className:this._classNames.check,role:"checkbox",id:this._id+"-check","aria-checked":A,"aria-labelledby":this._id+"-check "+this._id,"data-selection-toggle":!0,onClick:this._onToggleSelectGroupClick},C),P({checked:A,theme:S},P))):i!==Kf.none&&f.createElement(sv,{indentWidth:48,count:1}),f.createElement(sv,{indentWidth:p,count:n}),f.createElement("div",{className:this._classNames.dropIcon,role:"presentation"},f.createElement(ii,{iconName:"Tag"})),f.createElement("div",{role:"gridcell"},f.createElement("button",d({"data-is-focusable":!1,type:"button",className:this._classNames.expand,onClick:this._onToggleClick,"aria-expanded":!this.state.isCollapsed},y),f.createElement(ii,{className:this._classNames.expandIsCollapsed,iconName:_||(L?"ChevronLeftMed":"ChevronRightMed")}))),m(this.props,this._onRenderTitle),N&&f.createElement($v,{label:a}))):null},t.prototype._defaultCheckboxRender=function(e){return f.createElement(Eh,{checked:e.checked})},t.prototype._fastDefaultCheckboxRender=function(e){return f.createElement(ob,{theme:e.theme,checked:e.checked})},t.defaultProps={expandButtonProps:{"aria-label":"expand collapse group"}},t}(f.Component),ob=f.memo((function(e){return f.createElement(Eh,{theme:e.theme,checked:e.checked,className:e.className,useFastIcons:!0})})),nb=Vn(tb,(function(e){var t,o,n,r,i,a=e.theme,s=e.className,l=e.selected,c=e.isCollapsed,u=e.compact,d=dv.cellLeftPadding,p=u?40:48,h=a.semanticColors,m=a.palette,g=a.fonts,f=Qo(qv,a),v=[To(a),{cursor:"default",background:"none",backgroundColor:"transparent",border:"none",padding:0}];return{root:[f.root,To(a),a.fonts.medium,{borderBottom:"1px solid "+h.listBackground,cursor:"default",userSelect:"none",selectors:(t={":hover":{background:h.listItemBackgroundHovered,color:h.actionLinkHovered}},t["&:hover ."+f.check]={opacity:1},t["."+wo+" &:focus ."+f.check]={opacity:1},t[":global(."+f.group+"."+f.isDropping+")"]={selectors:(o={},o["& > ."+f.root+" ."+f.dropIcon]={transition:"transform "+Le.durationValue4+" cubic-bezier(0.075, 0.820, 0.165, 1.000) opacity "+Le.durationValue1+" "+Yv,transitionDelay:Le.durationValue3,opacity:1,transform:"rotate(0.2deg) scale(1);"},o["."+f.check]={opacity:0},o)},t)},l&&[f.isSelected,{background:h.listItemBackgroundChecked,selectors:(n={":hover":{background:h.listItemBackgroundCheckedHovered}},n[""+f.check]={opacity:1},n)}],u&&[f.compact,{border:"none"}],s],groupHeaderContainer:[{display:"flex",alignItems:"center",height:p}],headerCount:[{padding:"0px 4px"}],check:[f.check,v,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:1,marginTop:-1,opacity:0,width:48,height:p,selectors:(r={},r["."+wo+" &:focus"]={opacity:1},r)}],expand:[f.expand,v,{display:"flex",alignItems:"center",justifyContent:"center",fontSize:g.small.fontSize,width:36,height:p,color:l?m.neutralPrimary:m.neutralSecondary,selectors:{":hover":{backgroundColor:l?m.neutralQuaternary:m.neutralLight},":active":{backgroundColor:l?m.neutralTertiaryAlt:m.neutralQuaternaryAlt}}}],expandIsCollapsed:[c?[f.isCollapsed,{transform:"rotate(0deg)",transformOrigin:"50% 50%",transition:"transform .1s linear"}]:{transform:jn(a)?"rotate(-90deg)":"rotate(90deg)",transformOrigin:"50% 50%",transition:"transform .1s linear"}],title:[f.title,{paddingLeft:d,fontSize:u?g.medium.fontSize:g.mediumPlus.fontSize,fontWeight:c?qe.regular:qe.semibold,cursor:"pointer",outline:0,whiteSpace:"nowrap",textOverflow:"ellipsis"}],dropIcon:[f.dropIcon,{position:"absolute",left:-26,fontSize:Ye.large,color:m.neutralSecondary,transition:"transform "+Le.durationValue2+" cubic-bezier(0.600, -0.280, 0.735, 0.045), opacity "+Le.durationValue4+" "+Yv,opacity:0,transform:"rotate(0.2deg) scale(0.65)",transformOrigin:"10px 10px",selectors:(i={},i[":global(."+f.iconTag+")"]={position:"absolute"},i)}]}}),void 0,{scope:"GroupHeader"}),rb={root:"ms-GroupShowAll",link:"ms-Link"},ib=Jn(),ab=Vn((function(e){var t=e.group,o=e.groupLevel,n=e.showAllLinkText,r=void 0===n?"Show All":n,i=e.styles,a=e.theme,s=e.onToggleSummarize,l=ib(i,{theme:a}),c=(0,f.useCallback)((function(e){s(t),e.stopPropagation(),e.preventDefault()}),[s,t]);return t?f.createElement("div",{className:l.root},f.createElement(sv,{count:o}),f.createElement(Rs,{onClick:c},r)):null}),(function(e){var t,o=e.theme,n=o.fonts,r=Qo(rb,o);return{root:[r.root,{position:"relative",padding:"10px 84px",cursor:"pointer",selectors:(t={},t["."+r.link]={fontSize:n.small.fontSize},t)}]}}),void 0,{scope:"GroupShowAll"}),sb={root:"ms-groupFooter"},lb=Jn(),cb=Vn((function(e){var t=e.group,o=e.groupLevel,n=e.footerText,r=e.indentWidth,i=e.styles,a=e.theme,s=lb(i,{theme:a});return t&&n?f.createElement("div",{className:s.root},f.createElement(sv,{indentWidth:r,count:o}),n):null}),(function(e){var t=e.theme,o=e.className,n=Qo(sb,t);return{root:[t.fonts.medium,n.root,{position:"relative",padding:"5px 38px"},o]}}),void 0,{scope:"GroupFooter"}),ub=function(e){function t(o){var n=e.call(this,o)||this;n._root=f.createRef(),n._list=f.createRef(),n._subGroupRefs={},n._droppingClassName="",n._onRenderGroupHeader=function(e){return f.createElement(nb,d({},e))},n._onRenderGroupShowAll=function(e){return f.createElement(ab,d({},e))},n._onRenderGroupFooter=function(e){return f.createElement(cb,d({},e))},n._renderSubGroup=function(e,o){var r=n.props,i=r.dragDropEvents,a=r.dragDropHelper,s=r.eventsToRegister,l=r.getGroupItemLimit,c=r.groupNestingDepth,u=r.groupProps,d=r.items,p=r.headerProps,h=r.showAllProps,m=r.footerProps,g=r.listProps,v=r.onRenderCell,b=r.selection,y=r.selectionMode,_=r.viewport,C=r.onRenderGroupHeader,S=r.onRenderGroupShowAll,x=r.onRenderGroupFooter,k=r.onShouldVirtualize,w=r.group,I=r.compact,D=e.level?e.level+1:c;return!e||e.count>0||u&&u.showEmptyGroups?f.createElement(t,{ref:function(e){return n._subGroupRefs["subGroup_"+o]=e},key:n._getGroupKey(e,o),dragDropEvents:i,dragDropHelper:a,eventsToRegister:s,footerProps:m,getGroupItemLimit:l,group:e,groupIndex:o,groupNestingDepth:D,groupProps:u,headerProps:p,items:d,listProps:g,onRenderCell:v,selection:b,selectionMode:y,showAllProps:h,viewport:_,onRenderGroupHeader:C,onRenderGroupShowAll:S,onRenderGroupFooter:x,onShouldVirtualize:k,groups:w?w.children:[],compact:I}):null},n._getGroupDragDropOptions=function(){var e=n.props,t=e.group,o=e.groupIndex,r=e.dragDropEvents;return{eventMap:e.eventsToRegister,selectionIndex:-1,context:{data:t,index:o,isGroup:!0},updateDropState:n._updateDroppingState,canDrag:r.canDrag,canDrop:r.canDrop,onDrop:r.onDrop,onDragStart:r.onDragStart,onDragEnter:r.onDragEnter,onDragLeave:r.onDragLeave,onDragEnd:r.onDragEnd,onDragOver:r.onDragOver}},n._updateDroppingState=function(e,t){var o=n.state.isDropping,r=n.props,i=r.dragDropEvents,a=r.group;o!==e&&(o?i&&i.onDragLeave&&i.onDragLeave(a,t):i&&i.onDragEnter&&(n._droppingClassName=i.onDragEnter(a,t)),n.setState({isDropping:e}))};var r=o.selection,i=o.group;return Ui(n),n._id=Va("GroupedListSection"),n.state={isDropping:!1,isSelected:!(!r||!i)&&r.isRangeSelected(i.startIndex,i.count)},n._events=new Os(n),n}return u(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.dragDropHelper,o=e.selection;t&&this._root.current&&(this._dragDropSubscription=t.subscribe(this._root.current,this._events,this._getGroupDragDropOptions())),o&&this._events.on(o,qf,this._onSelectionChange)},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._dragDropSubscription&&this._dragDropSubscription.dispose()},t.prototype.componentDidUpdate=function(e){this.props.group===e.group&&this.props.groupIndex===e.groupIndex&&this.props.dragDropHelper===e.dragDropHelper||(this._dragDropSubscription&&(this._dragDropSubscription.dispose(),delete this._dragDropSubscription),this.props.dragDropHelper&&this._root.current&&(this._dragDropSubscription=this.props.dragDropHelper.subscribe(this._root.current,this._events,this._getGroupDragDropOptions())))},t.prototype.render=function(){var e=this.props,t=e.getGroupItemLimit,o=e.group,n=e.groupIndex,r=e.headerProps,i=e.showAllProps,a=e.footerProps,s=e.viewport,l=e.selectionMode,c=e.onRenderGroupHeader,u=void 0===c?this._onRenderGroupHeader:c,p=e.onRenderGroupShowAll,h=void 0===p?this._onRenderGroupShowAll:p,m=e.onRenderGroupFooter,g=void 0===m?this._onRenderGroupFooter:m,v=e.onShouldVirtualize,b=e.groupedListClassNames,y=e.groups,_=e.compact,C=e.listProps,S=void 0===C?{}:C,x=this.state.isSelected,k=o&&t?t(o):1/0,w=o&&!o.children&&!o.isCollapsed&&!o.isShowingAll&&(o.count>k||o.hasMoreData),I=o&&o.children&&o.children.length>0,D=S.version,T={group:o,groupIndex:n,groupLevel:o?o.level:0,isSelected:x,selected:x,viewport:s,selectionMode:l,groups:y,compact:_},E={groupedListId:this._id,ariaSetSize:y?y.length:void 0,ariaPosInSet:void 0!==n?n+1:void 0},P=d(d(d({},r),T),E),M=d(d({},i),T),R=d(d({},a),T),N=!!this.props.dragDropHelper&&this._getGroupDragDropOptions().canDrag(o)&&!!this.props.dragDropEvents.canDragGroups;return f.createElement("div",d({ref:this._root},N&&{draggable:!0},{className:qr(b&&b.group,this._getDroppingClassName()),role:"presentation"}),u(P,this._onRenderGroupHeader),o&&o.isCollapsed?null:I?f.createElement(Sf,{role:"presentation",ref:this._list,items:o?o.children:[],onRenderCell:this._renderSubGroup,getItemCountForPage:this._returnOne,onShouldVirtualize:v,version:D,id:this._id}):this._onRenderGroup(k),o&&o.isCollapsed?null:w&&h(M,this._onRenderGroupShowAll),g(R,this._onRenderGroupFooter))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this.forceListUpdate()},t.prototype.forceListUpdate=function(){var e=this.props.group;if(this._list.current){if(this._list.current.forceUpdate(),e&&e.children&&e.children.length>0)for(var t=e.children.length,o=0;o<t;o++){var n;(n=this._list.current.pageRefs["subGroup_"+String(o)])&&n.forceListUpdate()}}else(n=this._subGroupRefs["subGroup_"+String(0)])&&n.forceListUpdate()},t.prototype._onSelectionChange=function(){var e=this.props,t=e.group,o=e.selection;if(o&&t){var n=o.isRangeSelected(t.startIndex,t.count);n!==this.state.isSelected&&this.setState({isSelected:n})}},t.prototype._onRenderGroupCell=function(e,t,o){return function(n,r){return e(t,n,r,o)}},t.prototype._onRenderGroup=function(e){var t=this.props,o=t.group,n=t.items,r=t.onRenderCell,i=t.listProps,a=t.groupNestingDepth,s=t.onShouldVirtualize,l=t.groupProps,c=o&&!o.isShowingAll?o.count:n.length,u=o?o.startIndex:0;return f.createElement(Sf,d({role:l&&l.role?l.role:"rowgroup","aria-label":null==o?void 0:o.name,items:n,onRenderCell:this._onRenderGroupCell(r,a,o),ref:this._list,renderCount:Math.min(c,e),startIndex:u,onShouldVirtualize:s,id:this._id},i))},t.prototype._returnOne=function(){return 1},t.prototype._getGroupKey=function(e,t){return"group-"+(e&&e.key?e.key:String(e.level)+String(t))},t.prototype._getDroppingClassName=function(){var e=this.state.isDropping,t=this.props,o=t.group,n=t.groupedListClassNames;return qr((e=!(!o||!e))&&this._droppingClassName,e&&"is-dropping",e&&n&&n.groupIsDropping)},t}(f.Component),db=Jn(),pb=pv.rowHeight,hb=pv.compactRowHeight,mb=function(e){function t(t){var o=e.call(this,t)||this;o._list=f.createRef(),o._renderGroup=function(e,t){var n=o.props,r=n.dragDropEvents,i=n.dragDropHelper,a=n.eventsToRegister,s=n.groupProps,l=n.items,c=n.listProps,u=n.onRenderCell,p=n.selectionMode,h=n.selection,m=n.viewport,g=n.onShouldVirtualize,v=n.groups,b=n.compact,y={onToggleSelectGroup:o._onToggleSelectGroup,onToggleCollapse:o._onToggleCollapse,onToggleSummarize:o._onToggleSummarize},_=d(d({},s.headerProps),y),C=d(d({},s.showAllProps),y),S=d(d({},s.footerProps),y),x=o._getGroupNestingDepth();if(!s.showEmptyGroups&&e&&0===e.count)return null;var k=d(d({},c||{}),{version:o.state.version});return f.createElement(ub,{key:o._getGroupKey(e,t),dragDropEvents:r,dragDropHelper:i,eventsToRegister:a,footerProps:S,getGroupItemLimit:s&&s.getGroupItemLimit,group:e,groupIndex:t,groupNestingDepth:x,groupProps:s,headerProps:_,listProps:k,items:l,onRenderCell:u,onRenderGroupHeader:s.onRenderHeader,onRenderGroupShowAll:s.onRenderShowAll,onRenderGroupFooter:s.onRenderFooter,selectionMode:p,selection:h,showAllProps:C,viewport:m,onShouldVirtualize:g,groupedListClassNames:o._classNames,groups:v,compact:b})},o._getDefaultGroupItemLimit=function(e){return e.children&&e.children.length>0?e.children.length:e.count},o._getGroupItemLimit=function(e){var t=o.props.groupProps;return(t&&t.getGroupItemLimit?t.getGroupItemLimit:o._getDefaultGroupItemLimit)(e)},o._getGroupHeight=function(e){var t=o.props.compact?hb:pb;return t+(e.isCollapsed?0:t*o._getGroupItemLimit(e))},o._getPageHeight=function(e){var t=o.state.groups,n=o.props.getGroupHeight,r=void 0===n?o._getGroupHeight:n,i=t&&t[e];return i?r(i,e):0},o._onToggleCollapse=function(e){var t=o.props.groupProps,n=t&&t.headerProps&&t.headerProps.onToggleCollapse;e&&(n&&n(e),e.isCollapsed=!e.isCollapsed,o._updateIsSomeGroupExpanded(),o.forceUpdate())},o._onToggleSelectGroup=function(e){var t=o.props,n=t.selection,r=t.selectionMode;e&&n&&r===Kf.multiple&&n.toggleRangeSelected(e.startIndex,e.count)},o._isInnerZoneKeystroke=function(e){return e.which===Yn(Un.right)},o._onToggleSummarize=function(e){var t=o.props.groupProps,n=t&&t.showAllProps&&t.showAllProps.onToggleSummarize;n?n(e):(e&&(e.isShowingAll=!e.isShowingAll),o.forceUpdate())},o._getPageSpecification=function(e){var t=o.state.groups,n=t&&t[e];return{key:n&&n.key}},Ui(o),o._isSomeGroupExpanded=o._computeIsSomeGroupExpanded(t.groups);var n=t.listProps,r=(void 0===n?{}:n).version,i=void 0===r?{}:r;return o.state={groups:t.groups,items:t.items,listProps:t.listProps,version:i},o}return u(t,e),t.getDerivedStateFromProps=function(e,t){var o=e.groups,n=e.selectionMode,r=e.compact,i=e.items,a=e.listProps,s=a&&a.version,l=d(d({},t),{selectionMode:n,compact:r,groups:o,listProps:a}),c=!1;return s===(t.listProps&&t.listProps.version)&&i===t.items&&o===t.groups&&n===t.selectionMode&&r===t.compact||(c=!0),o!==t.groups&&(l=d(d({},l),{groups:o})),n===t.selectionMode&&r===t.compact||(c=!0),c&&(l=d(d({},l),{version:{}})),l},t.prototype.scrollToIndex=function(e,t,o){this._list.current&&this._list.current.scrollToIndex(e,t,o)},t.prototype.getStartItemIndexInView=function(){return this._list.current.getStartItemIndexInView()||0},t.prototype.componentDidMount=function(){var e=this.props,t=e.groupProps,o=e.groups,n=void 0===o?[]:o;t&&t.isAllGroupsCollapsed&&this._setGroupsCollapsedState(n,t.isAllGroupsCollapsed)},t.prototype.render=function(){var e=this.props,t=e.className,o=e.usePageCache,n=e.onShouldVirtualize,r=e.theme,i=e.role,a=void 0===i?"treegrid":i,s=e.styles,l=e.compact,c=e.focusZoneProps,u=void 0===c?{}:c,p=e.rootListProps,h=void 0===p?{}:p,m=this.state,g=m.groups,v=m.version;this._classNames=db(s,{theme:r,className:t,compact:l});var b=u.shouldEnterInnerZone,y=void 0===b?this._isInnerZoneKeystroke:b;return f.createElement(vs,d({direction:$i.vertical,"data-automationid":"GroupedList","data-is-scrollable":"false",role:"presentation"},u,{shouldEnterInnerZone:y,className:qr(this._classNames.root,u.className)}),g?f.createElement(Sf,d({ref:this._list,role:a,items:g,onRenderCell:this._renderGroup,getItemCountForPage:this._returnOne,getPageHeight:this._getPageHeight,getPageSpecification:this._getPageSpecification,usePageCache:o,onShouldVirtualize:n,version:v},h)):this._renderGroup(void 0,0))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this._forceListUpdates()},t.prototype.toggleCollapseAll=function(e){var t=this.state.groups,o=void 0===t?[]:t,n=this.props.groupProps,r=n&&n.onToggleCollapseAll;o.length>0&&(r&&r(e),this._setGroupsCollapsedState(o,e),this._updateIsSomeGroupExpanded(),this.forceUpdate())},t.prototype._setGroupsCollapsedState=function(e,t){for(var o=0;o<e.length;o++)e[o].isCollapsed=t},t.prototype._returnOne=function(){return 1},t.prototype._getGroupKey=function(e,t){return"group-"+(e&&e.key?e.key:String(t))},t.prototype._getGroupNestingDepth=function(){for(var e=0,t=this.state.groups;t&&t.length>0;)e++,t=t[0].children;return e},t.prototype._forceListUpdates=function(e){this.setState({version:{}})},t.prototype._computeIsSomeGroupExpanded=function(e){var t=this;return!(!e||!e.some((function(e){return e.children?t._computeIsSomeGroupExpanded(e.children):!e.isCollapsed})))},t.prototype._updateIsSomeGroupExpanded=function(){var e=this.state.groups,t=this.props.onGroupExpandStateChanged,o=this._computeIsSomeGroupExpanded(e);this._isSomeGroupExpanded!==o&&(t&&t(o),this._isSomeGroupExpanded=o)},t.defaultProps={selectionMode:Kf.multiple,isHeaderVisible:!0,groupProps:{},compact:!1},t}(f.Component),gb=Vn(mb,(function(e){var t,o,n=e.theme,r=e.className,i=e.compact,a=n.palette,s=Qo(jv,n);return{root:[s.root,n.fonts.small,{position:"relative",selectors:(t={},t["."+s.listCell]={minHeight:38},t)},i&&[s.compact,{selectors:(o={},o["."+s.listCell]={minHeight:32},o)}],r],group:[s.group,{transition:"background-color "+Le.durationValue2+" cubic-bezier(0.445, 0.050, 0.550, 0.950)"}],groupIsDropping:{backgroundColor:a.neutralLight}}}),void 0,{scope:"GroupedList"});function fb(e){var t;return e&&(e===window?t={left:0,top:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:e.getBoundingClientRect&&(t=e.getBoundingClientRect())),t}function vb(e){return function(t){function o(e){var o=t.call(this,e)||this;return o._root=f.createRef(),o._registerResizeObserver=function(){var e=at(o._root.current);o._viewportResizeObserver=new e.ResizeObserver(o._onAsyncResize),o._viewportResizeObserver.observe(o._root.current)},o._unregisterResizeObserver=function(){o._viewportResizeObserver&&(o._viewportResizeObserver.disconnect(),delete o._viewportResizeObserver)},o._updateViewport=function(e){var t=o.state.viewport,n=o._root.current,r=fb(es(n)),i=fb(n);((i&&i.width)!==t.width||(r&&r.height)!==t.height)&&o._resizeAttempts<3&&i&&r?(o._resizeAttempts++,o.setState({viewport:{width:i.width,height:r.height}},(function(){o._updateViewport(e)}))):(o._resizeAttempts=0,e&&o._composedComponentInstance&&o._composedComponentInstance.forceUpdate())},o._async=new Zi(o),o._events=new Os(o),o._resizeAttempts=0,o.state={viewport:{width:0,height:0}},o}return u(o,t),o.prototype.componentDidMount=function(){var e=this.props,t=e.skipViewportMeasures,o=e.disableResizeObserver,n=at(this._root.current);this._onAsyncResize=this._async.debounce(this._onAsyncResize,500,{leading:!1}),t||(!o&&this._isResizeObserverAvailable()?this._registerResizeObserver():this._events.on(n,"resize",this._onAsyncResize),this._updateViewport())},o.prototype.componentDidUpdate=function(e){var t=e.skipViewportMeasures,o=this.props,n=o.skipViewportMeasures,r=o.disableResizeObserver,i=at(this._root.current);n!==t&&(n?(this._unregisterResizeObserver(),this._events.off(i,"resize",this._onAsyncResize)):(!r&&this._isResizeObserverAvailable()?this._viewportResizeObserver||this._registerResizeObserver():this._events.on(i,"resize",this._onAsyncResize),this._updateViewport()))},o.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose(),this._unregisterResizeObserver()},o.prototype.render=function(){var t=this.state.viewport,o=t.width>0&&t.height>0?t:void 0;return f.createElement("div",{className:"ms-Viewport",ref:this._root,style:{minWidth:1,minHeight:1}},f.createElement(e,d({ref:this._updateComposedComponentRef,viewport:o},this.props)))},o.prototype.forceUpdate=function(){this._updateViewport(!0)},o.prototype._onAsyncResize=function(){this._updateViewport()},o.prototype._isResizeObserverAvailable=function(){var e=at(this._root.current);return e&&e.ResizeObserver},o}(hu)}var bb=Jn(),yb=100,_b=function(e){var t=e.selection,o=e.ariaLabelForListHeader,n=e.ariaLabelForSelectAllCheckbox,r=e.ariaLabelForSelectionColumn,i=e.className,a=e.checkboxVisibility,s=e.compact,l=e.constrainMode,c=e.dragDropEvents,u=e.groups,p=e.groupProps,h=e.indentWidth,g=e.items,v=e.isPlaceholderData,b=e.isHeaderVisible,y=e.layoutMode,_=e.onItemInvoked,C=e.onItemContextMenu,S=e.onColumnHeaderClick,x=e.onColumnHeaderContextMenu,k=e.selectionMode,w=void 0===k?t.mode:k,I=e.selectionPreservedOnEmptyClick,D=e.selectionZoneProps,T=e.ariaLabel,E=e.ariaLabelForGrid,P=e.rowElementEventMap,M=e.shouldApplyApplicationRole,R=void 0!==M&&M,N=e.getKey,B=e.listProps,F=e.usePageCache,A=e.onShouldVirtualize,L=e.viewport,H=e.minimumPixelsForDrag,O=e.getGroupHeight,z=e.styles,W=e.theme,V=e.cellStyleProps,K=void 0===V?dv:V,U=e.onRenderCheckbox,G=e.useFastIcons,j=e.dragDropHelper,q=e.adjustedColumns,Y=e.isCollapsed,Z=e.isSizing,X=e.isSomeGroupExpanded,Q=e.version,J=e.rootRef,$=e.listRef,ee=e.focusZoneRef,te=e.columnReorderOptions,oe=e.groupedListRef,ne=e.headerRef,re=e.onGroupExpandStateChanged,ie=e.onColumnIsSizingChanged,ae=e.onRowDidMount,se=e.onRowWillUnmount,le=e.disableSelectionZone,ce=e.onColumnResized,ue=e.onColumnAutoResized,de=e.onToggleCollapse,pe=e.onActiveRowChanged,he=e.onBlur,me=e.rowElementEventMap,ge=e.onRenderMissingItem,fe=e.onRenderItemColumn,ve=e.getCellValueKey,be=e.getRowAriaLabel,ye=e.getRowAriaDescribedBy,_e=e.checkButtonAriaLabel,Ce=e.checkButtonGroupAriaLabel,Se=e.checkboxCellClassName,xe=e.useReducedRowRenderer,ke=e.enableUpdateAnimations,we=e.enterModalSelectionOnTouch,Ie=e.onRenderDefaultRow,De=e.selectionZoneRef,Te="grid",Ee=e.role?e.role:Te,Pe=Va("row"),Me=function(e){for(var t=0,o=e;o&&o.length>0;)t++,o=o[0].children;return t}(u),Re=function(e){return f.useMemo((function(){var t={};if(e)for(var o=1,n=1,r=0,i=e;r<i.length;r++){var a=i[r];t[a.key]={numOfGroupHeadersBeforeItem:n,totalRowCount:o},n++,o+=a.count+1}return t}),[e])}(u),Ne=f.useMemo((function(){return d({renderedWindowsAhead:Z?0:2,renderedWindowsBehind:Z?0:2,getKey:N,version:Q},B)}),[Z,N,Q,B]),Be=Sv.none;if(w===Kf.single&&(Be=Sv.hidden),w===Kf.multiple){var Fe=p&&p.headerProps&&p.headerProps.isCollapsedGroupSelectVisible;void 0===Fe&&(Fe=!0),Be=Fe||!u||X?Sv.visible:Sv.hidden}a===tv.hidden&&(Be=Sv.none);var Ae=f.useCallback((function(e){return f.createElement(Lv,d({},e))}),[]),Le=f.useCallback((function(){return null}),[]),He=e.onRenderDetailsHeader,Oe=f.useMemo((function(){return He?Wh(He,Ae):Ae}),[He,Ae]),ze=e.onRenderDetailsFooter,We=f.useMemo((function(){return ze?Wh(ze,Le):Le}),[ze,Le]),Ve=f.useMemo((function(){return{columns:q,groupNestingDepth:Me,selection:t,selectionMode:w,viewport:L,checkboxVisibility:a,indentWidth:h,cellStyleProps:K}}),[q,Me,t,w,L,a,h,K]),Ke=te&&te.onDragEnd,Ue=f.useCallback((function(e,t){var o=e.dropLocation,n=$f.outside;if(Ke){if(o&&o!==$f.header)n=o;else if(J.current){var r=J.current.getBoundingClientRect();t.clientX>r.left&&t.clientX<r.right&&t.clientY>r.top&&t.clientY<r.bottom&&(n=$f.surface)}Ke(n)}}),[Ke,J]),Ge=f.useMemo((function(){if(te)return d(d({},te),{onColumnDragEnd:Ue})}),[te,Ue]),je=(b?1:0)+function(e){var t=0;if(e)for(var o=m(e),n=void 0;o&&o.length>0;)++t,(n=o.pop())&&n.children&&o.push.apply(o,n.children);return t}(u)+(g?g.length:0),qe=(Be!==Sv.none?1:0)+(q?q.length:0)+(u?1:0),Ye=f.useMemo((function(){return bb(z,{theme:W,compact:s,isFixed:y===ev.fixedColumns,isHorizontalConstrained:l===Jf.horizontalConstrained,className:i})}),[z,W,s,y,l,i]),Ze=p&&p.onRenderFooter,Xe=f.useMemo((function(){return Ze?function(e,o){return Ze(d(d({},e),{columns:q,groupNestingDepth:Me,indentWidth:h,selection:t,selectionMode:w,viewport:L,checkboxVisibility:a,cellStyleProps:K}),o)}:void 0}),[Ze,q,Me,h,t,w,L,a,K]),Qe=p&&p.onRenderHeader,Je=f.useMemo((function(){return Qe?function(e,o){var n,r,i=e.groupIndex,s=void 0!==i?null===(r=null===(n=e.groups)||void 0===n?void 0:n[i])||void 0===r?void 0:r.key:void 0,l=void 0!==s&&Re[s]?Re[s].totalRowCount:0;return Qe(d(d({},e),{columns:q,groupNestingDepth:Me,indentWidth:h,selection:t,selectionMode:a!==tv.hidden?w:Kf.none,viewport:L,checkboxVisibility:a,cellStyleProps:K,ariaColSpan:q.length,ariaPosInSet:void 0,ariaSetSize:void 0,ariaRowCount:void 0,ariaRowIndex:void 0!==i?l+(b?1:0):void 0}),o)}:function(e,t){var o,n,r=e.groupIndex,i=void 0!==r?null===(n=null===(o=e.groups)||void 0===o?void 0:o[r])||void 0===n?void 0:n.key:void 0,a=void 0!==i&&Re[i]?Re[i].totalRowCount:0;return t(d(d({},e),{ariaColSpan:q.length,ariaPosInSet:void 0,ariaSetSize:void 0,ariaRowCount:void 0,ariaRowIndex:void 0!==r?a+(b?1:0):void 0}))}}),[Qe,q,Me,h,b,t,w,L,a,K,Re]),$e=f.useMemo((function(){return d(d({},p),{role:Ee===Te?"rowgroup":"presentation",onRenderFooter:Xe,onRenderHeader:Je,headerProps:d({selectAllButtonProps:{"aria-label":Ce}},null==p?void 0:p.headerProps)})}),[p,Xe,Je,Ce,Ee]),et=Ei((function(){return jo((function(e){var t=0;return e.forEach((function(e){return t+=e.calculatedWidth||e.minWidth})),t}))})),tt=p&&p.collapseAllVisibility,ot=f.useMemo((function(){return et(q)}),[q,et]),nt=f.useCallback((function(o,n,r,i){var l=e.onRenderRow?Wh(e.onRenderRow,Ie):Ie,u=i?i.key:void 0,d=u&&Re[u]?Re[u].numOfGroupHeadersBeforeItem:0,p={item:n,itemIndex:r,flatIndexOffset:(b?2:1)+d,compact:s,columns:q,groupNestingDepth:o,id:Pe+"-"+r,selectionMode:w,selection:t,onDidMount:ae,onWillUnmount:se,onRenderItemColumn:fe,getCellValueKey:ve,eventsToRegister:me,dragDropEvents:c,dragDropHelper:j,viewport:L,checkboxVisibility:a,collapseAllVisibility:tt,getRowAriaLabel:be,getRowAriaDescribedBy:ye,checkButtonAriaLabel:_e,checkboxCellClassName:Se,useReducedRowRenderer:xe,indentWidth:h,cellStyleProps:K,onRenderDetailsCheckbox:U,enableUpdateAnimations:ke,rowWidth:ot,useFastIcons:G,role:Ee===Te?void 0:"presentation"};return n?l(p):ge?ge(r,p):null}),[s,q,w,t,Pe,ae,se,fe,ve,me,c,j,L,a,tt,be,ye,b,_e,Se,xe,h,K,U,ke,G,Ie,ge,e.onRenderRow,ot,Ee,Re]),rt=f.useCallback((function(e){return function(t,o){return nt(e,t,o)}}),[nt]),it=f.useCallback((function(e){return e.which===Yn(Un.right,W)}),[W]),at={componentRef:ee,className:Ye.focusZone,direction:$i.vertical,shouldEnterInnerZone:it,onActiveElementChanged:pe,shouldRaiseClicks:!1,onBlur:he},st=u?f.createElement(gb,{focusZoneProps:at,componentRef:oe,groups:u,groupProps:$e,items:g,onRenderCell:nt,role:"presentation",selection:t,selectionMode:a!==tv.hidden?w:Kf.none,dragDropEvents:c,dragDropHelper:j,eventsToRegister:P,listProps:Ne,onGroupExpandStateChanged:re,usePageCache:F,onShouldVirtualize:A,getGroupHeight:O,compact:s}):f.createElement(vs,d({},at),f.createElement(Sf,d({ref:$,role:"presentation",items:g,onRenderCell:rt(0),usePageCache:F,onShouldVirtualize:A},Ne))),lt=f.useCallback((function(e){e.which===Un.down&&ee.current&&ee.current.focus()&&(0===t.getSelectedIndices().length&&t.setIndexSelected(0,!0,!1),e.preventDefault(),e.stopPropagation())}),[t,ee]),ct=f.useCallback((function(e){e.which!==Un.up||e.altKey||ne.current&&ne.current.focus()&&(e.preventDefault(),e.stopPropagation())}),[ne]);return f.createElement("div",d({ref:J,className:Ye.root,"data-automationid":"DetailsList","data-is-scrollable":"false","aria-label":T},R?{role:"application"}:{}),f.createElement(ks,null),f.createElement("div",{role:Ee,"aria-label":E,"aria-rowcount":v?-1:je,"aria-colcount":qe,"aria-readonly":"true","aria-busy":v},f.createElement("div",{onKeyDown:lt,role:"presentation",className:Ye.headerWrapper},b&&Oe({componentRef:ne,selectionMode:w,layoutMode:y,selection:t,columns:q,onColumnClick:S,onColumnContextMenu:x,onColumnResized:ce,onColumnIsSizingChanged:ie,onColumnAutoResized:ue,groupNestingDepth:Me,isAllCollapsed:Y,onToggleCollapseAll:de,ariaLabel:o,ariaLabelForSelectAllCheckbox:n,ariaLabelForSelectionColumn:r,selectAllVisibility:Be,collapseAllVisibility:p&&p.collapseAllVisibility,viewport:L,columnReorderProps:Ge,minimumPixelsForDrag:H,cellStyleProps:K,checkboxVisibility:a,indentWidth:h,onRenderDetailsCheckbox:U,rowWidth:et(q),useFastIcons:G},Oe)),f.createElement("div",{onKeyDown:ct,role:"presentation",className:Ye.contentWrapper},le?st:f.createElement(av,d({ref:De,selection:t,selectionPreservedOnEmptyClick:I,selectionMode:w,onItemInvoked:_,onItemContextMenu:C,enterModalOnTouch:we},D||{}),st)),We(d({},Ve))))},Cb=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._header=f.createRef(),o._groupedList=f.createRef(),o._list=f.createRef(),o._focusZone=f.createRef(),o._selectionZone=f.createRef(),o._onRenderRow=function(e,t){return f.createElement(Gv,d({},e))},o._getDerivedStateFromProps=function(e,t){var n=o.props,r=n.checkboxVisibility,i=n.items,a=n.setKey,s=n.selectionMode,l=void 0===s?o._selection.mode:s,c=n.columns,u=n.viewport,p=n.compact,h=n.dragDropEvents,m=(o.props.groupProps||{}).isAllGroupsCollapsed,g=void 0===m?void 0:m,f=e.viewport&&e.viewport.width||0,v=u&&u.width||0,b=e.setKey!==a||void 0===e.setKey,y=!1;e.layoutMode!==o.props.layoutMode&&(y=!0);var _=t;return b&&(o._initialFocusedIndex=e.initialFocusedIndex,_=d(d({},_),{focusedItemIndex:void 0!==o._initialFocusedIndex?o._initialFocusedIndex:-1})),o.props.disableSelectionZone||e.items===i||o._selection.setItems(e.items,b),e.checkboxVisibility===r&&e.columns===c&&f===v&&e.compact===p||(y=!0),_=d(d({},_),o._adjustColumns(e,_,!0)),e.selectionMode!==l&&(y=!0),void 0===g&&e.groupProps&&void 0!==e.groupProps.isAllGroupsCollapsed&&(_=d(d({},_),{isCollapsed:e.groupProps.isAllGroupsCollapsed,isSomeGroupExpanded:!e.groupProps.isAllGroupsCollapsed})),e.dragDropEvents!==h&&(o._dragDropHelper&&o._dragDropHelper.dispose(),o._dragDropHelper=e.dragDropEvents?new kv({selection:o._selection,minimumPixelsForDrag:e.minimumPixelsForDrag}):void 0,y=!0),y&&(_=d(d({},_),{version:{}})),_},o._onGroupExpandStateChanged=function(e){o.setState({isSomeGroupExpanded:e})},o._onColumnIsSizingChanged=function(e,t){o.setState({isSizing:t})},o._onRowDidMount=function(e){var t=e.props,n=t.item,r=t.itemIndex,i=o._getItemKey(n,r);o._activeRows[i]=e,o._setFocusToRowIfPending(e);var a=o.props.onRowDidMount;a&&a(n,r)},o._onRowWillUnmount=function(e){var t=o.props.onRowWillUnmount,n=e.props,r=n.item,i=n.itemIndex,a=o._getItemKey(r,i);delete o._activeRows[a],t&&t(r,i)},o._onToggleCollapse=function(e){o.setState({isCollapsed:e}),o._groupedList.current&&o._groupedList.current.toggleCollapseAll(e)},o._onColumnResized=function(e,t,n){var r=Math.max(e.minWidth||yb,t);o.props.onColumnResize&&o.props.onColumnResize(e,r,n),o._rememberCalculatedWidth(e,r),o.setState(d(d({},o._adjustColumns(o.props,o.state,!0,n)),{version:{}}))},o._onColumnAutoResized=function(e,t){var n=0,r=0,i=Object.keys(o._activeRows).length;for(var a in o._activeRows)o._activeRows.hasOwnProperty(a)&&o._activeRows[a].measureCell(t,(function(a){n=Math.max(n,a),++r===i&&o._onColumnResized(e,n,t)}))},o._onActiveRowChanged=function(e,t){var n=o.props,r=n.items,i=n.onActiveItemChanged;if(e&&e.getAttribute("data-item-index")){var a=Number(e.getAttribute("data-item-index"));a>=0&&(i&&i(r[a],a,t),o.setState({focusedItemIndex:a}))}},o._onBlur=function(e){o.setState({focusedItemIndex:-1})},Ui(o),o._async=new Zi(o),o._activeRows={},o._columnOverrides={},o.state={focusedItemIndex:-1,lastWidth:0,adjustedColumns:o._getAdjustedColumns(t,void 0),isSizing:!1,isCollapsed:t.groupProps&&t.groupProps.isAllGroupsCollapsed,isSomeGroupExpanded:t.groupProps&&!t.groupProps.isAllGroupsCollapsed,version:{},getDerivedStateFromProps:o._getDerivedStateFromProps},o._selection=t.selection||new Yf({onSelectionChanged:void 0,getKey:t.getKey,selectionMode:t.selectionMode}),o.props.disableSelectionZone||o._selection.setItems(t.items,!1),o._dragDropHelper=t.dragDropEvents?new kv({selection:o._selection,minimumPixelsForDrag:t.minimumPixelsForDrag}):void 0,o._initialFocusedIndex=t.initialFocusedIndex,o}return u(t,e),t.getDerivedStateFromProps=function(e,t){return t.getDerivedStateFromProps(e,t)},t.prototype.scrollToIndex=function(e,t,o){this._list.current&&this._list.current.scrollToIndex(e,t,o),this._groupedList.current&&this._groupedList.current.scrollToIndex(e,t,o)},t.prototype.focusIndex=function(e,t,o,n){void 0===t&&(t=!1);var r=this.props.items[e];if(r){this.scrollToIndex(e,o,n);var i=this._getItemKey(r,e),a=this._activeRows[i];a&&this._setFocusToRow(a,t)}},t.prototype.getStartItemIndexInView=function(){return this._list&&this._list.current?this._list.current.getStartItemIndexInView():this._groupedList&&this._groupedList.current?this._groupedList.current.getStartItemIndexInView():0},t.prototype.componentWillUnmount=function(){this._dragDropHelper&&this._dragDropHelper.dispose(),this._async.dispose()},t.prototype.componentDidUpdate=function(e,t){if(this._notifyColumnsResized(),void 0!==this._initialFocusedIndex&&(i=this.props.items[this._initialFocusedIndex])){var o=this._getItemKey(i,this._initialFocusedIndex);(n=this._activeRows[o])&&this._setFocusToRowIfPending(n)}if(this.props.items!==e.items&&this.props.items.length>0&&-1!==this.state.focusedItemIndex&&!Ca(this._root.current,document.activeElement,!1)){var n,r=this.state.focusedItemIndex<this.props.items.length?this.state.focusedItemIndex:this.props.items.length-1,i=this.props.items[r];o=this._getItemKey(i,this.state.focusedItemIndex),(n=this._activeRows[o])?this._setFocusToRow(n):this._initialFocusedIndex=r}this.props.onDidUpdate&&this.props.onDidUpdate(this)},t.prototype.render=function(){return f.createElement(_b,d({},this.props,this.state,{selection:this._selection,dragDropHelper:this._dragDropHelper,rootRef:this._root,listRef:this._list,groupedListRef:this._groupedList,focusZoneRef:this._focusZone,headerRef:this._header,selectionZoneRef:this._selectionZone,onGroupExpandStateChanged:this._onGroupExpandStateChanged,onColumnIsSizingChanged:this._onColumnIsSizingChanged,onRowDidMount:this._onRowDidMount,onRowWillUnmount:this._onRowWillUnmount,onColumnResized:this._onColumnResized,onColumnAutoResized:this._onColumnAutoResized,onToggleCollapse:this._onToggleCollapse,onActiveRowChanged:this._onActiveRowChanged,onBlur:this._onBlur,onRenderDefaultRow:this._onRenderRow}))},t.prototype.forceUpdate=function(){e.prototype.forceUpdate.call(this),this._forceListUpdates()},t.prototype._getGroupNestingDepth=function(){for(var e=0,t=this.props.groups;t&&t.length>0;)e++,t=t[0].children;return e},t.prototype._setFocusToRowIfPending=function(e){var t=e.props.itemIndex;void 0!==this._initialFocusedIndex&&t===this._initialFocusedIndex&&(this._setFocusToRow(e),delete this._initialFocusedIndex)},t.prototype._setFocusToRow=function(e,t){void 0===t&&(t=!1),this._selectionZone.current&&this._selectionZone.current.ignoreNextFocus(),this._async.setTimeout((function(){e.focus(t)}),0)},t.prototype._forceListUpdates=function(){this._groupedList.current&&this._groupedList.current.forceUpdate(),this._list.current&&this._list.current.forceUpdate()},t.prototype._notifyColumnsResized=function(){this.state.adjustedColumns.forEach((function(e){e.onColumnResize&&e.onColumnResize(e.currentWidth)}))},t.prototype._adjustColumns=function(e,t,o,n){var r=this._getAdjustedColumns(e,t,o,n),i=this.props.viewport,a=i&&i.width?i.width:0;return d(d({},t),{adjustedColumns:r,lastWidth:a})},t.prototype._getAdjustedColumns=function(e,t,o,n){var r,i=this,a=e.items,s=e.layoutMode,l=e.selectionMode,c=e.viewport,u=c&&c.width?c.width:0,d=e.columns,p=this.props?this.props.columns:[],h=t?t.lastWidth:-1,m=t?t.lastSelectionMode:void 0;return o||h!==u||m!==l||p&&d!==p?(d=d||Sb(a,!0),s===ev.fixedColumns?(r=this._getFixedColumns(d,u,e)).forEach((function(e){i._rememberCalculatedWidth(e,e.calculatedWidth)})):(r=this._getJustifiedColumns(d,u,e)).forEach((function(e){i._getColumnOverride(e.key).currentWidth=e.calculatedWidth})),r):d||[]},t.prototype._getFixedColumns=function(e,t,o){var n=this,r=this.props,i=r.selectionMode,a=void 0===i?this._selection.mode:i,s=r.checkboxVisibility,l=r.flexMargin,c=r.skipViewportMeasures,u=t-(l||0),p=0;e.forEach((function(e){c||!e.flexGrow?u-=e.maxWidth||e.minWidth||yb:(u-=e.minWidth||yb,p+=e.flexGrow),u-=xb(e,o,!0)}));var h=a!==Kf.none&&s!==tv.hidden?48:0,m=36*this._getGroupNestingDepth(),g=(u-=h+m)/p;return c||e.forEach((function(e){var t=d(d({},e),n._columnOverrides[e.key]);if(t.flexGrow&&t.maxWidth){var o=t.flexGrow*g+t.minWidth,r=o-t.maxWidth;r>0&&(u+=r,p-=r/(o-t.minWidth)*t.flexGrow)}})),g=u>0?u/p:0,e.map((function(e){var t=d(d({},e),n._columnOverrides[e.key]);return!c&&t.flexGrow&&u<=0||t.calculatedWidth||(!c&&t.flexGrow?(t.calculatedWidth=t.minWidth+t.flexGrow*g,t.calculatedWidth=Math.min(t.calculatedWidth,t.maxWidth||Number.MAX_VALUE)):t.calculatedWidth=t.maxWidth||t.minWidth||yb),t}))},t.prototype._getJustifiedColumns=function(e,t,o){var n=this,r=o.selectionMode,i=void 0===r?this._selection.mode:r,a=o.checkboxVisibility,s=i!==Kf.none&&a!==tv.hidden?48:0,l=36*this._getGroupNestingDepth(),c=0,u=0,p=t-(s+l),h=e.map((function(e,t){var r=d(d({},e),{calculatedWidth:e.minWidth||yb}),i=d(d({},r),n._columnOverrides[e.key]);return r.isCollapsible||r.isCollapsable||(u+=xb(r,o)),c+=xb(i,o),i}));if(u>p)return h;for(var m=h.length-1;m>=0&&c>p;){var g=(y=h[m]).minWidth||yb,f=c-p;if(y.calculatedWidth-g>=f||!y.isCollapsible&&!y.isCollapsable){var v=y.calculatedWidth;y.calculatedWidth=Math.max(y.calculatedWidth-f,g),c-=v-y.calculatedWidth}else c-=xb(y,o),h.splice(m,1);m--}for(var b=0;b<h.length&&c<p;b++){var y=h[b],_=b===h.length-1,C=this._columnOverrides[y.key];if(!C||!C.calculatedWidth||_){var S=p-c,x=void 0;if(_)x=S;else{var k=y.maxWidth;g=y.minWidth||k||yb,x=k?Math.min(S,k-g):S}y.calculatedWidth=y.calculatedWidth+x,c+=x}}return h},t.prototype._rememberCalculatedWidth=function(e,t){var o=this._getColumnOverride(e.key);o.calculatedWidth=t,o.currentWidth=t},t.prototype._getColumnOverride=function(e){return this._columnOverrides[e]=this._columnOverrides[e]||{}},t.prototype._getItemKey=function(e,t){var o=this.props.getKey,n=void 0;return e&&(n=e.key),o&&(n=o(e,t)),n||(n=t),n},t.defaultProps={layoutMode:ev.justified,selectionMode:Kf.multiple,constrainMode:Jf.horizontalConstrained,checkboxVisibility:tv.onHover,isHeaderVisible:!0,compact:!1,useFastIcons:!0},h([vb],t)}(f.Component);function Sb(e,t,o,n,r,i,a){var s=[];if(e&&e.length){var l=e[0];for(var c in l)l.hasOwnProperty(c)&&s.push({key:c,name:c,fieldName:c,minWidth:yb,maxWidth:300,isCollapsable:!!s.length,isCollapsible:!!s.length,isMultiline:void 0!==a&&a,isSorted:n===c,isSortedDescending:!!r,isRowHeader:!1,columnActionsMode:Qf.clickable,isResizable:t,onColumnClick:o,isGrouped:i===c})}return s}function xb(e,t,o){var n=t.cellStyleProps,r=void 0===n?dv:n;return(o?0:e.calculatedWidth)+r.cellLeftPadding+r.cellRightPadding+(e.isPadded?r.cellExtraRightPadding:0)}var kb,wb={root:"ms-DetailsList",compact:"ms-DetailsList--Compact",contentWrapper:"ms-DetailsList-contentWrapper",headerWrapper:"ms-DetailsList-headerWrapper",isFixed:"is-fixed",isHorizontalConstrained:"is-horizontalConstrained",listCell:"ms-List-cell"},Ib=Vn(Cb,(function(e){var t,o,n=e.theme,r=e.className,i=e.isHorizontalConstrained,a=e.compact,s=e.isFixed,l=n.semanticColors,c=Qo(wb,n);return{root:[c.root,n.fonts.small,{position:"relative",color:l.listText,selectors:(t={},t["& ."+c.listCell]={minHeight:38,wordBreak:"break-word"},t)},s&&c.isFixed,a&&[c.compact,{selectors:(o={},o["."+c.listCell]={minHeight:32},o)}],i&&[c.isHorizontalConstrained,{overflowX:"auto",overflowY:"visible",WebkitOverflowScrolling:"touch"}],r],focusZone:[{display:"inline-block",minWidth:"100%",minHeight:1}],headerWrapper:c.headerWrapper,contentWrapper:c.contentWrapper}}),void 0,{scope:"DetailsList"});!function(e){e[e.normal=0]="normal",e[e.largeHeader=1]="largeHeader",e[e.close=2]="close"}(kb||(kb={}));var Db=Le.durationValue2,Tb={root:"ms-Modal",main:"ms-Dialog-main",scrollableContent:"ms-Modal-scrollableContent",isOpen:"is-open",layer:"ms-Modal-Layer"},Eb=Jn(),Pb=function(e){function t(t){var o=e.call(this,t)||this;Ui(o);var n=o.props.allowTouchBodyScroll,r=void 0!==n&&n;return o._allowTouchBodyScroll=r,o}return u(t,e),t.prototype.componentDidMount=function(){!this._allowTouchBodyScroll&&Qa()},t.prototype.componentWillUnmount=function(){!this._allowTouchBodyScroll&&Ja()},t.prototype.render=function(){var e=this.props,t=e.isDarkThemed,o=e.className,n=e.theme,r=e.styles,i=Tr(this.props,Dr),a=Eb(r,{theme:n,className:o,isDark:t});return f.createElement("div",d({},i,{className:a.root}))},t}(f.Component),Mb={root:"ms-Overlay",rootDark:"ms-Overlay--dark"},Rb=Vn(Pb,(function(e){var t,o=e.className,n=e.theme,r=e.isNone,i=e.isDark,a=n.palette,s=Qo(Mb,n);return{root:[s.root,n.fonts.medium,{backgroundColor:a.whiteTranslucent40,top:0,right:0,bottom:0,left:0,position:"absolute",selectors:(t={},t[ro]={border:"1px solid WindowText",opacity:0},t)},r&&{visibility:"hidden"},i&&[s.rootDark,{backgroundColor:a.blackTranslucent40}],o]}}),void 0,{scope:"Overlay"}),Nb=jo((function(e,t){return{root:Z(e,t&&{touchAction:"none",selectors:{"& *":{userSelect:"none"}}})}})),Bb={start:"touchstart",move:"touchmove",stop:"touchend"},Fb={start:"mousedown",move:"mousemove",stop:"mouseup"},Ab=function(e){function t(t){var o=e.call(this,t)||this;return o._currentEventType=Fb,o._events=[],o._onMouseDown=function(e){var t=f.Children.only(o.props.children).props.onMouseDown;return t&&t(e),o._currentEventType=Fb,o._onDragStart(e)},o._onMouseUp=function(e){var t=f.Children.only(o.props.children).props.onMouseUp;return t&&t(e),o._currentEventType=Fb,o._onDragStop(e)},o._onTouchStart=function(e){var t=f.Children.only(o.props.children).props.onTouchStart;return t&&t(e),o._currentEventType=Bb,o._onDragStart(e)},o._onTouchEnd=function(e){var t=f.Children.only(o.props.children).props.onTouchEnd;t&&t(e),o._currentEventType=Bb,o._onDragStop(e)},o._onDragStart=function(e){if("number"==typeof e.button&&0!==e.button)return!1;if(!(o.props.handleSelector&&!o._matchesSelector(e.target,o.props.handleSelector)||o.props.preventDragSelector&&o._matchesSelector(e.target,o.props.preventDragSelector))){o._touchId=o._getTouchId(e);var t=o._getControlPosition(e);if(void 0!==t){var n=o._createDragDataFromPosition(t);o.props.onStart&&o.props.onStart(e,n),o.setState({isDragging:!0,lastPosition:t}),o._events=[ol(document.body,o._currentEventType.move,o._onDrag,!0),ol(document.body,o._currentEventType.stop,o._onDragStop,!0)]}}},o._onDrag=function(e){"touchmove"===e.type&&e.preventDefault();var t=o._getControlPosition(e);if(t){var n=o._createUpdatedDragData(o._createDragDataFromPosition(t)),r=n.position;o.props.onDragChange&&o.props.onDragChange(e,n),o.setState({position:r,lastPosition:t})}},o._onDragStop=function(e){if(o.state.isDragging){var t=o._getControlPosition(e);if(t){var n=o._createDragDataFromPosition(t);o.setState({isDragging:!1,lastPosition:void 0}),o.props.onStop&&o.props.onStop(e,n),o.props.position&&o.setState({position:o.props.position}),o._events.forEach((function(e){return e()}))}}},o.state={isDragging:!1,position:o.props.position||{x:0,y:0},lastPosition:void 0},o}return u(t,e),t.prototype.componentDidUpdate=function(e){!this.props.position||e.position&&this.props.position===e.position||this.setState({position:this.props.position})},t.prototype.componentWillUnmount=function(){this._events.forEach((function(e){return e()}))},t.prototype.render=function(){var e=f.Children.only(this.props.children),t=e.props,o=this.props.position,n=this.state,r=n.position,i=n.isDragging,a=r.x,s=r.y;return o&&!i&&(a=o.x,s=o.y),f.cloneElement(e,{style:d(d({},t.style),{transform:"translate("+a+"px, "+s+"px)"}),className:Nb(t.className,this.state.isDragging).root,onMouseDown:this._onMouseDown,onMouseUp:this._onMouseUp,onTouchStart:this._onTouchStart,onTouchEnd:this._onTouchEnd})},t.prototype._getControlPosition=function(e){var t=this._getActiveTouch(e);if(void 0===this._touchId||t){var o=t||e;return{x:o.clientX,y:o.clientY}}},t.prototype._getActiveTouch=function(e){return e.targetTouches&&this._findTouchInTouchList(e.targetTouches)||e.changedTouches&&this._findTouchInTouchList(e.changedTouches)},t.prototype._getTouchId=function(e){var t=e.targetTouches&&e.targetTouches[0]||e.changedTouches&&e.changedTouches[0];if(t)return t.identifier},t.prototype._matchesSelector=function(e,t){if(!e||e===document.body)return!1;var o=e.matches||e.webkitMatchesSelector||e.msMatchesSelector;return!!o&&(o.call(e,t)||this._matchesSelector(e.parentElement,t))},t.prototype._findTouchInTouchList=function(e){if(void 0!==this._touchId)for(var t=0;t<e.length;t++)if(e[t].identifier===this._touchId)return e[t]},t.prototype._createDragDataFromPosition=function(e){var t=this.state.lastPosition;return void 0===t?{delta:{x:0,y:0},lastPosition:e,position:e}:{delta:{x:e.x-t.x,y:e.y-t.y},lastPosition:t,position:e}},t.prototype._createUpdatedDragData=function(e){var t=this.state.position;return{position:{x:t.x+e.delta.x,y:t.y+e.delta.y},delta:e.delta,lastPosition:t}},t}(f.Component);function Lb(e){var t=f.useState(e),o=t[0],n=t[1];return[o,{setTrue:Ei((function(){return function(){n(!0)}})),setFalse:Ei((function(){return function(){n(!1)}})),toggle:Ei((function(){return function(){n((function(e){return!e}))}}))}]}var Hb={x:0,y:0},Ob={isOpen:!1,isDarkOverlay:!0,className:"",containerClassName:""},zb=Jn(),Wb=f.forwardRef((function(e,t){var o,n,r=tr(Ob,e),i=r.allowTouchBodyScroll,a=r.className,s=r.children,l=r.containerClassName,c=r.scrollableContentClassName,u=r.elementToFocusOnDismiss,p=r.firstFocusableSelector,h=r.forceFocusInsideTrap,m=r.ignoreExternalFocusing,g=r.isBlocking,v=r.isAlert,b=r.isClickableOutsideFocusTrap,y=r.isDarkOverlay,_=r.onDismiss,C=r.layerProps,S=r.overlay,x=r.isOpen,k=r.titleAriaId,w=r.styles,I=r.subtitleAriaId,D=r.theme,T=r.topOffsetFixed,E=r.responsiveMode,P=r.onLayerDidMount,M=r.isModeless,R=r.dragOptions,N=r.onDismissed,B=r.enableAriaHiddenSiblings,F=f.useRef(null),A=f.useRef(null),L=f.useRef(null),H=Or(F,t),O=xu(H),z=Kd("ModalFocusTrapZone"),W=Ol(),V=fm(),K=V.setTimeout,U=V.clearTimeout,G=f.useState(x),j=G[0],q=G[1],Y=f.useState(x),Z=Y[0],X=Y[1],Q=f.useState(Hb),J=Q[0],$=Q[1],ee=f.useState(),te=ee[0],oe=ee[1],ne=Lb(!1),re=ne[0],ie=ne[1],ae=ie.toggle,se=ie.setFalse,le=Ei((function(){return{onModalCloseTimer:0,allowTouchBodyScroll:i,scrollableContent:null,lastSetCoordinates:Hb,events:new Os({})}})),ce=(R||{}).keepInBounds,ue=null!=v?v:g&&!M,de=void 0===C?"":C.className,pe=zb(w,{theme:D,className:a,containerClassName:l,scrollableContentClassName:c,isOpen:x,isVisible:Z,hasBeenOpened:le.hasBeenOpened,modalRectangleTop:te,topOffsetFixed:T,isModeless:M,layerClassName:de,windowInnerHeight:null==W?void 0:W.innerHeight,isDefaultDragHandle:R&&!R.dragHandleSelector}),he=d(d({eventBubblingEnabled:!1},C),{onLayerDidMount:C&&C.onLayerDidMount?C.onLayerDidMount:P,insertFirst:M,className:pe.layer}),me=f.useCallback((function(e){e?le.allowTouchBodyScroll?Za(e,le.events):Ya(e,le.events):le.events.off(le.scrollableContent),le.scrollableContent=e}),[le]),ge=function(){var e=L.current,t=null==e?void 0:e.getBoundingClientRect();t&&(T&&oe(t.top),ce&&(le.minPosition={x:-t.left,y:-t.top},le.maxPosition={x:t.left,y:t.top}))},fe=f.useCallback((function(e,t){var o=le.minPosition,n=le.maxPosition;return ce&&o&&n&&(t=Math.max(o[e],t),t=Math.min(n[e],t)),t}),[ce,le]),ve=function(){var e;le.lastSetCoordinates=Hb,se(),le.isInKeyboardMoveMode=!1,q(!1),$(Hb),null===(e=le.disposeOnKeyUp)||void 0===e||e.call(le),null==N||N()},be=f.useCallback((function(){se(),le.isInKeyboardMoveMode=!1}),[le,se]),ye=f.useCallback((function(e,t){$((function(e){return{x:fe("x",e.x+t.delta.x),y:fe("y",e.y+t.delta.y)}}))}),[fe]),_e=f.useCallback((function(){A.current&&A.current.focus()}),[]);f.useEffect((function(){var e;U(le.onModalCloseTimer),x&&(requestAnimationFrame((function(){return K(ge,0)})),q(!0),R&&(e=function(e){e.altKey&&e.ctrlKey&&e.keyCode===Un.space&&Ca(le.scrollableContent,e.target)&&(ae(),e.preventDefault(),e.stopPropagation())},le.disposeOnKeyUp||(le.events.on(W,"keyup",e,!0),le.disposeOnKeyUp=function(){le.events.off(W,"keyup",e,!0),le.disposeOnKeyUp=void 0})),le.hasBeenOpened=!0,X(!0)),!x&&j&&(le.onModalCloseTimer=K(ve,1e3*parseFloat(Db)),X(!1))}),[j,x]),o=function(){le.events.dispose()},(n=f.useRef(o)).current=o,f.useEffect((function(){return function(){var e;null===(e=n.current)||void 0===e||e.call(n)}}),[]),function(e,t){f.useImperativeHandle(e.componentRef,(function(){return{focus:function(){t.current&&t.current.focus()}}}),[t])}(r,A),function(e){Mi({name:"Modal",props:e,deprecations:{onLayerDidMount:"layerProps.onLayerDidMount"}})}(r);var Ce=f.createElement(xh,{id:z,ref:L,componentRef:A,className:pe.main,elementToFocusOnDismiss:u,isClickableOutsideFocusTrap:M||b||!g,ignoreExternalFocusing:m,forceFocusInsideTrap:M?!M:h,firstFocusableSelector:p,focusPreviouslyFocusedInnerElement:!0,onBlur:le.isInKeyboardMoveMode?function(){var e;le.lastSetCoordinates=Hb,le.isInKeyboardMoveMode=!1,null===(e=le.disposeOnKeyDown)||void 0===e||e.call(le)}:void 0,enableAriaHiddenSiblings:B},R&&le.isInKeyboardMoveMode&&f.createElement("div",{className:pe.keyboardMoveIconContainer},R.keyboardMoveIconProps?f.createElement(ii,d({},R.keyboardMoveIconProps)):f.createElement(ii,{iconName:"move",className:pe.keyboardMoveIcon})),f.createElement("div",{ref:me,className:pe.scrollableContent,"data-is-scrollable":!0},R&&re&&f.createElement(R.menu,{items:[{key:"move",text:R.moveMenuItemText,onClick:function(){var e=function(e){if(e.altKey&&e.ctrlKey&&e.keyCode===Un.space)return e.preventDefault(),void e.stopPropagation();if(re&&(e.altKey||e.keyCode===Un.escape)&&se(),!le.isInKeyboardMoveMode||e.keyCode!==Un.escape&&e.keyCode!==Un.enter||(le.isInKeyboardMoveMode=!1,e.preventDefault(),e.stopPropagation()),le.isInKeyboardMoveMode){var t=!0,o=function(e){var t=10;return e.shiftKey?e.ctrlKey||(t=50):e.ctrlKey&&(t=1),t}(e);switch(e.keyCode){case Un.escape:$(le.lastSetCoordinates);case Un.enter:le.lastSetCoordinates=Hb;break;case Un.up:$((function(e){return{x:e.x,y:fe("y",e.y-o)}}));break;case Un.down:$((function(e){return{x:e.x,y:fe("y",e.y+o)}}));break;case Un.left:$((function(e){return{x:fe("x",e.x-o),y:e.y}}));break;case Un.right:$((function(e){return{x:fe("x",e.x+o),y:e.y}}));break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())}};le.lastSetCoordinates=J,se(),le.isInKeyboardMoveMode=!0,le.events.on(W,"keydown",e,!0),le.disposeOnKeyDown=function(){le.events.off(W,"keydown",e,!0),le.disposeOnKeyDown=void 0}}},{key:"close",text:R.closeMenuItemText,onClick:ve}],onDismiss:se,alignTargetEdge:!0,coverTarget:!0,directionalHint:qs.topLeftEdge,directionalHintFixed:!0,shouldFocusOnMount:!0,target:le.scrollableContent}),s));return j&&O>=(E||pu.small)&&f.createElement(_c,d({ref:H},he),f.createElement(Ul,{role:ue?"alertdialog":"dialog","aria-modal":!M,ariaLabelledBy:k,ariaDescribedBy:I,onDismiss:_,shouldRestoreFocus:!m},f.createElement("div",{className:pe.root,role:M?void 0:"document"},!M&&f.createElement(Rb,d({"aria-hidden":!0,isDarkThemed:y,onClick:g?void 0:_,allowTouchBodyScroll:i},S)),R?f.createElement(Ab,{handleSelector:R.dragHandleSelector||"#"+z,preventDragSelector:"button",onStart:be,onDragChange:ye,onStop:_e,position:J},Ce):Ce)))||null}));Wb.displayName="Modal";var Vb=Vn(Wb,(function(e){var t,o=e.className,n=e.containerClassName,r=e.scrollableContentClassName,i=e.isOpen,a=e.isVisible,s=e.hasBeenOpened,l=e.modalRectangleTop,c=e.theme,u=e.topOffsetFixed,d=e.isModeless,p=e.layerClassName,h=e.isDefaultDragHandle,m=e.windowInnerHeight,g=c.palette,f=c.effects,v=c.fonts,b=Qo(Tb,c);return{root:[b.root,v.medium,{backgroundColor:"transparent",position:d?"absolute":"fixed",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,pointerEvents:"none",transition:"opacity "+Db},u&&"number"==typeof l&&s&&{alignItems:"flex-start"},i&&b.isOpen,a&&{opacity:1,pointerEvents:"auto"},o],main:[b.main,{boxShadow:f.elevation64,borderRadius:f.roundedCorner2,backgroundColor:g.white,boxSizing:"border-box",position:"relative",textAlign:"left",outline:"3px solid transparent",maxHeight:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)",minHeight:"176px",minWidth:"288px",overflowY:"auto",zIndex:d?ko.Layer:void 0},u&&"number"==typeof l&&s&&{top:l},h&&{cursor:"move"},n],scrollableContent:[b.scrollableContent,{overflowY:"auto",flexGrow:1,maxHeight:"100vh",selectors:(t={},t["@supports (-webkit-overflow-scrolling: touch)"]={maxHeight:m},t)},r],layer:d&&[p,b.layer,{position:"static",width:"unset",height:"unset"}],keyboardMoveIconContainer:{position:"absolute",display:"flex",justifyContent:"center",width:"100%",padding:"3px 0px"},keyboardMoveIcon:{fontSize:v.xLargePlus.fontSize,width:"24px"}}}),void 0,{scope:"Modal",fields:["theme","styles","enableAriaHiddenSiblings"]});Vb.displayName="Modal";var Kb,Ub=Jn(),Gb=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.styles,n=e.theme;return this._classNames=Ub(o,{theme:n,className:t}),f.createElement("div",{className:this._classNames.actions},f.createElement("div",{className:this._classNames.actionsRight},this._renderChildrenAsActions()))},t.prototype._renderChildrenAsActions=function(){var e=this;return f.Children.map(this.props.children,(function(t){return t?f.createElement("span",{className:e._classNames.action},t):null}))},t}(f.Component),jb={actions:"ms-Dialog-actions",action:"ms-Dialog-action",actionsRight:"ms-Dialog-actionsRight"},qb=Vn(Gb,(function(e){var t=e.className,o=e.theme,n=Qo(jb,o);return{actions:[n.actions,{position:"relative",width:"100%",minHeight:"24px",lineHeight:"24px",margin:"16px 0 0",fontSize:"0",selectors:{".ms-Button":{lineHeight:"normal"}}},t],action:[n.action,{margin:"0 4px"}],actionsRight:[n.actionsRight,{textAlign:"right",marginRight:"-4px",fontSize:"0"}]}}),void 0,{scope:"DialogFooter"}),Yb=Jn(),Zb=f.createElement(qb,null).type,Xb=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),xi("DialogContent",t,{titleId:"titleProps.id"}),o}return u(t,e),t.prototype.render=function(){var e,t=this.props,o=t.showCloseButton,n=t.className,r=t.closeButtonAriaLabel,i=t.onDismiss,a=t.subTextId,s=t.subText,l=t.titleProps,c=void 0===l?{}:l,u=t.titleId,p=t.title,h=t.type,m=t.styles,g=t.theme,v=t.draggableHeaderClassName,b=Yb(m,{theme:g,className:n,isLargeHeader:h===kb.largeHeader,isClose:h===kb.close,draggableHeaderClassName:v}),y=this._groupChildren();return s&&(e=f.createElement("p",{className:b.subText,id:a},s)),f.createElement("div",{className:b.content},f.createElement("div",{className:b.header},f.createElement("div",d({id:u,role:"heading","aria-level":1},c,{className:qr(b.title,c.className)}),p),f.createElement("div",{className:b.topButton},this.props.topButtonsProps.map((function(e,t){return f.createElement(Zu,d({key:e.uniqueId||t},e))})),(h===kb.close||o&&h!==kb.largeHeader)&&f.createElement(Zu,{className:b.button,iconProps:{iconName:"Cancel"},ariaLabel:r,onClick:i,title:r}))),f.createElement("div",{className:b.inner},f.createElement("div",{className:b.innerContent},e,y.contents),y.footers))},t.prototype._groupChildren=function(){var e={footers:[],contents:[]};return f.Children.map(this.props.children,(function(t){"object"==typeof t&&null!==t&&t.type===Zb?e.footers.push(t):e.contents.push(t)})),e},t.defaultProps={showCloseButton:!1,className:"",topButtonsProps:[],closeButtonAriaLabel:"Close"},h([Cu],t)}(f.Component),Qb={contentLgHeader:"ms-Dialog-lgHeader",close:"ms-Dialog--close",subText:"ms-Dialog-subText",header:"ms-Dialog-header",headerLg:"ms-Dialog--lgHeader",button:"ms-Dialog-button ms-Dialog-button--close",inner:"ms-Dialog-inner",content:"ms-Dialog-content",title:"ms-Dialog-title"},Jb=Vn(Xb,(function(e){var t,o,n,r=e.className,i=e.theme,a=e.isLargeHeader,s=e.isClose,l=e.hidden,c=e.isMultiline,u=e.draggableHeaderClassName,d=i.palette,p=i.fonts,h=i.effects,m=i.semanticColors,g=Qo(Qb,i);return{content:[a&&[g.contentLgHeader,{borderTop:"4px solid "+d.themePrimary}],s&&g.close,{flexGrow:1,overflowY:"hidden"},r],subText:[g.subText,p.medium,{margin:"0 0 24px 0",color:m.bodySubtext,lineHeight:"1.5",wordWrap:"break-word",fontWeight:qe.regular}],header:[g.header,{position:"relative",width:"100%",boxSizing:"border-box"},s&&g.close,u&&[u,{cursor:"move"}]],button:[g.button,l&&{selectors:{".ms-Icon.ms-Icon--Cancel":{color:m.buttonText,fontSize:Ye.medium}}}],inner:[g.inner,{padding:"0 24px 24px",selectors:(t={},t["@media (min-width: "+lo+"px) and (max-width: "+go+"px)"]={padding:"0 16px 16px"},t)}],innerContent:[g.content,{position:"relative",width:"100%"}],title:[g.title,p.xLarge,{color:m.bodyText,margin:"0",minHeight:p.xLarge.fontSize,padding:"16px 46px 20px 24px",lineHeight:"normal",selectors:(o={},o["@media (min-width: "+lo+"px) and (max-width: "+go+"px)"]={padding:"16px 46px 16px 16px"},o)},a&&{color:m.menuHeader},c&&{fontSize:p.xxLarge.fontSize}],topButton:[{display:"flex",flexDirection:"row",flexWrap:"nowrap",position:"absolute",top:"0",right:"0",padding:"15px 15px 0 0",selectors:(n={"> *":{flex:"0 0 auto"},".ms-Dialog-button":{color:m.buttonText},".ms-Dialog-button:hover":{color:m.buttonTextHovered,borderRadius:h.roundedCorner2}},n["@media (min-width: "+lo+"px) and (max-width: "+go+"px)"]={padding:"15px 8px 0 0"},n)}]}}),void 0,{scope:"DialogContent"}),$b=Jn(),ey={isDarkOverlay:!1,isBlocking:!1,className:"",containerClassName:"",topOffsetFixed:!1},ty={type:kb.normal,className:"",topButtonsProps:[]},oy=function(e){function t(t){var o=e.call(this,t)||this;return o._getSubTextId=function(){var e=o.props,t=e.ariaDescribedById,n=e.modalProps,r=e.dialogContentProps,i=e.subText,a=n&&n.subtitleAriaId||t;return a||(a=(r&&r.subText||i)&&o._defaultSubTextId),a},o._getTitleTextId=function(){var e=o.props,t=e.ariaLabelledById,n=e.modalProps,r=e.dialogContentProps,i=e.title,a=n&&n.titleAriaId||t;return a||(a=(r&&r.title||i)&&o._defaultTitleTextId),a},o._id=Va("Dialog"),o._defaultTitleTextId=o._id+"-title",o._defaultSubTextId=o._id+"-subText",xi("Dialog",t,{isOpen:"hidden",type:"dialogContentProps.type",subText:"dialogContentProps.subText",contentClassName:"dialogContentProps.className",topButtonsProps:"dialogContentProps.topButtonsProps",className:"modalProps.className",isDarkOverlay:"modalProps.isDarkOverlay",isBlocking:"modalProps.isBlocking",containerClassName:"modalProps.containerClassName",onDismissed:"modalProps.onDismissed",onLayerDidMount:"modalProps.layerProps.onLayerDidMount",ariaDescribedById:"modalProps.subtitleAriaId",ariaLabelledById:"modalProps.titleAriaId"}),o}return u(t,e),t.prototype.render=function(){var e,t,o,n,r=this.props,i=r.className,a=r.containerClassName,s=r.contentClassName,l=r.elementToFocusOnDismiss,c=r.firstFocusableSelector,u=r.forceFocusInsideTrap,p=r.styles,h=r.hidden,m=r.ignoreExternalFocusing,g=r.isBlocking,v=r.isClickableOutsideFocusTrap,b=r.isDarkOverlay,y=r.isOpen,_=r.onDismiss,C=r.onDismissed,S=r.onLayerDidMount,x=r.responsiveMode,k=r.subText,w=r.theme,I=r.title,D=r.topButtonsProps,T=r.type,E=r.minWidth,P=r.maxWidth,M=r.modalProps,R=d({},M?M.layerProps:{onLayerDidMount:S});S&&!R.onLayerDidMount&&(R.onLayerDidMount=S),M&&M.dragOptions&&!M.dragOptions.dragHandleSelector?(o="ms-Dialog-draggable-header",n=d(d({},M.dragOptions),{dragHandleSelector:"."+o})):n=M&&M.dragOptions;var N=d(d(d(d({},ey),{className:i,containerClassName:a,isBlocking:g,isDarkOverlay:b,onDismissed:C}),M),{layerProps:R,dragOptions:n}),B=d(d(d({className:s,subText:k,title:I,topButtonsProps:D,type:T},ty),this.props.dialogContentProps),{draggableHeaderClassName:o,titleProps:d({id:(null===(e=this.props.dialogContentProps)||void 0===e?void 0:e.titleId)||this._defaultTitleTextId},null===(t=this.props.dialogContentProps)||void 0===t?void 0:t.titleProps)}),F=$b(p,{theme:w,className:N.className,containerClassName:N.containerClassName,hidden:h,dialogDefaultMinWidth:E,dialogDefaultMaxWidth:P});return f.createElement(Vb,d({elementToFocusOnDismiss:l,firstFocusableSelector:c,forceFocusInsideTrap:u,ignoreExternalFocusing:m,isClickableOutsideFocusTrap:v,onDismissed:N.onDismissed,responsiveMode:x},N,{isDarkOverlay:N.isDarkOverlay,isBlocking:N.isBlocking,isOpen:void 0!==y?y:!h,className:F.root,containerClassName:F.main,onDismiss:_||N.onDismiss,subtitleAriaId:this._getSubTextId(),titleAriaId:this._getTitleTextId()}),f.createElement(Jb,d({subTextId:this._defaultSubTextId,title:B.title,subText:B.subText,showCloseButton:N.isBlocking,topButtonsProps:B.topButtonsProps,type:B.type,onDismiss:_||B.onDismiss,className:B.className},B),this.props.children))},t.defaultProps={hidden:!0},h([Cu],t)}(f.Component),ny={root:"ms-Dialog"},ry=Vn(oy,(function(e){var t,o=e.className,n=e.containerClassName,r=e.dialogDefaultMinWidth,i=void 0===r?"288px":r,a=e.dialogDefaultMaxWidth,s=void 0===a?"340px":a,l=e.hidden,c=e.theme;return{root:[Qo(ny,c).root,c.fonts.medium,o],main:[{width:i,outline:"3px solid transparent",selectors:(t={},t["@media (min-width: "+co+"px)"]={width:"auto",maxWidth:s,minWidth:i},t)},!l&&{display:"flex"},n]}}),void 0,{scope:"Dialog"});ry.displayName="Dialog",function(e){e[e.normal=0]="normal",e[e.compact=1]="compact"}(Kb||(Kb={}));var iy,ay=Jn(),sy=function(e){function t(t){var o=e.call(this,t)||this;return o._rootElement=f.createRef(),o._onClick=function(e){o._onAction(e)},o._onKeyDown=function(e){e.which!==Un.enter&&e.which!==Un.space||o._onAction(e)},o._onAction=function(e){var t=o.props,n=t.onClick,r=t.onClickHref,i=t.onClickTarget;n?n(e):!n&&r&&(i?window.open(r,i,"noreferrer noopener nofollow"):window.location.href=r,e.preventDefault(),e.stopPropagation())},Ui(o),xi("DocumentCard",t,{accentColor:void 0}),o}return u(t,e),t.prototype.render=function(){var e,t=this.props,o=t.onClick,n=t.onClickHref,r=t.children,i=t.type,a=t.accentColor,s=t.styles,l=t.theme,c=t.className,u=Tr(this.props,Dr,["className","onClick","type","role"]),p=!(!o&&!n);this._classNames=ay(s,{theme:l,className:c,actionable:p,compact:i===Kb.compact}),i===Kb.compact&&a&&(e={borderBottomColor:a});var h=this.props.role||(p?o?"button":"link":void 0),m=p?0:void 0;return f.createElement("div",d({ref:this._rootElement,tabIndex:m,"data-is-focusable":p,role:h,className:this._classNames.root,onKeyDown:p?this._onKeyDown:void 0,onClick:p?this._onClick:void 0,style:e},u),r)},t.prototype.focus=function(){this._rootElement.current&&this._rootElement.current.focus()},t.defaultProps={type:Kb.normal},t}(f.Component),ly={root:"ms-DocumentCardPreview",icon:"ms-DocumentCardPreview-icon",iconContainer:"ms-DocumentCardPreview-iconContainer"},cy={root:"ms-DocumentCardActivity",multiplePeople:"ms-DocumentCardActivity--multiplePeople",details:"ms-DocumentCardActivity-details",name:"ms-DocumentCardActivity-name",activity:"ms-DocumentCardActivity-activity",avatars:"ms-DocumentCardActivity-avatars",avatar:"ms-DocumentCardActivity-avatar"},uy={root:"ms-DocumentCardTitle"},dy={root:"ms-DocumentCardLocation"},py={root:"ms-DocumentCard",rootActionable:"ms-DocumentCard--actionable",rootCompact:"ms-DocumentCard--compact"},hy=Vn(sy,(function(e){var t,o,n=e.className,r=e.theme,i=e.actionable,a=e.compact,s=r.palette,l=r.fonts,c=r.effects,u=Qo(py,r);return{root:[u.root,{WebkitFontSmoothing:"antialiased",backgroundColor:s.white,border:"1px solid "+s.neutralLight,maxWidth:"320px",minWidth:"206px",userSelect:"none",position:"relative",selectors:(t={":focus":{outline:"0px solid"}},t["."+wo+" &:focus"]=Mo(s.neutralSecondary,c.roundedCorner2),t["."+dy.root+" + ."+uy.root]={paddingTop:"4px"},t)},i&&[u.rootActionable,{selectors:{":hover":{cursor:"pointer",borderColor:s.neutralTertiaryAlt},":hover:after":{content:'" "',position:"absolute",top:0,right:0,bottom:0,left:0,border:"1px solid "+s.neutralTertiaryAlt,pointerEvents:"none"}}}],a&&[u.rootCompact,{display:"flex",maxWidth:"480px",height:"108px",selectors:(o={},o["."+ly.root]={borderRight:"1px solid "+s.neutralLight,borderBottom:0,maxHeight:"106px",maxWidth:"144px"},o["."+ly.icon]={maxHeight:"32px",maxWidth:"32px"},o["."+cy.root]={paddingBottom:"12px"},o["."+uy.root]={paddingBottom:"12px 16px 8px 16px",fontSize:l.mediumPlus.fontSize,lineHeight:"16px"},o)}],n]}}),void 0,{scope:"DocumentCard"}),my=Jn(),gy=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.actions,n=t.views,r=t.styles,i=t.theme,a=t.className;return this._classNames=my(r,{theme:i,className:a}),f.createElement("div",{className:this._classNames.root},o&&o.map((function(t,o){return f.createElement("div",{className:e._classNames.action,key:o},f.createElement(Zu,d({},t)))})),n>0&&f.createElement("div",{className:this._classNames.views},f.createElement(ii,{iconName:"View",className:this._classNames.viewsIcon}),n))},t}(f.Component),fy={root:"ms-DocumentCardActions",action:"ms-DocumentCardActions-action",views:"ms-DocumentCardActions-views"},vy=Vn(gy,(function(e){var t=e.className,o=e.theme,n=o.palette,r=o.fonts,i=Qo(fy,o);return{root:[i.root,{height:"34px",padding:"4px 12px",position:"relative"},t],action:[i.action,{float:"left",marginRight:"4px",color:n.neutralSecondary,cursor:"pointer",selectors:{".ms-Button":{fontSize:r.mediumPlus.fontSize,height:34,width:34},".ms-Button:hover .ms-Button-icon":{color:o.semanticColors.buttonText,cursor:"pointer"}}}],views:[i.views,{textAlign:"right",lineHeight:34}],viewsIcon:{marginRight:"8px",fontSize:r.medium.fontSize,verticalAlign:"top"}}}),void 0,{scope:"DocumentCardActions"}),by=Jn(),yy=Vn(function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.activity,o=e.people,n=e.styles,r=e.theme,i=e.className;return this._classNames=by(n,{theme:r,className:i,multiplePeople:o.length>1}),o&&0!==o.length?f.createElement("div",{className:this._classNames.root},this._renderAvatars(o),f.createElement("div",{className:this._classNames.details},f.createElement("span",{className:this._classNames.name},this._getNameString(o)),f.createElement("span",{className:this._classNames.activity},t))):null},t.prototype._renderAvatars=function(e){return f.createElement("div",{className:this._classNames.avatars},e.length>1?this._renderAvatar(e[1]):null,this._renderAvatar(e[0]))},t.prototype._renderAvatar=function(e){return f.createElement("div",{className:this._classNames.avatar},f.createElement(Oi,{imageInitials:e.initials,text:e.name,imageUrl:e.profileImageSrc,initialsColor:e.initialsColor,allowPhoneInitials:e.allowPhoneInitials,role:"presentation",size:Yr.size32}))},t.prototype._getNameString=function(e){var t=e[0].name;return e.length>=2&&(t+=" +"+(e.length-1)),t},t}(f.Component),(function(e){var t=e.theme,o=e.className,n=e.multiplePeople,r=t.palette,i=t.fonts,a=Qo(cy,t);return{root:[a.root,n&&a.multiplePeople,{padding:"8px 16px",position:"relative"},o],avatars:[a.avatars,{marginLeft:"-2px",height:"32px"}],avatar:[a.avatar,{display:"inline-block",verticalAlign:"top",position:"relative",textAlign:"center",width:32,height:32,selectors:{"&:after":{content:'" "',position:"absolute",left:"-1px",top:"-1px",right:"-1px",bottom:"-1px",border:"2px solid "+r.white,borderRadius:"50%"},":nth-of-type(2)":n&&{marginLeft:"-16px"}}}],details:[a.details,{left:n?"72px":"56px",height:32,position:"absolute",top:8,width:"calc(100% - 72px)"}],name:[a.name,{display:"block",fontSize:i.small.fontSize,lineHeight:"15px",height:"15px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:r.neutralPrimary,fontWeight:qe.semibold}],activity:[a.activity,{display:"block",fontSize:i.small.fontSize,lineHeight:"15px",height:"15px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:r.neutralSecondary}]}}),void 0,{scope:"DocumentCardActivity"}),_y=Jn(),Cy=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.children,o=e.styles,n=e.theme,r=e.className;return this._classNames=_y(o,{theme:n,className:r}),f.createElement("div",{className:this._classNames.root},t)},t}(f.Component),Sy={root:"ms-DocumentCardDetails"},xy=Vn(Cy,(function(e){var t=e.className,o=e.theme;return{root:[Qo(Sy,o).root,{display:"flex",flexDirection:"column",flex:1,justifyContent:"space-between",overflow:"hidden"},t]}}),void 0,{scope:"DocumentCardDetails"}),ky=Jn(),wy=Vn(function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.location,o=e.locationHref,n=e.ariaLabel,r=e.onClick,i=e.styles,a=e.theme,s=e.className;return this._classNames=ky(i,{theme:a,className:s}),f.createElement("a",{className:this._classNames.root,href:o,onClick:r,"aria-label":n},t)},t}(f.Component),(function(e){var t=e.theme,o=e.className,n=t.palette,r=t.fonts;return{root:[Qo(dy,t).root,r.small,{color:n.themePrimary,display:"block",fontWeight:qe.semibold,overflow:"hidden",padding:"8px 16px",position:"relative",textDecoration:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",selectors:{":hover":{color:n.themePrimary,cursor:"pointer"}}},o]}}),void 0,{scope:"DocumentCardLocation"}),Iy=Jn(),Dy=Vn(function(e){function t(t){var o=e.call(this,t)||this;return o._renderPreviewList=function(e){var t=o.props,n=t.getOverflowDocumentCountText,r=t.maxDisplayCount,i=void 0===r?3:r,a=e.length-i,s=a?n?n(a):"+"+a:null,l=e.slice(0,i).map((function(e,t){return f.createElement("li",{key:t},f.createElement(Ur,{className:o._classNames.fileListIcon,src:e.iconSrc,role:"presentation",alt:"",width:"16px",height:"16px"}),f.createElement(Rs,d({className:o._classNames.fileListLink},(e.linkProps,{href:e.linkProps&&e.linkProps.href||e.url})),e.name))}));return f.createElement("div",null,f.createElement("ul",{className:o._classNames.fileList},l),s&&f.createElement("span",{className:o._classNames.fileListOverflowText},s))},Ui(o),o}return u(t,e),t.prototype.render=function(){var e,t,o=this.props,n=o.previewImages,r=o.styles,i=o.theme,a=o.className,s=n.length>1;return this._classNames=Iy(r,{theme:i,className:a,isFileList:s}),n.length>1?t=this._renderPreviewList(n):1===n.length&&(t=this._renderPreviewImage(n[0]),n[0].accentColor&&(e={borderBottomColor:n[0].accentColor})),f.createElement("div",{className:this._classNames.root,style:e},t)},t.prototype._renderPreviewImage=function(e){var t=e.width,o=e.height,n=e.imageFit,r=e.previewIconProps,i=e.previewIconContainerClass;if(r)return f.createElement("div",{className:qr(this._classNames.previewIcon,i),style:{width:t,height:o}},f.createElement(ii,d({},r)));var a,s=f.createElement(Ur,{width:t,height:o,imageFit:n,src:e.previewImageSrc,role:"presentation",alt:""});return e.iconSrc&&(a=f.createElement(Ur,{className:this._classNames.icon,src:e.iconSrc,role:"presentation",alt:""})),f.createElement("div",null,s,a)},t}(f.Component),(function(e){var t,o,n=e.theme,r=e.className,i=e.isFileList,a=n.palette,s=n.fonts,l=Qo(ly,n);return{root:[l.root,s.small,{backgroundColor:i?a.white:a.neutralLighterAlt,borderBottom:"1px solid "+a.neutralLight,overflow:"hidden",position:"relative"},r],previewIcon:[l.iconContainer,{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}],icon:[l.icon,{left:"10px",bottom:"10px",position:"absolute"}],fileList:{padding:"16px 16px 0 16px",listStyleType:"none",margin:0,selectors:{li:{height:"16px",lineHeight:"16px",marginBottom:"8px",overflow:"hidden"}}},fileListIcon:{display:"inline-block",marginRight:"8px"},fileListLink:[To(n,{highContrastStyle:{border:"1px solid WindowText",outline:"none"}}),{boxSizing:"border-box",color:a.neutralDark,overflow:"hidden",display:"inline-block",textDecoration:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"calc(100% - 24px)",selectors:(t={":hover":{color:a.themePrimary}},t["."+wo+" &:focus"]={selectors:(o={},o[ro]={outline:"none"},o)},t)}],fileListOverflowText:{padding:"0px 16px 8px 16px",display:"block"}}}),void 0,{scope:"DocumentCardPreview"}),Ty=Jn(),Ey=function(e){function t(t){var o=e.call(this,t)||this;return o._onImageLoad=function(){o.setState({imageHasLoaded:!0})},Ui(o),o.state={imageHasLoaded:!1},o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.width,n=e.height,r=e.imageFit,i=e.imageSrc;return this._classNames=Ty(t,this.props),f.createElement("div",{className:this._classNames.root},i&&f.createElement(Ur,{width:o,height:n,imageFit:r,src:i,role:"presentation",alt:"",onLoad:this._onImageLoad}),this.state.imageHasLoaded?this._renderCornerIcon():this._renderCenterIcon())},t.prototype._renderCenterIcon=function(){var e=this.props.iconProps;return f.createElement("div",{className:this._classNames.centeredIconWrapper},f.createElement(ii,d({className:this._classNames.centeredIcon},e)))},t.prototype._renderCornerIcon=function(){var e=this.props.iconProps;return f.createElement(ii,d({className:this._classNames.cornerIcon},e))},t}(f.Component),Py="42px",My="32px",Ry=Vn(Ey,(function(e){var t=e.theme,o=e.className,n=e.height,r=e.width,i=t.palette;return{root:[{borderBottom:"1px solid "+i.neutralLight,position:"relative",backgroundColor:i.neutralLighterAlt,overflow:"hidden",height:n&&n+"px",width:r&&r+"px"},o],centeredIcon:[{height:Py,width:Py,fontSize:Py}],centeredIconWrapper:[{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",width:"100%",position:"absolute",top:0,left:0}],cornerIcon:[{left:"10px",bottom:"10px",height:My,width:My,fontSize:My,position:"absolute",overflow:"visible"}]}}),void 0,{scope:"DocumentCardImage"}),Ny=Jn(),By=Vn(function(e){function t(t){var o=e.call(this,t)||this;return o._titleElement=f.createRef(),o._truncateTitle=function(){o._needMeasurement&&o._async.requestAnimationFrame(o._truncateWhenInAnimation)},o._truncateWhenInAnimation=function(){var e=o.props.title,t=o._titleElement.current;if(t){var n=getComputedStyle(t);if(n.width&&n.lineHeight&&n.height){var r=t.clientWidth,i=t.scrollWidth;o._clientWidth=r;var a=Math.floor((parseInt(n.height,10)+5)/parseInt(n.lineHeight,10));t.style.whiteSpace="";var s=i/(parseInt(n.width,10)*a);if(s>1){var l=e.length/s-3;return o.setState({truncatedTitleFirstPiece:e.slice(0,l/2),truncatedTitleSecondPiece:e.slice(e.length-l/2)})}}}},o._shrinkTitle=function(){var e=o.state,t=e.truncatedTitleFirstPiece,n=e.truncatedTitleSecondPiece;if(t&&n){var r=o._titleElement.current;if(!r)return;(r.scrollHeight>r.clientHeight+5||r.scrollWidth>r.clientWidth)&&o.setState({truncatedTitleFirstPiece:t.slice(0,t.length-1),truncatedTitleSecondPiece:n.slice(1)})}},Ui(o),o._async=new Zi(o),o._events=new Os(o),o._clientWidth=void 0,o.state={truncatedTitleFirstPiece:void 0,truncatedTitleSecondPiece:void 0},o}return u(t,e),t.prototype.componentDidUpdate=function(e){var t=this;this.props.title!==e.title&&this.setState({truncatedTitleFirstPiece:void 0,truncatedTitleSecondPiece:void 0}),e.shouldTruncate!==this.props.shouldTruncate?this.props.shouldTruncate?(this._truncateTitle(),this._async.requestAnimationFrame(this._shrinkTitle),this._events.on(window,"resize",this._updateTruncation)):this._events.off(window,"resize",this._updateTruncation):this._needMeasurement&&this._async.requestAnimationFrame((function(){t._truncateWhenInAnimation(),t._shrinkTitle()}))},t.prototype.componentDidMount=function(){this.props.shouldTruncate&&(this._truncateTitle(),this._events.on(window,"resize",this._updateTruncation))},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.title,o=e.shouldTruncate,n=e.showAsSecondaryTitle,r=e.styles,i=e.theme,a=e.className,s=this.state,l=s.truncatedTitleFirstPiece,c=s.truncatedTitleSecondPiece;return this._classNames=Ny(r,{theme:i,className:a,showAsSecondaryTitle:n}),o&&l&&c?f.createElement("div",{className:this._classNames.root,ref:this._titleElement,title:t},l,"…",c):f.createElement("div",{className:this._classNames.root,ref:this._titleElement,title:t,style:this._needMeasurement?{whiteSpace:"nowrap"}:void 0},t)},Object.defineProperty(t.prototype,"_needMeasurement",{get:function(){return!!this.props.shouldTruncate&&void 0===this._clientWidth},enumerable:!1,configurable:!0}),t.prototype._updateTruncation=function(){var e=this;this._timerId||(this._timerId=this._async.setTimeout((function(){delete e._timerId,e._clientWidth=void 0,e.setState({truncatedTitleFirstPiece:void 0,truncatedTitleSecondPiece:void 0})}),250))},t}(f.Component),(function(e){var t=e.theme,o=e.className,n=e.showAsSecondaryTitle,r=t.palette,i=t.fonts;return{root:[Qo(uy,t).root,n?i.medium:i.large,{padding:"8px 16px",display:"block",overflow:"hidden",wordWrap:"break-word",height:n?"45px":"38px",lineHeight:n?"18px":"21px",color:n?r.neutralSecondary:r.neutralPrimary},o]}}),void 0,{scope:"DocumentCardTitle"}),Fy=Jn(),Ay=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.logoIcon,o=e.styles,n=e.theme,r=e.className;return this._classNames=Fy(o,{theme:n,className:r}),f.createElement("div",{className:this._classNames.root},f.createElement(ii,{iconName:t}))},t}(f.Component),Ly={root:"ms-DocumentCardLogo"},Hy=Vn(Ay,(function(e){var t=e.theme,o=e.className,n=t.palette,r=t.fonts;return{root:[Qo(Ly,t).root,{fontSize:r.xxLargePlus.fontSize,color:n.themePrimary,display:"block",padding:"16px 16px 0 16px"},o]}}),void 0,{scope:"DocumentCardLogo"}),Oy=Jn(),zy=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.statusIcon,o=e.status,n=e.styles,r=e.theme,i=e.className,a={iconName:t,styles:{root:{padding:"8px"}}};return this._classNames=Oy(n,{theme:r,className:i}),f.createElement("div",{className:this._classNames.root},t&&f.createElement(ii,d({},a)),o)},t}(f.Component),Wy={root:"ms-DocumentCardStatus"},Vy=Vn(zy,(function(e){var t=e.className,o=e.theme,n=o.palette,r=o.fonts;return{root:[Qo(Wy,o).root,r.medium,{margin:"8px 16px",color:n.neutralPrimary,backgroundColor:n.neutralLighter,height:"32px"},t]}}),void 0,{scope:"DocumentCardStatus"}),Ky=function(e){var t;return function(o){t||(t=new Set,Ki(e,{componentWillUnmount:function(){t.forEach((function(e){return cancelAnimationFrame(e)}))}}));var n=requestAnimationFrame((function(){t.delete(n),o()}));t.add(n)}},Uy=function(){function e(){this._size=0}return e.prototype.updateOptions=function(e){for(var t=[],o=0,n=0;n<e.length;n++)e[n].itemType===Gg.Divider||e[n].itemType===Gg.Header?t.push(n):e[n].hidden||o++;this._size=o,this._displayOnlyOptionsCache=t,this._cachedOptions=m(e)},Object.defineProperty(e.prototype,"optionSetSize",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cachedOptions",{get:function(){return this._cachedOptions},enumerable:!1,configurable:!0}),e.prototype.positionInSet=function(e){if(void 0!==e){for(var t=0;e>this._displayOnlyOptionsCache[t];)t++;if(this._displayOnlyOptionsCache[t]===e)throw new Error("Unexpected: Option at index "+e+" is not a selectable element.");return e-t+1}},e}();!function(e){e[e.smallFluid=0]="smallFluid",e[e.smallFixedFar=1]="smallFixedFar",e[e.smallFixedNear=2]="smallFixedNear",e[e.medium=3]="medium",e[e.large=4]="large",e[e.largeFixed=5]="largeFixed",e[e.extraLarge=6]="extraLarge",e[e.custom=7]="custom",e[e.customNear=8]="customNear"}(iy||(iy={}));var Gy,jy=Jn();!function(e){e[e.closed=0]="closed",e[e.animatingOpen=1]="animatingOpen",e[e.open=2]="open",e[e.animatingClosed=3]="animatingClosed"}(Gy||(Gy={}));var qy,Yy,Zy,Xy,Qy,Jy=function(e){function t(t){var o=e.call(this,t)||this;o._panel=f.createRef(),o._animationCallback=null,o._hasCustomNavigation=!(!o.props.onRenderNavigation&&!o.props.onRenderNavigationContent),o.dismiss=function(e){o.props.onDismiss&&o.isActive&&o.props.onDismiss(e),(!e||e&&!e.defaultPrevented)&&o.close()},o._allowScrollOnPanel=function(e){e?o._allowTouchBodyScroll?Za(e,o._events):Ya(e,o._events):o._events.off(o._scrollableContent),o._scrollableContent=e},o._onRenderNavigation=function(e){if(!o.props.onRenderNavigationContent&&!o.props.onRenderNavigation&&!o.props.hasCloseButton)return null;var t=o.props.onRenderNavigationContent,n=void 0===t?o._onRenderNavigationContent:t;return f.createElement("div",{className:o._classNames.navigation},n(e,o._onRenderNavigationContent))},o._onRenderNavigationContent=function(e){var t,n=e.closeButtonAriaLabel,r=e.hasCloseButton,i=e.onRenderHeader,a=void 0===i?o._onRenderHeader:i;if(r){var s=null===(t=o._classNames.subComponentStyles)||void 0===t?void 0:t.closeButton();return f.createElement(f.Fragment,null,!o._hasCustomNavigation&&a(o.props,o._onRenderHeader,o._headerTextId),f.createElement(Zu,{styles:s,className:o._classNames.closeButton,onClick:o._onPanelClick,ariaLabel:n,title:n,"data-is-visible":!0,iconProps:{iconName:"Cancel"}}))}return null},o._onRenderHeader=function(e,t,n){var r=e.headerText,i=e.headerTextProps,a=void 0===i?{}:i;return r?f.createElement("div",{className:o._classNames.header},f.createElement("div",d({id:n,role:"heading","aria-level":1},a,{className:qr(o._classNames.headerText,a.className)}),r)):null},o._onRenderBody=function(e){return f.createElement("div",{className:o._classNames.content},e.children)},o._onRenderFooter=function(e){var t=o.props.onRenderFooterContent,n=void 0===t?null:t;return n?f.createElement("div",{className:o._classNames.footer},f.createElement("div",{className:o._classNames.footerInner},n())):null},o._animateTo=function(e){e===Gy.open&&o.props.onOpen&&o.props.onOpen(),o._animationCallback=o._async.setTimeout((function(){o.setState({visibility:e}),o._onTransitionComplete()}),200)},o._clearExistingAnimationTimer=function(){null!==o._animationCallback&&o._async.clearTimeout(o._animationCallback)},o._onPanelClick=function(e){o.dismiss(e)},o._onTransitionComplete=function(){o._updateFooterPosition(),o.state.visibility===Gy.open&&o.props.onOpened&&o.props.onOpened(),o.state.visibility===Gy.closed&&o.props.onDismissed&&o.props.onDismissed()};var n=o.props.allowTouchBodyScroll,r=void 0!==n&&n;return o._allowTouchBodyScroll=r,o._async=new Zi(o),o._events=new Os(o),Ui(o),xi("Panel",t,{ignoreExternalFocusing:"focusTrapZoneProps",forceFocusInsideTrap:"focusTrapZoneProps",firstFocusableSelector:"focusTrapZoneProps"}),o.state={isFooterSticky:!1,visibility:Gy.closed,id:Va("Panel")},o}return u(t,e),t.getDerivedStateFromProps=function(e,t){return void 0===e.isOpen?null:!e.isOpen||t.visibility!==Gy.closed&&t.visibility!==Gy.animatingClosed?e.isOpen||t.visibility!==Gy.open&&t.visibility!==Gy.animatingOpen?null:{visibility:Gy.animatingClosed}:{visibility:Gy.animatingOpen}},t.prototype.componentDidMount=function(){this._events.on(window,"resize",this._updateFooterPosition),this._shouldListenForOuterClick(this.props)&&this._events.on(document.body,"mousedown",this._dismissOnOuterClick,!0),this.props.isOpen&&this.setState({visibility:Gy.animatingOpen})},t.prototype.componentDidUpdate=function(e,t){var o=this._shouldListenForOuterClick(this.props),n=this._shouldListenForOuterClick(e);this.state.visibility!==t.visibility&&(this._clearExistingAnimationTimer(),this.state.visibility===Gy.animatingOpen?this._animateTo(Gy.open):this.state.visibility===Gy.animatingClosed&&this._animateTo(Gy.closed)),o&&!n?this._events.on(document.body,"mousedown",this._dismissOnOuterClick,!0):!o&&n&&this._events.off(document.body,"mousedown",this._dismissOnOuterClick,!0)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.render=function(){var e=this.props,t=e.className,o=void 0===t?"":t,n=e.elementToFocusOnDismiss,r=e.firstFocusableSelector,i=e.focusTrapZoneProps,a=e.forceFocusInsideTrap,s=e.hasCloseButton,l=e.headerText,c=e.headerClassName,u=void 0===c?"":c,p=e.ignoreExternalFocusing,h=e.isBlocking,m=e.isFooterAtBottom,g=e.isLightDismiss,v=e.isHiddenOnDismiss,b=e.layerProps,y=e.overlayProps,_=e.popupProps,C=e.type,S=e.styles,x=e.theme,k=e.customWidth,w=e.onLightDismissClick,I=void 0===w?this._onPanelClick:w,D=e.onRenderNavigation,T=void 0===D?this._onRenderNavigation:D,E=e.onRenderHeader,P=void 0===E?this._onRenderHeader:E,M=e.onRenderBody,R=void 0===M?this._onRenderBody:M,N=e.onRenderFooter,B=void 0===N?this._onRenderFooter:N,F=this.state,A=F.isFooterSticky,L=F.visibility,H=F.id,O=C===iy.smallFixedNear||C===iy.customNear,z=jn(x)?O:!O,W=C===iy.custom||C===iy.customNear?{width:k}:{},V=Tr(this.props,Dr),K=this.isActive,U=L===Gy.animatingClosed||L===Gy.animatingOpen;if(this._headerTextId=l&&H+"-headerText",!K&&!U&&!v)return null;this._classNames=jy(S,{theme:x,className:o,focusTrapZoneClassName:i?i.className:void 0,hasCloseButton:s,headerClassName:u,isAnimating:U,isFooterSticky:A,isFooterAtBottom:m,isOnRightSide:z,isOpen:K,isHiddenOnDismiss:v,type:C,hasCustomNavigation:this._hasCustomNavigation});var G,j=this._classNames,q=this._allowTouchBodyScroll;return h&&K&&(G=f.createElement(Rb,d({className:j.overlay,isDarkThemed:!1,onClick:g?I:void 0,allowTouchBodyScroll:q},y))),f.createElement(_c,d({},b),f.createElement(Ul,d({role:"dialog","aria-modal":h?"true":void 0,ariaLabelledBy:this._headerTextId?this._headerTextId:void 0,onDismiss:this.dismiss,className:j.hiddenPanel},_),f.createElement("div",d({"aria-hidden":!K&&U},V,{ref:this._panel,className:j.root}),G,f.createElement(xh,d({ignoreExternalFocusing:p,forceFocusInsideTrap:!(!h||v&&!K)&&a,firstFocusableSelector:r,isClickableOutsideFocusTrap:!0},i,{className:j.main,style:W,elementToFocusOnDismiss:n}),f.createElement("div",{className:j.commands,"data-is-visible":!0},T(this.props,this._onRenderNavigation)),f.createElement("div",{className:j.contentInner},(this._hasCustomNavigation||!s)&&P(this.props,this._onRenderHeader,this._headerTextId),f.createElement("div",{ref:this._allowScrollOnPanel,className:j.scrollableContent,"data-is-scrollable":!0},R(this.props,this._onRenderBody)),B(this.props,this._onRenderFooter))))))},t.prototype.open=function(){void 0===this.props.isOpen&&(this.isActive||this.setState({visibility:Gy.animatingOpen}))},t.prototype.close=function(){void 0===this.props.isOpen&&this.isActive&&this.setState({visibility:Gy.animatingClosed})},Object.defineProperty(t.prototype,"isActive",{get:function(){return this.state.visibility===Gy.open||this.state.visibility===Gy.animatingOpen},enumerable:!1,configurable:!0}),t.prototype._shouldListenForOuterClick=function(e){return!!e.isBlocking&&!!e.isOpen},t.prototype._updateFooterPosition=function(){var e=this._scrollableContent;if(e){var t=e.clientHeight,o=e.scrollHeight;this.setState({isFooterSticky:t<o})}},t.prototype._dismissOnOuterClick=function(e){var t=this._panel.current;this.isActive&&t&&!e.defaultPrevented&&(Ca(t,e.target)||(this.props.onOuterClick?this.props.onOuterClick(e):this.dismiss(e)))},t.defaultProps={isHiddenOnDismiss:!1,isOpen:void 0,isBlocking:!0,hasCloseButton:!0,type:iy.smallFixedFar},t}(f.Component),$y={root:"ms-Panel",main:"ms-Panel-main",commands:"ms-Panel-commands",contentInner:"ms-Panel-contentInner",scrollableContent:"ms-Panel-scrollableContent",navigation:"ms-Panel-navigation",closeButton:"ms-Panel-closeButton ms-PanelAction-close",header:"ms-Panel-header",headerText:"ms-Panel-headerText",content:"ms-Panel-content",footer:"ms-Panel-footer",footerInner:"ms-Panel-footerInner",isOpen:"is-open",hasCloseButton:"ms-Panel--hasCloseButton",smallFluid:"ms-Panel--smFluid",smallFixedNear:"ms-Panel--smLeft",smallFixedFar:"ms-Panel--sm",medium:"ms-Panel--md",large:"ms-Panel--lg",largeFixed:"ms-Panel--fixed",extraLarge:"ms-Panel--xl",custom:"ms-Panel--custom",customNear:"ms-Panel--customLeft"},e_="auto",t_=((qy={})["@media (min-width: "+co+"px)"]={width:340},qy),o_=((Yy={})["@media (min-width: "+uo+"px)"]={width:592},Yy["@media (min-width: "+po+"px)"]={width:644},Yy),n_=((Zy={})["@media (min-width: "+_o+"px)"]={left:48,width:"auto"},Zy["@media (min-width: "+ho+"px)"]={left:428},Zy),r_=((Xy={})["@media (min-width: "+ho+"px)"]={left:e_,width:940},Xy),i_=((Qy={})["@media (min-width: "+ho+"px)"]={left:176},Qy),a_=function(e){var t;switch(e){case iy.smallFixedFar:t=d({},t_);break;case iy.medium:t=d(d({},t_),o_);break;case iy.large:t=d(d(d({},t_),o_),n_);break;case iy.largeFixed:t=d(d(d(d({},t_),o_),n_),r_);break;case iy.extraLarge:t=d(d(d(d({},t_),o_),n_),i_)}return t},s_={paddingLeft:"24px",paddingRight:"24px"},l_=Vn(Jy,(function(e){var t,o=e.className,n=e.focusTrapZoneClassName,r=e.hasCloseButton,i=e.headerClassName,a=e.isAnimating,s=e.isFooterSticky,l=e.isFooterAtBottom,c=e.isOnRightSide,u=e.isOpen,p=e.isHiddenOnDismiss,h=e.hasCustomNavigation,m=e.theme,g=e.type,f=void 0===g?iy.smallFixedFar:g,v=m.effects,b=m.fonts,y=m.semanticColors,_=Qo($y,m),C=f===iy.custom||f===iy.customNear;return{root:[_.root,m.fonts.medium,u&&_.isOpen,r&&_.hasCloseButton,{pointerEvents:"none",position:"absolute",top:0,left:0,right:0,bottom:0},C&&c&&_.custom,C&&!c&&_.customNear,o],overlay:[{pointerEvents:"auto",cursor:"pointer"},u&&a&&Ze.fadeIn100,!u&&a&&Ze.fadeOut100],hiddenPanel:[!u&&!a&&p&&{visibility:"hidden"}],main:[_.main,{backgroundColor:y.bodyBackground,boxShadow:v.elevation64,pointerEvents:"auto",position:"absolute",display:"flex",flexDirection:"column",overflowX:"hidden",overflowY:"auto",WebkitOverflowScrolling:"touch",bottom:0,top:0,left:e_,right:0,width:"100%",selectors:d((t={},t[ro]={borderLeft:"3px solid "+y.variantBorder,borderRight:"3px solid "+y.variantBorder},t),a_(f))},f===iy.smallFluid&&{left:0},f===iy.smallFixedNear&&{left:0,right:e_,width:272},f===iy.customNear&&{right:"auto",left:0},C&&{maxWidth:"100vw"},u&&a&&!c&&Ze.slideRightIn40,u&&a&&c&&Ze.slideLeftIn40,!u&&a&&!c&&Ze.slideLeftOut40,!u&&a&&c&&Ze.slideRightOut40,n],commands:[_.commands,{marginTop:18},h&&{marginTop:"inherit"}],navigation:[_.navigation,{display:"flex",justifyContent:"flex-end"},h&&{height:"44px"}],contentInner:[_.contentInner,{display:"flex",flexDirection:"column",flexGrow:1,overflowY:"hidden"}],header:[_.header,s_,{alignSelf:"flex-start"},r&&!h&&{flexGrow:1},h&&{flexShrink:0}],headerText:[_.headerText,b.xLarge,{color:y.bodyText,lineHeight:"27px",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},i],scrollableContent:[_.scrollableContent,{overflowY:"auto"},l&&{flexGrow:1}],content:[_.content,s_,{paddingBottom:20}],footer:[_.footer,{flexShrink:0,borderTop:"1px solid transparent",transition:"opacity "+Le.durationValue3+" "+Le.easeFunction2},s&&{background:y.bodyBackground,borderTopColor:y.variantBorder}],footerInner:[_.footerInner,s_,{paddingBottom:16,paddingTop:16}],subComponentStyles:{closeButton:{root:[_.closeButton,{marginRight:14,color:m.palette.neutralSecondary,fontSize:Ye.large},h&&{marginRight:0,height:"auto",width:"44px"}],rootHovered:{color:m.palette.neutralPrimary}}}}}),void 0,{scope:"Panel"}),c_="Dropdown",u_=Jn(),d_={options:[]},p_=f.forwardRef((function(e,t){var o=tr(d_,e),n=f.useRef(null),r=Or(t,n),i=xu(n,o.responsiveMode),a=function(e){var t,o=e.defaultSelectedKeys,n=e.selectedKeys,r=e.defaultSelectedKey,i=e.selectedKey,a=e.options,s=e.multiSelect,l=Ti(a),c=f.useState([]),u=c[0],d=c[1],p=a!==l,h=Ti(t=s?p&&void 0!==o?o:n:p&&void 0!==r?r:i);return f.useEffect((function(){var e=function(e){return ia(a,(function(t){return null!=e?t.key===e:!!t.selected||!!t.isSelected}))};void 0===t&&l||t===h&&!p||d(function(){if(void 0===t)return s?a.map((function(e,t){return e.selected?t:-1})).filter((function(e){return-1!==e})):-1!==(i=e(null))?[i]:[];if(!Array.isArray(t))return-1!==(i=e(t))?[i]:[];for(var o=[],n=0,r=t;n<r.length;n++){var i,l=r[n];-1!==(i=e(l))&&o.push(i)}return o}())}),[p,s,l,h,a,t]),[u,d]}(o),s=a[0],l=a[1];return f.createElement(f_,d({},o,{responsiveMode:i,hoisted:{rootRef:r,selectedIndices:s,setSelectedIndices:l}}))}));p_.displayName="DropdownBase";var h_,m_,g_,f_=function(e){function t(t){var o=e.call(this,t)||this;o._host=f.createRef(),o._focusZone=f.createRef(),o._dropDown=f.createRef(),o._scrollIdleDelay=250,o._sizePosCache=new Uy,o._requestAnimationFrame=Ky(o),o._onChange=function(e,t,n,r,i){var a=o.props,s=a.onChange,l=a.onChanged;if(s||l){var c=i?d(d({},t[n]),{selected:!r}):t[n];s&&s(d(d({},e),{target:o._dropDown.current}),c,n),l&&l(c,n)}},o._getPlaceholder=function(){return o.props.placeholder||o.props.placeHolder},o._getTitle=function(e,t){var n=o.props.multiSelectDelimiter,r=void 0===n?", ":n;return e.map((function(e){return e.text})).join(r)},o._onRenderTitle=function(e){return f.createElement(f.Fragment,null,o._getTitle(e))},o._onRenderPlaceholder=function(e){return o._getPlaceholder()?f.createElement(f.Fragment,null,o._getPlaceholder()):null},o._onRenderContainer=function(e){var t=e.calloutProps,n=e.panelProps,r=o.props,i=r.responsiveMode,a=r.dropdownWidth,s=i<=pu.medium,l=o._classNames.subComponentStyles?o._classNames.subComponentStyles.panel:void 0,c=void 0,u=void 0;return"auto"===a?u=o._dropDown.current?o._dropDown.current.clientWidth:0:c=a||(o._dropDown.current?o._dropDown.current.clientWidth:0),s?f.createElement(l_,d({isOpen:!0,isLightDismiss:!0,onDismiss:o._onDismiss,hasCloseButton:!1,styles:l},n),o._renderFocusableList(e)):f.createElement(Cc,d({isBeakVisible:!1,gapSpace:0,doNotLayer:!1,directionalHintFixed:!1,directionalHint:qs.bottomLeftEdge,calloutWidth:c,calloutMinWidth:u},t,{className:o._classNames.callout,target:o._dropDown.current,onDismiss:o._onDismiss,onScroll:o._onScroll,onPositioned:o._onPositioned}),o._renderFocusableList(e))},o._onRenderCaretDown=function(e){return f.createElement(ii,{className:o._classNames.caretDown,iconName:"ChevronDown","aria-hidden":!0})},o._onRenderList=function(e){var t=e.onRenderItem,n=void 0===t?o._onRenderItem:t,r={items:[]},i=[],a=function(){var e=r.id?[f.createElement("div",{role:"group",key:r.id,"aria-labelledby":r.id},r.items)]:r.items;i=m(i,e),r={items:[]}};return e.options.forEach((function(e,t){!function(e,t){switch(e.itemType){case Gg.Header:r.items.length>0&&a();var i=o._id+e.key;r.items.push(n(d(d({id:i},e),{index:t}),o._onRenderItem)),r.id=i;break;case Gg.Divider:t>0&&r.items.push(n(d(d({},e),{index:t}),o._onRenderItem)),r.items.length>0&&a();break;default:r.items.push(n(d(d({},e),{index:t}),o._onRenderItem))}}(e,t)})),r.items.length>0&&a(),f.createElement(f.Fragment,null,i)},o._onRenderItem=function(e){switch(e.itemType){case Gg.Divider:return o._renderSeparator(e);case Gg.Header:return o._renderHeader(e);default:return o._renderOption(e)}},o._renderOption=function(e){var t=o.props,n=t.onRenderOption,r=void 0===n?o._onRenderOption:n,i=t.hoisted.selectedIndices,a=void 0===i?[]:i,s=!(void 0===e.index||!a)&&a.indexOf(e.index)>-1,l=e.hidden?o._classNames.dropdownItemHidden:s&&!0===e.disabled?o._classNames.dropdownItemSelectedAndDisabled:s?o._classNames.dropdownItemSelected:!0===e.disabled?o._classNames.dropdownItemDisabled:o._classNames.dropdownItem,c=e.title,u=o._classNames.subComponentStyles?o._classNames.subComponentStyles.multiSelectItem:void 0;return o.props.multiSelect?f.createElement(Ah,{id:o._listId+e.index,key:e.key,disabled:e.disabled,onChange:o._onItemClick(e),inputProps:d({"aria-selected":s,onMouseEnter:o._onItemMouseEnter.bind(o,e),onMouseLeave:o._onMouseItemLeave.bind(o,e),onMouseMove:o._onItemMouseMove.bind(o,e),role:"option"},{"data-index":e.index,"data-is-focusable":!e.disabled}),label:e.text,title:c,onRenderLabel:o._onRenderItemLabel.bind(o,e),className:l,checked:s,styles:u,ariaPositionInSet:o._sizePosCache.positionInSet(e.index),ariaSetSize:o._sizePosCache.optionSetSize,ariaLabel:e.ariaLabel}):f.createElement(zd,{id:o._listId+e.index,key:e.key,"data-index":e.index,"data-is-focusable":!e.disabled,disabled:e.disabled,className:l,onClick:o._onItemClick(e),onMouseEnter:o._onItemMouseEnter.bind(o,e),onMouseLeave:o._onMouseItemLeave.bind(o,e),onMouseMove:o._onItemMouseMove.bind(o,e),role:"option","aria-selected":s?"true":"false",ariaLabel:e.ariaLabel,title:c,"aria-posinset":o._sizePosCache.positionInSet(e.index),"aria-setsize":o._sizePosCache.optionSetSize},r(e,o._onRenderOption))},o._onRenderOption=function(e){return f.createElement("span",{className:o._classNames.dropdownOptionText},e.text)},o._onRenderItemLabel=function(e){var t=o.props.onRenderOption;return(void 0===t?o._onRenderOption:t)(e,o._onRenderOption)},o._onPositioned=function(e){o._focusZone.current&&o._requestAnimationFrame((function(){var e=o.props.hoisted.selectedIndices;if(o._focusZone.current)if(e&&e[0]&&!o.props.options[e[0]].disabled){var t=nt().getElementById(o._id+"-list"+e[0]);t&&o._focusZone.current.focusElement(t)}else o._focusZone.current.focus()})),o.state.calloutRenderEdge&&o.state.calloutRenderEdge===e.targetEdge||o.setState({calloutRenderEdge:e.targetEdge})},o._onItemClick=function(e){return function(t){e.disabled||(o.setSelectedIndex(t,e.index),o.props.multiSelect||o.setState({isOpen:!1}))}},o._onScroll=function(){o._isScrollIdle||void 0===o._scrollIdleTimeoutId?o._isScrollIdle=!1:(clearTimeout(o._scrollIdleTimeoutId),o._scrollIdleTimeoutId=void 0),o._scrollIdleTimeoutId=window.setTimeout((function(){o._isScrollIdle=!0}),o._scrollIdleDelay)},o._onMouseItemLeave=function(e,t){if(!o._shouldIgnoreMouseEvent()&&o._host.current)if(o._host.current.setActive)try{o._host.current.setActive()}catch(e){}else o._host.current.focus()},o._onDismiss=function(){o.setState({isOpen:!1})},o._onDropdownBlur=function(e){o._isDisabled()||o.state.isOpen||(o.setState({hasFocus:!1}),o.props.onBlur&&o.props.onBlur(e))},o._onDropdownKeyDown=function(e){if(!o._isDisabled()&&(o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e),!o.props.onKeyDown||(o.props.onKeyDown(e),!e.defaultPrevented))){var t,n=o.props.hoisted.selectedIndices.length?o.props.hoisted.selectedIndices[0]:-1,r=e.altKey||e.metaKey,i=o.state.isOpen;switch(e.which){case Un.enter:o.setState({isOpen:!i});break;case Un.escape:if(!i)return;o.setState({isOpen:!1});break;case Un.up:if(r){if(i){o.setState({isOpen:!1});break}return}o.props.multiSelect?o.setState({isOpen:!0}):o._isDisabled()||(t=o._moveIndex(e,-1,n-1,n));break;case Un.down:r&&(e.stopPropagation(),e.preventDefault()),r&&!i||o.props.multiSelect?o.setState({isOpen:!0}):o._isDisabled()||(t=o._moveIndex(e,1,n+1,n));break;case Un.home:o.props.multiSelect||(t=o._moveIndex(e,1,0,n));break;case Un.end:o.props.multiSelect||(t=o._moveIndex(e,-1,o.props.options.length-1,n));break;case Un.space:break;default:return}t!==n&&(e.stopPropagation(),e.preventDefault())}},o._onDropdownKeyUp=function(e){if(!o._isDisabled()){var t=o._shouldHandleKeyUp(e),n=o.state.isOpen;if(!o.props.onKeyUp||(o.props.onKeyUp(e),!e.defaultPrevented)){switch(e.which){case Un.space:o.setState({isOpen:!n});break;default:return void(t&&n&&o.setState({isOpen:!1}))}e.stopPropagation(),e.preventDefault()}}},o._onZoneKeyDown=function(e){var t;o._lastKeyDownWasAltOrMeta=o._isAltOrMeta(e);var n=e.altKey||e.metaKey;switch(e.which){case Un.up:n?o.setState({isOpen:!1}):o._host.current&&(t=xa(o._host.current,o._host.current.lastChild,!0));break;case Un.home:case Un.end:case Un.pageUp:case Un.pageDown:break;case Un.down:!n&&o._host.current&&(t=Sa(o._host.current,o._host.current.firstChild,!0));break;case Un.escape:o.setState({isOpen:!1});break;case Un.tab:return void o.setState({isOpen:!1});default:return}t&&t.focus(),e.stopPropagation(),e.preventDefault()},o._onZoneKeyUp=function(e){o._shouldHandleKeyUp(e)&&o.state.isOpen&&(o.setState({isOpen:!1}),e.preventDefault())},o._onDropdownClick=function(e){if(!o.props.onClick||(o.props.onClick(e),!e.defaultPrevented)){var t=o.state.isOpen;o._isDisabled()||o._shouldOpenOnFocus()||o.setState({isOpen:!t}),o._isFocusedByClick=!1}},o._onDropdownMouseDown=function(){o._isFocusedByClick=!0},o._onFocus=function(e){if(!o._isDisabled()){o.props.onFocus&&o.props.onFocus(e);var t={hasFocus:!0};o._shouldOpenOnFocus()&&(t.isOpen=!0),o.setState(t)}},o._isDisabled=function(){var e=o.props.disabled,t=o.props.isDisabled;return void 0===e&&(e=t),e},o._onRenderLabel=function(e){var t=e.label,n=e.required,r=e.disabled,i=o._classNames.subComponentStyles?o._classNames.subComponentStyles.label:void 0;return t?f.createElement(Oh,{className:o._classNames.label,id:o._labelId,required:n,styles:i,disabled:r},t):null},Ui(o);var n=t.multiSelect,r=t.selectedKey,i=t.selectedKeys,a=t.defaultSelectedKey,s=t.defaultSelectedKeys,l=t.options;if(xi(c_,t,{isDisabled:"disabled",onChanged:"onChange",placeHolder:"placeholder",onRenderPlaceHolder:"onRenderPlaceholder"}),ki(c_,t,{defaultSelectedKey:"selectedKey",defaultSelectedKeys:"selectedKeys",selectedKeys:"selectedKey"}),n){var c=function(e){return cn("Dropdown property '"+e+"' cannot be used when 'multiSelect' is true. Use '"+e+"s' instead.")};void 0!==r&&c("selectedKey"),void 0!==a&&c("defaultSelectedKey")}else{var u=function(e){return cn("Dropdown property '"+e+"s' cannot be used when 'multiSelect' is false/unset. Use '"+e+"' instead.")};void 0!==i&&u("selectedKey"),void 0!==s&&u("defaultSelectedKey")}return o._id=t.id||Va("Dropdown"),o._labelId=o._id+"-label",o._listId=o._id+"-list",o._optionId=o._id+"-option",o._isScrollIdle=!0,o._sizePosCache.updateOptions(l),o.state={isOpen:!1,hasFocus:!1,calloutRenderEdge:void 0},o}return u(t,e),Object.defineProperty(t.prototype,"selectedOptions",{get:function(){var e=this.props;return nf(e.options,e.hoisted.selectedIndices)},enumerable:!1,configurable:!0}),t.prototype.componentWillUnmount=function(){clearTimeout(this._scrollIdleTimeoutId)},t.prototype.componentDidUpdate=function(e,t){!0===t.isOpen&&!1===this.state.isOpen&&(this._gotMouseMove=!1,this.props.onDismiss&&this.props.onDismiss())},t.prototype.render=function(){var e=this._id,t=this.props,o=t.className,n=t.label,r=t.options,i=t.ariaLabel,a=t.required,s=t.errorMessage,l=t.styles,c=t.theme,u=t.panelProps,p=t.calloutProps,h=t.onRenderTitle,m=void 0===h?this._getTitle:h,g=t.onRenderContainer,v=void 0===g?this._onRenderContainer:g,b=t.onRenderCaretDown,y=void 0===b?this._onRenderCaretDown:b,_=t.onRenderLabel,C=void 0===_?this._onRenderLabel:_,S=t.hoisted.selectedIndices,x=this.state,k=x.isOpen,w=x.calloutRenderEdge,I=t.onRenderPlaceholder||t.onRenderPlaceHolder||this._getPlaceholder;r!==this._sizePosCache.cachedOptions&&this._sizePosCache.updateOptions(r);var D=nf(r,S),T=Tr(t,Dr),E=this._isDisabled(),P=e+"-errorMessage",M=E?void 0:k&&1===S.length&&S[0]>=0?this._listId+S[0]:void 0;this._classNames=u_(l,{theme:c,className:o,hasError:!!(s&&s.length>0),hasLabel:!!n,isOpen:k,required:a,disabled:E,isRenderingPlaceholder:!D.length,panelClassName:u?u.className:void 0,calloutClassName:p?p.className:void 0,calloutRenderEdge:w});var R=!!s&&s.length>0;return f.createElement("div",{className:this._classNames.root,ref:this.props.hoisted.rootRef,"aria-owns":k?this._listId:void 0},C(this.props,this._onRenderLabel),f.createElement("div",d({"data-is-focusable":!E,"data-ktp-target":!0,ref:this._dropDown,id:e,tabIndex:E?-1:0,role:"combobox","aria-haspopup":"listbox","aria-expanded":k?"true":"false","aria-label":i,"aria-labelledby":n&&!i?Ks(this._labelId,this._optionId):void 0,"aria-describedby":R?this._id+"-errorMessage":void 0,"aria-activedescendant":M,"aria-required":a,"aria-disabled":E,"aria-controls":k?this._listId:void 0},T,{className:this._classNames.dropdown,onBlur:this._onDropdownBlur,onKeyDown:this._onDropdownKeyDown,onKeyUp:this._onDropdownKeyUp,onClick:this._onDropdownClick,onMouseDown:this._onDropdownMouseDown,onFocus:this._onFocus}),f.createElement("span",{id:this._optionId,className:this._classNames.title,"aria-live":"polite","aria-atomic":!0,"aria-invalid":R},D.length?m(D,this._onRenderTitle):I(t,this._onRenderPlaceholder)),f.createElement("span",{className:this._classNames.caretDownWrapper},y(t,this._onRenderCaretDown))),k&&v(d(d({},t),{onDismiss:this._onDismiss}),this._onRenderContainer),R&&f.createElement("div",{role:"alert",id:P,className:this._classNames.errorMessage},s))},t.prototype.focus=function(e){this._dropDown.current&&(this._dropDown.current.focus(),e&&this.setState({isOpen:!0}))},t.prototype.setSelectedIndex=function(e,t){var o=this.props,n=o.options,r=o.selectedKey,i=o.selectedKeys,a=o.multiSelect,s=o.notifyOnReselect,l=o.hoisted.selectedIndices,c=void 0===l?[]:l,u=!!c&&c.indexOf(t)>-1,d=[];if(t=Math.max(0,Math.min(n.length-1,t)),void 0===r&&void 0===i){if(a||s||t!==c[0]){if(a)if(d=c?this._copyArray(c):[],u){var p=d.indexOf(t);p>-1&&d.splice(p,1)}else d.push(t);else d=[t];e.persist(),this.props.hoisted.setSelectedIndices(d),this._onChange(e,n,t,u,a)}}else this._onChange(e,n,t,u,a)},t.prototype._copyArray=function(e){for(var t=[],o=0,n=e;o<n.length;o++){var r=n[o];t.push(r)}return t},t.prototype._moveIndex=function(e,t,o,n){var r=this.props.options;if(n===o||0===r.length)return n;o>=r.length?o=0:o<0&&(o=r.length-1);for(var i=0;r[o].itemType===Gg.Header||r[o].itemType===Gg.Divider||r[o].disabled;){if(i>=r.length)return n;o+t<0?o=r.length:o+t>=r.length&&(o=-1),o+=t,i++}return this.setSelectedIndex(e,o),o},t.prototype._renderFocusableList=function(e){var t=e.onRenderList,o=void 0===t?this._onRenderList:t,n=e.label,r=e.ariaLabel,i=e.multiSelect;return f.createElement("div",{className:this._classNames.dropdownItemsWrapper,onKeyDown:this._onZoneKeyDown,onKeyUp:this._onZoneKeyUp,ref:this._host,tabIndex:0},f.createElement(vs,{ref:this._focusZone,direction:$i.vertical,id:this._listId,className:this._classNames.dropdownItems,role:"listbox","aria-label":r,"aria-labelledby":n&&!r?this._labelId:void 0,"aria-multiselectable":i},o(e,this._onRenderList)))},t.prototype._renderSeparator=function(e){var t=e.index,o=e.key;return t>0?f.createElement("div",{role:"separator",key:o,className:this._classNames.dropdownDivider}):null},t.prototype._renderHeader=function(e){var t=this.props.onRenderOption,o=void 0===t?this._onRenderOption:t,n=e.key,r=e.id;return f.createElement("div",{id:r,key:n,className:this._classNames.dropdownItemHeader},o(e,this._onRenderOption))},t.prototype._onItemMouseEnter=function(e,t){this._shouldIgnoreMouseEvent()||t.currentTarget.focus()},t.prototype._onItemMouseMove=function(e,t){var o=t.currentTarget;this._gotMouseMove=!0,this._isScrollIdle&&document.activeElement!==o&&o.focus()},t.prototype._shouldIgnoreMouseEvent=function(){return!this._isScrollIdle||!this._gotMouseMove},t.prototype._isAltOrMeta=function(e){return e.which===Un.alt||"Meta"===e.key},t.prototype._shouldHandleKeyUp=function(e){var t=this._lastKeyDownWasAltOrMeta&&this._isAltOrMeta(e);return this._lastKeyDownWasAltOrMeta=!1,!!t&&!(Ys()||Qs())},t.prototype._shouldOpenOnFocus=function(){var e=this.state.hasFocus,t=this.props.openOnKeyboardFocus;return!this._isFocusedByClick&&!0===t&&!e},t.defaultProps={options:[]},t}(f.Component),v_={root:"ms-Dropdown-container",label:"ms-Dropdown-label",dropdown:"ms-Dropdown",title:"ms-Dropdown-title",caretDownWrapper:"ms-Dropdown-caretDownWrapper",caretDown:"ms-Dropdown-caretDown",callout:"ms-Dropdown-callout",panel:"ms-Dropdown-panel",dropdownItems:"ms-Dropdown-items",dropdownItem:"ms-Dropdown-item",dropdownDivider:"ms-Dropdown-divider",dropdownOptionText:"ms-Dropdown-optionText",dropdownItemHeader:"ms-Dropdown-header",titleIsPlaceHolder:"ms-Dropdown-titleIsPlaceHolder",titleHasError:"ms-Dropdown-title--hasError"},b_=((h_={})[ro+", "+io.replace("@media ","")]=d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),h_),y_={selectors:d((m_={},m_[ro]={backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},m_),b_)},__={selectors:(g_={},g_[ro]={borderColor:"Highlight"},g_)},C_=Co(0,co),S_=Vn(p_,(function(e){var t,o,n,r,i,a,s,l,c,u,p,h,g=e.theme,f=e.hasError,v=e.hasLabel,b=e.className,y=e.isOpen,_=e.disabled,C=e.required,S=e.isRenderingPlaceholder,x=e.panelClassName,k=e.calloutClassName,w=e.calloutRenderEdge;if(!g)throw new Error("theme is undefined or null in base Dropdown getStyles function.");var I=Qo(v_,g),D=g.palette,T=g.semanticColors,E=g.effects,P=g.fonts,M={color:T.menuItemTextHovered},R={color:T.menuItemText},N={borderColor:T.errorText},B=[I.dropdownItem,{backgroundColor:"transparent",boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",padding:"0 8px",width:"100%",minHeight:36,lineHeight:20,height:0,position:"relative",border:"1px solid transparent",borderRadius:0,wordWrap:"break-word",overflowWrap:"break-word",textAlign:"left",".ms-Button-flexContainer":{width:"100%"}}],F=T.menuItemBackgroundPressed,A=function(e){var t;return void 0===e&&(e=!1),{selectors:(t={"&:hover:focus":[{color:T.menuItemTextHovered,backgroundColor:e?F:T.menuItemBackgroundHovered},y_],"&:focus":[{backgroundColor:e?F:"transparent"},y_],"&:active":[{color:T.menuItemTextHovered,backgroundColor:e?T.menuItemBackgroundHovered:T.menuBackground},y_]},t["."+wo+" &:focus:after"]={left:0,top:0,bottom:0,right:0},t[ro]={border:"none"},t)}},L=m(B,[{backgroundColor:F,color:T.menuItemTextHovered},A(!0),y_]),H=m(B,[{color:T.disabledText,cursor:"default",selectors:(t={},t[ro]={color:"GrayText",border:"none"},t)}]),O=w===Zs.bottom?E.roundedCorner2+" "+E.roundedCorner2+" 0 0":"0 0 "+E.roundedCorner2+" "+E.roundedCorner2,z=w===Zs.bottom?"0 0 "+E.roundedCorner2+" "+E.roundedCorner2:E.roundedCorner2+" "+E.roundedCorner2+" 0 0";return{root:[I.root,b],label:I.label,dropdown:[I.dropdown,on,P.medium,{color:T.menuItemText,borderColor:T.focusBorder,position:"relative",outline:0,userSelect:"none",selectors:(o={},o["&:hover ."+I.title]=[!_&&M,{borderColor:y?D.neutralSecondary:D.neutralPrimary},__],o["&:focus ."+I.title]=[!_&&M,{selectors:(n={},n[ro]={color:"Highlight"},n)}],o["&:focus:after"]=[{pointerEvents:"none",content:"''",position:"absolute",boxSizing:"border-box",top:"0px",left:"0px",width:"100%",height:"100%",border:_?"none":"2px solid "+D.themePrimary,borderRadius:"2px",selectors:(r={},r[ro]={color:"Highlight"},r)}],o["&:active ."+I.title]=[!_&&M,{borderColor:D.themePrimary},__],o["&:hover ."+I.caretDown]=!_&&R,o["&:focus ."+I.caretDown]=[!_&&R,{selectors:(i={},i[ro]={color:"Highlight"},i)}],o["&:active ."+I.caretDown]=!_&&R,o["&:hover ."+I.titleIsPlaceHolder]=!_&&R,o["&:focus ."+I.titleIsPlaceHolder]=!_&&R,o["&:active ."+I.titleIsPlaceHolder]=!_&&R,o["&:hover ."+I.titleHasError]=N,o["&:active ."+I.titleHasError]=N,o)},y&&"is-open",_&&"is-disabled",C&&"is-required",C&&!v&&{selectors:(a={":before":{content:"'*'",color:T.errorText,position:"absolute",top:-5,right:-10}},a[ro]={selectors:{":after":{right:-14}}},a)}],title:[I.title,on,{backgroundColor:T.inputBackground,borderWidth:1,borderStyle:"solid",borderColor:T.inputBorder,borderRadius:y?O:E.roundedCorner2,cursor:"pointer",display:"block",height:32,lineHeight:30,padding:"0 28px 0 8px",position:"relative",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},S&&[I.titleIsPlaceHolder,{color:T.inputPlaceholderText}],f&&[I.titleHasError,N],_&&{backgroundColor:T.disabledBackground,border:"none",color:T.disabledText,cursor:"default",selectors:(s={},s[ro]=d({border:"1px solid GrayText",color:"GrayText",backgroundColor:"Window"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),s)}],caretDownWrapper:[I.caretDownWrapper,{position:"absolute",top:1,right:8,height:32,lineHeight:30},!_&&{cursor:"pointer"}],caretDown:[I.caretDown,{color:D.neutralSecondary,fontSize:P.small.fontSize,pointerEvents:"none"},_&&{color:T.disabledText,selectors:(l={},l[ro]=d({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),l)}],errorMessage:d(d({color:T.errorText},g.fonts.small),{paddingTop:5}),callout:[I.callout,{boxShadow:E.elevation8,borderRadius:z,selectors:(c={},c[".ms-Callout-main"]={borderRadius:z},c)},k],dropdownItemsWrapper:{selectors:{"&:focus":{outline:0}}},dropdownItems:[I.dropdownItems,{display:"block"}],dropdownItem:m(B,[A()]),dropdownItemSelected:L,dropdownItemDisabled:H,dropdownItemSelectedAndDisabled:[L,H,{backgroundColor:"transparent"}],dropdownItemHidden:m(B,[{display:"none"}]),dropdownDivider:[I.dropdownDivider,{height:1,backgroundColor:T.bodyDivider}],dropdownOptionText:[I.dropdownOptionText,{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",minWidth:0,maxWidth:"100%",wordWrap:"break-word",overflowWrap:"break-word",margin:"1px"}],dropdownItemHeader:[I.dropdownItemHeader,d(d({},P.medium),{fontWeight:qe.semibold,color:T.menuHeader,background:"none",backgroundColor:"transparent",border:"none",height:36,lineHeight:36,cursor:"default",padding:"0 8px",userSelect:"none",textAlign:"left",selectors:(u={},u[ro]=d({color:"GrayText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),u)})],subComponentStyles:{label:{root:{display:"inline-block"}},multiSelectItem:{root:{padding:0},label:{alignSelf:"stretch",padding:"0 8px",width:"100%"},input:{selectors:(p={},p["."+wo+" &:focus + label::before"]={outlineOffset:"0px"},p)}},panel:{root:[x],main:{selectors:(h={},h[C_]={width:272},h)},contentInner:{padding:"0 0 20px"}}}}}),void 0,{scope:"Dropdown"});S_.displayName="Dropdown",Ft([{rawString:".pickerText_fe42fc7e{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid "},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:";min-width:180px;padding:1px;min-height:32px}.pickerText_fe42fc7e:hover{border-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.pickerInput_fe42fc7e{height:34px;border:none;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;outline:0;padding:0 6px 0;margin:1px}.pickerInput_fe42fc7e::-ms-clear{display:none}"}]);var x_="pickerText_fe42fc7e",k_="pickerInput_fe42fc7e",w_=o,I_=function(e){function t(t){var o=e.call(this,t)||this;return o.floatingPicker=f.createRef(),o.selectedItemsList=f.createRef(),o.root=f.createRef(),o.input=f.createRef(),o.onSelectionChange=function(){o.forceUpdate()},o.onInputChange=function(e,t){t||(o.setState({queryString:e}),o.floatingPicker.current&&o.floatingPicker.current.onQueryStringChanged(e))},o.onInputFocus=function(e){o.selectedItemsList.current&&o.selectedItemsList.current.unselectAll(),o.props.inputProps&&o.props.inputProps.onFocus&&o.props.inputProps.onFocus(e)},o.onInputClick=function(e){if(o.selectedItemsList.current&&o.selectedItemsList.current.unselectAll(),o.floatingPicker.current&&o.inputElement){var t=""===o.inputElement.value||o.inputElement.value!==o.floatingPicker.current.inputText;o.floatingPicker.current.showPicker(t)}},o.onBackspace=function(e){e.which===Un.backspace&&o.selectedItemsList.current&&o.items.length&&(o.input.current&&!o.input.current.isValueSelected&&o.input.current.inputElement===document.activeElement&&0===o.input.current.cursorLocation?(o.floatingPicker.current&&o.floatingPicker.current.hidePicker(),e.preventDefault(),o.selectedItemsList.current.removeItemAt(o.items.length-1),o._onSelectedItemsChanged()):o.selectedItemsList.current.hasSelectedItems()&&(o.floatingPicker.current&&o.floatingPicker.current.hidePicker(),e.preventDefault(),o.selectedItemsList.current.removeSelectedItems(),o._onSelectedItemsChanged()))},o.onCopy=function(e){o.selectedItemsList.current&&o.selectedItemsList.current.onCopy(e)},o.onPaste=function(e){if(o.props.onPaste){var t=e.clipboardData.getData("Text");e.preventDefault(),o.props.onPaste(t)}},o._onSuggestionSelected=function(e){var t=o.props.currentRenderedQueryString,n=o.state.queryString;if(void 0===t||t===n){var r=o.props.onItemSelected?o.props.onItemSelected(e):e;if(null===r)return;var i,a=r,s=r;s&&s.then?s.then((function(e){i=e,o._addProcessedItem(i)})):(i=a,o._addProcessedItem(i))}},o._onSelectedItemsChanged=function(){o.focus()},o._onSuggestionsShownOrHidden=function(){o.forceUpdate()},Ui(o),o.selection=new Yf({onSelectionChanged:function(){return o.onSelectionChange()}}),o.state={queryString:""},o}return u(t,e),Object.defineProperty(t.prototype,"items",{get:function(){var e,t,o,n;return null!==(n=null!==(o=null!==(e=this.props.selectedItems)&&void 0!==e?e:null===(t=this.selectedItemsList.current)||void 0===t?void 0:t.items)&&void 0!==o?o:this.props.defaultSelectedItems)&&void 0!==n?n:null},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.forceUpdate()},t.prototype.focus=function(){this.input.current&&this.input.current.focus()},t.prototype.clearInput=function(){this.input.current&&this.input.current.clear()},Object.defineProperty(t.prototype,"inputElement",{get:function(){return this.input.current&&this.input.current.inputElement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"highlightedItems",{get:function(){return this.selectedItemsList.current?this.selectedItemsList.current.highlightedItems():[]},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this.props,t=e.className,o=e.inputProps,n=e.disabled,r=e.focusZoneProps,i=this.floatingPicker.current&&-1!==this.floatingPicker.current.currentSelectedSuggestionIndex?"sug-"+this.floatingPicker.current.currentSelectedSuggestionIndex:void 0,a=!!this.floatingPicker.current&&this.floatingPicker.current.isSuggestionsShown;return f.createElement("div",{ref:this.root,className:qr("ms-BasePicker ms-BaseExtendedPicker",t||""),onKeyDown:this.onBackspace,onCopy:this.onCopy},f.createElement(vs,d({direction:$i.bidirectional},r),f.createElement(av,{selection:this.selection,selectionMode:Kf.multiple},f.createElement("div",{className:qr("ms-BasePicker-text",w_.pickerText),role:"list"},this.props.headerComponent,this.renderSelectedItemsList(),this.canAddItems()&&f.createElement(Qi,d({},o,{className:qr("ms-BasePicker-input",w_.pickerInput),ref:this.input,onFocus:this.onInputFocus,onClick:this.onInputClick,onInputValueChange:this.onInputChange,"aria-activedescendant":i,"aria-owns":a?"suggestion-list":void 0,"aria-expanded":a,"aria-haspopup":"true",role:"combobox",disabled:n,onPaste:this.onPaste}))))),this.renderFloatingPicker())},Object.defineProperty(t.prototype,"floatingPickerProps",{get:function(){return this.props.floatingPickerProps},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedItemsListProps",{get:function(){return this.props.selectedItemsListProps},enumerable:!1,configurable:!0}),t.prototype.canAddItems=function(){var e=this.props.itemLimit;return void 0===e||this.items.length<e},t.prototype.renderFloatingPicker=function(){var e=this.props.onRenderFloatingPicker;return f.createElement(e,d({componentRef:this.floatingPicker,onChange:this._onSuggestionSelected,onSuggestionsHidden:this._onSuggestionsShownOrHidden,onSuggestionsShown:this._onSuggestionsShownOrHidden,inputElement:this.input.current?this.input.current.inputElement:void 0,selectedItems:this.items,suggestionItems:this.props.suggestionItems?this.props.suggestionItems:void 0},this.floatingPickerProps))},t.prototype.renderSelectedItemsList=function(){var e=this.props.onRenderSelectedItems;return f.createElement(e,d({componentRef:this.selectedItemsList,selection:this.selection,selectedItems:this.props.selectedItems?this.props.selectedItems:void 0,onItemsDeleted:this.props.selectedItems?this.props.onItemsRemoved:void 0},this.selectedItemsListProps))},t.prototype._addProcessedItem=function(e){this.props.onItemAdded&&this.props.onItemAdded(e),this.selectedItemsList.current&&this.selectedItemsList.current.addItems([e]),this.input.current&&this.input.current.clear(),this.floatingPicker.current&&this.floatingPicker.current.hidePicker(),this.focus()},t}(f.Component);Ft([{rawString:".resultContent_23cb18ea{display:table-row}.resultContent_23cb18ea .resultItem_23cb18ea{display:table-cell;vertical-align:bottom}.peoplePickerPersona_23cb18ea{width:180px}.peoplePickerPersona_23cb18ea .ms-Persona-details{width:100%}.peoplePicker_23cb18ea .ms-BasePicker-text{min-height:40px}.peoplePickerPersonaContent_23cb18ea{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}"}]);var D_,T_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(I_),E_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(T_);!function(e){e[e.none=0]="none",e[e.descriptive=1]="descriptive",e[e.more=2]="more",e[e.downArrow=3]="downArrow"}(D_||(D_={}));var P_=jo((function(e,t,o){var n=ju(e),r=kn(n,o);return d(d({},r),{root:[n.root,t,e.fonts.medium,o&&o.root]})})),M_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.className,o=e.styles,n=p(e,["className","styles"]),r=P_(this.props.theme,t,o);return f.createElement(Wu,d({},n,{variantClassName:"ms-Button--facepile",styles:r,onRenderDescription:Vs}))},h([Vu("FacepileButton",["theme","styles"],!0)],t)}(f.Component),R_=Jn(),N_={size:Yr.size48,presence:Zr.none,imageAlt:"",showOverflowTooltip:!0},B_=f.forwardRef((function(e,t){var o=tr(N_,e);!function(e){Mi({name:"Persona",props:e,deprecations:{primaryText:"text"}})}(o);var n=Or(t,f.useRef(null)),r=function(){return o.text||o.primaryText||""},i=function(e,t,n){return f.createElement("div",{dir:"auto",className:e},t&&t(o,n))},a=function(e,t){return void 0===t&&(t=!0),e?t?function(){return f.createElement(bd,{content:e,overflowMode:rd.Parent,directionalHint:qs.topLeftEdge},e)}:function(){return f.createElement(f.Fragment,null,e)}:void 0},s=a(r(),o.showOverflowTooltip),l=a(o.secondaryText,o.showOverflowTooltip),c=a(o.tertiaryText,o.showOverflowTooltip),u=a(o.optionalText,o.showOverflowTooltip),p=o.hidePersonaDetails,h=o.onRenderOptionalText,m=void 0===h?u:h,g=o.onRenderPrimaryText,v=void 0===g?s:g,b=o.onRenderSecondaryText,y=void 0===b?l:b,_=o.onRenderTertiaryText,C=void 0===_?c:_,S=o.onRenderPersonaCoin,x=void 0===S?function(e){return f.createElement(Oi,d({},e))}:S,k=o.size,w=o.allowPhoneInitials,I=o.className,D=o.coinProps,T=o.showUnknownPersonaCoin,E=o.coinSize,P=o.styles,M=o.imageAlt,R=o.imageInitials,N=o.imageShouldFadeIn,B=o.imageShouldStartVisible,F=o.imageUrl,A=o.initialsColor,L=o.initialsTextColor,H=o.isOutOfOffice,O=o.onPhotoLoadingStateChange,z=o.onRenderCoin,W=o.onRenderInitials,V=o.presence,K=o.presenceTitle,U=o.presenceColors,G=o.showInitialsUntilImageLoads,j=o.showSecondaryText,q=o.theme,Y=d({allowPhoneInitials:w,showUnknownPersonaCoin:T,coinSize:E,imageAlt:M,imageInitials:R,imageShouldFadeIn:N,imageShouldStartVisible:B,imageUrl:F,initialsColor:A,initialsTextColor:L,onPhotoLoadingStateChange:O,onRenderCoin:z,onRenderInitials:W,presence:V,presenceTitle:K,showInitialsUntilImageLoads:G,size:k,text:r(),isOutOfOffice:H,presenceColors:U},D),Z=R_(P,{theme:q,className:I,showSecondaryText:j,presence:V,size:k}),X=Tr(o,Dr),Q=f.createElement("div",{className:Z.details},i(Z.primaryText,v,s),i(Z.secondaryText,y,l),i(Z.tertiaryText,C,c),i(Z.optionalText,m,u),o.children);return f.createElement("div",d({},X,{ref:n,className:Z.root,style:E?{height:E,minWidth:E}:void 0}),x(Y,x),(!p||k===Yr.size8||k===Yr.size10||k===Yr.tiny)&&Q)}));B_.displayName="PersonaBase";var F_={root:"ms-Persona",size8:"ms-Persona--size8",size10:"ms-Persona--size10",size16:"ms-Persona--size16",size24:"ms-Persona--size24",size28:"ms-Persona--size28",size32:"ms-Persona--size32",size40:"ms-Persona--size40",size48:"ms-Persona--size48",size56:"ms-Persona--size56",size72:"ms-Persona--size72",size100:"ms-Persona--size100",size120:"ms-Persona--size120",available:"ms-Persona--online",away:"ms-Persona--away",blocked:"ms-Persona--blocked",busy:"ms-Persona--busy",doNotDisturb:"ms-Persona--donotdisturb",offline:"ms-Persona--offline",details:"ms-Persona-details",primaryText:"ms-Persona-primaryText",secondaryText:"ms-Persona-secondaryText",tertiaryText:"ms-Persona-tertiaryText",optionalText:"ms-Persona-optionalText",textContent:"ms-Persona-textContent"},A_=Vn(B_,(function(e){var t=e.className,o=e.showSecondaryText,n=e.theme,r=n.semanticColors,i=n.fonts,a=Qo(F_,n),s=ai(e.size),l=li(e.presence),c="16px",u={color:r.bodySubtext,fontWeight:qe.regular,fontSize:i.small.fontSize};return{root:[a.root,n.fonts.medium,on,{color:r.bodyText,position:"relative",height:Jr.size48,minWidth:Jr.size48,display:"flex",alignItems:"center",selectors:{".contextualHost":{display:"none"}}},s.isSize8&&[a.size8,{height:Jr.size8,minWidth:Jr.size8}],s.isSize10&&[a.size10,{height:Jr.size10,minWidth:Jr.size10}],s.isSize16&&[a.size16,{height:Jr.size16,minWidth:Jr.size16}],s.isSize24&&[a.size24,{height:Jr.size24,minWidth:Jr.size24}],s.isSize24&&o&&{height:"36px"},s.isSize28&&[a.size28,{height:Jr.size28,minWidth:Jr.size28}],s.isSize28&&o&&{height:"32px"},s.isSize32&&[a.size32,{height:Jr.size32,minWidth:Jr.size32}],s.isSize40&&[a.size40,{height:Jr.size40,minWidth:Jr.size40}],s.isSize48&&a.size48,s.isSize56&&[a.size56,{height:Jr.size56,minWidth:Jr.size56}],s.isSize72&&[a.size72,{height:Jr.size72,minWidth:Jr.size72}],s.isSize100&&[a.size100,{height:Jr.size100,minWidth:Jr.size100}],s.isSize120&&[a.size120,{height:Jr.size120,minWidth:Jr.size120}],l.isAvailable&&a.available,l.isAway&&a.away,l.isBlocked&&a.blocked,l.isBusy&&a.busy,l.isDoNotDisturb&&a.doNotDisturb,l.isOffline&&a.offline,t],details:[a.details,{padding:"0 24px 0 16px",minWidth:0,width:"100%",textAlign:"left",display:"flex",flexDirection:"column",justifyContent:"space-around"},(s.isSize8||s.isSize10)&&{paddingLeft:17},(s.isSize24||s.isSize28||s.isSize32)&&{padding:"0 8px"},(s.isSize40||s.isSize48)&&{padding:"0 12px"}],primaryText:[a.primaryText,nn,{color:r.bodyText,fontWeight:qe.regular,fontSize:i.medium.fontSize,selectors:{":hover":{color:r.inputTextHovered}}},o&&{height:c,lineHeight:c,overflowX:"hidden"},(s.isSize8||s.isSize10)&&{fontSize:i.small.fontSize,lineHeight:Jr.size8},s.isSize16&&{lineHeight:Jr.size28},(s.isSize24||s.isSize28||s.isSize32||s.isSize40||s.isSize48)&&o&&{height:18},(s.isSize56||s.isSize72||s.isSize100||s.isSize120)&&{fontSize:i.xLarge.fontSize},(s.isSize56||s.isSize72||s.isSize100||s.isSize120)&&o&&{height:22}],secondaryText:[a.secondaryText,nn,u,(s.isSize8||s.isSize10||s.isSize16||s.isSize24||s.isSize28||s.isSize32)&&{display:"none"},o&&{display:"block",height:c,lineHeight:c,overflowX:"hidden"},s.isSize24&&o&&{height:18},(s.isSize56||s.isSize72||s.isSize100||s.isSize120)&&{fontSize:i.medium.fontSize},(s.isSize56||s.isSize72||s.isSize100||s.isSize120)&&o&&{height:18}],tertiaryText:[a.tertiaryText,nn,u,{display:"none",fontSize:i.medium.fontSize},(s.isSize72||s.isSize100||s.isSize120)&&{display:"block"}],optionalText:[a.optionalText,nn,u,{display:"none",fontSize:i.medium.fontSize},(s.isSize100||s.isSize120)&&{display:"block"}],textContent:[a.textContent,nn]}}),void 0,{scope:"Persona"}),L_=Jn(),H_=function(e){function t(t){var o=e.call(this,t)||this;return o._classNames=L_(o.props.styles,{theme:o.props.theme,className:o.props.className}),o._getPersonaControl=function(e){var t=o.props,n=t.getPersonaProps,r=t.personaSize;return f.createElement(A_,d({imageInitials:e.imageInitials,imageUrl:e.imageUrl,initialsColor:e.initialsColor,allowPhoneInitials:e.allowPhoneInitials,text:e.personaName,size:r},n?n(e):null,{styles:{details:{flex:"1 0 auto"}}}))},o._getPersonaCoinControl=function(e){var t=o.props,n=t.getPersonaProps,r=t.personaSize;return f.createElement(Oi,d({imageInitials:e.imageInitials,imageUrl:e.imageUrl,initialsColor:e.initialsColor,allowPhoneInitials:e.allowPhoneInitials,text:e.personaName,size:r},n?n(e):null))},Ui(o),o._ariaDescriptionId=Va(),o}return u(t,e),t.prototype.render=function(){var e=this.props.overflowButtonProps,t=this.props,o=t.chevronButtonProps,n=t.maxDisplayablePersonas,r=t.personas,i=t.overflowPersonas,a=t.showAddButton,s=t.ariaLabel,l=t.showTooltip,c=void 0===l||l,u=this._classNames,d="number"==typeof n?Math.min(r.length,n):r.length;o&&!e&&(e=o);var p=i&&i.length>0,h=p?r:r.slice(0,d),m=(p?i:r.slice(d))||[];return f.createElement("div",{className:u.root},this.onRenderAriaDescription(),f.createElement("div",{className:u.itemContainer},a?this._getAddNewElement():null,f.createElement("ul",{className:u.members,"aria-label":s},this._onRenderVisiblePersonas(h,0===m.length&&1===r.length,c)),e?this._getOverflowElement(m):null))},t.prototype.onRenderAriaDescription=function(){var e=this.props.ariaDescription,t=this._classNames;return e&&f.createElement("span",{className:t.screenReaderOnly,id:this._ariaDescriptionId},e)},t.prototype._onRenderVisiblePersonas=function(e,t,o){var n=this,r=this.props,i=r.onRenderPersona,a=void 0===i?this._getPersonaControl:i,s=r.onRenderPersonaCoin,l=void 0===s?this._getPersonaCoinControl:s;return e.map((function(e,r){var i=t?a(e,n._getPersonaControl):l(e,n._getPersonaCoinControl);return f.createElement("li",{key:(t?"persona":"personaCoin")+"-"+r,className:n._classNames.member},e.onClick?n._getElementWithOnClickEvent(i,e,o,r):n._getElementWithoutOnClickEvent(i,e,o,r))}))},t.prototype._getElementWithOnClickEvent=function(e,t,o,n){var r=t.keytipProps;return f.createElement(M_,d({},Tr(t,pr),this._getElementProps(t,o,n),{keytipProps:r,onClick:this._onPersonaClick.bind(this,t)}),e)},t.prototype._getElementWithoutOnClickEvent=function(e,t,o,n){return f.createElement("div",d({},Tr(t,pr),this._getElementProps(t,o,n)),e)},t.prototype._getElementProps=function(e,t,o){var n=this._classNames;return{key:(e.imageUrl?"i":"")+o,"data-is-focusable":!0,className:n.itemButton,title:t?e.personaName:void 0,onMouseMove:this._onPersonaMouseMove.bind(this,e),onMouseOut:this._onPersonaMouseOut.bind(this,e)}},t.prototype._getOverflowElement=function(e){switch(this.props.overflowButtonType){case D_.descriptive:return this._getDescriptiveOverflowElement(e);case D_.downArrow:return this._getIconElement("ChevronDown");case D_.more:return this._getIconElement("More");default:return null}},t.prototype._getDescriptiveOverflowElement=function(e){var t=this.props.personaSize;if(!e||e.length<1)return null;var o=e.map((function(e){return e.personaName})).join(", "),n=d({title:o},this.props.overflowButtonProps),r=Math.max(e.length,0),i=this._classNames;return f.createElement(M_,d({},n,{ariaDescription:n.title,className:i.descriptiveOverflowButton}),f.createElement(Oi,{size:t,onRenderInitials:this._renderInitialsNotPictured(r),initialsColor:Xr.transparent}))},t.prototype._getIconElement=function(e){var t=this.props,o=t.overflowButtonProps,n=t.personaSize,r=this._classNames;return f.createElement(M_,d({},o,{className:r.overflowButton}),f.createElement(Oi,{size:n,onRenderInitials:this._renderInitials(e,!0),initialsColor:Xr.transparent}))},t.prototype._getAddNewElement=function(){var e=this.props,t=e.addButtonProps,o=e.personaSize,n=this._classNames;return f.createElement(M_,d({},t,{className:n.addButton}),f.createElement(Oi,{size:o,onRenderInitials:this._renderInitials("AddFriend")}))},t.prototype._onPersonaClick=function(e,t){e.onClick(t,e),t.preventDefault(),t.stopPropagation()},t.prototype._onPersonaMouseMove=function(e,t){e.onMouseMove&&e.onMouseMove(t,e)},t.prototype._onPersonaMouseOut=function(e,t){e.onMouseOut&&e.onMouseOut(t,e)},t.prototype._renderInitials=function(e,t){var o=this._classNames;return function(){return f.createElement(ii,{iconName:e,className:t?o.overflowInitialsIcon:""})}},t.prototype._renderInitialsNotPictured=function(e){var t=this._classNames;return function(){return f.createElement("span",{className:t.overflowInitialsIcon},e<100?"+"+e:"99+")}},t.defaultProps={maxDisplayablePersonas:5,personas:[],overflowPersonas:[],personaSize:Yr.size32},t}(f.Component),O_={root:"ms-Facepile",addButton:"ms-Facepile-addButton ms-Facepile-itemButton",descriptiveOverflowButton:"ms-Facepile-descriptiveOverflowButton ms-Facepile-itemButton",itemButton:"ms-Facepile-itemButton ms-Facepile-person",itemContainer:"ms-Facepile-itemContainer",members:"ms-Facepile-members",member:"ms-Facepile-member",overflowButton:"ms-Facepile-overflowButton ms-Facepile-itemButton"},z_=Vn(H_,(function(e){var t,o=e.className,n=e.theme,r=e.spacingAroundItemButton,i=void 0===r?2:r,a=n.palette,s=n.fonts,l=Qo(O_,n),c={textAlign:"center",padding:0,borderRadius:"50%",verticalAlign:"top",display:"inline",backgroundColor:"transparent",border:"none",selectors:{"&::-moz-focus-inner":{padding:0,border:0}}};return{root:[l.root,n.fonts.medium,{width:"auto"},o],addButton:[l.addButton,To(n,{inset:-1}),c,{fontSize:s.medium.fontSize,color:a.white,backgroundColor:a.themePrimary,marginRight:2*i+"px",selectors:{"&:hover":{backgroundColor:a.themeDark},"&:focus":{backgroundColor:a.themeDark},"&:active":{backgroundColor:a.themeDarker},"&:disabled":{backgroundColor:a.neutralTertiaryAlt}}}],descriptiveOverflowButton:[l.descriptiveOverflowButton,To(n,{inset:-1}),c,{fontSize:s.small.fontSize,color:a.neutralSecondary,backgroundColor:a.neutralLighter,marginLeft:2*i+"px"}],itemButton:[l.itemButton,c],itemContainer:[l.itemContainer,{display:"flex"}],members:[l.members,{display:"flex",overflow:"hidden",listStyleType:"none",padding:0,margin:"-"+i+"px"}],member:[l.member,{display:"inline-flex",flex:"0 0 auto",margin:i+"px"}],overflowButton:[l.overflowButton,To(n,{inset:-1}),c,{fontSize:s.medium.fontSize,color:a.neutralSecondary,backgroundColor:a.neutralLighter,marginLeft:2*i+"px"}],overflowInitialsIcon:[{color:a.neutralPrimary,selectors:(t={},t[ro]={color:"WindowText"},t)}],screenReaderOnly:Ro}}),void 0,{scope:"Facepile"});Ft([{rawString:".callout_d081cdf0 .ms-Suggestions-itemButton{padding:0;border:none}.callout_d081cdf0 .ms-Suggestions{min-width:300px}"}]);var W_="callout_d081cdf0";Ft([{rawString:".root_be1cdb74{min-width:260px}.suggestionsItem_be1cdb74{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;position:relative;overflow:hidden}.suggestionsItem_be1cdb74:hover{background:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:"}.suggestionsItem_be1cdb74:hover .closeButton_be1cdb74{display:block}.suggestionsItem_be1cdb74.suggestionsItemIsSuggested_be1cdb74{background:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.suggestionsItem_be1cdb74.suggestionsItemIsSuggested_be1cdb74:hover{background:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:"}@media screen and (-ms-high-contrast:active){.suggestionsItem_be1cdb74.suggestionsItemIsSuggested_be1cdb74:hover{background:Highlight;color:HighlightText}}@media screen and (-ms-high-contrast:active){.suggestionsItem_be1cdb74.suggestionsItemIsSuggested_be1cdb74{background:Highlight;color:HighlightText;-ms-high-contrast-adjust:none}}.suggestionsItem_be1cdb74.suggestionsItemIsSuggested_be1cdb74 .closeButton_be1cdb74:hover{background:"},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:";color:"},{theme:"neutralPrimary",defaultValue:"#323130"},{rawString:"}@media screen and (-ms-high-contrast:active){.suggestionsItem_be1cdb74.suggestionsItemIsSuggested_be1cdb74 .itemButton_be1cdb74{color:HighlightText}}.suggestionsItem_be1cdb74 .closeButton_be1cdb74{display:none;color:"},{theme:"neutralSecondary",defaultValue:"#605e5c"},{rawString:"}.suggestionsItem_be1cdb74 .closeButton_be1cdb74:hover{background:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.actionButton_be1cdb74{background-color:transparent;border:0;cursor:pointer;margin:0;position:relative;border-top:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";height:40px;width:100%;font-size:12px}[dir=ltr] .actionButton_be1cdb74{padding-left:8px}[dir=rtl] .actionButton_be1cdb74{padding-right:8px}html[dir=ltr] .actionButton_be1cdb74{text-align:left}html[dir=rtl] .actionButton_be1cdb74{text-align:right}.actionButton_be1cdb74:hover{background-color:"},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:";cursor:pointer}.actionButton_be1cdb74:active,.actionButton_be1cdb74:focus{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.actionButton_be1cdb74 .ms-Button-icon{font-size:16px;width:25px}.actionButton_be1cdb74 .ms-Button-label{margin:0 4px 0 9px}html[dir=rtl] .actionButton_be1cdb74 .ms-Button-label{margin:0 9px 0 4px}.buttonSelected_be1cdb74{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.suggestionsTitle_be1cdb74{padding:0 12px;color:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:";font-size:12px;line-height:40px;border-bottom:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.suggestionsContainer_be1cdb74{overflow-y:auto;overflow-x:hidden;max-height:300px;border-bottom:1px solid "},{theme:"neutralLight",defaultValue:"#edebe9"},{rawString:"}.suggestionsNone_be1cdb74{text-align:center;color:#797775;font-size:12px;line-height:30px}.suggestionsSpinner_be1cdb74{margin:5px 0;white-space:nowrap;line-height:20px;font-size:12px}html[dir=ltr] .suggestionsSpinner_be1cdb74{padding-left:14px}html[dir=rtl] .suggestionsSpinner_be1cdb74{padding-right:14px}html[dir=ltr] .suggestionsSpinner_be1cdb74{text-align:left}html[dir=rtl] .suggestionsSpinner_be1cdb74{text-align:right}.suggestionsSpinner_be1cdb74 .ms-Spinner-circle{display:inline-block;vertical-align:middle}.suggestionsSpinner_be1cdb74 .ms-Spinner-label{display:inline-block;margin:0 10px 0 16px;vertical-align:middle}html[dir=rtl] .suggestionsSpinner_be1cdb74 .ms-Spinner-label{margin:0 16px 0 10px}.itemButton_be1cdb74.itemButton_be1cdb74{width:100%;padding:0;min-width:0;height:100%}@media screen and (-ms-high-contrast:active){.itemButton_be1cdb74.itemButton_be1cdb74{color:WindowText}}.itemButton_be1cdb74.itemButton_be1cdb74:hover{color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.closeButton_be1cdb74.closeButton_be1cdb74{padding:0 4px;height:auto;width:32px}@media screen and (-ms-high-contrast:active){.closeButton_be1cdb74.closeButton_be1cdb74{color:WindowText}}.closeButton_be1cdb74.closeButton_be1cdb74:hover{background:"},{theme:"neutralTertiaryAlt",defaultValue:"#c8c6c4"},{rawString:";color:"},{theme:"neutralDark",defaultValue:"#201f1e"},{rawString:"}.suggestionsAvailable_be1cdb74{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"}]);var V_="root_be1cdb74",K_="suggestionsItem_be1cdb74",U_="closeButton_be1cdb74",G_="suggestionsItemIsSuggested_be1cdb74",j_="itemButton_be1cdb74",q_="actionButton_be1cdb74",Y_="buttonSelected_be1cdb74",Z_="suggestionsTitle_be1cdb74",X_="suggestionsContainer_be1cdb74",Q_="suggestionsNone_be1cdb74",J_="suggestionsSpinner_be1cdb74",$_="suggestionsAvailable_be1cdb74",eC=r,tC=Jn(),oC=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e,t=this.props,o=t.suggestionModel,n=t.RenderSuggestion,r=t.onClick,i=t.className,a=t.id,s=t.onRemoveItem,l=t.isSelectedOverride,c=t.removeButtonAriaLabel,u=t.styles,d=t.theme,p=u?tC(u,{theme:d,className:i,suggested:o.selected||l}):{root:qr("ms-Suggestions-item",eC.suggestionsItem,(e={},e["is-suggested "+eC.suggestionsItemIsSuggested]=o.selected||l,e),i),itemButton:qr("ms-Suggestions-itemButton",eC.itemButton),closeButton:qr("ms-Suggestions-closeButton",eC.closeButton)};return f.createElement("div",{className:p.root,role:"presentation"},f.createElement(zd,{onClick:r,className:p.itemButton,id:a,"aria-selected":o.selected,role:"option","aria-label":o.ariaLabel},n(o.item,this.props)),this.props.showRemoveButton?f.createElement(Zu,{iconProps:{iconName:"Cancel",styles:{root:{fontSize:"12px"}}},title:c,ariaLabel:c,onClick:s,className:p.closeButton}):null)},t}(f.Component);Ft([{rawString:".suggestionsContainer_630f9786{overflow-y:auto;overflow-x:hidden;max-height:300px}.suggestionsContainer_630f9786 .ms-Suggestion-item:hover{background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";cursor:pointer}.suggestionsContainer_630f9786 .is-suggested{background-color:"},{theme:"themeLighter",defaultValue:"#deecf9"},{rawString:"}.suggestionsContainer_630f9786 .is-suggested:hover{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:";cursor:pointer}"}]);var nC="suggestionsContainer_630f9786",rC=i,iC=function(e){function t(t){var o=e.call(this,t)||this;return o._selectedElement=f.createRef(),o.SuggestionsItemOfProperType=oC,o._onClickTypedSuggestionsItem=function(e,t){return function(n){o.props.onSuggestionClick(n,e,t)}},o._onRemoveTypedSuggestionsItem=function(e,t){return function(n){(0,o.props.onSuggestionRemove)(n,e,t),n.stopPropagation()}},Ui(o),o.currentIndex=-1,o}return u(t,e),t.prototype.nextSuggestion=function(){var e=this.props.suggestions;if(e&&e.length>0){if(-1===this.currentIndex)return this.setSelectedSuggestion(0),!0;if(this.currentIndex<e.length-1)return this.setSelectedSuggestion(this.currentIndex+1),!0;if(this.props.shouldLoopSelection&&this.currentIndex===e.length-1)return this.setSelectedSuggestion(0),!0}return!1},t.prototype.previousSuggestion=function(){var e=this.props.suggestions;if(e&&e.length>0){if(-1===this.currentIndex)return this.setSelectedSuggestion(e.length-1),!0;if(this.currentIndex>0)return this.setSelectedSuggestion(this.currentIndex-1),!0;if(this.props.shouldLoopSelection&&0===this.currentIndex)return this.setSelectedSuggestion(e.length-1),!0}return!1},Object.defineProperty(t.prototype,"selectedElement",{get:function(){return this._selectedElement.current||void 0},enumerable:!1,configurable:!0}),t.prototype.getCurrentItem=function(){return this.props.suggestions[this.currentIndex]},t.prototype.getSuggestionAtIndex=function(e){return this.props.suggestions[e]},t.prototype.hasSuggestionSelected=function(){return-1!==this.currentIndex&&this.currentIndex<this.props.suggestions.length},t.prototype.removeSuggestion=function(e){this.props.suggestions.splice(e,1)},t.prototype.deselectAllSuggestions=function(){this.currentIndex>-1&&this.props.suggestions[this.currentIndex]&&(this.props.suggestions[this.currentIndex].selected=!1,this.currentIndex=-1,this.forceUpdate())},t.prototype.setSelectedSuggestion=function(e){var t=this.props.suggestions;e>t.length-1||e<0?(this.currentIndex=0,this.currentSuggestion.selected=!1,this.currentSuggestion=t[0],this.currentSuggestion.selected=!0):(this.currentIndex>-1&&t[this.currentIndex]&&(t[this.currentIndex].selected=!1),t[e].selected=!0,this.currentIndex=e,this.currentSuggestion=t[e]),this.forceUpdate()},t.prototype.componentDidUpdate=function(){this.scrollSelected()},t.prototype.render=function(){var e=this,t=this.props,o=t.onRenderSuggestion,n=t.suggestionsItemClassName,r=t.resultsMaximumNumber,i=t.showRemoveButtons,a=t.suggestionsContainerAriaLabel,s=this.SuggestionsItemOfProperType,l=this.props.suggestions;return r&&(l=l.slice(0,r)),f.createElement("div",{className:qr("ms-Suggestions-container",rC.suggestionsContainer),id:"suggestion-list",role:"list","aria-label":a},l.map((function(t,r){return f.createElement("div",{ref:t.selected||r===e.currentIndex?e._selectedElement:void 0,key:t.item.key?t.item.key:r,id:"sug-"+r,role:"listitem","aria-label":t.ariaLabel},f.createElement(s,{id:"sug-item"+r,suggestionModel:t,RenderSuggestion:o,onClick:e._onClickTypedSuggestionsItem(t.item,r),className:n,showRemoveButton:i,onRemoveItem:e._onRemoveTypedSuggestionsItem(t.item,r),isSelectedOverride:r===e.currentIndex}))})))},t.prototype.scrollSelected=function(){var e;void 0!==(null===(e=this._selectedElement.current)||void 0===e?void 0:e.scrollIntoView)&&this._selectedElement.current.scrollIntoView(!1)},t}(f.Component);Ft([{rawString:".root_a74e5986{min-width:260px}.actionButton_a74e5986{background:0 0;background-color:transparent;border:0;cursor:pointer;margin:0;padding:0;position:relative;width:100%;font-size:12px}html[dir=ltr] .actionButton_a74e5986{text-align:left}html[dir=rtl] .actionButton_a74e5986{text-align:right}.actionButton_a74e5986:hover{background-color:"},{theme:"neutralLighter",defaultValue:"#f3f2f1"},{rawString:";cursor:pointer}.actionButton_a74e5986:active,.actionButton_a74e5986:focus{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.actionButton_a74e5986 .ms-Button-icon{font-size:16px;width:25px}.actionButton_a74e5986 .ms-Button-label{margin:0 4px 0 9px}html[dir=rtl] .actionButton_a74e5986 .ms-Button-label{margin:0 9px 0 4px}.buttonSelected_a74e5986{background-color:"},{theme:"themeLighter",defaultValue:"#deecf9"},{rawString:"}.buttonSelected_a74e5986:hover{background-color:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:";cursor:pointer}@media screen and (-ms-high-contrast:active){.buttonSelected_a74e5986:hover{background-color:Highlight;color:HighlightText}}@media screen and (-ms-high-contrast:active){.buttonSelected_a74e5986{background-color:Highlight;color:HighlightText;-ms-high-contrast-adjust:none}}.suggestionsTitle_a74e5986{font-size:12px}.suggestionsSpinner_a74e5986{margin:5px 0;white-space:nowrap;line-height:20px;font-size:12px}html[dir=ltr] .suggestionsSpinner_a74e5986{padding-left:14px}html[dir=rtl] .suggestionsSpinner_a74e5986{padding-right:14px}html[dir=ltr] .suggestionsSpinner_a74e5986{text-align:left}html[dir=rtl] .suggestionsSpinner_a74e5986{text-align:right}.suggestionsSpinner_a74e5986 .ms-Spinner-circle{display:inline-block;vertical-align:middle}.suggestionsSpinner_a74e5986 .ms-Spinner-label{display:inline-block;margin:0 10px 0 16px;vertical-align:middle}html[dir=rtl] .suggestionsSpinner_a74e5986 .ms-Spinner-label{margin:0 16px 0 10px}.itemButton_a74e5986{height:100%;width:100%;padding:7px 12px}@media screen and (-ms-high-contrast:active){.itemButton_a74e5986{color:WindowText}}.screenReaderOnly_a74e5986{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"}]);var aC,sC="root_a74e5986",lC="actionButton_a74e5986",cC="buttonSelected_a74e5986",uC="suggestionsTitle_a74e5986",dC="suggestionsSpinner_a74e5986",pC="itemButton_a74e5986",hC="screenReaderOnly_a74e5986",mC=a;!function(e){e[e.header=0]="header",e[e.suggestion=1]="suggestion",e[e.footer=2]="footer"}(aC||(aC={}));var gC=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.prototype.render=function(){var e,t=this.props,o=t.renderItem,n=t.onExecute,r=t.isSelected,i=t.id,a=t.className;return n?f.createElement("div",{id:i,onClick:n,className:qr("ms-Suggestions-sectionButton",a,mC.actionButton,(e={},e["is-selected "+mC.buttonSelected]=r,e))},o()):f.createElement("div",{id:i,className:qr("ms-Suggestions-section",a,mC.suggestionsTitle)},o())},t}(f.Component),fC=function(e){function t(t){var o=e.call(this,t)||this;return o._selectedElement=f.createRef(),o._suggestions=f.createRef(),o.SuggestionsOfProperType=iC,Ui(o),o.state={selectedHeaderIndex:-1,selectedFooterIndex:-1,suggestions:t.suggestions},o}return u(t,e),t.prototype.componentDidMount=function(){this.resetSelectedItem()},t.prototype.componentDidUpdate=function(e){var t=this;this.scrollSelected(),e.suggestions&&e.suggestions!==this.props.suggestions&&this.setState({suggestions:this.props.suggestions},(function(){t.resetSelectedItem()}))},t.prototype.componentWillUnmount=function(){var e;null===(e=this._suggestions.current)||void 0===e||e.deselectAllSuggestions()},t.prototype.render=function(){var e=this.props,t=e.className,o=e.headerItemsProps,n=e.footerItemsProps,r=e.suggestionsAvailableAlertText,i=Z(Ro),a=this.state.suggestions&&this.state.suggestions.length>0&&r;return f.createElement("div",{className:qr("ms-Suggestions",t||"",mC.root)},o&&this.renderHeaderItems(),this._renderSuggestions(),n&&this.renderFooterItems(),a?f.createElement("span",{role:"alert","aria-live":"polite",className:i},r):null)},Object.defineProperty(t.prototype,"currentSuggestion",{get:function(){var e;return(null===(e=this._suggestions.current)||void 0===e?void 0:e.getCurrentItem())||void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentSuggestionIndex",{get:function(){return this._suggestions.current?this._suggestions.current.currentIndex:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedElement",{get:function(){var e;return this._selectedElement.current?this._selectedElement.current:null===(e=this._suggestions.current)||void 0===e?void 0:e.selectedElement},enumerable:!1,configurable:!0}),t.prototype.hasSuggestionSelected=function(){var e;return(null===(e=this._suggestions.current)||void 0===e?void 0:e.hasSuggestionSelected())||!1},t.prototype.hasSelection=function(){var e=this.state,t=e.selectedHeaderIndex,o=e.selectedFooterIndex;return-1!==t||this.hasSuggestionSelected()||-1!==o},t.prototype.executeSelectedAction=function(){var e,t=this.props,o=t.headerItemsProps,n=t.footerItemsProps,r=this.state,i=r.selectedHeaderIndex,a=r.selectedFooterIndex;if(o&&-1!==i&&i<o.length){var s=o[i];s.onExecute&&s.onExecute()}else if(null===(e=this._suggestions.current)||void 0===e?void 0:e.hasSuggestionSelected())this.props.completeSuggestion();else if(n&&-1!==a&&a<n.length){var l=n[a];l.onExecute&&l.onExecute()}},t.prototype.removeSuggestion=function(e){var t,o;null===(t=this._suggestions.current)||void 0===t||t.removeSuggestion(e||(null===(o=this._suggestions.current)||void 0===o?void 0:o.currentIndex))},t.prototype.handleKeyDown=function(e){var t,o,n,r,i=this.state,a=i.selectedHeaderIndex,s=i.selectedFooterIndex,l=!1;return e===Un.down?-1!==a||(null===(t=this._suggestions.current)||void 0===t?void 0:t.hasSuggestionSelected())||-1!==s?-1!==a?(this.selectNextItem(aC.header),l=!0):(null===(o=this._suggestions.current)||void 0===o?void 0:o.hasSuggestionSelected())?(this.selectNextItem(aC.suggestion),l=!0):-1!==s&&(this.selectNextItem(aC.footer),l=!0):this.selectFirstItem():e===Un.up?-1!==a||(null===(n=this._suggestions.current)||void 0===n?void 0:n.hasSuggestionSelected())||-1!==s?-1!==a?(this.selectPreviousItem(aC.header),l=!0):(null===(r=this._suggestions.current)||void 0===r?void 0:r.hasSuggestionSelected())?(this.selectPreviousItem(aC.suggestion),l=!0):-1!==s&&(this.selectPreviousItem(aC.footer),l=!0):this.selectLastItem():e!==Un.enter&&e!==Un.tab||this.hasSelection()&&(this.executeSelectedAction(),l=!0),l},t.prototype.scrollSelected=function(){this._selectedElement.current&&this._selectedElement.current.scrollIntoView(!1)},t.prototype.renderHeaderItems=function(){var e=this,t=this.props,o=t.headerItemsProps,n=t.suggestionsHeaderContainerAriaLabel,r=this.state.selectedHeaderIndex;return o?f.createElement("div",{className:qr("ms-Suggestions-headerContainer",mC.suggestionsContainer),id:"suggestionHeader-list",role:"list","aria-label":n},o.map((function(t,o){var n=-1!==r&&r===o;return t.shouldShow()?f.createElement("div",{ref:n?e._selectedElement:void 0,id:"sug-header"+o,key:"sug-header"+o,role:"listitem","aria-label":t.ariaLabel},f.createElement(gC,{id:"sug-header-item"+o,isSelected:n,renderItem:t.renderItem,onExecute:t.onExecute,className:t.className})):null}))):null},t.prototype.renderFooterItems=function(){var e=this,t=this.props,o=t.footerItemsProps,n=t.suggestionsFooterContainerAriaLabel,r=this.state.selectedFooterIndex;return o?f.createElement("div",{className:qr("ms-Suggestions-footerContainer",mC.suggestionsContainer),id:"suggestionFooter-list",role:"list","aria-label":n},o.map((function(t,o){var n=-1!==r&&r===o;return t.shouldShow()?f.createElement("div",{ref:n?e._selectedElement:void 0,id:"sug-footer"+o,key:"sug-footer"+o,role:"listitem","aria-label":t.ariaLabel},f.createElement(gC,{id:"sug-footer-item"+o,isSelected:n,renderItem:t.renderItem,onExecute:t.onExecute,className:t.className})):null}))):null},t.prototype._renderSuggestions=function(){var e=this.SuggestionsOfProperType;return f.createElement(e,d({ref:this._suggestions},this.props,{suggestions:this.state.suggestions}))},t.prototype.selectNextItem=function(e,t){if(e!==t){var o=void 0!==t?t:e;this._selectNextItemOfItemType(e,o===e?this._getCurrentIndexForType(e):void 0)||this.selectNextItem(this._getNextItemSectionType(e),o)}else this._selectNextItemOfItemType(e)},t.prototype.selectPreviousItem=function(e,t){if(e!==t){var o=void 0!==t?t:e;this._selectPreviousItemOfItemType(e,o===e?this._getCurrentIndexForType(e):void 0)||this.selectPreviousItem(this._getPreviousItemSectionType(e),o)}else this._selectPreviousItemOfItemType(e)},t.prototype.resetSelectedItem=function(){var e;this.setState({selectedHeaderIndex:-1,selectedFooterIndex:-1}),null===(e=this._suggestions.current)||void 0===e||e.deselectAllSuggestions(),(void 0===this.props.shouldSelectFirstItem||this.props.shouldSelectFirstItem())&&this.selectFirstItem()},t.prototype.selectFirstItem=function(){this._selectNextItemOfItemType(aC.header)||this._selectNextItemOfItemType(aC.suggestion)||this._selectNextItemOfItemType(aC.footer)},t.prototype.selectLastItem=function(){this._selectPreviousItemOfItemType(aC.footer)||this._selectPreviousItemOfItemType(aC.suggestion)||this._selectPreviousItemOfItemType(aC.header)},t.prototype._selectNextItemOfItemType=function(e,t){var o,n;if(void 0===t&&(t=-1),e===aC.suggestion){if(this.state.suggestions.length>t+1)return null===(o=this._suggestions.current)||void 0===o||o.setSelectedSuggestion(t+1),this.setState({selectedHeaderIndex:-1,selectedFooterIndex:-1}),!0}else{var r=e===aC.header,i=r?this.props.headerItemsProps:this.props.footerItemsProps;if(i&&i.length>t+1)for(var a=t+1;a<i.length;a++){var s=i[a];if(s.onExecute&&s.shouldShow())return this.setState({selectedHeaderIndex:r?a:-1}),this.setState({selectedFooterIndex:r?-1:a}),null===(n=this._suggestions.current)||void 0===n||n.deselectAllSuggestions(),!0}}return!1},t.prototype._selectPreviousItemOfItemType=function(e,t){var o,n;if(e===aC.suggestion){if((r=void 0!==t?t:this.state.suggestions.length)>0)return null===(o=this._suggestions.current)||void 0===o||o.setSelectedSuggestion(r-1),this.setState({selectedHeaderIndex:-1,selectedFooterIndex:-1}),!0}else{var r,i=e===aC.header,a=i?this.props.headerItemsProps:this.props.footerItemsProps;if(a&&(r=void 0!==t?t:a.length)>0)for(var s=r-1;s>=0;s--){var l=a[s];if(l.onExecute&&l.shouldShow())return this.setState({selectedHeaderIndex:i?s:-1}),this.setState({selectedFooterIndex:i?-1:s}),null===(n=this._suggestions.current)||void 0===n||n.deselectAllSuggestions(),!0}}return!1},t.prototype._getCurrentIndexForType=function(e){switch(e){case aC.header:return this.state.selectedHeaderIndex;case aC.suggestion:return this._suggestions.current.currentIndex;case aC.footer:return this.state.selectedFooterIndex}},t.prototype._getNextItemSectionType=function(e){switch(e){case aC.header:return aC.suggestion;case aC.suggestion:return aC.footer;case aC.footer:return aC.header}},t.prototype._getPreviousItemSectionType=function(e){switch(e){case aC.header:return aC.footer;case aC.suggestion:return aC.header;case aC.footer:return aC.suggestion}},t}(f.Component),vC=n,bC=function(e){function t(t){var o=e.call(this,t)||this;return o.root=f.createRef(),o.suggestionsControl=f.createRef(),o.SuggestionsControlOfProperType=fC,o.isComponentMounted=!1,o.onQueryStringChanged=function(e){e!==o.state.queryString&&(o.setState({queryString:e}),o.props.onInputChanged&&o.props.onInputChanged(e),o.updateValue(e))},o.hidePicker=function(){var e=o.isSuggestionsShown;o.setState({suggestionsVisible:!1}),o.props.onSuggestionsHidden&&e&&o.props.onSuggestionsHidden()},o.showPicker=function(e){void 0===e&&(e=!1);var t=o.isSuggestionsShown;o.setState({suggestionsVisible:!0});var n=o.props.inputElement?o.props.inputElement.value:"";e&&o.updateValue(n),o.props.onSuggestionsShown&&!t&&o.props.onSuggestionsShown()},o.completeSuggestion=function(){o.suggestionsControl.current&&o.suggestionsControl.current.hasSuggestionSelected()&&o.onChange(o.suggestionsControl.current.currentSuggestion.item)},o.onSuggestionClick=function(e,t,n){o.onChange(t),o._updateSuggestionsVisible(!1)},o.onSuggestionRemove=function(e,t,n){o.props.onRemoveSuggestion&&o.props.onRemoveSuggestion(t),o.suggestionsControl.current&&o.suggestionsControl.current.removeSuggestion(n)},o.onKeyDown=function(e){if(o.state.suggestionsVisible&&(!o.props.inputElement||o.props.inputElement.contains(e.target))){var t=e.which;switch(t){case Un.escape:o.hidePicker(),e.preventDefault(),e.stopPropagation();break;case Un.tab:case Un.enter:!e.shiftKey&&!e.ctrlKey&&o.suggestionsControl.current&&o.suggestionsControl.current.handleKeyDown(t)?(e.preventDefault(),e.stopPropagation()):o._onValidateInput();break;case Un.del:o.props.onRemoveSuggestion&&o.suggestionsControl.current&&o.suggestionsControl.current.hasSuggestionSelected&&o.suggestionsControl.current.currentSuggestion&&e.shiftKey&&(o.props.onRemoveSuggestion(o.suggestionsControl.current.currentSuggestion.item),o.suggestionsControl.current.removeSuggestion(),o.forceUpdate(),e.stopPropagation());break;case Un.up:case Un.down:o.suggestionsControl.current&&o.suggestionsControl.current.handleKeyDown(t)&&(e.preventDefault(),e.stopPropagation(),o._updateActiveDescendant())}}},o._onValidateInput=function(){if(o.state.queryString&&o.props.onValidateInput&&o.props.createGenericItem){var e=o.props.createGenericItem(o.state.queryString,o.props.onValidateInput(o.state.queryString)),t=o.suggestionStore.convertSuggestionsToSuggestionItems([e]);o.onChange(t[0].item)}},o._async=new Zi(o),Ui(o),o.suggestionStore=t.suggestionsStore,o.state={queryString:"",didBind:!1},o}return u(t,e),Object.defineProperty(t.prototype,"inputText",{get:function(){return this.state.queryString},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suggestions",{get:function(){return this.suggestionStore.suggestions},enumerable:!1,configurable:!0}),t.prototype.forceResolveSuggestion=function(){this.suggestionsControl.current&&this.suggestionsControl.current.hasSuggestionSelected()?this.completeSuggestion():this._onValidateInput()},Object.defineProperty(t.prototype,"currentSelectedSuggestionIndex",{get:function(){return this.suggestionsControl.current?this.suggestionsControl.current.currentSuggestionIndex:-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSuggestionsShown",{get:function(){return void 0!==this.state.suggestionsVisible&&this.state.suggestionsVisible},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this._bindToInputElement(),this.isComponentMounted=!0,this._onResolveSuggestions=this._async.debounce(this._onResolveSuggestions,this.props.resolveDelay)},t.prototype.componentDidUpdate=function(){this._bindToInputElement()},t.prototype.componentWillUnmount=function(){this._unbindFromInputElement(),this.isComponentMounted=!1},t.prototype.updateSuggestions=function(e,t){void 0===t&&(t=!1),this.suggestionStore.updateSuggestions(e),t&&this.forceUpdate()},t.prototype.render=function(){var e=this.props.className;return f.createElement("div",{ref:this.root,className:qr("ms-BasePicker ms-BaseFloatingPicker",e||"")},this.renderSuggestions())},t.prototype.renderSuggestions=function(){var e=this.SuggestionsControlOfProperType;return this.props.suggestionItems&&this.suggestionStore.updateSuggestions(this.props.suggestionItems),this.state.suggestionsVisible?f.createElement(Cc,d({className:vC.callout,isBeakVisible:!1,gapSpace:5,target:this.props.inputElement,onDismiss:this.hidePicker,directionalHint:qs.bottomLeftEdge,directionalHintForRTL:qs.bottomRightEdge,calloutWidth:this.props.calloutWidth?this.props.calloutWidth:0},this.props.pickerCalloutProps),f.createElement(e,d({onRenderSuggestion:this.props.onRenderSuggestionsItem,onSuggestionClick:this.onSuggestionClick,onSuggestionRemove:this.onSuggestionRemove,suggestions:this.suggestionStore.getSuggestions(),componentRef:this.suggestionsControl,completeSuggestion:this.completeSuggestion,shouldLoopSelection:!1},this.props.pickerSuggestionsProps))):null},t.prototype.onSelectionChange=function(){this.forceUpdate()},t.prototype.updateValue=function(e){""===e?this.updateSuggestionWithZeroState():this._onResolveSuggestions(e)},t.prototype.updateSuggestionWithZeroState=function(){if(this.props.onZeroQuerySuggestion){var e=(0,this.props.onZeroQuerySuggestion)(this.props.selectedItems);this.updateSuggestionsList(e)}else this.hidePicker()},t.prototype.updateSuggestionsList=function(e){var t=this,o=e,n=e;if(Array.isArray(o))this.updateSuggestions(o,!0);else if(n&&n.then){var r=this.currentPromise=n;r.then((function(e){r===t.currentPromise&&t.isComponentMounted&&t.updateSuggestions(e,!0)}))}},t.prototype.onChange=function(e){this.props.onChange&&this.props.onChange(e)},t.prototype._updateActiveDescendant=function(){if(this.props.inputElement&&this.suggestionsControl.current&&this.suggestionsControl.current.selectedElement){var e=this.suggestionsControl.current.selectedElement.getAttribute("id");e&&this.props.inputElement.setAttribute("aria-activedescendant",e)}},t.prototype._onResolveSuggestions=function(e){var t=this.props.onResolveSuggestions(e,this.props.selectedItems);this._updateSuggestionsVisible(!0),null!==t&&this.updateSuggestionsList(t)},t.prototype._updateSuggestionsVisible=function(e){e?this.showPicker():this.hidePicker()},t.prototype._bindToInputElement=function(){this.props.inputElement&&!this.state.didBind&&(this.props.inputElement.addEventListener("keydown",this.onKeyDown),this.setState({didBind:!0}))},t.prototype._unbindFromInputElement=function(){this.props.inputElement&&this.state.didBind&&(this.props.inputElement.removeEventListener("keydown",this.onKeyDown),this.setState({didBind:!1}))},t}(f.Component);Ft([{rawString:".resultContent_ccf39b60{display:table-row}.resultContent_ccf39b60 .resultItem_ccf39b60{display:table-cell;vertical-align:bottom}.peoplePickerPersona_ccf39b60{width:180px}.peoplePickerPersona_ccf39b60 .ms-Persona-details{width:100%}.peoplePicker_ccf39b60 .ms-BasePicker-text{min-height:40px}.peoplePickerPersonaContent_ccf39b60{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:7px 12px}"}]);var yC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(bC),_C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.defaultProps={onRenderSuggestionsItem:function(e,t){return o=d({},e),d({},t),f.createElement("div",{className:qr("ms-PeoplePicker-personaContent","peoplePickerPersonaContent_ccf39b60")},f.createElement(A_,d({presence:void 0!==o.presence?o.presence:Zr.none,size:Yr.size40,className:qr("ms-PeoplePicker-Persona","peoplePickerPersona_ccf39b60"),showSecondaryText:!0},o)));var o},createGenericItem:CC},t}(yC);function CC(e,t){var o={key:e,primaryText:e,imageInitials:"!",isValid:t};return t||(o.imageInitials=Hr(e,jn())),o}var SC=function(){function e(e){var t=this;this._isSuggestionModel=function(e){return void 0!==e.item},this._ensureSuggestionModel=function(e){return t._isSuggestionModel(e)?e:{item:e,selected:!1,ariaLabel:void 0!==t.getAriaLabel?t.getAriaLabel(e):e.name||e.text||e.primaryText}},this.suggestions=[],this.getAriaLabel=e&&e.getAriaLabel}return e.prototype.updateSuggestions=function(e){e&&e.length>0?this.suggestions=this.convertSuggestionsToSuggestionItems(e):this.suggestions=[]},e.prototype.getSuggestions=function(){return this.suggestions},e.prototype.getSuggestionAtIndex=function(e){return this.suggestions[e]},e.prototype.removeSuggestion=function(e){this.suggestions.splice(e,1)},e.prototype.convertSuggestionsToSuggestionItems=function(e){return Array.isArray(e)?e.map(this._ensureSuggestionModel):[]},e}();Pn("@fluentui/react-focus","8.2.1");var xC,kC,wC={host:"ms-HoverCard-host"};!function(e){e[e.hover=0]="hover",e[e.hotKey=1]="hotKey"}(xC||(xC={})),function(e){e.plain="PlainCard",e.expanding="ExpandingCard"}(kC||(kC={}));var IC,DC={root:"ms-ExpandingCard-root",compactCard:"ms-ExpandingCard-compactCard",expandedCard:"ms-ExpandingCard-expandedCard",expandedCardScroll:"ms-ExpandingCard-expandedCardScrollRegion"};!function(e){e[e.compact=0]="compact",e[e.expanded=1]="expanded"}(IC||(IC={}));var TC=function(e){var t=e.gapSpace,o=void 0===t?0:t,n=e.directionalHint,r=void 0===n?qs.bottomLeftEdge:n,i=e.directionalHintFixed,a=e.targetElement,s=e.firstFocus,l=e.trapFocus,c=e.onLeave,u=e.className,p=e.finalHeight,h=e.content,m=e.calloutProps,g=d(d(d({},Tr(e,Dr)),{className:u,target:a,isBeakVisible:!1,directionalHint:r,directionalHintFixed:i,finalHeight:p,minPagePadding:24,onDismiss:c,gapSpace:o}),m);return f.createElement(f.Fragment,null,l?f.createElement(wh,d({},g,{focusTrapProps:{forceFocusInsideTrap:!1,isClickableOutsideFocusTrap:!0,disableFirstFocus:!s}}),h):f.createElement(Cc,d({},g),h))},EC=Jn(),PC=function(e){function t(t){var o=e.call(this,t)||this;return o._expandedElem=f.createRef(),o._onKeyDown=function(e){e.which===Un.escape&&o.props.onLeave&&o.props.onLeave(e)},o._onRenderCompactCard=function(){return f.createElement("div",{className:o._classNames.compactCard},o.props.onRenderCompactCard(o.props.renderData))},o._onRenderExpandedCard=function(){return!o.state.firstFrameRendered&&o._async.requestAnimationFrame((function(){o.setState({firstFrameRendered:!0})})),f.createElement("div",{className:o._classNames.expandedCard,ref:o._expandedElem},f.createElement("div",{className:o._classNames.expandedCardScroll},o.props.onRenderExpandedCard&&o.props.onRenderExpandedCard(o.props.renderData)))},o._checkNeedsScroll=function(){var e=o.props.expandedCardHeight;o._async.requestAnimationFrame((function(){o._expandedElem.current&&o._expandedElem.current.scrollHeight>=e&&o.setState({needsScroll:!0})}))},o._async=new Zi(o),Ui(o),o.state={firstFrameRendered:!1,needsScroll:!1},o}return u(t,e),t.prototype.componentDidMount=function(){this._checkNeedsScroll()},t.prototype.componentWillUnmount=function(){this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.styles,o=e.compactCardHeight,n=e.expandedCardHeight,r=e.theme,i=e.mode,a=e.className,s=this.state,l=s.needsScroll,c=s.firstFrameRendered,u=o+n;this._classNames=EC(t,{theme:r,compactCardHeight:o,className:a,expandedCardHeight:n,needsScroll:l,expandedCardFirstFrameRendered:i===IC.expanded&&c});var p=f.createElement("div",{onMouseEnter:this.props.onEnter,onMouseLeave:this.props.onLeave,onKeyDown:this._onKeyDown},this._onRenderCompactCard(),this._onRenderExpandedCard());return f.createElement(TC,d({},this.props,{content:p,finalHeight:u,className:this._classNames.root}))},t.defaultProps={compactCardHeight:156,expandedCardHeight:384,directionalHintFixed:!0},t}(f.Component),MC=Vn(PC,(function(e){var t,o=e.theme,n=e.needsScroll,r=e.expandedCardFirstFrameRendered,i=e.compactCardHeight,a=e.expandedCardHeight,s=e.className,l=o.palette,c=Qo(DC,o);return{root:[c.root,{width:320,pointerEvents:"none",selectors:(t={},t[ro]={border:"1px solid WindowText"},t)},s],compactCard:[c.compactCard,{pointerEvents:"auto",position:"relative",height:i}],expandedCard:[c.expandedCard,{height:1,overflowY:"hidden",pointerEvents:"auto",transition:"height 0.467s cubic-bezier(0.5, 0, 0, 1)",selectors:{":before":{content:'""',position:"relative",display:"block",top:0,left:24,width:272,height:1,backgroundColor:l.neutralLighter}}},r&&{height:a}],expandedCardScroll:[c.expandedCardScroll,n&&{height:"100%",boxSizing:"border-box",overflowY:"auto"}]}}),void 0,{scope:"ExpandingCard"}),RC={root:"ms-PlainCard-root"},NC=Jn(),BC=function(e){function t(t){var o=e.call(this,t)||this;return o._onKeyDown=function(e){e.which===Un.escape&&o.props.onLeave&&o.props.onLeave(e)},Ui(o),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.theme,n=e.className;this._classNames=NC(t,{theme:o,className:n});var r=f.createElement("div",{onMouseEnter:this.props.onEnter,onMouseLeave:this.props.onLeave,onKeyDown:this._onKeyDown},this.props.onRenderPlainCard(this.props.renderData));return f.createElement(TC,d({},this.props,{content:r,className:this._classNames.root}))},t}(f.Component),FC=Vn(BC,(function(e){var t,o=e.theme,n=e.className;return{root:[Qo(RC,o).root,{pointerEvents:"auto",selectors:(t={},t[ro]={border:"1px solid WindowText"},t)},n]}}),void 0,{scope:"PlainCard"}),AC=Jn(),LC=function(e){function t(t){var o=e.call(this,t)||this;return o._hoverCard=f.createRef(),o.dismiss=function(e){o._async.clearTimeout(o._openTimerId),o._async.clearTimeout(o._dismissTimerId),e?o._dismissTimerId=o._async.setTimeout((function(){o._setDismissedState()}),o.props.cardDismissDelay):o._setDismissedState()},o._cardOpen=function(e){o._shouldBlockHoverCard()||"keydown"===e.type&&e.which!==o.props.openHotKey||(o._async.clearTimeout(o._dismissTimerId),"mouseenter"===e.type&&(o._currentMouseTarget=e.currentTarget),o._executeCardOpen(e))},o._executeCardOpen=function(e){o._async.clearTimeout(o._openTimerId),o._openTimerId=o._async.setTimeout((function(){o.setState((function(t){return t.isHoverCardVisible?t:{isHoverCardVisible:!0,mode:IC.compact,openMode:"keydown"===e.type?xC.hotKey:xC.hover}}))}),o.props.cardOpenDelay)},o._cardDismiss=function(e,t){if(e){if(!(t instanceof MouseEvent))return;if("keydown"===t.type&&t.which!==Un.escape)return;o.props.sticky||o._currentMouseTarget!==t.currentTarget&&t.which!==Un.escape||o.dismiss(!0)}else{if(o.props.sticky&&!(t instanceof MouseEvent)&&t.nativeEvent instanceof MouseEvent&&"mouseleave"===t.type)return;o.dismiss(!0)}},o._setDismissedState=function(){o.setState({isHoverCardVisible:!1,mode:IC.compact,openMode:xC.hover})},o._instantOpenAsExpanded=function(e){o._async.clearTimeout(o._dismissTimerId),o.setState((function(e){return e.isHoverCardVisible?e:{isHoverCardVisible:!0,mode:IC.expanded}}))},o._setEventListeners=function(){var e=o.props,t=e.trapFocus,n=e.instantOpenOnClick,r=e.eventListenerTarget,i=r?o._getTargetElement(r):o._getTargetElement(o.props.target),a=o._nativeDismissEvent;i&&(o._events.on(i,"mouseenter",o._cardOpen),o._events.on(i,"mouseleave",a),t?o._events.on(i,"keydown",o._cardOpen):(o._events.on(i,"focus",o._cardOpen),o._events.on(i,"blur",a)),n?o._events.on(i,"click",o._instantOpenAsExpanded):(o._events.on(i,"mousedown",a),o._events.on(i,"keydown",a)))},Ui(o),o._async=new Zi(o),o._events=new Os(o),o._nativeDismissEvent=o._cardDismiss.bind(o,!0),o._childDismissEvent=o._cardDismiss.bind(o,!1),o.state={isHoverCardVisible:!1,mode:IC.compact,openMode:xC.hover},o}return u(t,e),t.prototype.componentDidMount=function(){this._setEventListeners()},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.componentDidUpdate=function(e,t){var o=this;e.target!==this.props.target&&(this._events.off(),this._setEventListeners()),t.isHoverCardVisible!==this.state.isHoverCardVisible&&(this.state.isHoverCardVisible?(this._async.setTimeout((function(){o.setState({mode:IC.expanded},(function(){o.props.onCardExpand&&o.props.onCardExpand()}))}),this.props.expandedCardOpenDelay),this.props.onCardVisible&&this.props.onCardVisible()):(this.setState({mode:IC.compact}),this.props.onCardHide&&this.props.onCardHide()))},t.prototype.render=function(){var e=this.props,t=e.expandingCardProps,o=e.children,n=e.id,r=e.setAriaDescribedBy,i=void 0===r||r,a=e.styles,s=e.theme,l=e.className,c=e.type,u=e.plainCardProps,p=e.trapFocus,h=e.setInitialFocus,m=this.state,g=m.isHoverCardVisible,v=m.mode,b=m.openMode,y=n||Va("hoverCard");this._classNames=AC(a,{theme:s,className:l});var _=d(d({},Tr(this.props,Dr)),{id:y,trapFocus:!!p,firstFocus:h||b===xC.hotKey,targetElement:this._getTargetElement(this.props.target),onEnter:this._cardOpen,onLeave:this._childDismissEvent}),C=d(d(d({},t),_),{mode:v}),S=d(d({},u),_);return f.createElement("div",{className:this._classNames.host,ref:this._hoverCard,"aria-describedby":i&&g?y:void 0,"data-is-focusable":!this.props.target},o,g&&(c===kC.expanding?f.createElement(MC,d({},C)):f.createElement(FC,d({},S))))},t.prototype._getTargetElement=function(e){switch(typeof e){case"string":return nt().querySelector(e);case"object":return e;default:return this._hoverCard.current||void 0}},t.prototype._shouldBlockHoverCard=function(){return!(!this.props.shouldBlockHoverCard||!this.props.shouldBlockHoverCard())},t.defaultProps={cardOpenDelay:500,cardDismissDelay:100,expandedCardOpenDelay:1500,instantOpenOnClick:!1,setInitialFocus:!1,openHotKey:Un.c,type:kC.expanding},t}(f.Component),HC=Vn(LC,(function(e){var t=e.className,o=e.theme;return{host:[Qo(wC,o).host,t]}}),void 0,{scope:"HoverCard"});function OC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons"',src:"url('"+e+"fabric-icons-a13498cf.woff') format('woff')"},icons:{GlobalNavButton:"",ChevronDown:"",ChevronUp:"",Edit:"",Add:"",Cancel:"",More:"",Settings:"",Mail:"",Filter:"",Search:"",Share:"",BlockedSite:"",FavoriteStar:"",FavoriteStarFill:"",CheckMark:"",Delete:"",ChevronLeft:"",ChevronRight:"",Calendar:"",Megaphone:"",Undo:"",Flag:"",Page:"",Pinned:"",View:"",Clear:"",Download:"",Upload:"",Folder:"",Sort:"",AlignRight:"",AlignLeft:"",Tag:"",AddFriend:"",Info:"",SortLines:"",List:"",CircleRing:"",Heart:"",HeartFill:"",Tiles:"",Embed:"",Glimmer:"",Ascending:"",Descending:"",SortUp:"",SortDown:"",SyncToPC:"",LargeGrid:"",SkypeCheck:"",SkypeClock:"",SkypeMinus:"",ClearFilter:"",Flow:"",StatusCircleCheckmark:"",MoreVertical:""}},t)}function zC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-0"',src:"url('"+e+"fabric-icons-0-467ee27f.woff') format('woff')"},icons:{PageLink:"",CommentSolid:"",ChangeEntitlements:"",Installation:"",WebAppBuilderModule:"",WebAppBuilderFragment:"",WebAppBuilderSlot:"",BullseyeTargetEdit:"",WebAppBuilderFragmentCreate:"",PageData:"",PageHeaderEdit:"",ProductList:"",UnpublishContent:"",DependencyAdd:"",DependencyRemove:"",EntitlementPolicy:"",EntitlementRedemption:"",SchoolDataSyncLogo:"",PinSolid12:"",PinSolidOff12:"",AddLink:"",SharepointAppIcon16:"",DataflowsLink:"",TimePicker:"",UserWarning:"",ComplianceAudit:"",InternetSharing:"",Brightness:"",MapPin:"",Airplane:"",Tablet:"",QuickNote:"",Video:"",People:"",Phone:"",Pin:"",Shop:"",Stop:"",Link:"",AllApps:"",Zoom:"",ZoomOut:"",Microphone:"",Camera:"",Attach:"",Send:"",FavoriteList:"",PageSolid:"",Forward:"",Back:"",Refresh:"",Lock:"",ReportHacked:"",EMI:"",MiniLink:"",Blocked:"",ReadingMode:"",Favicon:"",Remove:"",Checkbox:"",CheckboxComposite:"",CheckboxFill:"",CheckboxIndeterminate:"",CheckboxCompositeReversed:"",BackToWindow:"",FullScreen:"",Print:"",Up:"",Down:"",OEM:"",Save:"",ReturnKey:"",Cloud:"",Flashlight:"",CommandPrompt:"",Sad:"",RealEstate:"",SIPMove:"",EraseTool:"",GripperTool:"",Dialpad:"",PageLeft:"",PageRight:"",MultiSelect:"",KeyboardClassic:"",Play:"",Pause:"",InkingTool:"",Emoji2:"",GripperBarHorizontal:"",System:"",Personalize:"",SearchAndApps:"",Globe:"",EaseOfAccess:"",ContactInfo:"",Unpin:"",Contact:"",Memo:"",IncomingCall:""}},t)}function WC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-1"',src:"url('"+e+"fabric-icons-1-4d521695.woff') format('woff')"},icons:{Paste:"",WindowsLogo:"",Error:"",GripperBarVertical:"",Unlock:"",Slideshow:"",Trim:"",AutoEnhanceOn:"",AutoEnhanceOff:"",Color:"",SaveAs:"",Light:"",Filters:"",AspectRatio:"",Contrast:"",Redo:"",Crop:"",PhotoCollection:"",Album:"",Rotate:"",PanoIndicator:"",Translate:"",RedEye:"",ViewOriginal:"",ThumbnailView:"",Package:"",Telemarketer:"",Warning:"",Financial:"",Education:"",ShoppingCart:"",Train:"",Move:"",TouchPointer:"",Merge:"",TurnRight:"",Ferry:"",Highlight:"",PowerButton:"",Tab:"",Admin:"",TVMonitor:"",Speakers:"",Game:"",HorizontalTabKey:"",UnstackSelected:"",StackIndicator:"",Nav2DMapView:"",StreetsideSplitMinimize:"",Car:"",Bus:"",EatDrink:"",SeeDo:"",LocationCircle:"",Home:"",SwitcherStartEnd:"",ParkingLocation:"",IncidentTriangle:"",Touch:"",MapDirections:"",CaretHollow:"",CaretSolid:"",History:"",Location:"",MapLayers:"",SearchNearby:"",Work:"",Recent:"",Hotel:"",Bank:"",LocationDot:"",Dictionary:"",ChromeBack:"",FolderOpen:"",PinnedFill:"",RevToggleKey:"",USB:"",Previous:"",Next:"",Sync:"",Help:"",Emoji:"",MailForward:"",ClosePane:"",OpenPane:"",PreviewLink:"",ZoomIn:"",Bookmarks:"",Document:"",ProtectedDocument:"",OpenInNewWindow:"",MailFill:"",ViewAll:"",Switch:"",Rename:"",Go:"",Remote:"",SelectAll:"",Orientation:"",Import:""}},t)}function VC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-2"',src:"url('"+e+"fabric-icons-2-63c99abf.woff') format('woff')"},icons:{Picture:"",ChromeClose:"",ShowResults:"",Message:"",CalendarDay:"",CalendarWeek:"",MailReplyAll:"",Read:"",Cut:"",PaymentCard:"",Copy:"",Important:"",MailReply:"",GotoToday:"",Font:"",FontColor:"",FolderFill:"",Permissions:"",DisableUpdates:"",Unfavorite:"",Italic:"",Underline:"",Bold:"",MoveToFolder:"",Dislike:"",Like:"",AlignCenter:"",OpenFile:"",ClearSelection:"",FontDecrease:"",FontIncrease:"",FontSize:"",CellPhone:"",RepeatOne:"",RepeatAll:"",Calculator:"",Library:"",PostUpdate:"",NewFolder:"",CalendarReply:"",UnsyncFolder:"",SyncFolder:"",BlockContact:"",Accept:"",BulletedList:"",Preview:"",News:"",Chat:"",Group:"",World:"",Comment:"",DockLeft:"",DockRight:"",Repair:"",Accounts:"",Street:"",RadioBullet:"",Stopwatch:"",Clock:"",WorldClock:"",AlarmClock:"",Photo:"",ActionCenter:"",Hospital:"",Timer:"",FullCircleMask:"",LocationFill:"",ChromeMinimize:"",ChromeRestore:"",Annotation:"",Fingerprint:"",Handwriting:"",ChromeFullScreen:"",Completed:"",Label:"",FlickDown:"",FlickUp:"",FlickLeft:"",FlickRight:"",MiniExpand:"",MiniContract:"",Streaming:"",MusicInCollection:"",OneDriveLogo:"",CompassNW:"",Code:"",LightningBolt:"",CalculatorMultiply:"",CalculatorAddition:"",CalculatorSubtract:"",CalculatorPercentage:"",CalculatorEqualTo:"",PrintfaxPrinterFile:"",StorageOptical:"",Communications:"",Headset:"",Health:"",Webcam2:"",FrontCamera:"",ChevronUpSmall:""}},t)}function KC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-3"',src:"url('"+e+"fabric-icons-3-089e217a.woff') format('woff')"},icons:{ChevronDownSmall:"",ChevronLeftSmall:"",ChevronRightSmall:"",ChevronUpMed:"",ChevronDownMed:"",ChevronLeftMed:"",ChevronRightMed:"",Devices2:"",PC1:"",PresenceChickletVideo:"",Reply:"",HalfAlpha:"",ConstructionCone:"",DoubleChevronLeftMed:"",Volume0:"",Volume1:"",Volume2:"",Volume3:"",Chart:"",Robot:"",Manufacturing:"",LockSolid:"",FitPage:"",FitWidth:"",BidiLtr:"",BidiRtl:"",RightDoubleQuote:"",Sunny:"",CloudWeather:"",Cloudy:"",PartlyCloudyDay:"",PartlyCloudyNight:"",ClearNight:"",RainShowersDay:"",Rain:"",Thunderstorms:"",RainSnow:"",Snow:"",BlowingSnow:"",Frigid:"",Fog:"",Squalls:"",Duststorm:"",Unknown:"",Precipitation:"",Ribbon:"",AreaChart:"",Assign:"",FlowChart:"",CheckList:"",Diagnostic:"",Generate:"",LineChart:"",Equalizer:"",BarChartHorizontal:"",BarChartVertical:"",Freezing:"",FunnelChart:"",Processing:"",Quantity:"",ReportDocument:"",StackColumnChart:"",SnowShowerDay:"",HailDay:"",WorkFlow:"",HourGlass:"",StoreLogoMed20:"",TimeSheet:"",TriangleSolid:"",UpgradeAnalysis:"",VideoSolid:"",RainShowersNight:"",SnowShowerNight:"",Teamwork:"",HailNight:"",PeopleAdd:"",Glasses:"",DateTime2:"",Shield:"",Header1:"",PageAdd:"",NumberedList:"",PowerBILogo:"",Info2:"",MusicInCollectionFill:"",Asterisk:"",ErrorBadge:"",CircleFill:"",Record2:"",AllAppsMirrored:"",BookmarksMirrored:"",BulletedListMirrored:"",CaretHollowMirrored:"",CaretSolidMirrored:"",ChromeBackMirrored:"",ClearSelectionMirrored:"",ClosePaneMirrored:"",DockLeftMirrored:"",DoubleChevronLeftMedMirrored:"",GoMirrored:""}},t)}function UC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-4"',src:"url('"+e+"fabric-icons-4-a656cc0a.woff') format('woff')"},icons:{HelpMirrored:"",ImportMirrored:"",ImportAllMirrored:"",ListMirrored:"",MailForwardMirrored:"",MailReplyMirrored:"",MailReplyAllMirrored:"",MiniContractMirrored:"",MiniExpandMirrored:"",OpenPaneMirrored:"",ParkingLocationMirrored:"",SendMirrored:"",ShowResultsMirrored:"",ThumbnailViewMirrored:"",Media:"",Devices3:"",Focus:"",VideoLightOff:"",Lightbulb:"",StatusTriangle:"",VolumeDisabled:"",Puzzle:"",EmojiNeutral:"",EmojiDisappointed:"",HomeSolid:"",Ringer:"",PDF:"",HeartBroken:"",StoreLogo16:"",MultiSelectMirrored:"",Broom:"",AddToShoppingList:"",Cocktails:"",Wines:"",Articles:"",Cycling:"",DietPlanNotebook:"",Pill:"",ExerciseTracker:"",HandsFree:"",Medical:"",Running:"",Weights:"",Trackers:"",AddNotes:"",AllCurrency:"",BarChart4:"",CirclePlus:"",Coffee:"",Cotton:"",Market:"",Money:"",PieDouble:"",PieSingle:"",RemoveFilter:"",Savings:"",Sell:"",StockDown:"",StockUp:"",Lamp:"",Source:"",MSNVideos:"",Cricket:"",Golf:"",Baseball:"",Soccer:"",MoreSports:"",AutoRacing:"",CollegeHoops:"",CollegeFootball:"",ProFootball:"",ProHockey:"",Rugby:"",SubstitutionsIn:"",Tennis:"",Arrivals:"",Design:"",Website:"",Drop:"",HistoricalWeather:"",SkiResorts:"",Snowflake:"",BusSolid:"",FerrySolid:"",AirplaneSolid:"",TrainSolid:"",Ticket:"",WifiWarning4:"",Devices4:"",AzureLogo:"",BingLogo:"",MSNLogo:"",OutlookLogoInverse:"",OfficeLogo:"",SkypeLogo:"",Door:"",EditMirrored:"",GiftCard:"",DoubleBookmark:"",StatusErrorFull:""}},t)}function GC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-5"',src:"url('"+e+"fabric-icons-5-f95ba260.woff') format('woff')"},icons:{Certificate:"",FastForward:"",Rewind:"",Photo2:"",OpenSource:"",Movers:"",CloudDownload:"",Family:"",WindDirection:"",Bug:"",SiteScan:"",BrowserScreenShot:"",F12DevTools:"",CSS:"",JS:"",DeliveryTruck:"",ReminderPerson:"",ReminderGroup:"",ReminderTime:"",TabletMode:"",Umbrella:"",NetworkTower:"",CityNext:"",CityNext2:"",Section:"",OneNoteLogoInverse:"",ToggleFilled:"",ToggleBorder:"",SliderThumb:"",ToggleThumb:"",Documentation:"",Badge:"",Giftbox:"",VisualStudioLogo:"",HomeGroup:"",ExcelLogoInverse:"",WordLogoInverse:"",PowerPointLogoInverse:"",Cafe:"",SpeedHigh:"",Commitments:"",ThisPC:"",MusicNote:"",MicOff:"",PlaybackRate1x:"",EdgeLogo:"",CompletedSolid:"",AlbumRemove:"",MessageFill:"",TabletSelected:"",MobileSelected:"",LaptopSelected:"",TVMonitorSelected:"",DeveloperTools:"",Shapes:"",InsertTextBox:"",LowerBrightness:"",WebComponents:"",OfflineStorage:"",DOM:"",CloudUpload:"",ScrollUpDown:"",DateTime:"",Event:"",Cake:"",Org:"",PartyLeader:"",DRM:"",CloudAdd:"",AppIconDefault:"",Photo2Add:"",Photo2Remove:"",Calories:"",POI:"",AddTo:"",RadioBtnOff:"",RadioBtnOn:"",ExploreContent:"",Product:"",ProgressLoopInner:"",ProgressLoopOuter:"",Blocked2:"",FangBody:"",Toolbox:"",PageHeader:"",ChatInviteFriend:"",Brush:"",Shirt:"",Crown:"",Diamond:"",ScaleUp:"",QRCode:"",Feedback:"",SharepointLogoInverse:"",YammerLogo:"",Hide:"",Uneditable:"",ReturnToSession:"",OpenFolderHorizontal:"",CalendarMirrored:""}},t)}function jC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-6"',src:"url('"+e+"fabric-icons-6-ef6fd590.woff') format('woff')"},icons:{SwayLogoInverse:"",OutOfOffice:"",Trophy:"",ReopenPages:"",EmojiTabSymbols:"",AADLogo:"",AccessLogo:"",AdminALogoInverse32:"",AdminCLogoInverse32:"",AdminDLogoInverse32:"",AdminELogoInverse32:"",AdminLLogoInverse32:"",AdminMLogoInverse32:"",AdminOLogoInverse32:"",AdminPLogoInverse32:"",AdminSLogoInverse32:"",AdminYLogoInverse32:"",DelveLogoInverse:"",ExchangeLogoInverse:"",LyncLogo:"",OfficeVideoLogoInverse:"",SocialListeningLogo:"",VisioLogoInverse:"",Balloons:"",Cat:"",MailAlert:"",MailCheck:"",MailLowImportance:"",MailPause:"",MailRepeat:"",SecurityGroup:"",Table:"",VoicemailForward:"",VoicemailReply:"",Waffle:"",RemoveEvent:"",EventInfo:"",ForwardEvent:"",WipePhone:"",AddOnlineMeeting:"",JoinOnlineMeeting:"",RemoveLink:"",PeopleBlock:"",PeopleRepeat:"",PeopleAlert:"",PeoplePause:"",TransferCall:"",AddPhone:"",UnknownCall:"",NoteReply:"",NoteForward:"",NotePinned:"",RemoveOccurrence:"",Timeline:"",EditNote:"",CircleHalfFull:"",Room:"",Unsubscribe:"",Subscribe:"",HardDrive:"",RecurringTask:"",TaskManager:"",TaskManagerMirrored:"",Combine:"",Split:"",DoubleChevronUp:"",DoubleChevronLeft:"",DoubleChevronRight:"",TextBox:"",TextField:"",NumberField:"",Dropdown:"",PenWorkspace:"",BookingsLogo:"",ClassNotebookLogoInverse:"",DelveAnalyticsLogo:"",DocsLogoInverse:"",Dynamics365Logo:"",DynamicSMBLogo:"",OfficeAssistantLogo:"",OfficeStoreLogo:"",OneNoteEduLogoInverse:"",PlannerLogo:"",PowerApps:"",Suitcase:"",ProjectLogoInverse:"",CaretLeft8:"",CaretRight8:"",CaretUp8:"",CaretDown8:"",CaretLeftSolid8:"",CaretRightSolid8:"",CaretUpSolid8:"",CaretDownSolid8:"",ClearFormatting:"",Superscript:"",Subscript:"",Strikethrough:"",Export:"",ExportMirrored:""}},t)}function qC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-7"',src:"url('"+e+"fabric-icons-7-2b97bb99.woff') format('woff')"},icons:{SingleBookmark:"",SingleBookmarkSolid:"",DoubleChevronDown:"",FollowUser:"",ReplyAll:"",WorkforceManagement:"",RecruitmentManagement:"",Questionnaire:"",ManagerSelfService:"",ProductionFloorManagement:"",ProductRelease:"",ProductVariant:"",ReplyMirrored:"",ReplyAllMirrored:"",Medal:"",AddGroup:"",QuestionnaireMirrored:"",CloudImportExport:"",TemporaryUser:"",CaretSolid16:"",GroupedDescending:"",GroupedAscending:"",AwayStatus:"",MyMoviesTV:"",GenericScan:"",AustralianRules:"",WifiEthernet:"",TrackersMirrored:"",DateTimeMirrored:"",StopSolid:"",DoubleChevronUp12:"",DoubleChevronDown12:"",DoubleChevronLeft12:"",DoubleChevronRight12:"",CalendarAgenda:"",ConnectVirtualMachine:"",AddEvent:"",AssetLibrary:"",DataConnectionLibrary:"",DocLibrary:"",FormLibrary:"",FormLibraryMirrored:"",ReportLibrary:"",ReportLibraryMirrored:"",ContactCard:"",CustomList:"",CustomListMirrored:"",IssueTracking:"",IssueTrackingMirrored:"",PictureLibrary:"",OfficeAddinsLogo:"",OfflineOneDriveParachute:"",OfflineOneDriveParachuteDisabled:"",TriangleSolidUp12:"",TriangleSolidDown12:"",TriangleSolidLeft12:"",TriangleSolidRight12:"",TriangleUp12:"",TriangleDown12:"",TriangleLeft12:"",TriangleRight12:"",ArrowUpRight8:"",ArrowDownRight8:"",DocumentSet:"",GoToDashboard:"",DelveAnalytics:"",ArrowUpRightMirrored8:"",ArrowDownRightMirrored8:"",CompanyDirectory:"",OpenEnrollment:"",CompanyDirectoryMirrored:"",OneDriveAdd:"",ProfileSearch:"",Header2:"",Header3:"",Header4:"",RingerSolid:"",Eyedropper:"",MarketDown:"",CalendarWorkWeek:"",SidePanel:"",GlobeFavorite:"",CaretTopLeftSolid8:"",CaretTopRightSolid8:"",ViewAll2:"",DocumentReply:"",PlayerSettings:"",ReceiptForward:"",ReceiptReply:"",ReceiptCheck:"",Fax:"",RecurringEvent:"",ReplyAlt:"",ReplyAllAlt:"",EditStyle:"",EditMail:"",Lifesaver:"",LifesaverLock:"",InboxCheck:"",FolderSearch:""}},t)}function YC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-8"',src:"url('"+e+"fabric-icons-8-6fdf1528.woff') format('woff')"},icons:{CollapseMenu:"",ExpandMenu:"",Boards:"",SunAdd:"",SunQuestionMark:"",LandscapeOrientation:"",DocumentSearch:"",PublicCalendar:"",PublicContactCard:"",PublicEmail:"",PublicFolder:"",WordDocument:"",PowerPointDocument:"",ExcelDocument:"",GroupedList:"",ClassroomLogo:"",Sections:"",EditPhoto:"",Starburst:"",ShareiOS:"",AirTickets:"",PencilReply:"",Tiles2:"",SkypeCircleCheck:"",SkypeCircleClock:"",SkypeCircleMinus:"",SkypeMessage:"",ClosedCaption:"",ATPLogo:"",OfficeFormsLogoInverse:"",RecycleBin:"",EmptyRecycleBin:"",Hide2:"",Breadcrumb:"",BirthdayCake:"",TimeEntry:"",CRMProcesses:"",PageEdit:"",PageArrowRight:"",PageRemove:"",Database:"",DataManagementSettings:"",CRMServices:"",EditContact:"",ConnectContacts:"",AppIconDefaultAdd:"",AppIconDefaultList:"",ActivateOrders:"",DeactivateOrders:"",ProductCatalog:"",ScatterChart:"",AccountActivity:"",DocumentManagement:"",CRMReport:"",KnowledgeArticle:"",Relationship:"",HomeVerify:"",ZipFolder:"",SurveyQuestions:"",TextDocument:"",TextDocumentShared:"",PageCheckedOut:"",PageShared:"",SaveAndClose:"",Script:"",Archive:"",ActivityFeed:"",Compare:"",EventDate:"",ArrowUpRight:"",CaretRight:"",SetAction:"",ChatBot:"",CaretSolidLeft:"",CaretSolidDown:"",CaretSolidRight:"",CaretSolidUp:"",PowerAppsLogo:"",PowerApps2Logo:"",SearchIssue:"",SearchIssueMirrored:"",FabricAssetLibrary:"",FabricDataConnectionLibrary:"",FabricDocLibrary:"",FabricFormLibrary:"",FabricFormLibraryMirrored:"",FabricReportLibrary:"",FabricReportLibraryMirrored:"",FabricPublicFolder:"",FabricFolderSearch:"",FabricMovetoFolder:"",FabricUnsyncFolder:"",FabricSyncFolder:"",FabricOpenFolderHorizontal:"",FabricFolder:"",FabricFolderFill:"",FabricNewFolder:"",FabricPictureLibrary:"",PhotoVideoMedia:"",AddFavorite:""}},t)}function ZC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-9"',src:"url('"+e+"fabric-icons-9-c6162b42.woff') format('woff')"},icons:{AddFavoriteFill:"",BufferTimeBefore:"",BufferTimeAfter:"",BufferTimeBoth:"",PublishContent:"",ClipboardList:"",ClipboardListMirrored:"",CannedChat:"",SkypeForBusinessLogo:"",TabCenter:"",PageCheckedin:"",PageList:"",ReadOutLoud:"",CaretBottomLeftSolid8:"",CaretBottomRightSolid8:"",FolderHorizontal:"",MicrosoftStaffhubLogo:"",GiftboxOpen:"",StatusCircleOuter:"",StatusCircleInner:"",StatusCircleRing:"",StatusTriangleOuter:"",StatusTriangleInner:"",StatusTriangleExclamation:"",StatusCircleExclamation:"",StatusCircleErrorX:"",StatusCircleInfo:"",StatusCircleBlock:"",StatusCircleBlock2:"",StatusCircleQuestionMark:"",StatusCircleSync:"",Toll:"",ExploreContentSingle:"",CollapseContent:"",CollapseContentSingle:"",InfoSolid:"",GroupList:"",ProgressRingDots:"",CaloriesAdd:"",BranchFork:"",MuteChat:"",AddHome:"",AddWork:"",MobileReport:"",ScaleVolume:"",HardDriveGroup:"",FastMode:"",ToggleLeft:"",ToggleRight:"",TriangleShape:"",RectangleShape:"",CubeShape:"",Trophy2:"",BucketColor:"",BucketColorFill:"",Taskboard:"",SingleColumn:"",DoubleColumn:"",TripleColumn:"",ColumnLeftTwoThirds:"",ColumnRightTwoThirds:"",AccessLogoFill:"",AnalyticsLogo:"",AnalyticsQuery:"",NewAnalyticsQuery:"",AnalyticsReport:"",WordLogo:"",WordLogoFill:"",ExcelLogo:"",ExcelLogoFill:"",OneNoteLogo:"",OneNoteLogoFill:"",OutlookLogo:"",OutlookLogoFill:"",PowerPointLogo:"",PowerPointLogoFill:"",PublisherLogo:"",PublisherLogoFill:"",ScheduleEventAction:"",FlameSolid:"",ServerProcesses:"",Server:"",SaveAll:"",LinkedInLogo:"",Decimals:"",SidePanelMirrored:"",ProtectRestrict:"",Blog:"",UnknownMirrored:"",PublicContactCardMirrored:"",GridViewSmall:"",GridViewMedium:"",GridViewLarge:"",Step:"",StepInsert:"",StepShared:"",StepSharedAdd:"",StepSharedInsert:"",ViewDashboard:"",ViewList:""}},t)}function XC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-10"',src:"url('"+e+"fabric-icons-10-c4ded8e4.woff') format('woff')"},icons:{ViewListGroup:"",ViewListTree:"",TriggerAuto:"",TriggerUser:"",PivotChart:"",StackedBarChart:"",StackedLineChart:"",BuildQueue:"",BuildQueueNew:"",UserFollowed:"",ContactLink:"",Stack:"",Bullseye:"",VennDiagram:"",FiveTileGrid:"",FocalPoint:"",Insert:"",RingerRemove:"",TeamsLogoInverse:"",TeamsLogo:"",TeamsLogoFill:"",SkypeForBusinessLogoFill:"",SharepointLogo:"",SharepointLogoFill:"",DelveLogo:"",DelveLogoFill:"",OfficeVideoLogo:"",OfficeVideoLogoFill:"",ExchangeLogo:"",ExchangeLogoFill:"",Signin:"",DocumentApproval:"",CloneToDesktop:"",InstallToDrive:"",Blur:"",Build:"",ProcessMetaTask:"",BranchFork2:"",BranchLocked:"",BranchCommit:"",BranchCompare:"",BranchMerge:"",BranchPullRequest:"",BranchSearch:"",BranchShelveset:"",RawSource:"",MergeDuplicate:"",RowsGroup:"",RowsChild:"",Deploy:"",Redeploy:"",ServerEnviroment:"",VisioDiagram:"",HighlightMappedShapes:"",TextCallout:"",IconSetsFlag:"",VisioLogo:"",VisioLogoFill:"",VisioDocument:"",TimelineProgress:"",TimelineDelivery:"",Backlog:"",TeamFavorite:"",TaskGroup:"",TaskGroupMirrored:"",ScopeTemplate:"",AssessmentGroupTemplate:"",NewTeamProject:"",CommentAdd:"",CommentNext:"",CommentPrevious:"",ShopServer:"",LocaleLanguage:"",QueryList:"",UserSync:"",UserPause:"",StreamingOff:"",ArrowTallUpLeft:"",ArrowTallUpRight:"",ArrowTallDownLeft:"",ArrowTallDownRight:"",FieldEmpty:"",FieldFilled:"",FieldChanged:"",FieldNotChanged:"",RingerOff:"",PlayResume:"",BulletedList2:"",BulletedList2Mirrored:"",ImageCrosshair:"",GitGraph:"",Repo:"",RepoSolid:"",FolderQuery:"",FolderList:"",FolderListMirrored:"",LocationOutline:"",POISolid:"",CalculatorNotEqualTo:"",BoxSubtractSolid:""}},t)}function QC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-11"',src:"url('"+e+"fabric-icons-11-2a8393d6.woff') format('woff')"},icons:{BoxAdditionSolid:"",BoxMultiplySolid:"",BoxPlaySolid:"",BoxCheckmarkSolid:"",CirclePauseSolid:"",CirclePause:"",MSNVideosSolid:"",CircleStopSolid:"",CircleStop:"",NavigateBack:"",NavigateBackMirrored:"",NavigateForward:"",NavigateForwardMirrored:"",UnknownSolid:"",UnknownMirroredSolid:"",CircleAddition:"",CircleAdditionSolid:"",FilePDB:"",FileTemplate:"",FileSQL:"",FileJAVA:"",FileASPX:"",FileCSS:"",FileSass:"",FileLess:"",FileHTML:"",JavaScriptLanguage:"",CSharpLanguage:"",CSharp:"",VisualBasicLanguage:"",VB:"",CPlusPlusLanguage:"",CPlusPlus:"",FSharpLanguage:"",FSharp:"",TypeScriptLanguage:"",PythonLanguage:"",PY:"",CoffeeScript:"",MarkDownLanguage:"",FullWidth:"",FullWidthEdit:"",Plug:"",PlugSolid:"",PlugConnected:"",PlugDisconnected:"",UnlockSolid:"",Variable:"",Parameter:"",CommentUrgent:"",Storyboard:"",DiffInline:"",DiffSideBySide:"",ImageDiff:"",ImagePixel:"",FileBug:"",FileCode:"",FileComment:"",BusinessHoursSign:"",FileImage:"",FileSymlink:"",AutoFillTemplate:"",WorkItem:"",WorkItemBug:"",LogRemove:"",ColumnOptions:"",Packages:"",BuildIssue:"",AssessmentGroup:"",VariableGroup:"",FullHistory:"",Wheelchair:"",SingleColumnEdit:"",DoubleColumnEdit:"",TripleColumnEdit:"",ColumnLeftTwoThirdsEdit:"",ColumnRightTwoThirdsEdit:"",StreamLogo:"",PassiveAuthentication:"",AlertSolid:"",MegaphoneSolid:"",TaskSolid:"",ConfigurationSolid:"",BugSolid:"",CrownSolid:"",Trophy2Solid:"",QuickNoteSolid:"",ConstructionConeSolid:"",PageListSolid:"",PageListMirroredSolid:"",StarburstSolid:"",ReadingModeSolid:"",SadSolid:"",HealthSolid:"",ShieldSolid:"",GiftBoxSolid:"",ShoppingCartSolid:"",MailSolid:"",ChatSolid:"",RibbonSolid:""}},t)}function JC(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-12"',src:"url('"+e+"fabric-icons-12-7e945a1e.woff') format('woff')"},icons:{FinancialSolid:"",FinancialMirroredSolid:"",HeadsetSolid:"",PermissionsSolid:"",ParkingSolid:"",ParkingMirroredSolid:"",DiamondSolid:"",AsteriskSolid:"",OfflineStorageSolid:"",BankSolid:"",DecisionSolid:"",Parachute:"",ParachuteSolid:"",FiltersSolid:"",ColorSolid:"",ReviewSolid:"",ReviewRequestSolid:"",ReviewRequestMirroredSolid:"",ReviewResponseSolid:"",FeedbackRequestSolid:"",FeedbackRequestMirroredSolid:"",FeedbackResponseSolid:"",WorkItemBar:"",WorkItemBarSolid:"",Separator:"",NavigateExternalInline:"",PlanView:"",TimelineMatrixView:"",EngineeringGroup:"",ProjectCollection:"",CaretBottomRightCenter8:"",CaretBottomLeftCenter8:"",CaretTopRightCenter8:"",CaretTopLeftCenter8:"",DonutChart:"",ChevronUnfold10:"",ChevronFold10:"",DoubleChevronDown8:"",DoubleChevronUp8:"",DoubleChevronLeft8:"",DoubleChevronRight8:"",ChevronDownEnd6:"",ChevronUpEnd6:"",ChevronLeftEnd6:"",ChevronRightEnd6:"",ContextMenu:"",AzureAPIManagement:"",AzureServiceEndpoint:"",VSTSLogo:"",VSTSAltLogo1:"",VSTSAltLogo2:"",FileTypeSolution:"",WordLogoInverse16:"",WordLogo16:"",WordLogoFill16:"",PowerPointLogoInverse16:"",PowerPointLogo16:"",PowerPointLogoFill16:"",ExcelLogoInverse16:"",ExcelLogo16:"",ExcelLogoFill16:"",OneNoteLogoInverse16:"",OneNoteLogo16:"",OneNoteLogoFill16:"",OutlookLogoInverse16:"",OutlookLogo16:"",OutlookLogoFill16:"",PublisherLogoInverse16:"",PublisherLogo16:"",PublisherLogoFill16:"",VisioLogoInverse16:"",VisioLogo16:"",VisioLogoFill16:"",TestBeaker:"",TestBeakerSolid:"",TestExploreSolid:"",TestAutoSolid:"",TestUserSolid:"",TestImpactSolid:"",TestPlan:"",TestStep:"",TestParameter:"",TestSuite:"",TestCase:"",Sprint:"",SignOut:"",TriggerApproval:"",Rocket:"",AzureKeyVault:"",Onboarding:"",Transition:"",LikeSolid:"",DislikeSolid:"",CRMCustomerInsightsApp:"",EditCreate:"",PlayReverseResume:"",PlayReverse:"",SearchData:"",UnSetColor:"",DeclineCall:""}},t)}function $C(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-13"',src:"url('"+e+"fabric-icons-13-c3989a02.woff') format('woff')"},icons:{RectangularClipping:"",TeamsLogo16:"",TeamsLogoFill16:"",Spacer:"",SkypeLogo16:"",SkypeForBusinessLogo16:"",SkypeForBusinessLogoFill16:"",FilterSolid:"",MailUndelivered:"",MailTentative:"",MailTentativeMirrored:"",MailReminder:"",ReceiptUndelivered:"",ReceiptTentative:"",ReceiptTentativeMirrored:"",Inbox:"",IRMReply:"",IRMReplyMirrored:"",IRMForward:"",IRMForwardMirrored:"",VoicemailIRM:"",EventAccepted:"",EventTentative:"",EventTentativeMirrored:"",EventDeclined:"",IDBadge:"",BackgroundColor:"",OfficeFormsLogoInverse16:"",OfficeFormsLogo:"",OfficeFormsLogoFill:"",OfficeFormsLogo16:"",OfficeFormsLogoFill16:"",OfficeFormsLogoInverse24:"",OfficeFormsLogo24:"",OfficeFormsLogoFill24:"",PageLock:"",NotExecuted:"",NotImpactedSolid:"",FieldReadOnly:"",FieldRequired:"",BacklogBoard:"",ExternalBuild:"",ExternalTFVC:"",ExternalXAML:"",IssueSolid:"",DefectSolid:"",LadybugSolid:"",NugetLogo:"",TFVCLogo:"",ProjectLogo32:"",ProjectLogoFill32:"",ProjectLogo16:"",ProjectLogoFill16:"",SwayLogo32:"",SwayLogoFill32:"",SwayLogo16:"",SwayLogoFill16:"",ClassNotebookLogo32:"",ClassNotebookLogoFill32:"",ClassNotebookLogo16:"",ClassNotebookLogoFill16:"",ClassNotebookLogoInverse32:"",ClassNotebookLogoInverse16:"",StaffNotebookLogo32:"",StaffNotebookLogoFill32:"",StaffNotebookLogo16:"",StaffNotebookLogoFill16:"",StaffNotebookLogoInverted32:"",StaffNotebookLogoInverted16:"",KaizalaLogo:"",TaskLogo:"",ProtectionCenterLogo32:"",GallatinLogo:"",Globe2:"",Guitar:"",Breakfast:"",Brunch:"",BeerMug:"",Vacation:"",Teeth:"",Taxi:"",Chopsticks:"",SyncOccurence:"",UnsyncOccurence:"",GIF:"",PrimaryCalendar:"",SearchCalendar:"",VideoOff:"",MicrosoftFlowLogo:"",BusinessCenterLogo:"",ToDoLogoBottom:"",ToDoLogoTop:"",EditSolid12:"",EditSolidMirrored12:"",UneditableSolid12:"",UneditableSolidMirrored12:"",UneditableMirrored:"",AdminALogo32:"",AdminALogoFill32:"",ToDoLogoInverse:""}},t)}function eS(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-14"',src:"url('"+e+"fabric-icons-14-5cf58db8.woff') format('woff')"},icons:{Snooze:"",WaffleOffice365:"",ImageSearch:"",NewsSearch:"",VideoSearch:"",R:"",FontColorA:"",FontColorSwatch:"",LightWeight:"",NormalWeight:"",SemiboldWeight:"",GroupObject:"",UngroupObject:"",AlignHorizontalLeft:"",AlignHorizontalCenter:"",AlignHorizontalRight:"",AlignVerticalTop:"",AlignVerticalCenter:"",AlignVerticalBottom:"",HorizontalDistributeCenter:"",VerticalDistributeCenter:"",Ellipse:"",Line:"",Octagon:"",Hexagon:"",Pentagon:"",RightTriangle:"",HalfCircle:"",QuarterCircle:"",ThreeQuarterCircle:"","6PointStar":"","12PointStar":"",ArrangeBringToFront:"",ArrangeSendToBack:"",ArrangeSendBackward:"",ArrangeBringForward:"",BorderDash:"",BorderDot:"",LineStyle:"",LineThickness:"",WindowEdit:"",HintText:"",MediaAdd:"",AnchorLock:"",AutoHeight:"",ChartSeries:"",ChartXAngle:"",ChartYAngle:"",Combobox:"",LineSpacing:"",Padding:"",PaddingTop:"",PaddingBottom:"",PaddingLeft:"",PaddingRight:"",NavigationFlipper:"",AlignJustify:"",TextOverflow:"",VisualsFolder:"",VisualsStore:"",PictureCenter:"",PictureFill:"",PicturePosition:"",PictureStretch:"",PictureTile:"",Slider:"",SliderHandleSize:"",DefaultRatio:"",NumberSequence:"",GUID:"",ReportAdd:"",DashboardAdd:"",MapPinSolid:"",WebPublish:"",PieSingleSolid:"",BlockedSolid:"",DrillDown:"",DrillDownSolid:"",DrillExpand:"",DrillShow:"",SpecialEvent:"",OneDriveFolder16:"",FunctionalManagerDashboard:"",BIDashboard:"",CodeEdit:"",RenewalCurrent:"",RenewalFuture:"",SplitObject:"",BulkUpload:"",DownloadDocument:"",GreetingCard:"",Flower:"",WaitlistConfirm:"",WaitlistConfirmMirrored:"",LaptopSecure:"",DragObject:"",EntryView:"",EntryDecline:"",ContactCardSettings:"",ContactCardSettingsMirrored:""}},t)}function tS(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-15"',src:"url('"+e+"fabric-icons-15-3807251b.woff') format('woff')"},icons:{CalendarSettings:"",CalendarSettingsMirrored:"",HardDriveLock:"",HardDriveUnlock:"",AccountManagement:"",ReportWarning:"",TransitionPop:"",TransitionPush:"",TransitionEffect:"",LookupEntities:"",ExploreData:"",AddBookmark:"",SearchBookmark:"",DrillThrough:"",MasterDatabase:"",CertifiedDatabase:"",MaximumValue:"",MinimumValue:"",VisualStudioIDELogo32:"",PasteAsText:"",PasteAsCode:"",BrowserTab:"",BrowserTabScreenshot:"",DesktopScreenshot:"",FileYML:"",ClipboardSolid:"",FabricUserFolder:"",FabricNetworkFolder:"",BullseyeTarget:"",AnalyticsView:"",Video360Generic:"",Untag:"",Leave:"",Trending12:"",Blocked12:"",Warning12:"",CheckedOutByOther12:"",CheckedOutByYou12:"",CircleShapeSolid:"",SquareShapeSolid:"",TriangleShapeSolid:"",DropShapeSolid:"",RectangleShapeSolid:"",ZoomToFit:"",InsertColumnsLeft:"",InsertColumnsRight:"",InsertRowsAbove:"",InsertRowsBelow:"",DeleteColumns:"",DeleteRows:"",DeleteRowsMirrored:"",DeleteTable:"",AccountBrowser:"",VersionControlPush:"",StackedColumnChart2:"",TripleColumnWide:"",QuadColumn:"",WhiteBoardApp16:"",WhiteBoardApp32:"",PinnedSolid:"",InsertSignatureLine:"",ArrangeByFrom:"",Phishing:"",CreateMailRule:"",PublishCourse:"",DictionaryRemove:"",UserRemove:"",UserEvent:"",Encryption:"",PasswordField:"",OpenInNewTab:"",Hide3:"",VerifiedBrandSolid:"",MarkAsProtected:"",AuthenticatorApp:"",WebTemplate:"",DefenderTVM:"",MedalSolid:"",D365TalentLearn:"",D365TalentInsight:"",D365TalentHRCore:"",BacklogList:"",ButtonControl:"",TableGroup:"",MountainClimbing:"",TagUnknown:"",TagUnknownMirror:"",TagUnknown12:"",TagUnknown12Mirror:"",Link12:"",Presentation:"",Presentation12:"",Lock12:"",BuildDefinition:"",ReleaseDefinition:"",SaveTemplate:"",UserGauge:"",BlockedSiteSolid12:"",TagSolid:"",OfficeChat:""}},t)}function oS(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-16"',src:"url('"+e+"fabric-icons-16-9cf93f3b.woff') format('woff')"},icons:{OfficeChatSolid:"",MailSchedule:"",WarningSolid:"",Blocked2Solid:"",SkypeCircleArrow:"",SkypeArrow:"",SyncStatus:"",SyncStatusSolid:"",ProjectDocument:"",ToDoLogoOutline:"",VisioOnlineLogoFill32:"",VisioOnlineLogo32:"",VisioOnlineLogoCloud32:"",VisioDiagramSync:"",Event12:"",EventDateMissed12:"",UserOptional:"",ResponsesMenu:"",DoubleDownArrow:"",DistributeDown:"",BookmarkReport:"",FilterSettings:"",GripperDotsVertical:"",MailAttached:"",AddIn:"",LinkedDatabase:"",TableLink:"",PromotedDatabase:"",BarChartVerticalFilter:"",BarChartVerticalFilterSolid:"",MicOff2:"",MicrosoftTranslatorLogo:"",ShowTimeAs:"",FileRequest:"",WorkItemAlert:"",PowerBILogo16:"",PowerBILogoBackplate16:"",BulletedListText:"",BulletedListBullet:"",BulletedListTextMirrored:"",BulletedListBulletMirrored:"",NumberedListText:"",NumberedListNumber:"",NumberedListTextMirrored:"",NumberedListNumberMirrored:"",RemoveLinkChain:"",RemoveLinkX:"",FabricTextHighlight:"",ClearFormattingA:"",ClearFormattingEraser:"",Photo2Fill:"",IncreaseIndentText:"",IncreaseIndentArrow:"",DecreaseIndentText:"",DecreaseIndentArrow:"",IncreaseIndentTextMirrored:"",IncreaseIndentArrowMirrored:"",DecreaseIndentTextMirrored:"",DecreaseIndentArrowMirrored:"",CheckListText:"",CheckListCheck:"",CheckListTextMirrored:"",CheckListCheckMirrored:"",NumberSymbol:"",Coupon:"",VerifiedBrand:"",ReleaseGate:"",ReleaseGateCheck:"",ReleaseGateError:"",M365InvoicingLogo:"",RemoveFromShoppingList:"",ShieldAlert:"",FabricTextHighlightComposite:"",Dataflows:"",GenericScanFilled:"",DiagnosticDataBarTooltip:"",SaveToMobile:"",Orientation2:"",ScreenCast:"",ShowGrid:"",SnapToGrid:"",ContactList:"",NewMail:"",EyeShadow:"",FabricFolderConfirm:"",InformationBarriers:"",CommentActive:"",ColumnVerticalSectionEdit:"",WavingHand:"",ShakeDevice:"",SmartGlassRemote:"",Rotate90Clockwise:"",Rotate90CounterClockwise:"",CampaignTemplate:"",ChartTemplate:"",PageListFilter:"",SecondaryNav:"",ColumnVerticalSection:"",SkypeCircleSlash:"",SkypeSlash:""}},t)}function nS(e,t){void 0===e&&(e=""),mn({style:{MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",fontStyle:"normal",fontWeight:"normal",speak:"none"},fontFace:{fontFamily:'"FabricMDL2Icons-17"',src:"url('"+e+"fabric-icons-17-0c4ed701.woff') format('woff')"},icons:{CustomizeToolbar:"",DuplicateRow:"",RemoveFromTrash:"",MailOptions:"",Childof:"",Footer:"",Header:"",BarChartVerticalFill:"",StackedColumnChart2Fill:"",PlainText:"",AccessibiltyChecker:"",DatabaseSync:"",ReservationOrders:"",TabOneColumn:"",TabTwoColumn:"",TabThreeColumn:"",BulletedTreeList:"",MicrosoftTranslatorLogoGreen:"",MicrosoftTranslatorLogoBlue:"",InternalInvestigation:"",AddReaction:"",ContactHeart:"",VisuallyImpaired:"",EventToDoLogo:"",Variable2:"",ModelingView:"",DisconnectVirtualMachine:"",ReportLock:"",Uneditable2:"",Uneditable2Mirrored:"",BarChartVerticalEdit:"",GlobalNavButtonActive:"",PollResults:"",Rerun:"",QandA:"",QandAMirror:"",BookAnswers:"",AlertSettings:"",TrimStart:"",TrimEnd:"",TableComputed:"",DecreaseIndentLegacy:"",IncreaseIndentLegacy:"",SizeLegacy:""}},t)}function rS(e,t){void 0===e&&(e="https://spoprod-a.akamaihd.net/files/fabric/assets/icons/"),[OC,zC,WC,VC,KC,UC,GC,jC,qC,YC,ZC,XC,QC,JC,$C,eS,tS,oS,nS].forEach((function(o){return o(e,t)})),fn("trash","delete"),fn("onedrive","onedrivelogo"),fn("alertsolid12","eventdatemissed12"),fn("sixpointstar","6pointstar"),fn("twelvepointstar","12pointstar"),fn("toggleon","toggleleft"),fn("toggleoff","toggleright")}Pn("@fluentui/font-icons-mdl2","8.1.10");var iS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.content,o=e.styles,n=e.theme,r=e.disabled,i=e.visible,a=Jn()(o,{theme:n,disabled:r,visible:i});return f.createElement("div",{className:a.container},f.createElement("span",{className:a.root},t))},t}(f.Component),aS=function(e){return{container:[],root:[{border:"none",boxShadow:"none"}],beak:[],beakCurtain:[],calloutMain:[{backgroundColor:"transparent"}]}},sS=function(e){return function(t){return In({container:[],root:[{border:"none",boxShadow:"none"}],beak:[],beakCurtain:[],calloutMain:[{backgroundColor:"transparent"}]},{root:[{marginLeft:e.left||e.x,marginTop:e.top||e.y}]})}},lS=Vn(iS,(function(e){var t,o=e.theme,n=e.disabled,r=e.visible;return{container:[{backgroundColor:o.palette.neutralDark},n&&{opacity:.5,selectors:(t={},t[ro]={color:"GrayText",opacity:1},t)},!r&&{visibility:"hidden"}],root:[o.fonts.medium,{textAlign:"center",paddingLeft:"3px",paddingRight:"3px",backgroundColor:o.palette.neutralDark,color:o.palette.neutralLight,minWidth:"11px",lineHeight:"17px",height:"17px",display:"inline-block"},n&&{color:o.palette.neutralTertiaryAlt}]}}),void 0,{scope:"KeytipContent"}),cS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e,t=this.props,o=t.keySequences,n=t.offset,r=t.overflowSetSequence,i=this.props.calloutProps;return e=Jc(r?Qc(o,r):o),n&&(i=d(d({},i),{coverTarget:!0,directionalHint:qs.topLeftEdge})),i&&void 0!==i.directionalHint||(i=d(d({},i),{directionalHint:qs.bottomCenter})),f.createElement(Cc,d({},i,{isBeakVisible:!1,doNotLayer:!0,minPagePadding:0,styles:n?sS(n):aS,preventDismissOnScroll:!0,target:e}),f.createElement(lS,d({},this.props)))},t}(f.Component);function uS(e){var t=tu(e),o=t.keytipId,n=t.ariaDescribedBy;return f.useCallback((function(e){if(e){var t=pS(e,Uc)||e,r=pS(e,Gc)||t,i=pS(e,jc)||r;dS(t,Uc,o),dS(r,Gc,o),dS(i,"aria-describedby",n,!0)}}),[o,n])}function dS(e,t,o,n){if(void 0===n&&(n=!1),e&&o){var r=o;if(n){var i=e.getAttribute(t);i&&-1===i.indexOf(o)&&(r=i+" "+o)}e.setAttribute(t,r)}}function pS(e,t){return e.querySelector("["+t+"]")}var hS=function(e){return{root:[{zIndex:ko.KeytipLayer}]}},mS=function(){function e(){this.nodeMap={},this.root={id:qc,children:[],parent:"",keySequences:[]},this.nodeMap[this.root.id]=this.root}return e.prototype.addNode=function(e,t,o){var n=this._getFullSequence(e),r=Xc(n);n.pop();var i=this._getParentID(n),a=this._createNode(r,i,[],e,o);this.nodeMap[t]=a,this.getNodes([i]).forEach((function(e){return e.children.push(r)}))},e.prototype.updateNode=function(e,t){var o=this._getFullSequence(e),n=Xc(o);o.pop();var r=this._getParentID(o),i=this.nodeMap[t],a=i.parent;i&&(a!==r&&this._removeChildFromParents(a,i.id),i.id!==n&&this.getNodes([r]).forEach((function(e){var t=e.children.indexOf(i.id);t>=0?e.children[t]=n:e.children.push(n)})),i.id=n,i.keySequences=e.keySequences,i.overflowSetSequence=e.overflowSetSequence,i.onExecute=e.onExecute,i.onReturn=e.onReturn,i.hasDynamicChildren=e.hasDynamicChildren,i.hasMenu=e.hasMenu,i.parent=r,i.disabled=e.disabled)},e.prototype.removeNode=function(e,t){var o=this._getFullSequence(e),n=Xc(o);o.pop(),this._removeChildFromParents(this._getParentID(o),n),this.nodeMap[t]&&delete this.nodeMap[t]},e.prototype.getExactMatchedNode=function(e,t){var o=this;return aa(this.getNodes(t.children),(function(t){return o._getNodeSequence(t)===e&&!t.disabled}))},e.prototype.getPartiallyMatchedNodes=function(e,t){var o=this;return this.getNodes(t.children).filter((function(t){return 0===o._getNodeSequence(t).indexOf(e)&&!t.disabled}))},e.prototype.getChildren=function(e){var t=this;if(!e&&!(e=this.currentKeytip))return[];var o=e.children;return Object.keys(this.nodeMap).reduce((function(e,n){return o.indexOf(t.nodeMap[n].id)>=0&&!t.nodeMap[n].persisted&&e.push(t.nodeMap[n].id),e}),[])},e.prototype.getNodes=function(e){var t=this;return Object.keys(this.nodeMap).reduce((function(o,n){return e.indexOf(t.nodeMap[n].id)>=0&&o.push(t.nodeMap[n]),o}),[])},e.prototype.getNode=function(e){return aa(Ls(this.nodeMap),(function(t){return t.id===e}))},e.prototype.isCurrentKeytipParent=function(e){if(this.currentKeytip){var t=m(e.keySequences);e.overflowSetSequence&&(t=Qc(t,e.overflowSetSequence)),t.pop();var o=0===t.length?this.root.id:Xc(t),n=!1;return this.currentKeytip.overflowSetSequence&&(n=Xc(this.currentKeytip.keySequences)===o),n||this.currentKeytip.id===o}return!1},e.prototype._getParentID=function(e){return 0===e.length?this.root.id:Xc(e)},e.prototype._getFullSequence=function(e){var t=m(e.keySequences);return e.overflowSetSequence&&(t=Qc(t,e.overflowSetSequence)),t},e.prototype._getNodeSequence=function(e){var t=m(e.keySequences);return e.overflowSetSequence&&(t=Qc(t,e.overflowSetSequence)),t[t.length-1]},e.prototype._createNode=function(e,t,o,n,r){var i=this,a=n.keySequences,s=n.hasDynamicChildren,l=n.overflowSetSequence,c=n.hasMenu,u=n.onExecute,d=n.onReturn,p=n.disabled,h={id:e,keySequences:a,overflowSetSequence:l,parent:t,children:o,onExecute:u,onReturn:d,hasDynamicChildren:s,hasMenu:c,disabled:p,persisted:r};return h.children=Object.keys(this.nodeMap).reduce((function(t,o){return i.nodeMap[o].parent===e&&t.push(i.nodeMap[o].id),t}),[]),h},e.prototype._removeChildFromParents=function(e,t){this.getNodes([e]).forEach((function(e){var o=e.children.indexOf(t);o>=0&&e.children.splice(o,1)}))},e}();function gS(e,t){if(e.key!==t.key)return!1;var o=e.modifierKeys,n=t.modifierKeys;if(!o&&n||o&&!n)return!1;if(o&&n){if(o.length!==n.length)return!1;o=o.sort(),n=n.sort();for(var r=0;r<o.length;r++)if(o[r]!==n[r])return!1}return!0}function fS(e,t){return!!aa(e,(function(e){return gS(e,t)}))}var vS={key:Ys()?"Control":"Meta",modifierKeys:[Un.alt]},bS=vS,yS={key:"Escape"},_S=Jn(),CS=function(e){function t(t,o){var n=e.call(this,t,o)||this;n._keytipManager=Zc.getInstance(),n._delayedKeytipQueue=[],n._keyHandled=!1,n._onDismiss=function(e){n.state.inKeytipMode&&n._exitKeytipMode(e)},n._onKeyDown=function(e){n._keyHandled=!1;var t=e.key;switch(t){case"Tab":case"Enter":case"Spacebar":case" ":case"ArrowUp":case"Up":case"ArrowDown":case"Down":case"ArrowLeft":case"Left":case"ArrowRight":case"Right":n.state.inKeytipMode&&(n._keyHandled=!0,n._exitKeytipMode(e));break;default:"Esc"===t?t="Escape":"OS"!==t&&"Win"!==t||(t="Meta");var o={key:t};o.modifierKeys=n._getModifierKey(t,e),n.processTransitionInput(o,e)}},n._onKeyPress=function(e){n.state.inKeytipMode&&!n._keyHandled&&(n.processInput(e.key.toLocaleLowerCase(),e),e.preventDefault(),e.stopPropagation())},n._onKeytipAdded=function(e){var t,o=e.keytip,r=e.uniqueID;if(n._keytipTree.addNode(o,r),n._setKeytips(),n._keytipTree.isCurrentKeytipParent(o)&&(n._delayedKeytipQueue=n._delayedKeytipQueue.concat((null===(t=n._keytipTree.currentKeytip)||void 0===t?void 0:t.children)||[]),n._addKeytipToQueue(Xc(o.keySequences)),n._keytipTree.currentKeytip&&n._keytipTree.currentKeytip.hasDynamicChildren&&n._keytipTree.currentKeytip.children.indexOf(o.id)<0)){var i=n._keytipTree.getNode(n._keytipTree.currentKeytip.id);i&&(n._keytipTree.currentKeytip=i)}n._persistedKeytipChecks(o)},n._onKeytipUpdated=function(e){var t,o=e.keytip,r=e.uniqueID;n._keytipTree.updateNode(o,r),n._setKeytips(),n._keytipTree.isCurrentKeytipParent(o)&&(n._delayedKeytipQueue=n._delayedKeytipQueue.concat((null===(t=n._keytipTree.currentKeytip)||void 0===t?void 0:t.children)||[]),n._addKeytipToQueue(Xc(o.keySequences))),n._persistedKeytipChecks(o)},n._persistedKeytipChecks=function(e){if(n._newCurrentKeytipSequences&&ha(e.keySequences,n._newCurrentKeytipSequences)&&n._triggerKeytipImmediately(e),n._isCurrentKeytipAnAlias(e)){var t=e.keySequences;e.overflowSetSequence&&(t=Qc(t,e.overflowSetSequence)),n._keytipTree.currentKeytip=n._keytipTree.getNode(Xc(t))}},n._onKeytipRemoved=function(e){var t=e.keytip,o=e.uniqueID;n._removeKeytipFromQueue(Xc(t.keySequences)),n._keytipTree.removeNode(t,o),n._setKeytips()},n._onPersistedKeytipAdded=function(e){var t=e.keytip,o=e.uniqueID;n._keytipTree.addNode(t,o,!0)},n._onPersistedKeytipRemoved=function(e){var t=e.keytip,o=e.uniqueID;n._keytipTree.removeNode(t,o)},n._onPersistedKeytipExecute=function(e){n._persistedKeytipExecute(e.overflowButtonSequences,e.keytipSequences)},n._setInKeytipMode=function(e){n.setState({inKeytipMode:e}),n._keytipManager.inKeytipMode=e},n._warnIfDuplicateKeytips=function(){var e=n._getDuplicateIds(n._keytipTree.getChildren());e.length&&cn("Duplicate keytips found for "+e.join(", "))},n._getDuplicateIds=function(e){var t={};return e.filter((function(e){return t[e]=t[e]?t[e]+1:1,2===t[e]}))},Ui(n),n._events=new Os(n),n._async=new Zi(n);var r=n._keytipManager.getKeytips();return n.state={inKeytipMode:!1,keytips:r,visibleKeytips:n._getVisibleKeytips(r)},n._buildTree(),n._currentSequence="",n._events.on(n._keytipManager,Sc.KEYTIP_ADDED,n._onKeytipAdded),n._events.on(n._keytipManager,Sc.KEYTIP_UPDATED,n._onKeytipUpdated),n._events.on(n._keytipManager,Sc.KEYTIP_REMOVED,n._onKeytipRemoved),n._events.on(n._keytipManager,Sc.PERSISTED_KEYTIP_ADDED,n._onPersistedKeytipAdded),n._events.on(n._keytipManager,Sc.PERSISTED_KEYTIP_REMOVED,n._onPersistedKeytipRemoved),n._events.on(n._keytipManager,Sc.PERSISTED_KEYTIP_EXECUTE,n._onPersistedKeytipExecute),n}return u(t,e),t.prototype.render=function(){var e=this,t=this.props,o=t.content,n=t.styles,r=this.state,i=r.keytips,a=r.visibleKeytips;return this._classNames=_S(n,{}),f.createElement(_c,{styles:hS},f.createElement("span",{id:qc,className:this._classNames.innerContent},""+o+Yc),i&&i.map((function(t,o){return f.createElement("span",{key:o,id:Xc(t.keySequences),className:e._classNames.innerContent},t.keySequences.join(Yc))})),a&&a.map((function(e){return f.createElement(cS,d({key:Xc(e.keySequences)},e))})))},t.prototype.componentDidMount=function(){this._events.on(window,"mouseup",this._onDismiss,!0),this._events.on(window,"pointerup",this._onDismiss,!0),this._events.on(window,"resize",this._onDismiss),this._events.on(window,"keydown",this._onKeyDown,!0),this._events.on(window,"keypress",this._onKeyPress,!0),this._events.on(window,"scroll",this._onDismiss,!0),this._events.on(this._keytipManager,Sc.ENTER_KEYTIP_MODE,this._enterKeytipMode),this._events.on(this._keytipManager,Sc.EXIT_KEYTIP_MODE,this._exitKeytipMode)},t.prototype.componentWillUnmount=function(){this._async.dispose(),this._events.dispose()},t.prototype.getCurrentSequence=function(){return this._currentSequence},t.prototype.getKeytipTree=function(){return this._keytipTree},t.prototype.processTransitionInput=function(e,t){var o=this._keytipTree.currentKeytip;fS(this.props.keytipExitSequences,e)&&o?(this._keyHandled=!0,this._exitKeytipMode(t)):fS(this.props.keytipReturnSequences,e)?o&&(this._keyHandled=!0,o.id===this._keytipTree.root.id?this._exitKeytipMode(t):(o.onReturn&&o.onReturn(this._getKtpExecuteTarget(o),this._getKtpTarget(o)),this._currentSequence="",this._keytipTree.currentKeytip=this._keytipTree.getNode(o.parent),this.showKeytips(this._keytipTree.getChildren()),this._warnIfDuplicateKeytips())):fS(this.props.keytipStartSequences,e)&&!o&&(this._keyHandled=!0,this._enterKeytipMode(e),this._warnIfDuplicateKeytips())},t.prototype.processInput=function(e,t){var o=this._currentSequence+e,n=this._keytipTree.currentKeytip;if(n){var r=this._keytipTree.getExactMatchedNode(o,n);if(r){this._keytipTree.currentKeytip=n=r;var i=this._keytipTree.getChildren();return n.onExecute&&(n.onExecute(this._getKtpExecuteTarget(n),this._getKtpTarget(n)),n=this._keytipTree.currentKeytip),0!==i.length||n.hasDynamicChildren||n.hasMenu?(this.showKeytips(i),this._warnIfDuplicateKeytips()):this._exitKeytipMode(t),void(this._currentSequence="")}var a=this._keytipTree.getPartiallyMatchedNodes(o,n);if(a.length>0){var s=a.filter((function(e){return!e.persisted})).map((function(e){return e.id}));this.showKeytips(s),this._currentSequence=o}}},t.prototype.showKeytips=function(e){for(var t=0,o=this._keytipManager.getKeytips();t<o.length;t++){var n=o[t],r=Xc(n.keySequences);n.overflowSetSequence&&(r=Xc(Qc(n.keySequences,n.overflowSetSequence))),e.indexOf(r)>=0?n.visible=!0:n.visible=!1}this._setKeytips()},t.prototype._enterKeytipMode=function(e){this._keytipManager.shouldEnterKeytipMode&&(this._keytipManager.delayUpdatingKeytipChange&&(this._buildTree(),this._setKeytips()),this._keytipTree.currentKeytip=this._keytipTree.root,this.showKeytips(this._keytipTree.getChildren()),this._setInKeytipMode(!0),this.props.onEnterKeytipMode&&this.props.onEnterKeytipMode(e))},t.prototype._buildTree=function(){this._keytipTree=new mS;for(var e=0,t=Object.keys(this._keytipManager.keytips);e<t.length;e++){var o=t[e],n=this._keytipManager.keytips[o];this._keytipTree.addNode(n.keytip,n.uniqueID)}for(var r=0,i=Object.keys(this._keytipManager.persistedKeytips);r<i.length;r++)o=i[r],n=this._keytipManager.persistedKeytips[o],this._keytipTree.addNode(n.keytip,n.uniqueID)},t.prototype._exitKeytipMode=function(e){this._keytipTree.currentKeytip=void 0,this._currentSequence="",this.showKeytips([]),this._delayedQueueTimeout&&this._async.clearTimeout(this._delayedQueueTimeout),this._delayedKeytipQueue=[],this._setInKeytipMode(!1),this.props.onExitKeytipMode&&this.props.onExitKeytipMode(e)},t.prototype._setKeytips=function(e){void 0===e&&(e=this._keytipManager.getKeytips()),this.setState({keytips:e,visibleKeytips:this._getVisibleKeytips(e)})},t.prototype._persistedKeytipExecute=function(e,t){this._newCurrentKeytipSequences=t;var o=this._keytipTree.getNode(Xc(e));o&&o.onExecute&&o.onExecute(this._getKtpExecuteTarget(o),this._getKtpTarget(o))},t.prototype._getVisibleKeytips=function(e){var t={};return e.filter((function(e){var o=Xc(e.keySequences);return e.overflowSetSequence&&(o=Xc(Qc(e.keySequences,e.overflowSetSequence))),t[o]=t[o]?t[o]+1:1,e.visible&&1===t[o]}))},t.prototype._getModifierKey=function(e,t){var o=[];return t.altKey&&"Alt"!==e&&o.push(Un.alt),t.ctrlKey&&"Control"!==e&&o.push(Un.ctrl),t.shiftKey&&"Shift"!==e&&o.push(Un.shift),t.metaKey&&"Meta"!==e&&o.push(Un.leftWindow),o.length?o:void 0},t.prototype._triggerKeytipImmediately=function(e){var t=m(e.keySequences);if(e.overflowSetSequence&&(t=Qc(t,e.overflowSetSequence)),this._keytipTree.currentKeytip=this._keytipTree.getNode(Xc(t)),this._keytipTree.currentKeytip){var o=this._keytipTree.getChildren();o.length&&this.showKeytips(o),this._keytipTree.currentKeytip.onExecute&&this._keytipTree.currentKeytip.onExecute(this._getKtpExecuteTarget(this._keytipTree.currentKeytip),this._getKtpTarget(this._keytipTree.currentKeytip))}this._newCurrentKeytipSequences=void 0},t.prototype._addKeytipToQueue=function(e){var t=this;this._delayedKeytipQueue.push(e),this._delayedQueueTimeout&&this._async.clearTimeout(this._delayedQueueTimeout),this._delayedQueueTimeout=this._async.setTimeout((function(){t._delayedKeytipQueue.length&&(t.showKeytips(t._delayedKeytipQueue),t._delayedKeytipQueue=[])}),300)},t.prototype._removeKeytipFromQueue=function(e){var t=this,o=this._delayedKeytipQueue.indexOf(e);o>=0&&(this._delayedKeytipQueue.splice(o,1),this._delayedQueueTimeout&&this._async.clearTimeout(this._delayedQueueTimeout),this._delayedQueueTimeout=this._async.setTimeout((function(){t._delayedKeytipQueue.length&&(t.showKeytips(t._delayedKeytipQueue),t._delayedKeytipQueue=[])}),300))},t.prototype._getKtpExecuteTarget=function(e){return nt().querySelector($c(e.id))},t.prototype._getKtpTarget=function(e){return nt().querySelector(Jc(e.keySequences))},t.prototype._isCurrentKeytipAnAlias=function(e){var t=this._keytipTree.currentKeytip;return!(!t||!t.overflowSetSequence&&!t.persisted||!ha(e.keySequences,t.keySequences))},t.defaultProps={keytipStartSequences:[vS],keytipExitSequences:[bS],keytipReturnSequences:[yS],content:""},t}(f.Component),SS=Vn(CS,(function(e){return{innerContent:[{position:"absolute",width:0,height:0,margin:0,padding:0,border:0,overflow:"hidden",visibility:"hidden"}]}}),void 0,{scope:"KeytipLayer"});function xS(e){for(var t={},o=0,n=e.keytips;o<n.length;o++)kS(t,[],n[o]);return t}function kS(e,t,o){var n=o.sequence?o.sequence:o.content.toLocaleLowerCase(),r=t.concat(n),i=d(d({},o.optionalProps),{keySequences:r,content:o.content});if(e[o.id]=i,o.children)for(var a=0,s=o.children;a<s.length;a++)kS(e,r,s[a])}Pn("@fluentui/react","8.29.2");var wS=function(e){var t=e.id,o=e.className;return f.useEffect((function(){mc(t)}),[]),IS((function(){mc(t)})),f.createElement("div",d({},e,{className:qr("ms-LayerHost",o)}))},IS=function(e){var t=f.useRef(e);t.current=e,f.useEffect((function(){return function(){t.current&&t.current()}}),[])},DS=100,TS=function(){function e(e){this._events=new Os(this),this._scrollableParent=es(e),this._incrementScroll=this._incrementScroll.bind(this),this._scrollRect=fb(this._scrollableParent),this._scrollableParent===window&&(this._scrollableParent=document.body),this._scrollableParent&&(this._events.on(window,"mousemove",this._onMouseMove,!0),this._events.on(window,"touchmove",this._onTouchMove,!0))}return e.prototype.dispose=function(){this._events.dispose(),this._stopScroll()},e.prototype._onMouseMove=function(e){this._computeScrollVelocity(e)},e.prototype._onTouchMove=function(e){e.touches.length>0&&this._computeScrollVelocity(e)},e.prototype._computeScrollVelocity=function(e){if(this._scrollRect){var t,o;"clientX"in e?(t=e.clientX,o=e.clientY):(t=e.touches[0].clientX,o=e.touches[0].clientY);var n,r,i,a=this._scrollRect.top,s=this._scrollRect.left,l=a+this._scrollRect.height-DS,c=s+this._scrollRect.width-DS;o<a+DS||o>l?(r=o,n=a,i=l,this._isVerticalScroll=!0):(r=t,n=s,i=c,this._isVerticalScroll=!1),this._scrollVelocity=r<n+DS?Math.max(-15,(DS-(r-n))/DS*-15):r>i?Math.min(15,(r-i)/DS*15):0,this._scrollVelocity?this._startScroll():this._stopScroll()}},e.prototype._startScroll=function(){this._timeoutId||this._incrementScroll()},e.prototype._incrementScroll=function(){this._scrollableParent&&(this._isVerticalScroll?this._scrollableParent.scrollTop+=Math.round(this._scrollVelocity):this._scrollableParent.scrollLeft+=Math.round(this._scrollVelocity)),this._timeoutId=setTimeout(this._incrementScroll,16)},e.prototype._stopScroll=function(){this._timeoutId&&(clearTimeout(this._timeoutId),delete this._timeoutId)},e}();function ES(e,t){var o=e.left||e.x||0,n=e.top||e.y||0,r=t.left||t.x||0,i=t.top||t.y||0;return Math.sqrt(Math.pow(o-r,2)+Math.pow(n-i,2))}function PS(e){var t,o=e.contentSize,n=e.boundsSize,r=e.mode,i=void 0===r?"contain":r,a=e.maxScale,s=void 0===a?1:a,l=o.width/o.height,c=n.width/n.height;t=("contain"===i?l>c:l<c)?n.width/o.width:n.height/o.height;var u=Math.min(s,t);return{width:o.width*u,height:o.height*u}}function MS(e){var t=/[1-9]([0]+$)|\.([0-9]*)/.exec(String(e));return t?t[1]?-t[1].length:t[2]?t[2].length:0:0}function RS(e,t,o){void 0===o&&(o=10);var n=Math.pow(o,t);return Math.round(e*n)/n}var NS,BS,FS=Jn(),AS=Vn(function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._onMouseDown=function(e){var t=o.props,n=t.isEnabled,r=t.onShouldStartSelection;o._isMouseEventOnScrollbar(e)||o._isInSelectionToggle(e)||o._isTouch||!n||o._isDragStartInSelection(e)||r&&!r(e)||o._scrollableSurface&&0===e.button&&o._root.current&&(o._selectedIndicies={},o._preservedIndicies=void 0,o._events.on(window,"mousemove",o._onAsyncMouseMove,!0),o._events.on(o._scrollableParent,"scroll",o._onAsyncMouseMove),o._events.on(window,"click",o._onMouseUp,!0),o._autoScroll=new TS(o._root.current),o._scrollTop=o._scrollableSurface.scrollTop,o._scrollLeft=o._scrollableSurface.scrollLeft,o._rootRect=o._root.current.getBoundingClientRect(),o._onMouseMove(e))},o._onTouchStart=function(e){o._isTouch=!0,o._async.setTimeout((function(){o._isTouch=!1}),0)},o._onPointerDown=function(e){"touch"===e.pointerType&&(o._isTouch=!0,o._async.setTimeout((function(){o._isTouch=!1}),0))},Ui(o),o._async=new Zi(o),o._events=new Os(o),o.state={dragRect:void 0},o}return u(t,e),t.prototype.componentDidMount=function(){this._scrollableParent=es(this._root.current),this._scrollableSurface=this._scrollableParent===window?document.body:this._scrollableParent;var e=this.props.isDraggingConstrainedToRoot?this._root.current:this._scrollableSurface;this._events.on(e,"mousedown",this._onMouseDown),this._events.on(e,"touchstart",this._onTouchStart,!0),this._events.on(e,"pointerdown",this._onPointerDown,!0)},t.prototype.componentWillUnmount=function(){this._autoScroll&&this._autoScroll.dispose(),delete this._scrollableParent,delete this._scrollableSurface,this._events.dispose(),this._async.dispose()},t.prototype.render=function(){var e=this.props,t=e.rootProps,o=e.children,n=e.theme,r=e.className,i=e.styles,a=this.state.dragRect,s=FS(i,{theme:n,className:r});return f.createElement("div",d({},t,{className:s.root,ref:this._root}),o,a&&f.createElement("div",{className:s.dragMask}),a&&f.createElement("div",{className:s.box,style:a},f.createElement("div",{className:s.boxFill})))},t.prototype._isMouseEventOnScrollbar=function(e){var t=e.target,o=t.offsetWidth-t.clientWidth,n=t.offsetHeight-t.clientHeight;if(o||n){var r=t.getBoundingClientRect();if(jn(this.props.theme)){if(e.clientX<r.left+o)return!0}else if(e.clientX>r.left+t.clientWidth)return!0;if(e.clientY>r.top+t.clientHeight)return!0}return!1},t.prototype._getRootRect=function(){return{left:this._rootRect.left+(this._scrollableSurface?this._scrollLeft-this._scrollableSurface.scrollLeft:this._scrollLeft),top:this._rootRect.top+(this._scrollableSurface?this._scrollTop-this._scrollableSurface.scrollTop:this._scrollTop),width:this._rootRect.width,height:this._rootRect.height}},t.prototype._onAsyncMouseMove=function(e){var t=this;this._async.requestAnimationFrame((function(){t._onMouseMove(e)})),e.stopPropagation(),e.preventDefault()},t.prototype._onMouseMove=function(e){if(this._autoScroll){void 0!==e.clientX&&(this._lastMouseEvent=e);var t=this._getRootRect(),o={left:e.clientX-t.left,top:e.clientY-t.top};if(this._dragOrigin||(this._dragOrigin=o),void 0!==e.buttons&&0===e.buttons)this._onMouseUp(e);else if(this.state.dragRect||ES(this._dragOrigin,o)>5){if(!this.state.dragRect){var n=this.props.selection;e.shiftKey||n.setAllSelected(!1),this._preservedIndicies=n&&n.getSelectedIndices&&n.getSelectedIndices()}var r=this.props.isDraggingConstrainedToRoot?{left:Math.max(0,Math.min(t.width,this._lastMouseEvent.clientX-t.left)),top:Math.max(0,Math.min(t.height,this._lastMouseEvent.clientY-t.top))}:{left:this._lastMouseEvent.clientX-t.left,top:this._lastMouseEvent.clientY-t.top},i={left:Math.min(this._dragOrigin.left||0,r.left),top:Math.min(this._dragOrigin.top||0,r.top),width:Math.abs(r.left-(this._dragOrigin.left||0)),height:Math.abs(r.top-(this._dragOrigin.top||0))};this._evaluateSelection(i,t),this.setState({dragRect:i})}return!1}},t.prototype._onMouseUp=function(e){this._events.off(window),this._events.off(this._scrollableParent,"scroll"),this._autoScroll&&this._autoScroll.dispose(),this._autoScroll=this._dragOrigin=this._lastMouseEvent=void 0,this._selectedIndicies=this._itemRectCache=void 0,this.state.dragRect&&(this.setState({dragRect:void 0}),e.preventDefault(),e.stopPropagation())},t.prototype._isPointInRectangle=function(e,t){return!!t.top&&e.top<t.top&&e.bottom>t.top&&!!t.left&&e.left<t.left&&e.right>t.left},t.prototype._isDragStartInSelection=function(e){var t=this.props.selection;if(!this._root.current||t&&0===t.getSelectedCount())return!1;for(var o=this._root.current.querySelectorAll("[data-selection-index]"),n=0;n<o.length;n++){var r=o[n],i=Number(r.getAttribute("data-selection-index"));if(t.isIndexSelected(i)){var a=r.getBoundingClientRect();if(this._isPointInRectangle(a,{left:e.clientX,top:e.clientY}))return!0}}return!1},t.prototype._isInSelectionToggle=function(e){for(var t=e.target;t&&t!==this._root.current;){if("true"===t.getAttribute("data-selection-toggle"))return!0;t=t.parentElement}return!1},t.prototype._evaluateSelection=function(e,t){if(e&&this._root.current){var o=this.props.selection,n=this._root.current.querySelectorAll("[data-selection-index]");this._itemRectCache||(this._itemRectCache={});for(var r=0;r<n.length;r++){var i=n[r],a=i.getAttribute("data-selection-index"),s=this._itemRectCache[a];s||(s={left:(s=i.getBoundingClientRect()).left-t.left,top:s.top-t.top,width:s.width,height:s.height,right:s.left-t.left+s.width,bottom:s.top-t.top+s.height}).width>0&&s.height>0&&(this._itemRectCache[a]=s),s.top<e.top+e.height&&s.bottom>e.top&&s.left<e.left+e.width&&s.right>e.left?this._selectedIndicies[a]=!0:delete this._selectedIndicies[a]}var l=this._allSelectedIndices||{};for(var a in this._allSelectedIndices={},this._selectedIndicies)this._selectedIndicies.hasOwnProperty(a)&&(this._allSelectedIndices[a]=!0);if(this._preservedIndicies)for(var c=0,u=this._preservedIndicies;c<u.length;c++)a=u[c],this._allSelectedIndices[a]=!0;var d=!1;for(var a in this._allSelectedIndices)if(this._allSelectedIndices[a]!==l[a]){d=!0;break}if(!d)for(var a in l)if(this._allSelectedIndices[a]!==l[a]){d=!0;break}if(d){o.setChangeEvents(!1),o.setAllSelected(!1);for(var p=0,h=Object.keys(this._allSelectedIndices);p<h.length;p++)a=h[p],o.setIndexSelected(Number(a),!0,!1);o.setChangeEvents(!0)}}},t.defaultProps={rootTagName:"div",rootProps:{},isEnabled:!0},t}(f.Component),(function(e){var t,o,n,r=e.theme,i=e.className,a=r.palette;return{root:[i,{position:"relative",cursor:"default"}],dragMask:[{position:"absolute",background:"rgba(255, 0, 0, 0)",left:0,top:0,right:0,bottom:0,selectors:(t={},t[ro]={background:"none",backgroundColor:"transparent"},t)}],box:[{position:"absolute",boxSizing:"border-box",border:"1px solid "+a.themePrimary,pointerEvents:"none",zIndex:10,selectors:(o={},o[ro]={borderColor:"Highlight"},o)}],boxFill:[{position:"absolute",boxSizing:"border-box",backgroundColor:a.themePrimary,opacity:.1,left:0,top:0,right:0,bottom:0,selectors:(n={},n[ro]={background:"none",backgroundColor:"transparent"},n)}]}}),void 0,{scope:"MarqueeSelection"});!function(e){e[e.info=0]="info",e[e.error=1]="error",e[e.blocked=2]="blocked",e[e.severeWarning=3]="severeWarning",e[e.success=4]="success",e[e.warning=5]="warning"}(NS||(NS={}));var LS,HS,OS,zS=((BS={})[NS.info]="Info",BS[NS.warning]="Info",BS[NS.error]="ErrorBadge",BS[NS.blocked]="Blocked2",BS[NS.severeWarning]="Warning",BS[NS.success]="Completed",BS),WS=Jn(),VS=function(e){switch(e){case NS.blocked:case NS.error:case NS.severeWarning:return"assertive"}return"polite"},KS=function(e){switch(e){case NS.blocked:case NS.error:case NS.severeWarning:return"alert"}return"status"},US=f.forwardRef((function(e,t){var o=Lb(!1),n=o[0],r=o[1].toggle,i=Kd("MessageBar"),a=e.actions,s=e.className,l=e.children,c=e.overflowButtonAriaLabel,u=e.dismissIconProps,p=e.styles,h=e.theme,m=e.messageBarType,g=void 0===m?NS.info:m,v=e.onDismiss,b=void 0===v?void 0:v,y=e.isMultiline,_=void 0===y||y,C=e.truncated,S=e.dismissButtonAriaLabel,x=e.messageBarIconProps,k=e.role,w=e.delayedRender,I=void 0===w||w,D=Tr(e,ir,["className","role"]),T=WS(p,{theme:h,messageBarType:g||NS.info,onDismiss:void 0!==b,actions:void 0!==a,truncated:C,isMultiline:_,expandSingleLine:n,className:s}),E={iconName:n?"DoubleChevronUp":"DoubleChevronDown"},P=a||b?{"aria-describedby":i,role:"region"}:{},M=a?f.createElement("div",{className:T.actions},a):null,R=b?f.createElement(Zu,{disabled:!1,className:T.dismissal,onClick:b,iconProps:u||{iconName:"Clear"},title:S,ariaLabel:S}):null;return f.createElement("div",d({ref:t,className:T.root},P),f.createElement("div",{className:T.content},f.createElement("div",{className:T.iconContainer,"aria-hidden":!0},x?f.createElement(ii,d({},x,{className:qr(T.icon,x.className)})):f.createElement(ii,{iconName:zS[g],className:T.icon})),f.createElement("div",{className:T.text,id:i,role:k||KS(g),"aria-live":VS(g)},f.createElement("span",d({className:T.innerText},D),I?f.createElement(ea,null,f.createElement("span",null,l)):f.createElement("span",null,l))),!_&&!M&&C&&f.createElement("div",{className:T.expandSingleLine},f.createElement(Zu,{disabled:!1,className:T.expand,onClick:r,iconProps:E,ariaLabel:c,"aria-expanded":n})),!_&&M,!_&&R&&f.createElement("div",{className:T.dismissSingleLine},R),_&&R),_&&M)}));US.displayName="MessageBar";var GS,jS={root:"ms-MessageBar",error:"ms-MessageBar--error",blocked:"ms-MessageBar--blocked",severeWarning:"ms-MessageBar--severeWarning",success:"ms-MessageBar--success",warning:"ms-MessageBar--warning",multiline:"ms-MessageBar-multiline",singleline:"ms-MessageBar-singleline",dismissalSingleLine:"ms-MessageBar-dismissalSingleLine",expandingSingleLine:"ms-MessageBar-expandingSingleLine",content:"ms-MessageBar-content",iconContainer:"ms-MessageBar-icon",text:"ms-MessageBar-text",innerText:"ms-MessageBar-innerText",dismissSingleLine:"ms-MessageBar-dismissSingleLine",expandSingleLine:"ms-MessageBar-expandSingleLine",dismissal:"ms-MessageBar-dismissal",expand:"ms-MessageBar-expand",actions:"ms-MessageBar-actions",actionsSingleline:"ms-MessageBar-actionsSingleLine"},qS=((LS={})[NS.error]="errorBackground",LS[NS.blocked]="errorBackground",LS[NS.success]="successBackground",LS[NS.warning]="warningBackground",LS[NS.severeWarning]="severeWarningBackground",LS[NS.info]="infoBackground",LS),YS=((HS={})[NS.error]="rgba(255, 0, 0, 0.3)",HS[NS.blocked]="rgba(255, 0, 0, 0.3)",HS[NS.success]="rgba(48, 241, 73, 0.3)",HS[NS.warning]="rgba(255, 254, 57, 0.3)",HS[NS.severeWarning]="rgba(255, 0, 0, 0.3)",HS[NS.info]="Window",HS),ZS=((OS={})[NS.error]="errorIcon",OS[NS.blocked]="errorIcon",OS[NS.success]="successIcon",OS[NS.warning]="warningIcon",OS[NS.severeWarning]="severeWarningIcon",OS[NS.info]="infoIcon",OS),XS=Vn(US,(function(e){var t,o,n,r,i,a=e.theme,s=e.className,l=e.onDismiss,c=e.truncated,u=e.isMultiline,p=e.expandSingleLine,h=e.messageBarType,m=void 0===h?NS.info:h,g=a.semanticColors,f=a.fonts,v=Co(0,go),b=Qo(jS,a),y={fontSize:Ye.xSmall,height:10,lineHeight:"10px",color:g.messageText,selectors:(t={},t[ro]=d(d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{color:"WindowText"}),t)},_=[To(a,{inset:1,highContrastStyle:{outlineOffset:"-6px",outline:"1px solid Highlight"},borderColor:"transparent"}),{flexShrink:0,width:32,height:32,padding:"8px 12px",selectors:{"& .ms-Button-icon":y,":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}}];return{root:[b.root,f.medium,m===NS.error&&b.error,m===NS.blocked&&b.blocked,m===NS.severeWarning&&b.severeWarning,m===NS.success&&b.success,m===NS.warning&&b.warning,u?b.multiline:b.singleline,!u&&l&&b.dismissalSingleLine,!u&&c&&b.expandingSingleLine,{background:g[qS[m]],color:g.messageText,minHeight:32,width:"100%",display:"flex",wordBreak:"break-word",selectors:(o={".ms-Link":{color:g.messageLink,selectors:{":hover":{color:g.messageLinkHovered}}}},o[ro]=d(d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{background:YS[m],border:"1px solid WindowText",color:"WindowText"}),o)},u&&{flexDirection:"column"},s],content:[b.content,{display:"flex",width:"100%",lineHeight:"normal"}],iconContainer:[b.iconContainer,{fontSize:Ye.medium,minWidth:16,minHeight:16,display:"flex",flexShrink:0,margin:"8px 0 8px 12px"}],icon:{color:g[ZS[m]],selectors:(n={},n[ro]=d(d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),{color:"WindowText"}),n)},text:[b.text,d(d({minWidth:0,display:"flex",flexGrow:1,margin:8},f.small),{selectors:(r={},r[ro]=d({},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)}),!l&&{marginRight:12}],innerText:[b.innerText,{lineHeight:16,selectors:{"& span a:last-child":{paddingLeft:4}}},c&&{overflow:"visible",whiteSpace:"pre-wrap"},!u&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},!u&&!c&&{selectors:(i={},i[v]={overflow:"visible",whiteSpace:"pre-wrap"},i)},p&&{overflow:"visible",whiteSpace:"pre-wrap"}],dismissSingleLine:b.dismissSingleLine,expandSingleLine:b.expandSingleLine,dismissal:[b.dismissal,_],expand:[b.expand,_],actions:[u?b.actions:b.actionsSingleline,{display:"flex",flexGrow:0,flexShrink:0,flexBasis:"auto",flexDirection:"row-reverse",alignItems:"center",margin:"0 12px 0 8px",selectors:{"& button:nth-child(n+2)":{marginLeft:8}}},u&&{marginBottom:8},l&&!u&&{marginRight:0}]}}),void 0,{scope:"MessageBar"}),QS={root:"ms-Nav",linkText:"ms-Nav-linkText",compositeLink:"ms-Nav-compositeLink",link:"ms-Nav-link",chevronButton:"ms-Nav-chevronButton",chevronIcon:"ms-Nav-chevron",navItem:"ms-Nav-navItem",navItems:"ms-Nav-navItems",group:"ms-Nav-group",groupContent:"ms-Nav-groupContent"},JS={textContainer:{overflow:"hidden"},label:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}};function $S(e){return!!e&&!/^[a-z0-9+-.]+:\/\//i.test(e)}var ex,tx=Jn(),ox=function(e){function t(t){var o=e.call(this,t)||this;return o._focusZone=f.createRef(),o._onRenderLink=function(e){var t=o.props,n=t.styles,r=t.groups,i=t.theme,a=tx(n,{theme:i,groups:r});return f.createElement("div",{className:a.linkText},e.name)},o._renderGroup=function(e,t){var n=o.props,r=n.styles,i=n.groups,a=n.theme,s=n.onRenderGroupHeader,l=void 0===s?o._renderGroupHeader:s,c=o._isGroupExpanded(e),u=tx(r,{theme:a,isGroup:!0,isExpanded:c,groups:i}),p=d(d({},e),{isExpanded:c,onHeaderClick:function(t,n){o._onGroupHeaderClicked(e,t)}});return f.createElement("div",{key:t,className:u.group},p.name?l(p,o._renderGroupHeader):null,f.createElement("div",{className:u.groupContent},o._renderLinks(p.links,0)))},o._renderGroupHeader=function(e){var t=o.props,n=t.styles,r=t.groups,i=t.theme,a=t.expandButtonAriaLabel,s=e.isExpanded,l=tx(n,{theme:i,isGroup:!0,isExpanded:s,groups:r}),c=(s?e.collapseAriaLabel:e.expandAriaLabel)||a,u=e.onHeaderClick,d=u?function(e){u(e,s)}:void 0;return f.createElement("button",{className:l.chevronButton,onClick:d,"aria-label":c,"aria-expanded":s},f.createElement(ii,{className:l.chevronIcon,iconName:"ChevronDown"}),e.name)},Ui(o),o.state={isGroupCollapsed:{},isLinkExpandStateChanged:!1,selectedKey:t.initialSelectedKey||t.selectedKey},o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.styles,o=e.groups,n=e.className,r=e.isOnTop,i=e.theme;if(!o)return null;var a=o.map(this._renderGroup),s=tx(t,{theme:i,className:n,isOnTop:r,groups:o});return f.createElement(vs,{direction:$i.vertical,componentRef:this._focusZone},f.createElement("nav",{role:"navigation",className:s.root,"aria-label":this.props.ariaLabel},a))},Object.defineProperty(t.prototype,"selectedKey",{get:function(){return this.state.selectedKey},enumerable:!1,configurable:!0}),t.prototype.focus=function(e){return void 0===e&&(e=!1),!(!this._focusZone||!this._focusZone.current)&&this._focusZone.current.focus(e)},t.prototype._renderNavLink=function(e,t,o){var n=this.props,r=n.styles,i=n.groups,a=n.theme,s=e.icon||e.iconProps,l=this._isLinkSelected(e),c=e.ariaCurrent,u=void 0===c?"page":c,d=tx(r,{theme:a,isSelected:l,isDisabled:e.disabled,isButtonEntry:e.onClick&&!e.forceAnchor,leftPadding:14*o+3+(s?0:24),groups:i}),p=e.url&&e.target&&!$S(e.url)?"noopener noreferrer":void 0,h=this.props.linkAs?If(this.props.linkAs,Nd):Nd,m=this.props.onRenderLink?Wh(this.props.onRenderLink,this._onRenderLink):this._onRenderLink;return f.createElement(h,{className:d.link,styles:JS,href:e.url||(e.forceAnchor?"#":void 0),iconProps:e.iconProps||{iconName:e.icon},onClick:e.onClick?this._onNavButtonLinkClicked.bind(this,e):this._onNavAnchorLinkClicked.bind(this,e),title:void 0!==e.title?e.title:e.name,target:e.target,rel:p,disabled:e.disabled,"aria-current":l?u:void 0,"aria-label":e.ariaLabel?e.ariaLabel:void 0,link:e},m(e))},t.prototype._renderCompositeLink=function(e,t,o){var n=d({},Tr(e,Dr,["onClick"])),r=this.props,i=r.expandButtonAriaLabel,a=r.styles,s=r.groups,l=r.theme,c=tx(a,{theme:l,isExpanded:!!e.isExpanded,isSelected:this._isLinkSelected(e),isLink:!0,isDisabled:e.disabled,position:14*o+1,groups:s}),u="";return e.links&&e.links.length>0&&(u=e.collapseAriaLabel||e.expandAriaLabel?e.isExpanded?e.collapseAriaLabel:e.expandAriaLabel:i?e.name+" "+i:e.name),f.createElement("div",d({},n,{key:e.key||t,className:c.compositeLink}),e.links&&e.links.length>0?f.createElement("button",{className:c.chevronButton,onClick:this._onLinkExpandClicked.bind(this,e),"aria-label":u,"aria-expanded":e.isExpanded?"true":"false"},f.createElement(ii,{className:c.chevronIcon,iconName:"ChevronDown"})):null,this._renderNavLink(e,t,o))},t.prototype._renderLink=function(e,t,o){var n=this.props,r=n.styles,i=n.groups,a=n.theme,s=tx(r,{theme:a,groups:i});return f.createElement("li",{key:e.key||t,role:"listitem",className:s.navItem},this._renderCompositeLink(e,t,o),e.isExpanded?this._renderLinks(e.links,++o):null)},t.prototype._renderLinks=function(e,t){var o=this;if(!e||!e.length)return null;var n=e.map((function(e,n){return o._renderLink(e,n,t)})),r=this.props,i=r.styles,a=r.groups,s=r.theme,l=tx(i,{theme:s,groups:a});return f.createElement("ul",{role:"list",className:l.navItems},n)},t.prototype._onGroupHeaderClicked=function(e,t){e.onHeaderClick&&e.onHeaderClick(t,this._isGroupExpanded(e)),this._toggleCollapsed(e),t&&(t.preventDefault(),t.stopPropagation())},t.prototype._onLinkExpandClicked=function(e,t){var o=this.props.onLinkExpandClick;o&&o(t,e),t.defaultPrevented||(e.isExpanded=!e.isExpanded,this.setState({isLinkExpandStateChanged:!0})),t.preventDefault(),t.stopPropagation()},t.prototype._preventBounce=function(e,t){!e.url&&e.forceAnchor&&t.preventDefault()},t.prototype._onNavAnchorLinkClicked=function(e,t){this._preventBounce(e,t),this.props.onLinkClick&&this.props.onLinkClick(t,e),!e.url&&e.links&&e.links.length>0&&this._onLinkExpandClicked(e,t),this.setState({selectedKey:e.key})},t.prototype._onNavButtonLinkClicked=function(e,t){this._preventBounce(e,t),e.onClick&&e.onClick(t,e),!e.url&&e.links&&e.links.length>0&&this._onLinkExpandClicked(e,t),this.setState({selectedKey:e.key})},t.prototype._isLinkSelected=function(e){if(void 0!==this.props.selectedKey)return e.key===this.props.selectedKey;if(void 0!==this.state.selectedKey)return e.key===this.state.selectedKey;if(void 0===at()||!e.url)return!1;(GS=GS||document.createElement("a")).href=e.url||"";var t=GS.href;return location.href===t||location.protocol+"//"+location.host+location.pathname===t||!!location.hash&&(location.hash===e.url||(GS.href=location.hash.substring(1),GS.href===t))},t.prototype._isGroupExpanded=function(e){return e.name&&this.state.isGroupCollapsed.hasOwnProperty(e.name)?!this.state.isGroupCollapsed[e.name]:void 0===e.collapseByDefault||!e.collapseByDefault},t.prototype._toggleCollapsed=function(e){var t;if(e.name){var o=d(d({},this.state.isGroupCollapsed),((t={})[e.name]=this._isGroupExpanded(e),t));this.setState({isGroupCollapsed:o})}},t.defaultProps={groups:null},t}(f.Component),nx=Vn(ox,(function(e){var t,o=e.className,n=e.theme,r=e.isOnTop,i=e.isExpanded,a=e.isGroup,s=e.isLink,l=e.isSelected,c=e.isDisabled,u=e.isButtonEntry,d=e.navHeight,p=void 0===d?44:d,h=e.position,m=e.leftPadding,g=void 0===m?20:m,f=e.leftPaddingExpanded,v=void 0===f?28:f,b=e.rightPadding,y=void 0===b?20:b,_=n.palette,C=n.semanticColors,S=n.fonts,x=Qo(QS,n);return{root:[x.root,o,S.medium,{overflowY:"auto",userSelect:"none",WebkitOverflowScrolling:"touch"},r&&[{position:"absolute"},Ze.slideRightIn40]],linkText:[x.linkText,{margin:"0 4px",overflow:"hidden",verticalAlign:"middle",textAlign:"left",textOverflow:"ellipsis"}],compositeLink:[x.compositeLink,{display:"block",position:"relative",color:C.bodyText},i&&"is-expanded",l&&"is-selected",c&&"is-disabled",c&&{color:C.disabledText}],link:[x.link,To(n),{display:"block",position:"relative",height:p,width:"100%",lineHeight:p+"px",textDecoration:"none",cursor:"pointer",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",paddingLeft:g,paddingRight:y,color:C.bodyText,selectors:(t={},t[ro]={border:0,selectors:{":focus":{border:"1px solid WindowText"}}},t)},!c&&{selectors:{".ms-Nav-compositeLink:hover &":{backgroundColor:C.bodyBackgroundHovered}}},l&&{color:C.bodyTextChecked,fontWeight:qe.semibold,backgroundColor:C.bodyBackgroundChecked,selectors:{"&:after":{borderLeft:"2px solid "+_.themePrimary,content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none"}}},c&&{color:C.disabledText},u&&{color:_.themePrimary}],chevronButton:[x.chevronButton,To(n),S.small,{display:"block",textAlign:"left",lineHeight:p+"px",margin:"5px 0",padding:"0px, "+y+"px, 0px, "+v+"px",border:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"pointer",color:C.bodyText,backgroundColor:"transparent",selectors:{"&:visited":{color:C.bodyText}}},a&&{fontSize:S.large.fontSize,width:"100%",height:p,borderBottom:"1px solid "+C.bodyDivider},s&&{display:"block",width:v-2,height:p-2,position:"absolute",top:"1px",left:h+"px",zIndex:ko.Nav,padding:0,margin:0},l&&{color:_.themePrimary,backgroundColor:_.neutralLighterAlt,selectors:{"&:after":{borderLeft:"2px solid "+_.themePrimary,content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none"}}}],chevronIcon:[x.chevronIcon,{position:"absolute",left:"8px",height:p,display:"inline-flex",alignItems:"center",lineHeight:p+"px",fontSize:S.small.fontSize,transition:"transform .1s linear"},i&&{transform:"rotate(-180deg)"},s&&{top:0}],navItem:[x.navItem,{padding:0}],navItems:[x.navItems,{listStyleType:"none",padding:0,margin:0}],group:[x.group,i&&"is-expanded"],groupContent:[x.groupContent,{display:"none",marginBottom:"40px"},Ze.slideDownIn20,i&&{display:"block"}]}}),void 0,{scope:"Nav"});!function(e){e[e.none=0]="none",e[e.forceResolve=1]="forceResolve",e[e.searchMore=2]="searchMore"}(ex||(ex={}));var rx,ix={root:"ms-Suggestions-item",itemButton:"ms-Suggestions-itemButton",closeButton:"ms-Suggestions-closeButton",isSuggested:"is-suggested"},ax=r,sx=Jn(),lx=Vn(oC,(function(e){var t,o,n,r,i,a,s=e.className,l=e.theme,c=e.suggested,u=l.palette,p=l.semanticColors,h=Qo(ix,l);return{root:[h.root,{display:"flex",alignItems:"stretch",boxSizing:"border-box",width:"100%",position:"relative",selectors:{"&:hover":{background:p.menuItemBackgroundHovered},"&:hover .ms-Suggestions-closeButton":{display:"block"}}},c&&{selectors:(t={},t["."+wo+" &"]={selectors:(o={},o["."+h.closeButton]={display:"block",background:p.menuItemBackgroundPressed},o)},t[":after"]={pointerEvents:"none",content:'""',position:"absolute",left:0,top:0,bottom:0,right:0,border:"1px solid "+l.semanticColors.focusBorder},t)},s],itemButton:[h.itemButton,{width:"100%",padding:0,border:"none",height:"100%",minWidth:0,overflow:"hidden",selectors:(n={},n[ro]={color:"WindowText",selectors:{":hover":d({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"})}},n[":hover"]={color:p.menuItemTextHovered},n)},c&&[h.isSuggested,{background:p.menuItemBackgroundPressed,selectors:(r={":hover":{background:p.menuDivider}},r[ro]=d({background:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),r)}]],closeButton:[h.closeButton,{display:"none",color:u.neutralSecondary,padding:"0 4px",height:"auto",width:32,selectors:(i={":hover, :active":{background:u.neutralTertiaryAlt,color:u.neutralDark}},i[ro]={color:"WindowText"},i)},c&&(a={},a["."+wo+" &"]={selectors:{":hover, :active":{background:u.neutralTertiary}}},a.selectors={":hover, :active":{background:u.neutralTertiary,color:u.neutralPrimary}},a)]}}),void 0,{scope:"SuggestionItem"}),cx=function(e){function t(t){var o=e.call(this,t)||this;return o._forceResolveButton=f.createRef(),o._searchForMoreButton=f.createRef(),o._selectedElement=f.createRef(),o._scrollContainer=f.createRef(),o.tryHandleKeyDown=function(e,t){var n=!1,r=null,i=o.state.selectedActionType,a=o.props.suggestions.length;if(e===Un.down)switch(i){case ex.forceResolve:a>0?(o._refocusOnSuggestions(e),r=ex.none):r=o._searchForMoreButton.current?ex.searchMore:ex.forceResolve;break;case ex.searchMore:o._forceResolveButton.current?r=ex.forceResolve:a>0?(o._refocusOnSuggestions(e),r=ex.none):r=ex.searchMore;break;case ex.none:-1===t&&o._forceResolveButton.current&&(r=ex.forceResolve)}else if(e===Un.up)switch(i){case ex.forceResolve:o._searchForMoreButton.current?r=ex.searchMore:a>0&&(o._refocusOnSuggestions(e),r=ex.none);break;case ex.searchMore:a>0?(o._refocusOnSuggestions(e),r=ex.none):o._forceResolveButton.current&&(r=ex.forceResolve);break;case ex.none:-1===t&&o._searchForMoreButton.current&&(r=ex.searchMore)}return null!==r&&(o.setState({selectedActionType:r}),n=!0),n},o._getAlertText=function(){var e=o.props,t=e.isLoading,n=e.isSearching,r=e.suggestions,i=e.suggestionsAvailableAlertText,a=e.noResultsFoundText;if(!t&&!n){if(r.length>0)return i||"";if(a)return a}return""},o._getMoreResults=function(){o.props.onGetMoreResults&&o.props.onGetMoreResults()},o._forceResolve=function(){o.props.createGenericItem&&o.props.createGenericItem()},o._shouldShowForceResolve=function(){return!!o.props.showForceResolve&&o.props.showForceResolve()},o._onClickTypedSuggestionsItem=function(e,t){return function(n){o.props.onSuggestionClick(n,e,t)}},o._refocusOnSuggestions=function(e){"function"==typeof o.props.refocusSuggestions&&o.props.refocusSuggestions(e)},o._onRemoveTypedSuggestionsItem=function(e,t){return function(n){(0,o.props.onSuggestionRemove)(n,e,t),n.stopPropagation()}},Ui(o),o.state={selectedActionType:ex.none},o}return u(t,e),t.prototype.componentDidMount=function(){this.scrollSelected(),this.activeSelectedElement=this._selectedElement?this._selectedElement.current:null},t.prototype.componentDidUpdate=function(){this._selectedElement.current&&this.activeSelectedElement!==this._selectedElement.current&&(this.scrollSelected(),this.activeSelectedElement=this._selectedElement.current)},t.prototype.render=function(){var e,t,o=this,n=this.props,r=n.forceResolveText,i=n.mostRecentlyUsedHeaderText,a=n.searchForMoreText,s=n.className,l=n.moreSuggestionsAvailable,c=n.noResultsFoundText,u=n.suggestions,p=n.isLoading,h=n.isSearching,m=n.loadingText,g=n.onRenderNoResultFound,v=n.searchingText,b=n.isMostRecentlyUsedVisible,y=n.resultsMaximumNumber,_=n.resultsFooterFull,C=n.resultsFooter,S=n.isResultsFooterVisible,x=void 0===S||S,k=n.suggestionsHeaderText,w=n.suggestionsClassName,I=n.theme,D=n.styles,T=n.suggestionsListId;this._classNames=D?sx(D,{theme:I,className:s,suggestionsClassName:w,forceResolveButtonSelected:this.state.selectedActionType===ex.forceResolve,searchForMoreButtonSelected:this.state.selectedActionType===ex.searchMore}):{root:qr("ms-Suggestions",s,ax.root),title:qr("ms-Suggestions-title",ax.suggestionsTitle),searchForMoreButton:qr("ms-SearchMore-button",ax.actionButton,(e={},e["is-selected "+ax.buttonSelected]=this.state.selectedActionType===ex.searchMore,e)),forceResolveButton:qr("ms-forceResolve-button",ax.actionButton,(t={},t["is-selected "+ax.buttonSelected]=this.state.selectedActionType===ex.forceResolve,t)),suggestionsAvailable:qr("ms-Suggestions-suggestionsAvailable",ax.suggestionsAvailable),suggestionsContainer:qr("ms-Suggestions-container",ax.suggestionsContainer,w),noSuggestions:qr("ms-Suggestions-none",ax.suggestionsNone)};var E=this._classNames.subComponentStyles?this._classNames.subComponentStyles.spinner:void 0,P=D?{styles:E}:{className:qr("ms-Suggestions-spinner",ax.suggestionsSpinner)},M=function(){return c?f.createElement("div",{className:o._classNames.noSuggestions},c):null},R=k;b&&i&&(R=i);var N=void 0;x&&(N=u.length>=y?_:C);var B=!(u&&u.length||p),F=B||p?{role:"dialog",id:T}:{},A=this.state.selectedActionType===ex.forceResolve?"sug-selectedAction":void 0,L=this.state.selectedActionType===ex.searchMore?"sug-selectedAction":void 0;return f.createElement("div",d({className:this._classNames.root},F),f.createElement(na,{message:this._getAlertText(),"aria-live":"polite"}),R?f.createElement("div",{className:this._classNames.title},R):null,r&&this._shouldShowForceResolve()&&f.createElement(zd,{componentRef:this._forceResolveButton,className:this._classNames.forceResolveButton,id:A,onClick:this._forceResolve,"data-automationid":"sug-forceResolve"},r),p&&f.createElement($v,d({},P,{label:m})),B?g?g(void 0,M):M():this._renderSuggestions(),a&&l&&f.createElement(zd,{componentRef:this._searchForMoreButton,className:this._classNames.searchForMoreButton,iconProps:{iconName:"Search"},id:L,onClick:this._getMoreResults,"data-automationid":"sug-searchForMore"},a),h?f.createElement($v,d({},P,{label:v})):null,!N||l||b||h?null:f.createElement("div",{className:this._classNames.title},N(this.props)))},t.prototype.hasSuggestedAction=function(){return!!this._searchForMoreButton.current||!!this._forceResolveButton.current},t.prototype.hasSuggestedActionSelected=function(){return this.state.selectedActionType!==ex.none},t.prototype.executeSelectedAction=function(){switch(this.state.selectedActionType){case ex.forceResolve:this._forceResolve();break;case ex.searchMore:this._getMoreResults()}},t.prototype.focusAboveSuggestions=function(){this._forceResolveButton.current?this.setState({selectedActionType:ex.forceResolve}):this._searchForMoreButton.current&&this.setState({selectedActionType:ex.searchMore})},t.prototype.focusBelowSuggestions=function(){this._searchForMoreButton.current?this.setState({selectedActionType:ex.searchMore}):this._forceResolveButton.current&&this.setState({selectedActionType:ex.forceResolve})},t.prototype.focusSearchForMoreButton=function(){this._searchForMoreButton.current&&this._searchForMoreButton.current.focus()},t.prototype.scrollSelected=function(){if(this._selectedElement.current&&this._scrollContainer.current&&void 0!==this._scrollContainer.current.scrollTo){var e=this._selectedElement.current,t=e.offsetHeight,o=e.offsetTop,n=this._scrollContainer.current,r=n.offsetHeight,i=n.scrollTop,a=o+t>i+r;o<i?this._scrollContainer.current.scrollTo(0,o):a&&this._scrollContainer.current.scrollTo(0,o-r+t)}},t.prototype._renderSuggestions=function(){var e=this,t=this.props,o=t.isMostRecentlyUsedVisible,n=t.mostRecentlyUsedHeaderText,r=t.onRenderSuggestion,i=t.removeSuggestionAriaLabel,a=t.suggestionsItemClassName,s=t.resultsMaximumNumber,l=t.showRemoveButtons,c=t.suggestionsContainerAriaLabel,u=t.suggestionsHeaderText,d=t.suggestionsListId,p=this.props.suggestions,h=lx,m=-1;if(p.some((function(e,t){return!!e.selected&&(m=t,!0)})),s&&(p=m>=s?p.slice(m-s+1,m+1):p.slice(0,s)),0===p.length)return null;var g=u;return o&&n&&(g=n),f.createElement("div",{className:this._classNames.suggestionsContainer,id:d,ref:this._scrollContainer,role:"listbox","aria-label":c||g},p.map((function(t,o){return f.createElement("div",{ref:t.selected?e._selectedElement:void 0,key:t.item.key?t.item.key:o,role:"presentation"},f.createElement(h,{suggestionModel:t,RenderSuggestion:r,onClick:e._onClickTypedSuggestionsItem(t.item,o),className:a,showRemoveButton:l,removeButtonAriaLabel:i,onRemoveItem:e._onRemoveTypedSuggestionsItem(t.item,o),id:"sug-"+o}))})))},t}(f.Component),ux=function(){function e(){var e=this;this._isSuggestionModel=function(e){return void 0!==e.item},this._ensureSuggestionModel=function(t){return e._isSuggestionModel(t)?t:{item:t,selected:!1,ariaLabel:t.name||t.primaryText}},this.suggestions=[],this.currentIndex=-1}return e.prototype.updateSuggestions=function(e,t){e&&e.length>0?(this.suggestions=this.convertSuggestionsToSuggestionItems(e),this.currentIndex=t||0,-1===t?this.currentSuggestion=void 0:void 0!==t&&(this.suggestions[t].selected=!0,this.currentSuggestion=this.suggestions[t])):(this.suggestions=[],this.currentIndex=-1,this.currentSuggestion=void 0)},e.prototype.nextSuggestion=function(){if(this.suggestions&&this.suggestions.length){if(this.currentIndex<this.suggestions.length-1)return this.setSelectedSuggestion(this.currentIndex+1),!0;if(this.currentIndex===this.suggestions.length-1)return this.setSelectedSuggestion(0),!0}return!1},e.prototype.previousSuggestion=function(){if(this.suggestions&&this.suggestions.length){if(this.currentIndex>0)return this.setSelectedSuggestion(this.currentIndex-1),!0;if(0===this.currentIndex)return this.setSelectedSuggestion(this.suggestions.length-1),!0}return!1},e.prototype.getSuggestions=function(){return this.suggestions},e.prototype.getCurrentItem=function(){return this.currentSuggestion},e.prototype.getSuggestionAtIndex=function(e){return this.suggestions[e]},e.prototype.hasSelectedSuggestion=function(){return!!this.currentSuggestion},e.prototype.removeSuggestion=function(e){this.suggestions.splice(e,1)},e.prototype.createGenericSuggestion=function(e){var t=this.convertSuggestionsToSuggestionItems([e])[0];this.currentSuggestion=t},e.prototype.convertSuggestionsToSuggestionItems=function(e){return Array.isArray(e)?e.map(this._ensureSuggestionModel):[]},e.prototype.deselectAllSuggestions=function(){this.currentIndex>-1&&(this.suggestions[this.currentIndex].selected=!1,this.currentIndex=-1)},e.prototype.setSelectedSuggestion=function(e){e>this.suggestions.length-1||e<0?(this.currentIndex=0,this.currentSuggestion.selected=!1,this.currentSuggestion=this.suggestions[0],this.currentSuggestion.selected=!0):(this.currentIndex>-1&&(this.suggestions[this.currentIndex].selected=!1),this.suggestions[e].selected=!0,this.currentIndex=e,this.currentSuggestion=this.suggestions[e])},e}(),dx={root:"ms-Suggestions",suggestionsContainer:"ms-Suggestions-container",title:"ms-Suggestions-title",forceResolveButton:"ms-forceResolve-button",searchForMoreButton:"ms-SearchMore-button",spinner:"ms-Suggestions-spinner",noSuggestions:"ms-Suggestions-none",suggestionsAvailable:"ms-Suggestions-suggestionsAvailable",isSelected:"is-selected"};function px(e){var t,o=e.className,n=e.suggestionsClassName,r=e.theme,i=e.forceResolveButtonSelected,a=e.searchForMoreButtonSelected,s=r.palette,l=r.semanticColors,c=r.fonts,u=Qo(dx,r),p={backgroundColor:"transparent",border:0,cursor:"pointer",margin:0,paddingLeft:8,position:"relative",borderTop:"1px solid "+s.neutralLight,height:40,textAlign:"left",width:"100%",fontSize:c.small.fontSize,selectors:{":hover":{backgroundColor:l.menuItemBackgroundPressed,cursor:"pointer"},":focus, :active":{backgroundColor:s.themeLight},".ms-Button-icon":{fontSize:c.mediumPlus.fontSize,width:25},".ms-Button-label":{margin:"0 4px 0 9px"}}},h={backgroundColor:s.themeLight,selectors:(t={},t[ro]=d({backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)};return{root:[u.root,{minWidth:260},o],suggestionsContainer:[u.suggestionsContainer,{overflowY:"auto",overflowX:"hidden",maxHeight:300,transform:"translate3d(0,0,0)"},n],title:[u.title,{padding:"0 12px",fontSize:c.small.fontSize,color:s.themePrimary,lineHeight:40,borderBottom:"1px solid "+l.menuItemBackgroundPressed}],forceResolveButton:[u.forceResolveButton,p,i&&[u.isSelected,h]],searchForMoreButton:[u.searchForMoreButton,p,a&&[u.isSelected,h]],noSuggestions:[u.noSuggestions,{textAlign:"center",color:s.neutralSecondary,fontSize:c.small.fontSize,lineHeight:30}],suggestionsAvailable:[u.suggestionsAvailable,Ro],subComponentStyles:{spinner:{root:[u.spinner,{margin:"5px 0",paddingLeft:14,textAlign:"left",whiteSpace:"nowrap",lineHeight:20,fontSize:c.small.fontSize}],circle:{display:"inline-block",verticalAlign:"middle"},label:{display:"inline-block",verticalAlign:"middle",margin:"0 10px 0 16px"}}}}}!function(e){e[e.valid=0]="valid",e[e.warning=1]="warning",e[e.invalid=2]="invalid"}(rx||(rx={})),Ft([{rawString:".pickerText_9dd672fc{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid "},{theme:"neutralTertiary",defaultValue:"#a19f9d"},{rawString:";min-width:180px;min-height:30px}.pickerText_9dd672fc:hover{border-color:"},{theme:"inputBorderHovered",defaultValue:"#323130"},{rawString:"}.pickerText_9dd672fc.inputFocused_9dd672fc{position:relative;border-color:"},{theme:"inputFocusBorderAlt",defaultValue:"#0078d4"},{rawString:"}.pickerText_9dd672fc.inputFocused_9dd672fc:after{pointer-events:none;content:'';position:absolute;left:-1px;top:-1px;bottom:-1px;right:-1px;border:2px solid "},{theme:"inputFocusBorderAlt",defaultValue:"#0078d4"},{rawString:"}@media screen and (-ms-high-contrast:active){.pickerText_9dd672fc.inputDisabled_9dd672fc{position:relative;border-color:GrayText}.pickerText_9dd672fc.inputDisabled_9dd672fc:after{pointer-events:none;content:'';position:absolute;left:0;top:0;bottom:0;right:0;background-color:Window}}.pickerInput_9dd672fc{height:34px;border:none;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;outline:0;padding:0 6px 0;-ms-flex-item-align:end;align-self:flex-end}.pickerItems_9dd672fc{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%}.screenReaderOnly_9dd672fc{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}"}]);var hx="pickerText_9dd672fc",mx="inputFocused_9dd672fc",gx="inputDisabled_9dd672fc",fx="pickerInput_9dd672fc",vx="pickerItems_9dd672fc",bx="screenReaderOnly_9dd672fc",yx=s,_x=Jn(),Cx=function(e){function t(t){var o=e.call(this,t)||this;o.root=f.createRef(),o.input=f.createRef(),o.suggestionElement=f.createRef(),o.SuggestionOfProperType=cx,o._styledSuggestions=Vn(o.SuggestionOfProperType,px,void 0,{scope:"Suggestions"}),o.dismissSuggestions=function(e){var t=function(){var t=!0;o.props.onDismiss&&(t=o.props.onDismiss(e,o.suggestionStore.currentSuggestion?o.suggestionStore.currentSuggestion.item:void 0)),(!e||e&&!e.defaultPrevented)&&!1!==t&&o.canAddItems()&&o.suggestionStore.hasSelectedSuggestion()&&o.state.suggestedDisplayValue&&o.addItemByIndex(0)};o.currentPromise?o.currentPromise.then((function(){return t()})):t(),o.setState({suggestionsVisible:!1})},o.refocusSuggestions=function(e){o.resetFocus(),o.suggestionStore.suggestions&&o.suggestionStore.suggestions.length>0&&(e===Un.up?o.suggestionStore.setSelectedSuggestion(o.suggestionStore.suggestions.length-1):e===Un.down&&o.suggestionStore.setSelectedSuggestion(0))},o.onInputChange=function(e){o.updateValue(e),o.setState({moreSuggestionsAvailable:!0,isMostRecentlyUsedVisible:!1})},o.onSuggestionClick=function(e,t,n){o.addItemByIndex(n)},o.onSuggestionRemove=function(e,t,n){o.props.onRemoveSuggestion&&o.props.onRemoveSuggestion(t),o.suggestionStore.removeSuggestion(n)},o.onInputFocus=function(e){o.selection.setAllSelected(!1),o.state.isFocused||(o._userTriggeredSuggestions(),o.props.inputProps&&o.props.inputProps.onFocus&&o.props.inputProps.onFocus(e))},o.onInputBlur=function(e){o.props.inputProps&&o.props.inputProps.onBlur&&o.props.inputProps.onBlur(e)},o.onBlur=function(e){if(o.state.isFocused){var t=e.relatedTarget;null===e.relatedTarget&&(t=document.activeElement),t&&!Ca(o.root.current,t)&&(o.setState({isFocused:!1}),o.props.onBlur&&o.props.onBlur(e))}},o.onClick=function(e){void 0!==o.props.inputProps&&void 0!==o.props.inputProps.onClick&&o.props.inputProps.onClick(e),0===e.button&&o._userTriggeredSuggestions()},o.onFocus=function(){o.state.isFocused||o.setState({isFocused:!0})},o.onKeyDown=function(e){var t=e.which;switch(t){case Un.escape:o.state.suggestionsVisible&&(o.setState({suggestionsVisible:!1}),e.preventDefault(),e.stopPropagation());break;case Un.tab:case Un.enter:o.suggestionElement.current&&o.suggestionElement.current.hasSuggestedActionSelected()?o.suggestionElement.current.executeSelectedAction():!e.shiftKey&&o.suggestionStore.hasSelectedSuggestion()&&o.state.suggestionsVisible?(o.completeSuggestion(),e.preventDefault(),e.stopPropagation()):o._completeGenericSuggestion();break;case Un.backspace:o.props.disabled||o.onBackspace(e),e.stopPropagation();break;case Un.del:o.props.disabled||(o.input.current&&e.target===o.input.current.inputElement&&o.state.suggestionsVisible&&-1!==o.suggestionStore.currentIndex?(o.props.onRemoveSuggestion&&o.props.onRemoveSuggestion(o.suggestionStore.currentSuggestion.item),o.suggestionStore.removeSuggestion(o.suggestionStore.currentIndex),o.forceUpdate()):o.onBackspace(e)),e.stopPropagation();break;case Un.up:o.input.current&&e.target===o.input.current.inputElement&&o.state.suggestionsVisible&&(o.suggestionElement.current&&o.suggestionElement.current.tryHandleKeyDown(t,o.suggestionStore.currentIndex)?(e.preventDefault(),e.stopPropagation(),o.forceUpdate()):o.suggestionElement.current&&o.suggestionElement.current.hasSuggestedAction()&&0===o.suggestionStore.currentIndex?(e.preventDefault(),e.stopPropagation(),o.suggestionElement.current.focusAboveSuggestions(),o.suggestionStore.deselectAllSuggestions(),o.forceUpdate()):o.suggestionStore.previousSuggestion()&&(e.preventDefault(),e.stopPropagation(),o.onSuggestionSelect()));break;case Un.down:o.input.current&&e.target===o.input.current.inputElement&&o.state.suggestionsVisible&&(o.suggestionElement.current&&o.suggestionElement.current.tryHandleKeyDown(t,o.suggestionStore.currentIndex)?(e.preventDefault(),e.stopPropagation(),o.forceUpdate()):o.suggestionElement.current&&o.suggestionElement.current.hasSuggestedAction()&&o.suggestionStore.currentIndex+1===o.suggestionStore.suggestions.length?(e.preventDefault(),e.stopPropagation(),o.suggestionElement.current.focusBelowSuggestions(),o.suggestionStore.deselectAllSuggestions(),o.forceUpdate()):o.suggestionStore.nextSuggestion()&&(e.preventDefault(),e.stopPropagation(),o.onSuggestionSelect()))}},o.onItemChange=function(e,t){var n=o.state.items;if(t>=0){var r=n;r[t]=e,o._updateSelectedItems(r)}},o.onGetMoreResults=function(){o.setState({isSearching:!0},(function(){if(o.props.onGetMoreResults&&o.input.current){var e=o.props.onGetMoreResults(o.input.current.value,o.state.items),t=e,n=e;Array.isArray(t)?(o.updateSuggestions(t),o.setState({isSearching:!1})):n.then&&n.then((function(e){o.updateSuggestions(e),o.setState({isSearching:!1})}))}else o.setState({isSearching:!1});o.input.current&&o.input.current.focus(),o.setState({moreSuggestionsAvailable:!1,isResultsFooterVisible:!0})}))},o.completeSelection=function(e){o.addItem(e),o.updateValue(""),o.input.current&&o.input.current.clear(),o.setState({suggestionsVisible:!1})},o.addItemByIndex=function(e){o.completeSelection(o.suggestionStore.getSuggestionAtIndex(e).item)},o.addItem=function(e){var t=o.props.onItemSelected?o.props.onItemSelected(e):e;if(null!==t){var n=t,r=t;if(r&&r.then)r.then((function(e){var t=o.state.items.concat([e]);o._updateSelectedItems(t)}));else{var i=o.state.items.concat([n]);o._updateSelectedItems(i)}o.setState({suggestedDisplayValue:"",selectionRemoved:void 0})}},o.removeItem=function(e){var t=o.state.items,n=t.indexOf(e);if(n>=0){var r=t.slice(0,n).concat(t.slice(n+1));o.setState({selectionRemoved:e}),o._updateSelectedItems(r)}},o.removeItems=function(e){var t=o.state.items.filter((function(t){return-1===e.indexOf(t)}));o._updateSelectedItems(t)},o._shouldFocusZoneEnterInnerZone=function(e){if(o.state.suggestionsVisible)switch(e.which){case Un.up:case Un.down:return!0}return e.which===Un.enter},o._onResolveSuggestions=function(e){var t=o.props.onResolveSuggestions(e,o.state.items);null!==t&&o.updateSuggestionsList(t,e)},o._completeGenericSuggestion=function(){if(o.props.onValidateInput&&o.input.current&&o.props.onValidateInput(o.input.current.value)!==rx.invalid&&o.props.createGenericItem){var e=o.props.createGenericItem(o.input.current.value,o.props.onValidateInput(o.input.current.value));o.suggestionStore.createGenericSuggestion(e),o.completeSuggestion()}},o._userTriggeredSuggestions=function(){if(!o.state.suggestionsVisible){var e=o.input.current?o.input.current.value:"";e?0===o.suggestionStore.suggestions.length?o._onResolveSuggestions(e):o.setState({isMostRecentlyUsedVisible:!1,suggestionsVisible:!0}):o.onEmptyInputFocus()}},Ui(o),o._async=new Zi(o);var n=t.selectedItems||t.defaultSelectedItems||[];return o._id=Va(),o._ariaMap={selectedItems:"selected-items-"+o._id,selectedSuggestionAlert:"selected-suggestion-alert-"+o._id,suggestionList:"suggestion-list-"+o._id,combobox:"combobox-"+o._id},o.suggestionStore=new ux,o.selection=new Yf({onSelectionChanged:function(){return o.onSelectionChange()}}),o.selection.setItems(n),o.state={items:n,suggestedDisplayValue:"",isMostRecentlyUsedVisible:!1,moreSuggestionsAvailable:!1,isFocused:!1,isSearching:!1,selectedIndices:[],selectionRemoved:void 0},o}return u(t,e),t.getDerivedStateFromProps=function(e){return e.selectedItems?{items:e.selectedItems}:null},Object.defineProperty(t.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.selection.setItems(this.state.items),this._onResolveSuggestions=this._async.debounce(this._onResolveSuggestions,this.props.resolveDelay)},t.prototype.componentDidUpdate=function(e,t){if(this.state.items&&this.state.items!==t.items){var o=this.selection.getSelectedIndices()[0];this.selection.setItems(this.state.items),this.state.isFocused&&(this.state.items.length<t.items.length?(this.selection.setIndexSelected(o,!1,!0),this.resetFocus(o)):this.state.items.length>t.items.length&&!this.canAddItems()&&this.resetFocus(this.state.items.length-1))}},t.prototype.componentWillUnmount=function(){this.currentPromise&&(this.currentPromise=void 0),this._async.dispose()},t.prototype.focus=function(){this.input.current&&this.input.current.focus()},t.prototype.focusInput=function(){this.input.current&&this.input.current.focus()},t.prototype.completeSuggestion=function(e){this.suggestionStore.hasSelectedSuggestion()&&this.input.current?this.completeSelection(this.suggestionStore.currentSuggestion.item):e&&this._completeGenericSuggestion()},t.prototype.render=function(){var e=this.state,t=e.suggestedDisplayValue,o=e.isFocused,n=e.items,r=this.props,i=r.className,a=r.inputProps,s=r.disabled,l=r.selectionAriaLabel,c=r.selectionRole,u=void 0===c?"list":c,p=r.theme,h=r.styles,m=this.state.suggestionsVisible?this._ariaMap.suggestionList:"",g=h?_x(h,{theme:p,className:i,isFocused:o,disabled:s,inputClassName:a&&a.className}):{root:qr("ms-BasePicker",i||""),text:qr("ms-BasePicker-text",yx.pickerText,this.state.isFocused&&yx.inputFocused),itemsWrapper:yx.pickerItems,input:qr("ms-BasePicker-input",yx.pickerInput,a&&a.className),screenReaderText:yx.screenReaderOnly},v=this.props["aria-label"]||(null==a?void 0:a["aria-label"]);return f.createElement("div",{ref:this.root,className:g.root,onKeyDown:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur},this.renderCustomAlert(g.screenReaderText),f.createElement("span",{id:this._ariaMap.selectedItems+"-label",hidden:!0},l||v),f.createElement(av,{selection:this.selection,selectionMode:Kf.multiple},f.createElement("div",{className:g.text,"aria-owns":m},n.length>0&&f.createElement("span",{id:this._ariaMap.selectedItems,className:g.itemsWrapper,role:u,"aria-labelledby":this._ariaMap.selectedItems+"-label"},this.renderItems()),this.canAddItems()&&f.createElement(Qi,d({spellCheck:!1},a,{className:g.input,componentRef:this.input,id:(null==a?void 0:a.id)?a.id:this._ariaMap.combobox,onClick:this.onClick,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onInputValueChange:this.onInputChange,suggestedDisplayValue:t,"aria-activedescendant":this.getActiveDescendant(),"aria-controls":m,"aria-describedby":n.length>0?this._ariaMap.selectedItems:void 0,"aria-expanded":!!this.state.suggestionsVisible,"aria-haspopup":"listbox","aria-label":v,role:"combobox",disabled:s,onInputChange:this.props.onInputChange})))),this.renderSuggestions())},t.prototype.canAddItems=function(){var e=this.state.items,t=this.props.itemLimit;return void 0===t||e.length<t},t.prototype.renderSuggestions=function(){var e=this._styledSuggestions;return this.state.suggestionsVisible&&this.input?f.createElement(Cc,d({isBeakVisible:!1,gapSpace:5,target:this.input.current?this.input.current.inputElement:void 0,onDismiss:this.dismissSuggestions,directionalHint:qs.bottomLeftEdge,directionalHintForRTL:qs.bottomRightEdge},this.props.pickerCalloutProps),f.createElement(e,d({onRenderSuggestion:this.props.onRenderSuggestionsItem,onSuggestionClick:this.onSuggestionClick,onSuggestionRemove:this.onSuggestionRemove,suggestions:this.suggestionStore.getSuggestions(),componentRef:this.suggestionElement,onGetMoreResults:this.onGetMoreResults,moreSuggestionsAvailable:this.state.moreSuggestionsAvailable,isLoading:this.state.suggestionsLoading,isSearching:this.state.isSearching,isMostRecentlyUsedVisible:this.state.isMostRecentlyUsedVisible,isResultsFooterVisible:this.state.isResultsFooterVisible,refocusSuggestions:this.refocusSuggestions,removeSuggestionAriaLabel:this.props.removeButtonAriaLabel,suggestionsListId:this._ariaMap.suggestionList,createGenericItem:this._completeGenericSuggestion},this.props.pickerSuggestionsProps))):null},t.prototype.renderItems=function(){var e=this,t=this.props,o=t.disabled,n=t.removeButtonAriaLabel,r=this.props.onRenderItem,i=this.state,a=i.items,s=i.selectedIndices;return a.map((function(t,i){return r({item:t,index:i,key:t.key?t.key:i,selected:-1!==s.indexOf(i),onRemoveItem:function(){return e.removeItem(t)},disabled:o,onItemChange:e.onItemChange,removeButtonAriaLabel:n})}))},t.prototype.resetFocus=function(e){var t=this.state.items;if(t.length&&e>=0){var o=this.root.current&&this.root.current.querySelectorAll("[data-selection-index]")[Math.min(e,t.length-1)];o&&o.focus()}else this.canAddItems()?this.input.current&&this.input.current.focus():this.resetFocus(t.length-1)},t.prototype.onSuggestionSelect=function(){if(this.suggestionStore.currentSuggestion){var e=this.input.current?this.input.current.value:"",t=this._getTextFromItem(this.suggestionStore.currentSuggestion.item,e);this.setState({suggestedDisplayValue:t})}},t.prototype.onSelectionChange=function(){this.setState({selectedIndices:this.selection.getSelectedIndices()})},t.prototype.updateSuggestions=function(e){this.suggestionStore.updateSuggestions(e,0),this.forceUpdate()},t.prototype.onEmptyInputFocus=function(){var e=this.props.onEmptyResolveSuggestions?this.props.onEmptyResolveSuggestions:this.props.onEmptyInputFocus;if(e){var t=e(this.state.items);this.updateSuggestionsList(t),this.setState({isMostRecentlyUsedVisible:!0,suggestionsVisible:!0,moreSuggestionsAvailable:!1})}},t.prototype.updateValue=function(e){this._onResolveSuggestions(e)},t.prototype.updateSuggestionsList=function(e,t){var o=this,n=e,r=e;if(Array.isArray(n))this._updateAndResolveValue(t,n);else if(r&&r.then){this.setState({suggestionsLoading:!0}),this.suggestionStore.updateSuggestions([]),void 0!==t?this.setState({suggestionsVisible:this._getShowSuggestions()}):this.setState({suggestionsVisible:this.input.current&&this.input.current.inputElement===document.activeElement});var i=this.currentPromise=r;i.then((function(e){i===o.currentPromise&&o._updateAndResolveValue(t,e)}))}},t.prototype.resolveNewValue=function(e,t){var o=this;this.updateSuggestions(t);var n=void 0;this.suggestionStore.currentSuggestion&&(n=this._getTextFromItem(this.suggestionStore.currentSuggestion.item,e)),this.setState({suggestedDisplayValue:n,suggestionsVisible:this._getShowSuggestions()},(function(){return o.setState({suggestionsLoading:!1})}))},t.prototype.onChange=function(e){this.props.onChange&&this.props.onChange(e)},t.prototype.onBackspace=function(e){(this.state.items.length&&!this.input.current||this.input.current&&!this.input.current.isValueSelected&&0===this.input.current.cursorLocation)&&(this.selection.getSelectedCount()>0?this.removeItems(this.selection.getSelection()):this.removeItem(this.state.items[this.state.items.length-1]))},t.prototype.getActiveDescendant=function(){if(!this.state.suggestionsLoading){var e=this.suggestionStore.currentIndex;return e<0&&this.suggestionElement.current&&this.suggestionElement.current.hasSuggestedAction()?"sug-selectedAction":e>-1&&!this.state.suggestionsLoading?"sug-"+e:void 0}},t.prototype.getSuggestionsAlert=function(e){void 0===e&&(e=yx.screenReaderOnly);var t=this.suggestionStore.currentIndex;if(this.props.enableSelectedSuggestionAlert){var o=t>-1?this.suggestionStore.getSuggestionAtIndex(this.suggestionStore.currentIndex):void 0,n=o?o.ariaLabel:void 0;return f.createElement("div",{id:this._ariaMap.selectedSuggestionAlert,className:e},n+" ")}},t.prototype.renderCustomAlert=function(e){void 0===e&&(e=yx.screenReaderOnly);var t=this.props.suggestionRemovedText,o=void 0===t?"removed {0}":t,n="";return this.state.selectionRemoved&&(n=wp(o,this._getTextFromItem(this.state.selectionRemoved,""))),f.createElement("div",{className:e,id:this._ariaMap.selectedSuggestionAlert,"aria-live":"assertive"},this.getSuggestionsAlert(e),n)},t.prototype._updateAndResolveValue=function(e,t){void 0!==e?this.resolveNewValue(e,t):(this.suggestionStore.updateSuggestions(t,-1),this.state.suggestionsLoading&&this.setState({suggestionsLoading:!1}))},t.prototype._updateSelectedItems=function(e){var t=this;this.props.selectedItems?this.onChange(e):this.setState({items:e},(function(){t._onSelectedItemsUpdated(e)}))},t.prototype._onSelectedItemsUpdated=function(e){this.onChange(e)},t.prototype._getShowSuggestions=function(){return void 0!==this.input.current&&null!==this.input.current&&this.input.current.inputElement===document.activeElement&&""!==this.input.current.value},t.prototype._getTextFromItem=function(e,t){return this.props.getTextFromItem?this.props.getTextFromItem(e,t):""},t}(f.Component),Sx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.render=function(){var e=this.state,t=e.suggestedDisplayValue,o=e.isFocused,n=this.props,r=n.className,i=n.inputProps,a=n.disabled,s=n.selectionAriaLabel,l=n.selectionRole,c=void 0===l?"list":l,u=n.theme,p=n.styles,h=this.state.suggestionsVisible?this._ariaMap.suggestionList:"",m=p?_x(p,{theme:u,className:r,isFocused:o,inputClassName:i&&i.className}):{root:qr("ms-BasePicker",r||""),text:qr("ms-BasePicker-text",yx.pickerText,this.state.isFocused&&yx.inputFocused,a&&yx.inputDisabled),itemsWrapper:yx.pickerItems,input:qr("ms-BasePicker-input",yx.pickerInput,i&&i.className),screenReaderText:yx.screenReaderOnly},g=this.props["aria-label"]||(null==i?void 0:i["aria-label"]);return f.createElement("div",{ref:this.root,onBlur:this.onBlur,onFocus:this.onFocus},f.createElement("div",{className:m.root,onKeyDown:this.onKeyDown},this.renderCustomAlert(m.screenReaderText),f.createElement("div",{className:m.text,"aria-owns":h||void 0},f.createElement(Qi,d({},i,{className:m.input,componentRef:this.input,onFocus:this.onInputFocus,onBlur:this.onInputBlur,onClick:this.onClick,onInputValueChange:this.onInputChange,suggestedDisplayValue:t,"aria-activedescendant":this.getActiveDescendant(),"aria-controls":h||void 0,"aria-expanded":!!this.state.suggestionsVisible,"aria-haspopup":"listbox","aria-label":g,role:"combobox",id:(null==i?void 0:i.id)?i.id:this._ariaMap.combobox,disabled:a,onInputChange:this.props.onInputChange})))),this.renderSuggestions(),f.createElement(av,{selection:this.selection,selectionMode:Kf.single},f.createElement("div",{id:this._ariaMap.selectedItems,className:"ms-BasePicker-selectedItems",role:c,"aria-label":s||g},this.renderItems())))},t.prototype.onBackspace=function(e){},t}(Cx),xx={root:"ms-PickerPersona-container",itemContent:"ms-PickerItem-content",removeButton:"ms-PickerItem-removeButton",isSelected:"is-selected",isInvalid:"is-invalid"},kx=Jn(),wx=function(e){var t=e.item,o=e.onRemoveItem,n=e.index,r=e.selected,i=e.removeButtonAriaLabel,a=e.styles,s=e.theme,l=e.className,c=e.disabled,u=Va(),p=kx(a,{theme:s,className:l,selected:r,disabled:c,invalid:t.ValidationState===rx.warning}),h=p.subComponentStyles?p.subComponentStyles.persona:void 0,m=p.subComponentStyles?p.subComponentStyles.personaCoin:void 0;return f.createElement("div",{className:p.root,role:"listitem"},f.createElement("div",{className:p.itemContent,id:"selectedItemPersona-"+u},f.createElement(A_,d({size:Yr.size24,styles:h,coinProps:{styles:m}},t))),f.createElement(Zu,{id:u,onClick:o,disabled:c,iconProps:{iconName:"Cancel",styles:{root:{fontSize:"12px"}}},className:p.removeButton,ariaLabel:i,"aria-labelledby":u+" selectedItemPersona-"+u,"data-selection-index":n}))},Ix=Vn(wx,(function(e){var t,o,n,r,i,a,s,l=e.className,c=e.theme,u=e.selected,p=e.invalid,h=e.disabled,m=c.palette,g=c.semanticColors,f=c.fonts,v=Qo(xx,c),b=[u&&!p&&!h&&{color:m.white,selectors:(t={":hover":{color:m.white}},t[ro]={color:"HighlightText"},t)},(p&&!u||p&&u&&h)&&{color:m.redDark,borderBottom:"2px dotted "+m.redDark,selectors:(o={},o["."+v.root+":hover &"]={color:m.redDark},o)},p&&u&&!h&&{color:m.white,borderBottom:"2px dotted "+m.white},h&&{selectors:(n={},n[ro]={color:"GrayText"},n)}],y=[p&&{fontSize:f.xLarge.fontSize}];return{root:[v.root,To(c,{inset:-2}),{borderRadius:15,display:"inline-flex",alignItems:"center",background:m.neutralLighter,margin:"1px 2px",cursor:"default",userSelect:"none",maxWidth:300,verticalAlign:"middle",minWidth:0,selectors:(r={":hover":{background:u||h?"":m.neutralLight}},r[ro]=[{border:"1px solid WindowText"},h&&{borderColor:"GrayText"}],r)},u&&!h&&[v.isSelected,{background:m.themePrimary,selectors:(i={},i[ro]=d({borderColor:"HighLight",background:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)}],p&&[v.isInvalid],p&&u&&!h&&{background:m.redDark},l],itemContent:[v.itemContent,{flex:"0 1 auto",minWidth:0,maxWidth:"100%",overflow:"hidden"}],removeButton:[v.removeButton,{borderRadius:15,color:m.neutralPrimary,flex:"0 0 auto",width:24,height:24,selectors:{":hover":{background:m.neutralTertiaryAlt,color:m.neutralDark}}},u&&[{color:m.white,selectors:(a={":hover":{color:m.white,background:m.themeDark},":active":{color:m.white,background:m.themeDarker}},a[ro]={color:"HighlightText"},a)},p&&{selectors:{":hover":{background:m.red},":active":{background:m.redDark}}}],h&&{selectors:(s={},s["."+Lu.msButtonIcon]={color:g.buttonText},s)}],subComponentStyles:{persona:{primaryText:b},personaCoin:{initials:y}}}}),void 0,{scope:"PeoplePickerItem"}),Dx={root:"ms-PeoplePicker-personaContent",personaWrapper:"ms-PeoplePicker-Persona"},Tx=Jn(),Ex=function(e){var t=e.personaProps,o=e.suggestionsProps,n=e.compact,r=e.styles,i=e.theme,a=e.className,s=Tx(r,{theme:i,className:o&&o.suggestionsItemClassName||a}),l=s.subComponentStyles&&s.subComponentStyles.persona?s.subComponentStyles.persona:void 0;return f.createElement("div",{className:s.root},f.createElement(A_,d({size:Yr.size24,styles:l,className:s.personaWrapper,showSecondaryText:!n,showOverflowTooltip:!1},t)))},Px=Vn(Ex,(function(e){var t,o,n,r=e.className,i=e.theme,a=Qo(Dx,i),s={selectors:(t={},t["."+ix.isSuggested+" &"]={selectors:(o={},o[ro]={color:"HighlightText"},o)},t["."+a.root+":hover &"]={selectors:(n={},n[ro]={color:"HighlightText"},n)},t)};return{root:[a.root,{width:"100%",padding:"4px 12px"},r],personaWrapper:[a.personaWrapper,{width:180}],subComponentStyles:{persona:{primaryText:s,secondaryText:s}}}}),void 0,{scope:"PeoplePickerItemSuggestion"}),Mx={root:"ms-BasePicker",text:"ms-BasePicker-text",itemsWrapper:"ms-BasePicker-itemsWrapper",input:"ms-BasePicker-input"};function Rx(e){var t,o=e.className,n=e.theme,r=e.isFocused,i=e.inputClassName,a=e.disabled;if(!n)throw new Error("theme is undefined or null in base BasePicker getStyles function.");var s=n.semanticColors,l=n.effects,c=n.fonts,u=s.inputBorder,d=s.inputBorderHovered,p=s.inputFocusBorderAlt,h=Qo(Mx,n),m="rgba(218, 218, 218, 0.29)";return{root:[h.root,o],text:[h.text,{display:"flex",position:"relative",flexWrap:"wrap",alignItems:"center",boxSizing:"border-box",minWidth:180,minHeight:30,border:"1px solid "+u,borderRadius:l.roundedCorner2},!r&&!a&&{selectors:{":hover":{borderColor:d}}},r&&!a&&Mo(p,l.roundedCorner2),a&&{borderColor:m,selectors:(t={":after":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,background:m}},t[ro]={borderColor:"GrayText",selectors:{":after":{background:"none"}}},t)}],itemsWrapper:[h.itemsWrapper,{display:"flex",flexWrap:"wrap",maxWidth:"100%"}],input:[h.input,c.medium,{height:30,border:"none",flexGrow:1,outline:"none",padding:"0 6px 0",alignSelf:"flex-end",borderRadius:l.roundedCorner2,backgroundColor:"transparent",color:s.inputText,selectors:{"::-ms-clear":{display:"none"}}},i],screenReaderText:Ro}}var Nx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(Cx),Bx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(Sx),Fx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.defaultProps={onRenderItem:function(e){return f.createElement(Ix,d({},e))},onRenderSuggestionsItem:function(e,t){return f.createElement(Px,{personaProps:e,suggestionsProps:t})},createGenericItem:Hx},t}(Nx),Ax=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.defaultProps={onRenderItem:function(e){return f.createElement(Ix,d({},e))},onRenderSuggestionsItem:function(e,t){return f.createElement(Px,{personaProps:e,suggestionsProps:t,compact:!0})},createGenericItem:Hx},t}(Nx),Lx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.defaultProps={onRenderItem:function(e){return f.createElement(Ix,d({},e))},onRenderSuggestionsItem:function(e,t){return f.createElement(Px,{personaProps:e,suggestionsProps:t})},createGenericItem:Hx},t}(Bx);function Hx(e,t){var o={key:e,primaryText:e,imageInitials:"!",ValidationState:t};return t!==rx.warning&&(o.imageInitials=Hr(e,jn())),o}var Ox=Vn(Fx,Rx,void 0,{scope:"NormalPeoplePicker"}),zx=Vn(Ax,Rx,void 0,{scope:"CompactPeoplePicker"}),Wx=Vn(Lx,Rx,void 0,{scope:"ListPeoplePickerBase"}),Vx={root:"ms-TagItem",text:"ms-TagItem-text",close:"ms-TagItem-close",isSelected:"is-selected"},Kx=Jn(),Ux=function(e){var t=e.theme,o=e.styles,n=e.selected,r=e.disabled,i=e.enableTagFocusInDisabledPicker,a=e.children,s=e.className,l=e.index,c=e.onRemoveItem,u=e.removeButtonAriaLabel,p=e.title,h=void 0===p?"string"==typeof e.children?e.children:e.item.name:p,m=Kx(o,{theme:t,className:s,selected:n,disabled:r}),g=Kd(),v=i?{"aria-disabled":r,tabindex:0}:{disabled:r};return f.createElement("div",{className:m.root,role:"listitem",key:l},f.createElement("span",{className:m.text,title:h,id:g+"-text"},a),f.createElement(Zu,d({id:g,onClick:c},v,{iconProps:{iconName:"Cancel",styles:{root:{fontSize:"12px"}}},className:m.close,ariaLabel:u,"aria-labelledby":g+" "+g+"-text","data-selection-index":l})))},Gx=Vn(Ux,(function(e){var t,o,n,r,i=e.className,a=e.theme,s=e.selected,l=e.disabled,c=a.palette,u=a.effects,d=a.fonts,p=a.semanticColors,h=Qo(Vx,a);return{root:[h.root,d.medium,To(a),{boxSizing:"content-box",flexShrink:"1",margin:2,height:26,lineHeight:26,cursor:"default",userSelect:"none",display:"flex",flexWrap:"nowrap",maxWidth:300,minWidth:0,borderRadius:u.roundedCorner2,color:p.inputText,background:c.neutralLighter,selectors:(t={":hover":[!l&&!s&&{color:c.neutralDark,background:c.neutralLight,selectors:{".ms-TagItem-close":{color:c.neutralPrimary}}},l&&{background:c.neutralLighter}],":focus-within":[!l&&{background:c.themePrimary,color:c.white}]},t[ro]={border:"1px solid "+(s?"WindowFrame":"WindowText")},t)},l&&{selectors:(o={},o[ro]={borderColor:"GrayText"},o)},s&&!l&&[h.isSelected],i],text:[h.text,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:30,margin:"0 8px"},l&&{selectors:(n={},n[ro]={color:"GrayText"},n)}],close:[h.close,{color:c.neutralSecondary,width:30,height:"100%",flex:"0 0 auto",borderRadius:jn(a)?u.roundedCorner2+" 0 0 "+u.roundedCorner2:"0 "+u.roundedCorner2+" "+u.roundedCorner2+" 0",selectors:{":hover":{background:c.neutralQuaternaryAlt,color:c.neutralPrimary},":focus":{color:c.white,background:c.themePrimary},":focus:hover":{color:c.white,background:c.themeDark},":active":{color:c.white,backgroundColor:c.themeDark}}},l&&{selectors:(r={},r["."+Lu.msButtonIcon]={color:c.neutralSecondary},r)}]}}),void 0,{scope:"TagItem"}),jx={suggestionTextOverflow:"ms-TagItem-TextOverflow"},qx=Jn(),Yx=function(e){var t=e.styles,o=e.theme,n=e.children,r=qx(t,{theme:o});return f.createElement("div",{className:r.suggestionTextOverflow}," ",n," ")},Zx=Vn(Yx,(function(e){var t=e.className,o=e.theme;return{suggestionTextOverflow:[Qo(jx,o).suggestionTextOverflow,{overflow:"hidden",textOverflow:"ellipsis",maxWidth:"60vw",padding:"6px 12px 7px",whiteSpace:"nowrap"},t]}}),void 0,{scope:"TagItemSuggestion"}),Xx=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),o}return u(t,e),t.defaultProps={onRenderItem:function(e){return f.createElement(Gx,d({},e),e.item.name)},onRenderSuggestionsItem:function(e){return f.createElement(Zx,null,e.name)}},t}(Cx),Qx=Vn(Xx,Rx,void 0,{scope:"TagPicker"});function Jx(e,t){void 0===t&&(t=null);var o,n=f.useRef({ref:(o=function(e){n.ref.current!==e&&(n.cleanup&&(n.cleanup(),n.cleanup=void 0),n.ref.current=e,null!==e&&(n.cleanup=n.callback(e)))},o.current=t,o),callback:e}).current;return n.callback=e,n.ref}var $x=function(e){function t(t){var o=e.call(this,t)||this;return Ui(o),xi("PivotItem",t,{linkText:"headerText"}),o}return u(t,e),t.prototype.render=function(){return f.createElement("div",d({},Tr(this.props,Dr)),this.props.children)},t}(f.Component),ek=Jn(),tk=function(e,t){var o={links:[],keyToIndexMapping:{},keyToTabIdMapping:{}};return f.Children.forEach(f.Children.toArray(e.children),(function(n,r){if(ok(n)){var i=n.props,a=i.linkText,s=p(i,["linkText"]),l=n.props.itemKey||r.toString();o.links.push(d(d({headerText:a},s),{itemKey:l})),o.keyToIndexMapping[l]=r,o.keyToTabIdMapping[l]=function(e,t,o,n){return e.getTabId?e.getTabId(o,n):t+"-Tab"+n}(e,t,l,r)}else n&&cn("The children of a Pivot component must be of type PivotItem to be rendered.")})),o},ok=function(e){var t;return f.isValidElement(e)&&(null===(t=e.type)||void 0===t?void 0:t.name)===$x.name},nk=f.forwardRef((function(e,t){var o,n=f.useRef(null),r=f.useRef(null),i=Kd("Pivot"),a=gh(e.selectedKey,e.defaultSelectedKey),s=a[0],l=a[1],c=e.componentRef,u=e.theme,p=e.linkSize,h=e.linkFormat,m=e.overflowBehavior,g=e.focusZoneProps,v=Tr(e,Dr),b=tk(e,i);f.useImperativeHandle(c,(function(){return{focus:function(){var e;null===(e=n.current)||void 0===e||e.focus()}}}));var y=function(e){if(!e)return null;var t=e.itemCount,n=e.itemIcon,r=e.headerText;return f.createElement("span",{className:o.linkContent},void 0!==n&&f.createElement("span",{className:o.icon},f.createElement(ii,{iconName:n})),void 0!==r&&f.createElement("span",{className:o.text}," ",e.headerText),void 0!==t&&f.createElement("span",{className:o.count}," (",t,")"))},_=function(e,t,n,r){var i,a=t.itemKey,s=t.headerButtonProps,l=t.onRenderItemLink,c=e.keyToTabIdMapping[a],u=n===a;i=l?l(t,y):y(t);var p=t.headerText||"";return p+=t.itemCount?" ("+t.itemCount+")":"",p+=t.itemIcon?" xx":"",f.createElement(zd,d({},s,{id:c,key:a,className:qr(r,u&&o.linkIsSelected),onClick:function(e){return C(a,e)},onKeyDown:function(e){return S(a,e)},"aria-label":t.ariaLabel,role:t.role||"tab","aria-selected":u,name:t.headerText,keytipProps:t.keytipProps,"data-content":p}),i)},C=function(e,t){t.preventDefault(),x(e,t)},S=function(e,t){t.which===Un.enter&&(t.preventDefault(),x(e))},x=function(t,o){var n;if(l(t),b=tk(e,i),e.onLinkClick&&b.keyToIndexMapping[t]>=0){var a=b.keyToIndexMapping[t],s=f.Children.toArray(e.children)[a];ok(s)&&e.onLinkClick(s,o)}null===(n=r.current)||void 0===n||n.dismissMenu()};o=ek(e.styles,{theme:u,linkSize:p,linkFormat:h});var k,w=null===(k=s)||void 0!==k&&void 0!==b.keyToIndexMapping[k]?s:b.links.length?b.links[0].itemKey:void 0,I=w?b.keyToIndexMapping[w]:0,D=b.links.map((function(e){return _(b,e,w,o.link)})),T=f.useMemo((function(){return{items:[],alignTargetEdge:!0,directionalHint:qs.bottomRightEdge}}),[]),E=function(e){var t=e.onOverflowItemsChanged,o=e.rtl,n=e.pinnedIndex,r=f.useRef(),i=f.useRef(),a=Jx((function(e){var t=function(e,t){if("undefined"!=typeof ResizeObserver){var o=new ResizeObserver(t);return Array.isArray(e)?e.forEach((function(e){return o.observe(e)})):o.observe(e),function(){return o.disconnect()}}var n=function(){return t(void 0)},r=at(Array.isArray(e)?e[0]:e);if(!r)return function(){};var i=r.requestAnimationFrame(n);return r.addEventListener("resize",n,!1),function(){r.cancelAnimationFrame(i),r.removeEventListener("resize",n,!1)}}(e,(function(t){i.current=t?t[0].contentRect.width:e.clientWidth,r.current&&r.current()}));return function(){t(),i.current=void 0}})),s=Jx((function(e){return a(e.parentElement),function(){return a(null)}}));return f.useLayoutEffect((function(){var e=a.current,l=s.current;if(e&&l){for(var c=[],u=0;u<e.children.length;u++){var d=e.children[u];d instanceof HTMLElement&&d!==l&&c.push(d)}var p=[],h=0;r.current=function(){var e=i.current;if(void 0!==e){for(var t=c.length-1;t>=0;t--){if(void 0===p[t]){var r=o?e-c[t].offsetLeft:c[t].offsetLeft+c[t].offsetWidth;t+1<c.length&&t+1===n&&(h=p[t+1]-r),t===c.length-2&&(h+=l.offsetWidth),p[t]=r+h}if(e>p[t])return void g(t+1)}g(0)}};var m=c.length,g=function(e){m!==e&&(m=e,t(e,c.map((function(t,o){return{ele:t,isOverflowing:o>=e&&o!==n}}))))},f=void 0;if(void 0!==i.current){var v=at(e);if(v){var b=v.requestAnimationFrame(r.current);f=function(){return v.cancelAnimationFrame(b)}}}return function(){f&&f(),g(c.length),r.current=void 0}}})),{menuButtonRef:s}}({onOverflowItemsChanged:function(e,t){t.forEach((function(e){var t=e.ele,o=e.isOverflowing;return t.dataset.isOverflowing=""+o})),T.items=b.links.slice(e).map((function(t,n){return{key:t.itemKey||""+(e+n),onRender:function(){return _(b,t,w,o.linkInMenu)}}}))},rtl:jn(u),pinnedIndex:I}).menuButtonRef;return f.createElement("div",d({role:"toolbar"},v,{ref:t}),f.createElement(vs,d({componentRef:n,role:"tablist",direction:$i.horizontal},g,{className:qr(o.root,null==g?void 0:g.className)}),D,"menu"===m&&f.createElement(zd,{className:qr(o.link,o.overflowMenuButton),elementRef:E,componentRef:r,menuProps:T,menuIconProps:{iconName:"More",style:{color:"inherit"}}})),w&&b.links.map((function(t){return(!0===t.alwaysRender||w===t.itemKey)&&function(t,n){if(e.headersOnly||!t)return null;var r=b.keyToIndexMapping[t],i=b.keyToTabIdMapping[t];return f.createElement("div",{role:"tabpanel",hidden:!n,key:t,"aria-hidden":!n,"aria-labelledby":i,className:o.itemContainer},f.Children.toArray(e.children)[r])}(t.itemKey,w===t.itemKey)})))}));nk.displayName="Pivot";var rk,ik,ak={count:"ms-Pivot-count",icon:"ms-Pivot-icon",linkIsSelected:"is-selected",link:"ms-Pivot-link",linkContent:"ms-Pivot-linkContent",root:"ms-Pivot",rootIsLarge:"ms-Pivot--large",rootIsTabs:"ms-Pivot--tabs",text:"ms-Pivot-text",linkInMenu:"ms-Pivot-linkInMenu",overflowMenuButton:"ms-Pivot-overflowMenuButton"},sk=function(e,t,o){var n,r,i;void 0===o&&(o=!1);var a=e.linkSize,s=e.linkFormat,l=e.theme,c=l.semanticColors,u=l.fonts,p="large"===a,h="tabs"===s;return[u.medium,{color:c.actionLink,padding:"0 8px",position:"relative",backgroundColor:"transparent",border:0,borderRadius:0,selectors:(n={":hover":{backgroundColor:c.buttonBackgroundHovered,color:c.buttonTextHovered,cursor:"pointer"},":active":{backgroundColor:c.buttonBackgroundPressed,color:c.buttonTextHovered},":focus":{outline:"none"}},n["."+wo+" &:focus"]={outline:"1px solid "+c.focusBorder},n["."+wo+" &:focus:after"]={content:"attr(data-content)",position:"relative",border:0},n)},!o&&[{display:"inline-block",lineHeight:44,height:44,marginRight:8,textAlign:"center",selectors:{":before":{backgroundColor:"transparent",bottom:0,content:'""',height:2,left:8,position:"absolute",right:8,transition:"left "+Le.durationValue2+" "+Le.easeFunction2+",\n right "+Le.durationValue2+" "+Le.easeFunction2},":after":{color:"transparent",content:"attr(data-content)",display:"block",fontWeight:qe.bold,height:1,overflow:"hidden",visibility:"hidden"}}},p&&{fontSize:u.large.fontSize},h&&[{marginRight:0,height:44,lineHeight:44,backgroundColor:c.buttonBackground,padding:"0 10px",verticalAlign:"top",selectors:(r={":focus":{outlineOffset:"-1px"}},r["."+wo+" &:focus::before"]={height:"auto",background:"transparent",transition:"none"},r["&:hover, &:focus"]={color:c.buttonTextCheckedHovered},r["&:active, &:hover"]={color:c.primaryButtonText,backgroundColor:c.primaryButtonBackground},r["&."+t.linkIsSelected]={backgroundColor:c.primaryButtonBackground,color:c.primaryButtonText,fontWeight:qe.regular,selectors:(i={":before":{backgroundColor:"transparent",transition:"none",position:"absolute",top:0,left:0,right:0,bottom:0,content:'""',height:0},":hover":{backgroundColor:c.primaryButtonBackgroundHovered,color:c.primaryButtonText},"&:active":{backgroundColor:c.primaryButtonBackgroundPressed,color:c.primaryButtonText}},i[ro]=d({fontWeight:qe.semibold,color:"HighlightText",background:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),i)},r)}]]]},lk=Vn(nk,(function(e){var t,o,n,r,i=e.className,a=e.linkSize,s=e.linkFormat,l=e.theme,c=l.semanticColors,u=l.fonts,d=Qo(ak,l),p="large"===a,h="tabs"===s;return{root:[d.root,u.medium,on,{position:"relative",color:c.link,whiteSpace:"nowrap"},p&&d.rootIsLarge,h&&d.rootIsTabs,i],itemContainer:{selectors:{"&[hidden]":{display:"none"}}},link:m([d.link],sk(e,d),[(t={},t["&[data-is-overflowing='true']"]={display:"none"},t)]),overflowMenuButton:[d.overflowMenuButton,(o={visibility:"hidden",position:"absolute",right:0},o["."+d.link+"[data-is-overflowing='true'] ~ &"]={visibility:"visible",position:"relative"},o)],linkInMenu:m([d.linkInMenu],sk(e,d,!0),[{textAlign:"left",width:"100%",height:36,lineHeight:36}]),linkIsSelected:[d.link,d.linkIsSelected,{fontWeight:qe.semibold,selectors:(n={":before":{backgroundColor:c.inputBackgroundChecked,selectors:(r={},r[ro]={backgroundColor:"Highlight"},r)},":hover::before":{left:0,right:0}},n[ro]={color:"Highlight"},n)}],linkContent:[d.linkContent,{flex:"0 1 100%",selectors:{"& > * ":{marginLeft:4},"& > *:first-child":{marginLeft:0}}}],text:[d.text,{display:"inline-block",verticalAlign:"top"}],count:[d.count,{display:"inline-block",verticalAlign:"top"}],icon:d.icon}}),void 0,{scope:"Pivot"});!function(e){e.links="links",e.tabs="tabs"}(rk||(rk={})),function(e){e.normal="normal",e.large="large"}(ik||(ik={}));var ck,uk=Jn(),dk=function(e){function t(t){var o=e.call(this,t)||this;o._onRenderProgress=function(e){var t=o.props,n=t.ariaValueText,r=t.barHeight,i=t.className,a=t.description,s=t.label,l=void 0===s?o.props.title:s,c=t.styles,u=t.theme,d="number"==typeof o.props.percentComplete?Math.min(100,Math.max(0,100*o.props.percentComplete)):void 0,p=uk(c,{theme:u,className:i,barHeight:r,indeterminate:void 0===d}),h={width:void 0!==d?d+"%":void 0,transition:void 0!==d&&d<.01?"none":void 0},m=void 0!==d?0:void 0,g=void 0!==d?100:void 0,v=void 0!==d?Math.floor(d):void 0;return f.createElement("div",{className:p.itemProgress},f.createElement("div",{className:p.progressTrack}),f.createElement("div",{className:p.progressBar,style:h,role:"progressbar","aria-describedby":a?o._descriptionId:void 0,"aria-labelledby":l?o._labelId:void 0,"aria-valuemin":m,"aria-valuemax":g,"aria-valuenow":v,"aria-valuetext":n}))};var n=Va("progress-indicator");return o._labelId=n+"-label",o._descriptionId=n+"-description",o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.barHeight,o=e.className,n=e.label,r=void 0===n?this.props.title:n,i=e.description,a=e.styles,s=e.theme,l=e.progressHidden,c=e.onRenderProgress,u=void 0===c?this._onRenderProgress:c,p="number"==typeof this.props.percentComplete?Math.min(100,Math.max(0,100*this.props.percentComplete)):void 0,h=uk(a,{theme:s,className:o,barHeight:t,indeterminate:void 0===p});return f.createElement("div",{className:h.root},r?f.createElement("div",{id:this._labelId,className:h.itemName},r):null,l?null:u(d(d({},this.props),{percentComplete:p}),this._onRenderProgress),i?f.createElement("div",{id:this._descriptionId,className:h.itemDescription},i):null)},t.defaultProps={label:"",description:"",width:180},t}(f.Component),pk={root:"ms-ProgressIndicator",itemName:"ms-ProgressIndicator-itemName",itemDescription:"ms-ProgressIndicator-itemDescription",itemProgress:"ms-ProgressIndicator-itemProgress",progressTrack:"ms-ProgressIndicator-progressTrack",progressBar:"ms-ProgressIndicator-progressBar"},hk=jo((function(){return J({"0%":{left:"-30%"},"100%":{left:"100%"}})})),mk=jo((function(){return J({"100%":{right:"-30%"},"0%":{right:"100%"}})})),gk=Vn(dk,(function(e){var t,o,n,r=jn(e.theme),i=e.className,a=e.indeterminate,s=e.theme,l=e.barHeight,c=void 0===l?2:l,u=s.palette,p=s.semanticColors,h=s.fonts,m=Qo(pk,s),g=u.neutralLight;return{root:[m.root,h.medium,i],itemName:[m.itemName,nn,{color:p.bodyText,paddingTop:4,lineHeight:20}],itemDescription:[m.itemDescription,{color:p.bodySubtext,fontSize:h.small.fontSize,lineHeight:18}],itemProgress:[m.itemProgress,{position:"relative",overflow:"hidden",height:c,padding:"8px 0"}],progressTrack:[m.progressTrack,{position:"absolute",width:"100%",height:c,backgroundColor:g,selectors:(t={},t[ro]={borderBottom:"1px solid WindowText"},t)}],progressBar:[{backgroundColor:u.themePrimary,height:c,position:"absolute",transition:"width .3s ease",width:0,selectors:(o={},o[ro]=d({backgroundColor:"highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),o)},a?{position:"absolute",minWidth:"33%",background:"linear-gradient(to right, "+g+" 0%, "+u.themePrimary+" 50%, "+g+" 100%)",animation:(r?mk():hk())+" 3s infinite",selectors:(n={},n[ro]={background:"highlight"},n)}:{transition:"width .15s linear"},m.progressBar]}}),void 0,{scope:"ProgressIndicator"}),fk={root:"ms-RatingStar-root",rootIsSmall:"ms-RatingStar-root--small",rootIsLarge:"ms-RatingStar-root--large",ratingStar:"ms-RatingStar-container",ratingStarBack:"ms-RatingStar-back",ratingStarFront:"ms-RatingStar-front",ratingButton:"ms-Rating-button",ratingStarIsSmall:"ms-Rating--small",ratingStartIsLarge:"ms-Rating--large",labelText:"ms-Rating-labelText",ratingFocusZone:"ms-Rating-focuszone"};function vk(e,t){var o;return{color:e,selectors:(o={},o[ro]={color:t},o)}}!function(e){e[e.Small=0]="Small",e[e.Large=1]="Large"}(ck||(ck={}));var bk=Jn(),yk=function(e){return f.createElement("div",{className:e.classNames.ratingStar},f.createElement(ii,{className:e.classNames.ratingStarBack,iconName:0===e.fillPercentage||100===e.fillPercentage?e.icon:e.unselectedIcon}),!e.disabled&&f.createElement(ii,{className:e.classNames.ratingStarFront,iconName:e.icon,style:{width:e.fillPercentage+"%"}}))},_k=function(e,t){return e+"-star-"+(t-1)},Ck=f.forwardRef((function(e,t){var o=Kd("Rating"),n=Kd("RatingLabel"),r=e.ariaLabel,i=e.ariaLabelFormat,a=e.disabled,s=e.getAriaLabel,l=e.styles,c=e.min,u=void 0===c?e.allowZeroStars?0:1:c,p=e.max,h=void 0===p?5:p,m=e.readOnly,g=e.size,v=e.theme,b=e.icon,y=void 0===b?"FavoriteStarFill":b,_=e.unselectedIcon,C=void 0===_?"FavoriteStar":_,S=e.onRenderStar,x=Math.max(u,0),k=gh(e.rating,e.defaultRating,e.onChange),w=k[0],I=k[1],D=function(e,t,o){return Math.min(Math.max(null!=e?e:t,t),o)}(w,x,h);!function(e){Mi({name:"Rating",props:e,controlledUsage:{valueProp:"rating",defaultValueProp:"defaultRating",onChangeProp:"onChange",readOnlyProp:"readOnly"}})}(e),function(e,t){f.useImperativeHandle(e,(function(){return{rating:t}}),[t])}(e.componentRef,D);for(var T=Tr(e,Dr),E=bk(l,{disabled:a,readOnly:m,theme:v}),P=null==s?void 0:s(D,h),M=r||P,R=[],N=function(e){var t,r,s=function(e,t){var o=Math.ceil(t),n=100;return e===t?n=100:e===o?n=t%1*100:e>o&&(n=0),n}(e,D),l=function(t){void 0!==w&&Math.ceil(w)===e||I(e,t)};R.push(f.createElement("button",d({className:qr(E.ratingButton,g===ck.Large?E.ratingStarIsLarge:E.ratingStarIsSmall),id:_k(o,e),key:e},e===Math.ceil(D)&&{"data-is-current":!0},{onFocus:l,onClick:l,disabled:!(!a&&!m),role:"radio","aria-hidden":m?"true":void 0,type:"button","aria-checked":e===Math.ceil(D)}),f.createElement("span",{id:n+"-"+e,className:E.labelText},wp(i||"",e,h)),(t={fillPercentage:s,disabled:a,classNames:E,icon:s>0?y:C,starNum:e,unselectedIcon:C},(r=S)?r(t):f.createElement(yk,d({},t)))))},B=1;B<=h;B++)N(B);var F=g===ck.Large?E.rootIsLarge:E.rootIsSmall;return f.createElement("div",d({ref:t,className:qr("ms-Rating-star",E.root,F),"aria-label":m?void 0:M,id:o,role:m?void 0:"radiogroup"},T),f.createElement(vs,d({direction:$i.bidirectional,className:qr(E.ratingFocusZone,F),defaultActiveElement:"#"+_k(o,Math.ceil(D))},m&&{allowFocusRoot:!0,disabled:!0,role:"textbox","aria-label":P,"aria-readonly":!0,"data-is-focusable":!0,tabIndex:0}),R))}));Ck.displayName="RatingBase";var Sk=Vn(Ck,(function(e){var t=e.disabled,o=e.readOnly,n=e.theme,r=n.semanticColors,i=n.palette,a=Qo(fk,n),s=i.neutralSecondary,l=i.themePrimary,c=i.themeDark,u=i.neutralPrimary,d=r.disabledBodySubtext;return{root:[a.root,n.fonts.medium,!t&&!o&&{selectors:{"&:hover":{selectors:{".ms-RatingStar-back":vk(u,"Highlight")}}}}],rootIsSmall:[a.rootIsSmall,{height:"32px"}],rootIsLarge:[a.rootIsLarge,{height:"36px"}],ratingStar:[a.ratingStar,{display:"inline-block",position:"relative",height:"inherit"}],ratingStarBack:[a.ratingStarBack,{color:s,width:"100%"},t&&vk(d,"GrayText")],ratingStarFront:[a.ratingStarFront,{position:"absolute",height:"100 %",left:"0",top:"0",textAlign:"center",verticalAlign:"middle",overflow:"hidden"},vk(u,"Highlight")],ratingButton:[To(n),a.ratingButton,{backgroundColor:"transparent",padding:"8px 2px",boxSizing:"content-box",margin:"0px",border:"none",cursor:"pointer",selectors:{"&:disabled":{cursor:"default"},"&[disabled]":{cursor:"default"}}},!t&&!o&&{selectors:{"&:hover ~ .ms-Rating-button":{selectors:{".ms-RatingStar-back":vk(s,"WindowText"),".ms-RatingStar-front":vk(s,"WindowText")}},"&:hover":{selectors:{".ms-RatingStar-back":{color:l},".ms-RatingStar-front":{color:c}}}}},t&&{cursor:"default"}],ratingStarIsSmall:[a.ratingStarIsSmall,{fontSize:"16px",lineHeight:"16px",height:"16px"}],ratingStarIsLarge:[a.ratingStartIsLarge,{fontSize:"20px",lineHeight:"20px",height:"20px"}],labelText:[a.labelText,Ro],ratingFocusZone:[To(n),a.ratingFocusZone,{display:"inline-block"}]}}),void 0,{scope:"Rating"}),xk={root:"ms-ScrollablePane",contentContainer:"ms-ScrollablePane--contentContainer"},kk={auto:"auto",always:"always"},wk=f.createContext({scrollablePane:void 0}),Ik=Jn(),Dk=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._stickyAboveRef=f.createRef(),o._stickyBelowRef=f.createRef(),o._contentContainer=f.createRef(),o.subscribe=function(e){o._subscribers.add(e)},o.unsubscribe=function(e){o._subscribers.delete(e)},o.addSticky=function(e){o._stickies.add(e),o.contentContainer&&(e.setDistanceFromTop(o.contentContainer),o.sortSticky(e))},o.removeSticky=function(e){o._stickies.delete(e),o._removeStickyFromContainers(e),o.notifySubscribers()},o.sortSticky=function(e,t){o.stickyAbove&&o.stickyBelow&&(t&&o._removeStickyFromContainers(e),e.canStickyTop&&e.stickyContentTop&&o._addToStickyContainer(e,o.stickyAbove,e.stickyContentTop),e.canStickyBottom&&e.stickyContentBottom&&o._addToStickyContainer(e,o.stickyBelow,e.stickyContentBottom))},o.updateStickyRefHeights=function(){var e=o._stickies,t=0,n=0;e.forEach((function(e){var r=e.state,i=r.isStickyTop,a=r.isStickyBottom;e.nonStickyContent&&(i&&(t+=e.nonStickyContent.offsetHeight),a&&(n+=e.nonStickyContent.offsetHeight),o._checkStickyStatus(e))})),o.setState({stickyTopHeight:t,stickyBottomHeight:n})},o.notifySubscribers=function(){o.contentContainer&&o._subscribers.forEach((function(e){e(o.contentContainer,o.stickyBelow)}))},o.getScrollPosition=function(){return o.contentContainer?o.contentContainer.scrollTop:0},o.syncScrollSticky=function(e){e&&o.contentContainer&&e.syncScroll(o.contentContainer)},o._getScrollablePaneContext=function(){return{scrollablePane:{subscribe:o.subscribe,unsubscribe:o.unsubscribe,addSticky:o.addSticky,removeSticky:o.removeSticky,updateStickyRefHeights:o.updateStickyRefHeights,sortSticky:o.sortSticky,notifySubscribers:o.notifySubscribers,syncScrollSticky:o.syncScrollSticky}}},o._addToStickyContainer=function(e,t,n){if(t.children.length){if(!t.contains(n)){var r=[].slice.call(t.children),i=[];o._stickies.forEach((function(n){(t===o.stickyAbove&&e.canStickyTop||e.canStickyBottom)&&i.push(n)}));for(var a=void 0,s=0,l=i.sort((function(e,t){return(e.state.distanceFromTop||0)-(t.state.distanceFromTop||0)})).filter((function(e){var n=t===o.stickyAbove?e.stickyContentTop:e.stickyContentBottom;return!!n&&r.indexOf(n)>-1}));s<l.length;s++){var c=l[s];if((c.state.distanceFromTop||0)>=(e.state.distanceFromTop||0)){a=c;break}}var u=null;a&&(u=t===o.stickyAbove?a.stickyContentTop:a.stickyContentBottom),t.insertBefore(n,u)}}else t.appendChild(n)},o._removeStickyFromContainers=function(e){o.stickyAbove&&e.stickyContentTop&&o.stickyAbove.contains(e.stickyContentTop)&&o.stickyAbove.removeChild(e.stickyContentTop),o.stickyBelow&&e.stickyContentBottom&&o.stickyBelow.contains(e.stickyContentBottom)&&o.stickyBelow.removeChild(e.stickyContentBottom)},o._onWindowResize=function(){var e=o._getScrollbarWidth(),t=o._getScrollbarHeight();o.setState({scrollbarWidth:e,scrollbarHeight:t}),o.notifySubscribers()},o._getStickyContainerStyle=function(e,t){return d(d({height:e},jn(o.props.theme)?{right:"0",left:(o.state.scrollbarWidth||o._getScrollbarWidth()||0)+"px"}:{left:"0",right:(o.state.scrollbarWidth||o._getScrollbarWidth()||0)+"px"}),t?{top:"0"}:{bottom:(o.state.scrollbarHeight||o._getScrollbarHeight()||0)+"px"})},o._onScroll=function(){var e=o.contentContainer;e&&o._stickies.forEach((function(t){t.syncScroll(e)})),o._notifyThrottled()},o._subscribers=new Set,o._stickies=new Set,Ui(o),o._async=new Zi(o),o._events=new Os(o),o.state={stickyTopHeight:0,stickyBottomHeight:0,scrollbarWidth:0,scrollbarHeight:0},o._notifyThrottled=o._async.throttle(o.notifySubscribers,50),o}return u(t,e),Object.defineProperty(t.prototype,"root",{get:function(){return this._root.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stickyAbove",{get:function(){return this._stickyAboveRef.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stickyBelow",{get:function(){return this._stickyBelowRef.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentContainer",{get:function(){return this._contentContainer.current},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){var e=this,t=this.props.initialScrollPosition;this._events.on(this.contentContainer,"scroll",this._onScroll),this._events.on(window,"resize",this._onWindowResize),this.contentContainer&&t&&(this.contentContainer.scrollTop=t),this.setStickiesDistanceFromTop(),this._stickies.forEach((function(t){e.sortSticky(t)})),this.notifySubscribers(),"MutationObserver"in window&&(this._mutationObserver=new MutationObserver((function(t){var o=e._getScrollbarHeight();if(o!==e.state.scrollbarHeight&&e.setState({scrollbarHeight:o}),e.notifySubscribers(),t.some(function(e){return null!==this.stickyAbove&&null!==this.stickyBelow&&(this.stickyAbove.contains(e.target)||this.stickyBelow.contains(e.target))}.bind(e)))e.updateStickyRefHeights();else{var n=[];e._stickies.forEach((function(e){e.root&&e.root.contains(t[0].target)&&n.push(e)})),n.length&&n.forEach((function(e){e.forceUpdate()}))}})),this.root&&this._mutationObserver.observe(this.root,{childList:!0,attributes:!0,subtree:!0,characterData:!0}))},t.prototype.componentWillUnmount=function(){this._events.dispose(),this._async.dispose(),this._mutationObserver&&this._mutationObserver.disconnect()},t.prototype.shouldComponentUpdate=function(e,t){return this.props.children!==e.children||this.props.initialScrollPosition!==e.initialScrollPosition||this.props.className!==e.className||this.state.stickyTopHeight!==t.stickyTopHeight||this.state.stickyBottomHeight!==t.stickyBottomHeight||this.state.scrollbarWidth!==t.scrollbarWidth||this.state.scrollbarHeight!==t.scrollbarHeight},t.prototype.componentDidUpdate=function(e,t){var o=this.props.initialScrollPosition;this.contentContainer&&"number"==typeof o&&e.initialScrollPosition!==o&&(this.contentContainer.scrollTop=o),t.stickyTopHeight===this.state.stickyTopHeight&&t.stickyBottomHeight===this.state.stickyBottomHeight||this.notifySubscribers(),this._async.setTimeout(this._onWindowResize,0)},t.prototype.render=function(){var e=this.props,t=e.className,o=e.scrollContainerFocus,n=e.scrollContainerAriaLabel,r=e.theme,i=e.styles,a=this.state,s=a.stickyTopHeight,l=a.stickyBottomHeight,c=Ik(i,{theme:r,className:t,scrollbarVisibility:this.props.scrollbarVisibility}),u=o?{role:"group",tabIndex:0,"aria-label":n}:{};return f.createElement("div",d({},Tr(this.props,Dr),{ref:this._root,className:c.root}),f.createElement("div",{ref:this._stickyAboveRef,className:c.stickyAbove,style:this._getStickyContainerStyle(s,!0)}),f.createElement("div",d({ref:this._contentContainer},u,{className:c.contentContainer,"data-is-scrollable":!0}),f.createElement(wk.Provider,{value:this._getScrollablePaneContext()},this.props.children)),f.createElement("div",{className:c.stickyBelow,style:this._getStickyContainerStyle(l,!1)},f.createElement("div",{ref:this._stickyBelowRef,className:c.stickyBelowItems})))},t.prototype.setStickiesDistanceFromTop=function(){var e=this;this.contentContainer&&this._stickies.forEach((function(t){t.setDistanceFromTop(e.contentContainer)}))},t.prototype.forceLayoutUpdate=function(){this._onWindowResize()},t.prototype._checkStickyStatus=function(e){this.stickyAbove&&this.stickyBelow&&this.contentContainer&&e.nonStickyContent&&(e.state.isStickyTop||e.state.isStickyBottom?(e.state.isStickyTop&&!this.stickyAbove.contains(e.nonStickyContent)&&e.stickyContentTop&&e.addSticky(e.stickyContentTop),e.state.isStickyBottom&&!this.stickyBelow.contains(e.nonStickyContent)&&e.stickyContentBottom&&e.addSticky(e.stickyContentBottom)):this.contentContainer.contains(e.nonStickyContent)||e.resetSticky())},t.prototype._getScrollbarWidth=function(){var e=this.contentContainer;return e?e.offsetWidth-e.clientWidth:0},t.prototype._getScrollbarHeight=function(){var e=this.contentContainer;return e?e.offsetHeight-e.clientHeight:0},t}(f.Component),Tk=Vn(Dk,(function(e){var t,o,n=e.className,r=e.theme,i=Qo(xk,r),a={position:"absolute",pointerEvents:"none"},s={position:"absolute",top:0,right:0,bottom:0,left:0,WebkitOverflowScrolling:"touch"};return{root:[i.root,r.fonts.medium,s,n],contentContainer:[i.contentContainer,{overflowY:"always"===e.scrollbarVisibility?"scroll":"auto"},s],stickyAbove:[{top:0,zIndex:1,selectors:(t={},t[ro]={borderBottom:"1px solid WindowText"},t)},a],stickyBelow:[{bottom:0,selectors:(o={},o[ro]={borderTop:"1px solid WindowText"},o)},a],stickyBelowItems:[{bottom:0},a,{width:"100%"}]}}),void 0,{scope:"ScrollablePane"}),Ek="SearchBox",Pk={root:{height:"auto"},icon:{fontSize:"12px"}},Mk={iconName:"Clear"},Rk={ariaLabel:"Clear text"},Nk=Jn(),Bk=f.forwardRef((function(e,t){var o=e.ariaLabel,n=e.className,r=e.defaultValue,i=void 0===r?"":r,a=e.disabled,s=e.underlined,l=e.styles,c=e.labelText,u=e.placeholder,p=void 0===u?c:u,h=e.theme,m=e.clearButtonProps,g=void 0===m?Rk:m,v=e.disableAnimation,b=void 0!==v&&v,y=e.showIcon,_=void 0!==y&&y,C=e.onClear,S=e.onBlur,x=e.onEscape,k=e.onSearch,w=e.onKeyDown,I=e.iconProps,D=e.role,T=e.onChange,E=e.onChanged,P=f.useState(!1),M=P[0],R=P[1],N=gh(e.value,i,f.useCallback((function(e){null==T||T(e,null==e?void 0:e.target.value),null==E||E(null==e?void 0:e.target.value)}),[T,E])),B=N[0],F=N[1],A=String(B),L=f.useRef(null),H=f.useRef(null),O=Or(L,t),z=Kd(Ek,e.id),W=g.onClick,V=Nk(l,{theme:h,className:n,underlined:s,hasFocus:M,disabled:a,hasInput:A.length>0,disableAnimation:b,showIcon:_}),K=Tr(e,hr,["className","placeholder","onFocus","onBlur","value","role"]),U=f.useCallback((function(e){var t;null==C||C(e),e.defaultPrevented||(F(""),null===(t=H.current)||void 0===t||t.focus(),e.stopPropagation(),e.preventDefault())}),[C,F]),G=f.useCallback((function(e){null==W||W(e),e.defaultPrevented||U(e)}),[W,U]),j=f.useCallback((function(e){R(!1),null==S||S(e)}),[S]),q=function(e){F(e.target.value,e)};return function(e){Mi({name:Ek,props:e,deprecations:{labelText:"placeholder"}})}(e),function(e,t,o){f.useImperativeHandle(e,(function(){return{focus:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.focus()},hasFocus:function(){return o}}}),[t,o])}(e.componentRef,H,M),f.createElement("div",{role:D,ref:O,className:V.root,onFocusCapture:function(t){var o;R(!0),null===(o=e.onFocus)||void 0===o||o.call(e,t)}},f.createElement("div",{className:V.iconContainer,onClick:function(){H.current&&(H.current.focus(),H.current.selectionStart=H.current.selectionEnd=0)},"aria-hidden":!0},f.createElement(ii,d({iconName:"Search"},I,{className:V.icon}))),f.createElement("input",d({},K,{id:z,className:V.field,placeholder:p,onChange:q,onInput:q,onBlur:j,onKeyDown:function(e){switch(e.which){case Un.escape:null==x||x(e),A&&!e.defaultPrevented&&U(e);break;case Un.enter:k&&(k(A),e.preventDefault(),e.stopPropagation());break;default:null==w||w(e),e.defaultPrevented&&e.stopPropagation()}},value:A,disabled:a,role:"searchbox","aria-label":o,ref:H})),A.length>0&&f.createElement("div",{className:V.clearButton},f.createElement(Zu,d({onBlur:j,styles:Pk,iconProps:Mk},g,{onClick:G}))))}));Bk.displayName=Ek;var Fk={root:"ms-SearchBox",iconContainer:"ms-SearchBox-iconContainer",icon:"ms-SearchBox-icon",clearButton:"ms-SearchBox-clearButton",field:"ms-SearchBox-field"},Ak=Vn(Bk,(function(e){var t,o,n,r,i,a=e.theme,s=e.underlined,l=e.disabled,c=e.hasFocus,u=e.className,d=e.hasInput,p=e.disableAnimation,h=e.showIcon,m=a.palette,g=a.fonts,f=a.semanticColors,v=a.effects,b=Qo(Fk,a),y={color:f.inputPlaceholderText,opacity:1},_=m.neutralSecondary,C=m.neutralPrimary,S=m.neutralLighter,x=m.neutralLighter,k=m.neutralLighter;return{root:[b.root,g.medium,on,{color:f.inputText,backgroundColor:f.inputBackground,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"stretch",padding:"1px 0 1px 4px",borderRadius:v.roundedCorner2,border:"1px solid "+f.inputBorder,height:32,selectors:(t={},t[ro]={borderColor:"WindowText"},t[":hover"]={borderColor:f.inputBorderHovered,selectors:(o={},o[ro]={borderColor:"Highlight"},o)},t[":hover ."+b.iconContainer]={color:f.inputIconHovered},t)},!c&&d&&{selectors:(n={},n[":hover ."+b.iconContainer]={width:4},n[":hover ."+b.icon]={opacity:0},n)},c&&["is-active",{position:"relative"},Mo(f.inputFocusBorderAlt,s?0:v.roundedCorner2,s?"borderBottom":"border")],h&&[{selectors:(r={},r[":hover ."+b.iconContainer]={width:32},r[":hover ."+b.icon]={opacity:1},r)}],l&&["is-disabled",{borderColor:S,backgroundColor:k,pointerEvents:"none",cursor:"default",selectors:(i={},i[ro]={borderColor:"GrayText"},i)}],s&&["is-underlined",{borderWidth:"0 0 1px 0",borderRadius:0,padding:"1px 0 1px 8px"}],s&&l&&{backgroundColor:"transparent"},d&&"can-clear",u],iconContainer:[b.iconContainer,{display:"flex",flexDirection:"column",justifyContent:"center",flexShrink:0,fontSize:16,width:32,textAlign:"center",color:f.inputIcon,cursor:"text"},c&&{width:4},l&&{color:f.inputIconDisabled},!p&&{transition:"width "+Le.durationValue1},h&&c&&{width:32}],icon:[b.icon,{opacity:1},c&&{opacity:0},!p&&{transition:"opacity "+Le.durationValue1+" 0s"},h&&c&&{opacity:1}],clearButton:[b.clearButton,{display:"flex",flexDirection:"row",alignItems:"stretch",cursor:"pointer",flexBasis:"32px",flexShrink:0,padding:0,margin:"-1px 0px",selectors:{"&:hover .ms-Button":{backgroundColor:x},"&:hover .ms-Button-icon":{color:C},".ms-Button":{borderRadius:jn(a)?"1px 0 0 1px":"0 1px 1px 0"},".ms-Button-icon":{color:_}}}],field:[b.field,on,sn(y),{backgroundColor:"transparent",border:"none",outline:"none",fontWeight:"inherit",fontFamily:"inherit",fontSize:"inherit",color:f.inputText,flex:"1 1 0px",minWidth:"0px",overflow:"hidden",textOverflow:"ellipsis",paddingBottom:.5,selectors:{"::-ms-clear":{display:"none"}}},l&&{color:f.disabledText}]}}),void 0,{scope:"SearchBox"}),Lk=function(e){function t(t){var o=e.call(this,t)||this;o.addItems=function(e){var t=o.props.onItemSelected?o.props.onItemSelected(e):e,n=t,r=t;if(r&&r.then)r.then((function(e){var t=o.state.items.concat(e);o.updateItems(t)}));else{var i=o.state.items.concat(n);o.updateItems(i)}},o.removeItemAt=function(e){var t=o.state.items;if(o._canRemoveItem(t[e])&&e>-1){o.props.onItemsDeleted&&o.props.onItemsDeleted([t[e]]);var n=t.slice(0,e).concat(t.slice(e+1));o.updateItems(n)}},o.removeItem=function(e){var t=o.state.items.indexOf(e);o.removeItemAt(t)},o.replaceItem=function(e,t){var n=o.state.items,r=n.indexOf(e);if(r>-1){var i=n.slice(0,r).concat(t).concat(n.slice(r+1));o.updateItems(i)}},o.removeItems=function(e){var t=o.state.items,n=e.filter((function(e){return o._canRemoveItem(e)})),r=t.filter((function(e){return-1===n.indexOf(e)})),i=n[0],a=t.indexOf(i);o.props.onItemsDeleted&&o.props.onItemsDeleted(n),o.updateItems(r,a)},o.onCopy=function(e){if(o.props.onCopyItems&&o.selection.getSelectedCount()>0){var t=o.selection.getSelection();o.copyItems(t)}},o.renderItems=function(){var e=o.props.removeButtonAriaLabel,t=o.props.onRenderItem;return o.state.items.map((function(n,r){return t({item:n,index:r,key:n.key?n.key:r,selected:o.selection.isIndexSelected(r),onRemoveItem:function(){return o.removeItem(n)},onItemChange:o.onItemChange,removeButtonAriaLabel:e,onCopyItem:function(e){return o.copyItems([e])}})}))},o.onSelectionChanged=function(){o.forceUpdate()},o.onItemChange=function(e,t){var n=o.state.items;if(t>=0){var r=n;r[t]=e,o.updateItems(r)}},Ui(o);var n=t.selectedItems||t.defaultSelectedItems||[];return o.state={items:n},o._defaultSelection=new Yf({onSelectionChanged:o.onSelectionChanged}),o}return u(t,e),t.getDerivedStateFromProps=function(e){return e.selectedItems?{items:e.selectedItems}:null},Object.defineProperty(t.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),t.prototype.removeSelectedItems=function(){this.state.items.length&&this.selection.getSelectedCount()>0&&this.removeItems(this.selection.getSelection())},t.prototype.updateItems=function(e,t){var o=this;this.props.selectedItems?this.onChange(e):this.setState({items:e},(function(){o._onSelectedItemsUpdated(e,t)}))},t.prototype.hasSelectedItems=function(){return this.selection.getSelectedCount()>0},t.prototype.componentDidUpdate=function(e,t){this.state.items&&this.state.items!==t.items&&this.selection.setItems(this.state.items)},t.prototype.unselectAll=function(){this.selection.setAllSelected(!1)},t.prototype.highlightedItems=function(){return this.selection.getSelection()},t.prototype.componentDidMount=function(){this.selection.setItems(this.state.items)},Object.defineProperty(t.prototype,"selection",{get:function(){var e;return null!==(e=this.props.selection)&&void 0!==e?e:this._defaultSelection},enumerable:!1,configurable:!0}),t.prototype.render=function(){return this.renderItems()},t.prototype.onChange=function(e){this.props.onChange&&this.props.onChange(e)},t.prototype.copyItems=function(e){if(this.props.onCopyItems){var t=this.props.onCopyItems(e),o=document.createElement("input");document.body.appendChild(o);try{if(o.value=t,o.select(),!document.execCommand("copy"))throw new Error}catch(e){}finally{document.body.removeChild(o)}}},t.prototype._onSelectedItemsUpdated=function(e,t){this.onChange(e)},t.prototype._canRemoveItem=function(e){return!this.props.canRemoveItem||this.props.canRemoveItem(e)},t}(f.Component);Ft([{rawString:".personaContainer_d5ae1779{border-radius:15px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:"},{theme:"themeLighterAlt",defaultValue:"#eff6fc"},{rawString:";margin:4px;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;position:relative}.personaContainer_d5ae1779::-moz-focus-inner{border:0}.personaContainer_d5ae1779{outline:transparent}.personaContainer_d5ae1779{position:relative}.ms-Fabric--isFocusVisible .personaContainer_d5ae1779:focus:after{-webkit-box-sizing:border-box;box-sizing:border-box;content:'';position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;pointer-events:none;border:1px solid "},{theme:"focusBorder",defaultValue:"#605e5c"},{rawString:";border-radius:0}.personaContainer_d5ae1779 .ms-Persona-primaryText{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:";font-size:14px;font-weight:400}.personaContainer_d5ae1779 .ms-Persona-primaryText.hover_d5ae1779{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779 .ms-Persona-primaryText{color:HighlightText}}.personaContainer_d5ae1779 .actionButton_d5ae1779:hover{background:"},{theme:"themeLight",defaultValue:"#c7e0f4"},{rawString:"}.personaContainer_d5ae1779 .actionButton_d5ae1779 .ms-Button-icon{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779 .actionButton_d5ae1779 .ms-Button-icon{color:HighlightText}}.personaContainer_d5ae1779:hover{background:"},{theme:"themeLighter",defaultValue:"#deecf9"},{rawString:"}.personaContainer_d5ae1779:hover .ms-Persona-primaryText{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:";font-size:14px;font-weight:400}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779:hover .ms-Persona-primaryText{color:HighlightText}}.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779{background:"},{theme:"themePrimary",defaultValue:"#0078d4"},{rawString:"}.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779 .ms-Persona-primaryText{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779 .ms-Persona-primaryText{color:HighlightText}}.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779 .actionButton_d5ae1779{color:"},{theme:"white",defaultValue:"#ffffff"},{rawString:"}.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779 .actionButton_d5ae1779 .ms-Button-icon{color:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779 .actionButton_d5ae1779 .ms-Button-icon:hover{background:"},{theme:"themeDark",defaultValue:"#005a9e"},{rawString:"}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779 .actionButton_d5ae1779 .ms-Button-icon{color:HighlightText}}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779.personaContainerIsSelected_d5ae1779{border-color:Highlight;background:Highlight;-ms-high-contrast-adjust:none}}.personaContainer_d5ae1779.validationError_d5ae1779 .ms-Persona-primaryText{color:"},{theme:"red",defaultValue:"#e81123"},{rawString:"}.personaContainer_d5ae1779.validationError_d5ae1779 .ms-Persona-initials{font-size:20px}@media screen and (-ms-high-contrast:active){.personaContainer_d5ae1779{border:1px solid WindowText}}.personaContainer_d5ae1779 .itemContent_d5ae1779{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;min-width:0;max-width:100%}.personaContainer_d5ae1779 .removeButton_d5ae1779{border-radius:15px;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:33px;height:33px;-ms-flex-preferred-size:32px;flex-basis:32px}.personaContainer_d5ae1779 .expandButton_d5ae1779{border-radius:15px 0 0 15px;height:33px;width:44px;padding-right:16px;position:inherit;display:-webkit-box;display:-ms-flexbox;display:flex;margin-right:-17px}.personaContainer_d5ae1779 .personaWrapper_d5ae1779{position:relative;display:inherit}.personaContainer_d5ae1779 .personaWrapper_d5ae1779 .ms-Persona-details{padding:0 8px}.personaContainer_d5ae1779 .personaDetails_d5ae1779{-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.itemContainer_d5ae1779{display:inline-block;vertical-align:top}"}]);var Hk="personaContainer_d5ae1779",Ok="hover_d5ae1779",zk="actionButton_d5ae1779",Wk="personaContainerIsSelected_d5ae1779",Vk="validationError_d5ae1779",Kk="itemContent_d5ae1779",Uk="removeButton_d5ae1779",Gk="expandButton_d5ae1779",jk="personaWrapper_d5ae1779",qk="personaDetails_d5ae1779",Yk="itemContainer_d5ae1779",Zk=l,Xk=function(e){function t(t){var o=e.call(this,t)||this;return o.persona=f.createRef(),Ui(o),o.state={contextualMenuVisible:!1},o}return u(t,e),t.prototype.render=function(){var e,t,o=this.props,n=o.item,r=o.onExpandItem,i=o.onRemoveItem,a=o.removeButtonAriaLabel,s=o.index,l=o.selected,c=Va();return f.createElement("div",{ref:this.persona,className:qr("ms-PickerPersona-container",Zk.personaContainer,(e={},e["is-selected "+Zk.personaContainerIsSelected]=l,e),(t={},t["is-invalid "+Zk.validationError]=!n.isValid,t)),"data-is-focusable":!0,"data-is-sub-focuszone":!0,"data-selection-index":s,role:"listitem","aria-labelledby":"selectedItemPersona-"+c},f.createElement("div",{hidden:!n.canExpand||void 0===r},f.createElement(Zu,{onClick:this._onClickIconButton(r),iconProps:{iconName:"Add",style:{fontSize:"14px"}},className:qr("ms-PickerItem-removeButton",Zk.expandButton,Zk.actionButton),ariaLabel:a})),f.createElement("div",{className:qr(Zk.personaWrapper)},f.createElement("div",{className:qr("ms-PickerItem-content",Zk.itemContent),id:"selectedItemPersona-"+c},f.createElement(A_,d({},n,{onRenderCoin:this.props.renderPersonaCoin,onRenderPrimaryText:this.props.renderPrimaryText,size:Yr.size32}))),f.createElement(Zu,{onClick:this._onClickIconButton(i),iconProps:{iconName:"Cancel",style:{fontSize:"14px"}},className:qr("ms-PickerItem-removeButton",Zk.removeButton,Zk.actionButton),ariaLabel:a})))},t.prototype._onClickIconButton=function(e){return function(t){t.stopPropagation(),t.preventDefault(),e&&e()}},t}(f.Component),Qk=function(e){function t(t){var o=e.call(this,t)||this;return o.itemElement=f.createRef(),o._onClick=function(e){e.preventDefault(),o.props.beginEditing&&!o.props.item.isValid?o.props.beginEditing(o.props.item):o.setState({contextualMenuVisible:!0})},o._onCloseContextualMenu=function(e){o.setState({contextualMenuVisible:!1})},Ui(o),o.state={contextualMenuVisible:!1},o}return u(t,e),t.prototype.render=function(){return f.createElement("div",{ref:this.itemElement,onContextMenu:this._onClick},this.props.renderedItem,this.state.contextualMenuVisible?f.createElement(Au,{items:this.props.menuItems,shouldFocusOnMount:!0,target:this.itemElement.current,onDismiss:this._onCloseContextualMenu,directionalHint:qs.bottomLeftEdge}):null)},t}(f.Component),Jk={root:"ms-EditingItem",input:"ms-EditingItem-input"},$k=function(e){var t=Qt();if(!t)throw new Error("theme is undefined or null in Editing item getStyles function.");var o=t.semanticColors,n=Qo(Jk,t);return{root:[n.root,{margin:"4px"}],input:[n.input,{border:"0px",outline:"none",width:"100%",backgroundColor:o.inputBackground,color:o.inputText,selectors:{"::-ms-clear":{display:"none"}}}]}},ew=function(e){function t(t){var o=e.call(this,t)||this;return o._editingFloatingPicker=f.createRef(),o._renderEditingSuggestions=function(){var e=o.props.onRenderFloatingPicker,t=o.props.floatingPickerProps;return e&&t?f.createElement(e,d({componentRef:o._editingFloatingPicker,onChange:o._onSuggestionSelected,inputElement:o._editingInput,selectedItems:[]},t)):f.createElement(f.Fragment,null)},o._resolveInputRef=function(e){o._editingInput=e,o.forceUpdate((function(){o._editingInput.focus()}))},o._onInputClick=function(){o._editingFloatingPicker.current&&o._editingFloatingPicker.current.showPicker(!0)},o._onInputBlur=function(e){if(o._editingFloatingPicker.current&&null!==e.relatedTarget){var t=e.relatedTarget;-1===t.className.indexOf("ms-Suggestions-itemButton")&&-1===t.className.indexOf("ms-Suggestions-sectionButton")&&o._editingFloatingPicker.current.forceResolveSuggestion()}},o._onInputChange=function(e){var t=e.target.value;""===t?o.props.onRemoveItem&&o.props.onRemoveItem():o._editingFloatingPicker.current&&o._editingFloatingPicker.current.onQueryStringChanged(t)},o._onSuggestionSelected=function(e){o.props.onEditingComplete(o.props.item,e)},Ui(o),o.state={contextualMenuVisible:!1},o}return u(t,e),t.prototype.componentDidMount=function(){var e=(0,this.props.getEditingItemText)(this.props.item);this._editingFloatingPicker.current&&this._editingFloatingPicker.current.onQueryStringChanged(e),this._editingInput.value=e,this._editingInput.focus()},t.prototype.render=function(){var e=Va(),t=Tr(this.props,hr),o=Jn()($k);return f.createElement("div",{"aria-labelledby":"editingItemPersona-"+e,className:o.root},f.createElement("input",d({autoCapitalize:"off",autoComplete:"off"},t,{ref:this._resolveInputRef,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onBlur:this._onInputBlur,onClick:this._onInputClick,"data-lpignore":!0,className:o.input,id:e})),this._renderEditingSuggestions())},t.prototype._onInputKeyDown=function(e){e.which!==Un.backspace&&e.which!==Un.del||e.stopPropagation()},t}(f.Component),tw=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(Lk),ow=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.renderItems=function(){return t.state.items.map((function(e,o){return t._renderItem(e,o)}))},t._beginEditing=function(e){e.isEditing=!0,t.forceUpdate()},t._completeEditing=function(e,o){e.isEditing=!1,t.replaceItem(e,o)},t}return u(t,e),t.prototype._renderItem=function(e,t){var o=this,n=this.props.removeButtonAriaLabel,r=this.props.onExpandGroup,i={item:e,index:t,key:e.key?e.key:t,selected:this.selection.isIndexSelected(t),onRemoveItem:function(){return o.removeItem(e)},onItemChange:this.onItemChange,removeButtonAriaLabel:n,onCopyItem:function(e){return o.copyItems([e])},onExpandItem:r?function(){return r(e)}:void 0,menuItems:this._createMenuItems(e)},a=i.menuItems.length>0;if(e.isEditing&&a)return f.createElement(ew,d({},i,{onRenderFloatingPicker:this.props.onRenderFloatingPicker,floatingPickerProps:this.props.floatingPickerProps,onEditingComplete:this._completeEditing,getEditingItemText:this.props.getEditingItemText}));var s=(0,this.props.onRenderItem)(i);return a?f.createElement(Qk,{key:i.key,renderedItem:s,beginEditing:this._beginEditing,menuItems:this._createMenuItems(i.item),item:i.item}):s},t.prototype._createMenuItems=function(e){var t=this,o=[];return this.props.editMenuItemText&&this.props.getEditingItemText&&o.push({key:"Edit",text:this.props.editMenuItemText,onClick:function(e,o){t._beginEditing(o.data)},data:e}),this.props.removeMenuItemText&&o.push({key:"Remove",text:this.props.removeMenuItemText,onClick:function(e,o){t.removeItem(o.data)},data:e}),this.props.copyMenuItemText&&o.push({key:"Copy",text:this.props.copyMenuItemText,onClick:function(e,o){t.props.onCopyItems&&t.copyItems([o.data])},data:e}),o},t.defaultProps={onRenderItem:function(e){return f.createElement(Xk,d({},e))}},t}(tw),nw=Jn(),rw=f.forwardRef((function(e,t){var o=e.styles,n=e.theme,r=e.className,i=e.vertical,a=e.alignContent,s=e.children,l=nw(o,{theme:n,className:r,alignContent:a,vertical:i});return f.createElement("div",{className:l.root,ref:t},f.createElement("div",{className:l.content,role:"separator","aria-orientation":i?"vertical":"horizontal"},s))})),iw=Vn(rw,(function(e){var t,o,n=e.theme,r=e.alignContent,i=e.vertical,a=e.className,s="start"===r,l="center"===r,c="end"===r;return{root:[n.fonts.medium,{position:"relative"},r&&{textAlign:r},!r&&{textAlign:"center"},i&&(l||!r)&&{verticalAlign:"middle"},i&&s&&{verticalAlign:"top"},i&&c&&{verticalAlign:"bottom"},i&&{padding:"0 4px",height:"inherit",display:"table-cell",zIndex:1,selectors:{":after":(t={backgroundColor:n.palette.neutralLighter,width:"1px",content:'""',position:"absolute",top:"0",bottom:"0",left:"50%",right:"0",zIndex:-1},t[ro]={backgroundColor:"WindowText"},t)}},!i&&{padding:"4px 0",selectors:{":before":(o={backgroundColor:n.palette.neutralLighter,height:"1px",content:'""',display:"block",position:"absolute",top:"50%",bottom:"0",left:"0",right:"0"},o[ro]={backgroundColor:"WindowText"},o)}},a],content:[{position:"relative",display:"inline-block",padding:"0 12px",color:n.semanticColors.bodyText,background:n.semanticColors.bodyBackground},i&&{padding:"12px 0"}]}}),void 0,{scope:"Separator"});iw.displayName="Separator";var aw,sw,lw={root:"ms-Shimmer-container",shimmerWrapper:"ms-Shimmer-shimmerWrapper",shimmerGradient:"ms-Shimmer-shimmerGradient",dataWrapper:"ms-Shimmer-dataWrapper"},cw=jo((function(){return J({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}})})),uw=jo((function(){return J({"100%":{transform:"translateX(-100%)"},"0%":{transform:"translateX(100%)"}})}));!function(e){e[e.line=1]="line",e[e.circle=2]="circle",e[e.gap=3]="gap"}(aw||(aw={})),function(e){e[e.line=16]="line",e[e.gap=16]="gap",e[e.circle=24]="circle"}(sw||(sw={}));var dw=Jn(),pw=function(e){var t=e.height,o=e.styles,n=e.width,r=void 0===n?"100%":n,i=e.borderStyle,a=e.theme,s=dw(o,{theme:a,height:t,borderStyle:i});return f.createElement("div",{style:{width:r,minWidth:"number"==typeof r?r+"px":"auto"},className:s.root},f.createElement("svg",{width:"2",height:"2",className:s.topLeftCorner},f.createElement("path",{d:"M0 2 A 2 2, 0, 0, 1, 2 0 L 0 0 Z"})),f.createElement("svg",{width:"2",height:"2",className:s.topRightCorner},f.createElement("path",{d:"M0 0 A 2 2, 0, 0, 1, 2 2 L 2 0 Z"})),f.createElement("svg",{width:"2",height:"2",className:s.bottomRightCorner},f.createElement("path",{d:"M2 0 A 2 2, 0, 0, 1, 0 2 L 2 2 Z"})),f.createElement("svg",{width:"2",height:"2",className:s.bottomLeftCorner},f.createElement("path",{d:"M2 2 A 2 2, 0, 0, 1, 0 0 L 0 2 Z"})))},hw={root:"ms-ShimmerLine-root",topLeftCorner:"ms-ShimmerLine-topLeftCorner",topRightCorner:"ms-ShimmerLine-topRightCorner",bottomLeftCorner:"ms-ShimmerLine-bottomLeftCorner",bottomRightCorner:"ms-ShimmerLine-bottomRightCorner"},mw=Vn(pw,(function(e){var t,o=e.height,n=e.borderStyle,r=e.theme,i=r.semanticColors,a=Qo(hw,r),s=n||{},l={position:"absolute",fill:i.bodyBackground};return{root:[a.root,r.fonts.medium,{height:o+"px",boxSizing:"content-box",position:"relative",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:i.bodyBackground,borderWidth:0,selectors:(t={},t[ro]={borderColor:"Window",selectors:{"> *":{fill:"Window"}}},t)},s],topLeftCorner:[a.topLeftCorner,{top:"0",left:"0"},l],topRightCorner:[a.topRightCorner,{top:"0",right:"0"},l],bottomRightCorner:[a.bottomRightCorner,{bottom:"0",right:"0"},l],bottomLeftCorner:[a.bottomLeftCorner,{bottom:"0",left:"0"},l]}}),void 0,{scope:"ShimmerLine"}),gw=Jn(),fw=function(e){var t=e.height,o=e.styles,n=e.width,r=void 0===n?"10px":n,i=e.borderStyle,a=e.theme,s=gw(o,{theme:a,height:t,borderStyle:i});return f.createElement("div",{style:{width:r,minWidth:"number"==typeof r?r+"px":"auto"},className:s.root})},vw={root:"ms-ShimmerGap-root"},bw=Vn(fw,(function(e){var t,o=e.height,n=e.borderStyle,r=e.theme,i=r.semanticColors,a=n||{};return{root:[Qo(vw,r).root,r.fonts.medium,{backgroundColor:i.bodyBackground,height:o+"px",boxSizing:"content-box",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:i.bodyBackground,selectors:(t={},t[ro]={backgroundColor:"Window",borderColor:"Window"},t)},a]}}),void 0,{scope:"ShimmerGap"}),yw={root:"ms-ShimmerCircle-root",svg:"ms-ShimmerCircle-svg"},_w=Jn(),Cw=function(e){var t=e.height,o=e.styles,n=e.borderStyle,r=e.theme,i=_w(o,{theme:r,height:t,borderStyle:n});return f.createElement("div",{className:i.root},f.createElement("svg",{viewBox:"0 0 10 10",width:t,height:t,className:i.svg},f.createElement("path",{d:"M0,0 L10,0 L10,10 L0,10 L0,0 Z M0,5 C0,7.76142375 2.23857625,10 5,10 C7.76142375,10 10,7.76142375 10,5 C10,2.23857625 7.76142375,2.22044605e-16 5,0 C2.23857625,-2.22044605e-16 0,2.23857625 0,5 L0,5 Z"})))},Sw=Vn(Cw,(function(e){var t,o,n=e.height,r=e.borderStyle,i=e.theme,a=i.semanticColors,s=Qo(yw,i),l=r||{};return{root:[s.root,i.fonts.medium,{width:n+"px",height:n+"px",minWidth:n+"px",boxSizing:"content-box",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:a.bodyBackground,selectors:(t={},t[ro]={borderColor:"Window"},t)},l],svg:[s.svg,{display:"block",fill:a.bodyBackground,selectors:(o={},o[ro]={fill:"Window"},o)}]}}),void 0,{scope:"ShimmerCircle"}),xw=Jn(),kw=function(e){var t=e.styles,o=e.width,n=void 0===o?"auto":o,r=e.shimmerElements,i=e.rowHeight,a=void 0===i?function(e){return e.map((function(e){switch(e.type){case aw.circle:e.height||(e.height=sw.circle);break;case aw.line:e.height||(e.height=sw.line);break;case aw.gap:e.height||(e.height=sw.gap)}return e})).reduce((function(e,t){return t.height&&t.height>e?t.height:e}),0)}(r||[]):i,s=e.flexWrap,l=void 0!==s&&s,c=e.theme,u=e.backgroundColor,h=xw(t,{theme:c,flexWrap:l});return f.createElement("div",{style:{width:n},className:h.root},function(e,t,o){return e?e.map((function(e,n){var r=e.type,i=p(e,["type"]),a=i.verticalAlign,s=i.height,l=ww(a,r,s,t,o);switch(e.type){case aw.circle:return f.createElement(Sw,d({key:n},i,{styles:l}));case aw.gap:return f.createElement(bw,d({key:n},i,{styles:l}));case aw.line:return f.createElement(mw,d({key:n},i,{styles:l}))}})):f.createElement(mw,{height:sw.line})}(r,u,a))},ww=jo((function(e,t,o,n,r){var i,a=r&&o?r-o:0;if(e&&"center"!==e?e&&"top"===e?i={borderBottomWidth:a+"px",borderTopWidth:"0px"}:e&&"bottom"===e&&(i={borderBottomWidth:"0px",borderTopWidth:a+"px"}):i={borderBottomWidth:(a?Math.floor(a/2):0)+"px",borderTopWidth:(a?Math.ceil(a/2):0)+"px"},n)switch(t){case aw.circle:return{root:d(d({},i),{borderColor:n}),svg:{fill:n}};case aw.gap:return{root:d(d({},i),{borderColor:n,backgroundColor:n})};case aw.line:return{root:d(d({},i),{borderColor:n}),topLeftCorner:{fill:n},topRightCorner:{fill:n},bottomLeftCorner:{fill:n},bottomRightCorner:{fill:n}}}return{root:i}})),Iw={root:"ms-ShimmerElementsGroup-root"},Dw=Vn(kw,(function(e){var t=e.flexWrap,o=e.theme;return{root:[Qo(Iw,o).root,o.fonts.medium,{display:"flex",alignItems:"center",flexWrap:t?"wrap":"nowrap",position:"relative"}]}}),void 0,{scope:"ShimmerElementsGroup"}),Tw=Jn(),Ew=f.forwardRef((function(e,t){var o=e.styles,n=e.shimmerElements,r=e.children,i=e.width,a=e.className,s=e.customElementsGroup,l=e.theme,c=e.ariaLabel,u=e.shimmerColors,p=e.isDataLoaded,h=void 0!==p&&p,m=Tr(e,Dr),g=Tw(o,{theme:l,isDataLoaded:h,className:a,transitionAnimationInterval:200,shimmerColor:u&&u.shimmer,shimmerWaveColor:u&&u.shimmerWave}),v=Ei({lastTimeoutId:0}),b=fm(),y=b.setTimeout,_=b.clearTimeout,C=f.useState(h),S=C[0],x=C[1],k={width:i||"100%"};return f.useEffect((function(){if(h!==S){if(h)return v.lastTimeoutId=y((function(){x(!0)}),200),function(){return _(v.lastTimeoutId)};x(!1)}}),[h]),f.createElement("div",d({},m,{className:g.root,ref:t}),!S&&f.createElement("div",{style:k,className:g.shimmerWrapper},f.createElement("div",{className:g.shimmerGradient}),s||f.createElement(Dw,{shimmerElements:n,backgroundColor:u&&u.background})),r&&f.createElement("div",{className:g.dataWrapper},r),c&&!h&&f.createElement("div",{role:"status","aria-live":"polite"},f.createElement(ea,null,f.createElement("div",{className:g.screenReaderText},c))))}));Ew.displayName="Shimmer";var Pw=Vn(Ew,(function(e){var t,o=e.isDataLoaded,n=e.className,r=e.theme,i=e.transitionAnimationInterval,a=e.shimmerColor,s=e.shimmerWaveColor,l=r.semanticColors,c=Qo(lw,r),u=jn(r);return{root:[c.root,r.fonts.medium,{position:"relative",height:"auto"},n],shimmerWrapper:[c.shimmerWrapper,{position:"relative",overflow:"hidden",transform:"translateZ(0)",backgroundColor:a||l.disabledBackground,transition:"opacity "+i+"ms",selectors:(t={"> *":{transform:"translateZ(0)"}},t[ro]=d({background:"WindowText\n linear-gradient(\n to right,\n transparent 0%,\n Window 50%,\n transparent 100%)\n 0 0 / 90% 100%\n no-repeat"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),t)},o&&{opacity:"0",position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}],shimmerGradient:[c.shimmerGradient,{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:(a||l.disabledBackground)+"\n linear-gradient(\n to right,\n "+(a||l.disabledBackground)+" 0%,\n "+(s||l.bodyDivider)+" 50%,\n "+(a||l.disabledBackground)+" 100%)\n 0 0 / 90% 100%\n no-repeat",transform:"translateX(-100%)",animationDuration:"2s",animationTimingFunction:"ease-in-out",animationDirection:"normal",animationIterationCount:"infinite",animationName:u?uw():cw()}],dataWrapper:[c.dataWrapper,{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",opacity:"0",background:"none",backgroundColor:"transparent",border:"none",transition:"opacity "+i+"ms"},o&&{opacity:"1",position:"static"}],screenReaderText:Ro}}),void 0,{scope:"Shimmer"}),Mw=Jn(),Rw=function(e){function t(t){var o=e.call(this,t)||this;return o._onRenderShimmerPlaceholder=function(e,t){var n=o.props.onRenderCustomPlaceholder,r=n?n(t,e,o._renderDefaultShimmerPlaceholder):o._renderDefaultShimmerPlaceholder(t);return f.createElement(Pw,{customElementsGroup:r})},o._renderDefaultShimmerPlaceholder=function(e){var t=e.columns,o=e.compact,n=e.selectionMode,r=e.checkboxVisibility,i=e.cellStyleProps,a=void 0===i?dv:i,s=pv.rowHeight,l=pv.compactRowHeight,c=o?l:s+1,u=[];return n!==Kf.none&&r!==tv.hidden&&u.push(f.createElement(Dw,{key:"checkboxGap",shimmerElements:[{type:aw.gap,width:"40px",height:c}]})),t.forEach((function(e,t){var o=[],n=a.cellLeftPadding+a.cellRightPadding+e.calculatedWidth+(e.isPadded?a.cellExtraRightPadding:0);o.push({type:aw.gap,width:a.cellLeftPadding,height:c}),e.isIconOnly?(o.push({type:aw.line,width:e.calculatedWidth,height:e.calculatedWidth}),o.push({type:aw.gap,width:a.cellRightPadding,height:c})):(o.push({type:aw.line,width:.95*e.calculatedWidth,height:7}),o.push({type:aw.gap,width:a.cellRightPadding+(e.calculatedWidth-.95*e.calculatedWidth)+(e.isPadded?a.cellExtraRightPadding:0),height:c})),u.push(f.createElement(Dw,{key:t,width:n+"px",shimmerElements:o}))})),u.push(f.createElement(Dw,{key:"endGap",width:"100%",shimmerElements:[{type:aw.gap,width:"100%",height:c}]})),f.createElement("div",{style:{display:"flex"}},u)},o._shimmerItems=t.shimmerLines?new Array(t.shimmerLines):new Array(10),o}return u(t,e),t.prototype.render=function(){var e=this.props,t=e.detailsListStyles,o=e.enableShimmer,n=e.items,r=e.listProps,i=(e.onRenderCustomPlaceholder,e.removeFadingOverlay),a=(e.shimmerLines,e.styles),s=e.theme,l=e.ariaLabelForGrid,c=e.ariaLabelForShimmer,u=p(e,["detailsListStyles","enableShimmer","items","listProps","onRenderCustomPlaceholder","removeFadingOverlay","shimmerLines","styles","theme","ariaLabelForGrid","ariaLabelForShimmer"]),h=r&&r.className;this._classNames=Mw(a,{theme:s});var m=d(d({},r),{className:o&&!i?qr(this._classNames.root,h):h});return f.createElement(Ib,d({},u,{styles:t,items:o?this._shimmerItems:n,isPlaceholderData:o,ariaLabelForGrid:o&&c||l,onRenderMissingItem:this._onRenderShimmerPlaceholder,listProps:m}))},t}(f.Component),Nw=Vn(Rw,(function(e){var t=e.theme.palette;return{root:{position:"relative",selectors:{":after":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,backgroundImage:"linear-gradient(to bottom, transparent 30%, "+t.whiteTranslucent40+" 65%,"+t.white+" 100%)"}}}}}),void 0,{scope:"ShimmeredDetailsList"}),Bw=Jn(),Fw=function(e){return function(t){var o;return(o={})[e]=t+"%",o}},Aw=function(e,t,o){return o===t?0:(e-t)/(o-t)*100},Lw="SliderBase",Hw=f.forwardRef((function(e,t){var o=function(e,t){var o=e.step,n=void 0===o?1:o,r=e.className,i=e.disabled,a=void 0!==i&&i,s=e.label,l=e.max,c=void 0===l?10:l,u=e.min,p=void 0===u?0:u,h=e.showValue,m=void 0===h||h,g=e.buttonProps,v=void 0===g?{}:g,b=e.vertical,y=void 0!==b&&b,_=e.snapToStep,C=e.valueFormat,S=e.styles,x=e.theme,k=e.originFromZero,w=e["aria-label"],I=e.ranged,D=e.onChange,T=e.onChanged,E=f.useRef([]),P=fm(),M=P.setTimeout,R=P.clearTimeout,N=f.useRef(null),B=gh(e.value,e.defaultValue,(function(e,t){return null==D?void 0:D(t,I?[V.latestLowerValue,t]:void 0,e)})),F=B[0],A=B[1],L=gh(e.lowerValue,e.defaultLowerValue,(function(e,t){return null==D?void 0:D(V.latestValue,[t,V.latestValue],e)})),H=L[0],O=L[1],z=Math.max(p,Math.min(c,F||0)),W=Math.max(p,Math.min(z,H||0)),V=Ei({onKeyDownTimer:-1,isAdjustingLowerValue:!1,latestValue:z,latestLowerValue:W});V.latestValue=z,V.latestLowerValue=W;var K=Kd("Slider",e.id||(null==v?void 0:v.id)),U=Bw(S,{className:r,disabled:a,vertical:y,showTransitions:!_&&!V.isBetweenSteps,showValue:m,ranged:I,theme:x}),G=(c-p)/n,j=function(){R(V.onKeyDownTimer),V.onKeyDownTimer=-1},q=function(e){j(),T&&(V.onKeyDownTimer=M((function(){T(e,V.latestValue,I?[V.latestLowerValue,V.latestValue]:void 0)}),1e3))},Y=function(t){var o=e.ariaValueText;if(void 0!==t)return o?o(t):t.toString()},Z=function(e,t,o){t=Math.min(c,Math.max(p,t)),o=void 0!==o?Math.min(c,Math.max(p,o)):void 0;var r=0;if(isFinite(n))for(;Math.round(n*Math.pow(10,r))/Math.pow(10,r)!==n;)r++;var i=parseFloat(t.toFixed(r));V.isBetweenSteps=void 0!==o&&o!==i,I?V.isAdjustingLowerValue&&(k?i<=0:i<=V.latestValue)?O(i,e):!V.isAdjustingLowerValue&&(k?i>=0:i>=V.latestLowerValue)&&A(i,e):A(i,e)},X=function(e,t){var o=0;switch(e.type){case"mousedown":case"mousemove":o=t?e.clientY:e.clientX;break;case"touchstart":case"touchmove":o=t?e.touches[0].clientY:e.touches[0].clientX}return o},Q=function(t){var o,n=N.current.getBoundingClientRect(),r=(e.vertical?n.height:n.width)/G;if(e.vertical){var i=X(t,e.vertical);o=(n.bottom-i)/r}else{var a=X(t,e.vertical);o=(jn(e.theme)?n.right-a:a-n.left)/r}return o},J=function(e,t){var o=Q(e),r=p+n*o,i=p+n*Math.round(o);Z(e,i,r),t||(e.preventDefault(),e.stopPropagation())},$=function(e){if(I){var t=Q(e),o=p+n*t;V.isAdjustingLowerValue=o<=V.latestLowerValue||o-V.latestLowerValue<=V.latestValue-o}"mousedown"===e.type?E.current.push(ol(window,"mousemove",J,!0),ol(window,"mouseup",ee,!0)):"touchstart"===e.type&&E.current.push(ol(window,"touchmove",J,!0),ol(window,"touchend",ee,!0)),J(e,!0)},ee=function(e){V.isBetweenSteps=void 0,null==T||T(e,V.latestValue,I?[V.latestLowerValue,V.latestValue]:void 0),te()},te=function(){E.current.forEach((function(e){return e()})),E.current=[]},oe=f.useRef(null),ne=f.useRef(null);!function(e,t,o,n){f.useImperativeHandle(e.componentRef,(function(){return{get value(){return o},get range(){return n},focus:function(){t.current&&t.current.focus()}}}),[t,o,n])}(e,I&&!y?oe:ne,z,I?[W,z]:void 0);var re=Fw(y?"bottom":jn(e.theme)?"right":"left"),ie=Fw(y?"height":"width"),ae=k?0:p,se=Aw(z,p,c),le=Aw(W,p,c),ce=Aw(ae,p,c),ue=I?se-le:Math.abs(ce-se),de=Math.min(100-se,100-ce),pe=I?le:Math.min(se,ce),he={className:U.root,ref:t},me={className:U.titleLabel,children:s,disabled:a,htmlFor:w?void 0:K},ge=m?{className:U.valueLabel,children:C?C(z):z,disabled:a}:void 0,fe=I&&m?{className:U.valueLabel,children:C?C(W):W,disabled:a}:void 0,ve=k?{className:U.zeroTick,style:re(ce)}:void 0,be={className:qr(U.lineContainer,U.activeSection),style:ie(ue)},ye={className:qr(U.lineContainer,U.inactiveSection),style:ie(de)},_e={className:qr(U.lineContainer,U.inactiveSection),style:ie(pe)},Ce=d({"aria-disabled":a,role:"slider",tabIndex:a?void 0:0},{"data-is-focusable":!a}),Se=d(d(d({id:K,className:qr(U.slideBox,v.className)},!a&&{onMouseDown:$,onTouchStart:$,onKeyDown:function(t){var o=V.isAdjustingLowerValue?V.latestLowerValue:V.latestValue,r=0;switch(t.which){case Yn(Un.left,e.theme):case Un.down:r=-n,j(),q(t);break;case Yn(Un.right,e.theme):case Un.up:r=n,j(),q(t);break;case Un.home:o=p,j(),q(t);break;case Un.end:o=c,j(),q(t);break;default:return}Z(t,o+r),t.preventDefault(),t.stopPropagation()}}),v&&Tr(v,Dr,["id","className"])),!I&&d(d({},Ce),{"aria-valuemin":p,"aria-valuemax":c,"aria-valuenow":z,"aria-valuetext":Y(z),"aria-label":w||s})),xe=a?{}:{onFocus:function(e){V.isAdjustingLowerValue=e.target===oe.current}},ke=d({ref:ne,className:U.thumb,style:re(se)},I&&d(d(d({},Ce),xe),{id:"max-"+K,"aria-valuemin":W,"aria-valuemax":c,"aria-valuenow":z,"aria-valuetext":Y(z),"aria-label":"max "+(w||s)})),we=I?d(d(d({ref:oe,className:U.thumb,style:re(le)},Ce),xe),{id:"min-"+K,"aria-valuemin":p,"aria-valuemax":z,"aria-valuenow":W,"aria-valuetext":Y(W),"aria-label":"min "+(w||s)}):void 0;return{root:he,label:me,sliderBox:Se,container:{className:U.container},valueLabel:ge,lowerValueLabel:fe,thumb:ke,lowerValueThumb:we,zeroTick:ve,activeTrack:be,topInactiveTrack:ye,bottomInactiveTrack:_e,sliderLine:{ref:N,className:U.line}}}(e,t);return Mi({name:Lw,props:e,mutuallyExclusive:{value:"defaultValue"}}),f.createElement("div",d({},o.root),o&&f.createElement(Oh,d({},o.label)),f.createElement("div",d({},o.container),e.ranged&&(e.vertical?o.valueLabel&&f.createElement(Oh,d({},o.valueLabel)):o.lowerValueLabel&&f.createElement(Oh,d({},o.lowerValueLabel))),f.createElement("div",d({},o.sliderBox),f.createElement("div",d({},o.sliderLine),e.ranged&&f.createElement("span",d({},o.lowerValueThumb)),f.createElement("span",d({},o.thumb)),o.zeroTick&&f.createElement("span",d({},o.zeroTick)),f.createElement("span",d({},o.bottomInactiveTrack)),f.createElement("span",d({},o.activeTrack)),f.createElement("span",d({},o.topInactiveTrack)))),e.ranged&&e.vertical?o.lowerValueLabel&&f.createElement(Oh,d({},o.lowerValueLabel)):o.valueLabel&&f.createElement(Oh,d({},o.valueLabel))),f.createElement(ks,null))}));Hw.displayName=Lw;var Ow,zw={root:"ms-Slider",enabled:"ms-Slider-enabled",disabled:"ms-Slider-disabled",row:"ms-Slider-row",column:"ms-Slider-column",container:"ms-Slider-container",slideBox:"ms-Slider-slideBox",line:"ms-Slider-line",thumb:"ms-Slider-thumb",activeSection:"ms-Slider-active",inactiveSection:"ms-Slider-inactive",valueLabel:"ms-Slider-value",showValue:"ms-Slider-showValue",showTransitions:"ms-Slider-showTransitions",zeroTick:"ms-Slider-zeroTick"},Ww=Vn(Hw,(function(e){var t,o,n,r,i,a,s,l,c,u,d,p,h,g=e.className,f=e.titleLabelClassName,v=e.theme,b=e.vertical,y=e.disabled,_=e.showTransitions,C=e.showValue,S=e.ranged,x=v.semanticColors,k=Qo(zw,v),w=x.inputBackgroundCheckedHovered,I=x.inputBackgroundChecked,D=x.inputPlaceholderBackgroundChecked,T=x.smallInputBorder,E=x.disabledBorder,P=x.disabledText,M=x.disabledBackground,R=x.inputBackground,N=x.smallInputBorder,B=x.disabledBorder,F=!y&&{backgroundColor:w,selectors:(t={},t[ro]={backgroundColor:"Highlight"},t)},A=!y&&{backgroundColor:D,selectors:(o={},o[ro]={borderColor:"Highlight"},o)},L=!y&&{backgroundColor:I,selectors:(n={},n[ro]={backgroundColor:"Highlight"},n)},H=!y&&{border:"2px solid "+w,selectors:(r={},r[ro]={borderColor:"Highlight"},r)},O=!e.disabled&&{backgroundColor:x.inputPlaceholderBackgroundChecked,selectors:(i={},i[ro]={backgroundColor:"Highlight"},i)};return{root:m([k.root,v.fonts.medium,{userSelect:"none"},b&&{marginRight:8}],[y?void 0:k.enabled],[y?k.disabled:void 0],[b?void 0:k.row],[b?k.column:void 0],[g]),titleLabel:[{padding:0},f],container:[k.container,{display:"flex",flexWrap:"nowrap",alignItems:"center"},b&&{flexDirection:"column",height:"100%",textAlign:"center",margin:"8px 0"}],slideBox:m([k.slideBox,!S&&To(v),{background:"transparent",border:"none",flexGrow:1,lineHeight:28,display:"flex",alignItems:"center",selectors:(a={},a[":active ."+k.activeSection]=F,a[":hover ."+k.activeSection]=L,a[":active ."+k.inactiveSection]=A,a[":hover ."+k.inactiveSection]=A,a[":active ."+k.thumb]=H,a[":hover ."+k.thumb]=H,a[":active ."+k.zeroTick]=O,a[":hover ."+k.zeroTick]=O,a[ro]={forcedColorAdjust:"none"},a)},b?{height:"100%",width:28,padding:"8px 0"}:{height:28,width:"auto",padding:"0 8px"}],[C?k.showValue:void 0],[_?k.showTransitions:void 0]),thumb:[k.thumb,S&&To(v,{inset:-4}),{borderWidth:2,borderStyle:"solid",borderColor:N,borderRadius:10,boxSizing:"border-box",background:R,display:"block",width:16,height:16,position:"absolute"},b?{left:-6,margin:"0 auto",transform:"translateY(8px)"}:{top:-6,transform:jn(v)?"translateX(50%)":"translateX(-50%)"},_&&{transition:"left "+Le.durationValue3+" "+Le.easeFunction1},y&&{borderColor:B,selectors:(s={},s[ro]={borderColor:"GrayText"},s)}],line:[k.line,{display:"flex",position:"relative"},b?{height:"100%",width:4,margin:"0 auto",flexDirection:"column-reverse"}:{width:"100%"}],lineContainer:[{borderRadius:4,boxSizing:"border-box"},b?{width:4,height:"100%"}:{height:4,width:"100%"}],activeSection:[k.activeSection,{background:T,selectors:(l={},l[ro]={backgroundColor:"WindowText"},l)},_&&{transition:"width "+Le.durationValue3+" "+Le.easeFunction1},y&&{background:P,selectors:(c={},c[ro]={backgroundColor:"GrayText",borderColor:"GrayText"},c)}],inactiveSection:[k.inactiveSection,{background:E,selectors:(u={},u[ro]={border:"1px solid WindowText"},u)},_&&{transition:"width "+Le.durationValue3+" "+Le.easeFunction1},y&&{background:M,selectors:(d={},d[ro]={borderColor:"GrayText"},d)}],zeroTick:[k.zeroTick,{position:"absolute",background:x.disabledBorder,selectors:(p={},p[ro]={backgroundColor:"WindowText"},p)},e.disabled&&{background:x.disabledBackground,selectors:(h={},h[ro]={backgroundColor:"GrayText"},h)},e.vertical?{width:"16px",height:"1px",transform:jn(v)?"translateX(6px)":"translateX(-6px)"}:{width:"1px",height:"16px",transform:"translateY(-6px)"}],valueLabel:[k.valueLabel,{flexShrink:1,width:30,lineHeight:"1"},b?{margin:"0 auto",whiteSpace:"nowrap",width:40}:{margin:"0 8px",whiteSpace:"nowrap",width:40}]}}),void 0,{scope:"Slider"}),Vw=jo((function(e){var t,o=e.semanticColors,n=o.disabledText,r=o.disabledBackground;return{backgroundColor:r,pointerEvents:"none",cursor:"default",color:n,selectors:(t={":after":{borderColor:r}},t[ro]={color:"GrayText"},t)}})),Kw=jo((function(e,t,o){var n,r,i,a=e.palette,s=e.semanticColors,l=e.effects,c=a.neutralSecondary,u=s.buttonText,d=s.buttonText,p=s.buttonBackgroundHovered,h=s.buttonBackgroundPressed;return kn({root:{outline:"none",display:"block",height:"50%",width:23,padding:0,backgroundColor:"transparent",textAlign:"center",cursor:"default",color:c,selectors:{"&.ms-DownButton":{borderRadius:"0 0 "+l.roundedCorner2+" 0"},"&.ms-UpButton":{borderRadius:"0 "+l.roundedCorner2+" 0 0"}}},rootHovered:{backgroundColor:p,color:u},rootChecked:{backgroundColor:h,color:d,selectors:(n={},n[ro]={backgroundColor:"Highlight",color:"HighlightText"},n)},rootPressed:{backgroundColor:h,color:d,selectors:(r={},r[ro]={backgroundColor:"Highlight",color:"HighlightText"},r)},rootDisabled:{opacity:.5,selectors:(i={},i[ro]={color:"GrayText",opacity:1},i)},icon:{fontSize:8,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0}},{},o)}));!function(e){e[e.down=-1]="down",e[e.notSpinning=0]="notSpinning",e[e.up=1]="up"}(Ow||(Ow={}));var Uw=Jn(),Gw="SpinButton",jw={disabled:!1,label:"",step:1,labelPosition:Xs.start,incrementButtonIcon:{iconName:"ChevronUpSmall"},decrementButtonIcon:{iconName:"ChevronDownSmall"}},qw=function(){},Yw=function(e,t){var o=t.min,n=t.max;return"number"==typeof n&&(e=Math.min(e,n)),"number"==typeof o&&(e=Math.max(e,o)),e},Zw=f.forwardRef((function(e,t){var o=tr(jw,e),n=o.disabled,r=o.label,i=o.min,a=o.max,s=o.step,l=o.defaultValue,c=o.value,u=o.precision,p=o.labelPosition,h=o.iconProps,m=o.incrementButtonIcon,g=o.incrementButtonAriaLabel,v=o.decrementButtonIcon,b=o.decrementButtonAriaLabel,y=o.ariaLabel,_=o.ariaDescribedBy,C=o.upArrowButtonStyles,S=o.downArrowButtonStyles,x=o.theme,k=o.ariaPositionInSet,w=o.ariaSetSize,I=o.ariaValueNow,D=o.ariaValueText,T=o.className,E=o.inputProps,P=o.onDecrement,M=o.onIncrement,R=o.iconButtonProps,N=o.onValidate,B=o.onChange,F=o.styles,A=f.useRef(null),L=Kd("input"),H=Kd("Label"),O=f.useState(!1),z=O[0],W=O[1],V=f.useState(Ow.notSpinning),K=V[0],U=V[1],G=Al(),j=f.useMemo((function(){return null!=u?u:Math.max(MS(s),0)}),[u,s]),q=gh(c,null!=l?l:String(i||0),B),Y=q[0],Z=q[1],X=f.useState(),Q=X[0],J=X[1],$=f.useRef({stepTimeoutHandle:-1,latestValue:void 0,latestIntermediateValue:void 0}).current;$.latestValue=Y,$.latestIntermediateValue=Q;var ee=Ti(c);f.useEffect((function(){c!==ee&&void 0!==Q&&J(void 0)}),[c,ee,Q]);var te=Uw(F,{theme:x,disabled:n,isFocused:z,keyboardSpinDirection:K,labelPosition:p,className:T}),oe=Tr(o,Dr,["onBlur","onFocus","className","onChange"]),ne=f.useCallback((function(e){var t=$.latestIntermediateValue;if(void 0!==t&&t!==$.latestValue){var o=void 0;N?o=N(t,e):t&&t.trim().length&&!isNaN(Number(t))&&(o=String(Yw(Number(t),{min:i,max:a}))),void 0!==o&&o!==$.latestValue&&Z(o,e)}J(void 0)}),[$,a,i,N,Z]),re=f.useCallback((function(){$.stepTimeoutHandle>=0&&(G.clearTimeout($.stepTimeoutHandle),$.stepTimeoutHandle=-1),($.spinningByMouse||K!==Ow.notSpinning)&&($.spinningByMouse=!1,U(Ow.notSpinning))}),[$,K,G]),ie=f.useCallback((function(e,t){if(t.persist(),void 0!==$.latestIntermediateValue)return"keydown"===t.type&&ne(t),void G.requestAnimationFrame((function(){ie(e,t)}));var o=e($.latestValue||"",t);void 0!==o&&o!==$.latestValue&&Z(o,t);var n=$.spinningByMouse;$.spinningByMouse="mousedown"===t.type,$.spinningByMouse&&($.stepTimeoutHandle=G.setTimeout((function(){ie(e,t)}),n?75:400))}),[$,G,ne,Z]),ae=f.useCallback((function(e){if(M)return M(e);var t=Yw(Number(e)+Number(s),{max:a});return t=RS(t,j),String(t)}),[j,a,M,s]),se=f.useCallback((function(e){if(P)return P(e);var t=Yw(Number(e)-Number(s),{min:i});return t=RS(t,j),String(t)}),[j,i,P,s]),le=f.useCallback((function(e){(n||e.which===Un.up||e.which===Un.down)&&re()}),[n,re]),ce=f.useCallback((function(e){ie(ae,e)}),[ae,ie]),ue=f.useCallback((function(e){ie(se,e)}),[se,ie]);!function(e,t,o){f.useImperativeHandle(e.componentRef,(function(){return{get value(){return o},focus:function(){t.current&&t.current.focus()}}}),[t,o])}(o,A,Y),Xw(o);var de=!!Y&&!isNaN(Number(Y)),pe=(h||r)&&f.createElement("div",{className:te.labelWrapper},h&&f.createElement(ii,d({},h,{className:te.icon,"aria-hidden":"true"})),r&&f.createElement(Oh,{id:H,htmlFor:L,className:te.label,disabled:n},r));return f.createElement("div",{className:te.root,ref:t},p!==Xs.bottom&&pe,f.createElement("div",d({},oe,{className:te.spinButtonWrapper,"aria-label":y&&y,"aria-posinset":k,"aria-setsize":w,"data-ktp-target":!0}),f.createElement("input",d({value:null!=Q?Q:Y,id:L,onChange:qw,onInput:function(e){J(e.target.value)},className:te.input,type:"text",autoComplete:"off",role:"spinbutton","aria-labelledby":r&&H,"aria-valuenow":null!=I?I:de?Number(Y):void 0,"aria-valuetext":null!=D?D:de?void 0:Y,"aria-valuemin":i,"aria-valuemax":a,"aria-describedby":_,onBlur:function(e){var t;ne(e),W(!1),null===(t=o.onBlur)||void 0===t||t.call(o,e)},ref:A,onFocus:function(e){var t;A.current&&(($.spinningByMouse||K!==Ow.notSpinning)&&re(),A.current.select(),W(!0),null===(t=o.onFocus)||void 0===t||t.call(o,e))},onKeyDown:function(e){if(e.which!==Un.up&&e.which!==Un.down&&e.which!==Un.enter||(e.preventDefault(),e.stopPropagation()),n)re();else{var t=Ow.notSpinning;switch(e.which){case Un.up:t=Ow.up,ie(ae,e);break;case Un.down:t=Ow.down,ie(se,e);break;case Un.enter:ne(e);break;case Un.escape:J(void 0)}K!==t&&U(t)}},onKeyUp:le,disabled:n,"aria-disabled":n,"data-lpignore":!0,"data-ktp-execute-target":!0},E)),f.createElement("span",{className:te.arrowButtonsContainer},f.createElement(Zu,d({styles:Kw(x,!0,C),className:"ms-UpButton",checked:K===Ow.up,disabled:n,iconProps:m,onMouseDown:ce,onMouseLeave:re,onMouseUp:re,tabIndex:-1,ariaLabel:g,"data-is-focusable":!1},R)),f.createElement(Zu,d({styles:Kw(x,!1,S),className:"ms-DownButton",checked:K===Ow.down,disabled:n,iconProps:v,onMouseDown:ue,onMouseLeave:re,onMouseUp:re,tabIndex:-1,ariaLabel:b,"data-is-focusable":!1},R)))),p===Xs.bottom&&pe)}));Zw.displayName=Gw;var Xw=function(e){Mi({name:Gw,props:e,mutuallyExclusive:{value:"defaultValue"}})},Qw=Vn(Zw,(function(e){var t,o,n=e.theme,r=e.className,i=e.labelPosition,a=e.disabled,s=e.isFocused,l=n.palette,c=n.semanticColors,u=n.effects,d=n.fonts,p=c.inputBorder,h=c.inputBackground,m=c.inputBorderHovered,g=c.inputFocusBorderAlt,f=c.inputText,v=l.white,b=c.inputBackgroundChecked,y=c.disabledText;return{root:[d.medium,{outline:"none",width:"100%",minWidth:86},r],labelWrapper:[{display:"inline-flex",alignItems:"center"},i===Xs.start&&{height:32,float:"left",marginRight:10},i===Xs.end&&{height:32,float:"right",marginLeft:10},i===Xs.top&&{marginBottom:-1}],icon:[{padding:"0 5px",fontSize:Ye.large},a&&{color:y}],label:{pointerEvents:"none",lineHeight:Ye.large},spinButtonWrapper:[{display:"flex",position:"relative",boxSizing:"border-box",height:32,minWidth:86,selectors:{":after":{pointerEvents:"none",content:"''",position:"absolute",left:0,top:0,bottom:0,right:0,borderWidth:"1px",borderStyle:"solid",borderColor:p,borderRadius:u.roundedCorner2}}},(i===Xs.top||i===Xs.bottom)&&{width:"100%"},!a&&[{selectors:{":hover":{selectors:(t={":after":{borderColor:m}},t[ro]={selectors:{":after":{borderColor:"Highlight"}}},t)}}},s&&{selectors:{"&&":Mo(g,u.roundedCorner2)}}],a&&Vw(n)],input:["ms-spinButton-input",{boxSizing:"border-box",boxShadow:"none",borderStyle:"none",flex:1,margin:0,fontSize:d.medium.fontSize,fontFamily:"inherit",color:f,backgroundColor:h,height:"100%",padding:"0 8px 0 9px",outline:0,display:"block",minWidth:61,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",cursor:"text",userSelect:"text",borderRadius:u.roundedCorner2+" 0 0 "+u.roundedCorner2},!a&&{selectors:{"::selection":{backgroundColor:b,color:v,selectors:(o={},o[ro]={backgroundColor:"Highlight",borderColor:"Highlight",color:"HighlightText"},o)}}},a&&Vw(n)],arrowButtonsContainer:[{display:"block",height:"100%",cursor:"default"},a&&Vw(n)]}}),void 0,{scope:"SpinButton"}),Jw=d;function $w(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];var r=e;return r.isSlot?0===(o=f.Children.toArray(o)).length?r(t):r(d(d({},t),{children:o})):f.createElement.apply(f,m([e,t],o))}function eI(e,t){void 0===t&&(t={});var o=t.defaultProp,n=void 0===o?"children":o;return function(t,o,r,i,a){if(f.isValidElement(o))return o;var s=function(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];for(var r={},i=[],a=0,s=o;a<s.length;a++){var l=s[a];i.push(l&&l.className),Jw(r,l)}return r.className=X([e,i],{rtl:jn(t)}),r}(i,a,t,function(e,t){var o,n;return"string"==typeof t||"number"==typeof t||"boolean"==typeof t?((o={})[e]=t,n=o):n=t,n}(n,o));if(r){if(r.component){var l=r.component;return f.createElement(l,d({},s))}if(r.render)return r.render(s,e)}return f.createElement(e,d({},s))}}var tI=jo((function(e){return eI(e)}));function oI(e,t){var o={},n=e,r=function(e){if(t.hasOwnProperty(e)){var r=function(o){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(r.length>0)throw new Error("Any module using getSlots must use withSlots. Please see withSlots javadoc for more info.");return nI(t[e],o,n[e],n.slots&&n.slots[e],n._defaultStyles&&n._defaultStyles[e],n.theme)};r.isSlot=!0,o[e]=r}};for(var i in t)r(i);return o}function nI(e,t,o,n,r,i){return void 0!==e.create?e.create(t,o,n,r):tI(e)(t,o,n,r,i)}function rI(e,t){void 0===t&&(t={});var o=t.factoryOptions,n=(void 0===o?{}:o).defaultProp,r=function(o){var n,r,i,a=(n=t.displayName,r=f.useContext(On),i=t.fields,Dt.getSettings(i||["theme","styles","tokens"],n,r.customizations)),s=t.state;s&&(o=d(d({},o),s(o)));var l=o.theme||a.theme,c=iI(o,l,t.tokens,a.tokens,o.tokens),u=function(e,t,o){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];return kn.apply(void 0,n.map((function(n){return"function"==typeof n?n(e,t,o):n})))}(o,l,c,t.styles,a.styles,o.styles),p=d(d({},o),{styles:u,tokens:c,_defaultStyles:u,theme:l});return e(p)};return r.displayName=t.displayName||e.name,n&&(r.create=eI(r,{defaultProp:n})),Jw(r,t.statics),r}function iI(e,t){for(var o=[],n=2;n<arguments.length;n++)o[n-2]=arguments[n];for(var r={},i=0,a=o;i<a.length;i++){var s=a[i];s&&(s="function"==typeof s?s(e,t):s,Array.isArray(s)&&(s=iI.apply(void 0,m([e,t],s))),Jw(r,s))}return r}var aI,sI={root:"ms-StackItem"},lI={start:"flex-start",end:"flex-end"},cI=rI((function(e){var t=e.children,o=Tr(e,ir);return null==t?null:$w(oI(e,{root:"div"}).root,d({},o),t)}),{displayName:"StackItem",styles:function(e,t,o){var n=e.grow,r=e.shrink,i=e.disableShrink,a=e.align,s=e.verticalFill,l=e.order,c=e.className,u=Qo(sI,t);return{root:[t.fonts.medium,u.root,{margin:o.margin,padding:o.padding,height:s?"100%":"auto",width:"auto"},n&&{flexGrow:!0===n?1:n},(i||!n&&!r)&&{flexShrink:0},r&&!i&&{flexShrink:1},a&&{alignSelf:lI[a]||a},l&&{order:l},c]}}}),uI=function(e,t){return t.spacing.hasOwnProperty(e)?t.spacing[e]:e},dI=function(e){var t=parseFloat(e),o=isNaN(t)?0:t,n=isNaN(t)?"":t.toString();return{value:o,unit:e.substring(n.toString().length)||"px"}},pI=function(e,t){if(void 0===e||"number"==typeof e||""===e)return e;var o=e.split(" ");return o.length<2?uI(e,t):o.reduce((function(e,o){return uI(e,t)+" "+uI(o,t)}))},hI={start:"flex-start",end:"flex-end"},mI={root:"ms-Stack",inner:"ms-Stack-inner"},gI=rI((function(e){var t=e.as,o=void 0===t?"div":t,n=e.disableShrink,r=e.wrap,i=p(e,["as","disableShrink","wrap"]);xi("Stack",e,{gap:"tokens.childrenGap",maxHeight:"tokens.maxHeight",maxWidth:"tokens.maxWidth",padding:"tokens.padding"});var a=f.Children.map(e.children,(function(e,t){if(!e)return null;if((r=e)&&"object"==typeof r&&r.type&&r.type.displayName===cI.displayName){var o={shrink:!n};return f.cloneElement(e,d(d({},o),e.props))}var r;return e})),s=Tr(i,ir),l=oI(e,{root:o,inner:"div"});return $w(l.root,d({},s),r?$w(l.inner,null,a):a)}),{displayName:"Stack",styles:function(e,t,o){var n,r,i,a,s,l,c,u=e.verticalFill,p=e.horizontal,h=e.reversed,m=e.grow,g=e.wrap,f=e.horizontalAlign,v=e.verticalAlign,b=e.disableShrink,y=e.className,_=Qo(mI,t),C=o&&o.childrenGap?o.childrenGap:e.gap,S=o&&o.maxHeight?o.maxHeight:e.maxHeight,x=o&&o.maxWidth?o.maxWidth:e.maxWidth,k=o&&o.padding?o.padding:e.padding,w=function(e,t){if(void 0===e||""===e)return{rowGap:{value:0,unit:"px"},columnGap:{value:0,unit:"px"}};if("number"==typeof e)return{rowGap:{value:e,unit:"px"},columnGap:{value:e,unit:"px"}};var o=e.split(" ");if(o.length>2)return{rowGap:{value:0,unit:"px"},columnGap:{value:0,unit:"px"}};if(2===o.length)return{rowGap:dI(uI(o[0],t)),columnGap:dI(uI(o[1],t))};var n=dI(uI(e,t));return{rowGap:n,columnGap:n}}(C,t),I=w.rowGap,D=w.columnGap,T=""+-.5*D.value+D.unit,E=""+-.5*I.value+I.unit,P={textOverflow:"ellipsis"},M={"> *:not(.ms-StackItem)":{flexShrink:b?0:1}};return g?{root:[_.root,{flexWrap:"wrap",maxWidth:x,maxHeight:S,width:"auto",overflow:"visible",height:"100%"},f&&(n={},n[p?"justifyContent":"alignItems"]=hI[f]||f,n),v&&(r={},r[p?"alignItems":"justifyContent"]=hI[v]||v,r),y,{display:"flex"},p&&{height:u?"100%":"auto"}],inner:[_.inner,{display:"flex",flexWrap:"wrap",marginLeft:T,marginRight:T,marginTop:E,marginBottom:E,overflow:"visible",boxSizing:"border-box",padding:pI(k,t),width:0===D.value?"100%":"calc(100% + "+D.value+D.unit+")",maxWidth:"100vw",selectors:d({"> *":d({margin:""+.5*I.value+I.unit+" "+.5*D.value+D.unit},P)},M)},f&&(i={},i[p?"justifyContent":"alignItems"]=hI[f]||f,i),v&&(a={},a[p?"alignItems":"justifyContent"]=hI[v]||v,a),p&&{flexDirection:h?"row-reverse":"row",height:0===I.value?"100%":"calc(100% + "+I.value+I.unit+")",selectors:{"> *":{maxWidth:0===D.value?"100%":"calc(100% - "+D.value+D.unit+")"}}},!p&&{flexDirection:h?"column-reverse":"column",height:"calc(100% + "+I.value+I.unit+")",selectors:{"> *":{maxHeight:0===I.value?"100%":"calc(100% - "+I.value+I.unit+")"}}}]}:{root:[_.root,{display:"flex",flexDirection:p?h?"row-reverse":"row":h?"column-reverse":"column",flexWrap:"nowrap",width:"auto",height:u?"100%":"auto",maxWidth:x,maxHeight:S,padding:pI(k,t),boxSizing:"border-box",selectors:d((s={"> *":P},s[h?"> *:not(:last-child)":"> *:not(:first-child)"]=[p&&{marginLeft:""+D.value+D.unit},!p&&{marginTop:""+I.value+I.unit}],s),M)},m&&{flexGrow:!0===m?1:m},f&&(l={},l[p?"justifyContent":"alignItems"]=hI[f]||f,l),v&&(c={},c[p?"alignItems":"justifyContent"]=hI[v]||v,c),y]}},statics:{Item:cI}});!function(e){e[e.Both=0]="Both",e[e.Header=1]="Header",e[e.Footer=2]="Footer"}(aI||(aI={}));var fI=function(e){function t(t){var o=e.call(this,t)||this;return o._root=f.createRef(),o._stickyContentTop=f.createRef(),o._stickyContentBottom=f.createRef(),o._nonStickyContent=f.createRef(),o._placeHolder=f.createRef(),o.syncScroll=function(e){var t=o.nonStickyContent;t&&o.props.isScrollSynced&&(t.scrollLeft=e.scrollLeft)},o._getContext=function(){return o.context},o._onScrollEvent=function(e,t){if(o.root&&o.nonStickyContent){var n=o._getNonStickyDistanceFromTop(e),r=!1,i=!1;o.canStickyTop&&(r=n-o._getStickyDistanceFromTop()<e.scrollTop),o.canStickyBottom&&e.clientHeight-t.offsetHeight<=n&&(i=n-Math.floor(e.scrollTop)>=o._getStickyDistanceFromTopForFooter(e,t)),document.activeElement&&o.nonStickyContent.contains(document.activeElement)&&(o.state.isStickyTop!==r||o.state.isStickyBottom!==i)?o._activeElement=document.activeElement:o._activeElement=void 0,o.setState({isStickyTop:o.canStickyTop&&r,isStickyBottom:i,distanceFromTop:n})}},o._getStickyDistanceFromTop=function(){var e=0;return o.stickyContentTop&&(e=o.stickyContentTop.offsetTop),e},o._getStickyDistanceFromTopForFooter=function(e,t){var n=0;return o.stickyContentBottom&&(n=e.clientHeight-t.offsetHeight+o.stickyContentBottom.offsetTop),n},o._getNonStickyDistanceFromTop=function(e){var t=0,n=o.root;if(n){for(;n&&n.offsetParent!==e;)t+=n.offsetTop,n=n.offsetParent;n&&n.offsetParent===e&&(t+=n.offsetTop)}return t},Ui(o),o.state={isStickyTop:!1,isStickyBottom:!1,distanceFromTop:void 0},o._activeElement=void 0,o}return u(t,e),Object.defineProperty(t.prototype,"root",{get:function(){return this._root.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeHolder.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stickyContentTop",{get:function(){return this._stickyContentTop.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stickyContentBottom",{get:function(){return this._stickyContentBottom.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nonStickyContent",{get:function(){return this._nonStickyContent.current},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canStickyTop",{get:function(){return this.props.stickyPosition===aI.Both||this.props.stickyPosition===aI.Header},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canStickyBottom",{get:function(){return this.props.stickyPosition===aI.Both||this.props.stickyPosition===aI.Footer},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){var e=this._getContext().scrollablePane;e&&(e.subscribe(this._onScrollEvent),e.addSticky(this))},t.prototype.componentWillUnmount=function(){var e=this._getContext().scrollablePane;e&&(e.unsubscribe(this._onScrollEvent),e.removeSticky(this))},t.prototype.componentDidUpdate=function(e,t){var o=this._getContext().scrollablePane;if(o){var n=this.state,r=n.isStickyBottom,i=n.isStickyTop,a=n.distanceFromTop,s=!1;t.distanceFromTop!==a&&(o.sortSticky(this,!0),s=!0),t.isStickyTop===i&&t.isStickyBottom===r||(this._activeElement&&this._activeElement.focus(),o.updateStickyRefHeights(),s=!0),s&&o.syncScrollSticky(this)}},t.prototype.shouldComponentUpdate=function(e,t){if(!this.context.scrollablePane)return!0;var o=this.state,n=o.isStickyTop,r=o.isStickyBottom,i=o.distanceFromTop;return n!==t.isStickyTop||r!==t.isStickyBottom||this.props.stickyPosition!==e.stickyPosition||this.props.children!==e.children||i!==t.distanceFromTop||vI(this._nonStickyContent,this._stickyContentTop)||vI(this._nonStickyContent,this._stickyContentBottom)||vI(this._nonStickyContent,this._placeHolder)},t.prototype.render=function(){var e=this.state,t=e.isStickyTop,o=e.isStickyBottom,n=this.props,r=n.stickyClassName,i=n.children;return this.context.scrollablePane?f.createElement("div",{ref:this._root},this.canStickyTop&&f.createElement("div",{ref:this._stickyContentTop,style:{pointerEvents:t?"auto":"none"}},f.createElement("div",{style:this._getStickyPlaceholderHeight(t)})),this.canStickyBottom&&f.createElement("div",{ref:this._stickyContentBottom,style:{pointerEvents:o?"auto":"none"}},f.createElement("div",{style:this._getStickyPlaceholderHeight(o)})),f.createElement("div",{style:this._getNonStickyPlaceholderHeightAndWidth(),ref:this._placeHolder},(t||o)&&f.createElement("span",{style:Ro},i),f.createElement("div",{ref:this._nonStickyContent,className:t||o?r:void 0,style:this._getContentStyles(t||o)},i))):f.createElement("div",null,this.props.children)},t.prototype.addSticky=function(e){this.nonStickyContent&&e.appendChild(this.nonStickyContent)},t.prototype.resetSticky=function(){this.nonStickyContent&&this.placeholder&&this.placeholder.appendChild(this.nonStickyContent)},t.prototype.setDistanceFromTop=function(e){var t=this._getNonStickyDistanceFromTop(e);this.setState({distanceFromTop:t})},t.prototype._getContentStyles=function(e){return{backgroundColor:this.props.stickyBackgroundColor||this._getBackground(),overflow:e?"hidden":""}},t.prototype._getStickyPlaceholderHeight=function(e){var t=this.nonStickyContent?this.nonStickyContent.offsetHeight:0;return{visibility:e?"hidden":"visible",height:e?0:t}},t.prototype._getNonStickyPlaceholderHeightAndWidth=function(){var e=this.state,t=e.isStickyTop,o=e.isStickyBottom;if(t||o){var n=0,r=0;return this.nonStickyContent&&this.nonStickyContent.firstElementChild&&(n=this.nonStickyContent.offsetHeight,r=this.nonStickyContent.firstElementChild.scrollWidth+(this.nonStickyContent.firstElementChild.offsetWidth-this.nonStickyContent.firstElementChild.clientWidth)),{height:n,width:r}}return{}},t.prototype._getBackground=function(){if(this.root){for(var e=this.root;"rgba(0, 0, 0, 0)"===window.getComputedStyle(e).getPropertyValue("background-color")||"transparent"===window.getComputedStyle(e).getPropertyValue("background-color");){if("HTML"===e.tagName)return;e.parentElement&&(e=e.parentElement)}return window.getComputedStyle(e).getPropertyValue("background-color")}},t.defaultProps={stickyPosition:aI.Both,isScrollSynced:!0},t.contextType=wk,t}(f.Component);function vI(e,t){return e&&t&&e.current&&t.current&&e.current.offsetHeight!==t.current.offsetHeight}var bI=Jn(),yI=jo((function(e,t,o,n,r,i,a,s,l){var c=Rd(e);return In({root:["ms-Button",c.root,o,t,a&&["is-checked",c.rootChecked],i&&["is-disabled",c.rootDisabled],!i&&!a&&{selectors:{":hover":c.rootHovered,":focus":c.rootFocused,":active":c.rootPressed}},i&&a&&[c.rootCheckedDisabled],!i&&a&&{selectors:{":hover":c.rootCheckedHovered,":active":c.rootCheckedPressed}}],flexContainer:["ms-Button-flexContainer",c.flexContainer]})})),_I=function(e){var t,o,n=e.item,r=e.idPrefix,i=void 0===r?e.id:r,a=e.selected,s=void 0!==a&&a,l=e.disabled,c=void 0!==l&&l,u=e.styles,d=e.circle,p=void 0===d||d,h=e.color,m=e.onClick,g=e.onHover,v=e.onFocus,b=e.onMouseEnter,y=e.onMouseMove,_=e.onMouseLeave,C=e.onWheel,S=e.onKeyDown,x=e.height,k=e.width,w=e.borderWidth,I=bI(u,{theme:e.theme,disabled:c,selected:s,circle:p,isWhite:(t=h,o=Zm(t),"ffffff"===(null==o?void 0:o.hex)),height:x,width:k,borderWidth:w});return f.createElement(Xd,{item:n,id:i+"-"+n.id+"-"+n.index,key:n.id,disabled:c,role:"gridcell",onRenderItem:function(e){var t,o=I.svg;return f.createElement("svg",{className:o,viewBox:"0 0 20 20",fill:null===(t=Zm(e.color))||void 0===t?void 0:t.str},p?f.createElement("circle",{cx:"50%",cy:"50%",r:"50%"}):f.createElement("rect",{width:"100%",height:"100%"}))},selected:s,onClick:m,onHover:g,onFocus:v,label:n.label,className:I.colorCell,getClassNames:yI,index:n.index,onMouseEnter:b,onMouseMove:y,onMouseLeave:_,onWheel:C,onKeyDown:S})},CI={left:-2,top:-2,bottom:-2,right:-2,border:"none",outlineColor:"ButtonText"},SI=Vn(_I,(function(e){var t,o,n,r,i,a=e.theme,s=e.disabled,l=e.selected,c=e.circle,u=e.isWhite,d=e.height,p=void 0===d?20:d,h=e.width,m=void 0===h?20:h,g=e.borderWidth,f=a.semanticColors,v=a.palette,b=v.neutralLighter,y=v.neutralLight,_=v.neutralSecondary,C=v.neutralTertiary,S=g||(m<24?2:4);return{colorCell:[To(a,{inset:-1,position:"relative",highContrastStyle:CI}),{backgroundColor:f.bodyBackground,padding:0,position:"relative",boxSizing:"border-box",display:"inline-block",cursor:"pointer",userSelect:"none",borderRadius:0,border:"none",height:p,width:m,verticalAlign:"top"},!c&&{selectors:(t={},t["."+wo+" &:focus::after"]={outlineOffset:S-1+"px"},t)},c&&{borderRadius:"50%",selectors:(o={},o["."+wo+" &:focus::after"]={outline:"none",borderColor:f.focusBorder,borderRadius:"50%",left:-S,right:-S,top:-S,bottom:-S,selectors:(n={},n[ro]={outline:"1px solid ButtonText"},n)},o)},l&&{padding:2,border:S+"px solid "+y,selectors:(r={},r["&:hover::before"]={content:'""',height:p,width:m,position:"absolute",top:-S,left:-S,borderRadius:c?"50%":"default",boxShadow:"inset 0 0 0 1px "+_},r)},!l&&{selectors:(i={},i["&:hover, &:active, &:focus"]={backgroundColor:f.bodyBackground,padding:2,border:S+"px solid "+b},i["&:focus"]={borderColor:f.bodyBackground,padding:0,selectors:{":hover":{borderColor:a.palette.neutralLight,padding:2}}},i)},s&&{color:f.disabledBodyText,pointerEvents:"none",opacity:.3},u&&!l&&{backgroundColor:C,padding:1}],svg:[{width:"100%",height:"100%"},c&&{borderRadius:"50%"}]}}),void 0,{scope:"ColorPickerGridCell"},!0),xI=Jn(),kI="SwatchColorPicker",wI=f.forwardRef((function(e,t){var o=Kd("swatchColorPicker"),n=e.id||o,r=Ei({isNavigationIdle:!0,cellFocused:!1,navigationIdleTimeoutId:void 0,navigationIdleDelay:250}),i=fm(),a=i.setTimeout,s=i.clearTimeout;!function(e){Mi({name:kI,props:e,mutuallyExclusive:{focusOnHover:"onHover",selectedId:"defaultSelectedId"},deprecations:{isControlled:"selectedId' or 'defaultSelectedId",onColorChanged:"onChange"}})}(e);var l=e.colorCells,c=e.cellShape,u=void 0===c?"circle":c,p=e.columnCount,h=e.shouldFocusCircularNavigate,m=void 0===h||h,g=e.className,v=e.disabled,b=void 0!==v&&v,y=e.doNotContainWithinFocusZone,_=e.styles,C=e.cellMargin,S=void 0===C?10:C,x=e.defaultSelectedId,k=e.focusOnHover,w=e.mouseLeaveParentSelector,I=e.onChange,D=e.onColorChanged,T=e.onCellHovered,E=e.onCellFocused,P=e.getColorGridCellStyles,M=e.cellHeight,R=e.cellWidth,N=e.cellBorderWidth,B=f.useMemo((function(){return l.map((function(e,t){return d(d({},e),{index:t})}))}),[l]),F=f.useCallback((function(e,t){var o,n=null===(o=l.filter((function(e){return e.id===t}))[0])||void 0===o?void 0:o.color;null==I||I(e,t,n),null==D||D(t,n)}),[I,D,l]),A=gh(e.selectedId,x,F),L=A[0],H=A[1],O=xI(_,{theme:e.theme,className:g,cellMargin:S}),z={root:O.root,tableCell:O.tableCell,focusedContainer:O.focusedContainer},W=f.useCallback((function(){E&&(r.cellFocused=!1,E())}),[r,E]),V=f.useCallback((function(e){return k?(r.isNavigationIdle&&!b&&e.currentTarget.focus(),!0):!r.isNavigationIdle||!!b}),[k,r,b]),K=f.useCallback((function(e){if(!k)return!r.isNavigationIdle||!!b;var t=e.currentTarget;return!r.isNavigationIdle||document&&t===document.activeElement||t.focus(),!0}),[k,r,b]),U=f.useCallback((function(e){var t=w;if(k&&t&&r.isNavigationIdle&&!b)for(var o=document.querySelectorAll(t),n=0;n<o.length;n+=1)if(o[n].contains(e.currentTarget)){if(o[n].setActive)try{o[n].setActive()}catch(e){}else o[n].focus();break}}),[b,k,r,w]),G=f.useCallback((function(e){if(T)return e?T(e.id,e.color):T()}),[T]),j=f.useCallback((function(e){if(E)return e?(r.cellFocused=!0,E(e.id,e.color)):(r.cellFocused=!1,E())}),[r,E]),q=f.useCallback((function(e){b||e.id!==L&&(E&&r.cellFocused&&(r.cellFocused=!1,E()),H(e.id))}),[b,r,E,L,H]),Y=f.useCallback((function(){r.isNavigationIdle||void 0===r.navigationIdleTimeoutId?r.isNavigationIdle=!1:(s(r.navigationIdleTimeoutId),r.navigationIdleTimeoutId=void 0),r.navigationIdleTimeoutId=a((function(){r.isNavigationIdle=!0}),r.navigationIdleDelay)}),[s,r,a]),Z=f.useCallback((function(e){e.which!==Un.up&&e.which!==Un.down&&e.which!==Un.left&&e.which!==Un.right||Y()}),[Y]),X=function(e){return f.createElement(SI,{item:e,idPrefix:n,color:e.color,styles:P,disabled:b,onClick:q,onHover:G,onFocus:j,selected:L===e.id,circle:"circle"===u,label:e.label,onMouseEnter:V,onMouseMove:K,onMouseLeave:U,onWheel:Y,onKeyDown:Z,height:M,width:R,borderWidth:N})};return l.length<1||p<1?null:f.createElement(Gd,d({},e,{ref:t,id:n,items:B,columnCount:p,onRenderItem:function(t,o){var n=e.onRenderColorCell;return(void 0===n?X:n)(t,X)},shouldFocusCircularNavigate:m,doNotContainWithinFocusZone:y,onBlur:W,theme:e.theme,styles:z}))}));wI.displayName=kI;var II={focusedContainer:"ms-swatchColorPickerBodyContainer"},DI=Vn(wI,(function(e){var t=e.className,o=e.theme;return{root:{margin:"8px 0",borderCollapse:"collapse"},tableCell:{padding:e.cellMargin/2},focusedContainer:[Qo(II,o).focusedContainer,{clear:"both",display:"block",minWidth:"180px"},t]}}),void 0,{scope:"SwatchColorPicker"}),TI=Jn(),EI=f.forwardRef((function(e,t){var o,n,r,i,a,s=f.useRef(null),l=zl(),c=Or(s,t),u=e.illustrationImage,p=e.primaryButtonProps,h=e.secondaryButtonProps,m=e.headline,g=e.hasCondensedHeadline,v=e.hasCloseButton,b=void 0===v?e.hasCloseIcon:v,y=e.onDismiss,_=e.closeButtonAriaLabel,C=e.hasSmallHeadline,S=e.isWide,x=e.styles,k=e.theme,w=e.ariaDescribedBy,I=e.ariaLabelledBy,D=e.footerContent,T=e.focusTrapZoneProps,E=TI(x,{theme:k,hasCondensedHeadline:g,hasSmallHeadline:C,hasCloseButton:b,hasHeadline:!!m,isWide:S,primaryButtonClassName:p?p.className:void 0,secondaryButtonClassName:h?h.className:void 0});if(Ll(l,"keydown",f.useCallback((function(e){y&&e.which===Un.escape&&y(e)}),[y])),u&&u.src&&(o=f.createElement("div",{className:E.imageContent},f.createElement(Ur,d({},u)))),m){var P="string"==typeof m?"p":"div";n=f.createElement("div",{className:E.header},f.createElement(P,{role:"heading","aria-level":3,className:E.headline,id:I},m))}if(e.children){var M="string"==typeof e.children?"p":"div";r=f.createElement("div",{className:E.body},f.createElement(M,{className:E.subText,id:w},e.children))}return(p||h||D)&&(i=f.createElement(gI,{className:E.footer,horizontal:!0,horizontalAlign:D?"space-between":"end"},f.createElement(gI.Item,{align:"center"},f.createElement("span",null,D)),f.createElement(gI.Item,null,h&&f.createElement(Md,d({},h,{className:E.secondaryButton})),p&&f.createElement(Ad,d({},p,{className:E.primaryButton}))))),b&&(a=f.createElement(Zu,{className:E.closeButton,iconProps:{iconName:"Cancel"},ariaLabel:_,onClick:y})),function(e,t){f.useImperativeHandle(e,(function(){return{focus:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.focus()}}}),[t])}(e.componentRef,s),f.createElement("div",{className:E.content,ref:c,role:"dialog",tabIndex:-1,"aria-labelledby":I,"aria-describedby":w,"data-is-focusable":!0},o,f.createElement(xh,d({isClickableOutsideFocusTrap:!0},T),f.createElement("div",{className:E.bodyContent},n,r,i,a)))})),PI={root:"ms-TeachingBubble",body:"ms-TeachingBubble-body",bodyContent:"ms-TeachingBubble-bodycontent",closeButton:"ms-TeachingBubble-closebutton",content:"ms-TeachingBubble-content",footer:"ms-TeachingBubble-footer",header:"ms-TeachingBubble-header",headerIsCondensed:"ms-TeachingBubble-header--condensed",headerIsSmall:"ms-TeachingBubble-header--small",headerIsLarge:"ms-TeachingBubble-header--large",headline:"ms-TeachingBubble-headline",image:"ms-TeachingBubble-image",primaryButton:"ms-TeachingBubble-primaryButton",secondaryButton:"ms-TeachingBubble-secondaryButton",subText:"ms-TeachingBubble-subText",button:"ms-Button",buttonLabel:"ms-Button-label"},MI=jo((function(){return J({"0%":{opacity:0,animationTimingFunction:Le.easeFunction1,transform:"scale3d(.90,.90,.90)"},"100%":{opacity:1,transform:"scale3d(1,1,1)"}})})),RI=function(e,t){var o=t||{},n=o.calloutWidth,r=o.calloutMaxWidth;return[{display:"block",maxWidth:364,border:0,outline:"transparent",width:n||"calc(100% + 1px)",animationName:""+MI(),animationDuration:"300ms",animationTimingFunction:"linear",animationFillMode:"both"},e&&{maxWidth:r||456}]},NI=function(e,t,o){return t?[e.headerIsCondensed,{marginBottom:14}]:[o&&e.headerIsSmall,!o&&e.headerIsLarge,{selectors:{":not(:last-child)":{marginBottom:14}}}]},BI=function(e){var t,o,n,r=e.hasCondensedHeadline,i=e.hasSmallHeadline,a=e.hasCloseButton,s=e.hasHeadline,l=e.isWide,c=e.primaryButtonClassName,u=e.secondaryButtonClassName,d=e.theme,p=e.calloutProps,h=void 0===p?{className:void 0,theme:d}:p,g=!r&&!i,f=d.palette,v=d.semanticColors,b=d.fonts,y=Qo(PI,d),_=To(d,{outlineColor:"transparent",borderColor:"transparent"});return{root:[y.root,b.medium,h.className],body:[y.body,a&&!s&&{marginRight:24},{selectors:{":not(:last-child)":{marginBottom:20}}}],bodyContent:[y.bodyContent,{padding:"20px 24px 20px 24px"}],closeButton:[y.closeButton,{position:"absolute",right:0,top:0,margin:"15px 15px 0 0",borderRadius:0,color:f.white,fontSize:b.small.fontSize,selectors:{":hover":{background:f.themeDarkAlt,color:f.white},":active":{background:f.themeDark,color:f.white},":focus":{border:"1px solid "+v.variantBorder}}}],content:m([y.content],RI(l),[l&&{display:"flex"}]),footer:[y.footer,{display:"flex",flex:"auto",alignItems:"center",color:f.white,selectors:(t={},t["."+y.button+":not(:first-child)"]={marginLeft:10},t)}],header:m([y.header],NI(y,r,i),[a&&{marginRight:24},(r||i)&&[b.medium,{fontWeight:qe.semibold}]]),headline:[y.headline,{margin:0,color:f.white,fontWeight:qe.semibold,overflowWrap:"break-word"},g&&[{fontSize:b.xLarge.fontSize}]],imageContent:[y.header,y.image,l&&{display:"flex",alignItems:"center",maxWidth:154}],primaryButton:[y.primaryButton,c,_,{backgroundColor:f.white,borderColor:f.white,color:f.themePrimary,whiteSpace:"nowrap",selectors:(o={},o["."+y.buttonLabel]=b.medium,o[":hover"]={backgroundColor:f.themeLighter,borderColor:f.themeLighter,color:f.themeDark},o[":focus"]={backgroundColor:f.themeLighter,border:"1px solid "+f.black,color:f.themeDark,outline:"1px solid "+f.white,outlineOffset:"-2px"},o[":active"]={backgroundColor:f.white,borderColor:f.white,color:f.themePrimary},o)}],secondaryButton:[y.secondaryButton,u,_,{backgroundColor:f.themePrimary,borderColor:f.white,whiteSpace:"nowrap",selectors:(n={},n["."+y.buttonLabel]=[b.medium,{color:f.white}],n[":hover"]={backgroundColor:f.themeDarkAlt,borderColor:f.white},n[":focus"]={backgroundColor:f.themeDark,border:"1px solid "+f.black,outline:"1px solid "+f.white,outlineOffset:"-2px"},n[":active"]={backgroundColor:f.themePrimary,borderColor:f.white},n)}],subText:[y.subText,{margin:0,fontSize:b.medium.fontSize,color:f.white,fontWeight:qe.regular}],subComponentStyles:{callout:{root:m(RI(l,h),[b.medium]),beak:[{background:f.themePrimary}],calloutMain:[{background:f.themePrimary}]}}}},FI=Vn(EI,BI,void 0,{scope:"TeachingBubbleContent"}),AI={beakWidth:16,gapSpace:0,setInitialFocus:!0,doNotLayer:!1,directionalHint:qs.rightCenter},LI=Jn(),HI=f.forwardRef((function(e,t){var o=f.useRef(null),n=Or(o,t),r=e.calloutProps,i=e.targetElement,a=e.onDismiss,s=e.hasCloseButton,l=void 0===s?e.hasCloseIcon:s,c=e.isWide,u=e.styles,p=e.theme,h=e.target,m=f.useMemo((function(){return d(d(d({},AI),r),{theme:p})}),[r,p]),g=LI(u,{theme:p,isWide:c,calloutProps:m,hasCloseButton:l}),v=g.subComponentStyles?g.subComponentStyles.callout:void 0;return function(e,t){f.useImperativeHandle(e,(function(){return{focus:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.focus()}}}),[t])}(e.componentRef,o),f.createElement(Cc,d({target:h||i,onDismiss:a},m,{className:g.root,styles:v,hideOverflow:!0}),f.createElement("div",{ref:n},f.createElement(FI,d({},e))))}));HI.displayName="TeachingBubble";var OI=Vn(HI,BI,void 0,{scope:"TeachingBubble"}),zI=function(e){if(null==e.children)return null;e.block,e.className;var t=e.as,o=void 0===t?"span":t,n=(e.variant,e.nowrap,p(e,["block","className","as","variant","nowrap"]));return $w(oI(e,{root:o}).root,d({},Tr(n,ir)))},WI=function(e,t){var o=e.as,n=e.className,r=e.block,i=e.nowrap,a=e.variant,s=t.fonts,l=t.semanticColors,c=s[a||"medium"];return{root:[c,{color:c.color||l.bodyText,display:r?"td"===o?"table-cell":"block":"inline",mozOsxFontSmoothing:c.MozOsxFontSmoothing,webkitFontSmoothing:c.WebkitFontSmoothing},i&&{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},n]}},VI=rI(zI,{displayName:"Text",styles:WI}),KI={9:/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/};function UI(e,t){if(void 0===t&&(t=KI),!e)return[];for(var o=[],n=0,r=0;r+n<e.length;r++){var i=e.charAt(r+n);if("\\"===i)n++;else{var a=t[i];a&&o.push({displayIndex:r,format:a})}}return o}function GI(e,t,o){var n=e;if(!n)return"";n=n.replace(/\\/g,"");var r=0;t.length>0&&(r=t[0].displayIndex-1);for(var i=0,a=t;i<a.length;i++){var s=a[i],l=" ";s.value?(l=s.value,s.displayIndex>r&&(r=s.displayIndex)):o&&(l=o),n=n.slice(0,s.displayIndex)+l+n.slice(s.displayIndex+1)}return o||(n=n.slice(0,r+1)),n}function jI(e,t){for(var o=0;o<e.length;o++)if(e[o].displayIndex>=t)return e[o].displayIndex;return e[e.length-1].displayIndex}function qI(e,t,o){for(var n=0;n<e.length;n++)if(e[n].displayIndex>=t){if(e[n].displayIndex>=t+o)break;e[n].value=void 0}return e}function YI(e,t,o){for(var n=0,r=0,i=!1,a=0;a<e.length&&n<o.length;a++)if(e[a].displayIndex>=t)for(i=!0,r=e[a].displayIndex;n<o.length;){if(e[a].format.test(o.charAt(n))){e[a].value=o.charAt(n++),a+1<e.length?r=e[a+1].displayIndex:r++;break}n++}return i?r:t}var ZI,XI,QI,JI="_",$I=f.forwardRef((function(e,t){var o=f.useRef(null),n=e.componentRef,r=e.onFocus,i=e.onBlur,a=e.onMouseDown,s=e.onMouseUp,l=e.onChange,c=e.onPaste,u=e.onKeyDown,p=e.mask,h=e.maskChar,m=void 0===h?JI:h,g=e.maskFormat,v=void 0===g?KI:g,b=e.value,y=Ei((function(){return{maskCharData:UI(p,v),isFocused:!1,moveCursorOnMouseUp:!1,changeSelectionData:null}})),_=f.useState(),C=_[0],S=_[1],x=f.useState((function(){return GI(p,y.maskCharData,m)})),k=x[0],w=x[1],I=f.useCallback((function(e){for(var t=0,o=0;t<e.length&&o<y.maskCharData.length;){var n=e[t];y.maskCharData[o].format.test(n)&&(y.maskCharData[o].value=n,o++),t++}}),[y]),D=f.useCallback((function(e){null==r||r(e),y.isFocused=!0;for(var t=0;t<y.maskCharData.length;t++)if(!y.maskCharData[t].value){S(y.maskCharData[t].displayIndex);break}}),[y,r]),T=f.useCallback((function(e){null==i||i(e),y.isFocused=!1,y.moveCursorOnMouseUp=!0}),[y,i]),E=f.useCallback((function(e){null==a||a(e),y.isFocused||(y.moveCursorOnMouseUp=!0)}),[y,a]),P=f.useCallback((function(e){if(null==s||s(e),y.moveCursorOnMouseUp){y.moveCursorOnMouseUp=!1;for(var t=0;t<y.maskCharData.length;t++)if(!y.maskCharData[t].value){S(y.maskCharData[t].displayIndex);break}}}),[y,s]),M=f.useCallback((function(e,t){if(null===y.changeSelectionData&&o.current&&(y.changeSelectionData={changeType:"default",selectionStart:null!==o.current.selectionStart?o.current.selectionStart:-1,selectionEnd:null!==o.current.selectionEnd?o.current.selectionEnd:-1}),y.changeSelectionData){var n=0,r=y.changeSelectionData,i=r.changeType,a=r.selectionStart,s=r.selectionEnd;if("textPasted"===i){var c=s-a,u=t.length+c-k.length,d=a,h=t.substr(d,u);c&&(y.maskCharData=qI(y.maskCharData,a,c)),n=YI(y.maskCharData,d,h)}else if("delete"===i||"backspace"===i){var g="delete"===i;(u=s-a)?(y.maskCharData=qI(y.maskCharData,a,u),n=jI(y.maskCharData,a)):g?(y.maskCharData=function(e,t){for(var o=0;o<e.length;o++)if(e[o].displayIndex>=t){e[o].value=void 0;break}return e}(y.maskCharData,a),n=jI(y.maskCharData,a)):(y.maskCharData=function(e,t){for(var o=e.length-1;o>=0;o--)if(e[o].displayIndex<t){e[o].value=void 0;break}return e}(y.maskCharData,a),n=function(e,t){for(var o=e.length-1;o>=0;o--)if(e[o].displayIndex<t)return e[o].displayIndex;return e[0].displayIndex}(y.maskCharData,a))}else if(t.length>k.length){d=s-(u=t.length-k.length);var f=t.substr(d,u);n=YI(y.maskCharData,d,f)}else if(t.length<=k.length){u=1;var v=k.length+u-t.length;d=s-u,f=t.substr(d,u),y.maskCharData=qI(y.maskCharData,d,v),n=YI(y.maskCharData,d,f)}y.changeSelectionData=null;var b=GI(p,y.maskCharData,m);w(b),S(n),null==l||l(e,b)}}),[k.length,y,p,m,l]),R=f.useCallback((function(e){if(null==u||u(e),y.changeSelectionData=null,o.current&&o.current.value){var t=e.keyCode,n=e.ctrlKey,r=e.metaKey;if(n||r)return;if(t===Un.backspace||t===Un.del){var i=e.target.selectionStart,a=e.target.selectionEnd;if(!(t===Un.backspace&&a&&a>0||t===Un.del&&null!==i&&i<o.current.value.length))return;y.changeSelectionData={changeType:t===Un.backspace?"backspace":"delete",selectionStart:null!==i?i:-1,selectionEnd:null!==a?a:-1}}}}),[y,u]),N=f.useCallback((function(e){null==c||c(e);var t=e.target.selectionStart,o=e.target.selectionEnd;y.changeSelectionData={changeType:"textPasted",selectionStart:null!==t?t:-1,selectionEnd:null!==o?o:-1}}),[y,c]);return f.useEffect((function(){y.maskCharData=UI(p,v),void 0!==b&&I(b),w(GI(p,y.maskCharData,m))}),[p,b]),f.useLayoutEffect((function(){void 0!==C&&o.current&&o.current.setSelectionRange(C,C)}),[C]),f.useEffect((function(){y.isFocused&&void 0!==C&&o.current&&o.current.setSelectionRange(C,C)})),function(e,t,o){f.useImperativeHandle(e,(function(){return{get value(){for(var e="",o=0;o<t.maskCharData.length;o++){if(!t.maskCharData[o].value)return;e+=t.maskCharData[o].value}return e},get selectionStart(){return o.current&&null!==o.current.selectionStart?o.current.selectionStart:-1},get selectionEnd(){return o.current&&o.current.selectionEnd?o.current.selectionEnd:-1},focus:function(){o.current&&o.current.focus()},blur:function(){o.current&&o.current.blur()},select:function(){o.current&&o.current.select()},setSelectionStart:function(e){o.current&&o.current.setSelectionStart(e)},setSelectionEnd:function(e){o.current&&o.current.setSelectionEnd(e)},setSelectionRange:function(e,t){o.current&&o.current.setSelectionRange(e,t)}}}),[t,o])}(n,y,o),f.createElement(Pg,d({},e,{elementRef:t,onFocus:D,onBlur:T,onMouseDown:E,onMouseUp:P,onChange:M,onKeyDown:R,onPaste:N,value:k||"",componentRef:o}))}));$I.displayName="MaskedTextField",function(e){e.shade30="#004578",e.shade20="#005a9e",e.shade10="#106ebe",e.primary="#0078d4",e.tint10="#2b88d8",e.tint20="#c7e0f4",e.tint30="#deecf9",e.tint40="#eff6fc"}(ZI||(ZI={})),function(e){e.black="#000000",e.gray220="#11100f",e.gray210="#161514",e.gray200="#1b1a19",e.gray190="#201f1e",e.gray180="#252423",e.gray170="#292827",e.gray160="#323130",e.gray150="#3b3a39",e.gray140="#484644",e.gray130="#605e5c",e.gray120="#797775",e.gray110="#8a8886",e.gray100="#979593",e.gray90="#a19f9d",e.gray80="#b3b0ad",e.gray70="#bebbb8",e.gray60="#c8c6c4",e.gray50="#d2d0ce",e.gray40="#e1dfdd",e.gray30="#edebe9",e.gray20="#f3f2f1",e.gray10="#faf9f8",e.white="#ffffff"}(XI||(XI={})),function(e){e.pinkRed10="#750b1c",e.red20="#a4262c",e.red10="#d13438",e.redOrange20="#603d30",e.redOrange10="#da3b01",e.orange30="#8e562e",e.orange20="#ca5010",e.orange10="#ffaa44",e.yellow10="#fce100",e.orangeYellow20="#986f0b",e.orangeYellow10="#c19c00",e.yellowGreen10="#8cbd18",e.green20="#0b6a0b",e.green10="#498205",e.greenCyan10="#00ad56",e.cyan40="#005e50",e.cyan30="#005b70",e.cyan20="#038387",e.cyan10="#00b7c3",e.cyanBlue20="#004e8c",e.cyanBlue10="#0078d4",e.blue10="#4f6bed",e.blueMagenta40="#373277",e.blueMagenta30="#5c2e91",e.blueMagenta20="#8764b8",e.blueMagenta10="#8378de",e.magenta20="#881798",e.magenta10="#c239b3",e.magentaPink20="#9b0062",e.magentaPink10="#e3008c",e.gray40="#393939",e.gray30="#7a7574",e.gray20="#69797e",e.gray10="#a0aeb2"}(QI||(QI={}));var eD,tD,oD,nD=J({from:{opacity:0},to:{opacity:1}}),rD=J({from:{opacity:1},to:{opacity:0}}),iD=J({from:{transform:"scale3d(1.15, 1.15, 1)"},to:{transform:"scale3d(1, 1, 1)"}}),aD=J({from:{transform:"scale3d(1, 1, 1)"},to:{transform:"scale3d(0.9, 0.9, 1)"}}),sD=J({from:{transform:"translate3d(0, 0, 0)"},to:{transform:"translate3d(-48px, 0, 0)"}}),lD=J({from:{transform:"translate3d(0, 0, 0)"},to:{transform:"translate3d(48px, 0, 0)"}}),cD=J({from:{transform:"translate3d(48px, 0, 0)"},to:{transform:"translate3d(0, 0, 0)"}}),uD=J({from:{transform:"translate3d(-48px, 0, 0)"},to:{transform:"translate3d(0, 0, 0)"}}),dD=J({from:{transform:"translate3d(0, 0, 0)"},to:{transform:"translate3d(0, -48px, 0)"}}),pD=J({from:{transform:"translate3d(0, 0, 0)"},to:{transform:"translate3d(0, 48px, 0)"}}),hD=J({from:{transform:"translate3d(0, 48px, 0)"},to:{transform:"translate3d(0, 0, 0)"}}),mD=J({from:{transform:"translate3d(0, -48px, 0)"},to:{transform:"translate3d(0, 0, 0)"}});function gD(e,t,o){return e+" "+t+" "+o}!function(e){e.duration1="100ms",e.duration2="200ms",e.duration3="300ms",e.duration4="400ms"}(eD||(eD={})),function(e){e.accelerate="cubic-bezier(0.9, 0.1, 1, 0.2)",e.decelerate="cubic-bezier(0.1, 0.9, 0.2, 1)",e.linear="cubic-bezier(0, 0, 1, 1)",e.standard="cubic-bezier(0.8, 0, 0.2, 1)"}(tD||(tD={})),function(e){e.fadeIn=gD(nD,eD.duration1,tD.linear),e.fadeOut=gD(rD,eD.duration1,tD.linear),e.scaleDownIn=gD(iD,eD.duration3,tD.decelerate),e.scaleDownOut=gD(aD,eD.duration3,tD.decelerate),e.slideLeftOut=gD(sD,eD.duration1,tD.accelerate),e.slideRightOut=gD(lD,eD.duration1,tD.accelerate),e.slideLeftIn=gD(cD,eD.duration1,tD.decelerate),e.slideRightIn=gD(uD,eD.duration1,tD.decelerate),e.slideUpOut=gD(dD,eD.duration1,tD.accelerate),e.slideDownOut=gD(pD,eD.duration1,tD.accelerate),e.slideUpIn=gD(hD,eD.duration1,tD.decelerate),e.slideDownIn=gD(mD,eD.duration1,tD.decelerate)}(oD||(oD={}));var fD=jt({});Pn("@fluentui/theme","2.3.1");var vD=f.createContext(void 0),bD=function(){var e=(0,f.useContext)(vD),t=zn(["theme"]).theme;return e||t||jt({})},yD=0,_D=function(){return yD},CD=function(e,t){return Dn(Array.isArray(e)?e:[e],t)};function SD(e){var t=new Map;return function(o){void 0===o&&(o={});var n=o.theme,r=Ol(),i=bD();n=n||i;var a=_D(),s="function"==typeof e,l=s?[a,r,n]:[a,r],c=function(e,t){for(var o=0,n=t;o<n.length;o++){var r=n[o];if(!(e=e.get(r)))return}return e}(t,l);if(!c){var u=s?e(n):e;c=CD(u,{targetWindow:r,rtl:!!n.rtl}),function(e,t,o){for(var n=0;n<t.length-1;n++){var r=t[n],i=e.get(r);i||(i=new Map,e.set(r,i)),e=i}e.set(t[t.length-1],o)}(t,l,c)}return c}}var xD=SD((function(e){var t=e.semanticColors,o=e.fonts;return{body:[{color:t.bodyText,background:t.bodyBackground,fontFamily:o.medium.fontFamily,fontWeight:o.medium.fontWeight,fontSize:o.medium.fontSize,MozOsxFontSmoothing:o.medium.MozOsxFontSmoothing,WebkitFontSmoothing:o.medium.WebkitFontSmoothing}]}}));var kD=function(e){var t=e.theme,o=e.customizerContext,n=e.as||"div",r="string"==typeof e.as?cv(e.as,e):Hs(e,["as"]);return f.createElement(vD.Provider,{value:t},f.createElement(On.Provider,{value:o},f.createElement(n,d({},r))))},wD=new Map,ID=f.forwardRef((function(e,t){var o=function(e,t){var o,n,r,i,a=tr(t,e);return n=(o=a).theme,r=bD(),i=o.theme=f.useMemo((function(){var e=Ut(r,n);return e.id=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var o=[],n=0,r=e;n<r.length;n++){var i=r[n];if(i){var a=i.id||wD.get(i);a||(a=Va(""),wD.set(i,a)),o.push(a)}}return o.join("-")}(r,n),e}),[r,n]),o.customizerContext=f.useMemo((function(){return{customizations:{inCustomizerContext:!0,settings:{theme:i},scopedSettings:i.components||{}}}}),[i]),o.theme.rtl!==r.rtl&&(o.dir=o.theme.rtl?"rtl":"ltr"),{state:a,render:kD}}(e,{ref:Or(t,f.useRef(null)),as:"div",applyTo:"element"}),n=o.render,r=o.state;return function(e){var t=xD(e),o=e.className,n=e.applyTo;!function(e,t){var o,n="body"===e.applyTo,r=null===(o=zl())||void 0===o?void 0:o.body;f.useEffect((function(){if(n&&r){for(var e=0,o=t;e<o.length;e++){var i=o[e];i&&r.classList.add(i)}return function(){if(n&&r)for(var e=0,o=t;e<o.length;e++){var i=o[e];i&&r.classList.remove(i)}}}}),[n,r,t])}(e,[t.root,t.body]),e.className=qr(o,t.root,"element"===n&&t.body)}(r),xs(r.ref),n(r)}));ID.displayName="ThemeProvider";var DD,TD,ED,PD=function(){function e(){}return e.setSlot=function(t,o,n,r,i){if(void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i=!0),t.color||!t.value)if(i){var a=void 0;if("string"==typeof o){if(!(a=Zm(o)))throw new Error("color is invalid in setSlot(): "+o)}else a=o;e._setSlot(t,a,n,r,i)}else t.color&&e._setSlot(t,t.color,n,r,i)},e.insureSlots=function(t,o){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(!r.inherits&&!r.value){if(!r.color)throw new Error("A color slot rule that does not inherit must provide its own color.");e._setSlot(r,r.color,o,!1,!1)}}},e.getThemeAsJson=function(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var n=e[o];t[n.name]=n.color?n.color.str:n.value||""}return t},e.getThemeAsCode=function(t){return e._makeRemainingCode("loadTheme({\n palette: {\n",t)},e.getThemeAsCodeWithCreateTheme=function(t){return e._makeRemainingCode("const myTheme = createTheme({\n palette: {\n",t)},e.getThemeAsSass=function(e){var t="";for(var o in e)if(e.hasOwnProperty(o)){var n=e[o],r=n.name.charAt(0).toLowerCase()+n.name.slice(1);t+=wp('${0}Color: "[theme: {1}, default: {2}]";\n',r,r,n.color?n.color.str:n.value||"")}return t},e.getThemeForPowerShell=function(e){var t="";for(var o in e)if(e.hasOwnProperty(o)){var n=e[o];if(n.value)continue;var r=n.name.charAt(0).toLowerCase()+n.name.slice(1),i=n.color?"#"+n.color.hex:n.value||"";n.color&&n.color.a&&100!==n.color.a&&(i+=String(n.color.a.toString(16))),t+=wp('"{0}" = "{1}";\n',r,i)}return"@{\n"+t+"}"},e._setSlot=function(t,o,n,r,i){if(void 0===i&&(i=!0),(t.color||!t.value)&&(i||!t.color||!t.isCustomized||!t.inherits)){!i&&t.isCustomized||r||!t.inherits||!mg(t.asShade)?(t.color=o,t.isCustomized=!0):(t.isBackgroundShade?t.color=yg(o,t.asShade,n):t.color=bg(o,t.asShade,n),t.isCustomized=!1);for(var a=0,s=t.dependentRules;a<s.length;a++){var l=s[a];e._setSlot(l,t.color,n,!1,i)}}},e._makeRemainingCode=function(e,t){for(var o in t)if(t.hasOwnProperty(o)){var n=t[o];e+=wp(" {0}: '{1}',\n",n.name.charAt(0).toLowerCase()+n.name.slice(1),n.color?"#"+n.color.hex:n.value||"")}return e+" }});"},e}();function MD(){var e={};function t(t,o,n,r){void 0===r&&(r=!1);var i=e[DD[o]],a={name:t,inherits:i,asShade:n,isCustomized:!1,isBackgroundShade:r,dependentRules:[]};e[t]=a,i.dependentRules.push(a)}return As(DD,(function(t){e[t]={name:t,isCustomized:!0,dependentRules:[]},As(ig,(function(o,n){if(o!==ig[ig.Unshaded]){var r=e[t],i={name:t+o,inherits:e[t],asShade:n,isCustomized:!1,isBackgroundShade:t===DD[DD.backgroundColor],dependentRules:[]};e[t+o]=i,r.dependentRules.push(i)}}))})),e[DD[DD.primaryColor]].color=Zm("#0078d4"),e[DD[DD.backgroundColor]].color=Zm("#ffffff"),e[DD[DD.foregroundColor]].color=Zm("#323130"),t(TD[TD.themePrimary],DD.primaryColor,ig.Unshaded),t(TD[TD.themeLighterAlt],DD.primaryColor,ig.Shade1),t(TD[TD.themeLighter],DD.primaryColor,ig.Shade2),t(TD[TD.themeLight],DD.primaryColor,ig.Shade3),t(TD[TD.themeTertiary],DD.primaryColor,ig.Shade4),t(TD[TD.themeSecondary],DD.primaryColor,ig.Shade5),t(TD[TD.themeDarkAlt],DD.primaryColor,ig.Shade6),t(TD[TD.themeDark],DD.primaryColor,ig.Shade7),t(TD[TD.themeDarker],DD.primaryColor,ig.Shade8),t(TD[TD.neutralLighterAlt],DD.backgroundColor,ig.Shade1,!0),t(TD[TD.neutralLighter],DD.backgroundColor,ig.Shade2,!0),t(TD[TD.neutralLight],DD.backgroundColor,ig.Shade3,!0),t(TD[TD.neutralQuaternaryAlt],DD.backgroundColor,ig.Shade4,!0),t(TD[TD.neutralQuaternary],DD.backgroundColor,ig.Shade5,!0),t(TD[TD.neutralTertiaryAlt],DD.backgroundColor,ig.Shade6,!0),t(TD[TD.neutralTertiary],DD.foregroundColor,ig.Shade3),t(TD[TD.neutralSecondary],DD.foregroundColor,ig.Shade4),t(TD[TD.neutralPrimaryAlt],DD.foregroundColor,ig.Shade5),t(TD[TD.neutralPrimary],DD.foregroundColor,ig.Unshaded),t(TD[TD.neutralDark],DD.foregroundColor,ig.Shade7),t(TD[TD.black],DD.foregroundColor,ig.Shade8),t(TD[TD.white],DD.backgroundColor,ig.Unshaded,!0),e[TD[TD.neutralLighterAlt]].color=Zm("#faf9f8"),e[TD[TD.neutralLighter]].color=Zm("#f3f2f1"),e[TD[TD.neutralLight]].color=Zm("#edebe9"),e[TD[TD.neutralQuaternaryAlt]].color=Zm("#e1dfdd"),e[TD[TD.neutralDark]].color=Zm("#201f1e"),e[TD[TD.neutralTertiaryAlt]].color=Zm("#c8c6c4"),e[TD[TD.black]].color=Zm("#000000"),e[TD[TD.neutralDark]].color=Zm("#201f1e"),e[TD[TD.neutralPrimaryAlt]].color=Zm("#3b3a39"),e[TD[TD.neutralSecondary]].color=Zm("#605e5c"),e[TD[TD.neutralTertiary]].color=Zm("#a19f9d"),e[TD[TD.white]].color=Zm("#ffffff"),e[TD[TD.themeDarker]].color=Zm("#004578"),e[TD[TD.themeDark]].color=Zm("#005a9e"),e[TD[TD.themeDarkAlt]].color=Zm("#106ebe"),e[TD[TD.themeSecondary]].color=Zm("#2b88d8"),e[TD[TD.themeTertiary]].color=Zm("#71afe5"),e[TD[TD.themeLight]].color=Zm("#c7e0f4"),e[TD[TD.themeLighter]].color=Zm("#deecf9"),e[TD[TD.themeLighterAlt]].color=Zm("#eff6fc"),e[TD[TD.neutralLighterAlt]].isCustomized=!0,e[TD[TD.neutralLighter]].isCustomized=!0,e[TD[TD.neutralLight]].isCustomized=!0,e[TD[TD.neutralQuaternaryAlt]].isCustomized=!0,e[TD[TD.neutralDark]].isCustomized=!0,e[TD[TD.neutralTertiaryAlt]].isCustomized=!0,e[TD[TD.black]].isCustomized=!0,e[TD[TD.neutralDark]].isCustomized=!0,e[TD[TD.neutralPrimaryAlt]].isCustomized=!0,e[TD[TD.neutralSecondary]].isCustomized=!0,e[TD[TD.neutralTertiary]].isCustomized=!0,e[TD[TD.white]].isCustomized=!0,e[TD[TD.themeDarker]].isCustomized=!0,e[TD[TD.themeDark]].isCustomized=!0,e[TD[TD.themeDarkAlt]].isCustomized=!0,e[TD[TD.themePrimary]].isCustomized=!0,e[TD[TD.themeSecondary]].isCustomized=!0,e[TD[TD.themeTertiary]].isCustomized=!0,e[TD[TD.themeLight]].isCustomized=!0,e[TD[TD.themeLighter]].isCustomized=!0,e[TD[TD.themeLighterAlt]].isCustomized=!0,e}!function(e){e[e.primaryColor=0]="primaryColor",e[e.backgroundColor=1]="backgroundColor",e[e.foregroundColor=2]="foregroundColor"}(DD||(DD={})),function(e){e[e.themePrimary=0]="themePrimary",e[e.themeLighterAlt=1]="themeLighterAlt",e[e.themeLighter=2]="themeLighter",e[e.themeLight=3]="themeLight",e[e.themeTertiary=4]="themeTertiary",e[e.themeSecondary=5]="themeSecondary",e[e.themeDarkAlt=6]="themeDarkAlt",e[e.themeDark=7]="themeDark",e[e.themeDarker=8]="themeDarker",e[e.neutralLighterAlt=9]="neutralLighterAlt",e[e.neutralLighter=10]="neutralLighter",e[e.neutralLight=11]="neutralLight",e[e.neutralQuaternaryAlt=12]="neutralQuaternaryAlt",e[e.neutralQuaternary=13]="neutralQuaternary",e[e.neutralTertiaryAlt=14]="neutralTertiaryAlt",e[e.neutralTertiary=15]="neutralTertiary",e[e.neutralSecondary=16]="neutralSecondary",e[e.neutralPrimaryAlt=17]="neutralPrimaryAlt",e[e.neutralPrimary=18]="neutralPrimary",e[e.neutralDark=19]="neutralDark",e[e.black=20]="black",e[e.white=21]="white"}(TD||(TD={})),function(e){e[e.bodyBackground=0]="bodyBackground",e[e.bodyText=1]="bodyText",e[e.disabledBackground=2]="disabledBackground",e[e.disabledText=3]="disabledText"}(ED||(ED={}));var RD=/((1[0-2]|0?[1-9]):([0-5][0-9]):(?:[0-5]\d) ?([AaPp][Mm]))$/,ND=/((1[0-2]|0?[1-9]):([0-5][0-9]) ?([AaPp][Mm]))$/,BD=/([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)$/,FD=/([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:[0-5]\d)$/,AD=function(e){var t=e.label,o=e.increments,n=void 0===o?30:o,r=e.showSeconds,i=void 0!==r&&r,a=e.allowFreeform,s=void 0===a||a,l=e.useHour12,c=void 0!==l&&l,u=e.timeRange,h=e.strings,m=void 0===h?function(e,t){var o=e?"12-hour":"24-hour";return{invalidInputErrorMessage:t?"TimePicker format must be valid and in the "+o+" format hh:mm:ss A.":"TimePicker format must be valid and in the "+o+" format hh:mm A."}}(c,i):h,g=e.onFormatDate,v=e.onValidateUserInput,b=e.onChange,y=p(e,["label","increments","showSeconds","allowFreeform","useHour12","timeRange","strings","onFormatDate","onValidateUserInput","onChange"]),_=f.useState(""),C=_[0],S=_[1],x=f.useState(""),k=x[0],w=x[1],I=OD(n,u),D=f.useMemo((function(){for(var e=Array(I),t=0;t<I;t++)e[t]=0;var o=HD(n,u);return e.map((function(e,t){var r,a,s=(r=n*t,(a=new Date(o.getTime())).setTime(a.getTime()+r*ep.MinutesInOneHour*ep.MillisecondsIn1Sec),a);s.setSeconds(0);var l=g?g(s):function(e,t,o){return e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",second:t?"2-digit":void 0,hour12:o})}(s,i,c);return{key:l,text:l}}))}),[u,n,I,i,g,c]),T=f.useState(D[0].key),E=T[0],P=T[1],M=f.useCallback((function(e,t,o,n){b&&b(e,t,o,n);var r=null==t?void 0:t.key,a="",l="";n?(s&&!t&&(g?v&&(l=v(n)):l=function(e){var t="";return(c?i?RD:ND:i?BD:FD).test(e)||(t=m.invalidInputErrorMessage),t}(n)),a=n):t&&(a=t.text),w(l),S(a),P(r)}),[s,g,v,i,c,b,m.invalidInputErrorMessage]);return f.createElement(lf,d({},y,{allowFreeform:s,selectedKey:E,label:t,errorMessage:k,options:D,onChange:M,text:C,onKeyPress:function(e){g||e.charCode>=Un.zero&&e.charCode<=Un.colon||e.charCode===Un.space||e.charCode===Un.a||e.charCode===Un.m||e.charCode===Un.p||e.preventDefault()}}))};AD.displayName="TimePicker";var LD=function(e){return{start:Math.min(Math.max(e.start,0),23),end:Math.min(Math.max(e.end,0),23)}},HD=function(e,t){var o=new Date;if(t){var n=LD(t);o.setHours(n.start)}return function(e,t){var o=new Date(e.getTime()),n=o.getMinutes();if(ep.MinutesInOneHour%t)o.setMinutes(0);else{for(var r=ep.MinutesInOneHour/t,i=1;i<=r;i++)if(n>t*(i-1)&&n<=t*i){n=t*i;break}o.setMinutes(n)}return o}(o,e)},OD=function(e,t){var o=ep.HoursInOneDay;if(t){var n=LD(t);n.start>n.end?o=ep.HoursInOneDay-t.start-t.end:t.end>t.start&&(o=t.end-t.start)}return Math.floor(ep.MinutesInOneHour*o/e)},zD=Jn(),WD="Toggle",VD=f.forwardRef((function(e,t){var o=e.as,n=void 0===o?"div":o,r=e.ariaLabel,i=e.checked,a=e.className,s=e.defaultChecked,l=void 0!==s&&s,c=e.disabled,u=e.inlineLabel,p=e.label,h=e.offAriaLabel,m=e.offText,g=e.onAriaLabel,v=e.onChange,b=e.onChanged,y=e.onClick,_=e.onText,C=e.role,S=e.styles,x=e.theme,k=gh(i,l,f.useCallback((function(e,t){null==v||v(e,t),null==b||b(t)}),[v,b])),w=k[0],I=k[1],D=zD(S,{theme:x,className:a,disabled:c,checked:w,inlineLabel:u,onOffMissing:!_&&!m}),T=w?g:h,E=Kd(WD,e.id),P=E+"-label",M=E+"-stateText",R=w?_:m,N=Tr(e,hr,["defaultChecked"]),B=void 0;r||T||(p&&(B=P),R&&(B=B?B+" "+M:M));var F=f.useRef(null);xs(F),KD(e,w,F),Mi({name:WD,props:e,deprecations:{offAriaLabel:void 0,onAriaLabel:"ariaLabel",onChanged:"onChange"},mutuallyExclusive:{checked:"defaultChecked"}});var A={root:{className:D.root,hidden:N.hidden},label:{children:p,className:D.label,htmlFor:E,id:P},container:{className:D.container},pill:d(d({},N),{"aria-disabled":c,"aria-checked":w,"aria-label":r||T,"aria-labelledby":B,className:D.pill,"data-is-focusable":!0,"data-ktp-target":!0,disabled:c,id:E,onClick:function(e){c||(I(!w,e),y&&y(e))},ref:F,role:C||"switch",type:"button"}),thumb:{className:D.thumb},stateText:{children:R,className:D.text,htmlFor:E,id:M}};return f.createElement(n,d({ref:t},A.root),p&&f.createElement(Oh,d({},A.label)),f.createElement("div",d({},A.container),f.createElement("button",d({},A.pill),f.createElement("span",d({},A.thumb))),(w&&_||m)&&f.createElement(Oh,d({},A.stateText))))}));VD.displayName="ToggleBase";var KD=function(e,t,o){f.useImperativeHandle(e.componentRef,(function(){return{get checked(){return!!t},focus:function(){o.current&&o.current.focus()}}}),[t,o])},UD=Vn(VD,(function(e){var t,o,n,r,i,a,s,l=e.theme,c=e.className,u=e.disabled,p=e.checked,h=e.inlineLabel,m=e.onOffMissing,g=l.semanticColors,f=l.palette,v=g.bodyBackground,b=g.inputBackgroundChecked,y=g.inputBackgroundCheckedHovered,_=f.neutralDark,C=g.disabledBodySubtext,S=g.smallInputBorder,x=g.inputForegroundChecked,k=g.disabledBodySubtext,w=g.disabledBackground,I=g.smallInputBorder,D=g.inputBorderHovered,T=g.disabledBodySubtext,E=g.disabledText;return{root:["ms-Toggle",p&&"is-checked",!u&&"is-enabled",u&&"is-disabled",l.fonts.medium,{marginBottom:"8px"},h&&{display:"flex",alignItems:"center"},c],label:["ms-Toggle-label",{display:"inline-block"},u&&{color:E,selectors:(t={},t[ro]={color:"GrayText"},t)},h&&!m&&{marginRight:16},m&&h&&{order:1,marginLeft:16},h&&{wordBreak:"break-word"}],container:["ms-Toggle-innerContainer",{display:"flex",position:"relative"}],pill:["ms-Toggle-background",To(l,{inset:-3}),{fontSize:"20px",boxSizing:"border-box",width:40,height:20,borderRadius:10,transition:"all 0.1s ease",border:"1px solid "+I,background:v,cursor:"pointer",display:"flex",alignItems:"center",padding:"0 3px"},!u&&[!p&&{selectors:{":hover":[{borderColor:D}],":hover .ms-Toggle-thumb":[{backgroundColor:_,selectors:(o={},o[ro]={borderColor:"Highlight"},o)}]}},p&&[{background:b,borderColor:"transparent",justifyContent:"flex-end"},{selectors:(n={":hover":[{backgroundColor:y,borderColor:"transparent",selectors:(r={},r[ro]={backgroundColor:"Highlight"},r)}]},n[ro]=d({backgroundColor:"Highlight"},{forcedColorAdjust:"none",MsHighContrastAdjust:"none"}),n)}]],u&&[{cursor:"default"},!p&&[{borderColor:T}],p&&[{backgroundColor:C,borderColor:"transparent",justifyContent:"flex-end"}]],!u&&{selectors:{"&:hover":{selectors:(i={},i[ro]={borderColor:"Highlight"},i)}}}],thumb:["ms-Toggle-thumb",{display:"block",width:12,height:12,borderRadius:"50%",transition:"all 0.1s ease",backgroundColor:S,borderColor:"transparent",borderWidth:6,borderStyle:"solid",boxSizing:"border-box"},!u&&p&&[{backgroundColor:x,selectors:(a={},a[ro]={backgroundColor:"Window",borderColor:"Window"},a)}],u&&[!p&&[{backgroundColor:k}],p&&[{backgroundColor:w}]]],text:["ms-Toggle-stateText",{selectors:{"&&":{padding:"0",margin:"0 8px",userSelect:"none",fontWeight:qe.regular}}},u&&{selectors:{"&&":{color:E,selectors:(s={},s[ro]={color:"GrayText"},s)}}}]}}),void 0,{scope:"Toggle"}),GD=function(){return"undefined"!=typeof performance&&performance.now?performance.now():Date.now()},jD=function(){function e(){}return e.measure=function(t,o){e._timeoutId&&e.setPeriodicReset();var n=GD();o();var r=GD(),i=e.summary[t]||{totalDuration:0,count:0,all:[]},a=r-n;i.totalDuration+=a,i.count++,i.all.push({duration:a,timeStamp:r}),e.summary[t]=i},e.reset=function(){e.summary={},clearTimeout(e._timeoutId),e._timeoutId=NaN},e.setPeriodicReset=function(){e._timeoutId=setTimeout((function(){return e.reset()}),18e4)},e.summary={},e}(),qD="undefined"!=typeof WeakMap?new WeakMap:void 0;function YD(e){var t=function(t){function o(){var o=null!==t&&t.apply(this,arguments)||this;return o.state={Component:qD?qD.get(e.load):void 0},o}return u(o,t),o.prototype.render=function(){var e=this.props,t=e.forwardedRef,o=e.asyncPlaceholder,n=p(e,["forwardedRef","asyncPlaceholder"]),r=this.state.Component;return r?f.createElement(r,d(d({},n),{ref:t})):o?f.createElement(o,null):null},o.prototype.componentDidMount=function(){var t=this;this.state.Component||e.load().then((function(o){o&&(qD&&qD.set(e.load,o),t.setState({Component:o},e.onLoad))})).catch(e.onError)},o}(f.Component);return f.forwardRef((function(e,o){return f.createElement(t,d({},e,{forwardedRef:o}))}))}function ZD(e){throw new Error("Unexpected object: "+e)}function XD(e,t){void 0===t&&(t=!0);var o=[];if(e){for(var n=0;n<e.children.length;n++)o.push(e.children.item(n));t&&fa(e)&&o.push.apply(o,e._virtual.children)}return o}function QD(e){var t,o=e||at();o&&!0!==(null===(t=o.FabricConfig)||void 0===t?void 0:t.disableFocusRects)&&(o.__hasInitializeFocusRects__||(o.__hasInitializeFocusRects__=!0,o.addEventListener("mousedown",JD,!0),o.addEventListener("pointerdown",$D,!0),o.addEventListener("keydown",eT,!0)))}function JD(e){Do(!1,e.target)}function $D(e){"mouse"!==e.pointerType&&Do(!1,e.target)}function eT(e){ys(e.which)&&Do(!0,e.target)}var tT="";function oT(e){return tT+e}function nT(e){tT=e}var rT=function(e){var t;return function(o,n){t||(t=new Set,Ki(e,{componentWillUnmount:function(){t.forEach((function(e){return clearTimeout(e)}))}}));var r=setTimeout((function(){t.delete(r),o()}),n);t.add(r)}};Pn("@fluentui/utilities","8.3.1");var iT=d(d({},$d),{prevWeekAriaLabel:"Previous week",nextWeekAriaLabel:"Next week",prevMonthAriaLabel:"Go to previous month",nextMonthAriaLabel:"Go to next month",prevYearAriaLabel:"Go to previous year",nextYearAriaLabel:"Go to next year",closeButtonAriaLabel:"Close date picker"}),aT={leftNavigation:"ChevronLeft",rightNavigation:"ChevronRight"},sT=Jn(),lT=function(e){function t(t){var o=e.call(this,t)||this;o._dayGrid=f.createRef(),o._onSelectDate=function(e){var t=o.props.onSelectDate;o.setState({selectedDate:e}),o._focusOnUpdate=!0,t&&t(e)},o._onNavigateDate=function(e,t){var n=o.props.onNavigateDate;o.setState({navigatedDate:e}),o._focusOnUpdate=t,n&&n(e)},o._renderPreviousWeekNavigationButton=function(e){var t,n=o.props,r=n.minDate,i=n.firstDayOfWeek,a=n.navigationIcons,s=o.state.navigatedDate,l=jn()?a.rightNavigation:a.leftNavigation,c=!r||dp(r,fp(s,i))<0;return f.createElement("button",{className:qr(e.navigationIconButton,(t={},t[e.disabledStyle]=!c,t)),disabled:!c,"aria-disabled":!c,onClick:c?o._onSelectPrevDateRange:void 0,onKeyDown:c?o._onButtonKeyDown(o._onSelectPrevDateRange):void 0,title:o._createPreviousWeekAriaLabel(),type:"button"},f.createElement(ii,{iconName:l}))},o._renderNextWeekNavigationButton=function(e){var t,n=o.props,r=n.maxDate,i=n.firstDayOfWeek,a=n.navigationIcons,s=o.state.navigatedDate,l=jn()?a.leftNavigation:a.rightNavigation,c=!r||dp(tp(fp(s,i),7),r)<0;return f.createElement("button",{className:qr(e.navigationIconButton,(t={},t[e.disabledStyle]=!c,t)),disabled:!c,"aria-disabled":!c,onClick:c?o._onSelectNextDateRange:void 0,onKeyDown:c?o._onButtonKeyDown(o._onSelectNextDateRange):void 0,title:o._createNextWeekAriaLabel(),type:"button"},f.createElement(ii,{iconName:l}))},o._onSelectPrevDateRange=function(){o.props.showFullMonth?o._navigateDate(np(o.state.navigatedDate,-1)):o._navigateDate(tp(o.state.navigatedDate,-7))},o._onSelectNextDateRange=function(){o.props.showFullMonth?o._navigateDate(np(o.state.navigatedDate,1)):o._navigateDate(tp(o.state.navigatedDate,7))},o._navigateDate=function(e){o.setState({navigatedDate:e}),o.props.onNavigateDate&&o.props.onNavigateDate(e)},o._onWrapperKeyDown=function(e){switch(e.which){case Un.enter:case Un.backspace:e.preventDefault()}},o._onButtonKeyDown=function(e){return function(t){switch(t.which){case Un.enter:e()}}},o._onTouchStart=function(e){var t=e.touches[0];t&&(o._initialTouchX=t.clientX)},o._onTouchMove=function(e){var t=jn(),n=e.touches[0];n&&void 0!==o._initialTouchX&&n.clientX!==o._initialTouchX&&((n.clientX-o._initialTouchX)*(t?-1:1)<0?o._onSelectNextDateRange():o._onSelectPrevDateRange(),o._initialTouchX=void 0)},o._createPreviousWeekAriaLabel=function(){var e=o.props,t=e.strings,n=e.showFullMonth,r=e.firstDayOfWeek,i=o.state.navigatedDate,a=void 0;if(n&&t.prevMonthAriaLabel)a=t.prevMonthAriaLabel+" "+t.months[np(i,-1).getMonth()];else if(!n&&t.prevWeekAriaLabel){var s=fp(tp(i,-7),r),l=tp(s,6);a=t.prevWeekAriaLabel+" "+o._formatDateRange(s,l)}return a},o._createNextWeekAriaLabel=function(){var e=o.props,t=e.strings,n=e.showFullMonth,r=e.firstDayOfWeek,i=o.state.navigatedDate,a=void 0;if(n&&t.nextMonthAriaLabel)a=t.nextMonthAriaLabel+" "+t.months[np(i,1).getMonth()];else if(!n&&t.nextWeekAriaLabel){var s=fp(tp(i,7),r),l=tp(s,6);a=t.nextWeekAriaLabel+" "+o._formatDateRange(s,l)}return a},o._formatDateRange=function(e,t){var n=o.props,r=n.dateTimeFormatter,i=n.strings;return(null==r?void 0:r.formatMonthDayYear(e,i))+" - "+(null==r?void 0:r.formatMonthDayYear(t,i))},Ui(o);var n=t.initialDate&&!isNaN(t.initialDate.getTime())?t.initialDate:t.today||new Date;return o.state={selectedDate:n,navigatedDate:n,previousShowFullMonth:!!t.showFullMonth,animationDirection:t.animationDirection},o._focusOnUpdate=!1,o}return u(t,e),t.getDerivedStateFromProps=function(e,t){var o=e.initialDate&&!isNaN(e.initialDate.getTime())?e.initialDate:e.today||new Date,n=!!e.showFullMonth,r=n!==t.previousShowFullMonth?Ap.Vertical:Ap.Horizontal;return up(o,t.selectedDate)?{selectedDate:o,navigatedDate:t.navigatedDate,previousShowFullMonth:n,animationDirection:r}:{selectedDate:o,navigatedDate:o,previousShowFullMonth:n,animationDirection:r}},t.prototype.focus=function(){this._dayGrid&&this._dayGrid.current&&this._dayGrid.current.focus()},t.prototype.render=function(){var e=this.props,t=e.strings,o=e.dateTimeFormatter,n=e.firstDayOfWeek,r=e.minDate,i=e.maxDate,a=e.restrictedDates,s=e.today,l=e.styles,c=e.theme,u=e.className,h=e.showFullMonth,m=e.weeksToShow,g=p(e,["strings","dateTimeFormatter","firstDayOfWeek","minDate","maxDate","restrictedDates","today","styles","theme","className","showFullMonth","weeksToShow"]),v=sT(l,{theme:c,className:u});return f.createElement("div",{className:v.root,onKeyDown:this._onWrapperKeyDown,onTouchStart:this._onTouchStart,onTouchMove:this._onTouchMove,"aria-expanded":h},this._renderPreviousWeekNavigationButton(v),f.createElement(zp,d({styles:l,componentRef:this._dayGrid,strings:t,selectedDate:this.state.selectedDate,navigatedDate:this.state.navigatedDate,firstDayOfWeek:n,firstWeekOfYear:Yd.FirstDay,dateRangeType:Zd.Day,weeksToShow:h?m:1,dateTimeFormatter:o,minDate:r,maxDate:i,restrictedDates:a,onSelectDate:this._onSelectDate,onNavigateDate:this._onNavigateDate,today:s,lightenDaysOutsideNavigatedMonth:h,animationDirection:this.state.animationDirection},g)),this._renderNextWeekNavigationButton(v))},t.prototype.componentDidUpdate=function(){this._focusOnUpdate&&(this.focus(),this._focusOnUpdate=!1)},t.defaultProps={onSelectDate:void 0,initialDate:void 0,today:new Date,firstDayOfWeek:jd.Sunday,strings:iT,navigationIcons:aT,dateTimeFormatter:Jd,animationDirection:Ap.Horizontal},t}(f.Component),cT={root:"ms-WeeklyDayPicker-root"},uT=Vn(lT,(function(e){var t,o=e.className,n=e.theme,r=n.palette,i=Qo(cT,n);return{root:[i.root,on,{width:220,padding:12,boxSizing:"content-box",display:"flex",alignItems:"center",flexDirection:"row"},o],dayButton:{borderRadius:"100%"},dayIsToday:{},dayCell:{borderRadius:"100%!important"},daySelected:{},navigationIconButton:[To(n,{inset:0}),{width:12,minWidth:12,height:0,overflow:"hidden",padding:0,margin:0,border:"none",display:"flex",alignItems:"center",backgroundColor:r.neutralLighter,fontSize:je.small,fontFamily:"inherit",selectors:(t={},t["."+i.root+":hover &, ."+wo+" ."+i.root+":focus &, ."+wo+" &:focus"]={height:53,minHeight:12,overflow:"initial"},t["."+wo+" ."+i.root+":focus-within &"]={height:53,minHeight:12,overflow:"initial"},t["&:hover"]={cursor:"pointer",backgroundColor:r.neutralLight},t["&:active"]={backgroundColor:r.neutralTertiary},t)}],disabledStyle:{selectors:{"&, &:disabled, & button":{color:r.neutralTertiaryAlt,pointerEvents:"none"}}}}}),void 0,{scope:"WeeklyDayPicker"});Pn("@fluentui/react-window-provider","2.1.4"),rS(),FluentUIReact=t}(); //# sourceMappingURL=fluentui-react.js.map
src/js/reducer/distorter-event-reducer.js
aratakokubun/cursor-hijack
'use strict'; import React from 'react'; import { handleActions } from 'redux-actions'; import * as _ from 'lodash'; import ActionTypes from '../action/action-types'; import Distorter from '../service/distorter/distorter'; import format from 'string-format'; import * as sortOn from 'sort-on'; const createInitialState = () => ( { distorters: [] } ) const mergeAddState = (state, action) => { const addDistorters = _.filter(action.distorters, (addDistorter) => { if (!(addDistorter instanceof Distorter)) { console.warn( format("Type of arg should be {0}, but actually {1}", typeof Distorter, typeof addDistorter) ); return false; } else if (_.some(state.distorters, (alreadySet) => alreadySet.equals(addDistorter))) { console.warn( format("Distorter with key {0} is already set.", addDistorter.getKey()) ); return false; } else { return true; } }); return { distorters: _.concat(state.distorters, addDistorters) } } const mergeDeleteState = (state, action) => ( { distorters: _.remove(_.assign({}, state.distorters), (distorter) => ( _.some(action.distorters, (other) => { return distorter.eqauls(other); }) )) } ) const distorterEventReducer = handleActions({ [ActionTypes.ADD_DISTORTER_EVENT]: (state, action) => mergeAddState(state, action), [ActionTypes.DELETE_DISTORTER_EVENT]: (state, action) => mergeDeleteState(state, action), }, createInitialState()); export default distorterEventReducer;
frontend/components/PostcodeFormatter.js
datoszs/czech-lawyers
import React from 'react'; import PropTypes from 'prop-types'; const PostcodeFormatter = ({value}) => ( <span>{value.substring(0, 3)}&nbsp;{value.substring(3, 5)}</span> ); PostcodeFormatter.propTypes = { value: PropTypes.string.isRequired, }; export default PostcodeFormatter;
stories/AvailabilityEdit.stories.js
nekuno/client
import React from 'react'; import { storiesOf, forceReRender } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links' import AvailabilityEdit from '../src/js/components/Availability/AvailabilityEdit/AvailabilityEdit.js'; import {INFINITE_CALENDAR_BLUE_THEME, INFINITE_CALENDAR_THEME} from "../src/js/constants/InfiniteCalendarConstants"; let availability = null; const save = function(newAvailability) { availability = newAvailability; forceReRender(); }; storiesOf('AvailabilityEdit', module) .add('default', () => ( <AvailabilityEdit theme={INFINITE_CALENDAR_THEME} availability={availability} onSave={save}/> )) .add('theme', () => ( <AvailabilityEdit theme={INFINITE_CALENDAR_BLUE_THEME} color={'blue'} availability={availability} onSave={save}/> ));
src/components/dictator/Name.js
pekkis/diktaattoriporssi-2016
import React from 'react'; export default function Name({identity}) { return ( <span className="dictator-name">{identity.displayName}</span> ); }
src/svg-icons/image/filter-9-plus.js
skarnecki/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageFilter9Plus = (props) => ( <SvgIcon {...props}> <path d="M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 7V8c0-1.11-.9-2-2-2h-1c-1.1 0-2 .89-2 2v1c0 1.11.9 2 2 2h1v1H9v2h3c1.1 0 2-.89 2-2zm-3-3V8h1v1h-1zm10-8H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 8h-2V7h-2v2h-2v2h2v2h2v-2h2v6H7V3h14v6z"/> </SvgIcon> ); ImageFilter9Plus = pure(ImageFilter9Plus); ImageFilter9Plus.displayName = 'ImageFilter9Plus'; export default ImageFilter9Plus;
local-cli/link/__tests__/android/applyPatch.spec.js
skevy/react-native
/** * Copyright (c) 2013-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. */ 'use strict'; jest.autoMockOff(); const applyParams = require('../../android/patches/applyParams'); describe('applyParams', () => { it('apply params to the string', () => { expect( applyParams('${foo}', {foo: 'foo'}, 'react-native') ).toEqual('getResources().getString(R.string.reactNative_foo)'); }); it('use null if no params provided', () => { expect( applyParams('${foo}', {}, 'react-native') ).toEqual('null'); }); });
packages/material-ui-icons/src/CropRotateRounded.js
kybarg/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M16 9v5h2V8c0-1.1-.9-2-2-2h-6v2h5c.55 0 1 .45 1 1zm3 7H9c-.55 0-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v1H5c-.55 0-1 .45-1 1s.45 1 1 1h1v8c0 1.1.9 2 2 2h8v1c0 .55.45 1 1 1s1-.45 1-1v-1h1c.55 0 1-.45 1-1s-.45-1-1-1zM17.66 1.4C15.99.51 13.83-.11 11.39.04l3.81 3.81 1.33-1.33c3.09 1.46 5.34 4.37 5.89 7.86.06.41.44.69.86.62.41-.06.69-.45.62-.86-.6-3.8-2.96-7-6.24-8.74zM7.47 21.49c-3.09-1.46-5.34-4.37-5.89-7.86-.06-.41-.44-.69-.86-.62-.41.06-.69.45-.62.86.6 3.81 2.96 7.01 6.24 8.75 1.67.89 3.83 1.51 6.27 1.36L8.8 20.16l-1.33 1.33z" /> , 'CropRotateRounded');
public/assets/mui-0.9.16/extra/mui-react-combined.js
nunoblue/ts-react
(function (global) { var babelHelpers = global.babelHelpers = {}; babelHelpers.classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; babelHelpers.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; }; }(); babelHelpers.extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; babelHelpers.inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; babelHelpers.interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { default: obj }; }; babelHelpers.interopRequireWildcard = function (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; } }; babelHelpers.objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; babelHelpers.possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; })(typeof global === "undefined" ? self : global);(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){ // shim for using process in browser var process = module.exports = {}; process.nextTick = (function () { var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener ; if (canSetImmediate) { return function (f) { return window.setImmediate(f) }; } if (canPost) { var queue = []; window.addEventListener('message', function (ev) { var source = ev.source; if ((source === window || source === null) && ev.data === 'process-tick') { ev.stopPropagation(); if (queue.length > 0) { var fn = queue.shift(); fn(); } } }, true); return function nextTick(fn) { queue.push(fn); window.postMessage('process-tick', '*'); }; } return function nextTick(fn) { setTimeout(fn, 0); }; })(); process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); } // TODO(shtylman) process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; },{}],2:[function(require,module,exports){ 'use strict'; /** * MUI React main module * @module react/main */ (function (win) { // return if library has been loaded already if (win._muiReactLoaded) return;else win._muiReactLoaded = true; var mui = win.mui = win.mui || [], react = mui.react = {}, lib; react.Appbar = require('src/react/appbar'); react.Button = require('src/react/button'); react.Caret = require('src/react/caret'); react.Checkbox = require('src/react/checkbox'); react.Col = require('src/react/col'); react.Container = require('src/react/container'); react.Divider = require('src/react/divider'); react.Dropdown = require('src/react/dropdown'), react.DropdownItem = require('src/react/dropdown-item'), react.Form = require('src/react/form'); react.Input = require('src/react/input'); react.Option = require('src/react/option'); react.Panel = require('src/react/panel'); react.Radio = require('src/react/radio'); react.Row = require('src/react/row'); react.Select = require('src/react/select'); react.Tab = require('src/react/tab'); react.Tabs = require('src/react/tabs'); react.Textarea = require('src/react/textarea'); })(window); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNkbi1yZWFjdC5qcyJdLCJuYW1lcyI6WyJ3aW4iLCJfbXVpUmVhY3RMb2FkZWQiLCJtdWkiLCJyZWFjdCIsImxpYiIsIkFwcGJhciIsInJlcXVpcmUiLCJCdXR0b24iLCJDYXJldCIsIkNoZWNrYm94IiwiQ29sIiwiQ29udGFpbmVyIiwiRGl2aWRlciIsIkRyb3Bkb3duIiwiRHJvcGRvd25JdGVtIiwiRm9ybSIsIklucHV0IiwiT3B0aW9uIiwiUGFuZWwiLCJSYWRpbyIsIlJvdyIsIlNlbGVjdCIsIlRhYiIsIlRhYnMiLCJUZXh0YXJlYSIsIndpbmRvdyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7QUFLQSxDQUFDLFVBQVNBLEdBQVQsRUFBYztBQUNiO0FBQ0EsTUFBSUEsSUFBSUMsZUFBUixFQUF5QixPQUF6QixLQUNLRC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cmVxdWlyZSgnc3JjL3JlYWN0L2Ryb3Bkb3duJyksXG4gIHJlYWN0LkRyb3Bkb3duSXRlbSA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9kcm9wZG93bi1pdGVtJyksXG4gIHJlYWN0LkZvcm0gPSByZXF1aXJlKCdzcmMvcmVhY3QvZm9ybScpO1xuICByZWFjdC5JbnB1dCA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9pbnB1dCcpO1xuICByZWFjdC5PcHRpb24gPSByZXF1aXJlKCdzcmMvcmVhY3Qvb3B0aW9uJyk7XG4gIHJlYWN0LlBhbmVsID0gcmVxdWlyZSgnc3JjL3JlYWN0L3BhbmVsJyk7XG4gIHJlYWN0LlJhZGlvID0gcmVxdWlyZSgnc3JjL3JlYWN0L3JhZGlvJyk7XG4gIHJlYWN0LlJvdyA9IHJlcXVpcmUoJ3NyYy9yZWFjdC9yb3cnKTtcbiAgcmVhY3QuU2VsZWN0ID0gcmVxdWlyZSgnc3JjL3JlYWN0L3NlbGVjdCcpO1xuICByZWFjdC5UYWIgPSByZXF1aXJlKCdzcmMvcmVhY3QvdGFiJyk7XG4gIHJlYWN0LlRhYnMgPSByZXF1aXJlKCdzcmMvcmVhY3QvdGFicycpO1xuICByZWFjdC5UZXh0YXJlYSA9IHJlcXVpcmUoJ3NyYy9yZWFjdC90ZXh0YXJlYScpO1xufSkod2luZG93KTtcbiJdfQ== },{"src/react/appbar":15,"src/react/button":16,"src/react/caret":17,"src/react/checkbox":18,"src/react/col":19,"src/react/container":20,"src/react/divider":21,"src/react/dropdown":23,"src/react/dropdown-item":22,"src/react/form":24,"src/react/input":25,"src/react/option":26,"src/react/panel":27,"src/react/radio":28,"src/react/row":29,"src/react/select":30,"src/react/tab":31,"src/react/tabs":32,"src/react/textarea":33}],3:[function(require,module,exports){ 'use strict'; /** * MUI Combined React module * @module react/mui-combined */ (function (win) { // return if library has already been loaded if (win._muiReactCombinedLoaded) return;else win._muiReactCombinedLoaded = true; var util = require('src/js/lib/util'); // load css util.loadStyle(require('mui.min.css')); // load js require('./cdn-react'); })(window); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZha2VfZTg1OWRlNmIuanMiXSwibmFtZXMiOlsid2luIiwiX211aVJlYWN0Q29tYmluZWRMb2FkZWQiLCJ1dGlsIiwicmVxdWlyZSIsImxvYWRTdHlsZSIsIndpbmRvdyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7OztBQUlBLENBQUMsVUFBU0EsR0FBVCxFQUFjO0FBQ2I7QUFDQSxNQUFJQSxJQUFJQyx1QkFBUixFQUFpQyxPQUFqQyxLQUNLRCxJQUFJQyx1QkFBSixHQUE4QixJQUE5Qjs7QUFFTCxNQUFJQyxPQUFPQyxRQUFRLGlCQUFSLENBQVg7O0FBRUE7QUFDQUQsT0FBS0UsU0FBTCxDQUFlRCxRQUFRLGFBQVIsQ0FBZjs7QUFFQTtBQUNBQSxVQUFRLGFBQVI7QUFDRCxDQVpELEVBWUdFLE1BWkgiLCJmaWxlIjoiZmFrZV9lODU5ZGU2Yi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIENvbWJpbmVkIFJlYWN0IG1vZHVsZVxuICogQG1vZHVsZSByZWFjdC9tdWktY29tYmluZWRcbiAqL1xuKGZ1bmN0aW9uKHdpbikge1xuICAvLyByZXR1cm4gaWYgbGlicmFyeSBoYXMgYWxyZWFkeSBiZWVuIGxvYWRlZFxuICBpZiAod2luLl9tdWlSZWFjdENvbWJpbmVkTG9hZGVkKSByZXR1cm47XG4gIGVsc2Ugd2luLl9tdWlSZWFjdENvbWJpbmVkTG9hZGVkID0gdHJ1ZTtcblxuICB2YXIgdXRpbCA9IHJlcXVpcmUoJ3NyYy9qcy9saWIvdXRpbCcpO1xuXG4gIC8vIGxvYWQgY3NzXG4gIHV0aWwubG9hZFN0eWxlKHJlcXVpcmUoJ211aS5taW4uY3NzJykpO1xuXG4gIC8vIGxvYWQganNcbiAgcmVxdWlyZSgnLi9jZG4tcmVhY3QnKTtcbn0pKHdpbmRvdyk7XG4iXX0= },{"./cdn-react":2,"mui.min.css":13,"src/js/lib/util":14}],4:[function(require,module,exports){ "use strict"; /** * MUI config module * @module config */ /** Define module API */ module.exports = { /** Use debug mode */ debug: true }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbmZpZy5qcyJdLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwiZGVidWciXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7O0FBS0E7QUFDQUEsT0FBT0MsT0FBUCxHQUFpQjtBQUNmO0FBQ0FDLFNBQU87QUFGUSxDQUFqQiIsImZpbGUiOiJjb25maWcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBjb25maWcgbW9kdWxlXG4gKiBAbW9kdWxlIGNvbmZpZ1xuICovXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xubW9kdWxlLmV4cG9ydHMgPSB7XG4gIC8qKiBVc2UgZGVidWcgbW9kZSAqL1xuICBkZWJ1ZzogdHJ1ZVxufTtcbiJdfQ== },{}],5:[function(require,module,exports){ /** * MUI CSS/JS form helpers module * @module lib/forms.py */ 'use strict'; var wrapperPadding = 15, // from CSS inputHeight = 32, // from CSS rowHeight = 42, // from CSS menuPadding = 8; // from CSS /** * Menu position/size/scroll helper * @returns {Object} Object with keys 'height', 'top', 'scrollTop' */ function getMenuPositionalCSSFn(wrapperEl, numRows, selectedRow) { var viewHeight = document.documentElement.clientHeight; // determine 'height' var h = numRows * rowHeight + 2 * menuPadding, height = Math.min(h, viewHeight); // determine 'top' var top, initTop, minTop, maxTop; initTop = menuPadding + rowHeight - (wrapperPadding + inputHeight); initTop -= selectedRow * rowHeight; minTop = -1 * wrapperEl.getBoundingClientRect().top; maxTop = viewHeight - height + minTop; top = Math.min(Math.max(initTop, minTop), maxTop); // determine 'scrollTop' var scrollTop = 0, scrollIdeal, scrollMax; if (h > viewHeight) { scrollIdeal = menuPadding + (selectedRow + 1) * rowHeight - (-1 * top + wrapperPadding + inputHeight); scrollMax = numRows * rowHeight + 2 * menuPadding - height; scrollTop = Math.min(scrollIdeal, scrollMax); } return { 'height': height + 'px', 'top': top + 'px', 'scrollTop': scrollTop }; } /** Define module API */ module.exports = { getMenuPositionalCSS: getMenuPositionalCSSFn }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvcm1zLmpzIl0sIm5hbWVzIjpbIndyYXBwZXJQYWRkaW5nIiwiaW5wdXRIZWlnaHQiLCJyb3dIZWlnaHQiLCJtZW51UGFkZGluZyIsImdldE1lbnVQb3NpdGlvbmFsQ1NTRm4iLCJ3cmFwcGVyRWwiLCJudW1Sb3dzIiwic2VsZWN0ZWRSb3ciLCJ2aWV3SGVpZ2h0IiwiZG9jdW1lbnQiLCJkb2N1bWVudEVsZW1lbnQiLCJjbGllbnRIZWlnaHQiLCJoIiwiaGVpZ2h0IiwiTWF0aCIsIm1pbiIsInRvcCIsImluaXRUb3AiLCJtaW5Ub3AiLCJtYXhUb3AiLCJnZXRCb3VuZGluZ0NsaWVudFJlY3QiLCJtYXgiLCJzY3JvbGxUb3AiLCJzY3JvbGxJZGVhbCIsInNjcm9sbE1heCIsIm1vZHVsZSIsImV4cG9ydHMiLCJnZXRNZW51UG9zaXRpb25hbENTUyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7O0FBRUEsSUFBSUEsaUJBQWlCLEVBQXJCO0FBQUEsSUFBMEI7QUFDdEJDLGNBQWMsRUFEbEI7QUFBQSxJQUN1QjtBQUNuQkMsWUFBWSxFQUZoQjtBQUFBLElBRXFCO0FBQ2pCQyxjQUFjLENBSGxCLEMsQ0FHc0I7OztBQUd0Qjs7OztBQUlBLFNBQVNDLHNCQUFULENBQWdDQyxTQUFoQyx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qL1xubW9kdWxlLmV4cG9ydHMgPSB7XG4gIGdldE1lbnVQb3NpdGlvbmFsQ1NTOiBnZXRNZW51UG9zaXRpb25hbENTU0ZuXG59O1xuIl19 },{}],6:[function(require,module,exports){ /** * MUI CSS/JS jqLite module * @module lib/jqLite */ 'use strict'; /** * Add a class to an element. * @param {Element} element - The DOM element. * @param {string} cssClasses - Space separated list of class names. */ function jqLiteAddClass(element, cssClasses) { if (!cssClasses || !element.setAttribute) return; var existingClasses = _getExistingClasses(element), splitClasses = cssClasses.split(' '), cssClass; for (var i = 0; i < splitClasses.length; i++) { cssClass = splitClasses[i].trim(); if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) { existingClasses += cssClass + ' '; } } element.setAttribute('class', existingClasses.trim()); } /** * Get or set CSS properties. * @param {Element} element - The DOM element. * @param {string} [name] - The property name. * @param {string} [value] - The property value. */ function jqLiteCss(element, name, value) { // Return full style object if (name === undefined) { return getComputedStyle(element); } var nameType = jqLiteType(name); // Set multiple values if (nameType === 'object') { for (var key in name) { element.style[_camelCase(key)] = name[key]; }return; } // Set a single value if (nameType === 'string' && value !== undefined) { element.style[_camelCase(name)] = value; } var styleObj = getComputedStyle(element), isArray = jqLiteType(name) === 'array'; // Read single value if (!isArray) return _getCurrCssProp(element, name, styleObj); // Read multiple values var outObj = {}, key; for (var i = 0; i < name.length; i++) { key = name[i]; outObj[key] = _getCurrCssProp(element, key, styleObj); } return outObj; } /** * Check if element has class. * @param {Element} element - The DOM element. * @param {string} cls - The class name string. */ function jqLiteHasClass(element, cls) { if (!cls || !element.getAttribute) return false; return _getExistingClasses(element).indexOf(' ' + cls + ' ') > -1; } /** * Return the type of a variable. * @param {} somevar - The JavaScript variable. */ function jqLiteType(somevar) { // handle undefined if (somevar === undefined) return 'undefined'; // handle others (of type [object <Type>]) var typeStr = Object.prototype.toString.call(somevar); if (typeStr.indexOf('[object ') === 0) { return typeStr.slice(8, -1).toLowerCase(); } else { throw new Error("MUI: Could not understand type: " + typeStr); } } /** * Attach an event handler to a DOM element * @param {Element} element - The DOM element. * @param {string} events - Space separated event names. * @param {Function} callback - The callback function. * @param {Boolean} useCapture - Use capture flag. */ function jqLiteOn(element, events, callback, useCapture) { useCapture = useCapture === undefined ? false : useCapture; var cache = element._muiEventCache = element._muiEventCache || {}; events.split(' ').map(function (event) { // add to DOM element.addEventListener(event, callback, useCapture); // add to cache cache[event] = cache[event] || []; cache[event].push([callback, useCapture]); }); } /** * Remove an event handler from a DOM element * @param {Element} element - The DOM element. * @param {string} events - Space separated event names. * @param {Function} callback - The callback function. * @param {Boolean} useCapture - Use capture flag. */ function jqLiteOff(element, events, callback, useCapture) { useCapture = useCapture === undefined ? false : useCapture; // remove from cache var cache = element._muiEventCache = element._muiEventCache || {}, argsList, args, i; events.split(' ').map(function (event) { argsList = cache[event] || []; i = argsList.length; while (i--) { args = argsList[i]; // remove all events if callback is undefined if (callback === undefined || args[0] === callback && args[1] === useCapture) { // remove from cache argsList.splice(i, 1); // remove from DOM element.removeEventListener(event, args[0], args[1]); } } }); } /** * Attach an event hander which will only execute once per element per event * @param {Element} element - The DOM element. * @param {string} events - Space separated event names. * @param {Function} callback - The callback function. * @param {Boolean} useCapture - Use capture flag. */ function jqLiteOne(element, events, callback, useCapture) { events.split(' ').map(function (event) { jqLiteOn(element, event, function onFn(ev) { // execute callback if (callback) callback.apply(this, arguments); // remove wrapper jqLiteOff(element, event, onFn, useCapture); }, useCapture); }); } /** * Get or set horizontal scroll position * @param {Element} element - The DOM element * @param {number} [value] - The scroll position */ function jqLiteScrollLeft(element, value) { var win = window; // get if (value === undefined) { if (element === win) { var docEl = document.documentElement; return (win.pageXOffset || docEl.scrollLeft) - (docEl.clientLeft || 0); } else { return element.scrollLeft; } } // set if (element === win) win.scrollTo(value, jqLiteScrollTop(win));else element.scrollLeft = value; } /** * Get or set vertical scroll position * @param {Element} element - The DOM element * @param {number} value - The scroll position */ function jqLiteScrollTop(element, value) { var win = window; // get if (value === undefined) { if (element === win) { var docEl = document.documentElement; return (win.pageYOffset || docEl.scrollTop) - (docEl.clientTop || 0); } else { return element.scrollTop; } } // set if (element === win) win.scrollTo(jqLiteScrollLeft(win), value);else element.scrollTop = value; } /** * Return object representing top/left offset and element height/width. * @param {Element} element - The DOM element. */ function jqLiteOffset(element) { var win = window, rect = element.getBoundingClientRect(), scrollTop = jqLiteScrollTop(win), scrollLeft = jqLiteScrollLeft(win); return { top: rect.top + scrollTop, left: rect.left + scrollLeft, height: rect.height, width: rect.width }; } /** * Attach a callback to the DOM ready event listener * @param {Function} fn - The callback function. */ function jqLiteReady(fn) { var done = false, top = true, doc = document, win = doc.defaultView, root = doc.documentElement, add = doc.addEventListener ? 'addEventListener' : 'attachEvent', rem = doc.addEventListener ? 'removeEventListener' : 'detachEvent', pre = doc.addEventListener ? '' : 'on'; var init = function init(e) { if (e.type == 'readystatechange' && doc.readyState != 'complete') { return; } (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false); if (!done && (done = true)) fn.call(win, e.type || e); }; var poll = function poll() { try { root.doScroll('left'); } catch (e) { setTimeout(poll, 50);return; } init('poll'); }; if (doc.readyState == 'complete') { fn.call(win, 'lazy'); } else { if (doc.createEventObject && root.doScroll) { try { top = !win.frameElement; } catch (e) {} if (top) poll(); } doc[add](pre + 'DOMContentLoaded', init, false); doc[add](pre + 'readystatechange', init, false); win[add](pre + 'load', init, false); } } /** * Remove classes from a DOM element * @param {Element} element - The DOM element. * @param {string} cssClasses - Space separated list of class names. */ function jqLiteRemoveClass(element, cssClasses) { if (!cssClasses || !element.setAttribute) return; var existingClasses = _getExistingClasses(element), splitClasses = cssClasses.split(' '), cssClass; for (var i = 0; i < splitClasses.length; i++) { cssClass = splitClasses[i].trim(); while (existingClasses.indexOf(' ' + cssClass + ' ') >= 0) { existingClasses = existingClasses.replace(' ' + cssClass + ' ', ' '); } } element.setAttribute('class', existingClasses.trim()); } // ------------------------------ // Utilities // ------------------------------ var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g, MOZ_HACK_REGEXP = /^moz([A-Z])/, ESCAPE_REGEXP = /([.*+?^=!:${}()|\[\]\/\\])/g; function _getExistingClasses(element) { var classes = (element.getAttribute('class') || '').replace(/[\n\t]/g, ''); return ' ' + classes + ' '; } function _camelCase(name) { return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) { return offset ? letter.toUpperCase() : letter; }).replace(MOZ_HACK_REGEXP, 'Moz$1'); } function _escapeRegExp(string) { return string.replace(ESCAPE_REGEXP, "\\$1"); } function _getCurrCssProp(elem, name, computed) { var ret; // try computed style ret = computed.getPropertyValue(name); // try style attribute (if element is not attached to document) if (ret === '' && !elem.ownerDocument) ret = elem.style[_camelCase(name)]; return ret; } /** * Module API */ module.exports = { /** Add classes */ addClass: jqLiteAddClass, /** Get or set CSS properties */ css: jqLiteCss, /** Check for class */ hasClass: jqLiteHasClass, /** Remove event handlers */ off: jqLiteOff, /** Return offset values */ offset: jqLiteOffset, /** Add event handlers */ on: jqLiteOn, /** Add an execute-once event handler */ one: jqLiteOne, /** DOM ready event handler */ ready: jqLiteReady, /** Remove classes */ removeClass: jqLiteRemoveClass, /** Check JavaScript variable instance type */ type: jqLiteType, /** Get or set horizontal scroll position */ scrollLeft: jqLiteScrollLeft, /** Get or set vertical scroll position */ scrollTop: jqLiteScrollTop }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImpxTGl0ZS5qcyJdLCJuYW1lcyI6WyJqcUxpdGVBZGRDbGFzcyIsImVsZW1lbnQiLCJjc3NDbGFzc2VzIiwic2V0QXR0cmlidXRlIiwiZXhpc3RpbmdDbGFzc2VzIiwiX2dldEV4aXN0aW5nQ2xhc3NlcyIsInNwbGl0Q2xhc3NlcyIsInNwbGl0IiwiY3NzQ2xhc3MiLCJpIiwibGVuZ3RoIiwidHJpbSIsImluZGV4T2YiLCJqcUxpdGVDc3MiLCJuYW1lIiwidmFsdWUiLCJ1bmRlZmluZWQi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VDbGFzczoganFMaXRlUmVtb3ZlQ2xhc3MsXG5cbiAgLyoqIENoZWNrIEphdmFTY3JpcHQgdmFyaWFibGUgaW5zdGFuY2UgdHlwZSAqL1xuICB0eXBlOiBqcUxpdGVUeXBlLFxuXG4gIC8qKiBHZXQgb3Igc2V0IGhvcml6b250YWwgc2Nyb2xsIHBvc2l0aW9uICovXG4gIHNjcm9sbExlZnQ6IGpxTGl0ZVNjcm9sbExlZnQsXG5cbiAgLyoqIEdldCBvciBzZXQgdmVydGljYWwgc2Nyb2xsIHBvc2l0aW9uICovXG4gIHNjcm9sbFRvcDoganFMaXRlU2Nyb2xsVG9wXG59O1xuIl19 },{}],7:[function(require,module,exports){ /** * MUI CSS/JS utilities module * @module lib/util */ 'use strict'; var config = require('../config'), jqLite = require('./jqLite'), scrollLock = 0, scrollLockCls = 'mui-scroll-lock', scrollLockPos, scrollStyleEl, scrollEventHandler, _scrollBarWidth, _supportsPointerEvents; scrollEventHandler = function scrollEventHandler(ev) { // stop propagation on window scroll events if (!ev.target.tagName) ev.stopImmediatePropagation(); }; /** * Logging function */ function logFn() { var win = window; if (config.debug && typeof win.console !== "undefined") { try { win.console.log.apply(win.console, arguments); } catch (a) { var e = Array.prototype.slice.call(arguments); win.console.log(e.join("\n")); } } } /** * Load CSS text in new stylesheet * @param {string} cssText - The css text. */ function loadStyleFn(cssText) { var doc = document, head; // copied from jQuery head = doc.head || doc.getElementsByTagName('head')[0] || doc.documentElement; var e = doc.createElement('style'); e.type = 'text/css'; if (e.styleSheet) e.styleSheet.cssText = cssText;else e.appendChild(doc.createTextNode(cssText)); // add to document head.insertBefore(e, head.firstChild); return e; } /** * Raise an error * @param {string} msg - The error message. */ function raiseErrorFn(msg, useConsole) { if (useConsole) { if (typeof console !== 'undefined') console.error('MUI Warning: ' + msg); } else { throw new Error('MUI: ' + msg); } } /** * Convert Classname object, with class as key and true/false as value, to an * class string. * @param {Object} classes The classes * @return {String} class string */ function classNamesFn(classes) { var cs = ''; for (var i in classes) { cs += classes[i] ? i + ' ' : ''; } return cs.trim(); } /** * Check if client supports pointer events. */ function supportsPointerEventsFn() { // check cache if (_supportsPointerEvents !== undefined) return _supportsPointerEvents; var element = document.createElement('x'); element.style.cssText = 'pointer-events:auto'; _supportsPointerEvents = element.style.pointerEvents === 'auto'; return _supportsPointerEvents; } /** * Create callback closure. * @param {Object} instance - The object instance. * @param {String} funcName - The name of the callback function. */ function callbackFn(instance, funcName) { return function () { instance[funcName].apply(instance, arguments); }; } /** * Dispatch event. * @param {Element} element - The DOM element. * @param {String} eventType - The event type. * @param {Boolean} bubbles=true - If true, event bubbles. * @param {Boolean} cancelable=true = If true, event is cancelable * @param {Object} [data] - Data to add to event object */ function dispatchEventFn(element, eventType, bubbles, cancelable, data) { var ev = document.createEvent('HTMLEvents'), bubbles = bubbles !== undefined ? bubbles : true, cancelable = cancelable !== undefined ? cancelable : true, k; ev.initEvent(eventType, bubbles, cancelable); // add data to event object if (data) for (k in data) { ev[k] = data[k]; } // dispatch if (element) element.dispatchEvent(ev); return ev; } /** * Turn on window scroll lock. */ function enableScrollLockFn() { // increment counter scrollLock += 1; // add lock if (scrollLock === 1) { var doc = document, win = window, htmlEl = doc.documentElement, bodyEl = doc.body, scrollBarWidth = getScrollBarWidth(), cssProps, cssStr, x; // define scroll lock class dynamically cssProps = ['overflow:hidden']; if (scrollBarWidth) { // scrollbar-y if (htmlEl.scrollHeight > htmlEl.clientHeight) { x = parseInt(jqLite.css(bodyEl, 'padding-right')) + scrollBarWidth; cssProps.push('padding-right:' + x + 'px'); } // scrollbar-x if (htmlEl.scrollWidth > htmlEl.clientWidth) { x = parseInt(jqLite.css(bodyEl, 'padding-bottom')) + scrollBarWidth; cssProps.push('padding-bottom:' + x + 'px'); } } // define css class dynamically cssStr = '.' + scrollLockCls + '{'; cssStr += cssProps.join(' !important;') + ' !important;}'; scrollStyleEl = loadStyleFn(cssStr); // cancel 'scroll' event listener callbacks jqLite.on(win, 'scroll', scrollEventHandler, true); // add scroll lock scrollLockPos = { left: jqLite.scrollLeft(win), top: jqLite.scrollTop(win) }; jqLite.addClass(bodyEl, scrollLockCls); } } /** * Turn off window scroll lock. * @param {Boolean} resetPos - Reset scroll position to original value. */ function disableScrollLockFn(resetPos) { // ignore if (scrollLock === 0) return; // decrement counter scrollLock -= 1; // remove lock if (scrollLock === 0) { // remove scroll lock and delete style element jqLite.removeClass(document.body, scrollLockCls); scrollStyleEl.parentNode.removeChild(scrollStyleEl); // restore scroll position if (resetPos) window.scrollTo(scrollLockPos.left, scrollLockPos.top); // restore scroll event listeners jqLite.off(window, 'scroll', scrollEventHandler, true); } } /** * Return scroll bar width. */ var getScrollBarWidth = function getScrollBarWidth() { // check cache if (_scrollBarWidth !== undefined) return _scrollBarWidth; // calculate scroll bar width var doc = document, bodyEl = doc.body, el = doc.createElement('div'); el.innerHTML = '<div style="width:50px;height:50px;position:absolute;' + 'left:-50px;top:-50px;overflow:auto;"><div style="width:1px;' + 'height:100px;"></div></div>'; el = el.firstChild; bodyEl.appendChild(el); _scrollBarWidth = el.offsetWidth - el.clientWidth; bodyEl.removeChild(el); return _scrollBarWidth; }; /** * requestAnimationFrame polyfilled * @param {Function} callback - The callback function */ function requestAnimationFrameFn(callback) { var fn = window.requestAnimationFrame; if (fn) fn(callback);else setTimeout(callback, 0); } /** * Define the module API */ module.exports = { /** Create callback closures */ callback: callbackFn, /** Classnames object to string */ classNames: classNamesFn, /** Disable scroll lock */ disableScrollLock: disableScrollLockFn, /** Dispatch event */ dispatchEvent: dispatchEventFn, /** Enable scroll lock */ enableScrollLock: enableScrollLockFn, /** Log messages to the console when debug is turned on */ log: logFn, /** Load CSS text as new stylesheet */ loadStyle: loadStyleFn, /** Raise MUI error */ raiseError: raiseErrorFn, /** Request animation frame */ requestAnimationFrame: requestAnimationFrameFn, /** Support Pointer Events check */ supportsPointerEvents: supportsPointerEventsFn }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2V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helpers * @module react/_helpers */ 'use strict'; var controlledMessage = 'You provided a `value` prop to a form field ' + 'without an `OnChange` handler. Please see React documentation on ' + 'controlled components'; /** Module export */ module.exports = { controlledMessage: controlledMessage }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIl9oZWxwZXJzLmpzIl0sIm5hbWVzIjpbImNvbnRyb2xsZWRNZXNzYWdlIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7O0FBR0EsSUFBTUEsb0JBQW9CLGlEQUN4QixtRUFEd0IsR0FFeEIsdUJBRkY7O0FBS0E7QUFDQUMsT0FBT0MsT0FBUCxHQUFpQixFQUFFRixvQ0FBRixFQUFqQiIsImZpbGUiOiJfaGVscGVycy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IGhlbHBlcnNcbiAqIEBtb2R1bGUgcmVhY3QvX2hlbHBlcnNcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cblxuY29uc3QgY29udHJvbGxlZE1lc3NhZ2UgPSAnWW91IHByb3ZpZGVkIGEgYHZhbHVlYCBwcm9wIHRvIGEgZm9ybSBmaWVsZCAnICtcbiAgJ3dpdGhvdXQgYW4gYE9uQ2hhbmdlYCBoYW5kbGVyLiBQbGVhc2Ugc2VlIFJlYWN0IGRvY3VtZW50YXRpb24gb24gJyArXG4gICdjb250cm9sbGVkIGNvbXBvbmVudHMnO1xuXG5cbi8qKiBNb2R1bGUgZXhwb3J0ICovXG5tb2R1bGUuZXhwb3J0cyA9IHsgY29udHJvbGxlZE1lc3NhZ2UgfTtcbiJdfQ== },{}],9:[function(require,module,exports){ /** * MUI React button module * @module react/button */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var btnClass = 'mui-btn', btnAttrs = { color: 1, variant: 1, size: 1 }; /** * Button element * @class */ var Button = function (_React$Component) { babelHelpers.inherits(Button, _React$Component); function Button(props) { babelHelpers.classCallCheck(this, Button); var _this = babelHelpers.possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props)); _this.state = { ripple: null }; var cb = util.callback; _this.onMouseDownCB = cb(_this, 'onMouseDown'); _this.onMouseUpCB = cb(_this, 'onMouseUp'); _this.onMouseLeaveCB = cb(_this, 'onMouseLeave'); _this.onTouchStartCB = cb(_this, 'onTouchStart'); _this.onTouchEndCB = cb(_this, 'onTouchEnd'); return _this; } babelHelpers.createClass(Button, [{ key: 'componentDidMount', value: function componentDidMount() { // disable MUI js var el = this.refs.buttonEl; el._muiDropdown = true; el._muiRipple = true; } }, { key: 'onMouseDown', value: function onMouseDown(ev) { this.showRipple(ev); // execute callback var fn = this.props.onMouseDown; fn && fn(ev); } }, { key: 'onMouseUp', value: function onMouseUp(ev) { this.hideRipple(ev); // execute callback var fn = this.props.onMouseUp; fn && fn(ev); } }, { key: 'onMouseLeave', value: function onMouseLeave(ev) { this.hideRipple(ev); // execute callback var fn = this.props.onMouseLeave; fn && fn(ev); } }, { key: 'onTouchStart', value: function onTouchStart(ev) { this.showRipple(ev); // execute callback var fn = this.props.onTouchStart; fn && fn(ev); } }, { key: 'onTouchEnd', value: function onTouchEnd(ev) { this.hideRipple(ev); // execute callback var fn = this.props.onTouchEnd; fn && fn(ev); } }, { key: 'showRipple', value: function showRipple(ev) { var buttonEl = this.refs.buttonEl; // de-dupe touch events if ('ontouchstart' in buttonEl && ev.type === 'mousedown') return; // get (x, y) position of click var offset = jqLite.offset(this.refs.buttonEl), clickEv = void 0; if (ev.type === 'touchstart' && ev.touches) clickEv = ev.touches[0];else clickEv = ev; // calculate radius var radius = Math.sqrt(offset.width * offset.width + offset.height * offset.height); // add ripple to state this.setState({ ripple: { top: Math.round(clickEv.pageY - offset.top - radius) + 'px', left: Math.round(clickEv.pageX - offset.left - radius) + 'px', diameter: radius * 2 + 'px' } }); } }, { key: 'hideRipple', value: function hideRipple(ev) { this.setState({ ripple: null }); } }, { key: 'componentDidUpdate', value: function componentDidUpdate(prevProps, prevState) { var _this2 = this; var ripple = this.state.ripple; // trigger ripple animation if (ripple && !prevState.ripple) { util.requestAnimationFrame(function () { ripple.isAnimating = true; _this2.setState({ ripple: ripple }); }); } } }, { key: 'render', value: function render() { var cls = btnClass, rippleCls = 'mui-ripple', rippleStyle = void 0, k = void 0, v = void 0; var ripple = this.state.ripple; var _props = this.props, color = _props.color, size = _props.size, variant = _props.variant, reactProps = babelHelpers.objectWithoutProperties(_props, ['color', 'size', 'variant']); // button attributes for (k in btnAttrs) { v = this.props[k]; if (v !== 'default') cls += ' ' + btnClass + '--' + v; } // ripple attributes if (ripple) { rippleCls += ' mui--is-visible'; // handle animation if (ripple.isAnimating) rippleCls += ' mui--is-animating'; // style attrs rippleStyle = { width: ripple.diameter, height: ripple.diameter, top: ripple.top, left: ripple.left }; } return _react2.default.createElement( 'button', babelHelpers.extends({}, reactProps, { ref: 'buttonEl', className: cls + ' ' + this.props.className, onMouseUp: this.onMouseUpCB, onMouseDown: this.onMouseDownCB, onMouseLeave: this.onMouseLeaveCB, onTouchStart: this.onTouchStartCB, onTouchEnd: this.onTouchEndCB }), this.props.children, _react2.default.createElement( 'span', { className: 'mui-btn__ripple-container' }, _react2.default.createElement('span', { ref: 'rippleEl', className: rippleCls, style: rippleStyle }) ) ); } }]); return Button; }(_react2.default.Component); /** Define module API */ Button.defaultProps = { className: '', color: 'default', size: 'default', variant: 'default' }; exports.default = Button; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJ1dHRvbi5qc3giXSwibmFtZXMiOlsianFMaXRlIiwidXRpbCIsImJ0bkNsYXNzIiwiYnRuQ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3BhbiBjbGFzc05hbWU9XCJtdWktYnRuX19yaXBwbGUtY29udGFpbmVyXCI+XG4gICAgICAgICAgPHNwYW4gcmVmPVwicmlwcGxlRWxcIiBjbGFzc05hbWU9e3JpcHBsZUNsc30gc3R5bGU9e3JpcHBsZVN0eWxlfT5cbiAgICAgICAgICA8L3NwYW4+XG4gICAgICAgIDwvc3Bhbj5cbiAgICAgIDwvYnV0dG9uPlxuICAgICk7XG4gIH1cbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IEJ1dHRvbjtcbiJdfQ== },{"../js/lib/jqLite":6,"../js/lib/util":7,"react":"CwoHg3"}],10:[function(require,module,exports){ /** * MUI React Caret Module * @module react/caret */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Caret constructor * @class */ var Caret = function (_React$Component) { babelHelpers.inherits(Caret, _React$Component); function Caret() { babelHelpers.classCallCheck(this, Caret); return babelHelpers.possibleConstructorReturn(this, (Caret.__proto__ || Object.getPrototypeOf(Caret)).apply(this, arguments)); } babelHelpers.createClass(Caret, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, reactProps = babelHelpers.objectWithoutProperties(_props, ['children']); return _react2.default.createElement('span', babelHelpers.extends({}, reactProps, { className: 'mui-caret ' + this.props.className })); } }]); return Caret; }(_react2.default.Component); /** Define module API */ Caret.defaultProps = { className: '' }; exports.default = Caret; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhcmV0LmpzeCJdLCJuYW1lcyI6WyJDYXJldCIsInByb3BzIiwiY2hpbGRyZW4iLCJyZWFjdFByb3BzIiwiY2xhc3NOYW1lIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7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HQgQ2FyZXQ7XG4iXX0= },{"react":"CwoHg3"}],11:[function(require,module,exports){ /** * MUI React tabs module * @module react/tabs */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Tab constructor * @class */ var Tab = function (_React$Component) { babelHelpers.inherits(Tab, _React$Component); function Tab() { babelHelpers.classCallCheck(this, Tab); return babelHelpers.possibleConstructorReturn(this, (Tab.__proto__ || Object.getPrototypeOf(Tab)).apply(this, arguments)); } babelHelpers.createClass(Tab, [{ key: 'render', value: function render() { return null; } }]); return Tab; }(_react2.default.Component); /** Define module API */ Tab.defaultProps = { value: null, label: '', onActive: null }; exports.default = Tab; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhYi5qc3giXSwibmFtZXMiOlsiVGFiIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwidmFsdWUiLCJsYWJlbCIsIm9uQWN0aXZlIl0sIm1hcHBpbmdzIjoiQUFBQTs7OztBQUlBO0FBQ0E7O0FBRUE7Ozs7OztBQUVBOzs7O0FBR0E7Ozs7SUFJTUEsRzs7Ozs7Ozs7Ozs2QkFPSztBQUNQLGFBQU8sSUFBUDtBQUNEOzs7RUFUZSxnQkFBTUMsUzs7QUFheEI7OztBQWJNRCxHLENBQ0dFLFksR0FBZTtBQUNwQkMsU0FBTyxJQURhO0FBRXBCQyxTQUFPLEVBRmE7QUFHcEJDLFlBQVU7QUFIVSxDO2tCQWFUTCxHIiwiZmlsZSI6InRhYi5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCB0YWJzIG1vZHVsZVxuICogQG1vZHVsZSByZWFjdC90YWJzXG4gKi9cbi8qIGpzaGludCBxdW90bWFyazpmYWxzZSAqL1xuLy8ganNjczpkaXNhYmxlIHZhbGlkYXRlUXVvdGVNYXJrc1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBUYWIgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBUYWIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIHZhbHVlOiBudWxsLFxuICAgIGxhYmVsOiAnJyxcbiAgICBvbkFjdGl2ZTogbnVsbFxuICB9O1xuXG4gIHJlbmRlcigpIHtcbiAgICByZXR1cm4gbnVsbDtcbiAgfTtcbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IFRhYjtcbiJdfQ== },{"react":"CwoHg3"}],12:[function(require,module,exports){ /** * MUI React TextInput Component * @module react/text-field */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextField = undefined; var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Input constructor * @class */ var Input = function (_React$Component) { babelHelpers.inherits(Input, _React$Component); function Input(props) { babelHelpers.classCallCheck(this, Input); var _this = babelHelpers.possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).call(this, props)); var value = props.value; var innerValue = value || props.defaultValue; if (innerValue === undefined) innerValue = ''; _this.state = { innerValue: innerValue, isTouched: false, isPristine: true }; // warn if value defined but onChange is not if (value !== undefined && !props.onChange) { util.raiseError(_helpers.controlledMessage, true); } var cb = util.callback; _this.onBlurCB = cb(_this, 'onBlur'); _this.onChangeCB = cb(_this, 'onChange'); return _this; } babelHelpers.createClass(Input, [{ key: 'componentDidMount', value: function componentDidMount() { // disable MUI js this.refs.inputEl._muiTextfield = true; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { // update innerValue when new value is received to handle programmatic // changes to input box if ('value' in nextProps) this.setState({ innerValue: nextProps.value }); } }, { key: 'onBlur', value: function onBlur(ev) { // ignore if event is a window blur if (document.activeElement !== this.refs.inputEl) { this.setState({ isTouched: true }); } // execute callback var fn = this.props.onBlur; fn && fn(ev); } }, { key: 'onChange', value: function onChange(ev) { this.setState({ innerValue: ev.target.value, isPristine: false }); // execute callback var fn = this.props.onChange; fn && fn(ev); } }, { key: 'triggerFocus', value: function triggerFocus() { // hack to enable IE10 pointer-events shim this.refs.inputEl.focus(); } }, { key: 'render', value: function render() { var cls = {}, isNotEmpty = Boolean(this.state.innerValue.toString()), inputEl = void 0; var _props = this.props, hint = _props.hint, invalid = _props.invalid, rows = _props.rows, type = _props.type, reactProps = babelHelpers.objectWithoutProperties(_props, ['hint', 'invalid', 'rows', 'type']); cls['mui--is-touched'] = this.state.isTouched; cls['mui--is-untouched'] = !this.state.isTouched; cls['mui--is-pristine'] = this.state.isPristine; cls['mui--is-dirty'] = !this.state.isPristine; cls['mui--is-empty'] = !isNotEmpty; cls['mui--is-not-empty'] = isNotEmpty; cls['mui--is-invalid'] = invalid; cls = util.classNames(cls); if (type === 'textarea') { inputEl = _react2.default.createElement('textarea', babelHelpers.extends({}, reactProps, { ref: 'inputEl', className: cls, rows: rows, placeholder: hint, onBlur: this.onBlurCB, onChange: this.onChangeCB })); } else { inputEl = _react2.default.createElement('input', babelHelpers.extends({}, reactProps, { ref: 'inputEl', className: cls, type: type, placeholder: this.props.hint, onBlur: this.onBlurCB, onChange: this.onChangeCB })); } return inputEl; } }]); return Input; }(_react2.default.Component); /** * Label constructor * @class */ Input.defaultProps = { hint: null, invalid: false, rows: 2 }; var Label = function (_React$Component2) { babelHelpers.inherits(Label, _React$Component2); function Label() { var _ref; var _temp, _this2, _ret; babelHelpers.classCallCheck(this, Label); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this2 = babelHelpers.possibleConstructorReturn(this, (_ref = Label.__proto__ || Object.getPrototypeOf(Label)).call.apply(_ref, [this].concat(args))), _this2), _this2.state = { style: {} }, _temp), babelHelpers.possibleConstructorReturn(_this2, _ret); } babelHelpers.createClass(Label, [{ key: 'componentDidMount', value: function componentDidMount() { var _this3 = this; this.styleTimer = setTimeout(function () { var s = '.15s ease-out'; var style = void 0; style = { transition: s, WebkitTransition: s, MozTransition: s, OTransition: s, msTransform: s }; _this3.setState({ style: style }); }, 150); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // clear timer clearTimeout(this.styleTimer); } }, { key: 'render', value: function render() { return _react2.default.createElement( 'label', { style: this.state.style, onClick: this.props.onClick }, this.props.text ); } }]); return Label; }(_react2.default.Component); /** * TextField constructor * @class */ Label.defaultProps = { text: '', onClick: null }; var TextField = function (_React$Component3) { babelHelpers.inherits(TextField, _React$Component3); function TextField(props) { babelHelpers.classCallCheck(this, TextField); var _this4 = babelHelpers.possibleConstructorReturn(this, (TextField.__proto__ || Object.getPrototypeOf(TextField)).call(this, props)); _this4.onClickCB = util.callback(_this4, 'onClick'); return _this4; } babelHelpers.createClass(TextField, [{ key: 'onClick', value: function onClick(ev) { // pointer-events shim if (util.supportsPointerEvents() === false) { ev.target.style.cursor = 'text'; this.refs.inputEl.triggerFocus(); } } }, { key: 'render', value: function render() { var cls = {}, labelEl = void 0; var _props2 = this.props, children = _props2.children, className = _props2.className, style = _props2.style, label = _props2.label, floatingLabel = _props2.floatingLabel, other = babelHelpers.objectWithoutProperties(_props2, ['children', 'className', 'style', 'label', 'floatingLabel']); var type = jqLite.type(label); if (type === 'string' && label.length || type === 'object') { labelEl = _react2.default.createElement(Label, { text: label, onClick: this.onClickCB }); } cls['mui-textfield'] = true; cls['mui-textfield--float-label'] = floatingLabel; cls = util.classNames(cls); return _react2.default.createElement( 'div', { className: cls + ' ' + className, style: style }, _react2.default.createElement(Input, babelHelpers.extends({ ref: 'inputEl' }, other)), labelEl ); } }]); return TextField; }(_react2.default.Component); /** Define module API */ TextField.defaultProps = { className: '', label: null, floatingLabel: false }; exports.TextField = TextField; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRleHQtZmllbGQuanN4Il0sIm5hbWVzIjpbImpxTGl0ZSIsInV0aWwiLCJJbnB1dCIsInByb3BzIiwidmFsdWUiLCJpbm5lclZhbHVlIiwiZGVmYXVsdFZhbHVlIiwidW5kZWZpbmVkIiwic3RhdGUiLCJpc1RvdWNoZWQiLCJpc1ByaXN0aW5lIiwib25DaGFuZ2UiLCJyYWlzZUVycm9yIiwiY2IiLCJjYWxsYmFjayIsIm9uQmx1ckNCIiwib25DaGFuZ2VDQiIsInJlZnMiLCJpbnB1dEVsIiwiX211aVRleHRmaWVsZCIsIm5leHRQcm9wcyIsInNldFN0YXRlIiwiZXYiLCJkb2N1bWVudCIsImFjdGl2ZUVsZW1lbnQiLCJmbiIsIm9uQmx1ciIsInRhcmdldCIsImZvY3VzIiwiY2xzIiwiaXNOb3RFbXB0eSIsIkJvb2xlYW4iLCJ0b1N0cmluZyIsImhpbnQiLCJpbnZhbGlkIiwicm93cyIsInR5cGUiLCJyZWFjdFByb3BzIiwiY2xhc3NOYW1lcyIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyIsIkxhYmVsIiwic3R5bGUiLCJzdHlsZVRpbWVyIiwic2V0VGltZW91dCIsInMiLCJ0cmFuc2l0aW9uIiwiV2Via2l0VHJhbnNpdGlvbiIsIk1velRyYW5zaXRpb24iLCJPVHJhbnNpdGlvbiIsIm1zVHJhbnNmb3JtIiwiY2xlYXJUaW1lb3V0Iiwib25DbGljayIsInRleHQiLCJUZXh0RmllbGQiLCJvbkNsaWNrQ0IiLCJzdXBwb3J0c1BvaW50ZXJFdmVudHMiLCJjdXJzb3IiLCJ0cmlnZ2VyRm9jdXMiLCJsYWJlbEVsIiwiY2h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hdGluZ0xhYmVsO1xuICAgIGNscyA9IHV0aWwuY2xhc3NOYW1lcyhjbHMpO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXZcbiAgICAgICAgY2xhc3NOYW1lPXtjbHMgKyAnICcgKyBjbGFzc05hbWV9XG4gICAgICAgIHN0eWxlPXtzdHlsZX1cbiAgICAgID5cbiAgICAgICAgPElucHV0IHJlZj1cImlucHV0RWxcIiB7IC4uLm90aGVyIH0gLz5cbiAgICAgICAge2xhYmVsRWx9XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCB7IFRleHRGaWVsZCB9O1xuIl19 },{"../js/lib/jqLite":6,"../js/lib/util":7,"./_helpers":8,"react":"CwoHg3"}],13:[function(require,module,exports){ module.exports = "/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:Arial,Verdana,Tahoma;font-size:14px;font-weight:400;line-height:1.429;color:rgba(0,0,0,.87);background-color:#FFF}a{color:#2196F3;text-decoration:none}a:focus,a:hover{text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}p{margin:0 0 10px}ol,ul{margin-top:0;margin-bottom:10px}hr{margin-top:20px;margin-bottom:20px;border:0;height:1px;background-color:rgba(0,0,0,.12)}strong{font-weight:700}abbr[title]{cursor:help;border-bottom:1px dotted #2196F3}h1,h2,h3{margin-top:20px;margin-bottom:10px}h4,h5,h6{margin-top:10px;margin-bottom:10px}.mui--appbar-height{height:56px}.mui--appbar-min-height,.mui-appbar{min-height:56px}.mui--appbar-line-height{line-height:56px}.mui--appbar-top{top:56px}@media (orientation:landscape) and (max-height:480px){.mui--appbar-height{height:48px}.mui--appbar-min-height,.mui-appbar{min-height:48px}.mui--appbar-line-height{line-height:48px}.mui--appbar-top{top:48px}}@media (min-width:480px){.mui--appbar-height{height:64px}.mui--appbar-min-height,.mui-appbar{min-height:64px}.mui--appbar-line-height{line-height:64px}.mui--appbar-top{top:64px}}.mui-appbar{background-color:#2196F3;color:#FFF}.mui-btn{font-weight:500;font-size:14px;line-height:18px;text-transform:uppercase;color:rgba(0,0,0,.87);background-color:#FFF;transition:all .2s ease-in-out;display:inline-block;height:36px;padding:0 26px;margin:6px 0;border:none;border-radius:2px;cursor:pointer;-ms-touch-action:manipulation;touch-action:manipulation;background-image:none;text-align:center;line-height:36px;vertical-align:middle;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;font-family:inherit;letter-spacing:.03em;position:relative;overflow:hidden}.mui-btn:active,.mui-btn:focus,.mui-btn:hover{color:rgba(0,0,0,.87);background-color:#fff}.mui-btn[disabled]:active,.mui-btn[disabled]:focus,.mui-btn[disabled]:hover{color:rgba(0,0,0,.87);background-color:#FFF}.mui-btn.mui-btn--flat{color:rgba(0,0,0,.87);background-color:transparent}.mui-btn.mui-btn--flat:active,.mui-btn.mui-btn--flat:focus,.mui-btn.mui-btn--flat:hover{color:rgba(0,0,0,.87);background-color:#f2f2f2}.mui-btn.mui-btn--flat[disabled]:active,.mui-btn.mui-btn--flat[disabled]:focus,.mui-btn.mui-btn--flat[disabled]:hover{color:rgba(0,0,0,.87);background-color:transparent}.mui-btn:active,.mui-btn:focus,.mui-btn:hover{outline:0;text-decoration:none;color:rgba(0,0,0,.87)}.mui-btn:focus,.mui-btn:hover{box-shadow:0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn:focus,.mui-btn:hover{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn:focus,.mui-btn:hover{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}.mui-btn:active:hover{box-shadow:0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn:active:hover{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn:active:hover{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}.mui-btn.mui--is-disabled,.mui-btn:disabled{cursor:not-allowed;pointer-events:none;opacity:.6;box-shadow:none}.mui-btn+.mui-btn{margin-left:8px}.mui-btn--flat{background-color:transparent}.mui-btn--flat:active,.mui-btn--flat:active:hover,.mui-btn--flat:focus,.mui-btn--flat:hover{box-shadow:none;background-color:#f2f2f2}.mui-btn--fab,.mui-btn--raised{box-shadow:0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn--fab,.mui-btn--raised{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn--fab,.mui-btn--raised{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 2px rgba(0,0,0,.12),0 2px 2px rgba(0,0,0,.2)}}.mui-btn--fab:active,.mui-btn--raised:active{box-shadow:0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-btn--fab:active,.mui-btn--raised:active{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}@supports (-ms-ime-align:auto){.mui-btn--fab:active,.mui-btn--raised:active{box-shadow:0 -1px 2px rgba(0,0,0,.12),-1px 0 2px rgba(0,0,0,.12),0 0 4px rgba(0,0,0,.12),1px 3px 4px rgba(0,0,0,.2)}}.mui-btn--fab{position:relative;padding:0;width:55px;height:55px;line-height:55px;border-radius:50%;z-index:1}.mui-btn--primary{color:#FFF;background-color:#2196F3}.mui-btn--primary:active,.mui-btn--primary:focus,.mui-btn--primary:hover{color:#FFF;background-color:#39a1f4}.mui-btn--primary[disabled]:active,.mui-btn--primary[disabled]:focus,.mui-btn--primary[disabled]:hover{color:#FFF;background-color:#2196F3}.mui-btn--primary.mui-btn--flat{color:#2196F3;background-color:transparent}.mui-btn--primary.mui-btn--flat:active,.mui-btn--primary.mui-btn--flat:focus,.mui-btn--primary.mui-btn--flat:hover{color:#2196F3;background-color:#f2f2f2}.mui-btn--primary.mui-btn--flat[disabled]:active,.mui-btn--primary.mui-btn--flat[disabled]:focus,.mui-btn--primary.mui-btn--flat[disabled]:hover{color:#2196F3;background-color:transparent}.mui-btn--dark{color:#FFF;background-color:#424242}.mui-btn--dark:active,.mui-btn--dark:focus,.mui-btn--dark:hover{color:#FFF;background-color:#4f4f4f}.mui-btn--dark[disabled]:active,.mui-btn--dark[disabled]:focus,.mui-btn--dark[disabled]:hover{color:#FFF;background-color:#424242}.mui-btn--dark.mui-btn--flat{color:#424242;background-color:transparent}.mui-btn--dark.mui-btn--flat:active,.mui-btn--dark.mui-btn--flat:focus,.mui-btn--dark.mui-btn--flat:hover{color:#424242;background-color:#f2f2f2}.mui-btn--dark.mui-btn--flat[disabled]:active,.mui-btn--dark.mui-btn--flat[disabled]:focus,.mui-btn--dark.mui-btn--flat[disabled]:hover{color:#424242;background-color:transparent}.mui-btn--danger{color:#FFF;background-color:#F44336}.mui-btn--danger:active,.mui-btn--danger:focus,.mui-btn--danger:hover{color:#FFF;background-color:#f55a4e}.mui-btn--danger[disabled]:active,.mui-btn--danger[disabled]:focus,.mui-btn--danger[disabled]:hover{color:#FFF;background-color:#F44336}.mui-btn--danger.mui-btn--flat{color:#F44336;background-color:transparent}.mui-btn--danger.mui-btn--flat:active,.mui-btn--danger.mui-btn--flat:focus,.mui-btn--danger.mui-btn--flat:hover{color:#F44336;background-color:#f2f2f2}.mui-btn--danger.mui-btn--flat[disabled]:active,.mui-btn--danger.mui-btn--flat[disabled]:focus,.mui-btn--danger.mui-btn--flat[disabled]:hover{color:#F44336;background-color:transparent}.mui-btn--accent{color:#FFF;background-color:#FF4081}.mui-btn--accent:active,.mui-btn--accent:focus,.mui-btn--accent:hover{color:#FFF;background-color:#ff5a92}.mui-btn--accent[disabled]:active,.mui-btn--accent[disabled]:focus,.mui-btn--accent[disabled]:hover{color:#FFF;background-color:#FF4081}.mui-btn--accent.mui-btn--flat{color:#FF4081;background-color:transparent}.mui-btn--accent.mui-btn--flat:active,.mui-btn--accent.mui-btn--flat:focus,.mui-btn--accent.mui-btn--flat:hover{color:#FF4081;background-color:#f2f2f2}.mui-btn--accent.mui-btn--flat[disabled]:active,.mui-btn--accent.mui-btn--flat[disabled]:focus,.mui-btn--accent.mui-btn--flat[disabled]:hover{color:#FF4081;background-color:transparent}.mui-btn--small{height:30.6px;line-height:30.6px;padding:0 16px;font-size:13px}.mui-btn--large{height:54px;line-height:54px;padding:0 26px;font-size:14px}.mui-btn--fab.mui-btn--small{width:44px;height:44px;line-height:44px}.mui-btn--fab.mui-btn--large{width:75px;height:75px;line-height:75px}.mui-checkbox,.mui-radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.mui-checkbox>label,.mui-radio>label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.mui-checkbox input:disabled,.mui-radio input:disabled{cursor:not-allowed}.mui-checkbox input:focus,.mui-radio input:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.mui-checkbox--inline>label>input[type=checkbox],.mui-checkbox>label>input[type=checkbox],.mui-radio--inline>label>input[type=radio],.mui-radio>label>input[type=radio]{position:absolute;margin-left:-20px;margin-top:4px}.mui-checkbox+.mui-checkbox,.mui-radio+.mui-radio{margin-top:-5px}.mui-checkbox--inline,.mui-radio--inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.mui-checkbox--inline>input[type=checkbox],.mui-checkbox--inline>input[type=radio],.mui-checkbox--inline>label>input[type=checkbox],.mui-checkbox--inline>label>input[type=radio],.mui-radio--inline>input[type=checkbox],.mui-radio--inline>input[type=radio],.mui-radio--inline>label>input[type=checkbox],.mui-radio--inline>label>input[type=radio]{margin:4px 0 0;line-height:normal}.mui-checkbox--inline+.mui-checkbox--inline,.mui-radio--inline+.mui-radio--inline{margin-top:0;margin-left:10px}.mui-container{box-sizing:border-box;margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.mui-container:after,.mui-container:before{content:\" \";display:table}.mui-container:after{clear:both}@media (min-width:544px){.mui-container{max-width:570px}}@media (min-width:768px){.mui-container{max-width:740px}}@media (min-width:992px){.mui-container{max-width:960px}}@media (min-width:1200px){.mui-container{max-width:1170px}}.mui-container-fluid{box-sizing:border-box;margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.mui-container-fluid:after,.mui-container-fluid:before{content:\" \";display:table}.mui-container-fluid:after{clear:both}.mui-divider{display:block;height:1px;background-color:rgba(0,0,0,.12)}.mui--divider-top{border-top:1px solid rgba(0,0,0,.12)}.mui--divider-bottom{border-bottom:1px solid rgba(0,0,0,.12)}.mui--divider-left{border-left:1px solid rgba(0,0,0,.12)}.mui--divider-right{border-right:1px solid rgba(0,0,0,.12)}.mui-dropdown{display:inline-block;position:relative}[data-mui-toggle=dropdown]{outline:0}.mui-dropdown__menu{position:absolute;top:100%;left:0;display:none;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#FFF;border-radius:2px;z-index:1;background-clip:padding-box}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-dropdown__menu{border-top:1px solid rgba(0,0,0,.12);border-left:1px solid rgba(0,0,0,.12)}}@supports (-ms-ime-align:auto){.mui-dropdown__menu{border-top:1px solid rgba(0,0,0,.12);border-left:1px solid rgba(0,0,0,.12)}}.mui-dropdown__menu.mui--is-open{display:block}.mui-dropdown__menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.429;color:rgba(0,0,0,.87);text-decoration:none;white-space:nowrap}.mui-dropdown__menu>li>a:focus,.mui-dropdown__menu>li>a:hover{text-decoration:none;color:rgba(0,0,0,.87);background-color:#EEE}.mui-dropdown__menu>.mui--is-disabled>a,.mui-dropdown__menu>.mui--is-disabled>a:focus,.mui-dropdown__menu>.mui--is-disabled>a:hover{color:#EEE}.mui-dropdown__menu>.mui--is-disabled>a:focus,.mui-dropdown__menu>.mui--is-disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;cursor:not-allowed}.mui-dropdown__menu--right{left:auto;right:0}.mui-form legend{display:block;width:100%;padding:0;margin-bottom:10px;font-size:21px;color:rgba(0,0,0,.87);line-height:inherit;border:0}.mui-form fieldset{border:0;padding:0;margin:0 0 20px 0}@media (min-width:544px){.mui-form--inline .mui-textfield{display:inline-block;vertical-align:bottom;margin-bottom:0}.mui-form--inline .mui-checkbox,.mui-form--inline .mui-radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.mui-form--inline .mui-checkbox>label,.mui-form--inline .mui-radio>label{padding-left:0}.mui-form--inline .mui-checkbox>label>input[type=checkbox],.mui-form--inline .mui-radio>label>input[type=radio]{position:relative;margin-left:0}.mui-form--inline .mui-select{display:inline-block}.mui-form--inline .mui-btn{margin-bottom:0;margin-top:0;vertical-align:bottom}}.mui-row{margin-left:-15px;margin-right:-15px}.mui-row:after,.mui-row:before{content:\" \";display:table}.mui-row:after{clear:both}.mui-col-lg-1,.mui-col-lg-10,.mui-col-lg-11,.mui-col-lg-12,.mui-col-lg-2,.mui-col-lg-3,.mui-col-lg-4,.mui-col-lg-5,.mui-col-lg-6,.mui-col-lg-7,.mui-col-lg-8,.mui-col-lg-9,.mui-col-md-1,.mui-col-md-10,.mui-col-md-11,.mui-col-md-12,.mui-col-md-2,.mui-col-md-3,.mui-col-md-4,.mui-col-md-5,.mui-col-md-6,.mui-col-md-7,.mui-col-md-8,.mui-col-md-9,.mui-col-sm-1,.mui-col-sm-10,.mui-col-sm-11,.mui-col-sm-12,.mui-col-sm-2,.mui-col-sm-3,.mui-col-sm-4,.mui-col-sm-5,.mui-col-sm-6,.mui-col-sm-7,.mui-col-sm-8,.mui-col-sm-9,.mui-col-xs-1,.mui-col-xs-10,.mui-col-xs-11,.mui-col-xs-12,.mui-col-xs-2,.mui-col-xs-3,.mui-col-xs-4,.mui-col-xs-5,.mui-col-xs-6,.mui-col-xs-7,.mui-col-xs-8,.mui-col-xs-9{box-sizing:border-box;min-height:1px;padding-left:15px;padding-right:15px}.mui-col-xs-1,.mui-col-xs-10,.mui-col-xs-11,.mui-col-xs-12,.mui-col-xs-2,.mui-col-xs-3,.mui-col-xs-4,.mui-col-xs-5,.mui-col-xs-6,.mui-col-xs-7,.mui-col-xs-8,.mui-col-xs-9{float:left}.mui-col-xs-1{width:8.33333%}.mui-col-xs-2{width:16.66667%}.mui-col-xs-3{width:25%}.mui-col-xs-4{width:33.33333%}.mui-col-xs-5{width:41.66667%}.mui-col-xs-6{width:50%}.mui-col-xs-7{width:58.33333%}.mui-col-xs-8{width:66.66667%}.mui-col-xs-9{width:75%}.mui-col-xs-10{width:83.33333%}.mui-col-xs-11{width:91.66667%}.mui-col-xs-12{width:100%}.mui-col-xs-offset-0{margin-left:0}.mui-col-xs-offset-1{margin-left:8.33333%}.mui-col-xs-offset-2{margin-left:16.66667%}.mui-col-xs-offset-3{margin-left:25%}.mui-col-xs-offset-4{margin-left:33.33333%}.mui-col-xs-offset-5{margin-left:41.66667%}.mui-col-xs-offset-6{margin-left:50%}.mui-col-xs-offset-7{margin-left:58.33333%}.mui-col-xs-offset-8{margin-left:66.66667%}.mui-col-xs-offset-9{margin-left:75%}.mui-col-xs-offset-10{margin-left:83.33333%}.mui-col-xs-offset-11{margin-left:91.66667%}.mui-col-xs-offset-12{margin-left:100%}@media (min-width:544px){.mui-col-sm-1,.mui-col-sm-10,.mui-col-sm-11,.mui-col-sm-12,.mui-col-sm-2,.mui-col-sm-3,.mui-col-sm-4,.mui-col-sm-5,.mui-col-sm-6,.mui-col-sm-7,.mui-col-sm-8,.mui-col-sm-9{float:left}.mui-col-sm-1{width:8.33333%}.mui-col-sm-2{width:16.66667%}.mui-col-sm-3{width:25%}.mui-col-sm-4{width:33.33333%}.mui-col-sm-5{width:41.66667%}.mui-col-sm-6{width:50%}.mui-col-sm-7{width:58.33333%}.mui-col-sm-8{width:66.66667%}.mui-col-sm-9{width:75%}.mui-col-sm-10{width:83.33333%}.mui-col-sm-11{width:91.66667%}.mui-col-sm-12{width:100%}.mui-col-sm-offset-0{margin-left:0}.mui-col-sm-offset-1{margin-left:8.33333%}.mui-col-sm-offset-2{margin-left:16.66667%}.mui-col-sm-offset-3{margin-left:25%}.mui-col-sm-offset-4{margin-left:33.33333%}.mui-col-sm-offset-5{margin-left:41.66667%}.mui-col-sm-offset-6{margin-left:50%}.mui-col-sm-offset-7{margin-left:58.33333%}.mui-col-sm-offset-8{margin-left:66.66667%}.mui-col-sm-offset-9{margin-left:75%}.mui-col-sm-offset-10{margin-left:83.33333%}.mui-col-sm-offset-11{margin-left:91.66667%}.mui-col-sm-offset-12{margin-left:100%}}@media (min-width:768px){.mui-col-md-1,.mui-col-md-10,.mui-col-md-11,.mui-col-md-12,.mui-col-md-2,.mui-col-md-3,.mui-col-md-4,.mui-col-md-5,.mui-col-md-6,.mui-col-md-7,.mui-col-md-8,.mui-col-md-9{float:left}.mui-col-md-1{width:8.33333%}.mui-col-md-2{width:16.66667%}.mui-col-md-3{width:25%}.mui-col-md-4{width:33.33333%}.mui-col-md-5{width:41.66667%}.mui-col-md-6{width:50%}.mui-col-md-7{width:58.33333%}.mui-col-md-8{width:66.66667%}.mui-col-md-9{width:75%}.mui-col-md-10{width:83.33333%}.mui-col-md-11{width:91.66667%}.mui-col-md-12{width:100%}.mui-col-md-offset-0{margin-left:0}.mui-col-md-offset-1{margin-left:8.33333%}.mui-col-md-offset-2{margin-left:16.66667%}.mui-col-md-offset-3{margin-left:25%}.mui-col-md-offset-4{margin-left:33.33333%}.mui-col-md-offset-5{margin-left:41.66667%}.mui-col-md-offset-6{margin-left:50%}.mui-col-md-offset-7{margin-left:58.33333%}.mui-col-md-offset-8{margin-left:66.66667%}.mui-col-md-offset-9{margin-left:75%}.mui-col-md-offset-10{margin-left:83.33333%}.mui-col-md-offset-11{margin-left:91.66667%}.mui-col-md-offset-12{margin-left:100%}}@media (min-width:992px){.mui-col-lg-1,.mui-col-lg-10,.mui-col-lg-11,.mui-col-lg-12,.mui-col-lg-2,.mui-col-lg-3,.mui-col-lg-4,.mui-col-lg-5,.mui-col-lg-6,.mui-col-lg-7,.mui-col-lg-8,.mui-col-lg-9{float:left}.mui-col-lg-1{width:8.33333%}.mui-col-lg-2{width:16.66667%}.mui-col-lg-3{width:25%}.mui-col-lg-4{width:33.33333%}.mui-col-lg-5{width:41.66667%}.mui-col-lg-6{width:50%}.mui-col-lg-7{width:58.33333%}.mui-col-lg-8{width:66.66667%}.mui-col-lg-9{width:75%}.mui-col-lg-10{width:83.33333%}.mui-col-lg-11{width:91.66667%}.mui-col-lg-12{width:100%}.mui-col-lg-offset-0{margin-left:0}.mui-col-lg-offset-1{margin-left:8.33333%}.mui-col-lg-offset-2{margin-left:16.66667%}.mui-col-lg-offset-3{margin-left:25%}.mui-col-lg-offset-4{margin-left:33.33333%}.mui-col-lg-offset-5{margin-left:41.66667%}.mui-col-lg-offset-6{margin-left:50%}.mui-col-lg-offset-7{margin-left:58.33333%}.mui-col-lg-offset-8{margin-left:66.66667%}.mui-col-lg-offset-9{margin-left:75%}.mui-col-lg-offset-10{margin-left:83.33333%}.mui-col-lg-offset-11{margin-left:91.66667%}.mui-col-lg-offset-12{margin-left:100%}}@media (min-width:1200px){.mui-col-xl-1,.mui-col-xl-10,.mui-col-xl-11,.mui-col-xl-12,.mui-col-xl-2,.mui-col-xl-3,.mui-col-xl-4,.mui-col-xl-5,.mui-col-xl-6,.mui-col-xl-7,.mui-col-xl-8,.mui-col-xl-9{float:left}.mui-col-xl-1{width:8.33333%}.mui-col-xl-2{width:16.66667%}.mui-col-xl-3{width:25%}.mui-col-xl-4{width:33.33333%}.mui-col-xl-5{width:41.66667%}.mui-col-xl-6{width:50%}.mui-col-xl-7{width:58.33333%}.mui-col-xl-8{width:66.66667%}.mui-col-xl-9{width:75%}.mui-col-xl-10{width:83.33333%}.mui-col-xl-11{width:91.66667%}.mui-col-xl-12{width:100%}.mui-col-xl-offset-0{margin-left:0}.mui-col-xl-offset-1{margin-left:8.33333%}.mui-col-xl-offset-2{margin-left:16.66667%}.mui-col-xl-offset-3{margin-left:25%}.mui-col-xl-offset-4{margin-left:33.33333%}.mui-col-xl-offset-5{margin-left:41.66667%}.mui-col-xl-offset-6{margin-left:50%}.mui-col-xl-offset-7{margin-left:58.33333%}.mui-col-xl-offset-8{margin-left:66.66667%}.mui-col-xl-offset-9{margin-left:75%}.mui-col-xl-offset-10{margin-left:83.33333%}.mui-col-xl-offset-11{margin-left:91.66667%}.mui-col-xl-offset-12{margin-left:100%}}.mui-panel{padding:15px;margin-bottom:20px;border-radius:0;background-color:#FFF;box-shadow:0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12)}.mui-panel:after,.mui-panel:before{content:\" \";display:table}.mui-panel:after{clear:both}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-panel{box-shadow:0 -1px 2px 0 rgba(0,0,0,.12),-1px 0 2px 0 rgba(0,0,0,.12),0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12)}}@supports (-ms-ime-align:auto){.mui-panel{box-shadow:0 -1px 2px 0 rgba(0,0,0,.12),-1px 0 2px 0 rgba(0,0,0,.12),0 2px 2px 0 rgba(0,0,0,.16),0 0 2px 0 rgba(0,0,0,.12)}}.mui-select{display:block;padding-top:15px;margin-bottom:20px;position:relative}.mui-select:focus{outline:0}.mui-select:focus>select{height:33px;margin-bottom:-1px;border-color:#2196F3;border-width:2px}.mui-select>select{display:block;height:32px;width:100%;appearance:none;-webkit-appearance:none;-moz-appearance:none;outline:0;border:none;border-bottom:1px solid rgba(0,0,0,.26);border-radius:0;box-shadow:none;background-color:transparent;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNiIgd2lkdGg9IjEwIj48cG9seWdvbiBwb2ludHM9IjAsMCAxMCwwIDUsNiIgc3R5bGU9ImZpbGw6cmdiYSgwLDAsMCwuMjQpOyIvPjwvc3ZnPg==);background-repeat:no-repeat;background-position:right center;cursor:pointer;color:rgba(0,0,0,.87);font-size:16px;font-family:inherit;line-height:inherit;padding:0 25px 0 0}.mui-select>select::-ms-expand{display:none}.mui-select>select:focus{outline:0;height:33px;margin-bottom:-1px;border-color:#2196F3;border-width:2px}.mui-select>select:disabled{color:rgba(0,0,0,.38);cursor:not-allowed;background-color:transparent;opacity:1}.mui-select>select:-moz-focusring{color:transparent;text-shadow:0 0 0 #000}.mui-select>select:focus::-ms-value{background:0 0;color:rgba(0,0,0,.87)}.mui-select>label{position:absolute;top:0;display:block;width:100%;color:rgba(0,0,0,.54);font-size:12px;font-weight:400;line-height:15px;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.mui-select:focus>label,.mui-select>select:focus~label{color:#2196F3}.mui-select__menu{position:absolute;z-index:2;min-width:100%;overflow-y:auto;padding:8px 0;background-color:#FFF;font-size:16px}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.mui-select__menu{border-left:1px solid rgba(0,0,0,.12);border-top:1px solid rgba(0,0,0,.12)}}@supports (-ms-ime-align:auto){.mui-select__menu{border-left:1px solid rgba(0,0,0,.12);border-top:1px solid rgba(0,0,0,.12)}}.mui-select__menu>div{padding:0 22px;height:42px;line-height:42px;cursor:pointer;white-space:nowrap}.mui-select__menu>div.mui--is-selected{background-color:#EEE}.mui-select__menu>div.mui--is-disabled{color:rgba(0,0,0,.38);cursor:not-allowed}.mui-select__menu>div:not(.mui-optgroup__label):not(.mui--is-disabled):hover{background-color:#E0E0E0}.mui-optgroup__option{text-indent:1em}.mui-optgroup__label{color:rgba(0,0,0,.54);font-size:.9em}.mui-table{width:100%;max-width:100%;margin-bottom:20px}.mui-table>tbody>tr>th,.mui-table>tfoot>tr>th,.mui-table>thead>tr>th{text-align:left}.mui-table>tbody>tr>td,.mui-table>tbody>tr>th,.mui-table>tfoot>tr>td,.mui-table>tfoot>tr>th,.mui-table>thead>tr>td,.mui-table>thead>tr>th{padding:10px;line-height:1.429}.mui-table>thead>tr>th{border-bottom:2px solid rgba(0,0,0,.12);font-weight:700}.mui-table>tbody+tbody{border-top:2px solid rgba(0,0,0,.12)}.mui-table.mui-table--bordered>tbody>tr>td{border-bottom:1px solid rgba(0,0,0,.12)}.mui-tabs__bar{list-style:none;padding-left:0;margin-bottom:0;background-color:transparent;white-space:nowrap;overflow-x:auto}.mui-tabs__bar>li{display:inline-block}.mui-tabs__bar>li>a{display:block;white-space:nowrap;text-transform:uppercase;font-weight:500;font-size:14px;color:rgba(0,0,0,.87);cursor:default;height:48px;line-height:48px;padding-left:24px;padding-right:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mui-tabs__bar>li>a:hover{text-decoration:none}.mui-tabs__bar>li.mui--is-active{border-bottom:2px solid #2196F3}.mui-tabs__bar>li.mui--is-active>a{color:#2196F3}.mui-tabs__bar.mui-tabs__bar--justified{display:table;width:100%;table-layout:fixed}.mui-tabs__bar.mui-tabs__bar--justified>li{display:table-cell}.mui-tabs__bar.mui-tabs__bar--justified>li>a{text-align:center;padding-left:0;padding-right:0}.mui-tabs__pane{display:none}.mui-tabs__pane.mui--is-active{display:block}.mui-textfield{display:block;padding-top:15px;margin-bottom:20px;position:relative}.mui-textfield>label{position:absolute;top:0;display:block;width:100%;color:rgba(0,0,0,.54);font-size:12px;font-weight:400;line-height:15px;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap}.mui-textfield>textarea{padding-top:5px}.mui-textfield>input:focus~label,.mui-textfield>textarea:focus~label{color:#2196F3}.mui-textfield--float-label>label{position:absolute;transform:translate(0,15px);font-size:16px;line-height:32px;color:rgba(0,0,0,.26);text-overflow:clip;cursor:text;pointer-events:none}.mui-textfield--float-label>input:focus~label,.mui-textfield--float-label>textarea:focus~label{transform:translate(0,0);font-size:12px;line-height:15px;text-overflow:ellipsis}.mui-textfield--float-label>input:not(:focus).mui--is-not-empty~label,.mui-textfield--float-label>input:not(:focus):not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield--float-label>input:not(:focus)[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield--float-label>textarea:not(:focus).mui--is-not-empty~label,.mui-textfield--float-label>textarea:not(:focus):not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield--float-label>textarea:not(:focus)[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label{color:rgba(0,0,0,.54);font-size:12px;line-height:15px;transform:translate(0,0);text-overflow:ellipsis}.mui-textfield--wrap-label{display:table;width:100%;padding-top:0}.mui-textfield--wrap-label:not(.mui-textfield--float-label)>label{display:table-header-group;position:static;white-space:normal;overflow-x:visible}.mui-textfield>input,.mui-textfield>textarea{box-sizing:border-box;display:block;background-color:transparent;color:rgba(0,0,0,.87);border:none;border-bottom:1px solid rgba(0,0,0,.26);outline:0;width:100%;padding:0;box-shadow:none;border-radius:0;font-size:16px;font-family:inherit;line-height:inherit;background-image:none}.mui-textfield>input:focus,.mui-textfield>textarea:focus{border-color:#2196F3;border-width:2px}.mui-textfield>input:-moz-read-only,.mui-textfield>input:disabled,.mui-textfield>textarea:-moz-read-only,.mui-textfield>textarea:disabled{cursor:not-allowed;background-color:transparent;opacity:1}.mui-textfield>input:disabled,.mui-textfield>input:read-only,.mui-textfield>textarea:disabled,.mui-textfield>textarea:read-only{cursor:not-allowed;background-color:transparent;opacity:1}.mui-textfield>input::-webkit-input-placeholder,.mui-textfield>textarea::-webkit-input-placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input:-ms-input-placeholder,.mui-textfield>textarea:-ms-input-placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input::placeholder,.mui-textfield>textarea::placeholder{color:rgba(0,0,0,.26);opacity:1}.mui-textfield>input{height:32px}.mui-textfield>input:focus{height:33px;margin-bottom:-1px}.mui-textfield>textarea{min-height:64px}.mui-textfield>textarea[rows]:not([rows=\"2\"]):focus{margin-bottom:-1px}.mui-textfield>input:focus{height:33px;margin-bottom:-1px}.mui-textfield>input:invalid:not(:focus):not(:required),.mui-textfield>input:invalid:not(:focus):required.mui--is-empty.mui--is-touched,.mui-textfield>input:invalid:not(:focus):required.mui--is-not-empty,.mui-textfield>input:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:not(:required),.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-empty.mui--is-touched,.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-not-empty,.mui-textfield>input:not(:focus).mui--is-invalid:required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:invalid:not(:focus):not(:required),.mui-textfield>textarea:invalid:not(:focus):required.mui--is-empty.mui--is-touched,.mui-textfield>textarea:invalid:not(:focus):required.mui--is-not-empty,.mui-textfield>textarea:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:not(:focus).mui--is-invalid:not(:required),.mui-textfield>textarea:not(:focus).mui--is-invalid:required.mui--is-empty.mui--is-touched,.mui-textfield>textarea:not(:focus).mui--is-invalid:required.mui--is-not-empty,.mui-textfield>textarea:not(:focus).mui--is-invalid:required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>textarea:not(:focus).mui--is-invalid:required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty){border-color:#F44336;border-width:2px}.mui-textfield>input:invalid:not(:focus):not(:required),.mui-textfield>input:invalid:not(:focus):required.mui--is-empty.mui--is-touched,.mui-textfield>input:invalid:not(:focus):required.mui--is-not-empty,.mui-textfield>input:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:not(:required),.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-empty.mui--is-touched,.mui-textfield>input:not(:focus).mui--is-invalid:required.mui--is-not-empty,.mui-textfield>input:not(:focus).mui--is-invalid:required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty),.mui-textfield>input:not(:focus).mui--is-invalid:required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty){height:33px;margin-bottom:-1px}.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):not(:required)~label,.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):required.mui--is-not-empty~label,.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield.mui-textfield--float-label>input:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):not(:required)~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):required.mui--is-not-empty~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):required:not(:empty):not(.mui--is-empty):not(.mui--is-not-empty)~label,.mui-textfield.mui-textfield--float-label>textarea:invalid:not(:focus):required[value]:not([value=\"\"]):not(.mui--is-empty):not(.mui--is-not-empty)~label{color:#F44336}.mui-textfield:not(.mui-textfield--float-label)>input:invalid:not(:focus):not(:required)~label,.mui-textfield:not(.mui-textfield--float-label)>input:invalid:not(:focus):required.mui--is-empty.mui--is-touched~label,.mui-textfield:not(.mui-textfield--float-label)>input:invalid:not(:focus):required.mui--is-not-empty~label,.mui-textfield:not(.mui-textfield--float-label)>textarea:invalid:not(:focus):not(:required)~label,.mui-textfield:not(.mui-textfield--float-label)>textarea:invalid:not(:focus):required.mui--is-empty.mui--is-touched~label,.mui-textfield:not(.mui-textfield--float-label)>textarea:invalid:not(:focus):required.mui--is-not-empty~label{color:#F44336}.mui-textfield.mui-textfield--float-label>.mui--is-invalid.mui--is-not-empty:not(:focus)~label{color:#F44336}.mui-textfield:not(.mui-textfield--float-label)>.mui--is-invalid:not(:focus)~label{color:#F44336}.mui--no-transition{transition:none!important}.mui--no-user-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mui-caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.mui--text-left{text-align:left!important}.mui--text-right{text-align:right!important}.mui--text-center{text-align:center!important}.mui--text-justify{text-align:justify!important}.mui--text-nowrap{white-space:nowrap!important}.mui--align-baseline{vertical-align:baseline!important}.mui--align-top{vertical-align:top!important}.mui--align-middle{vertical-align:middle!important}.mui--align-bottom{vertical-align:bottom!important}.mui--text-dark{color:rgba(0,0,0,.87)}.mui--text-dark-secondary{color:rgba(0,0,0,.54)}.mui--text-dark-hint{color:rgba(0,0,0,.38)}.mui--text-light{color:#FFF}.mui--text-light-secondary{color:rgba(255,255,255,.7)}.mui--text-light-hint{color:rgba(255,255,255,.3)}.mui--text-accent{color:rgba(255,64,129,.87)}.mui--text-accent-secondary{color:rgba(255,64,129,.54)}.mui--text-accent-hint{color:rgba(255,64,129,.38)}.mui--text-black{color:#000}.mui--text-white{color:#FFF}.mui--text-danger{color:#F44336}.mui--bg-primary{background-color:#2196F3}.mui--bg-primary-dark{background-color:#1976D2}.mui--bg-primary-light{background-color:#BBDEFB}.mui--bg-accent{background-color:#FF4081}.mui--bg-accent-dark{background-color:#F50057}.mui--bg-accent-light{background-color:#FF80AB}.mui--bg-danger{background-color:#F44336}.mui-list--unstyled{padding-left:0;list-style:none}.mui-list--inline{padding-left:0;list-style:none;margin-left:-5px}.mui-list--inline>li{display:inline-block;padding-left:5px;padding-right:5px}.mui--z1,.mui-dropdown__menu,.mui-select__menu{box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.mui--z2{box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}.mui--z3{box-shadow:0 10px 20px rgba(0,0,0,.19),0 6px 6px rgba(0,0,0,.23)}.mui--z4{box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22)}.mui--z5{box-shadow:0 19px 38px rgba(0,0,0,.3),0 15px 12px rgba(0,0,0,.22)}.mui--clearfix:after,.mui--clearfix:before{content:\" \";display:table}.mui--clearfix:after{clear:both}.mui--pull-right{float:right!important}.mui--pull-left{float:left!important}.mui--hide{display:none!important}.mui--show{display:block!important}.mui--invisible{visibility:hidden}.mui--overflow-hidden{overflow:hidden!important}.mui--overflow-hidden-x{overflow-x:hidden!important}.mui--overflow-hidden-y{overflow-y:hidden!important}.mui--visible-lg-block,.mui--visible-lg-inline,.mui--visible-lg-inline-block,.mui--visible-md-block,.mui--visible-md-inline,.mui--visible-md-inline-block,.mui--visible-sm-block,.mui--visible-sm-inline,.mui--visible-sm-inline-block,.mui--visible-xl-block,.mui--visible-xl-inline,.mui--visible-xl-inline-block,.mui--visible-xs-block,.mui--visible-xs-inline,.mui--visible-xs-inline-block{display:none!important}@media (max-width:543px){.mui-visible-xs{display:block!important}table.mui-visible-xs{display:table}tr.mui-visible-xs{display:table-row!important}td.mui-visible-xs,th.mui-visible-xs{display:table-cell!important}.mui--visible-xs-block{display:block!important}.mui--visible-xs-inline{display:inline!important}.mui--visible-xs-inline-block{display:inline-block!important}}@media (min-width:544px) and (max-width:767px){.mui-visible-sm{display:block!important}table.mui-visible-sm{display:table}tr.mui-visible-sm{display:table-row!important}td.mui-visible-sm,th.mui-visible-sm{display:table-cell!important}.mui--visible-sm-block{display:block!important}.mui--visible-sm-inline{display:inline!important}.mui--visible-sm-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.mui-visible-md{display:block!important}table.mui-visible-md{display:table}tr.mui-visible-md{display:table-row!important}td.mui-visible-md,th.mui-visible-md{display:table-cell!important}.mui--visible-md-block{display:block!important}.mui--visible-md-inline{display:inline!important}.mui--visible-md-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.mui-visible-lg{display:block!important}table.mui-visible-lg{display:table}tr.mui-visible-lg{display:table-row!important}td.mui-visible-lg,th.mui-visible-lg{display:table-cell!important}.mui--visible-lg-block{display:block!important}.mui--visible-lg-inline{display:inline!important}.mui--visible-lg-inline-block{display:inline-block!important}}@media (min-width:1200px){.mui-visible-xl{display:block!important}table.mui-visible-xl{display:table}tr.mui-visible-xl{display:table-row!important}td.mui-visible-xl,th.mui-visible-xl{display:table-cell!important}.mui--visible-xl-block{display:block!important}.mui--visible-xl-inline{display:inline!important}.mui--visible-xl-inline-block{display:inline-block!important}}@media (max-width:543px){.mui--hidden-xs{display:none!important}}@media (min-width:544px) and (max-width:767px){.mui--hidden-sm{display:none!important}}@media (min-width:768px) and (max-width:991px){.mui--hidden-md{display:none!important}}@media (min-width:992px) and (max-width:1199px){.mui--hidden-lg{display:none!important}}@media (min-width:1200px){.mui--hidden-xl{display:none!important}}.mui-scrlock--showbar-y{overflow-y:scroll!important}.mui-scrlock--showbar-x{overflow-x:scroll!important}#mui-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999999;background-color:rgba(0,0,0,.2);overflow:auto}.mui-btn__ripple-container{position:absolute;top:0;left:0;display:block;height:100%;width:100%;overflow:hidden;z-index:0;pointer-events:none}.mui-ripple{position:absolute;top:0;left:0;border-radius:50%;opacity:0;pointer-events:none;transform:scale(.0001,.0001)}.mui-ripple.mui--is-animating{transform:none;transition:transform .3s cubic-bezier(0,0,.2,1),width .3s cubic-bezier(0,0,.2,1),height .3s cubic-bezier(0,0,.2,1),opacity .3s cubic-bezier(0,0,.2,1)}.mui-ripple.mui--is-visible{opacity:.3}.mui-btn .mui-ripple{background-color:#a6a6a6}.mui-btn--primary .mui-ripple{background-color:#FFF}.mui-btn--dark .mui-ripple{background-color:#FFF}.mui-btn--danger .mui-ripple{background-color:#FFF}.mui-btn--accent .mui-ripple{background-color:#FFF}.mui-btn--flat .mui-ripple{background-color:#a6a6a6}.mui--text-display4{font-weight:300;font-size:112px;line-height:112px}.mui--text-display3{font-weight:400;font-size:56px;line-height:56px}.mui--text-display2{font-weight:400;font-size:45px;line-height:48px}.mui--text-display1,h1{font-weight:400;font-size:34px;line-height:40px}.mui--text-headline,h2{font-weight:400;font-size:24px;line-height:32px}.mui--text-title,h3{font-weight:400;font-size:20px;line-height:28px}.mui--text-subhead,h4{font-weight:400;font-size:16px;line-height:24px}.mui--text-body2,h5{font-weight:500;font-size:14px;line-height:24px}.mui--text-body1{font-weight:400;font-size:14px;line-height:20px}.mui--text-caption{font-weight:400;font-size:12px;line-height:16px}.mui--text-menu{font-weight:500;font-size:13px;line-height:17px}.mui--text-button{font-weight:500;font-size:14px;line-height:18px;text-transform:uppercase}"; },{}],14:[function(require,module,exports){ module.exports=require(7) },{"../config":4,"./jqLite":6}],15:[function(require,module,exports){ /** * MUI React Appbar Module * @module react/appbar */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Appbar constructor * @class */ var Appbar = function (_React$Component) { babelHelpers.inherits(Appbar, _React$Component); function Appbar() { babelHelpers.classCallCheck(this, Appbar); return babelHelpers.possibleConstructorReturn(this, (Appbar.__proto__ || Object.getPrototypeOf(Appbar)).apply(this, arguments)); } babelHelpers.createClass(Appbar, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, reactProps = babelHelpers.objectWithoutProperties(_props, ['children']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-appbar ' + this.props.className }), children ); } }]); return Appbar; }(_react2.default.Component); /** Define module API */ Appbar.defaultProps = { className: '' }; exports.default = Appbar; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcGJhci5qc3giXSwibmFtZXMiOlsiQXBwYmFyIiwicHJvcHMiLCJjaGlsZHJlbiIsInJlYWN0UHJvcHMiLCJjbGFzc05hbWUiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQUtBOzs7Ozs7QUFFQTs7OztBQUdBOzs7O0lBSU1BLE07Ozs7Ozs7Ozs7NkJBS0s7QUFBQSxtQkFDNkIsS0FBS0MsS0FEbEM7QUFBQSxVQUNDQyxRQURELFVBQ0NBLFFBREQ7QUFBQSxVQUNjQyxVQURkOzs7QUFHUCxhQUNFO0FBQUE7QUFBQSxpQ0FDT0EsVUFEUDtBQUVFLHFCQUFXLGdCQUFnQixLQUFLRixLQUFMLENBQVdHO0FBRnhDO0FBSUdGO0FBSkgsT0FERjtBQVFEOzs7RUFoQmtCLGdCQUFNRyxTOztBQW9CM0I7OztBQXBCTUwsTSxDQUNHTSxZLEdBQWU7QUFDcEJGLGFBQVc7QUFEUyxDO2tCQW9CVEosTSIsImZpbGUiOiJhcHBiYXIuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBNVUkgUmVhY3QgQXBwYmFyIE1vZHVsZVxuICogQG1vZHVsZSByZWFjdC9hcHBiYXJcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBBcHBiYXIgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBBcHBiYXIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJydcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgLi4ucmVhY3RQcm9wcyB9ID0gdGhpcy5wcm9wcztcblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1hcHBiYXIgJyArIHRoaXMucHJvcHMuY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBBcHBiYXI7XG4iXX0= },{"react":"CwoHg3"}],16:[function(require,module,exports){ module.exports=require(9) },{"../js/lib/jqLite":6,"../js/lib/util":7,"react":"CwoHg3"}],17:[function(require,module,exports){ module.exports=require(10) },{"react":"CwoHg3"}],18:[function(require,module,exports){ /** * MUI React checkbox module * @module react/checkbox */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Checkbox constructor * @class */ var Checkbox = function (_React$Component) { babelHelpers.inherits(Checkbox, _React$Component); function Checkbox() { babelHelpers.classCallCheck(this, Checkbox); return babelHelpers.possibleConstructorReturn(this, (Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).apply(this, arguments)); } babelHelpers.createClass(Checkbox, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, label = _props.label, autoFocus = _props.autoFocus, checked = _props.checked, defaultChecked = _props.defaultChecked, defaultValue = _props.defaultValue, disabled = _props.disabled, form = _props.form, name = _props.name, required = _props.required, value = _props.value, onChange = _props.onChange, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'label', 'autoFocus', 'checked', 'defaultChecked', 'defaultValue', 'disabled', 'form', 'name', 'required', 'value', 'onChange']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-checkbox ' + className }), _react2.default.createElement( 'label', null, _react2.default.createElement('input', { ref: 'inputEl', type: 'checkbox', autoFocus: autoFocus, checked: checked, defaultChecked: defaultChecked, defaultValue: defaultValue, disabled: disabled, form: form, name: name, required: required, value: value, onChange: onChange }), label ) ); } }]); return Checkbox; }(_react2.default.Component); /** Define module API */ Checkbox.defaultProps = { className: '', label: null }; exports.default = Checkbox; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNoZWNrYm94LmpzeCJdLCJuYW1lcyI6WyJ1dGlsIiwiQ2hlY2tib3giLCJwcm9wcyIsImNoaWxkcmVuIiwiY2xhc3NOYW1lIiwibGFiZWwiLCJhdXRvRm9jdXMiLCJjaGVja2VkIiwiZGVmYXVsdENoZWNrZWQiLCJkZWZhdWx0VmFsdWUiLCJkaXNhYmxlZCIsImZvcm0iLCJuYW1lIiwicmVxdWlyZWQiLCJ2YWx1ZSIsIm9uQ2hhbmdlIiwicmV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1ZSwgb25DaGFuZ2UsXG4gICAgICAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXZcbiAgICAgICAgeyAuLi5yZWFjdFByb3BzIH1cbiAgICAgICAgY2xhc3NOYW1lPXsnbXVpLWNoZWNrYm94ICcgKyBjbGFzc05hbWV9XG4gICAgICA+XG4gICAgICAgIDxsYWJlbD5cbiAgICAgICAgICA8aW5wdXRcbiAgICAgICAgICAgIHJlZj1cImlucHV0RWxcIlxuICAgICAgICAgICAgdHlwZT1cImNoZWNrYm94XCJcbiAgICAgICAgICAgIGF1dG9Gb2N1cz17YXV0b0ZvY3VzfVxuICAgICAgICAgICAgY2hlY2tlZD17Y2hlY2tlZH1cbiAgICAgICAgICAgIGRlZmF1bHRDaGVja2VkPXtkZWZhdWx0Q2hlY2tlZH1cbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZT17ZGVmYXVsdFZhbHVlfVxuICAgICAgICAgICAgZGlzYWJsZWQ9e2Rpc2FibGVkfVxuICAgICAgICAgICAgZm9ybT17Zm9ybX1cbiAgICAgICAgICAgIG5hbWU9e25hbWV9XG4gICAgICAgICAgICByZXF1aXJlZD17cmVxdWlyZWR9XG4gICAgICAgICAgICB2YWx1ZT17dmFsdWV9XG4gICAgICAgICAgICBvbkNoYW5nZT17b25DaGFuZ2V9XG4gICAgICAgICAgLz5cbiAgICAgICAgICB7bGFiZWx9XG4gICAgICAgIDwvbGFiZWw+XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBDaGVja2JveDtcbiJdfQ== },{"../js/lib/util":7,"./_helpers":8,"react":"CwoHg3"}],19:[function(require,module,exports){ /** * MUI React Col Component * @module react/col */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var breakpoints = ['xs', 'sm', 'md', 'lg', 'xl']; /** * Col constructor * @class */ var Col = function (_React$Component) { babelHelpers.inherits(Col, _React$Component); function Col() { babelHelpers.classCallCheck(this, Col); return babelHelpers.possibleConstructorReturn(this, (Col.__proto__ || Object.getPrototypeOf(Col)).apply(this, arguments)); } babelHelpers.createClass(Col, [{ key: 'defaultProps', value: function defaultProps() { var props = { className: '' }, i = void 0, v = void 0; // add {breakpoint}, {breakpoint}-offset to props for (i = breakpoints.length - 1; i > -1; i--) { v = breakpoints[i]; props[v] = null; props[v + '-offset'] = null; } return props; } }, { key: 'render', value: function render() { var cls = {}, i = void 0, bk = void 0, val = void 0, baseCls = void 0; var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); // add mui-col classes for (i = breakpoints.length - 1; i > -1; i--) { bk = breakpoints[i]; baseCls = 'mui-col-' + bk; // add mui-col-{bk}-{val} val = this.props[bk]; if (val) cls[baseCls + '-' + val] = true; // add mui-col-{bk}-offset-{val} val = this.props[bk + '-offset']; if (val) cls[baseCls + '-offset-' + val] = true; // remove from reactProps delete reactProps[bk]; delete reactProps[bk + '-offset']; } cls = util.classNames(cls); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: cls + ' ' + className }), children ); } }]); return Col; }(_react2.default.Component); /** Define module API */ exports.default = Col; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbC5qc3giXSwibmFtZXMiOlsidXRpbCIsImJyZWFrcG9pbnRzIiwiQ29sIiwicHJvcHMiLCJjbGFzc05hbWUiLCJpIiwidiIsImxlbmd0aCIsImNscyIsImJrIiwidmFsIiwiYmFzZUNscyIsImNoaWxkcmVuIiwicmVhY3RQcm9wcyIsImNsYXNzTmFtZXMiLCJDb21wb25lbnQiXSwibWFwcGluZ3MiOiJBQUFBOzs7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ICAgZGVsZXRlIHJlYWN0UHJvcHNbYmtdO1xuICAgICAgZGVsZXRlIHJlYWN0UHJvcHNbYmsgKyAnLW9mZnNldCddO1xuICAgIH1cblxuICAgIGNscyA9IHV0aWwuY2xhc3NOYW1lcyhjbHMpO1xuICAgIFxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17Y2xzICsgJyAnICsgY2xhc3NOYW1lIH1cbiAgICAgID5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgQ29sO1xuIl19 },{"../js/lib/util":7,"react":"CwoHg3"}],20:[function(require,module,exports){ /** * MUI React container module * @module react/container */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Container constructor * @class */ var Container = function (_React$Component) { babelHelpers.inherits(Container, _React$Component); function Container() { babelHelpers.classCallCheck(this, Container); return babelHelpers.possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); } babelHelpers.createClass(Container, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, fluid = _props.fluid, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'fluid']); var cls = 'mui-container'; // fluid containers if (fluid) cls += '-fluid'; return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: cls + ' ' + className }), children ); } }]); return Container; }(_react2.default.Component); /** Define module API */ Container.defaultProps = { className: '', fluid: false }; exports.default = Container; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRhaW5lci5qc3giXSwibmFtZXMiOlsiQ29udGFpbmVyIiwicHJvcHMiLCJ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GNsYXNzTmFtZTogJycsXG4gICAgZmx1aWQ6IGZhbHNlXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgZmx1aWQsIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICBsZXQgY2xzID0gJ211aS1jb250YWluZXInO1xuXG4gICAgLy8gZmx1aWQgY29udGFpbmVyc1xuICAgIGlmIChmbHVpZCkgY2xzICs9ICctZmx1aWQnO1xuICAgIFxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17Y2xzICsgJyAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBDb250YWluZXI7XG4iXX0= },{"react":"CwoHg3"}],21:[function(require,module,exports){ /** * MUI React divider module * @module react/divider */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Divider constructor * @class */ var Divider = function (_React$Component) { babelHelpers.inherits(Divider, _React$Component); function Divider() { babelHelpers.classCallCheck(this, Divider); return babelHelpers.possibleConstructorReturn(this, (Divider.__proto__ || Object.getPrototypeOf(Divider)).apply(this, arguments)); } babelHelpers.createClass(Divider, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); return _react2.default.createElement('div', babelHelpers.extends({}, reactProps, { className: 'mui-divider ' + className })); } }]); return Divider; }(_react2.default.Component); /** Define module API */ Divider.defaultProps = { className: '' }; exports.default = Divider; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW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dGhpcy5wcm9wcztcblxuICAgIHJldHVybiAoXG4gICAgICA8ZGl2XG4gICAgICAgIHsgLi4ucmVhY3RQcm9wcyB9XG4gICAgICAgIGNsYXNzTmFtZT17J211aS1kaXZpZGVyICcgKyBjbGFzc05hbWUgfVxuICAgICAgPlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgRGl2aWRlcjtcbiJdfQ== },{"react":"CwoHg3"}],22:[function(require,module,exports){ /** * MUI React dropdowns module * @module react/dropdowns */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); /** * DropdownItem constructor * @class */ var DropdownItem = function (_React$Component) { babelHelpers.inherits(DropdownItem, _React$Component); function DropdownItem() { babelHelpers.classCallCheck(this, DropdownItem); return babelHelpers.possibleConstructorReturn(this, (DropdownItem.__proto__ || Object.getPrototypeOf(DropdownItem)).apply(this, arguments)); } babelHelpers.createClass(DropdownItem, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, link = _props.link, target = _props.target, value = _props.value, onClick = _props.onClick, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'link', 'target', 'value', 'onClick']); return _react2.default.createElement( 'li', reactProps, _react2.default.createElement( 'a', { href: link, target: target, 'data-mui-value': value, onClick: onClick }, children ) ); } }]); return DropdownItem; }(_react2.default.Component); /** Define module API */ exports.default = DropdownItem; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3Bkb3duLWl0ZW0uanN4Il0sIm5hbWVzIjpbInV0aWwiLCJEcm9wZG93bkl0ZW0iLCJwcm9wcyIsImNoaWxkcmVuIiwibGluayIsInRhcmdldC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93bkl0ZW0gY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBEcm9wZG93bkl0ZW0gZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgbGluaywgdGFyZ2V0LCB2YWx1ZSwgb25DbGljayxcbiAgICAgIC4uLnJlYWN0UHJvcHMgfSA9IHRoaXMucHJvcHM7XG5cbiAgICByZXR1cm4gKFxuICAgICAgPGxpIHsgLi4ucmVhY3RQcm9wcyB9PlxuICAgICAgICA8YVxuICAgICAgICAgIGhyZWY9e2xpbmt9XG4gICAgICAgICAgdGFyZ2V0PXt0YXJnZXR9XG4gICAgICAgICAgZGF0YS1tdWktdmFsdWU9e3ZhbHVlfVxuICAgICAgICAgIG9uQ2xpY2s9e29uQ2xpY2t9XG4gICAgICAgID5cbiAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgIDwvYT5cbiAgICAgIDwvbGk+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgRHJvcGRvd25JdGVtO1xuIl19 },{"../js/lib/util":7,"react":"CwoHg3"}],23:[function(require,module,exports){ /** * MUI React dropdowns module * @module react/dropdowns */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _button = require('./button'); var _button2 = babelHelpers.interopRequireDefault(_button); var _caret = require('./caret'); var _caret2 = babelHelpers.interopRequireDefault(_caret); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var dropdownClass = 'mui-dropdown', menuClass = 'mui-dropdown__menu', openClass = 'mui--is-open', rightClass = 'mui-dropdown__menu--right'; /** * Dropdown constructor * @class */ var Dropdown = function (_React$Component) { babelHelpers.inherits(Dropdown, _React$Component); function Dropdown(props) { babelHelpers.classCallCheck(this, Dropdown); var _this = babelHelpers.possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); _this.state = { opened: false, menuTop: 0 }; var cb = util.callback; _this.selectCB = cb(_this, 'select'); _this.onClickCB = cb(_this, 'onClick'); _this.onOutsideClickCB = cb(_this, 'onOutsideClick'); return _this; } babelHelpers.createClass(Dropdown, [{ key: 'componentDidMount', value: function componentDidMount() { document.addEventListener('click', this.onOutsideClickCB); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { document.removeEventListener('click', this.onOutsideClickCB); } }, { key: 'onClick', value: function onClick(ev) { // only left clicks if (ev.button !== 0) return; // exit if toggle button is disabled if (this.props.disabled) return; if (!ev.defaultPrevented) { this.toggle(); // execute <Dropdown> onClick method var fn = this.props.onClick; fn && fn(ev); } } }, { key: 'toggle', value: function toggle() { // exit if no menu element if (!this.props.children) { return util.raiseError('Dropdown menu element not found'); } if (this.state.opened) this.close();else this.open(); } }, { key: 'open', value: function open() { // position menu element below toggle button var wrapperRect = this.refs.wrapperEl.getBoundingClientRect(), toggleRect = void 0; toggleRect = this.refs.button.refs.buttonEl.getBoundingClientRect(); this.setState({ opened: true, menuTop: toggleRect.top - wrapperRect.top + toggleRect.height }); } }, { key: 'close', value: function close() { this.setState({ opened: false }); } }, { key: 'select', value: function select(ev) { // onSelect callback if (this.props.onSelect && ev.target.tagName === 'A') { this.props.onSelect(ev.target.getAttribute('data-mui-value')); } // close menu if (!ev.defaultPrevented) this.close(); } }, { key: 'onOutsideClick', value: function onOutsideClick(ev) { var isClickInside = this.refs.wrapperEl.contains(ev.target); if (!isClickInside) this.close(); } }, { key: 'render', value: function render() { var buttonEl = void 0, menuEl = void 0, labelEl = void 0; var _props = this.props, children = _props.children, className = _props.className, color = _props.color, variant = _props.variant, size = _props.size, label = _props.label, alignMenu = _props.alignMenu, onClick = _props.onClick, onSelect = _props.onSelect, disabled = _props.disabled, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'color', 'variant', 'size', 'label', 'alignMenu', 'onClick', 'onSelect', 'disabled']); // build label if (jqLite.type(label) === 'string') { labelEl = _react2.default.createElement( 'span', null, label, ' ', _react2.default.createElement(_caret2.default, null) ); } else { labelEl = label; } buttonEl = _react2.default.createElement( _button2.default, { ref: 'button', type: 'button', onClick: this.onClickCB, color: color, variant: variant, size: size, disabled: disabled }, labelEl ); if (this.state.opened) { var cs = {}; cs[menuClass] = true; cs[openClass] = this.state.opened; cs[rightClass] = alignMenu === 'right'; cs = util.classNames(cs); menuEl = _react2.default.createElement( 'ul', { ref: 'menuEl', className: cs, style: { top: this.state.menuTop }, onClick: this.selectCB }, children ); } else { menuEl = _react2.default.createElement('div', null); } return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { ref: 'wrapperEl', className: dropdownClass + ' ' + className }), buttonEl, menuEl ); } }]); return Dropdown; }(_react2.default.Component); /** Define module API */ Dropdown.defaultProps = { className: '', color: 'default', variant: 'default', size: 'default', label: '', alignMenu: 'left', onClick: null, onSelect: null, disabled: false }; exports.default = Dropdown; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3Bkb3duLmpzeCJdLCJuYW1lcyI6WyJqcUxpdGUiLCJ1dGlsIiwiZHJvcGRvd25DbGFzcyIsIm1lbnVDbGFzcyIsIm9wZW5DbGFzcyIsInJpZ2h0Q2xhc3MiLCJEcm9wZG93biIsInByb3BzIiwic3RhdGUiLCJvcGVuZWQiLCJtZW51VG9wIiwiY2IiLCJjYWxsYmFjayIsInNlbGVjdENCIiwib25DbGlja0NCIiwib25PdXRzaWRlQ2xpY2tDQiIsImRvY3VtZW50IiwiYWRkRXZlbnRMaXN0ZW5lciIsInJlbW92ZUV2ZW50TGlzdGVuZXIiLCJldiIsImJ1dHRvbiIsImRpc2FibG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AgIG1lbnVFbCA9IChcbiAgICAgICAgPHVsXG4gICAgICAgICAgcmVmPVwibWVudUVsXCJcbiAgICAgICAgICBjbGFzc05hbWU9e2NzfVxuICAgICAgICAgIHN0eWxlPXt7dG9wOiB0aGlzLnN0YXRlLm1lbnVUb3B9fVxuICAgICAgICAgIG9uQ2xpY2s9e3RoaXMuc2VsZWN0Q0J9XG4gICAgICAgID5cbiAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgIDwvdWw+XG4gICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICBtZW51RWwgPSA8ZGl2PjwvZGl2PjtcbiAgICB9XG5cbiAgICByZXR1cm4gKFxuICAgICAgPGRpdlxuICAgICAgICB7IC4uLnJlYWN0UHJvcHMgfVxuICAgICAgICByZWY9XCJ3cmFwcGVyRWxcIlxuICAgICAgICBjbGFzc05hbWU9e2Ryb3Bkb3duQ2xhc3MgKyAnICcgKyBjbGFzc05hbWV9XG4gICAgICA+XG4gICAgICAgIHtidXR0b25FbH1cbiAgICAgICAge21lbnVFbH1cbiAgICAgIDwvZGl2PlxuICAgICk7XG4gIH1cbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IERyb3Bkb3duO1xuIl19 },{"../js/lib/jqLite":6,"../js/lib/util":7,"./button":9,"./caret":10,"react":"CwoHg3"}],24:[function(require,module,exports){ /** * MUI React form module * @module react/form */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Form constructor * @class */ var Form = function (_React$Component) { babelHelpers.inherits(Form, _React$Component); function Form() { babelHelpers.classCallCheck(this, Form); return babelHelpers.possibleConstructorReturn(this, (Form.__proto__ || Object.getPrototypeOf(Form)).apply(this, arguments)); } babelHelpers.createClass(Form, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, inline = _props.inline, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'inline']); var cls = 'mui-form'; // inline form if (inline) cls += ' mui-form--inline'; return _react2.default.createElement( 'form', babelHelpers.extends({}, reactProps, { className: cls + ' ' + className }), children ); } }]); return Form; }(_react2.default.Component); /** Define module API */ Form.defaultProps = { className: '', inline: false }; exports.default = Form; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvcm0uanN4Il0sIm5hbWVzIjpbIkZvcm0iLCJwcm9wcyIsImNoaWxkcmVuIiwiY2xhc3NOYW1lIiwiaW5saW5lIiwicmVhY3RQcm9wcyIsImNscyIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBR0E7Ozs7SUFJTUEsSTs7Ozs7Ozs7Ozs2QkFNSztBQUFBLG1CQUNnRCxLQUFLQyxLQURyRDtBQUFBLFVBQ0NDLFFBREQsVUFDQ0EsUUFERDtBQUFBLFVBQ1dDLFNBRFgsVUFDV0EsU0FEWDtBQUFBLFVBQ3NCQyxNQUR0QixVQUNzQkEsTUFEdEI7QUFBQSxVQUNpQ0MsVUFEakM7O0FBRVAsVUFBSUMsTUFBTSxVQUFWOztBQUVBO0FBQ0EsVUFBSUYsTUFBSixFQUFZRSxPQUFPLG1CQUFQOztBQUVaLGFBQ0U7QUFBQTtBQUFBLGlDQUNPRCxVQURQO0FBRUUscUJBQVdDLE1BQU0sR0FBTixHQUFZSDtBQUZ6QjtBQUlHRDtBQUpILE9BREY7QUFRRDs7O0VBckJnQixnQkFBTUssUzs7QUF5QnpCOzs7QUF6Qk1QLEksQ0FDR1EsWSxHQUFlO0FBQ3BCTCxhQUFXLEVBRFM7QUFFcEJDLFVBQVE7QUFGWSxDO2tCQXlCVEosSSIsImZpbGUiOiJmb3JtLmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IGZvcm0gbW9kdWxlXG4gKiBAbW9kdWxlIHJlYWN0L2Zvcm1cbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cblxuLyoqXG4gKiBGb3JtIGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgRm9ybSBleHRlbmRzIFJlYWN0LkNvbXBvbmVudCB7XG4gIHN0YXRpYyBkZWZhdWx0UHJvcHMgPSB7XG4gICAgY2xhc3NOYW1lOiAnJyxcbiAgICBpbmxpbmU6IGZhbHNlXG4gIH07XG5cbiAgcmVuZGVyKCkge1xuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNsYXNzTmFtZSwgaW5saW5lLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuICAgIGxldCBjbHMgPSAnbXVpLWZvcm0nO1xuXG4gICAgLy8gaW5saW5lIGZvcm1cbiAgICBpZiAoaW5saW5lKSBjbHMgKz0gJyBtdWktZm9ybS0taW5saW5lJztcblxuICAgIHJldHVybiAoXG4gICAgICA8Zm9ybVxuICAgICAgICB7IC4uLnJlYWN0UHJvcHMgfVxuICAgICAgICBjbGFzc05hbWU9e2NscyArICcgJyArIGNsYXNzTmFtZSB9XG4gICAgICA+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvZm9ybT5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBGb3JtO1xuIl19 },{"react":"CwoHg3"}],25:[function(require,module,exports){ /** * MUI React Input Component * @module react/input */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _textField = require('./text-field'); /** * Input constructor * @class */ var Input = function (_React$Component) { babelHelpers.inherits(Input, _React$Component); function Input() { babelHelpers.classCallCheck(this, Input); return babelHelpers.possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).apply(this, arguments)); } babelHelpers.createClass(Input, [{ key: 'render', value: function render() { return _react2.default.createElement(_textField.TextField, this.props); } }]); return Input; }(_react2.default.Component); Input.defaultProps = { type: 'text' }; exports.default = Input; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmpzeCJdLCJuYW1lcyI6WyJJbnB1dCIsInByb3BzIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwidHlwZSJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBRUE7O0FBR0E7Ozs7SUFJTUEsSzs7Ozs7Ozs7Ozs2QkFLSztBQUNQLGFBQU8sb0RBQWdCLEtBQUtDLEtBQXJCLENBQVA7QUFDRDs7O0VBUGlCLGdCQUFNQyxTOztBQUFwQkYsSyxDQUNHRyxZLEdBQWU7QUFDcEJDLFFBQU07QUFEYyxDO2tCQVVUSixLIiwiZmlsZSI6ImlucHV0LmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAqIE1VSSBSZWFjdCBJbnB1dCBDb21wb25lbnRcbiAqIEBtb2R1bGUgcmVhY3QvaW5wdXRcbiAqL1xuXG4ndXNlIHN0cmljdCc7XG5cbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCB7IFRleHRGaWVsZCB9IGZyb20gJy4vdGV4dC1maWVsZCc7XG5cblxuLyoqXG4gKiBJbnB1dCBjb25zdHJ1Y3RvclxuICogQGNsYXNzXG4gKi9cbmNsYXNzIElucHV0IGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICB0eXBlOiAndGV4dCdcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgcmV0dXJuIDxUZXh0RmllbGQgeyAuLi50aGlzLnByb3BzIH0gLz47XG4gIH1cbn1cblxuXG5leHBvcnQgZGVmYXVsdCBJbnB1dDtcbiJdfQ== },{"./text-field":12,"react":"CwoHg3"}],26:[function(require,module,exports){ /** * MUI React options module * @module react/option */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _forms = require('../js/lib/forms'); var formlib = babelHelpers.interopRequireWildcard(_forms); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Option constructor * @class */ var Option = function (_React$Component) { babelHelpers.inherits(Option, _React$Component); function Option() { babelHelpers.classCallCheck(this, Option); return babelHelpers.possibleConstructorReturn(this, (Option.__proto__ || Object.getPrototypeOf(Option)).apply(this, arguments)); } babelHelpers.createClass(Option, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, label = _props.label, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'label']); return _react2.default.createElement( 'option', reactProps, label ); } }]); return Option; }(_react2.default.Component); /** Define module API */ Option.defaultProps = { className: '', label: null }; exports.default = Option; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wdGlvbi5qc3giXSwibmFtZXMiOlsiZm9ybWxpYiIsImpxTGl0ZSIsInV0aWwiLCJPcHRpb24iLCJwcm9wcyIsImNoaWxkcmVuIiwibGFiZWwiLCJyZWFjdFByb3BzIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwiY2xhc3NOYW1lIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFFQTs7SUFBWUEsTzs7QUFDWjs7SUFBWUMsTTs7QUFDWj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NvbnN0IHsgY2hpbGRyZW4sIGxhYmVsLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIDxvcHRpb24geyAuLi5yZWFjdFByb3BzIH0+e2xhYmVsfTwvb3B0aW9uPjtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgT3B0aW9uO1xuIl19 },{"../js/lib/forms":5,"../js/lib/jqLite":6,"../js/lib/util":7,"./_helpers":8,"react":"CwoHg3"}],27:[function(require,module,exports){ /** * MUI React layout module * @module react/layout */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Panel constructor * @class */ var Panel = function (_React$Component) { babelHelpers.inherits(Panel, _React$Component); function Panel() { babelHelpers.classCallCheck(this, Panel); return babelHelpers.possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).apply(this, arguments)); } babelHelpers.createClass(Panel, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-panel ' + className }), children ); } }]); return Panel; }(_react2.default.Component); /** Define module API */ Panel.defaultProps = { className: '' }; exports.default = Panel; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhbmVsLmpzeCJdLCJuYW1lcyI6WyJQYW5lbCIsInByb3BzIiwiY2hpbGRyZW4iLCJjbGFzc05hbWUiLCJyZWFjdFByb3BzIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7QUFLQTs7Ozs7O0FBRUE7Ozs7QUFHQTs7OztJQUlNQSxLOzs7Ozs7Ozs7OzZCQUtLO0FBQUEsbUJBQ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CBkZWZhdWx0IFBhbmVsO1xuIl19 },{"react":"CwoHg3"}],28:[function(require,module,exports){ /** * MUI React radio module * @module react/radio */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); /** * Radio constructor * @class */ var Radio = function (_React$Component) { babelHelpers.inherits(Radio, _React$Component); function Radio() { babelHelpers.classCallCheck(this, Radio); return babelHelpers.possibleConstructorReturn(this, (Radio.__proto__ || Object.getPrototypeOf(Radio)).apply(this, arguments)); } babelHelpers.createClass(Radio, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, label = _props.label, autoFocus = _props.autoFocus, checked = _props.checked, defaultChecked = _props.defaultChecked, defaultValue = _props.defaultValue, disabled = _props.disabled, form = _props.form, name = _props.name, required = _props.required, value = _props.value, onChange = _props.onChange, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'label', 'autoFocus', 'checked', 'defaultChecked', 'defaultValue', 'disabled', 'form', 'name', 'required', 'value', 'onChange']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-radio ' + className }), _react2.default.createElement( 'label', null, _react2.default.createElement('input', { ref: 'inputEl', type: 'radio', autoFocus: autoFocus, checked: checked, defaultChecked: defaultChecked, defaultValue: defaultValue, disabled: disabled, form: form, name: name, required: required, value: value, onChange: onChange }), label ) ); } }]); return Radio; }(_react2.default.Component); /** Define module API */ Radio.defaultProps = { className: '', label: null }; exports.default = Radio; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJhZGlvLmpzeCJdLCJuYW1lcyI6WyJSYWRpbyIsInByb3BzIiwiY2hpbGRyZW4iLCJjbGFzc05hbWUiLCJsYWJlbCIsImF1dG9Gb2N1cyIsImNoZWNrZWQiLCJkZWZhdWx0Q2hlY2tlZCIsImRlZmF1bHRWYWx1ZSIsImRpc2FibGVkIiwiZm9ybSIsIm5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yAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgPGlucHV0XG4gICAgICAgICAgICByZWY9XCJpbnB1dEVsXCJcbiAgICAgICAgICAgIHR5cGU9XCJyYWRpb1wiXG4gICAgICAgICAgICBhdXRvRm9jdXM9e2F1dG9Gb2N1c31cbiAgICAgICAgICAgIGNoZWNrZWQ9e2NoZWNrZWR9XG4gICAgICAgICAgICBkZWZhdWx0Q2hlY2tlZD17ZGVmYXVsdENoZWNrZWR9XG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU9e2RlZmF1bHRWYWx1ZX1cbiAgICAgICAgICAgIGRpc2FibGVkPXtkaXNhYmxlZH1cbiAgICAgICAgICAgIGZvcm09e2Zvcm19XG4gICAgICAgICAgICBuYW1lPXtuYW1lfVxuICAgICAgICAgICAgcmVxdWlyZWQ9e3JlcXVpcmVkfVxuICAgICAgICAgICAgdmFsdWU9e3ZhbHVlfVxuICAgICAgICAgICAgb25DaGFuZ2U9e29uQ2hhbmdlfVxuICAgICAgICAgIC8+XG4gICAgICAgICAge2xhYmVsfVxuICAgICAgICA8L2xhYmVsPlxuICAgICAgPC9kaXY+XG4gICAgKTtcbiAgfVxufVxuXG5cbi8qKiBEZWZpbmUgbW9kdWxlIEFQSSAqL1xuZXhwb3J0IGRlZmF1bHQgUmFkaW87XG4iXX0= },{"react":"CwoHg3"}],29:[function(require,module,exports){ /** * MUI React Row Component * @module react/row */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var breakpoints = ['xs', 'sm', 'md', 'lg']; /** * Row constructor * @class */ var Row = function (_React$Component) { babelHelpers.inherits(Row, _React$Component); function Row() { babelHelpers.classCallCheck(this, Row); return babelHelpers.possibleConstructorReturn(this, (Row.__proto__ || Object.getPrototypeOf(Row)).apply(this, arguments)); } babelHelpers.createClass(Row, [{ key: 'render', value: function render() { var _props = this.props, children = _props.children, className = _props.className, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { className: 'mui-row ' + className }), children ); } }]); return Row; }(_react2.default.Component); /** Define module API */ Row.defaultProps = { className: '' }; exports.default = Row; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvdy5qc3giXSwibmFtZXMiOlsidXRpbCIsImJyZWFrcG9pbnRzIiwiUm93IiwicHJvcHMiLCJjaGlsZHJlbiIsImNsYXNzTmFtZSIsInJlYWN0UHJvcHMiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiXSwibWFwcGluZ3MiOiJBQUFBOzs7OztBQUtBOzs7Ozs7QUFFQTs7OztBQUVBOztJQUFZQSxJOzs7QUFHWixJQUFNQyxjQUFjLENBQUMsSUFBRCxFQUFPLElBQVAsRUFBYSxJQUFiLEVBQW1CLElBQW5CLENBQXBCOztBQUdBOzs7OztJQUlNQyxHOzs7Ozs7Ozs7OzZCQUtLO0FBQUEsbUJBQ3dDLEtBQUtDLEtBRDdDO0FBQUEsVUFDQ0MsUUFERCxVQUNDQSxRQUREO0FBQUEsVUFDV0MsU0FEWCxVQUNXQSxTQURYO0FBQUEsVUFDeUJDLFVBRHpCOzs7QUFHUCxhQUNFO0FBQUE7QUFBQSxpQ0FDT0EsVUFEUDtBQUVFLHFCQUFXLGFBQWFEO0FBRjFCO0FBSUdEO0FBSkgsT0FERjtBQVFEOzs7RUFoQmUsZ0JBQU1HLFM7O0FBb0J4Qjs7O0FBcEJNTCxHLENBQ0dNLFksR0FBZTtBQUNwQkgsYUFBVztBQURTLEM7a0JBb0JUSCxHIiwiZmlsZSI6InJvdy5qc3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1VSSBSZWFjdCBSb3cgQ29tcG9uZW50XG4gKiBAbW9kdWxlIHJlYWN0L3Jvd1xuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0ICogYXMgdXRpbCBmcm9tICcuLi9qcy9saWIvdXRpbCc7XG5cblxuY29uc3QgYnJlYWtwb2ludHMgPSBbJ3hzJywgJ3NtJywgJ21kJywgJ2xnJ107XG5cblxuLyoqXG4gKiBSb3cgY29uc3RydWN0b3JcbiAqIEBjbGFzc1xuICovXG5jbGFzcyBSb3cgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIGNsYXNzTmFtZTogJydcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgY29uc3QgeyBjaGlsZHJlbiwgY2xhc3NOYW1lLCAuLi5yZWFjdFByb3BzIH0gPSB0aGlzLnByb3BzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXZcbiAgICAgICAgeyAuLi5yZWFjdFByb3BzIH1cbiAgICAgICAgY2xhc3NOYW1lPXsnbXVpLXJvdyAnICsgY2xhc3NOYW1lfVxuICAgICAgPlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBSb3c7XG4iXX0= },{"../js/lib/util":7,"react":"CwoHg3"}],30:[function(require,module,exports){ /** * MUI React select module * @module react/select */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _forms = require('../js/lib/forms'); var formlib = babelHelpers.interopRequireWildcard(_forms); var _jqLite = require('../js/lib/jqLite'); var jqLite = babelHelpers.interopRequireWildcard(_jqLite); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var _helpers = require('./_helpers'); /** * Select constructor * @class */ var Select = function (_React$Component) { babelHelpers.inherits(Select, _React$Component); function Select(props) { babelHelpers.classCallCheck(this, Select); // warn if value defined but onChange is not var _this = babelHelpers.possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props)); _this.state = { showMenu: false }; if (props.readOnly === false && props.value !== undefined && props.onChange === null) { util.raiseError(_helpers.controlledMessage, true); } _this.state.value = props.value; // bind callback function var cb = util.callback; _this.onInnerChangeCB = cb(_this, 'onInnerChange'); _this.onInnerMouseDownCB = cb(_this, 'onInnerMouseDown'); _this.onOuterClickCB = cb(_this, 'onOuterClick'); _this.onOuterKeyDownCB = cb(_this, 'onOuterKeyDown'); _this.hideMenuCB = cb(_this, 'hideMenu'); _this.onMenuChangeCB = cb(_this, 'onMenuChange'); return _this; } babelHelpers.createClass(Select, [{ key: 'componentDidMount', value: function componentDidMount() { // disable MUI CSS/JS this.refs.selectEl._muiSelect = true; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { this.setState({ value: nextProps.value }); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // ensure that doc event listners have been removed jqLite.off(window, 'resize', this.hideMenuCB); jqLite.off(document, 'click', this.hideMenuCB); } }, { key: 'onInnerChange', value: function onInnerChange(ev) { var value = ev.target.value; // update state this.setState({ value: value }); } }, { key: 'onInnerMouseDown', value: function onInnerMouseDown(ev) { // only left clicks & check flag if (ev.button !== 0 || this.props.useDefault) return; // prevent built-in menu from opening ev.preventDefault(); } }, { key: 'onOuterClick', value: function onOuterClick(ev) { // only left clicks, return if <select> is disabled if (ev.button !== 0 || this.refs.selectEl.disabled) return; // execute callback var fn = this.props.onClick; fn && fn(ev); // exit if preventDefault() was called if (ev.defaultPrevented || this.props.useDefault) return; // focus wrapper this.refs.wrapperEl.focus(); // open custom menu this.showMenu(); } }, { key: 'onOuterKeyDown', value: function onOuterKeyDown(ev) { // execute callback var fn = this.props.onKeyDown; fn && fn(ev); // exit if preventDevault() was called or useDefault is true if (ev.defaultPrevented || this.props.useDefault) return; if (this.state.showMenu === false) { var keyCode = ev.keyCode; // spacebar, down, up if (keyCode === 32 || keyCode === 38 || keyCode === 40) { // prevent default browser action ev.preventDefault(); // open custom menu this.showMenu(); } } } }, { key: 'showMenu', value: function showMenu() { // check useDefault flag if (this.props.useDefault) return; // add event listeners jqLite.on(window, 'resize', this.hideMenuCB); jqLite.on(document, 'click', this.hideMenuCB); // re-draw this.setState({ showMenu: true }); } }, { key: 'hideMenu', value: function hideMenu() { // remove event listeners jqLite.off(window, 'resize', this.hideMenuCB); jqLite.off(document, 'click', this.hideMenuCB); // re-draw this.setState({ showMenu: false }); // refocus this.refs.wrapperEl.focus(); } }, { key: 'onMenuChange', value: function onMenuChange(value) { if (this.props.readOnly) return; // update inner <select> and dispatch 'change' event this.refs.selectEl.value = value; util.dispatchEvent(this.refs.selectEl, 'change'); } }, { key: 'render', value: function render() { var menuElem = void 0; if (this.state.showMenu) { menuElem = _react2.default.createElement(Menu, { optionEls: this.refs.selectEl.children, wrapperEl: this.refs.wrapperEl, onChange: this.onMenuChangeCB, onClose: this.hideMenuCB }); } // set tab index so user can focus wrapper element var tabIndexWrapper = '-1', tabIndexInner = '0'; if (this.props.useDefault === false) { tabIndexWrapper = '0'; tabIndexInner = '-1'; } var _props = this.props, children = _props.children, className = _props.className, style = _props.style, label = _props.label, defaultValue = _props.defaultValue, readOnly = _props.readOnly, useDefault = _props.useDefault, name = _props.name, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'className', 'style', 'label', 'defaultValue', 'readOnly', 'useDefault', 'name']); return _react2.default.createElement( 'div', babelHelpers.extends({}, reactProps, { ref: 'wrapperEl', tabIndex: tabIndexWrapper, style: style, className: 'mui-select ' + className, onClick: this.onOuterClickCB, onKeyDown: this.onOuterKeyDownCB }), _react2.default.createElement( 'select', { ref: 'selectEl', name: name, tabIndex: tabIndexInner, value: this.state.value, defaultValue: defaultValue, readOnly: this.props.readOnly, onChange: this.onInnerChangeCB, onMouseDown: this.onInnerMouseDownCB, required: this.props.required }, children ), _react2.default.createElement( 'label', null, label ), menuElem ); } }]); return Select; }(_react2.default.Component); /** * Menu constructor * @class */ Select.defaultProps = { className: '', name: '', readOnly: false, useDefault: typeof document !== 'undefined' && 'ontouchstart' in document.documentElement ? true : false, onChange: null, onClick: null, onKeyDown: null }; var Menu = function (_React$Component2) { babelHelpers.inherits(Menu, _React$Component2); function Menu(props) { babelHelpers.classCallCheck(this, Menu); var _this2 = babelHelpers.possibleConstructorReturn(this, (Menu.__proto__ || Object.getPrototypeOf(Menu)).call(this, props)); _this2.state = { origIndex: null, currentIndex: null }; _this2.onKeyDownCB = util.callback(_this2, 'onKeyDown'); _this2.onKeyPressCB = util.callback(_this2, 'onKeyPress'); _this2.q = ''; _this2.qTimeout = null; return _this2; } babelHelpers.createClass(Menu, [{ key: 'componentWillMount', value: function componentWillMount() { var optionEls = this.props.optionEls, m = optionEls.length, selectedPos = 0, i = void 0; // get current selected position for (i = m - 1; i > -1; i--) { if (optionEls[i].selected) selectedPos = i; }this.setState({ origIndex: selectedPos, currentIndex: selectedPos }); } }, { key: 'componentDidMount', value: function componentDidMount() { // prevent scrolling util.enableScrollLock(); // set position var props = formlib.getMenuPositionalCSS(this.props.wrapperEl, this.props.optionEls.length, this.state.currentIndex); var el = this.refs.wrapperEl; jqLite.css(el, props); jqLite.scrollTop(el, props.scrollTop); // attach keydown handler jqLite.on(document, 'keydown', this.onKeyDownCB); jqLite.on(document, 'keypress', this.onKeyPressCB); } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { // remove scroll lock util.disableScrollLock(true); // remove keydown handler jqLite.off(document, 'keydown', this.onKeyDownCB); jqLite.off(document, 'keypress', this.onKeyPressCB); } }, { key: 'onClick', value: function onClick(pos, ev) { // don't allow events to bubble ev.stopPropagation(); this.selectAndDestroy(pos); } }, { key: 'onKeyDown', value: function onKeyDown(ev) { var keyCode = ev.keyCode; // tab if (keyCode === 9) return this.destroy(); // escape | up | down | enter if (keyCode === 27 || keyCode === 40 || keyCode === 38 || keyCode === 13) { ev.preventDefault(); } if (keyCode === 27) this.destroy();else if (keyCode === 40) this.increment();else if (keyCode === 38) this.decrement();else if (keyCode === 13) this.selectAndDestroy(); } }, { key: 'onKeyPress', value: function onKeyPress(ev) { // handle query timer var self = this; clearTimeout(this.qTimeout); this.q += ev.key; this.qTimeout = setTimeout(function () { self.q = ''; }, 300); // select first match alphabetically var prefixRegex = new RegExp('^' + this.q, 'i'), optionEls = this.props.optionEls, m = optionEls.length, i = void 0; for (i = 0; i < m; i++) { // select item if code matches if (prefixRegex.test(optionEls[i].innerText)) { this.setState({ currentIndex: i }); break; } } } }, { key: 'increment', value: function increment() { if (this.state.currentIndex === this.props.optionEls.length - 1) return; this.setState({ currentIndex: this.state.currentIndex + 1 }); } }, { key: 'decrement', value: function decrement() { if (this.state.currentIndex === 0) return; this.setState({ currentIndex: this.state.currentIndex - 1 }); } }, { key: 'selectAndDestroy', value: function selectAndDestroy(pos) { pos = pos === undefined ? this.state.currentIndex : pos; // handle onChange if (pos !== this.state.origIndex) { this.props.onChange(this.props.optionEls[pos].value); } // close menu this.destroy(); } }, { key: 'destroy', value: function destroy() { this.props.onClose(); } }, { key: 'render', value: function render() { var menuItems = [], optionEls = this.props.optionEls, m = optionEls.length, optionEl = void 0, cls = void 0, i = void 0; // define menu items for (i = 0; i < m; i++) { cls = i === this.state.currentIndex ? 'mui--is-selected ' : ''; // add custom css class from <Option> component cls += optionEls[i].className; menuItems.push(_react2.default.createElement( 'div', { key: i, className: cls, onClick: this.onClick.bind(this, i) }, optionEls[i].textContent )); } return _react2.default.createElement( 'div', { ref: 'wrapperEl', className: 'mui-select__menu' }, menuItems ); } }]); return Menu; }(_react2.default.Component); /** Define module API */ Menu.defaultProps = { optionEls: [], wrapperEl: null, onChange: null, onClose: null }; exports.default = Select; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbGVjdC5qc3giXSwibmFtZXMiOl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zLXNlbGVjdGVkICcgOiAnJztcblxuICAgICAgLy8gYWRkIGN1c3RvbSBjc3MgY2xhc3MgZnJvbSA8T3B0aW9uPiBjb21wb25lbnRcbiAgICAgIGNscyArPSBvcHRpb25FbHNbaV0uY2xhc3NOYW1lO1xuXG4gICAgICBtZW51SXRlbXMucHVzaChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIGtleT17aX1cbiAgICAgICAgICBjbGFzc05hbWU9e2Nsc31cbiAgICAgICAgICBvbkNsaWNrPXt0aGlzLm9uQ2xpY2suYmluZCh0aGlzLCBpKX1cbiAgICAgICAgPlxuICAgICAgICAgIHtvcHRpb25FbHNbaV0udGV4dENvbnRlbnR9XG4gICAgICAgIDwvZGl2PlxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gPGRpdiByZWY9XCJ3cmFwcGVyRWxcIiBjbGFzc05hbWU9XCJtdWktc2VsZWN0X19tZW51XCI+e21lbnVJdGVtc308L2Rpdj47XG4gIH1cbn1cblxuXG4vKiogRGVmaW5lIG1vZHVsZSBBUEkgKi9cbmV4cG9ydCBkZWZhdWx0IFNlbGVjdDtcbiJdfQ== },{"../js/lib/forms":5,"../js/lib/jqLite":6,"../js/lib/util":7,"./_helpers":8,"react":"CwoHg3"}],31:[function(require,module,exports){ module.exports=require(11) },{"react":"CwoHg3"}],32:[function(require,module,exports){ (function (process){ /** * MUI React tabs module * @module react/tabs */ /* jshint quotmark:false */ // jscs:disable validateQuoteMarks 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _tab = require('./tab'); var _tab2 = babelHelpers.interopRequireDefault(_tab); var _util = require('../js/lib/util'); var util = babelHelpers.interopRequireWildcard(_util); var tabsBarClass = 'mui-tabs__bar', tabsBarJustifiedClass = 'mui-tabs__bar--justified', tabsPaneClass = 'mui-tabs__pane', isActiveClass = 'mui--is-active'; /** * Tabs constructor * @class */ var Tabs = function (_React$Component) { babelHelpers.inherits(Tabs, _React$Component); function Tabs(props) { babelHelpers.classCallCheck(this, Tabs); /* * The following code exists only to warn about deprecating props.initialSelectedIndex in favor of props.defaultSelectedIndex. * It can be removed once support for props.initialSelectedIndex is officially dropped. */ var defaultSelectedIndex = void 0; if (typeof props.initialSelectedIndex === 'number') { defaultSelectedIndex = props.initialSelectedIndex; if (console && process && process.env && process.NODE_ENV !== 'production') { console.warn('MUICSS DEPRECATION WARNING: ' + 'property "initialSelectedIndex" on the muicss Tabs component is deprecated in favor of "defaultSelectedIndex". ' + 'It will be removed in a future release.'); } } else { defaultSelectedIndex = props.defaultSelectedIndex; } /* * End deprecation warning */ var _this = babelHelpers.possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); _this.state = { currentSelectedIndex: typeof props.selectedIndex === 'number' ? props.selectedIndex : defaultSelectedIndex }; return _this; } babelHelpers.createClass(Tabs, [{ key: 'onClick', value: function onClick(i, tab, ev) { if (typeof this.props.selectedIndex === 'number' && i !== this.props.selectedIndex || i !== this.state.currentSelectedIndex) { this.setState({ currentSelectedIndex: i }); // onActive callback if (tab.props.onActive) tab.props.onActive(tab); // onChange callback if (this.props.onChange) { this.props.onChange(i, tab.props.value, tab, ev); } } } }, { key: 'render', value: function render() { var _props = this.props, children = _props.children, defaultSelectedIndex = _props.defaultSelectedIndex, initialSelectedIndex = _props.initialSelectedIndex, justified = _props.justified, selectedIndex = _props.selectedIndex, reactProps = babelHelpers.objectWithoutProperties(_props, ['children', 'defaultSelectedIndex', 'initialSelectedIndex', 'justified', 'selectedIndex']); var tabs = _react2.default.Children.toArray(children); var tabEls = [], paneEls = [], m = tabs.length, currentSelectedIndex = (typeof selectedIndex === 'number' ? selectedIndex : this.state.currentSelectedIndex) % m, isActive = void 0, item = void 0, cls = void 0, i = void 0; for (i = 0; i < m; i++) { item = tabs[i]; // only accept MUITab elements if (item.type !== _tab2.default) util.raiseError('Expecting MUITab React Element'); isActive = i === currentSelectedIndex ? true : false; // tab element tabEls.push(_react2.default.createElement( 'li', { key: i, className: isActive ? isActiveClass : '' }, _react2.default.createElement( 'a', { onClick: this.onClick.bind(this, i, item) }, item.props.label ) )); // pane element cls = tabsPaneClass + ' '; if (isActive) cls += isActiveClass; paneEls.push(_react2.default.createElement( 'div', { key: i, className: cls }, item.props.children )); } cls = tabsBarClass; if (justified) cls += ' ' + tabsBarJustifiedClass; return _react2.default.createElement( 'div', reactProps, _react2.default.createElement( 'ul', { className: cls }, tabEls ), paneEls ); } }]); return Tabs; }(_react2.default.Component); /** Define module API */ Tabs.defaultProps = { className: '', defaultSelectedIndex: 0, /* * @deprecated */ initialSelectedIndex: null, justified: false, onChange: null, selectedIndex: null }; exports.default = Tabs; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhYnMuanN4Il0sIm5hbWVzIjpbInV0aWwiLCJ0YWJzQmFyQ2xhc3MiLCJ0YWJzQmFySnVzdGlmaWVkQ2xhc3MiLCJ0YWJzUGFuZUNsYXNzIiwiaXNBY3RpdmVDbGFzcyIsIlRhYnMiLCJwcm9wcyIsImRlZmF1bHRTZWxlY3RlZEluZGV4IiwiaW5pdGlhbFNlbGVjdGVkSW5kZXgiLCJjb25zb2xlIiwicHJvY2VzcyIsImVudiIsIk5PREVfRU5WIiwid2FybiIsInN0YXRlIiwiY3VycmVudFNlbGVjdGVkSW5kZXgiLCJzZWxlY3RlZEluZGV4IiwiaSIsInRhYiIsImV2Iiwic2V0U3RhdGUiLCJvbkFjdGl2ZSIsIm9uQ2hhbmdlIiwidmFsdWUiLCJjaGlsZHJlbiIsImp1c3RpZmllZCIsInJlYWN0UHJvcHMiLCJ0YWJzIiwiQ2hpbGRyZW4iLCJ0b0FycmF5IiwidGFiRWxzIiwicGFuZUVscyIsIm0iLCJsZW5ndGgiLCJpc0FjdGl2ZSIsIml0ZW0iLCJjbHMiLCJ0eXBlIiwicmFpc2VFcnJvciIsInB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xuICAgICAgICA8bGkga2V5PXtpfSBjbGFzc05hbWU9eyhpc0FjdGl2ZSkgPyBpc0FjdGl2ZUNsYXNzIDogJyd9PlxuICAgICAgICAgIDxhIG9uQ2xpY2s9e3RoaXMub25DbGljay5iaW5kKHRoaXMsIGksIGl0ZW0pfT5cbiAgICAgICAgICAgIHtpdGVtLnByb3BzLmxhYmVsfVxuICAgICAgICAgIDwvYT5cbiAgICAgICAgPC9saT5cbiAgICAgICk7XG5cbiAgICAgIC8vIHBhbmUgZWxlbWVudFxuICAgICAgY2xzID0gdGFic1BhbmVDbGFzcyArICcgJztcbiAgICAgIGlmIChpc0FjdGl2ZSkgY2xzICs9IGlzQWN0aXZlQ2xhc3M7XG5cbiAgICAgIHBhbmVFbHMucHVzaChcbiAgICAgICAgPGRpdiBrZXk9e2l9IGNsYXNzTmFtZT17Y2xzfT5cbiAgICAgICAgICB7aXRlbS5wcm9wcy5jaGlsZHJlbn1cbiAgICAgICAgPC9kaXY+XG4gICAgICApO1xuICAgIH1cblxuICAgIGNscyA9IHRhYnNCYXJDbGFzcztcbiAgICBpZiAoanVzdGlmaWVkKSBjbHMgKz0gJyAnICsgdGFic0Jhckp1c3RpZmllZENsYXNzO1xuXG4gICAgcmV0dXJuIChcbiAgICAgIDxkaXYgeyAuLi5yZWFjdFByb3BzIH0+XG4gICAgICAgIDx1bCBjbGFzc05hbWU9e2Nsc30+XG4gICAgICAgICAge3RhYkVsc31cbiAgICAgICAgPC91bD5cbiAgICAgICAge3BhbmVFbHN9XG4gICAgICA8L2Rpdj5cbiAgICApO1xuICB9XG59XG5cblxuLyoqIERlZmluZSBtb2R1bGUgQVBJICovXG5leHBvcnQgZGVmYXVsdCBUYWJzO1xuIl19 }).call(this,require("rh2vBp")) },{"../js/lib/util":7,"./tab":11,"react":"CwoHg3","rh2vBp":1}],33:[function(require,module,exports){ /** * MUI React Textarea Component * @module react/textarea */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = window.React; var _react2 = babelHelpers.interopRequireDefault(_react); var _textField = require('./text-field'); /** * Textarea constructor * @class */ var Textarea = function (_React$Component) { babelHelpers.inherits(Textarea, _React$Component); function Textarea() { babelHelpers.classCallCheck(this, Textarea); return babelHelpers.possibleConstructorReturn(this, (Textarea.__proto__ || Object.getPrototypeOf(Textarea)).apply(this, arguments)); } babelHelpers.createClass(Textarea, [{ key: 'render', value: function render() { return _react2.default.createElement(_textField.TextField, this.props); } }]); return Textarea; }(_react2.default.Component); Textarea.defaultProps = { type: 'textarea' }; exports.default = Textarea; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRleHRhcmVhLmpzeCJdLCJuYW1lcyI6WyJUZXh0YXJlYSIsInByb3BzIiwiQ29tcG9uZW50IiwiZGVmYXVsdFByb3BzIiwidHlwZSJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0FBS0E7Ozs7OztBQUVBOzs7O0FBRUE7O0FBR0E7Ozs7SUFJTUEsUTs7Ozs7Ozs7Ozs2QkFLSztBQUNQLGFBQU8sb0RBQWdCLEtBQUtDLEtBQXJCLENBQVA7QUFDRDs7O0VBUG9CLGdCQUFNQyxTOztBQUF2QkYsUSxDQUNHRyxZLEdBQWU7QUFDcEJDLFFBQU07QUFEYyxDO2tCQVVUSixRIiwiZmlsZSI6InRleHRhcmVhLmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTVVJIFJlYWN0IFRleHRhcmVhIENvbXBvbmVudFxuICogQG1vZHVsZSByZWFjdC90ZXh0YXJlYVxuICovXG5cbid1c2Ugc3RyaWN0JztcblxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgVGV4dEZpZWxkIH0gZnJvbSAnLi90ZXh0LWZpZWxkJztcblxuXG4vKipcbiAqIFRleHRhcmVhIGNvbnN0cnVjdG9yXG4gKiBAY2xhc3NcbiAqL1xuY2xhc3MgVGV4dGFyZWEgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICBzdGF0aWMgZGVmYXVsdFByb3BzID0ge1xuICAgIHR5cGU6ICd0ZXh0YXJlYSdcbiAgfTtcblxuICByZW5kZXIoKSB7XG4gICAgcmV0dXJuIDxUZXh0RmllbGQgeyAuLi50aGlzLnByb3BzIH0gLz47XG4gIH1cbn1cblxuXG5leHBvcnQgZGVmYXVsdCBUZXh0YXJlYTtcbiJdfQ== },{"./text-field":12,"react":"CwoHg3"}]},{},[3])
src/containers/App.js
DIYAbility/Capacita-Controller-Interface
import React, { Component } from 'react'; import { connect } from 'react-redux'; import ReactSuperSimpleRouter from '../components/app/ReactSuperSimpleRouter'; import AppToolbar from '../components/app/AppToolbar'; import * as page from '../constants/pages'; import { changeRoute } from '../actions/actions-app'; import SignIn from '../pages/SignIn'; import ControllerLayout from '../pages/ControllerLayout'; import Help from '../pages/Help'; import Account from '../pages/Account'; import NotFound from '../pages/NotFound'; import './App.css'; class App extends Component { render() { return ( <div className="capacita-app"> <ReactSuperSimpleRouter route={this.props.app.route} onChange={this.onRouteChange.bind(this)} unsaved={this.props.layout.ui.dirty} /> <AppToolbar {...this.props} /> {this.renderPage()} </div> ); } onRouteChange(route) { this.props.dispatch(changeRoute(route)); } renderPage() { switch (this.props.app.route[0]) { case page.SIGNIN: return <SignIn />; case page.LAYOUT: return <ControllerLayout />; case page.HELP: return <Help />; case page.ACCOUNT: return <Account />; default: return <NotFound />; } } } const mapStateToProps = (state, props) => { return state; } export default connect(mapStateToProps)(App);
src/index.js
dcritchlow/reading-timer
import React from 'react'; import ReactDOM from 'react-dom'; import App from './components/App'; import './index.css'; ReactDOM.render( <App />, document.getElementById('root') );
src/app/component/button/button.story.js
all3dp/printing-engine-client
import React from 'react' import {storiesOf} from '@storybook/react' import {action} from '@storybook/addon-actions' import Button from '.' import placeholderIcon from '../../../asset/icon/placeholder.svg' storiesOf('Button', module) .add('default', () => <Button label="Default Button" onClick={action('onClick')} />) .add('disabled', () => <Button label="Disabled Button" disabled onClick={action('onClick')} />) .add('with icon', () => ( <Button label="Button with Icon" icon={placeholderIcon} onClick={action('onClick')} /> )) .add('text', () => <Button label="Text Button" text onClick={action('onClick')} />) .add('block', () => <Button label="Block Button" block onClick={action('onClick')} />) .add('tiny', () => <Button label="Tiny Button" tiny onClick={action('onClick')} />) .add('selected', () => <Button label="Selected Button" selected onClick={action('onClick')} />) .add('minor', () => <Button label="Minor Button" minor onClick={action('onClick')} />) .add('minor & disabled', () => ( <Button label="Disabled Minor Button" disabled minor onClick={action('onClick')} /> )) .add('minor & tiny', () => ( <Button label="Tiny Minor Button" minor tiny onClick={action('onClick')} /> )) .add('iconOnly', () => <Button icon={placeholderIcon} iconOnly onClick={action('onClick')} />) .add('iconOnly & inlineIcon', () => ( <Button icon={placeholderIcon} iconOnly inlineIcon onClick={action('onClick')} /> )) .add('iconOnly & tiny', () => ( <Button icon={placeholderIcon} iconOnly tiny onClick={action('onClick')} /> )) .add('iconOnly & disabled', () => ( <Button icon={placeholderIcon} disabled iconOnly onClick={action('onClick')} /> )) .add('iconOnly & warning', () => ( <Button icon={placeholderIcon} iconOnly warning onClick={action('onClick')} /> )) .add('iconOnly & error', () => ( <Button icon={placeholderIcon} iconOnly error onClick={action('onClick')} /> )) .add('href', () => ( <Button href="https://google.com" label="Default Button" onClick={action('onClick')} /> ))
front/src/components/CommentList.js
muhammad-awan/financial-news
import React from 'react' import Comment from './Comment' export default function CommentList({ items }){ return( <div> { items.map((item) => ( <Comment key={ item._id } { ... item } /> )) } </div> ) }
node_modules/react-icons/go/fold.js
bairrada97/festival
import React from 'react' import Icon from 'react-icon-base' const GoFold = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m37.5 10h-8.7l-2.5 2.5h7.5l-5 5h-17.5l-5-5h7.5l-2.5-2.5h-8.8v2.5l6.3 6.3-6.3 6.2v2.5h8.8l2.5-2.5h-7.5l5-5h17.5l5 5h-7.5l2.5 2.5h8.7v-2.5l-6.2-6.2 6.2-6.3v-2.5z m-10-2.5h-5v-7.5h-5v7.5h-5l7.5 7.5 7.5-7.5z m-15 22.5h5v7.5h5v-7.5h5l-7.5-7.5-7.5 7.5z"/></g> </Icon> ) export default GoFold
packages/react-error-overlay/src/components/CodeBlock.js
Clearcover/web-build
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* @flow */ import React from 'react'; import { redTransparent, yellowTransparent } from '../styles'; const _preStyle = { display: 'block', padding: '0.5em', marginTop: '0.5em', marginBottom: '0.5em', overflowX: 'auto', whiteSpace: 'pre-wrap', borderRadius: '0.25rem', }; const primaryPreStyle = { ..._preStyle, backgroundColor: redTransparent, }; const secondaryPreStyle = { ..._preStyle, backgroundColor: yellowTransparent, }; const codeStyle = { fontFamily: 'Consolas, Menlo, monospace', }; type CodeBlockPropsType = {| main: boolean, codeHTML: string, |}; function CodeBlock(props: CodeBlockPropsType) { const preStyle = props.main ? primaryPreStyle : secondaryPreStyle; const codeBlock = { __html: props.codeHTML }; return ( <pre style={preStyle}> <code style={codeStyle} dangerouslySetInnerHTML={codeBlock} /> </pre> ); } export default CodeBlock;
src/components/Login/login.js
ateev/starWars
import React, { Component } from 'react'; import './login.css'; class LoginContainer extends Component { constructor() { super(); this.state = { username: 'Luke Skywalker', password: '19BBY', } } handleChange = (ev) => { const newObj = {}; newObj[ev.target.name] = ev.target.value; this.setState(newObj); } submitForm = (ev) => { ev.preventDefault(); this.props.submitCallback(this.state.username, this.state.password); } render() { return ( <div className="login-container"> <form onSubmit={ this.submitForm }> <div className="form-title">Use the force, luke</div> <input type="text" name="username" value={this.state.username} onChange={this.handleChange} /> <input type="password" name="password" value={this.state.password} onChange={this.handleChange} /> <input type="submit" value="Login" /> </form> </div> ); } } export default LoginContainer;
src/browser/main.js
AugustinLF/este
import 'babel-polyfill'; import Bluebird from 'bluebird'; import React from 'react'; import ReactDOM from 'react-dom'; import configureStore from '../common/configureStore'; import createEngine from 'redux-storage-engine-localstorage'; import createRoutes from './createRoutes'; import cs from 'react-intl/locale-data/cs'; import en from 'react-intl/locale-data/en'; import fr from 'react-intl/locale-data/fr'; import ro from 'react-intl/locale-data/ro'; import { Provider } from 'react-redux'; import { Router } from 'react-router'; import { addLocaleData } from 'react-intl'; import { browserHistory } from 'react-router'; import { routerMiddleware, syncHistoryWithStore } from 'react-router-redux'; // http://bluebirdjs.com/docs/why-bluebird.html window.Promise = Bluebird; // github.com/yahoo/react-intl/wiki/Upgrade-Guide#add-call-to-addlocaledata-in-browser [cs, en, fr, ro].forEach(addLocaleData); const store = configureStore({ createEngine, initialState: window.__INITIAL_STATE__, platformMiddleware: [routerMiddleware(browserHistory)] }); const history = syncHistoryWithStore(browserHistory, store); const routes = createRoutes(store.getState); ReactDOM.render( <Provider store={store}> <Router history={history}> {routes} </Router> </Provider> , document.getElementById('app') );
property-finder-sample/app/modules/property-list/SearchResults.js
mitrais-cdc-mobile/react-pocs
"use strict"; import React, { Component, Image, ListView, StyleSheet, Text, TouchableHighlight, View } from 'react-native'; import Styles from './SearchResults.Styles'; import PropertyView from '../property-detail/PropertyView'; /** Responsible for rendering ListView which display search's results */ class SearchResults extends Component { /** Define this component's Id & Name */ static get Id() { return "SearchResults"; } static get Name() { return "Results"; } constructor(props){ super(props); let dataSource = new ListView.DataSource({ /** tells list view to re-render when there are changes on the source data. * In this case, it works by comparing the identity of a pair of rows. */ rowHasChanged: (r1, r2) => r1.guid !== r2.guid }); if (this.props.listings){ this.state = { dataSource: dataSource.cloneWithRows(this.props.listings) }; } } onRowTouched(touchedRow){ // navigate to PropertyView and pass in the touchedRow this.props.navigator.push({ title: PropertyView.Name, component: PropertyView, id: PropertyView.Id, passProps: {property: touchedRow} }); } /** Supplies UI for each row */ onRenderRow(rowData, sectionID, rowID){ console.log('[DEBUG] - SearchResults onRenderRow is invoked. sectionID=%s, rowID = %s, img_url=%s', sectionID, rowID, rowData.img_url ); // Always comment any console.dir lines before running RN app on iPhone :D //console.dir(rowData); const price = rowData.price_formatted.split(' ')[0]; return ( <TouchableHighlight underlayColor='#dddddd' onPress={()=>this.onRowTouched(rowData)}> <View style={Styles.rowContainer}> <Image style={Styles.image} source={{uri: rowData.img_url}}/> <View style={Styles.textContainer}> <Text style={Styles.price}>{price}</Text> <Text style={Styles.title} numberOfLines={2}>{rowData.title}</Text> </View> </View> </TouchableHighlight> ); } render(){ console.log('[DEBUG] - SearchResults.render is called.'); return( <ListView dataSource={this.state.dataSource} renderRow={this.onRenderRow.bind(this)} style={Styles.list}/> ); } } export default SearchResults;
web/dashboard/src/layout/ReactPanel.js
unicesi/pascani-library
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; require("../img/close.png"); require("../img/expand.png"); require("../img/collapse.png"); class ReactPanel extends Component { static defaultProps = { active: false, floating: false, width: 'regular', id: undefined, onBeforeOpen: (panel) => {}, onBeforeClose: (panel) => {}, onResize: (width) => {}, claimActiveState: (panel) => {}, closePanel: (panel) => {}, } static propTypes = { active: React.PropTypes.bool, floating: React.PropTypes.bool, width: React.PropTypes.string, id: React.PropTypes.string, onBeforeOpen: React.PropTypes.func, onBeforeClose: React.PropTypes.func, onResize: React.PropTypes.func, claimActiveState: React.PropTypes.func, closePanel: React.PropTypes.func, } state = { expanded: false, width: undefined, } constructor(props) { super(props); } componentWillMount() { this.props.onBeforeOpen(this); } onMouseDown = (e) => { e.stopPropagation(); e.preventDefault(); // only left mouse button if (e.button !== 0) return; document.addEventListener('mousemove', this.onMouseMove); document.addEventListener('mouseup', this.onMouseUp); } onMouseMove = (e) => { e.stopPropagation(); e.preventDefault(); const offset = $(this.refs.container).offset(); const width = e.pageX - offset.left + 1; this.setState({ width: width }); this.props.onResize(width); } onMouseUp = (e) => { e.stopPropagation(); e.preventDefault(); document.removeEventListener('mousemove', this.onMouseMove); } componentWillUnmount() { this.props.onBeforeClose(this); } close = () => { this.props.closePanel(this); this.setState({ expanded: false }); } expand = () => { this.setState({ expanded: true }); this.props.claimActiveState(this); } collapse = () => { this.setState({ expanded: false }); this.props.claimActiveState(this); } handlePanelClick = (e) => { if(typeof e.target.className.indexOf !== "function") return; if (e.target.className.indexOf("close") > -1) { this.close(); } else if (e.target.className.indexOf("expand") > -1) { this.expand(); } else if (e.target.className.indexOf("collapse") > -1) { this.collapse(); } } render() { const classes = (!this.state.width ? `${this.props.width}` : '') + (this.props.floating ? " floating" : "") + (this.props.active ? " active" : "") + (this.state.expanded ? " expanded" : ""); const style = {}; if (this.state.width) style.width = `${this.state.width}px`; return ( <section id={this.props.id} className={"react-panel " + classes} onClick={this.handlePanelClick} style={style} ref="container"> {this.props.children} <div className="dragbar" onMouseDown={this.onMouseDown}></div> </section> ); } } export default ReactPanel;
frontend/src/components/overview/sub/Recipe.js
kevto/cssd2webapp
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import {Redirect} from 'react-router-dom' export default class Recipe extends Component { constructor(props) { super(props) } componentDidMount() { } clearText() { //console.log('clearing text'); this.commentBox.value = '' } _onChangeComment(e) { this.props.onChangeComment(e.target.value) } render() { let renderContainer = false let r = this.props.recipe if(typeof this.props.recipe != 'undefined') { renderContainer = <div style={styles.container}> <InfoRow recipe={r}/> <div style={styles.commentContainer}> <div style={styles.infoRowTitle}>Voer commentaar in:</div> <textarea ref={(ref) => {this.commentBox = ref}} onChange={this._onChangeComment.bind(this)} style={{flex: 1, marginBottom: 7}}/> <div style={styles.infoRowText}> Druk op goed of afkeuren om op te slaan. </div> </div> </div> } else { renderContainer = <div style={{display: 'flex', backgroundColor: 'white', flex:1, justifyContent:'center', padding: 14, fontSize: 24, fontWeight: 'bold'}}> Selecteer een recept. </div> } return( renderContainer ) } } class InfoRow extends Component { render() { let r = this.props.recipe let medicines = [] if(r.voorMedicijn.length > 0) { for(let m of r.voorMedicijn) { medicines.push(<li key={m._id}>{m.naam}</li>) } } return( <div style={styles.infoRowContainer}> <div style={styles.infoRowColumn}> <div style={styles.infoRowTitle}>Recept ID: {r._id}</div> <div style={styles.infoRowText}>Klantnummer: {r.vanKlant}</div> <div style={styles.infoRowText}>Ontvangen op: {r.ontvangenOp}</div> <div style={styles.infoRowText}>uitgeschreven door: {r.uitgeschrevenDoor}</div> <div style={styles.medicijnenContainer}> <div>Medicijnen:</div> <ul> {medicines ? medicines : <div>-</div>} </ul> </div> <div style={styles.infoRowText}>Opmerking:</div> <div><i>"{r.opmerking || 'Nog geen opmerking toegevoegd'}"</i></div> </div> <div style={styles.infoRowColumn}> <div style={{display: 'flex', flex: 1, flexDirection:'row', backgroundColor:'lightgrey'}}> <div style={styles.receptScan}>voorkant</div> <div style={styles.receptScan}>achterkant</div> </div> </div> </div> ) } } Recipe.propTypes = { recipe: PropTypes.object, onChangeComment: PropTypes.func.isRequired } Recipe.defaultProps = { recipe: undefined } const styles = { container: { display: 'flex', flex: 1, //backgroundColor: 'orange', //padding: 7, flexDirection: 'column', //height: 50, justifyContent: 'center', //alignItems: 'center' }, medicijnenContainer: { //overflow: 'scroll' }, infoRowContainer: { //overflow: 'scroll', backgroundColor: 'white', borderBottom: '1px solid black', // borderStyle: 'solid', // borderWidth: 1, // borderColor: 'black', display:'flex', flex: 1, flexDirection: 'row', }, commentContainer: { display: 'flex', flexDirection: 'column', backgroundColor: '#f2f2f2', padding: 7, paddingBottom: 50, flex: 1, }, infoRowTitle: { fontWeight: 'bold', marginBottom:24, fontSize: 24, }, infoRowText: { marginBottom: 20, fontSize: 16 }, infoRowColumn: { display: 'flex', flex: 1, flexDirection: 'column', padding: 7, //backgroundColor:'purple' }, receptScan: { flex:1, backgroundColor: 'grey', margin: 7, textAlign: 'center' } }
files/rxjs/2.3.14/rx.lite.compat.js
therob3000/jsdelivr
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. ;(function (undefined) { var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; var root = (objectTypes[typeof window] && window) || this, freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, freeGlobal = objectTypes[typeof global] && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { root = freeGlobal; } var Rx = { internals: {}, config: { Promise: root.Promise // Detect if promise exists }, helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; }, identity = Rx.helpers.identity = function (x) { return x; }, pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()), defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; }, asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, not = Rx.helpers.not = function (a) { return !a; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { return typeof value == 'function' || false; } // fallback for older versions of Chrome and Safari if (isFn(/x/)) { isFn = function(value) { return typeof value == 'function' && toString.call(value) == '[object Function]'; }; } return isFn; }()); // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } // Shim in iterator support var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || '_es6shim_iterator_'; // Bug for mozilla version if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { $iterator$ = '@@iterator'; } var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; Rx.iterator = $iterator$; /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass, errorProto = Error.prototype, objectProto = Object.prototype, propertyIsEnumerable = objectProto.propertyIsEnumerable; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch(e) { suportNodeClass = true; } var shadowedProps = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true }; nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true }; nonEnumProps[objectClass] = { 'constructor': true }; var support = {}; (function () { var ctor = function() { this.x = 1; }, props = []; ctor.prototype = { 'valueOf': 1, 'y': 1 }; for (var key in new ctor) { props.push(key); } for (key in arguments) { } // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default. support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name'); // Detect if `prototype` properties are enumerable by default. support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype'); // Detect if `arguments` object indexes are non-enumerable support.nonEnumArgs = key != 0; // Detect if properties shadowing those on `Object.prototype` are non-enumerable. support.nonEnumShadows = !/valueOf/.test(props); }(1)); function isObject(value) { // check if the value is the ECMAScript language type of Object // http://es5.github.io/#x8 // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; return value && (type == 'function' || type == 'object') || false; } function keysIn(object) { var result = []; if (!isObject(object)) { return result; } if (support.nonEnumArgs && object.length && isArguments(object)) { object = slice.call(object); } var skipProto = support.enumPrototypes && typeof object == 'function', skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error); for (var key in object) { if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name'))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { var ctor = object.constructor, index = -1, length = shadowedProps.length; if (object === (ctor && ctor.prototype)) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } while (++index < length) { key = shadowedProps[index]; if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { result.push(key); } } } return result; } function internalFor(object, callback, keysFunc) { var index = -1, props = keysFunc(object), length = props.length; while (++index < length) { var key = props[index]; if (callback(object[key], key, object) === false) { break; } } return object; } function internalForIn(object, callback) { return internalFor(object, callback, keysIn); } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } var isEqual = Rx.internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && (a == null || b == null || (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { return false; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b // but treat `-0` vs. `+0` as not equal : (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && ('constructor' in a && 'constructor' in b) ) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var initedStack = !stackA; stackA || (stackA = []); stackB || (stackB = []); var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; var result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary length = a.length; size = b.length; result = size == length; if (result) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } } } else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly internalForIn(b, function(value, key, b) { if (hasOwnProperty.call(b, key)) { // count the number of properties. size++; // deep compare each property value. return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); } }); if (result) { // ensure both objects have the same number of properties internalForIn(a, function(value, key, a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } }); } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; var addProperties = Rx.internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Utilities if (!Function.prototype.bind) { Function.prototype.bind = function (that) { var target = this, args = slice.call(arguments, 1); var bound = function () { if (this instanceof bound) { function F() { } F.prototype = target.prototype; var self = new F(); var result = target.apply(self, args.concat(slice.call(arguments))); if (Object(result) === result) { return result; } return self; } else { return target.apply(that, args.concat(slice.call(arguments))); } }; return bound; }; } if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { var T, k; if (this == null) { throw new TypeError(" this is null or not defined"); } var O = Object(this); var len = O.length >>> 0; if (typeof callback !== "function") { throw new TypeError(callback + " is not a function"); } if (arguments.length > 1) { T = thisArg; } k = 0; while (k < len) { var kValue; if (k in O) { kValue = O[k]; callback.call(T, kValue, k, O); } k++; } }; } var boxedString = Object("a"), splitString = boxedString[0] != "a" || !(0 in boxedString); if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { var object = Object(this), self = splitString && {}.toString.call(this) == stringClass ? this.split("") : object, length = self.length >>> 0, thisp = arguments[1]; if ({}.toString.call(fun) != funcClass) { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self && !fun.call(thisp, self[i], i, object)) { return false; } } return true; }; } if (!Array.prototype.map) { Array.prototype.map = function map(fun /*, thisp*/) { var object = Object(this), self = splitString && {}.toString.call(this) == stringClass ? this.split("") : object, length = self.length >>> 0, result = Array(length), thisp = arguments[1]; if ({}.toString.call(fun) != funcClass) { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self) { result[i] = fun.call(thisp, self[i], i, object); } } return result; }; } if (!Array.prototype.filter) { Array.prototype.filter = function (predicate) { var results = [], item, t = new Object(this); for (var i = 0, len = t.length >>> 0; i < len; i++) { item = t[i]; if (i in t && predicate.call(arguments[1], item, i, t)) { results.push(item); } } return results; }; } if (!Array.isArray) { Array.isArray = function (arg) { return {}.toString.call(arg) == arrayClass; }; } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf(searchElement) { 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) { 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; }; } // Collections function IndexedItem(id, value) { this.id = id; this.value = value; } IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); c === 0 && (c = this.id - other.id); return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { +index || (index = 0); if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function () { function BooleanDisposable () { this.isDisposed = false; this.current = null; } var booleanDisposablePrototype = BooleanDisposable.prototype; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } old && old.dispose(); shouldDispose && value && value.dispose(); }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } old && old.dispose(); }; return BooleanDisposable; }()); var SerialDisposable = Rx.SerialDisposable = SingleAssignmentDisposable; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { timeSpan < 0 && (timeSpan = 0); return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; (function (schedulerProto) { function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function scheduleInnerRecursive(action, self) { action(function(dt) { self(action, dt); }); } /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, invokeRecImmediate); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; }(Scheduler.prototype)); (function (schedulerProto) { /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, action); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new Error('Periodic scheduling not supported.'); } var s = state; var id = root.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { root.clearInterval(id); }); }; }(Scheduler.prototype)); /** * Gets a scheduler that schedules work immediately on the current thread. */ var immediateScheduler = Scheduler.immediate = (function () { function scheduleNow(state, action) { return action(this, state); } function scheduleRelative(state, dueTime, action) { var dt = normalizeTime(dt); while (dt - this.now() > 0) { } return action(this, state); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); }()); /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = (function () { var queue; function runTrampoline (q) { var item; while (q.length > 0) { item = q.dequeue(); if (!item.isCancelled()) { // Note, do not schedule blocking work! while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } } function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt); if (!queue) { queue = new PriorityQueue(4); queue.enqueue(si); try { runTrampoline(queue); } catch (e) { throw e; } finally { queue = null; } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return !queue; }; currentScheduler.ensureTrampoline = function (action) { if (!queue) { this.schedule(action); } else { action(); } }; return currentScheduler; }()); var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); var scheduleMethod, clearMethod = noop; var localTimer = (function () { var localSetTimeout, localClearTimeout = noop; if ('WScript' in this) { localSetTimeout = function (fn, time) { WScript.Sleep(time); fn(); }; } else if (!!root.setTimeout) { localSetTimeout = root.setTimeout; localClearTimeout = root.clearTimeout; } else { throw new Error('No concurrency detected!'); } return { setTimeout: localSetTimeout, clearTimeout: localClearTimeout }; }()); var localSetTimeout = localTimer.setTimeout, localClearTimeout = localTimer.clearTimeout; (function () { var reNative = RegExp('^' + String(toString) .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/toString| for [^\]]+/g, '.*?') + '$' ); var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && !reNative.test(setImmediate) && setImmediate, clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' && !reNative.test(clearImmediate) && clearImmediate; function postMessageSupported () { // Ensure not in a worker if (!root.postMessage || root.importScripts) { return false; } var isAsync = false, oldHandler = root.onmessage; // Test for async root.onmessage = function () { isAsync = true; }; root.postMessage('','*'); root.onmessage = oldHandler; return isAsync; } // Use in order, nextTick, setImmediate, postMessage, MessageChannel, script readystatechanged, setTimeout if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (typeof setImmediate === 'function') { scheduleMethod = setImmediate; clearMethod = clearImmediate; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (root.addEventListener) { root.addEventListener('message', onGlobalPostMessage, false); } else { root.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; root.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!root.MessageChannel) { var channel = new root.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = root.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; root.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return localSetTimeout(action, 0); }; clearMethod = localClearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = localSetTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { localClearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? this._acceptObservable(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notifications * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ Notification.prototype.toObservable = function (scheduler) { var notification = this; isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); notification.kind === 'N' && observer.onCompleted(); }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (e) { var notification = new Notification('E'); notification.exception = e; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); var Enumerator = Rx.internals.Enumerator = function (next) { this._next = next; }; Enumerator.prototype.next = function () { return this._next(); }; Enumerator.prototype[$iterator$] = function () { return this; } var Enumerable = Rx.internals.Enumerable = function (iterator) { this._iterator = iterator; }; Enumerable.prototype[$iterator$] = function () { return this._iterator(); }; Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var currentItem; if (isDisposed) { return; } try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { observer.onCompleted(); return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e; try { e = sources[$iterator$](); } catch(err) { observer.onError(); return; } var isDisposed, lastException, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { if (isDisposed) { return; } var currentItem; try { currentItem = e.next(); } catch (ex) { observer.onError(ex); return; } if (currentItem.done) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } // Check if promise var currentValue = currentItem.value; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(currentValue.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount == null) { repeatCount = -1; } return new Enumerable(function () { var left = repeatCount; return new Enumerator(function () { if (left === 0) { return doneEnumerator; } if (left > 0) { left--; } return { done: false, value: value }; }); }); }; var enumerableOf = Enumerable.of = function (source, selector, thisArg) { selector || (selector = identity); return new Enumerable(function () { var index = -1; return new Enumerator( function () { return ++index < source.length ? { done: false, value: selector.call(thisArg, source[index], index, source) } : doneEnumerator; }); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { return new AnonymousObserver(function (x) { return handler.call(thisArg, notificationCreateOnNext(x)); }, function (e) { return handler.call(thisArg, notificationCreateOnError(e)); }, function () { return handler.call(thisArg, notificationCreateOnCompleted()); }); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { inherits(AbstractObserver, __super__); /** * Creates a new observer in a non-stopped state. */ function AbstractObserver() { this.isStopped = false; __super__.call(this); } /** * Notifies the observer of a new element in the sequence. * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { inherits(AnonymousObserver, __super__); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { __super__.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * @param {Any} error The error that has occurred. */ AnonymousObserver.prototype.error = function (error) { this._onError(error); }; /** * Calls the onCompleted action. */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; /** * Subscribes an observer to the observable sequence. * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { return this._subscribe(typeof observerOrOnNext === 'object' ? observerOrOnNext : observerCreate(observerOrOnNext, onError, onCompleted)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onNext The function to invoke on each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnNext = function (onNext, thisArg) { return this._subscribe(observerCreate(arguments.length === 2 ? function(x) { onNext.call(thisArg, x); } : onNext)); }; /** * Subscribes to an exceptional condition in the sequence with an optional "this" argument. * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnError = function (onError, thisArg) { return this._subscribe(observerCreate(null, arguments.length === 2 ? function(e) { onError.call(thisArg, e); } : onError)); }; /** * Subscribes to the next value in the sequence with an optional "this" argument. * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. */ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { return this._subscribe(observerCreate(null, null, arguments.length === 2 ? function() { onCompleted.call(thisArg); } : onCompleted)); }; return Observable; })(); var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { inherits(ScheduledObserver, __super__); function ScheduledObserver(scheduler, observer) { __super__.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; ScheduledObserver.prototype.error = function (err) { var self = this; this.queue.push(function () { self.observer.onError(err); }); }; ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; ScheduledObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); /** * Creates a list from an observable sequence. * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { var self = this; return new AnonymousObservable(function(observer) { var arr = []; return self.subscribe( arr.push.bind(arr), observer.onError.bind(observer), function () { observer.onNext(arr); observer.onCompleted(); }); }); }; /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } isPromise(result) && (result = observableFromPromise(result)); return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; var maxSafeInteger = Math.pow(2, 53) - 1; function numberIsFinite(value) { return typeof value === 'number' && root.isFinite(value); } function isNan(n) { return n !== n; } function isIterable(o) { return o[$iterator$] !== undefined; } function sign(value) { var number = +value; if (number === 0) { return number; } if (isNaN(number)) { return number; } return number < 0 ? -1 : 1; } function toLength(o) { var len = +o.length; if (isNaN(len)) { return 0; } if (len === 0 || !numberIsFinite(len)) { return len; } len = sign(len) * Math.floor(Math.abs(len)); if (len <= 0) { return 0; } if (len > maxSafeInteger) { return maxSafeInteger; } return len; } function isCallable(f) { return Object.prototype.toString.call(f) === '[object Function]' && typeof f === 'function'; } /** * This method creates a new Observable sequence from an array-like or iterable object. * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. * @param {Function} [mapFn] Map function to call on every element of the array. * @param {Any} [thisArg] The context to use calling the mapFn if provided. * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { if (iterable == null) { throw new Error('iterable cannot be null.') } if (mapFn && !isCallable(mapFn)) { throw new Error('mapFn when provided must be a function'); } isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var list = Object(iterable), objIsIterable = isIterable(list), len = objIsIterable ? 0 : toLength(list), it = objIsIterable ? list[$iterator$]() : null, i = 0; return scheduler.scheduleRecursive(function (self) { if (i < len || objIsIterable) { var result; if (objIsIterable) { var next; try { next = it.next(); } catch (e) { observer.onError(e); return; } if (next.done) { observer.onCompleted(); return; } result = next.value; } else { result = !!list.charAt ? list.charAt(i) : list[i]; } if (mapFn && isCallable(mapFn)) { try { result = thisArg ? mapFn.call(thisArg, result, i) : mapFn(result, i); } catch (e) { observer.onError(e); return; } } observer.onNext(result); i++; self(); } else { observer.onCompleted(); } }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * var res = Rx.Observable.fromArray([1,2,3]); * var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0, len = array.length; return scheduler.scheduleRecursive(function (self) { if (count < len) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ Observable.of = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } return observableFromArray(args); }; /** * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. * @example * var res = Rx.Observable.of(1,2,3); * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. */ var observableOf = Observable.ofWithScheduler = function (scheduler) { var len = arguments.length - 1, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i + 1]; } return observableFromArray(args, scheduler); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'just', and 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.returnValue = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwError' for browsers <IE9. * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = Observable.throwError = function (exception, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } isPromise(result) && (result = observableFromPromise(result)); d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) { return typeof handlerOrSecond === 'function' ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs. * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = Observable.catchError = Observable['catch'] = function () { return enumerableOf(argsOrArray(arguments, 0)).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence. * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { return enumerableOf(argsOrArray(arguments, 0)).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = []; function subscribe(xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); // Check for promises support isPromise(xs) && (xs = observableFromPromise(xs)); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(subscription); if (q.length > 0) { subscribe(q.shift()); } else { activeCount--; isStopped && activeCount === 0 && observer.onCompleted(); } })); } group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; activeCount === 0 && observer.onCompleted(); })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll = function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); // Check for promises support isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); innerSubscription.setDisposable(innerSource.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { group.remove(innerSubscription); isStopped && group.length === 1 && observer.onCompleted(); })); }, observer.onError.bind(observer), function () { isStopped = true; group.length === 1 && observer.onCompleted(); })); return group; }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { isOpen && observer.onNext(left); }, observer.onError.bind(observer), function () { isOpen && observer.onCompleted(); })); isPromise(other) && (other = observableFromPromise(other)); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe( function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); // Check if Promise or Observable isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); d.setDisposable(innerSource.subscribe( function (x) { latest === id && observer.onNext(x); }, function (e) { latest === id && observer.onError(e); }, function () { if (latest === id) { hasLatest = false; isStopped && observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; !hasLatest && observer.onCompleted(); }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { isPromise(other) && (other = observableFromPromise(other)); return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { var source = sources[i], sad = new SingleAssignmentDisposable(); isPromise(source) && (source = observableFromPromise(source)); sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); subscriptions[i] = sad; })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = argsOrArray(arguments, 0); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { return new AnonymousObservable(this.subscribe.bind(this)); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.doAction = observableProto.tap = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (err) { if (onError) { try { onError(err); } catch (e) { observer.onError(e); } } observer.onError(err); }, function () { if (onCompleted) { try { onCompleted(); } catch (e) { observer.onError(e); } } observer.onCompleted(); }); }); }; /** * Invokes an action for each element in the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onNext Action to invoke for each element in the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { return this.tap(arguments.length === 2 ? function (x) { onNext.call(thisArg, x); } : onNext); }; /** * Invokes an action upon exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { return this.tap(noop, arguments.length === 2 ? function (e) { onError.call(thisArg, e); } : onError); }; /** * Invokes an action upon graceful termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { return this.tap(noop, null, arguments.length === 2 ? function () { onCompleted.call(thisArg); } : onCompleted); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * var res = observable.finallyAction(function () { console.log('sequence ended'; }); * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription; try { subscription = source.subscribe(observer); } catch (e) { action(); throw e; } return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * var res = repeated = source.repeat(); * var res = repeated = source.repeat(42); * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * Note if you encounter an error and want it to retry once, then you must use .retry(2); * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(2); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { !hasValue && (hasValue = true); try { if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { !hasValue && hasSeed && observer.onNext(seed); observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && observer.onNext(q.shift()); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * @example * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * @param {Arguments} args The specified values to prepend to the observable sequence * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && isScheduler(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableOf([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence. * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, observer.onError.bind(observer), function () { while(q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); }); }); }; function concatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i, source); isPromise(result) && (result = observableFromPromise(result)); (Array.isArray(result) || isIterable(result)) && (result = observableFrom(result)); return result; }).concatAll(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the * source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { if (typeof selector === 'function' && typeof resultSelector === 'function') { return this.concatMap(function (x, i) { var selectorResult = selector(x, i); isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); (Array.isArray(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); return selectorResult.map(function (y, i2) { return resultSelector(x, y, i, i2); }); }); } return typeof selector === 'function' ? concatMap(this, selector, thisArg) : concatMap(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (e) { observer.onError(e); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Retrieves the value of a specified property from all elements in the Observable sequence. * @param {String} prop The property to pluck. * @returns {Observable} Returns a new Observable sequence of property values. */ observableProto.pluck = function (prop) { return this.map(function (x) { return x[prop]; }); }; function flatMap(source, selector, thisArg) { return source.map(function (x, i) { var result = selector.call(thisArg, x, i, source); isPromise(result) && (result = observableFromPromise(result)); (Array.isArray(result) || isIterable(result)) && (result = observableFrom(result)); return result; }).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { if (typeof selector === 'function' && typeof resultSelector === 'function') { return this.flatMap(function (x, i) { var selectorResult = selector(x, i); isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); (Array.isArray(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); return selectorResult.map(function (y, i2) { return resultSelector(x, y, i, i2); }); }, thisArg); } return typeof selector === 'function' ? flatMap(this, selector, thisArg) : flatMap(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var source = this; return new AnonymousObservable(function (observer) { var remaining = count; return source.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } running && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new RangeError(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining-- > 0) { observer.onNext(x); remaining === 0 && observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (e) { observer.onError(e); return; } shouldRun && observer.onNext(value); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Converts a callback function to an observable sequence. * * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. */ Observable.fromCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }).publishLast().refCount(); }; }; /** * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. * @param {Function} func The function to call * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. */ Observable.fromNodeCallback = function (func, context, selector) { return function () { var args = slice.call(arguments, 0); return new AnonymousObservable(function (observer) { function handler(err) { if (err) { observer.onError(err); return; } var results = slice.call(arguments, 1); if (selector) { try { results = selector(results); } catch (e) { observer.onError(e); return; } observer.onNext(results); } else { if (results.length <= 1) { observer.onNext.apply(observer, results); } else { observer.onNext(results); } } observer.onCompleted(); } args.push(handler); func.apply(context, args); }).publishLast().refCount(); }; }; function fixEvent(event) { var stopPropagation = function () { this.cancelBubble = true; }; var preventDefault = function () { this.bubbledKeyCode = this.keyCode; if (this.ctrlKey) { try { this.keyCode = 0; } catch (e) { } } this.defaultPrevented = true; this.returnValue = false; this.modified = true; }; event || (event = root.event); if (!event.target) { event.target = event.target || event.srcElement; if (event.type == 'mouseover') { event.relatedTarget = event.fromElement; } if (event.type == 'mouseout') { event.relatedTarget = event.toElement; } // Adding stopPropogation and preventDefault to IE if (!event.stopPropagation){ event.stopPropagation = stopPropagation; event.preventDefault = preventDefault; } // Normalize key events switch(event.type){ case 'keypress': var c = ('charCode' in event ? event.charCode : event.keyCode); if (c == 10) { c = 0; event.keyCode = 13; } else if (c == 13 || c == 27) { c = 0; } else if (c == 3) { c = 99; } event.charCode = c; event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : ''; break; } } return event; } function createListener (element, name, handler) { // Standards compliant if (element.addEventListener) { element.addEventListener(name, handler, false); return disposableCreate(function () { element.removeEventListener(name, handler, false); }); } if (element.attachEvent) { // IE Specific var innerHandler = function (event) { handler(fixEvent(event)); }; element.attachEvent('on' + name, innerHandler); return disposableCreate(function () { element.detachEvent('on' + name, innerHandler); }); } // Level 1 DOM Events element['on' + name] = handler; return disposableCreate(function () { element['on' + name] = null; }); } function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList if (Object.prototype.toString.call(el) === '[object NodeList]') { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el.item(i), eventName, handler)); } } else if (el) { disposables.add(createListener(el, eventName, handler)); } return disposables; } /** * Configuration option to determine whether to use native events only */ Rx.config.useNativeEvents = false; // Check for Angular/jQuery/Zepto support var jq = !!root.angular && !!angular.element ? angular.element : (!!root.jQuery ? root.jQuery : ( !!root.Zepto ? root.Zepto : null)); // Check for ember var ember = !!root.Ember && typeof root.Ember.addListener === 'function'; // Check for Backbone.Marionette. Note if using AMD add Marionette as a dependency of rxjs // for proper loading order! var marionette = !!root.Backbone && !!root.Backbone.Marionette; /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. * * @example * var source = Rx.Observable.fromEvent(element, 'mouseup'); * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ Observable.fromEvent = function (element, eventName, selector) { // Node.js specific if (element.addListener) { return fromEventPattern( function (h) { element.addListener(eventName, h); }, function (h) { element.removeListener(eventName, h); }, selector); } // Use only if non-native events are allowed if (!Rx.config.useNativeEvents) { if (marionette) { return fromEventPattern( function (h) { element.on(eventName, h); }, function (h) { element.off(eventName, h); }, selector); } if (ember) { return fromEventPattern( function (h) { Ember.addListener(element, eventName, h); }, function (h) { Ember.removeListener(element, eventName, h); }, selector); } if (jq) { var $elem = jq(element); return fromEventPattern( function (h) { $elem.on(eventName, h); }, function (h) { $elem.off(eventName, h); }, selector); } } return new AnonymousObservable(function (observer) { return createEventListener( element, eventName, function handler (e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return } } observer.onNext(results); }); }).publish().refCount(); }; /** * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { return new AnonymousObservable(function (observer) { function innerHandler (e) { var result = e; if (selector) { try { result = selector(arguments); } catch (err) { observer.onError(err); return; } } observer.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { if (removeHandler) { removeHandler(innerHandler, returnValue); } }); }).publish().refCount(); }; /** * Converts a Promise to an Observable sequence * @param {Promise} An ES6 Compliant promise. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ var observableFromPromise = Observable.fromPromise = function (promise) { return observableDefer(function () { var subject = new Rx.AsyncSubject(); promise.then( function (value) { if (!subject.isDisposed) { subject.onNext(value); subject.onCompleted(); } }, subject.onError.bind(subject)); return subject; }); }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); * * // With config * Rx.config.Promise = RSVP.Promise; * var promise = Rx.Observable.return(42).toPromise(); * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. */ observableProto.toPromise = function (promiseCtor) { promiseCtor || (promiseCtor = Rx.config.Promise); if (!promiseCtor) { throw new TypeError('Promise type not provided nor in Rx.config.Promise'); } var source = this; return new promiseCtor(function (resolve, reject) { // No cancellation can be done var value, hasValue = false; source.subscribe(function (v) { value = v; hasValue = true; }, reject, function () { hasValue && resolve(value); }); }); }; /** * Invokes the asynchronous function, surfacing the result through an observable sequence. * @param {Function} functionAsync Asynchronous function which returns a Promise to run. * @returns {Observable} An observable sequence exposing the function's result value, or an exception. */ Observable.startAsync = function (functionAsync) { var promise; try { promise = functionAsync(); } catch (e) { return observableThrow(e); } return observableFromPromise(promise); } /** * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. * * @example * 1 - res = source.multicast(observable); * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); * * @param {Function|Subject} subjectOrSubjectSelector * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. * Or: * Subject to push source elements into. * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.multicast = function (subjectOrSubjectSelector, selector) { var source = this; return typeof subjectOrSubjectSelector === 'function' ? new AnonymousObservable(function (observer) { var connectable = source.multicast(subjectOrSubjectSelector()); return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect()); }) : new ConnectableObservable(source, subjectOrSubjectSelector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of Multicast using a regular Subject. * * @example * var resres = source.publish(); * var res = source.publish(function (x) { return x; }); * * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publish = function (selector) { return selector && isFunction(selector) ? this.multicast(function () { return new Subject(); }, selector) : this.multicast(new Subject()); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.share(); * * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.share = function () { return this.publish().refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. * This operator is a specialization of Multicast using a AsyncSubject. * * @example * var res = source.publishLast(); * var res = source.publishLast(function (x) { return x; }); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishLast = function (selector) { return selector && isFunction(selector) ? this.multicast(function () { return new AsyncSubject(); }, selector) : this.multicast(new AsyncSubject()); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. * This operator is a specialization of Multicast using a BehaviorSubject. * * @example * var res = source.publishValue(42); * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42); * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishValue = function (initialValueOrSelector, initialValue) { return arguments.length === 2 ? this.multicast(function () { return new BehaviorSubject(initialValue); }, initialValueOrSelector) : this.multicast(new BehaviorSubject(initialValueOrSelector)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareValue(42); * * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareValue = function (initialValue) { return this.publishValue(initialValue).refCount(); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of Multicast using a ReplaySubject. * * @example * var res = source.replay(null, 3); * var res = source.replay(null, 3, 500); * var res = source.replay(null, 3, 500, scheduler); * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.replay = function (selector, bufferSize, window, scheduler) { return selector && isFunction(selector) ? this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector) : this.multicast(new ReplaySubject(bufferSize, window, scheduler)); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. * * @example * var res = source.shareReplay(3); * var res = source.shareReplay(3, 500); * var res = source.shareReplay(3, 500, scheduler); * * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. */ observableProto.shareReplay = function (bufferSize, window, scheduler) { return this.replay(null, bufferSize, window, scheduler).refCount(); }; var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) { inherits(ConnectableObservable, __super__); function ConnectableObservable(source, subject) { var hasSubscription = false, subscription, sourceObservable = source.asObservable(); this.connect = function () { if (!hasSubscription) { hasSubscription = true; subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () { hasSubscription = false; })); } return subscription; }; __super__.call(this, subject.subscribe.bind(subject)); } ConnectableObservable.prototype.refCount = function () { var connectableSubscription, count = 0, source = this; return new AnonymousObservable(function (observer) { var shouldConnect = ++count === 1, subscription = source.subscribe(observer); shouldConnect && (connectableSubscription = source.connect()); return function () { subscription.dispose(); --count === 0 && connectableSubscription.dispose(); }; }); }; return ConnectableObservable; }(Observable)); function observableTimerDate(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithAbsolute(dueTime, function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerDateAndPeriod(dueTime, period, scheduler) { return new AnonymousObservable(function (observer) { var count = 0, d = dueTime, p = normalizeTime(period); return scheduler.scheduleRecursiveWithAbsolute(d, function (self) { if (p > 0) { var now = scheduler.now(); d = d + p; d <= now && (d = now + p); } observer.onNext(count++); self(d); }); }); } function observableTimerTimeSpan(dueTime, scheduler) { return new AnonymousObservable(function (observer) { return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { return dueTime === period ? new AnonymousObservable(function (observer) { return scheduler.schedulePeriodicWithState(0, period, function (count) { observer.onNext(count); return count + 1; }); }) : observableDefer(function () { return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); }); } /** * Returns an observable sequence that produces a value after each period. * * @example * 1 - res = Rx.Observable.interval(1000); * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); * * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. * @returns {Observable} An observable sequence that produces a value after each period. */ var observableinterval = Observable.interval = function (period, scheduler) { return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler); }; /** * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. */ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; isScheduler(scheduler) || (scheduler = timeoutScheduler); if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (isScheduler(periodOrScheduler)) { scheduler = periodOrScheduler; } if (dueTime instanceof Date && period === undefined) { return observableTimerDate(dueTime.getTime(), scheduler); } if (dueTime instanceof Date && period !== undefined) { period = periodOrScheduler; return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler); } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; function observableDelayTimeSpan(source, dueTime, scheduler) { return new AnonymousObservable(function (observer) { var active = false, cancelable = new SerialDisposable(), exception = null, q = [], running = false, subscription; subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { var d, shouldRun; if (notification.value.kind === 'E') { q = []; q.push(notification); exception = notification.value.exception; shouldRun = !running; } else { q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); shouldRun = !active; active = true; } if (shouldRun) { if (exception !== null) { observer.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { var e, recurseDueTime, result, shouldRecurse; if (exception !== null) { return; } running = true; do { result = null; if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { result = q.shift().value; } if (result !== null) { result.accept(observer); } } while (result !== null); shouldRecurse = false; recurseDueTime = 0; if (q.length > 0) { shouldRecurse = true; recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); } else { active = false; } e = exception; running = false; if (e !== null) { observer.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } })); } } }); return new CompositeDisposable(subscription, cancelable); }); } function observableDelayDate(source, dueTime, scheduler) { return observableDefer(function () { return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler); }); } /** * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. * * @example * 1 - res = Rx.Observable.delay(new Date()); * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout); * * 3 - res = Rx.Observable.delay(5000); * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delay = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return dueTime instanceof Date ? observableDelayDate(this, dueTime.getTime(), scheduler) : observableDelayTimeSpan(this, dueTime, scheduler); }; /** * Ignores values from an observable sequence which are followed by another value before dueTime. * * @example * 1 - res = source.throttle(5000); // 5 seconds * 2 - res = source.throttle(5000, scheduler); * * @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The throttled sequence. */ observableProto.throttle = function (dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0; var subscription = source.subscribe( function (x) { hasvalue = true; value = x; id++; var currentId = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () { hasvalue && id === currentId && observer.onNext(value); hasvalue = false; })); }, function (e) { cancelable.dispose(); observer.onError(e); hasvalue = false; id++; }, function () { cancelable.dispose(); hasvalue && observer.onNext(value); observer.onCompleted(); hasvalue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Records the timestamp for each value in an observable sequence. * * @example * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } * 2 - res = source.timestamp(Rx.Scheduler.timeout); * * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with timestamp information on values. */ observableProto.timestamp = function (scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return this.map(function (x) { return { value: x, timestamp: scheduler.now() }; }); }; function sampleObservable(source, sampler) { return new AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { if (hasValue) { hasValue = false; observer.onNext(value); } atEnd && observer.onCompleted(); } return new CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe) ); }); } /** * Samples the observable sequence at each interval. * * @example * 1 - res = source.sample(sampleObservable); // Sampler tick sequence * 2 - res = source.sample(5000); // 5 seconds * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Sampled observable sequence. */ observableProto.sample = function (intervalOrSampler, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); return typeof intervalOrSampler === 'number' ? sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : sampleObservable(this, intervalOrSampler); }; /** * Returns the source observable sequence or the other observable sequence if dueTime elapses. * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeout = function (dueTime, other, scheduler) { (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout'))); isScheduler(scheduler) || (scheduler = timeoutScheduler); var source = this, schedulerMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; return new AnonymousObservable(function (observer) { var id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), switched = false, timer = new SerialDisposable(); subscription.setDisposable(original); function createTimer() { var myId = id; timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { if (id === myId) { isPromise(other) && (other = observableFromPromise(other)); subscription.setDisposable(other.subscribe(observer)); } })); } createTimer(); original.setDisposable(source.subscribe(function (x) { if (!switched) { id++; observer.onNext(x); createTimer(); } }, function (e) { if (!switched) { id++; observer.onError(e); } }, function () { if (!switched) { id++; observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; var PausableObservable = (function (_super) { inherits(PausableObservable, _super); function subscribe(observer) { var conn = this.source.publish(), subscription = conn.subscribe(observer), connection = disposableEmpty; var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) { if (b) { connection = conn.connect(); } else { connection.dispose(); connection = disposableEmpty; } }); return new CompositeDisposable(subscription, connection, pausable); } function PausableObservable(source, pauser) { this.source = source; this.controller = new Subject(); if (pauser && pauser.subscribe) { this.pauser = this.controller.merge(pauser); } else { this.pauser = this.controller; } _super.call(this, subscribe); } PausableObservable.prototype.pause = function () { this.controller.onNext(false); }; PausableObservable.prototype.resume = function () { this.controller.onNext(true); }; return PausableObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausable(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausable = function (pauser) { return new PausableObservable(this, pauser); }; function combineLatestSource(source, subject, resultSelector) { return new AnonymousObservable(function (observer) { var n = 2, hasValue = [false, false], hasValueAll = false, isDone = false, values = new Array(n); function next(x, i) { values[i] = x var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone) { observer.onCompleted(); } } return new CompositeDisposable( source.subscribe( function (x) { next(x, 0); }, observer.onError.bind(observer), function () { isDone = true; observer.onCompleted(); }), subject.subscribe( function (x) { next(x, 1); }, observer.onError.bind(observer)) ); }); } var PausableBufferedObservable = (function (_super) { inherits(PausableBufferedObservable, _super); function subscribe(observer) { var q = [], previousShouldFire; var subscription = combineLatestSource( this.source, this.pauser.distinctUntilChanged().startWith(false), function (data, shouldFire) { return { data: data, shouldFire: shouldFire }; }) .subscribe( function (results) { if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) { previousShouldFire = results.shouldFire; // change in shouldFire if (results.shouldFire) { while (q.length > 0) { observer.onNext(q.shift()); } } } else { previousShouldFire = results.shouldFire; // new data if (results.shouldFire) { observer.onNext(results.data); } else { q.push(results.data); } } }, function (err) { // Empty buffer before sending error while (q.length > 0) { observer.onNext(q.shift()); } observer.onError(err); }, function () { // Empty buffer before sending completion while (q.length > 0) { observer.onNext(q.shift()); } observer.onCompleted(); } ); return subscription; } function PausableBufferedObservable(source, pauser) { this.source = source; this.controller = new Subject(); if (pauser && pauser.subscribe) { this.pauser = this.controller.merge(pauser); } else { this.pauser = this.controller; } _super.call(this, subscribe); } PausableBufferedObservable.prototype.pause = function () { this.controller.onNext(false); }; PausableBufferedObservable.prototype.resume = function () { this.controller.onNext(true); }; return PausableBufferedObservable; }(Observable)); /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, * and yields the values that were buffered while paused. * @example * var pauser = new Rx.Subject(); * var source = Rx.Observable.interval(100).pausableBuffered(pauser); * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.pausableBuffered = function (subject) { return new PausableBufferedObservable(this, subject); }; /** * Attaches a controller to the observable sequence with the ability to queue. * @example * var source = Rx.Observable.interval(100).controlled(); * source.request(3); // Reads 3 values * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ observableProto.controlled = function (enableQueue) { if (enableQueue == null) { enableQueue = true; } return new ControlledObservable(this, enableQueue); }; var ControlledObservable = (function (_super) { inherits(ControlledObservable, _super); function subscribe (observer) { return this.source.subscribe(observer); } function ControlledObservable (source, enableQueue) { _super.call(this, subscribe); this.subject = new ControlledSubject(enableQueue); this.source = source.multicast(this.subject).refCount(); } ControlledObservable.prototype.request = function (numberOfItems) { if (numberOfItems == null) { numberOfItems = -1; } return this.subject.request(numberOfItems); }; return ControlledObservable; }(Observable)); var ControlledSubject = Rx.ControlledSubject = (function (_super) { function subscribe (observer) { return this.subject.subscribe(observer); } inherits(ControlledSubject, _super); function ControlledSubject(enableQueue) { if (enableQueue == null) { enableQueue = true; } _super.call(this, subscribe); this.subject = new Subject(); this.enableQueue = enableQueue; this.queue = enableQueue ? [] : null; this.requestedCount = 0; this.requestedDisposable = disposableEmpty; this.error = null; this.hasFailed = false; this.hasCompleted = false; this.controlledDisposable = disposableEmpty; } addProperties(ControlledSubject.prototype, Observer, { onCompleted: function () { checkDisposed.call(this); this.hasCompleted = true; if (!this.enableQueue || this.queue.length === 0) { this.subject.onCompleted(); } }, onError: function (error) { checkDisposed.call(this); this.hasFailed = true; this.error = error; if (!this.enableQueue || this.queue.length === 0) { this.subject.onError(error); } }, onNext: function (value) { checkDisposed.call(this); var hasRequested = false; if (this.requestedCount === 0) { if (this.enableQueue) { this.queue.push(value); } } else { if (this.requestedCount !== -1) { if (this.requestedCount-- === 0) { this.disposeCurrentRequest(); } } hasRequested = true; } if (hasRequested) { this.subject.onNext(value); } }, _processRequest: function (numberOfItems) { if (this.enableQueue) { //console.log('queue length', this.queue.length); while (this.queue.length >= numberOfItems && numberOfItems > 0) { //console.log('number of items', numberOfItems); this.subject.onNext(this.queue.shift()); numberOfItems--; } if (this.queue.length !== 0) { return { numberOfItems: numberOfItems, returnValue: true }; } else { return { numberOfItems: numberOfItems, returnValue: false }; } } if (this.hasFailed) { this.subject.onError(this.error); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } else if (this.hasCompleted) { this.subject.onCompleted(); this.controlledDisposable.dispose(); this.controlledDisposable = disposableEmpty; } return { numberOfItems: numberOfItems, returnValue: false }; }, request: function (number) { checkDisposed.call(this); this.disposeCurrentRequest(); var self = this, r = this._processRequest(number); number = r.numberOfItems; if (!r.returnValue) { this.requestedCount = number; this.requestedDisposable = disposableCreate(function () { self.requestedCount = 0; }); return this.requestedDisposable } else { return disposableEmpty; } }, disposeCurrentRequest: function () { this.requestedDisposable.dispose(); this.requestedDisposable = disposableEmpty; }, dispose: function () { this.isDisposed = true; this.error = null; this.subject.dispose(); this.requestedDisposable.dispose(); } }); return ControlledSubject; }(Observable)); /** * Executes a transducer to transform the observable sequence * @param {Transducer} transducer A transducer to execute * @returns {Observable} An Observable sequence containing the results from the transducer. */ observableProto.transduce = function(transducer) { var source = this; function transformForObserver(observer) { return { init: function() { return observer; }, step: function(obs, input) { return obs.onNext(input); }, result: function(obs) { return obs.onCompleted(); } }; } return new AnonymousObservable(function(observer) { var xform = transducer(transformForObserver(observer)); return source.subscribe( function(v) { try { xform.step(observer, v); } catch (e) { observer.onError(e); } }, observer.onError.bind(observer), function() { xform.result(observer); } ); }); }; var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { inherits(AnonymousObservable, __super__); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; } return typeof subscriber === 'function' ? disposableCreate(subscriber) : disposableEmpty; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var setDisposable = function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }; var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(setDisposable); } else { setDisposable(); } return autoDetachObserver; } __super__.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception, hv = this.hasValue, v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, __super__); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { __super__.call(this, subscribe); this.isDisposed = false; this.isStopped = false; this.value = null; this.hasValue = false; this.observers = []; this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { checkDisposed.call(this); return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var os = this.observers.slice(0), v = this.value, hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the error. * @param {Mixed} error The Error to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; this.hasValue = true; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { inherits(AnonymousSubject, __super__); function AnonymousSubject(observer, observable) { this.observer = observer; this.observable = observable; __super__.call(this, this.observable.subscribe.bind(this.observable)); } addProperties(AnonymousSubject.prototype, Observer, { onCompleted: function () { this.observer.onCompleted(); }, onError: function (exception) { this.observer.onError(exception); }, onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); /** * Represents a value that changes over time. * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. */ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); observer.onNext(this.value); return new InnerSubscription(this, observer); } var ex = this.exception; if (ex) { observer.onError(ex); } else { observer.onCompleted(); } return disposableEmpty; } inherits(BehaviorSubject, __super__); /** * @constructor * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. */ function BehaviorSubject(value) { __super__.call(this, subscribe); this.value = value, this.observers = [], this.isDisposed = false, this.isStopped = false, this.exception = null; } addProperties(BehaviorSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; this.exception = error; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } this.value = value; for (var i = 0, os = this.observers.slice(0), len = os.length; i < len; i++) { os[i].onNext(value); } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.value = null; this.exception = null; } }); return BehaviorSubject; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. */ var ReplaySubject = Rx.ReplaySubject = (function (__super__) { function createRemovableDisposable(subject, observer) { return disposableCreate(function () { observer.dispose(); !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1); }); } function subscribe(observer) { var so = new ScheduledObserver(this.scheduler, observer), subscription = createRemovableDisposable(this, so); checkDisposed.call(this); this._trim(this.scheduler.now()); this.observers.push(so); var n = this.q.length; for (var i = 0, len = this.q.length; i < len; i++) { so.onNext(this.q[i].value); } if (this.hasError) { n++; so.onError(this.error); } else if (this.isStopped) { n++; so.onCompleted(); } so.ensureActive(n); return subscription; } inherits(ReplaySubject, __super__); /** * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. * @param {Number} [bufferSize] Maximum element count of the replay buffer. * @param {Number} [windowSize] Maximum time length of the replay buffer. * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. */ function ReplaySubject(bufferSize, windowSize, scheduler) { this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize; this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize; this.scheduler = scheduler || currentThreadScheduler; this.q = []; this.observers = []; this.isStopped = false; this.isDisposed = false; this.hasError = false; this.error = null; __super__.call(this, subscribe); } addProperties(ReplaySubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, _trim: function (now) { while (this.q.length > this.bufferSize) { this.q.shift(); } while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { this.q.shift(); } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (this.isStopped) { return; } var now = this.scheduler.now(); this.q.push({ interval: now, value: value }); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onNext(value); observer.ensureActive(); } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; this.error = error; this.hasError = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onError(error); observer.ensureActive(); } this.observers = []; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (this.isStopped) { return; } this.isStopped = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { var observer = o[i]; observer.onCompleted(); observer.ensureActive(); } this.observers = []; }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); return ReplaySubject; }(Observable)); if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { root.Rx = Rx; define(function() { return Rx; }); } else if (freeExports && freeModule) { // in Node.js or RingoJS if (moduleExports) { (freeModule.exports = Rx).Rx = Rx; } else { freeExports.Rx = Rx; } } else { // in a browser or Rhino root.Rx = Rx; } }.call(this));
src/svg-icons/image/filter-frames.js
ruifortes/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageFilterFrames = (props) => ( <SvgIcon {...props}> <path d="M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM18 8H6v10h12"/> </SvgIcon> ); ImageFilterFrames = pure(ImageFilterFrames); ImageFilterFrames.displayName = 'ImageFilterFrames'; ImageFilterFrames.muiName = 'SvgIcon'; export default ImageFilterFrames;
src/svg-icons/notification/do-not-disturb-on.js
hwo411/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NotificationDoNotDisturbOn = (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 2zm5 11H7v-2h10v2z"/> </SvgIcon> ); NotificationDoNotDisturbOn = pure(NotificationDoNotDisturbOn); NotificationDoNotDisturbOn.displayName = 'NotificationDoNotDisturbOn'; NotificationDoNotDisturbOn.muiName = 'SvgIcon'; export default NotificationDoNotDisturbOn;
ajax/libs/vue-material/0.5.0/components/mdBottomBar/index.debug.js
tholu/cdnjs
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["VueMaterial"] = factory(); else root["VueMaterial"] = factory(); })(this, function() { return /******/ (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__) { module.exports = __webpack_require__(16); /***/ }, /* 1 */, /* 2 */, /* 3 */, /* 4 */, /* 5 */, /* 6 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _vue = __webpack_require__(7); var _vue2 = _interopRequireDefault(_vue); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { props: { mdTheme: String }, data: function data() { return { closestThemedParent: false }; }, methods: { getClosestThemedParent: function getClosestThemedParent($parent) { if (!$parent || !$parent.$el || $parent._uid === 0) { return false; } if ($parent.mdTheme || $parent.mdName) { return $parent; } return this.getClosestThemedParent($parent.$parent); } }, computed: { themeClass: function themeClass() { if (this.mdTheme) { return 'md-theme-' + this.mdTheme; } var theme = this.closestThemedParent.mdTheme; if (!theme) { theme = this.closestThemedParent.mdName; } return 'md-theme-' + (theme || _vue2.default.material.currentTheme); } }, mounted: function mounted() { this.closestThemedParent = this.getClosestThemedParent(this.$parent); if (!_vue2.default.material.currentTheme) { _vue2.default.material.setCurrentTheme('default'); } } }; module.exports = exports['default']; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, global) {/*! * Vue.js v2.1.6 * (c) 2014-2016 Evan You * Released under the MIT License. */ 'use strict'; /* */ /** * Convert a value to a string that is actually rendered. */ function _toString (val) { return val == null ? '' : typeof val === 'object' ? JSON.stringify(val, null, 2) : String(val) } /** * Convert a input value to a number for persistence. * If the conversion fails, return original string. */ function toNumber (val) { var n = parseFloat(val, 10); return (n || n === 0) ? n : val } /** * Make a map and return a function for checking if a key * is in that map. */ function makeMap ( str, expectsLowerCase ) { var map = Object.create(null); var list = str.split(','); for (var i = 0; i < list.length; i++) { map[list[i]] = true; } return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; } } /** * Check if a tag is a built-in tag. */ var isBuiltInTag = makeMap('slot,component', true); /** * Remove an item from an array */ function remove$1 (arr, item) { if (arr.length) { var index = arr.indexOf(item); if (index > -1) { return arr.splice(index, 1) } } } /** * Check whether the object has the property. */ var hasOwnProperty = Object.prototype.hasOwnProperty; function hasOwn (obj, key) { return hasOwnProperty.call(obj, key) } /** * Check if value is primitive */ function isPrimitive (value) { return typeof value === 'string' || typeof value === 'number' } /** * Create a cached version of a pure function. */ function cached (fn) { var cache = Object.create(null); return function cachedFn (str) { var hit = cache[str]; return hit || (cache[str] = fn(str)) } } /** * Camelize a hyphen-delmited string. */ var camelizeRE = /-(\w)/g; var camelize = cached(function (str) { return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) }); /** * Capitalize a string. */ var capitalize = cached(function (str) { return str.charAt(0).toUpperCase() + str.slice(1) }); /** * Hyphenate a camelCase string. */ var hyphenateRE = /([^-])([A-Z])/g; var hyphenate = cached(function (str) { return str .replace(hyphenateRE, '$1-$2') .replace(hyphenateRE, '$1-$2') .toLowerCase() }); /** * Simple bind, faster than native */ function bind$1 (fn, ctx) { function boundFn (a) { var l = arguments.length; return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx) } // record original fn length boundFn._length = fn.length; return boundFn } /** * Convert an Array-like object to a real Array. */ function toArray (list, start) { start = start || 0; var i = list.length - start; var ret = new Array(i); while (i--) { ret[i] = list[i + start]; } return ret } /** * Mix properties into target object. */ function extend (to, _from) { for (var key in _from) { to[key] = _from[key]; } return to } /** * Quick object check - this is primarily used to tell * Objects from primitive values when we know the value * is a JSON-compliant type. */ function isObject (obj) { return obj !== null && typeof obj === 'object' } /** * Strict object type check. Only returns true * for plain JavaScript objects. */ var toString = Object.prototype.toString; var OBJECT_STRING = '[object Object]'; function isPlainObject (obj) { return toString.call(obj) === OBJECT_STRING } /** * Merge an Array of Objects into a single Object. */ function toObject (arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } return res } /** * Perform no operation. */ function noop () {} /** * Always return false. */ var no = function () { return false; }; /** * Return same value */ var identity = function (_) { return _; }; /** * Generate a static keys string from compiler modules. */ function genStaticKeys (modules) { return modules.reduce(function (keys, m) { return keys.concat(m.staticKeys || []) }, []).join(',') } /** * Check if two values are loosely equal - that is, * if they are plain objects, do they have the same shape? */ function looseEqual (a, b) { /* eslint-disable eqeqeq */ return a == b || ( isObject(a) && isObject(b) ? JSON.stringify(a) === JSON.stringify(b) : false ) /* eslint-enable eqeqeq */ } function looseIndexOf (arr, val) { for (var i = 0; i < arr.length; i++) { if (looseEqual(arr[i], val)) { return i } } return -1 } /* */ var config = { /** * Option merge strategies (used in core/util/options) */ optionMergeStrategies: Object.create(null), /** * Whether to suppress warnings. */ silent: false, /** * Whether to enable devtools */ devtools: process.env.NODE_ENV !== 'production', /** * Error handler for watcher errors */ errorHandler: null, /** * Ignore certain custom elements */ ignoredElements: null, /** * Custom user key aliases for v-on */ keyCodes: Object.create(null), /** * Check if a tag is reserved so that it cannot be registered as a * component. This is platform-dependent and may be overwritten. */ isReservedTag: no, /** * Check if a tag is an unknown element. * Platform-dependent. */ isUnknownElement: no, /** * Get the namespace of an element */ getTagNamespace: noop, /** * Parse the real tag name for the specific platform. */ parsePlatformTagName: identity, /** * Check if an attribute must be bound using property, e.g. value * Platform-dependent. */ mustUseProp: no, /** * List of asset types that a component can own. */ _assetTypes: [ 'component', 'directive', 'filter' ], /** * List of lifecycle hooks. */ _lifecycleHooks: [ 'beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'beforeDestroy', 'destroyed', 'activated', 'deactivated' ], /** * Max circular updates allowed in a scheduler flush cycle. */ _maxUpdateCount: 100 }; /* */ /** * Check if a string starts with $ or _ */ function isReserved (str) { var c = (str + '').charCodeAt(0); return c === 0x24 || c === 0x5F } /** * Define a property. */ function def (obj, key, val, enumerable) { Object.defineProperty(obj, key, { value: val, enumerable: !!enumerable, writable: true, configurable: true }); } /** * Parse simple path. */ var bailRE = /[^\w.$]/; function parsePath (path) { if (bailRE.test(path)) { return } else { var segments = path.split('.'); return function (obj) { for (var i = 0; i < segments.length; i++) { if (!obj) { return } obj = obj[segments[i]]; } return obj } } } /* */ /* globals MutationObserver */ // can we use __proto__? var hasProto = '__proto__' in {}; // Browser environment sniffing var inBrowser = typeof window !== 'undefined'; var UA = inBrowser && window.navigator.userAgent.toLowerCase(); var isIE = UA && /msie|trident/.test(UA); var isIE9 = UA && UA.indexOf('msie 9.0') > 0; var isEdge = UA && UA.indexOf('edge/') > 0; var isAndroid = UA && UA.indexOf('android') > 0; var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA); // this needs to be lazy-evaled because vue may be required before // vue-server-renderer can set VUE_ENV var _isServer; var isServerRendering = function () { if (_isServer === undefined) { /* istanbul ignore if */ if (!inBrowser && typeof global !== 'undefined') { // detect presence of vue-server-renderer and avoid // Webpack shimming the process _isServer = global['process'].env.VUE_ENV === 'server'; } else { _isServer = false; } } return _isServer }; // detect devtools var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; /* istanbul ignore next */ function isNative (Ctor) { return /native code/.test(Ctor.toString()) } /** * Defer a task to execute it asynchronously. */ var nextTick = (function () { var callbacks = []; var pending = false; var timerFunc; function nextTickHandler () { pending = false; var copies = callbacks.slice(0); callbacks.length = 0; for (var i = 0; i < copies.length; i++) { copies[i](); } } // the nextTick behavior leverages the microtask queue, which can be accessed // via either native Promise.then or MutationObserver. // MutationObserver has wider support, however it is seriously bugged in // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It // completely stops working after triggering a few times... so, if native // Promise is available, we will use it: /* istanbul ignore if */ if (typeof Promise !== 'undefined' && isNative(Promise)) { var p = Promise.resolve(); var logError = function (err) { console.error(err); }; timerFunc = function () { p.then(nextTickHandler).catch(logError); // in problematic UIWebViews, Promise.then doesn't completely break, but // it can get stuck in a weird state where callbacks are pushed into the // microtask queue but the queue isn't being flushed, until the browser // needs to do some other work, e.g. handle a timer. Therefore we can // "force" the microtask queue to be flushed by adding an empty timer. if (isIOS) { setTimeout(noop); } }; } else if (typeof MutationObserver !== 'undefined' && ( isNative(MutationObserver) || // PhantomJS and iOS 7.x MutationObserver.toString() === '[object MutationObserverConstructor]' )) { // use MutationObserver where native Promise is not available, // e.g. PhantomJS IE11, iOS7, Android 4.4 var counter = 1; var observer = new MutationObserver(nextTickHandler); var textNode = document.createTextNode(String(counter)); observer.observe(textNode, { characterData: true }); timerFunc = function () { counter = (counter + 1) % 2; textNode.data = String(counter); }; } else { // fallback to setTimeout /* istanbul ignore next */ timerFunc = function () { setTimeout(nextTickHandler, 0); }; } return function queueNextTick (cb, ctx) { var _resolve; callbacks.push(function () { if (cb) { cb.call(ctx); } if (_resolve) { _resolve(ctx); } }); if (!pending) { pending = true; timerFunc(); } if (!cb && typeof Promise !== 'undefined') { return new Promise(function (resolve) { _resolve = resolve; }) } } })(); var _Set; /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) { // use native Set when available. _Set = Set; } else { // a non-standard Set polyfill that only works with primitive keys. _Set = (function () { function Set () { this.set = Object.create(null); } Set.prototype.has = function has (key) { return this.set[key] === true }; Set.prototype.add = function add (key) { this.set[key] = true; }; Set.prototype.clear = function clear () { this.set = Object.create(null); }; return Set; }()); } var warn = noop; var formatComponentName; if (process.env.NODE_ENV !== 'production') { var hasConsole = typeof console !== 'undefined'; warn = function (msg, vm) { if (hasConsole && (!config.silent)) { console.error("[Vue warn]: " + msg + " " + ( vm ? formatLocation(formatComponentName(vm)) : '' )); } }; formatComponentName = function (vm) { if (vm.$root === vm) { return 'root instance' } var name = vm._isVue ? vm.$options.name || vm.$options._componentTag : vm.name; return ( (name ? ("component <" + name + ">") : "anonymous component") + (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '') ) }; var formatLocation = function (str) { if (str === 'anonymous component') { str += " - use the \"name\" option for better debugging messages."; } return ("\n(found in " + str + ")") }; } /* */ var uid$1 = 0; /** * A dep is an observable that can have multiple * directives subscribing to it. */ var Dep = function Dep () { this.id = uid$1++; this.subs = []; }; Dep.prototype.addSub = function addSub (sub) { this.subs.push(sub); }; Dep.prototype.removeSub = function removeSub (sub) { remove$1(this.subs, sub); }; Dep.prototype.depend = function depend () { if (Dep.target) { Dep.target.addDep(this); } }; Dep.prototype.notify = function notify () { // stablize the subscriber list first var subs = this.subs.slice(); for (var i = 0, l = subs.length; i < l; i++) { subs[i].update(); } }; // the current target watcher being evaluated. // this is globally unique because there could be only one // watcher being evaluated at any time. Dep.target = null; var targetStack = []; function pushTarget (_target) { if (Dep.target) { targetStack.push(Dep.target); } Dep.target = _target; } function popTarget () { Dep.target = targetStack.pop(); } /* * not type checking this file because flow doesn't play well with * dynamically accessing methods on Array prototype */ var arrayProto = Array.prototype; var arrayMethods = Object.create(arrayProto);[ 'push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse' ] .forEach(function (method) { // cache original method var original = arrayProto[method]; def(arrayMethods, method, function mutator () { var arguments$1 = arguments; // avoid leaking arguments: // http://jsperf.com/closure-with-arguments var i = arguments.length; var args = new Array(i); while (i--) { args[i] = arguments$1[i]; } var result = original.apply(this, args); var ob = this.__ob__; var inserted; switch (method) { case 'push': inserted = args; break case 'unshift': inserted = args; break case 'splice': inserted = args.slice(2); break } if (inserted) { ob.observeArray(inserted); } // notify change ob.dep.notify(); return result }); }); /* */ var arrayKeys = Object.getOwnPropertyNames(arrayMethods); /** * By default, when a reactive property is set, the new value is * also converted to become reactive. However when passing down props, * we don't want to force conversion because the value may be a nested value * under a frozen data structure. Converting it would defeat the optimization. */ var observerState = { shouldConvert: true, isSettingProps: false }; /** * Observer class that are attached to each observed * object. Once attached, the observer converts target * object's property keys into getter/setters that * collect dependencies and dispatches updates. */ var Observer = function Observer (value) { this.value = value; this.dep = new Dep(); this.vmCount = 0; def(value, '__ob__', this); if (Array.isArray(value)) { var augment = hasProto ? protoAugment : copyAugment; augment(value, arrayMethods, arrayKeys); this.observeArray(value); } else { this.walk(value); } }; /** * Walk through each property and convert them into * getter/setters. This method should only be called when * value type is Object. */ Observer.prototype.walk = function walk (obj) { var keys = Object.keys(obj); for (var i = 0; i < keys.length; i++) { defineReactive$$1(obj, keys[i], obj[keys[i]]); } }; /** * Observe a list of Array items. */ Observer.prototype.observeArray = function observeArray (items) { for (var i = 0, l = items.length; i < l; i++) { observe(items[i]); } }; // helpers /** * Augment an target Object or Array by intercepting * the prototype chain using __proto__ */ function protoAugment (target, src) { /* eslint-disable no-proto */ target.__proto__ = src; /* eslint-enable no-proto */ } /** * Augment an target Object or Array by defining * hidden properties. */ /* istanbul ignore next */ function copyAugment (target, src, keys) { for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; def(target, key, src[key]); } } /** * Attempt to create an observer instance for a value, * returns the new observer if successfully observed, * or the existing observer if the value already has one. */ function observe (value) { if (!isObject(value)) { return } var ob; if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { ob = value.__ob__; } else if ( observerState.shouldConvert && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue ) { ob = new Observer(value); } return ob } /** * Define a reactive property on an Object. */ function defineReactive$$1 ( obj, key, val, customSetter ) { var dep = new Dep(); var property = Object.getOwnPropertyDescriptor(obj, key); if (property && property.configurable === false) { return } // cater for pre-defined getter/setters var getter = property && property.get; var setter = property && property.set; var childOb = observe(val); Object.defineProperty(obj, key, { enumerable: true, configurable: true, get: function reactiveGetter () { var value = getter ? getter.call(obj) : val; if (Dep.target) { dep.depend(); if (childOb) { childOb.dep.depend(); } if (Array.isArray(value)) { dependArray(value); } } return value }, set: function reactiveSetter (newVal) { var value = getter ? getter.call(obj) : val; /* eslint-disable no-self-compare */ if (newVal === value || (newVal !== newVal && value !== value)) { return } /* eslint-enable no-self-compare */ if (process.env.NODE_ENV !== 'production' && customSetter) { customSetter(); } if (setter) { setter.call(obj, newVal); } else { val = newVal; } childOb = observe(newVal); dep.notify(); } }); } /** * Set a property on an object. Adds the new property and * triggers change notification if the property doesn't * already exist. */ function set$1 (obj, key, val) { if (Array.isArray(obj)) { obj.length = Math.max(obj.length, key); obj.splice(key, 1, val); return val } if (hasOwn(obj, key)) { obj[key] = val; return } var ob = obj.__ob__; if (obj._isVue || (ob && ob.vmCount)) { process.env.NODE_ENV !== 'production' && warn( 'Avoid adding reactive properties to a Vue instance or its root $data ' + 'at runtime - declare it upfront in the data option.' ); return } if (!ob) { obj[key] = val; return } defineReactive$$1(ob.value, key, val); ob.dep.notify(); return val } /** * Delete a property and trigger change if necessary. */ function del (obj, key) { var ob = obj.__ob__; if (obj._isVue || (ob && ob.vmCount)) { process.env.NODE_ENV !== 'production' && warn( 'Avoid deleting properties on a Vue instance or its root $data ' + '- just set it to null.' ); return } if (!hasOwn(obj, key)) { return } delete obj[key]; if (!ob) { return } ob.dep.notify(); } /** * Collect dependencies on array elements when the array is touched, since * we cannot intercept array element access like property getters. */ function dependArray (value) { for (var e = (void 0), i = 0, l = value.length; i < l; i++) { e = value[i]; e && e.__ob__ && e.__ob__.dep.depend(); if (Array.isArray(e)) { dependArray(e); } } } /* */ /** * Option overwriting strategies are functions that handle * how to merge a parent option value and a child option * value into the final value. */ var strats = config.optionMergeStrategies; /** * Options with restrictions */ if (process.env.NODE_ENV !== 'production') { strats.el = strats.propsData = function (parent, child, vm, key) { if (!vm) { warn( "option \"" + key + "\" can only be used during instance " + 'creation with the `new` keyword.' ); } return defaultStrat(parent, child) }; } /** * Helper that recursively merges two data objects together. */ function mergeData (to, from) { if (!from) { return to } var key, toVal, fromVal; var keys = Object.keys(from); for (var i = 0; i < keys.length; i++) { key = keys[i]; toVal = to[key]; fromVal = from[key]; if (!hasOwn(to, key)) { set$1(to, key, fromVal); } else if (isPlainObject(toVal) && isPlainObject(fromVal)) { mergeData(toVal, fromVal); } } return to } /** * Data */ strats.data = function ( parentVal, childVal, vm ) { if (!vm) { // in a Vue.extend merge, both should be functions if (!childVal) { return parentVal } if (typeof childVal !== 'function') { process.env.NODE_ENV !== 'production' && warn( 'The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm ); return parentVal } if (!parentVal) { return childVal } // when parentVal & childVal are both present, // we need to return a function that returns the // merged result of both functions... no need to // check if parentVal is a function here because // it has to be a function to pass previous merges. return function mergedDataFn () { return mergeData( childVal.call(this), parentVal.call(this) ) } } else if (parentVal || childVal) { return function mergedInstanceDataFn () { // instance merge var instanceData = typeof childVal === 'function' ? childVal.call(vm) : childVal; var defaultData = typeof parentVal === 'function' ? parentVal.call(vm) : undefined; if (instanceData) { return mergeData(instanceData, defaultData) } else { return defaultData } } } }; /** * Hooks and param attributes are merged as arrays. */ function mergeHook ( parentVal, childVal ) { return childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal } config._lifecycleHooks.forEach(function (hook) { strats[hook] = mergeHook; }); /** * Assets * * When a vm is present (instance creation), we need to do * a three-way merge between constructor options, instance * options and parent options. */ function mergeAssets (parentVal, childVal) { var res = Object.create(parentVal || null); return childVal ? extend(res, childVal) : res } config._assetTypes.forEach(function (type) { strats[type + 's'] = mergeAssets; }); /** * Watchers. * * Watchers hashes should not overwrite one * another, so we merge them as arrays. */ strats.watch = function (parentVal, childVal) { /* istanbul ignore if */ if (!childVal) { return parentVal } if (!parentVal) { return childVal } var ret = {}; extend(ret, parentVal); for (var key in childVal) { var parent = ret[key]; var child = childVal[key]; if (parent && !Array.isArray(parent)) { parent = [parent]; } ret[key] = parent ? parent.concat(child) : [child]; } return ret }; /** * Other object hashes. */ strats.props = strats.methods = strats.computed = function (parentVal, childVal) { if (!childVal) { return parentVal } if (!parentVal) { return childVal } var ret = Object.create(null); extend(ret, parentVal); extend(ret, childVal); return ret }; /** * Default strategy. */ var defaultStrat = function (parentVal, childVal) { return childVal === undefined ? parentVal : childVal }; /** * Validate component names */ function checkComponents (options) { for (var key in options.components) { var lower = key.toLowerCase(); if (isBuiltInTag(lower) || config.isReservedTag(lower)) { warn( 'Do not use built-in or reserved HTML elements as component ' + 'id: ' + key ); } } } /** * Ensure all props option syntax are normalized into the * Object-based format. */ function normalizeProps (options) { var props = options.props; if (!props) { return } var res = {}; var i, val, name; if (Array.isArray(props)) { i = props.length; while (i--) { val = props[i]; if (typeof val === 'string') { name = camelize(val); res[name] = { type: null }; } else if (process.env.NODE_ENV !== 'production') { warn('props must be strings when using array syntax.'); } } } else if (isPlainObject(props)) { for (var key in props) { val = props[key]; name = camelize(key); res[name] = isPlainObject(val) ? val : { type: val }; } } options.props = res; } /** * Normalize raw function directives into object format. */ function normalizeDirectives (options) { var dirs = options.directives; if (dirs) { for (var key in dirs) { var def = dirs[key]; if (typeof def === 'function') { dirs[key] = { bind: def, update: def }; } } } } /** * Merge two option objects into a new one. * Core utility used in both instantiation and inheritance. */ function mergeOptions ( parent, child, vm ) { if (process.env.NODE_ENV !== 'production') { checkComponents(child); } normalizeProps(child); normalizeDirectives(child); var extendsFrom = child.extends; if (extendsFrom) { parent = typeof extendsFrom === 'function' ? mergeOptions(parent, extendsFrom.options, vm) : mergeOptions(parent, extendsFrom, vm); } if (child.mixins) { for (var i = 0, l = child.mixins.length; i < l; i++) { var mixin = child.mixins[i]; if (mixin.prototype instanceof Vue$2) { mixin = mixin.options; } parent = mergeOptions(parent, mixin, vm); } } var options = {}; var key; for (key in parent) { mergeField(key); } for (key in child) { if (!hasOwn(parent, key)) { mergeField(key); } } function mergeField (key) { var strat = strats[key] || defaultStrat; options[key] = strat(parent[key], child[key], vm, key); } return options } /** * Resolve an asset. * This function is used because child instances need access * to assets defined in its ancestor chain. */ function resolveAsset ( options, type, id, warnMissing ) { /* istanbul ignore if */ if (typeof id !== 'string') { return } var assets = options[type]; // check local registration variations first if (hasOwn(assets, id)) { return assets[id] } var camelizedId = camelize(id); if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } var PascalCaseId = capitalize(camelizedId); if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } // fallback to prototype chain var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; if (process.env.NODE_ENV !== 'production' && warnMissing && !res) { warn( 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, options ); } return res } /* */ function validateProp ( key, propOptions, propsData, vm ) { var prop = propOptions[key]; var absent = !hasOwn(propsData, key); var value = propsData[key]; // handle boolean props if (isBooleanType(prop.type)) { if (absent && !hasOwn(prop, 'default')) { value = false; } else if (value === '' || value === hyphenate(key)) { value = true; } } // check default value if (value === undefined) { value = getPropDefaultValue(vm, prop, key); // since the default value is a fresh copy, // make sure to observe it. var prevShouldConvert = observerState.shouldConvert; observerState.shouldConvert = true; observe(value); observerState.shouldConvert = prevShouldConvert; } if (process.env.NODE_ENV !== 'production') { assertProp(prop, key, value, vm, absent); } return value } /** * Get the default value of a prop. */ function getPropDefaultValue (vm, prop, key) { // no default, return undefined if (!hasOwn(prop, 'default')) { return undefined } var def = prop.default; // warn against non-factory defaults for Object & Array if (isObject(def)) { process.env.NODE_ENV !== 'production' && warn( 'Invalid default value for prop "' + key + '": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm ); } // the raw prop value was also undefined from previous render, // return previous default value to avoid unnecessary watcher trigger if (vm && vm.$options.propsData && vm.$options.propsData[key] === undefined && vm[key] !== undefined) { return vm[key] } // call factory function for non-Function types return typeof def === 'function' && prop.type !== Function ? def.call(vm) : def } /** * Assert whether a prop is valid. */ function assertProp ( prop, name, value, vm, absent ) { if (prop.required && absent) { warn( 'Missing required prop: "' + name + '"', vm ); return } if (value == null && !prop.required) { return } var type = prop.type; var valid = !type || type === true; var expectedTypes = []; if (type) { if (!Array.isArray(type)) { type = [type]; } for (var i = 0; i < type.length && !valid; i++) { var assertedType = assertType(value, type[i]); expectedTypes.push(assertedType.expectedType); valid = assertedType.valid; } } if (!valid) { warn( 'Invalid prop: type check failed for prop "' + name + '".' + ' Expected ' + expectedTypes.map(capitalize).join(', ') + ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.', vm ); return } var validator = prop.validator; if (validator) { if (!validator(value)) { warn( 'Invalid prop: custom validator check failed for prop "' + name + '".', vm ); } } } /** * Assert the type of a value */ function assertType (value, type) { var valid; var expectedType = getType(type); if (expectedType === 'String') { valid = typeof value === (expectedType = 'string'); } else if (expectedType === 'Number') { valid = typeof value === (expectedType = 'number'); } else if (expectedType === 'Boolean') { valid = typeof value === (expectedType = 'boolean'); } else if (expectedType === 'Function') { valid = typeof value === (expectedType = 'function'); } else if (expectedType === 'Object') { valid = isPlainObject(value); } else if (expectedType === 'Array') { valid = Array.isArray(value); } else { valid = value instanceof type; } return { valid: valid, expectedType: expectedType } } /** * Use function string name to check built-in types, * because a simple equality check will fail when running * across different vms / iframes. */ function getType (fn) { var match = fn && fn.toString().match(/^\s*function (\w+)/); return match && match[1] } function isBooleanType (fn) { if (!Array.isArray(fn)) { return getType(fn) === 'Boolean' } for (var i = 0, len = fn.length; i < len; i++) { if (getType(fn[i]) === 'Boolean') { return true } } /* istanbul ignore next */ return false } var util = Object.freeze({ defineReactive: defineReactive$$1, _toString: _toString, toNumber: toNumber, makeMap: makeMap, isBuiltInTag: isBuiltInTag, remove: remove$1, hasOwn: hasOwn, isPrimitive: isPrimitive, cached: cached, camelize: camelize, capitalize: capitalize, hyphenate: hyphenate, bind: bind$1, toArray: toArray, extend: extend, isObject: isObject, isPlainObject: isPlainObject, toObject: toObject, noop: noop, no: no, identity: identity, genStaticKeys: genStaticKeys, looseEqual: looseEqual, looseIndexOf: looseIndexOf, isReserved: isReserved, def: def, parsePath: parsePath, hasProto: hasProto, inBrowser: inBrowser, UA: UA, isIE: isIE, isIE9: isIE9, isEdge: isEdge, isAndroid: isAndroid, isIOS: isIOS, isServerRendering: isServerRendering, devtools: devtools, nextTick: nextTick, get _Set () { return _Set; }, mergeOptions: mergeOptions, resolveAsset: resolveAsset, get warn () { return warn; }, get formatComponentName () { return formatComponentName; }, validateProp: validateProp }); /* not type checking this file because flow doesn't play well with Proxy */ var initProxy; if (process.env.NODE_ENV !== 'production') { var allowedGlobals = makeMap( 'Infinity,undefined,NaN,isFinite,isNaN,' + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + 'require' // for Webpack/Browserify ); var warnNonPresent = function (target, key) { warn( "Property or method \"" + key + "\" is not defined on the instance but " + "referenced during render. Make sure to declare reactive data " + "properties in the data option.", target ); }; var hasProxy = typeof Proxy !== 'undefined' && Proxy.toString().match(/native code/); if (hasProxy) { var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta'); config.keyCodes = new Proxy(config.keyCodes, { set: function set (target, key, value) { if (isBuiltInModifier(key)) { warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); return false } else { target[key] = value; return true } } }); } var hasHandler = { has: function has (target, key) { var has = key in target; var isAllowed = allowedGlobals(key) || key.charAt(0) === '_'; if (!has && !isAllowed) { warnNonPresent(target, key); } return has || !isAllowed } }; var getHandler = { get: function get (target, key) { if (typeof key === 'string' && !(key in target)) { warnNonPresent(target, key); } return target[key] } }; initProxy = function initProxy (vm) { if (hasProxy) { // determine which proxy handler to use var options = vm.$options; var handlers = options.render && options.render._withStripped ? getHandler : hasHandler; vm._renderProxy = new Proxy(vm, handlers); } else { vm._renderProxy = vm; } }; } /* */ var queue = []; var has$1 = {}; var circular = {}; var waiting = false; var flushing = false; var index = 0; /** * Reset the scheduler's state. */ function resetSchedulerState () { queue.length = 0; has$1 = {}; if (process.env.NODE_ENV !== 'production') { circular = {}; } waiting = flushing = false; } /** * Flush both queues and run the watchers. */ function flushSchedulerQueue () { flushing = true; // Sort queue before flush. // This ensures that: // 1. Components are updated from parent to child. (because parent is always // created before the child) // 2. A component's user watchers are run before its render watcher (because // user watchers are created before the render watcher) // 3. If a component is destroyed during a parent component's watcher run, // its watchers can be skipped. queue.sort(function (a, b) { return a.id - b.id; }); // do not cache length because more watchers might be pushed // as we run existing watchers for (index = 0; index < queue.length; index++) { var watcher = queue[index]; var id = watcher.id; has$1[id] = null; watcher.run(); // in dev build, check and stop circular updates. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) { circular[id] = (circular[id] || 0) + 1; if (circular[id] > config._maxUpdateCount) { warn( 'You may have an infinite update loop ' + ( watcher.user ? ("in watcher with expression \"" + (watcher.expression) + "\"") : "in a component render function." ), watcher.vm ); break } } } // devtool hook /* istanbul ignore if */ if (devtools && config.devtools) { devtools.emit('flush'); } resetSchedulerState(); } /** * Push a watcher into the watcher queue. * Jobs with duplicate IDs will be skipped unless it's * pushed when the queue is being flushed. */ function queueWatcher (watcher) { var id = watcher.id; if (has$1[id] == null) { has$1[id] = true; if (!flushing) { queue.push(watcher); } else { // if already flushing, splice the watcher based on its id // if already past its id, it will be run next immediately. var i = queue.length - 1; while (i >= 0 && queue[i].id > watcher.id) { i--; } queue.splice(Math.max(i, index) + 1, 0, watcher); } // queue the flush if (!waiting) { waiting = true; nextTick(flushSchedulerQueue); } } } /* */ var uid$2 = 0; /** * A watcher parses an expression, collects dependencies, * and fires callback when the expression value changes. * This is used for both the $watch() api and directives. */ var Watcher = function Watcher ( vm, expOrFn, cb, options ) { if ( options === void 0 ) options = {}; this.vm = vm; vm._watchers.push(this); // options this.deep = !!options.deep; this.user = !!options.user; this.lazy = !!options.lazy; this.sync = !!options.sync; this.expression = expOrFn.toString(); this.cb = cb; this.id = ++uid$2; // uid for batching this.active = true; this.dirty = this.lazy; // for lazy watchers this.deps = []; this.newDeps = []; this.depIds = new _Set(); this.newDepIds = new _Set(); // parse expression for getter if (typeof expOrFn === 'function') { this.getter = expOrFn; } else { this.getter = parsePath(expOrFn); if (!this.getter) { this.getter = function () {}; process.env.NODE_ENV !== 'production' && warn( "Failed watching path: \"" + expOrFn + "\" " + 'Watcher only accepts simple dot-delimited paths. ' + 'For full control, use a function instead.', vm ); } } this.value = this.lazy ? undefined : this.get(); }; /** * Evaluate the getter, and re-collect dependencies. */ Watcher.prototype.get = function get () { pushTarget(this); var value = this.getter.call(this.vm, this.vm); // "touch" every property so they are all tracked as // dependencies for deep watching if (this.deep) { traverse(value); } popTarget(); this.cleanupDeps(); return value }; /** * Add a dependency to this directive. */ Watcher.prototype.addDep = function addDep (dep) { var id = dep.id; if (!this.newDepIds.has(id)) { this.newDepIds.add(id); this.newDeps.push(dep); if (!this.depIds.has(id)) { dep.addSub(this); } } }; /** * Clean up for dependency collection. */ Watcher.prototype.cleanupDeps = function cleanupDeps () { var this$1 = this; var i = this.deps.length; while (i--) { var dep = this$1.deps[i]; if (!this$1.newDepIds.has(dep.id)) { dep.removeSub(this$1); } } var tmp = this.depIds; this.depIds = this.newDepIds; this.newDepIds = tmp; this.newDepIds.clear(); tmp = this.deps; this.deps = this.newDeps; this.newDeps = tmp; this.newDeps.length = 0; }; /** * Subscriber interface. * Will be called when a dependency changes. */ Watcher.prototype.update = function update () { /* istanbul ignore else */ if (this.lazy) { this.dirty = true; } else if (this.sync) { this.run(); } else { queueWatcher(this); } }; /** * Scheduler job interface. * Will be called by the scheduler. */ Watcher.prototype.run = function run () { if (this.active) { var value = this.get(); if ( value !== this.value || // Deep watchers and watchers on Object/Arrays should fire even // when the value is the same, because the value may // have mutated. isObject(value) || this.deep ) { // set new value var oldValue = this.value; this.value = value; if (this.user) { try { this.cb.call(this.vm, value, oldValue); } catch (e) { /* istanbul ignore else */ if (config.errorHandler) { config.errorHandler.call(null, e, this.vm); } else { process.env.NODE_ENV !== 'production' && warn( ("Error in watcher \"" + (this.expression) + "\""), this.vm ); throw e } } } else { this.cb.call(this.vm, value, oldValue); } } } }; /** * Evaluate the value of the watcher. * This only gets called for lazy watchers. */ Watcher.prototype.evaluate = function evaluate () { this.value = this.get(); this.dirty = false; }; /** * Depend on all deps collected by this watcher. */ Watcher.prototype.depend = function depend () { var this$1 = this; var i = this.deps.length; while (i--) { this$1.deps[i].depend(); } }; /** * Remove self from all dependencies' subscriber list. */ Watcher.prototype.teardown = function teardown () { var this$1 = this; if (this.active) { // remove self from vm's watcher list // this is a somewhat expensive operation so we skip it // if the vm is being destroyed or is performing a v-for // re-render (the watcher list is then filtered by v-for). if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) { remove$1(this.vm._watchers, this); } var i = this.deps.length; while (i--) { this$1.deps[i].removeSub(this$1); } this.active = false; } }; /** * Recursively traverse an object to evoke all converted * getters, so that every nested property inside the object * is collected as a "deep" dependency. */ var seenObjects = new _Set(); function traverse (val) { seenObjects.clear(); _traverse(val, seenObjects); } function _traverse (val, seen) { var i, keys; var isA = Array.isArray(val); if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { return } if (val.__ob__) { var depId = val.__ob__.dep.id; if (seen.has(depId)) { return } seen.add(depId); } if (isA) { i = val.length; while (i--) { _traverse(val[i], seen); } } else { keys = Object.keys(val); i = keys.length; while (i--) { _traverse(val[keys[i]], seen); } } } /* */ function initState (vm) { vm._watchers = []; initProps(vm); initMethods(vm); initData(vm); initComputed(vm); initWatch(vm); } var isReservedProp = { key: 1, ref: 1, slot: 1 }; function initProps (vm) { var props = vm.$options.props; if (props) { var propsData = vm.$options.propsData || {}; var keys = vm.$options._propKeys = Object.keys(props); var isRoot = !vm.$parent; // root instance props should be converted observerState.shouldConvert = isRoot; var loop = function ( i ) { var key = keys[i]; /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') { if (isReservedProp[key]) { warn( ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."), vm ); } defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () { if (vm.$parent && !observerState.isSettingProps) { warn( "Avoid mutating a prop directly since the value will be " + "overwritten whenever the parent component re-renders. " + "Instead, use a data or computed property based on the prop's " + "value. Prop being mutated: \"" + key + "\"", vm ); } }); } else { defineReactive$$1(vm, key, validateProp(key, props, propsData, vm)); } }; for (var i = 0; i < keys.length; i++) loop( i ); observerState.shouldConvert = true; } } function initData (vm) { var data = vm.$options.data; data = vm._data = typeof data === 'function' ? data.call(vm) : data || {}; if (!isPlainObject(data)) { data = {}; process.env.NODE_ENV !== 'production' && warn( 'data functions should return an object:\n' + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm ); } // proxy data on instance var keys = Object.keys(data); var props = vm.$options.props; var i = keys.length; while (i--) { if (props && hasOwn(props, keys[i])) { process.env.NODE_ENV !== 'production' && warn( "The data property \"" + (keys[i]) + "\" is already declared as a prop. " + "Use prop default value instead.", vm ); } else { proxy(vm, keys[i]); } } // observe data observe(data); data.__ob__ && data.__ob__.vmCount++; } var computedSharedDefinition = { enumerable: true, configurable: true, get: noop, set: noop }; function initComputed (vm) { var computed = vm.$options.computed; if (computed) { for (var key in computed) { var userDef = computed[key]; if (typeof userDef === 'function') { computedSharedDefinition.get = makeComputedGetter(userDef, vm); computedSharedDefinition.set = noop; } else { computedSharedDefinition.get = userDef.get ? userDef.cache !== false ? makeComputedGetter(userDef.get, vm) : bind$1(userDef.get, vm) : noop; computedSharedDefinition.set = userDef.set ? bind$1(userDef.set, vm) : noop; } Object.defineProperty(vm, key, computedSharedDefinition); } } } function makeComputedGetter (getter, owner) { var watcher = new Watcher(owner, getter, noop, { lazy: true }); return function computedGetter () { if (watcher.dirty) { watcher.evaluate(); } if (Dep.target) { watcher.depend(); } return watcher.value } } function initMethods (vm) { var methods = vm.$options.methods; if (methods) { for (var key in methods) { vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm); if (process.env.NODE_ENV !== 'production' && methods[key] == null) { warn( "method \"" + key + "\" has an undefined value in the component definition. " + "Did you reference the function correctly?", vm ); } } } } function initWatch (vm) { var watch = vm.$options.watch; if (watch) { for (var key in watch) { var handler = watch[key]; if (Array.isArray(handler)) { for (var i = 0; i < handler.length; i++) { createWatcher(vm, key, handler[i]); } } else { createWatcher(vm, key, handler); } } } } function createWatcher (vm, key, handler) { var options; if (isPlainObject(handler)) { options = handler; handler = handler.handler; } if (typeof handler === 'string') { handler = vm[handler]; } vm.$watch(key, handler, options); } function stateMixin (Vue) { // flow somehow has problems with directly declared definition object // when using Object.defineProperty, so we have to procedurally build up // the object here. var dataDef = {}; dataDef.get = function () { return this._data }; if (process.env.NODE_ENV !== 'production') { dataDef.set = function (newData) { warn( 'Avoid replacing instance root $data. ' + 'Use nested data properties instead.', this ); }; } Object.defineProperty(Vue.prototype, '$data', dataDef); Vue.prototype.$set = set$1; Vue.prototype.$delete = del; Vue.prototype.$watch = function ( expOrFn, cb, options ) { var vm = this; options = options || {}; options.user = true; var watcher = new Watcher(vm, expOrFn, cb, options); if (options.immediate) { cb.call(vm, watcher.value); } return function unwatchFn () { watcher.teardown(); } }; } function proxy (vm, key) { if (!isReserved(key)) { Object.defineProperty(vm, key, { configurable: true, enumerable: true, get: function proxyGetter () { return vm._data[key] }, set: function proxySetter (val) { vm._data[key] = val; } }); } } /* */ var VNode = function VNode ( tag, data, children, text, elm, context, componentOptions ) { this.tag = tag; this.data = data; this.children = children; this.text = text; this.elm = elm; this.ns = undefined; this.context = context; this.functionalContext = undefined; this.key = data && data.key; this.componentOptions = componentOptions; this.child = undefined; this.parent = undefined; this.raw = false; this.isStatic = false; this.isRootInsert = true; this.isComment = false; this.isCloned = false; this.isOnce = false; }; var createEmptyVNode = function () { var node = new VNode(); node.text = ''; node.isComment = true; return node }; function createTextVNode (val) { return new VNode(undefined, undefined, undefined, String(val)) } // optimized shallow clone // used for static nodes and slot nodes because they may be reused across // multiple renders, cloning them avoids errors when DOM manipulations rely // on their elm reference. function cloneVNode (vnode) { var cloned = new VNode( vnode.tag, vnode.data, vnode.children, vnode.text, vnode.elm, vnode.context, vnode.componentOptions ); cloned.ns = vnode.ns; cloned.isStatic = vnode.isStatic; cloned.key = vnode.key; cloned.isCloned = true; return cloned } function cloneVNodes (vnodes) { var res = new Array(vnodes.length); for (var i = 0; i < vnodes.length; i++) { res[i] = cloneVNode(vnodes[i]); } return res } /* */ var activeInstance = null; function initLifecycle (vm) { var options = vm.$options; // locate first non-abstract parent var parent = options.parent; if (parent && !options.abstract) { while (parent.$options.abstract && parent.$parent) { parent = parent.$parent; } parent.$children.push(vm); } vm.$parent = parent; vm.$root = parent ? parent.$root : vm; vm.$children = []; vm.$refs = {}; vm._watcher = null; vm._inactive = false; vm._isMounted = false; vm._isDestroyed = false; vm._isBeingDestroyed = false; } function lifecycleMixin (Vue) { Vue.prototype._mount = function ( el, hydrating ) { var vm = this; vm.$el = el; if (!vm.$options.render) { vm.$options.render = createEmptyVNode; if (process.env.NODE_ENV !== 'production') { /* istanbul ignore if */ if (vm.$options.template && vm.$options.template.charAt(0) !== '#') { warn( 'You are using the runtime-only build of Vue where the template ' + 'option is not available. Either pre-compile the templates into ' + 'render functions, or use the compiler-included build.', vm ); } else { warn( 'Failed to mount component: template or render function not defined.', vm ); } } } callHook(vm, 'beforeMount'); vm._watcher = new Watcher(vm, function () { vm._update(vm._render(), hydrating); }, noop); hydrating = false; // manually mounted instance, call mounted on self // mounted is called for render-created child components in its inserted hook if (vm.$vnode == null) { vm._isMounted = true; callHook(vm, 'mounted'); } return vm }; Vue.prototype._update = function (vnode, hydrating) { var vm = this; if (vm._isMounted) { callHook(vm, 'beforeUpdate'); } var prevEl = vm.$el; var prevVnode = vm._vnode; var prevActiveInstance = activeInstance; activeInstance = vm; vm._vnode = vnode; // Vue.prototype.__patch__ is injected in entry points // based on the rendering backend used. if (!prevVnode) { // initial render vm.$el = vm.__patch__( vm.$el, vnode, hydrating, false /* removeOnly */, vm.$options._parentElm, vm.$options._refElm ); } else { // updates vm.$el = vm.__patch__(prevVnode, vnode); } activeInstance = prevActiveInstance; // update __vue__ reference if (prevEl) { prevEl.__vue__ = null; } if (vm.$el) { vm.$el.__vue__ = vm; } // if parent is an HOC, update its $el as well if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { vm.$parent.$el = vm.$el; } if (vm._isMounted) { callHook(vm, 'updated'); } }; Vue.prototype._updateFromParent = function ( propsData, listeners, parentVnode, renderChildren ) { var vm = this; var hasChildren = !!(vm.$options._renderChildren || renderChildren); vm.$options._parentVnode = parentVnode; vm.$vnode = parentVnode; // update vm's placeholder node without re-render if (vm._vnode) { // update child tree's parent vm._vnode.parent = parentVnode; } vm.$options._renderChildren = renderChildren; // update props if (propsData && vm.$options.props) { observerState.shouldConvert = false; if (process.env.NODE_ENV !== 'production') { observerState.isSettingProps = true; } var propKeys = vm.$options._propKeys || []; for (var i = 0; i < propKeys.length; i++) { var key = propKeys[i]; vm[key] = validateProp(key, vm.$options.props, propsData, vm); } observerState.shouldConvert = true; if (process.env.NODE_ENV !== 'production') { observerState.isSettingProps = false; } vm.$options.propsData = propsData; } // update listeners if (listeners) { var oldListeners = vm.$options._parentListeners; vm.$options._parentListeners = listeners; vm._updateListeners(listeners, oldListeners); } // resolve slots + force update if has children if (hasChildren) { vm.$slots = resolveSlots(renderChildren, parentVnode.context); vm.$forceUpdate(); } }; Vue.prototype.$forceUpdate = function () { var vm = this; if (vm._watcher) { vm._watcher.update(); } }; Vue.prototype.$destroy = function () { var vm = this; if (vm._isBeingDestroyed) { return } callHook(vm, 'beforeDestroy'); vm._isBeingDestroyed = true; // remove self from parent var parent = vm.$parent; if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { remove$1(parent.$children, vm); } // teardown watchers if (vm._watcher) { vm._watcher.teardown(); } var i = vm._watchers.length; while (i--) { vm._watchers[i].teardown(); } // remove reference from data ob // frozen object may not have observer. if (vm._data.__ob__) { vm._data.__ob__.vmCount--; } // call the last hook... vm._isDestroyed = true; callHook(vm, 'destroyed'); // turn off all instance listeners. vm.$off(); // remove __vue__ reference if (vm.$el) { vm.$el.__vue__ = null; } // invoke destroy hooks on current rendered tree vm.__patch__(vm._vnode, null); }; } function callHook (vm, hook) { var handlers = vm.$options[hook]; if (handlers) { for (var i = 0, j = handlers.length; i < j; i++) { handlers[i].call(vm); } } vm.$emit('hook:' + hook); } /* */ var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 }; var hooksToMerge = Object.keys(hooks); function createComponent ( Ctor, data, context, children, tag ) { if (!Ctor) { return } var baseCtor = context.$options._base; if (isObject(Ctor)) { Ctor = baseCtor.extend(Ctor); } if (typeof Ctor !== 'function') { if (process.env.NODE_ENV !== 'production') { warn(("Invalid Component definition: " + (String(Ctor))), context); } return } // async component if (!Ctor.cid) { if (Ctor.resolved) { Ctor = Ctor.resolved; } else { Ctor = resolveAsyncComponent(Ctor, baseCtor, function () { // it's ok to queue this on every render because // $forceUpdate is buffered by the scheduler. context.$forceUpdate(); }); if (!Ctor) { // return nothing if this is indeed an async component // wait for the callback to trigger parent update. return } } } // resolve constructor options in case global mixins are applied after // component constructor creation resolveConstructorOptions(Ctor); data = data || {}; // extract props var propsData = extractProps(data, Ctor); // functional component if (Ctor.options.functional) { return createFunctionalComponent(Ctor, propsData, data, context, children) } // extract listeners, since these needs to be treated as // child component listeners instead of DOM listeners var listeners = data.on; // replace with listeners with .native modifier data.on = data.nativeOn; if (Ctor.options.abstract) { // abstract components do not keep anything // other than props & listeners data = {}; } // merge component management hooks onto the placeholder node mergeHooks(data); // return a placeholder vnode var name = Ctor.options.name || tag; var vnode = new VNode( ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), data, undefined, undefined, undefined, context, { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children } ); return vnode } function createFunctionalComponent ( Ctor, propsData, data, context, children ) { var props = {}; var propOptions = Ctor.options.props; if (propOptions) { for (var key in propOptions) { props[key] = validateProp(key, propOptions, propsData); } } // ensure the createElement function in functional components // gets a unique context - this is necessary for correct named slot check var _context = Object.create(context); var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); }; var vnode = Ctor.options.render.call(null, h, { props: props, data: data, parent: context, children: children, slots: function () { return resolveSlots(children, context); } }); if (vnode instanceof VNode) { vnode.functionalContext = context; if (data.slot) { (vnode.data || (vnode.data = {})).slot = data.slot; } } return vnode } function createComponentInstanceForVnode ( vnode, // we know it's MountedComponentVNode but flow doesn't parent, // activeInstance in lifecycle state parentElm, refElm ) { var vnodeComponentOptions = vnode.componentOptions; var options = { _isComponent: true, parent: parent, propsData: vnodeComponentOptions.propsData, _componentTag: vnodeComponentOptions.tag, _parentVnode: vnode, _parentListeners: vnodeComponentOptions.listeners, _renderChildren: vnodeComponentOptions.children, _parentElm: parentElm || null, _refElm: refElm || null }; // check inline-template render functions var inlineTemplate = vnode.data.inlineTemplate; if (inlineTemplate) { options.render = inlineTemplate.render; options.staticRenderFns = inlineTemplate.staticRenderFns; } return new vnodeComponentOptions.Ctor(options) } function init ( vnode, hydrating, parentElm, refElm ) { if (!vnode.child || vnode.child._isDestroyed) { var child = vnode.child = createComponentInstanceForVnode( vnode, activeInstance, parentElm, refElm ); child.$mount(hydrating ? vnode.elm : undefined, hydrating); } else if (vnode.data.keepAlive) { // kept-alive components, treat as a patch var mountedNode = vnode; // work around flow prepatch(mountedNode, mountedNode); } } function prepatch ( oldVnode, vnode ) { var options = vnode.componentOptions; var child = vnode.child = oldVnode.child; child._updateFromParent( options.propsData, // updated props options.listeners, // updated listeners vnode, // new parent vnode options.children // new children ); } function insert (vnode) { if (!vnode.child._isMounted) { vnode.child._isMounted = true; callHook(vnode.child, 'mounted'); } if (vnode.data.keepAlive) { vnode.child._inactive = false; callHook(vnode.child, 'activated'); } } function destroy$1 (vnode) { if (!vnode.child._isDestroyed) { if (!vnode.data.keepAlive) { vnode.child.$destroy(); } else { vnode.child._inactive = true; callHook(vnode.child, 'deactivated'); } } } function resolveAsyncComponent ( factory, baseCtor, cb ) { if (factory.requested) { // pool callbacks factory.pendingCallbacks.push(cb); } else { factory.requested = true; var cbs = factory.pendingCallbacks = [cb]; var sync = true; var resolve = function (res) { if (isObject(res)) { res = baseCtor.extend(res); } // cache resolved factory.resolved = res; // invoke callbacks only if this is not a synchronous resolve // (async resolves are shimmed as synchronous during SSR) if (!sync) { for (var i = 0, l = cbs.length; i < l; i++) { cbs[i](res); } } }; var reject = function (reason) { process.env.NODE_ENV !== 'production' && warn( "Failed to resolve async component: " + (String(factory)) + (reason ? ("\nReason: " + reason) : '') ); }; var res = factory(resolve, reject); // handle promise if (res && typeof res.then === 'function' && !factory.resolved) { res.then(resolve, reject); } sync = false; // return in case resolved synchronously return factory.resolved } } function extractProps (data, Ctor) { // we are only extracting raw values here. // validation and default values are handled in the child // component itself. var propOptions = Ctor.options.props; if (!propOptions) { return } var res = {}; var attrs = data.attrs; var props = data.props; var domProps = data.domProps; if (attrs || props || domProps) { for (var key in propOptions) { var altKey = hyphenate(key); checkProp(res, props, key, altKey, true) || checkProp(res, attrs, key, altKey) || checkProp(res, domProps, key, altKey); } } return res } function checkProp ( res, hash, key, altKey, preserve ) { if (hash) { if (hasOwn(hash, key)) { res[key] = hash[key]; if (!preserve) { delete hash[key]; } return true } else if (hasOwn(hash, altKey)) { res[key] = hash[altKey]; if (!preserve) { delete hash[altKey]; } return true } } return false } function mergeHooks (data) { if (!data.hook) { data.hook = {}; } for (var i = 0; i < hooksToMerge.length; i++) { var key = hooksToMerge[i]; var fromParent = data.hook[key]; var ours = hooks[key]; data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours; } } function mergeHook$1 (one, two) { return function (a, b, c, d) { one(a, b, c, d); two(a, b, c, d); } } /* */ function mergeVNodeHook (def, hookKey, hook, key) { key = key + hookKey; var injectedHash = def.__injected || (def.__injected = {}); if (!injectedHash[key]) { injectedHash[key] = true; var oldHook = def[hookKey]; if (oldHook) { def[hookKey] = function () { oldHook.apply(this, arguments); hook.apply(this, arguments); }; } else { def[hookKey] = hook; } } } /* */ function updateListeners ( on, oldOn, add, remove$$1, vm ) { var name, cur, old, fn, event, capture, once; for (name in on) { cur = on[name]; old = oldOn[name]; if (!cur) { process.env.NODE_ENV !== 'production' && warn( "Invalid handler for event \"" + name + "\": got " + String(cur), vm ); } else if (!old) { once = name.charAt(0) === '~'; // Prefixed last, checked first event = once ? name.slice(1) : name; capture = event.charAt(0) === '!'; event = capture ? event.slice(1) : event; if (Array.isArray(cur)) { add(event, (cur.invoker = arrInvoker(cur)), once, capture); } else { if (!cur.invoker) { fn = cur; cur = on[name] = {}; cur.fn = fn; cur.invoker = fnInvoker(cur); } add(event, cur.invoker, once, capture); } } else if (cur !== old) { if (Array.isArray(old)) { old.length = cur.length; for (var i = 0; i < old.length; i++) { old[i] = cur[i]; } on[name] = old; } else { old.fn = cur; on[name] = old; } } } for (name in oldOn) { if (!on[name]) { once = name.charAt(0) === '~'; // Prefixed last, checked first event = once ? name.slice(1) : name; capture = event.charAt(0) === '!'; event = capture ? event.slice(1) : event; remove$$1(event, oldOn[name].invoker, capture); } } } function arrInvoker (arr) { return function (ev) { var arguments$1 = arguments; var single = arguments.length === 1; for (var i = 0; i < arr.length; i++) { single ? arr[i](ev) : arr[i].apply(null, arguments$1); } } } function fnInvoker (o) { return function (ev) { var single = arguments.length === 1; single ? o.fn(ev) : o.fn.apply(null, arguments); } } /* */ function normalizeChildren (children) { return isPrimitive(children) ? [createTextVNode(children)] : Array.isArray(children) ? normalizeArrayChildren(children) : undefined } function normalizeArrayChildren (children, nestedIndex) { var res = []; var i, c, last; for (i = 0; i < children.length; i++) { c = children[i]; if (c == null || typeof c === 'boolean') { continue } last = res[res.length - 1]; // nested if (Array.isArray(c)) { res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i))); } else if (isPrimitive(c)) { if (last && last.text) { last.text += String(c); } else if (c !== '') { // convert primitive to vnode res.push(createTextVNode(c)); } } else { if (c.text && last && last.text) { res[res.length - 1] = createTextVNode(last.text + c.text); } else { // default key for nested array children (likely generated by v-for) if (c.tag && c.key == null && nestedIndex != null) { c.key = "__vlist" + nestedIndex + "_" + i + "__"; } res.push(c); } } } return res } /* */ function getFirstComponentChild (children) { return children && children.filter(function (c) { return c && c.componentOptions; })[0] } /* */ // wrapper function for providing a more flexible interface // without getting yelled at by flow function createElement ( context, tag, data, children, needNormalization, alwaysNormalize ) { if (Array.isArray(data) || isPrimitive(data)) { needNormalization = children; children = data; data = undefined; } if (alwaysNormalize) { needNormalization = true; } return _createElement(context, tag, data, children, needNormalization) } function _createElement ( context, tag, data, children, needNormalization ) { if (data && data.__ob__) { process.env.NODE_ENV !== 'production' && warn( "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + 'Always create fresh vnode data objects in each render!', context ); return createEmptyVNode() } if (!tag) { // in case of component :is set to falsy value return createEmptyVNode() } // support single function children as default scoped slot if (Array.isArray(children) && typeof children[0] === 'function') { data = data || {}; data.scopedSlots = { default: children[0] }; children.length = 0; } if (needNormalization) { children = normalizeChildren(children); } var vnode, ns; if (typeof tag === 'string') { var Ctor; ns = config.getTagNamespace(tag); if (config.isReservedTag(tag)) { // platform built-in elements vnode = new VNode( config.parsePlatformTagName(tag), data, children, undefined, undefined, context ); } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) { // component vnode = createComponent(Ctor, data, context, children, tag); } else { // unknown or unlisted namespaced elements // check at runtime because it may get assigned a namespace when its // parent normalizes children ns = tag === 'foreignObject' ? 'xhtml' : ns; vnode = new VNode( tag, data, children, undefined, undefined, context ); } } else { // direct component options / constructor vnode = createComponent(tag, data, context, children); } if (vnode) { if (ns) { applyNS(vnode, ns); } return vnode } else { return createEmptyVNode() } } function applyNS (vnode, ns) { vnode.ns = ns; if (vnode.children) { for (var i = 0, l = vnode.children.length; i < l; i++) { var child = vnode.children[i]; if (child.tag && !child.ns) { applyNS(child, ns); } } } } /* */ function initRender (vm) { vm.$vnode = null; // the placeholder node in parent tree vm._vnode = null; // the root of the child tree vm._staticTrees = null; var parentVnode = vm.$options._parentVnode; var renderContext = parentVnode && parentVnode.context; vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext); vm.$scopedSlots = {}; // bind the createElement fn to this instance // so that we get proper render context inside it. // args order: tag, data, children, needNormalization, alwaysNormalize // internal version is used by render functions compiled from templates vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; // normalization is always applied for the public version, used in // user-written render functions. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; if (vm.$options.el) { vm.$mount(vm.$options.el); } } function renderMixin (Vue) { Vue.prototype.$nextTick = function (fn) { return nextTick(fn, this) }; Vue.prototype._render = function () { var vm = this; var ref = vm.$options; var render = ref.render; var staticRenderFns = ref.staticRenderFns; var _parentVnode = ref._parentVnode; if (vm._isMounted) { // clone slot nodes on re-renders for (var key in vm.$slots) { vm.$slots[key] = cloneVNodes(vm.$slots[key]); } } if (_parentVnode && _parentVnode.data.scopedSlots) { vm.$scopedSlots = _parentVnode.data.scopedSlots; } if (staticRenderFns && !vm._staticTrees) { vm._staticTrees = []; } // set parent vnode. this allows render functions to have access // to the data on the placeholder node. vm.$vnode = _parentVnode; // render self var vnode; try { vnode = render.call(vm._renderProxy, vm.$createElement); } catch (e) { /* istanbul ignore else */ if (config.errorHandler) { config.errorHandler.call(null, e, vm); } else { if (process.env.NODE_ENV !== 'production') { warn(("Error when rendering " + (formatComponentName(vm)) + ":")); } throw e } // return previous vnode to prevent render error causing blank component vnode = vm._vnode; } // return empty vnode in case the render function errored out if (!(vnode instanceof VNode)) { if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) { warn( 'Multiple root nodes returned from render function. Render function ' + 'should return a single root node.', vm ); } vnode = createEmptyVNode(); } // set parent vnode.parent = _parentVnode; return vnode }; // toString for mustaches Vue.prototype._s = _toString; // convert text to vnode Vue.prototype._v = createTextVNode; // number conversion Vue.prototype._n = toNumber; // empty vnode Vue.prototype._e = createEmptyVNode; // loose equal Vue.prototype._q = looseEqual; // loose indexOf Vue.prototype._i = looseIndexOf; // render static tree by index Vue.prototype._m = function renderStatic ( index, isInFor ) { var tree = this._staticTrees[index]; // if has already-rendered static tree and not inside v-for, // we can reuse the same tree by doing a shallow clone. if (tree && !isInFor) { return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree) } // otherwise, render a fresh tree. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy); markStatic(tree, ("__static__" + index), false); return tree }; // mark node as static (v-once) Vue.prototype._o = function markOnce ( tree, index, key ) { markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); return tree }; function markStatic (tree, key, isOnce) { if (Array.isArray(tree)) { for (var i = 0; i < tree.length; i++) { if (tree[i] && typeof tree[i] !== 'string') { markStaticNode(tree[i], (key + "_" + i), isOnce); } } } else { markStaticNode(tree, key, isOnce); } } function markStaticNode (node, key, isOnce) { node.isStatic = true; node.key = key; node.isOnce = isOnce; } // filter resolution helper Vue.prototype._f = function resolveFilter (id) { return resolveAsset(this.$options, 'filters', id, true) || identity }; // render v-for Vue.prototype._l = function renderList ( val, render ) { var ret, i, l, keys, key; if (Array.isArray(val)) { ret = new Array(val.length); for (i = 0, l = val.length; i < l; i++) { ret[i] = render(val[i], i); } } else if (typeof val === 'number') { ret = new Array(val); for (i = 0; i < val; i++) { ret[i] = render(i + 1, i); } } else if (isObject(val)) { keys = Object.keys(val); ret = new Array(keys.length); for (i = 0, l = keys.length; i < l; i++) { key = keys[i]; ret[i] = render(val[key], key, i); } } return ret }; // renderSlot Vue.prototype._t = function ( name, fallback, props ) { var scopedSlotFn = this.$scopedSlots[name]; if (scopedSlotFn) { // scoped slot return scopedSlotFn(props || {}) || fallback } else { var slotNodes = this.$slots[name]; // warn duplicate slot usage if (slotNodes && process.env.NODE_ENV !== 'production') { slotNodes._rendered && warn( "Duplicate presence of slot \"" + name + "\" found in the same render tree " + "- this will likely cause render errors.", this ); slotNodes._rendered = true; } return slotNodes || fallback } }; // apply v-bind object Vue.prototype._b = function bindProps ( data, tag, value, asProp ) { if (value) { if (!isObject(value)) { process.env.NODE_ENV !== 'production' && warn( 'v-bind without argument expects an Object or Array value', this ); } else { if (Array.isArray(value)) { value = toObject(value); } for (var key in value) { if (key === 'class' || key === 'style') { data[key] = value[key]; } else { var hash = asProp || config.mustUseProp(tag, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {}); hash[key] = value[key]; } } } } return data }; // check v-on keyCodes Vue.prototype._k = function checkKeyCodes ( eventKeyCode, key, builtInAlias ) { var keyCodes = config.keyCodes[key] || builtInAlias; if (Array.isArray(keyCodes)) { return keyCodes.indexOf(eventKeyCode) === -1 } else { return keyCodes !== eventKeyCode } }; } function resolveSlots ( children, context ) { var slots = {}; if (!children) { return slots } var defaultSlot = []; var name, child; for (var i = 0, l = children.length; i < l; i++) { child = children[i]; // named slots should only be respected if the vnode was rendered in the // same context. if ((child.context === context || child.functionalContext === context) && child.data && (name = child.data.slot)) { var slot = (slots[name] || (slots[name] = [])); if (child.tag === 'template') { slot.push.apply(slot, child.children); } else { slot.push(child); } } else { defaultSlot.push(child); } } // ignore single whitespace if (defaultSlot.length && !( defaultSlot.length === 1 && (defaultSlot[0].text === ' ' || defaultSlot[0].isComment) )) { slots.default = defaultSlot; } return slots } /* */ function initEvents (vm) { vm._events = Object.create(null); // init parent attached events var listeners = vm.$options._parentListeners; var add = function (event, fn, once) { once ? vm.$once(event, fn) : vm.$on(event, fn); }; var remove$$1 = bind$1(vm.$off, vm); vm._updateListeners = function (listeners, oldListeners) { updateListeners(listeners, oldListeners || {}, add, remove$$1, vm); }; if (listeners) { vm._updateListeners(listeners); } } function eventsMixin (Vue) { Vue.prototype.$on = function (event, fn) { var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn); return vm }; Vue.prototype.$once = function (event, fn) { var vm = this; function on () { vm.$off(event, on); fn.apply(vm, arguments); } on.fn = fn; vm.$on(event, on); return vm }; Vue.prototype.$off = function (event, fn) { var vm = this; // all if (!arguments.length) { vm._events = Object.create(null); return vm } // specific event var cbs = vm._events[event]; if (!cbs) { return vm } if (arguments.length === 1) { vm._events[event] = null; return vm } // specific handler var cb; var i = cbs.length; while (i--) { cb = cbs[i]; if (cb === fn || cb.fn === fn) { cbs.splice(i, 1); break } } return vm }; Vue.prototype.$emit = function (event) { var vm = this; var cbs = vm._events[event]; if (cbs) { cbs = cbs.length > 1 ? toArray(cbs) : cbs; var args = toArray(arguments, 1); for (var i = 0, l = cbs.length; i < l; i++) { cbs[i].apply(vm, args); } } return vm }; } /* */ var uid = 0; function initMixin (Vue) { Vue.prototype._init = function (options) { var vm = this; // a uid vm._uid = uid++; // a flag to avoid this being observed vm._isVue = true; // merge options if (options && options._isComponent) { // optimize internal component instantiation // since dynamic options merging is pretty slow, and none of the // internal component options needs special treatment. initInternalComponent(vm, options); } else { vm.$options = mergeOptions( resolveConstructorOptions(vm.constructor), options || {}, vm ); } /* istanbul ignore else */ if (process.env.NODE_ENV !== 'production') { initProxy(vm); } else { vm._renderProxy = vm; } // expose real self vm._self = vm; initLifecycle(vm); initEvents(vm); callHook(vm, 'beforeCreate'); initState(vm); callHook(vm, 'created'); initRender(vm); }; } function initInternalComponent (vm, options) { var opts = vm.$options = Object.create(vm.constructor.options); // doing this because it's faster than dynamic enumeration. opts.parent = options.parent; opts.propsData = options.propsData; opts._parentVnode = options._parentVnode; opts._parentListeners = options._parentListeners; opts._renderChildren = options._renderChildren; opts._componentTag = options._componentTag; opts._parentElm = options._parentElm; opts._refElm = options._refElm; if (options.render) { opts.render = options.render; opts.staticRenderFns = options.staticRenderFns; } } function resolveConstructorOptions (Ctor) { var options = Ctor.options; if (Ctor.super) { var superOptions = Ctor.super.options; var cachedSuperOptions = Ctor.superOptions; var extendOptions = Ctor.extendOptions; if (superOptions !== cachedSuperOptions) { // super option changed Ctor.superOptions = superOptions; extendOptions.render = options.render; extendOptions.staticRenderFns = options.staticRenderFns; extendOptions._scopeId = options._scopeId; options = Ctor.options = mergeOptions(superOptions, extendOptions); if (options.name) { options.components[options.name] = Ctor; } } } return options } function Vue$2 (options) { if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue$2)) { warn('Vue is a constructor and should be called with the `new` keyword'); } this._init(options); } initMixin(Vue$2); stateMixin(Vue$2); eventsMixin(Vue$2); lifecycleMixin(Vue$2); renderMixin(Vue$2); /* */ function initUse (Vue) { Vue.use = function (plugin) { /* istanbul ignore if */ if (plugin.installed) { return } // additional parameters var args = toArray(arguments, 1); args.unshift(this); if (typeof plugin.install === 'function') { plugin.install.apply(plugin, args); } else { plugin.apply(null, args); } plugin.installed = true; return this }; } /* */ function initMixin$1 (Vue) { Vue.mixin = function (mixin) { this.options = mergeOptions(this.options, mixin); }; } /* */ function initExtend (Vue) { /** * Each instance constructor, including Vue, has a unique * cid. This enables us to create wrapped "child * constructors" for prototypal inheritance and cache them. */ Vue.cid = 0; var cid = 1; /** * Class inheritance */ Vue.extend = function (extendOptions) { extendOptions = extendOptions || {}; var Super = this; var SuperId = Super.cid; var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); if (cachedCtors[SuperId]) { return cachedCtors[SuperId] } var name = extendOptions.name || Super.options.name; if (process.env.NODE_ENV !== 'production') { if (!/^[a-zA-Z][\w-]*$/.test(name)) { warn( 'Invalid component name: "' + name + '". Component names ' + 'can only contain alphanumeric characters and the hyphen, ' + 'and must start with a letter.' ); } } var Sub = function VueComponent (options) { this._init(options); }; Sub.prototype = Object.create(Super.prototype); Sub.prototype.constructor = Sub; Sub.cid = cid++; Sub.options = mergeOptions( Super.options, extendOptions ); Sub['super'] = Super; // allow further extension/mixin/plugin usage Sub.extend = Super.extend; Sub.mixin = Super.mixin; Sub.use = Super.use; // create asset registers, so extended classes // can have their private assets too. config._assetTypes.forEach(function (type) { Sub[type] = Super[type]; }); // enable recursive self-lookup if (name) { Sub.options.components[name] = Sub; } // keep a reference to the super options at extension time. // later at instantiation we can check if Super's options have // been updated. Sub.superOptions = Super.options; Sub.extendOptions = extendOptions; // cache constructor cachedCtors[SuperId] = Sub; return Sub }; } /* */ function initAssetRegisters (Vue) { /** * Create asset registration methods. */ config._assetTypes.forEach(function (type) { Vue[type] = function ( id, definition ) { if (!definition) { return this.options[type + 's'][id] } else { /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production') { if (type === 'component' && config.isReservedTag(id)) { warn( 'Do not use built-in or reserved HTML elements as component ' + 'id: ' + id ); } } if (type === 'component' && isPlainObject(definition)) { definition.name = definition.name || id; definition = this.options._base.extend(definition); } if (type === 'directive' && typeof definition === 'function') { definition = { bind: definition, update: definition }; } this.options[type + 's'][id] = definition; return definition } }; }); } /* */ var patternTypes = [String, RegExp]; function matches (pattern, name) { if (typeof pattern === 'string') { return pattern.split(',').indexOf(name) > -1 } else { return pattern.test(name) } } var KeepAlive = { name: 'keep-alive', abstract: true, props: { include: patternTypes, exclude: patternTypes }, created: function created () { this.cache = Object.create(null); }, render: function render () { var vnode = getFirstComponentChild(this.$slots.default); if (vnode && vnode.componentOptions) { var opts = vnode.componentOptions; // check pattern var name = opts.Ctor.options.name || opts.tag; if (name && ( (this.include && !matches(this.include, name)) || (this.exclude && matches(this.exclude, name)) )) { return vnode } var key = vnode.key == null // same constructor may get registered as different local components // so cid alone is not enough (#3269) ? opts.Ctor.cid + (opts.tag ? ("::" + (opts.tag)) : '') : vnode.key; if (this.cache[key]) { vnode.child = this.cache[key].child; } else { this.cache[key] = vnode; } vnode.data.keepAlive = true; } return vnode }, destroyed: function destroyed () { var this$1 = this; for (var key in this.cache) { var vnode = this$1.cache[key]; callHook(vnode.child, 'deactivated'); vnode.child.$destroy(); } } }; var builtInComponents = { KeepAlive: KeepAlive }; /* */ function initGlobalAPI (Vue) { // config var configDef = {}; configDef.get = function () { return config; }; if (process.env.NODE_ENV !== 'production') { configDef.set = function () { warn( 'Do not replace the Vue.config object, set individual fields instead.' ); }; } Object.defineProperty(Vue, 'config', configDef); Vue.util = util; Vue.set = set$1; Vue.delete = del; Vue.nextTick = nextTick; Vue.options = Object.create(null); config._assetTypes.forEach(function (type) { Vue.options[type + 's'] = Object.create(null); }); // this is used to identify the "base" constructor to extend all plain-object // components with in Weex's multi-instance scenarios. Vue.options._base = Vue; extend(Vue.options.components, builtInComponents); initUse(Vue); initMixin$1(Vue); initExtend(Vue); initAssetRegisters(Vue); } initGlobalAPI(Vue$2); Object.defineProperty(Vue$2.prototype, '$isServer', { get: isServerRendering }); Vue$2.version = '2.1.6'; /* */ // attributes that should be using props for binding var acceptValue = makeMap('input,textarea,option,select'); var mustUseProp = function (tag, attr) { return ( (attr === 'value' && acceptValue(tag)) || (attr === 'selected' && tag === 'option') || (attr === 'checked' && tag === 'input') || (attr === 'muted' && tag === 'video') ) }; var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); var isBooleanAttr = makeMap( 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 'required,reversed,scoped,seamless,selected,sortable,translate,' + 'truespeed,typemustmatch,visible' ); var xlinkNS = 'http://www.w3.org/1999/xlink'; var isXlink = function (name) { return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' }; var getXlinkProp = function (name) { return isXlink(name) ? name.slice(6, name.length) : '' }; var isFalsyAttrValue = function (val) { return val == null || val === false }; /* */ function genClassForVnode (vnode) { var data = vnode.data; var parentNode = vnode; var childNode = vnode; while (childNode.child) { childNode = childNode.child._vnode; if (childNode.data) { data = mergeClassData(childNode.data, data); } } while ((parentNode = parentNode.parent)) { if (parentNode.data) { data = mergeClassData(data, parentNode.data); } } return genClassFromData(data) } function mergeClassData (child, parent) { return { staticClass: concat(child.staticClass, parent.staticClass), class: child.class ? [child.class, parent.class] : parent.class } } function genClassFromData (data) { var dynamicClass = data.class; var staticClass = data.staticClass; if (staticClass || dynamicClass) { return concat(staticClass, stringifyClass(dynamicClass)) } /* istanbul ignore next */ return '' } function concat (a, b) { return a ? b ? (a + ' ' + b) : a : (b || '') } function stringifyClass (value) { var res = ''; if (!value) { return res } if (typeof value === 'string') { return value } if (Array.isArray(value)) { var stringified; for (var i = 0, l = value.length; i < l; i++) { if (value[i]) { if ((stringified = stringifyClass(value[i]))) { res += stringified + ' '; } } } return res.slice(0, -1) } if (isObject(value)) { for (var key in value) { if (value[key]) { res += key + ' '; } } return res.slice(0, -1) } /* istanbul ignore next */ return res } /* */ var namespaceMap = { svg: 'http://www.w3.org/2000/svg', math: 'http://www.w3.org/1998/Math/MathML', xhtml: 'http://www.w3.org/1999/xhtml' }; var isHTMLTag = makeMap( 'html,body,base,head,link,meta,style,title,' + 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' + 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 'embed,object,param,source,canvas,script,noscript,del,ins,' + 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 'output,progress,select,textarea,' + 'details,dialog,menu,menuitem,summary,' + 'content,element,shadow,template' ); // this map is intentionally selective, only covering SVG elements that may // contain child elements. var isSVG = makeMap( 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,' + 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true ); var isReservedTag = function (tag) { return isHTMLTag(tag) || isSVG(tag) }; function getTagNamespace (tag) { if (isSVG(tag)) { return 'svg' } // basic support for MathML // note it doesn't support other MathML elements being component roots if (tag === 'math') { return 'math' } } var unknownElementCache = Object.create(null); function isUnknownElement (tag) { /* istanbul ignore if */ if (!inBrowser) { return true } if (isReservedTag(tag)) { return false } tag = tag.toLowerCase(); /* istanbul ignore if */ if (unknownElementCache[tag] != null) { return unknownElementCache[tag] } var el = document.createElement(tag); if (tag.indexOf('-') > -1) { // http://stackoverflow.com/a/28210364/1070244 return (unknownElementCache[tag] = ( el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement )) } else { return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) } } /* */ /** * Query an element selector if it's not an element already. */ function query (el) { if (typeof el === 'string') { var selector = el; el = document.querySelector(el); if (!el) { process.env.NODE_ENV !== 'production' && warn( 'Cannot find element: ' + selector ); return document.createElement('div') } } return el } /* */ function createElement$1 (tagName, vnode) { var elm = document.createElement(tagName); if (tagName !== 'select') { return elm } if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) { elm.setAttribute('multiple', 'multiple'); } return elm } function createElementNS (namespace, tagName) { return document.createElementNS(namespaceMap[namespace], tagName) } function createTextNode (text) { return document.createTextNode(text) } function createComment (text) { return document.createComment(text) } function insertBefore (parentNode, newNode, referenceNode) { parentNode.insertBefore(newNode, referenceNode); } function removeChild (node, child) { node.removeChild(child); } function appendChild (node, child) { node.appendChild(child); } function parentNode (node) { return node.parentNode } function nextSibling (node) { return node.nextSibling } function tagName (node) { return node.tagName } function setTextContent (node, text) { node.textContent = text; } function setAttribute (node, key, val) { node.setAttribute(key, val); } var nodeOps = Object.freeze({ createElement: createElement$1, createElementNS: createElementNS, createTextNode: createTextNode, createComment: createComment, insertBefore: insertBefore, removeChild: removeChild, appendChild: appendChild, parentNode: parentNode, nextSibling: nextSibling, tagName: tagName, setTextContent: setTextContent, setAttribute: setAttribute }); /* */ var ref = { create: function create (_, vnode) { registerRef(vnode); }, update: function update (oldVnode, vnode) { if (oldVnode.data.ref !== vnode.data.ref) { registerRef(oldVnode, true); registerRef(vnode); } }, destroy: function destroy (vnode) { registerRef(vnode, true); } }; function registerRef (vnode, isRemoval) { var key = vnode.data.ref; if (!key) { return } var vm = vnode.context; var ref = vnode.child || vnode.elm; var refs = vm.$refs; if (isRemoval) { if (Array.isArray(refs[key])) { remove$1(refs[key], ref); } else if (refs[key] === ref) { refs[key] = undefined; } } else { if (vnode.data.refInFor) { if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) { refs[key].push(ref); } else { refs[key] = [ref]; } } else { refs[key] = ref; } } } /** * Virtual DOM patching algorithm based on Snabbdom by * Simon Friis Vindum (@paldepind) * Licensed under the MIT License * https://github.com/paldepind/snabbdom/blob/master/LICENSE * * modified by Evan You (@yyx990803) * /* * Not type-checking this because this file is perf-critical and the cost * of making flow understand it is not worth it. */ var emptyNode = new VNode('', {}, []); var hooks$1 = ['create', 'activate', 'update', 'remove', 'destroy']; function isUndef (s) { return s == null } function isDef (s) { return s != null } function sameVnode (vnode1, vnode2) { return ( vnode1.key === vnode2.key && vnode1.tag === vnode2.tag && vnode1.isComment === vnode2.isComment && !vnode1.data === !vnode2.data ) } function createKeyToOldIdx (children, beginIdx, endIdx) { var i, key; var map = {}; for (i = beginIdx; i <= endIdx; ++i) { key = children[i].key; if (isDef(key)) { map[key] = i; } } return map } function createPatchFunction (backend) { var i, j; var cbs = {}; var modules = backend.modules; var nodeOps = backend.nodeOps; for (i = 0; i < hooks$1.length; ++i) { cbs[hooks$1[i]] = []; for (j = 0; j < modules.length; ++j) { if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); } } } function emptyNodeAt (elm) { return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) } function createRmCb (childElm, listeners) { function remove$$1 () { if (--remove$$1.listeners === 0) { removeElement(childElm); } } remove$$1.listeners = listeners; return remove$$1 } function removeElement (el) { var parent = nodeOps.parentNode(el); // element may have already been removed due to v-html if (parent) { nodeOps.removeChild(parent, el); } } var inPre = 0; function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) { vnode.isRootInsert = !nested; // for transition enter check if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { return } var data = vnode.data; var children = vnode.children; var tag = vnode.tag; if (isDef(tag)) { if (process.env.NODE_ENV !== 'production') { if (data && data.pre) { inPre++; } if ( !inPre && !vnode.ns && !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) && config.isUnknownElement(tag) ) { warn( 'Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly? For recursive components, ' + 'make sure to provide the "name" option.', vnode.context ); } } vnode.elm = vnode.ns ? nodeOps.createElementNS(vnode.ns, tag) : nodeOps.createElement(tag, vnode); setScope(vnode); /* istanbul ignore if */ { createChildren(vnode, children, insertedVnodeQueue); if (isDef(data)) { invokeCreateHooks(vnode, insertedVnodeQueue); } insert(parentElm, vnode.elm, refElm); } if (process.env.NODE_ENV !== 'production' && data && data.pre) { inPre--; } } else if (vnode.isComment) { vnode.elm = nodeOps.createComment(vnode.text); insert(parentElm, vnode.elm, refElm); } else { vnode.elm = nodeOps.createTextNode(vnode.text); insert(parentElm, vnode.elm, refElm); } } function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { var i = vnode.data; if (isDef(i)) { var isReactivated = isDef(vnode.child) && i.keepAlive; if (isDef(i = i.hook) && isDef(i = i.init)) { i(vnode, false /* hydrating */, parentElm, refElm); } // after calling the init hook, if the vnode is a child component // it should've created a child instance and mounted it. the child // component also has set the placeholder vnode's elm. // in that case we can just return the element and be done. if (isDef(vnode.child)) { initComponent(vnode, insertedVnodeQueue); if (isReactivated) { reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); } return true } } } function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { var i; // hack for #4339: a reactivated component with inner transition // does not trigger because the inner node's created hooks are not called // again. It's not ideal to involve module-specific logic in here but // there doesn't seem to be a better way to do it. var innerNode = vnode; while (innerNode.child) { innerNode = innerNode.child._vnode; if (isDef(i = innerNode.data) && isDef(i = i.transition)) { for (i = 0; i < cbs.activate.length; ++i) { cbs.activate[i](emptyNode, innerNode); } insertedVnodeQueue.push(innerNode); break } } // unlike a newly created component, // a reactivated keep-alive component doesn't insert itself insert(parentElm, vnode.elm, refElm); } function insert (parent, elm, ref) { if (parent) { if (ref) { nodeOps.insertBefore(parent, elm, ref); } else { nodeOps.appendChild(parent, elm); } } } function createChildren (vnode, children, insertedVnodeQueue) { if (Array.isArray(children)) { for (var i = 0; i < children.length; ++i) { createElm(children[i], insertedVnodeQueue, vnode.elm, null, true); } } else if (isPrimitive(vnode.text)) { nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text)); } } function isPatchable (vnode) { while (vnode.child) { vnode = vnode.child._vnode; } return isDef(vnode.tag) } function invokeCreateHooks (vnode, insertedVnodeQueue) { for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { cbs.create[i$1](emptyNode, vnode); } i = vnode.data.hook; // Reuse variable if (isDef(i)) { if (i.create) { i.create(emptyNode, vnode); } if (i.insert) { insertedVnodeQueue.push(vnode); } } } function initComponent (vnode, insertedVnodeQueue) { if (vnode.data.pendingInsert) { insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); } vnode.elm = vnode.child.$el; if (isPatchable(vnode)) { invokeCreateHooks(vnode, insertedVnodeQueue); setScope(vnode); } else { // empty component root. // skip all element-related modules except for ref (#3455) registerRef(vnode); // make sure to invoke the insert hook insertedVnodeQueue.push(vnode); } } // set scope id attribute for scoped CSS. // this is implemented as a special case to avoid the overhead // of going through the normal attribute patching process. function setScope (vnode) { var i; if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) { nodeOps.setAttribute(vnode.elm, i, ''); } if (isDef(i = activeInstance) && i !== vnode.context && isDef(i = i.$options._scopeId)) { nodeOps.setAttribute(vnode.elm, i, ''); } } function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { for (; startIdx <= endIdx; ++startIdx) { createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm); } } function invokeDestroyHook (vnode) { var i, j; var data = vnode.data; if (isDef(data)) { if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } } if (isDef(i = vnode.children)) { for (j = 0; j < vnode.children.length; ++j) { invokeDestroyHook(vnode.children[j]); } } } function removeVnodes (parentElm, vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { var ch = vnodes[startIdx]; if (isDef(ch)) { if (isDef(ch.tag)) { removeAndInvokeRemoveHook(ch); invokeDestroyHook(ch); } else { // Text node nodeOps.removeChild(parentElm, ch.elm); } } } } function removeAndInvokeRemoveHook (vnode, rm) { if (rm || isDef(vnode.data)) { var listeners = cbs.remove.length + 1; if (!rm) { // directly removing rm = createRmCb(vnode.elm, listeners); } else { // we have a recursively passed down rm callback // increase the listeners count rm.listeners += listeners; } // recursively invoke hooks on child component root node if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) { removeAndInvokeRemoveHook(i, rm); } for (i = 0; i < cbs.remove.length; ++i) { cbs.remove[i](vnode, rm); } if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { i(vnode, rm); } else { rm(); } } else { removeElement(vnode.elm); } } function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { var oldStartIdx = 0; var newStartIdx = 0; var oldEndIdx = oldCh.length - 1; var oldStartVnode = oldCh[0]; var oldEndVnode = oldCh[oldEndIdx]; var newEndIdx = newCh.length - 1; var newStartVnode = newCh[0]; var newEndVnode = newCh[newEndIdx]; var oldKeyToIdx, idxInOld, elmToMove, refElm; // removeOnly is a special flag used only by <transition-group> // to ensure removed elements stay in correct relative positions // during leaving transitions var canMove = !removeOnly; while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { if (isUndef(oldStartVnode)) { oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left } else if (isUndef(oldEndVnode)) { oldEndVnode = oldCh[--oldEndIdx]; } else if (sameVnode(oldStartVnode, newStartVnode)) { patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue); oldStartVnode = oldCh[++oldStartIdx]; newStartVnode = newCh[++newStartIdx]; } else if (sameVnode(oldEndVnode, newEndVnode)) { patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue); oldEndVnode = oldCh[--oldEndIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue); canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); oldStartVnode = oldCh[++oldStartIdx]; newEndVnode = newCh[--newEndIdx]; } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue); canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); oldEndVnode = oldCh[--oldEndIdx]; newStartVnode = newCh[++newStartIdx]; } else { if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null; if (isUndef(idxInOld)) { // New element createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm); newStartVnode = newCh[++newStartIdx]; } else { elmToMove = oldCh[idxInOld]; /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && !elmToMove) { warn( 'It seems there are duplicate keys that is causing an update error. ' + 'Make sure each v-for item has a unique key.' ); } if (sameVnode(elmToMove, newStartVnode)) { patchVnode(elmToMove, newStartVnode, insertedVnodeQueue); oldCh[idxInOld] = undefined; canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm); newStartVnode = newCh[++newStartIdx]; } else { // same key but different element. treat as new element createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm); newStartVnode = newCh[++newStartIdx]; } } } } if (oldStartIdx > oldEndIdx) { refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); } else if (newStartIdx > newEndIdx) { removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); } } function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) { if (oldVnode === vnode) { return } // reuse element for static trees. // note we only do this if the vnode is cloned - // if the new node is not cloned it means the render functions have been // reset by the hot-reload-api and we need to do a proper re-render. if (vnode.isStatic && oldVnode.isStatic && vnode.key === oldVnode.key && (vnode.isCloned || vnode.isOnce)) { vnode.elm = oldVnode.elm; vnode.child = oldVnode.child; return } var i; var data = vnode.data; var hasData = isDef(data); if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) { i(oldVnode, vnode); } var elm = vnode.elm = oldVnode.elm; var oldCh = oldVnode.children; var ch = vnode.children; if (hasData && isPatchable(vnode)) { for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } } if (isUndef(vnode.text)) { if (isDef(oldCh) && isDef(ch)) { if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } } else if (isDef(ch)) { if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); } else if (isDef(oldCh)) { removeVnodes(elm, oldCh, 0, oldCh.length - 1); } else if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } } else if (oldVnode.text !== vnode.text) { nodeOps.setTextContent(elm, vnode.text); } if (hasData) { if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } } } function invokeInsertHook (vnode, queue, initial) { // delay insert hooks for component root nodes, invoke them after the // element is really inserted if (initial && vnode.parent) { vnode.parent.data.pendingInsert = queue; } else { for (var i = 0; i < queue.length; ++i) { queue[i].data.hook.insert(queue[i]); } } } var bailed = false; // list of modules that can skip create hook during hydration because they // are already rendered on the client or has no need for initialization var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key'); // Note: this is a browser-only function so we can assume elms are DOM nodes. function hydrate (elm, vnode, insertedVnodeQueue) { if (process.env.NODE_ENV !== 'production') { if (!assertNodeMatch(elm, vnode)) { return false } } vnode.elm = elm; var tag = vnode.tag; var data = vnode.data; var children = vnode.children; if (isDef(data)) { if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } if (isDef(i = vnode.child)) { // child component. it should have hydrated its own tree. initComponent(vnode, insertedVnodeQueue); return true } } if (isDef(tag)) { if (isDef(children)) { // empty element, allow client to pick up and populate children if (!elm.hasChildNodes()) { createChildren(vnode, children, insertedVnodeQueue); } else { var childrenMatch = true; var childNode = elm.firstChild; for (var i$1 = 0; i$1 < children.length; i$1++) { if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) { childrenMatch = false; break } childNode = childNode.nextSibling; } // if childNode is not null, it means the actual childNodes list is // longer than the virtual children list. if (!childrenMatch || childNode) { if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined' && !bailed) { bailed = true; console.warn('Parent: ', elm); console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); } return false } } } if (isDef(data)) { for (var key in data) { if (!isRenderedModule(key)) { invokeCreateHooks(vnode, insertedVnodeQueue); break } } } } return true } function assertNodeMatch (node, vnode) { if (vnode.tag) { return ( vnode.tag.indexOf('vue-component') === 0 || vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) ) } else { return _toString(vnode.text) === node.data } } return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) { if (!vnode) { if (oldVnode) { invokeDestroyHook(oldVnode); } return } var elm, parent; var isInitialPatch = false; var insertedVnodeQueue = []; if (!oldVnode) { // empty mount (likely as component), create new root element isInitialPatch = true; createElm(vnode, insertedVnodeQueue, parentElm, refElm); } else { var isRealElement = isDef(oldVnode.nodeType); if (!isRealElement && sameVnode(oldVnode, vnode)) { // patch existing root node patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly); } else { if (isRealElement) { // mounting to a real element // check if this is server-rendered content and if we can perform // a successful hydration. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) { oldVnode.removeAttribute('server-rendered'); hydrating = true; } if (hydrating) { if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { invokeInsertHook(vnode, insertedVnodeQueue, true); return oldVnode } else if (process.env.NODE_ENV !== 'production') { warn( 'The client-side rendered virtual DOM tree is not matching ' + 'server-rendered content. This is likely caused by incorrect ' + 'HTML markup, for example nesting block-level elements inside ' + '<p>, or missing <tbody>. Bailing hydration and performing ' + 'full client-side render.' ); } } // either not server-rendered, or hydration failed. // create an empty node and replace it oldVnode = emptyNodeAt(oldVnode); } // replacing existing element elm = oldVnode.elm; parent = nodeOps.parentNode(elm); createElm(vnode, insertedVnodeQueue, parent, nodeOps.nextSibling(elm)); if (vnode.parent) { // component root element replaced. // update parent placeholder node element, recursively var ancestor = vnode.parent; while (ancestor) { ancestor.elm = vnode.elm; ancestor = ancestor.parent; } if (isPatchable(vnode)) { for (var i = 0; i < cbs.create.length; ++i) { cbs.create[i](emptyNode, vnode.parent); } } } if (parent !== null) { removeVnodes(parent, [oldVnode], 0, 0); } else if (isDef(oldVnode.tag)) { invokeDestroyHook(oldVnode); } } } invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); return vnode.elm } } /* */ var directives = { create: updateDirectives, update: updateDirectives, destroy: function unbindDirectives (vnode) { updateDirectives(vnode, emptyNode); } }; function updateDirectives (oldVnode, vnode) { if (oldVnode.data.directives || vnode.data.directives) { _update(oldVnode, vnode); } } function _update (oldVnode, vnode) { var isCreate = oldVnode === emptyNode; var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); var dirsWithInsert = []; var dirsWithPostpatch = []; var key, oldDir, dir; for (key in newDirs) { oldDir = oldDirs[key]; dir = newDirs[key]; if (!oldDir) { // new directive, bind callHook$1(dir, 'bind', vnode, oldVnode); if (dir.def && dir.def.inserted) { dirsWithInsert.push(dir); } } else { // existing directive, update dir.oldValue = oldDir.value; callHook$1(dir, 'update', vnode, oldVnode); if (dir.def && dir.def.componentUpdated) { dirsWithPostpatch.push(dir); } } } if (dirsWithInsert.length) { var callInsert = function () { for (var i = 0; i < dirsWithInsert.length; i++) { callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); } }; if (isCreate) { mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert'); } else { callInsert(); } } if (dirsWithPostpatch.length) { mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () { for (var i = 0; i < dirsWithPostpatch.length; i++) { callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); } }, 'dir-postpatch'); } if (!isCreate) { for (key in oldDirs) { if (!newDirs[key]) { // no longer present, unbind callHook$1(oldDirs[key], 'unbind', oldVnode); } } } } var emptyModifiers = Object.create(null); function normalizeDirectives$1 ( dirs, vm ) { var res = Object.create(null); if (!dirs) { return res } var i, dir; for (i = 0; i < dirs.length; i++) { dir = dirs[i]; if (!dir.modifiers) { dir.modifiers = emptyModifiers; } res[getRawDirName(dir)] = dir; dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); } return res } function getRawDirName (dir) { return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) } function callHook$1 (dir, hook, vnode, oldVnode) { var fn = dir.def && dir.def[hook]; if (fn) { fn(vnode.elm, dir, vnode, oldVnode); } } var baseModules = [ ref, directives ]; /* */ function updateAttrs (oldVnode, vnode) { if (!oldVnode.data.attrs && !vnode.data.attrs) { return } var key, cur, old; var elm = vnode.elm; var oldAttrs = oldVnode.data.attrs || {}; var attrs = vnode.data.attrs || {}; // clone observed objects, as the user probably wants to mutate it if (attrs.__ob__) { attrs = vnode.data.attrs = extend({}, attrs); } for (key in attrs) { cur = attrs[key]; old = oldAttrs[key]; if (old !== cur) { setAttr(elm, key, cur); } } // #4391: in IE9, setting type can reset value for input[type=radio] /* istanbul ignore if */ if (isIE9 && attrs.value !== oldAttrs.value) { setAttr(elm, 'value', attrs.value); } for (key in oldAttrs) { if (attrs[key] == null) { if (isXlink(key)) { elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); } else if (!isEnumeratedAttr(key)) { elm.removeAttribute(key); } } } } function setAttr (el, key, value) { if (isBooleanAttr(key)) { // set attribute for blank value // e.g. <option disabled>Select one</option> if (isFalsyAttrValue(value)) { el.removeAttribute(key); } else { el.setAttribute(key, key); } } else if (isEnumeratedAttr(key)) { el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true'); } else if (isXlink(key)) { if (isFalsyAttrValue(value)) { el.removeAttributeNS(xlinkNS, getXlinkProp(key)); } else { el.setAttributeNS(xlinkNS, key, value); } } else { if (isFalsyAttrValue(value)) { el.removeAttribute(key); } else { el.setAttribute(key, value); } } } var attrs = { create: updateAttrs, update: updateAttrs }; /* */ function updateClass (oldVnode, vnode) { var el = vnode.elm; var data = vnode.data; var oldData = oldVnode.data; if (!data.staticClass && !data.class && (!oldData || (!oldData.staticClass && !oldData.class))) { return } var cls = genClassForVnode(vnode); // handle transition classes var transitionClass = el._transitionClasses; if (transitionClass) { cls = concat(cls, stringifyClass(transitionClass)); } // set the class if (cls !== el._prevClass) { el.setAttribute('class', cls); el._prevClass = cls; } } var klass = { create: updateClass, update: updateClass }; /* */ var target; function add$1 (event, handler, once, capture) { if (once) { var oldHandler = handler; handler = function (ev) { remove$2(event, handler, capture); arguments.length === 1 ? oldHandler(ev) : oldHandler.apply(null, arguments); }; } target.addEventListener(event, handler, capture); } function remove$2 (event, handler, capture) { target.removeEventListener(event, handler, capture); } function updateDOMListeners (oldVnode, vnode) { if (!oldVnode.data.on && !vnode.data.on) { return } var on = vnode.data.on || {}; var oldOn = oldVnode.data.on || {}; target = vnode.elm; updateListeners(on, oldOn, add$1, remove$2, vnode.context); } var events = { create: updateDOMListeners, update: updateDOMListeners }; /* */ function updateDOMProps (oldVnode, vnode) { if (!oldVnode.data.domProps && !vnode.data.domProps) { return } var key, cur; var elm = vnode.elm; var oldProps = oldVnode.data.domProps || {}; var props = vnode.data.domProps || {}; // clone observed objects, as the user probably wants to mutate it if (props.__ob__) { props = vnode.data.domProps = extend({}, props); } for (key in oldProps) { if (props[key] == null) { elm[key] = ''; } } for (key in props) { cur = props[key]; // ignore children if the node has textContent or innerHTML, // as these will throw away existing DOM nodes and cause removal errors // on subsequent patches (#3360) if (key === 'textContent' || key === 'innerHTML') { if (vnode.children) { vnode.children.length = 0; } if (cur === oldProps[key]) { continue } } if (key === 'value') { // store value as _value as well since // non-string values will be stringified elm._value = cur; // avoid resetting cursor position when value is the same var strCur = cur == null ? '' : String(cur); if (!elm.composing && ( (document.activeElement !== elm && elm.value !== strCur) || isValueChanged(vnode, strCur) )) { elm.value = strCur; } } else { elm[key] = cur; } } } function isValueChanged (vnode, newVal) { var value = vnode.elm.value; var modifiers = vnode.elm._vModifiers; // injected by v-model runtime if ((modifiers && modifiers.number) || vnode.elm.type === 'number') { return toNumber(value) !== toNumber(newVal) } if (modifiers && modifiers.trim) { return value.trim() !== newVal.trim() } return value !== newVal } var domProps = { create: updateDOMProps, update: updateDOMProps }; /* */ var parseStyleText = cached(function (cssText) { var res = {}; var listDelimiter = /;(?![^(]*\))/g; var propertyDelimiter = /:(.+)/; cssText.split(listDelimiter).forEach(function (item) { if (item) { var tmp = item.split(propertyDelimiter); tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); } }); return res }); // merge static and dynamic style data on the same vnode function normalizeStyleData (data) { var style = normalizeStyleBinding(data.style); // static style is pre-processed into an object during compilation // and is always a fresh object, so it's safe to merge into it return data.staticStyle ? extend(data.staticStyle, style) : style } // normalize possible array / string values into Object function normalizeStyleBinding (bindingStyle) { if (Array.isArray(bindingStyle)) { return toObject(bindingStyle) } if (typeof bindingStyle === 'string') { return parseStyleText(bindingStyle) } return bindingStyle } /** * parent component style should be after child's * so that parent component's style could override it */ function getStyle (vnode, checkChild) { var res = {}; var styleData; if (checkChild) { var childNode = vnode; while (childNode.child) { childNode = childNode.child._vnode; if (childNode.data && (styleData = normalizeStyleData(childNode.data))) { extend(res, styleData); } } } if ((styleData = normalizeStyleData(vnode.data))) { extend(res, styleData); } var parentNode = vnode; while ((parentNode = parentNode.parent)) { if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { extend(res, styleData); } } return res } /* */ var cssVarRE = /^--/; var importantRE = /\s*!important$/; var setProp = function (el, name, val) { /* istanbul ignore if */ if (cssVarRE.test(name)) { el.style.setProperty(name, val); } else if (importantRE.test(val)) { el.style.setProperty(name, val.replace(importantRE, ''), 'important'); } else { el.style[normalize(name)] = val; } }; var prefixes = ['Webkit', 'Moz', 'ms']; var testEl; var normalize = cached(function (prop) { testEl = testEl || document.createElement('div'); prop = camelize(prop); if (prop !== 'filter' && (prop in testEl.style)) { return prop } var upper = prop.charAt(0).toUpperCase() + prop.slice(1); for (var i = 0; i < prefixes.length; i++) { var prefixed = prefixes[i] + upper; if (prefixed in testEl.style) { return prefixed } } }); function updateStyle (oldVnode, vnode) { var data = vnode.data; var oldData = oldVnode.data; if (!data.staticStyle && !data.style && !oldData.staticStyle && !oldData.style) { return } var cur, name; var el = vnode.elm; var oldStaticStyle = oldVnode.data.staticStyle; var oldStyleBinding = oldVnode.data.style || {}; // if static style exists, stylebinding already merged into it when doing normalizeStyleData var oldStyle = oldStaticStyle || oldStyleBinding; var style = normalizeStyleBinding(vnode.data.style) || {}; vnode.data.style = style.__ob__ ? extend({}, style) : style; var newStyle = getStyle(vnode, true); for (name in oldStyle) { if (newStyle[name] == null) { setProp(el, name, ''); } } for (name in newStyle) { cur = newStyle[name]; if (cur !== oldStyle[name]) { // ie9 setting to null has no effect, must use empty string setProp(el, name, cur == null ? '' : cur); } } } var style = { create: updateStyle, update: updateStyle }; /* */ /** * Add class with compatibility for SVG since classList is not supported on * SVG elements in IE */ function addClass (el, cls) { /* istanbul ignore if */ if (!cls || !cls.trim()) { return } /* istanbul ignore else */ if (el.classList) { if (cls.indexOf(' ') > -1) { cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); }); } else { el.classList.add(cls); } } else { var cur = ' ' + el.getAttribute('class') + ' '; if (cur.indexOf(' ' + cls + ' ') < 0) { el.setAttribute('class', (cur + cls).trim()); } } } /** * Remove class with compatibility for SVG since classList is not supported on * SVG elements in IE */ function removeClass (el, cls) { /* istanbul ignore if */ if (!cls || !cls.trim()) { return } /* istanbul ignore else */ if (el.classList) { if (cls.indexOf(' ') > -1) { cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); }); } else { el.classList.remove(cls); } } else { var cur = ' ' + el.getAttribute('class') + ' '; var tar = ' ' + cls + ' '; while (cur.indexOf(tar) >= 0) { cur = cur.replace(tar, ' '); } el.setAttribute('class', cur.trim()); } } /* */ var hasTransition = inBrowser && !isIE9; var TRANSITION = 'transition'; var ANIMATION = 'animation'; // Transition property/event sniffing var transitionProp = 'transition'; var transitionEndEvent = 'transitionend'; var animationProp = 'animation'; var animationEndEvent = 'animationend'; if (hasTransition) { /* istanbul ignore if */ if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) { transitionProp = 'WebkitTransition'; transitionEndEvent = 'webkitTransitionEnd'; } if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) { animationProp = 'WebkitAnimation'; animationEndEvent = 'webkitAnimationEnd'; } } var raf = (inBrowser && window.requestAnimationFrame) || setTimeout; function nextFrame (fn) { raf(function () { raf(fn); }); } function addTransitionClass (el, cls) { (el._transitionClasses || (el._transitionClasses = [])).push(cls); addClass(el, cls); } function removeTransitionClass (el, cls) { if (el._transitionClasses) { remove$1(el._transitionClasses, cls); } removeClass(el, cls); } function whenTransitionEnds ( el, expectedType, cb ) { var ref = getTransitionInfo(el, expectedType); var type = ref.type; var timeout = ref.timeout; var propCount = ref.propCount; if (!type) { return cb() } var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; var ended = 0; var end = function () { el.removeEventListener(event, onEnd); cb(); }; var onEnd = function (e) { if (e.target === el) { if (++ended >= propCount) { end(); } } }; setTimeout(function () { if (ended < propCount) { end(); } }, timeout + 1); el.addEventListener(event, onEnd); } var transformRE = /\b(transform|all)(,|$)/; function getTransitionInfo (el, expectedType) { var styles = window.getComputedStyle(el); var transitioneDelays = styles[transitionProp + 'Delay'].split(', '); var transitionDurations = styles[transitionProp + 'Duration'].split(', '); var transitionTimeout = getTimeout(transitioneDelays, transitionDurations); var animationDelays = styles[animationProp + 'Delay'].split(', '); var animationDurations = styles[animationProp + 'Duration'].split(', '); var animationTimeout = getTimeout(animationDelays, animationDurations); var type; var timeout = 0; var propCount = 0; /* istanbul ignore if */ if (expectedType === TRANSITION) { if (transitionTimeout > 0) { type = TRANSITION; timeout = transitionTimeout; propCount = transitionDurations.length; } } else if (expectedType === ANIMATION) { if (animationTimeout > 0) { type = ANIMATION; timeout = animationTimeout; propCount = animationDurations.length; } } else { timeout = Math.max(transitionTimeout, animationTimeout); type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; } var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']); return { type: type, timeout: timeout, propCount: propCount, hasTransform: hasTransform } } function getTimeout (delays, durations) { /* istanbul ignore next */ while (delays.length < durations.length) { delays = delays.concat(delays); } return Math.max.apply(null, durations.map(function (d, i) { return toMs(d) + toMs(delays[i]) })) } function toMs (s) { return Number(s.slice(0, -1)) * 1000 } /* */ function enter (vnode, toggleDisplay) { var el = vnode.elm; // call leave callback now if (el._leaveCb) { el._leaveCb.cancelled = true; el._leaveCb(); } var data = resolveTransition(vnode.data.transition); if (!data) { return } /* istanbul ignore if */ if (el._enterCb || el.nodeType !== 1) { return } var css = data.css; var type = data.type; var enterClass = data.enterClass; var enterActiveClass = data.enterActiveClass; var appearClass = data.appearClass; var appearActiveClass = data.appearActiveClass; var beforeEnter = data.beforeEnter; var enter = data.enter; var afterEnter = data.afterEnter; var enterCancelled = data.enterCancelled; var beforeAppear = data.beforeAppear; var appear = data.appear; var afterAppear = data.afterAppear; var appearCancelled = data.appearCancelled; // activeInstance will always be the <transition> component managing this // transition. One edge case to check is when the <transition> is placed // as the root node of a child component. In that case we need to check // <transition>'s parent for appear check. var context = activeInstance; var transitionNode = activeInstance.$vnode; while (transitionNode && transitionNode.parent) { transitionNode = transitionNode.parent; context = transitionNode.context; } var isAppear = !context._isMounted || !vnode.isRootInsert; if (isAppear && !appear && appear !== '') { return } var startClass = isAppear ? appearClass : enterClass; var activeClass = isAppear ? appearActiveClass : enterActiveClass; var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter; var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter; var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter; var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled; var expectsCSS = css !== false && !isIE9; var userWantsControl = enterHook && // enterHook may be a bound method which exposes // the length of original fn as _length (enterHook._length || enterHook.length) > 1; var cb = el._enterCb = once(function () { if (expectsCSS) { removeTransitionClass(el, activeClass); } if (cb.cancelled) { if (expectsCSS) { removeTransitionClass(el, startClass); } enterCancelledHook && enterCancelledHook(el); } else { afterEnterHook && afterEnterHook(el); } el._enterCb = null; }); if (!vnode.data.show) { // remove pending leave element on enter by injecting an insert hook mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () { var parent = el.parentNode; var pendingNode = parent && parent._pending && parent._pending[vnode.key]; if (pendingNode && pendingNode.context === vnode.context && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) { pendingNode.elm._leaveCb(); } enterHook && enterHook(el, cb); }, 'transition-insert'); } // start enter transition beforeEnterHook && beforeEnterHook(el); if (expectsCSS) { addTransitionClass(el, startClass); addTransitionClass(el, activeClass); nextFrame(function () { removeTransitionClass(el, startClass); if (!cb.cancelled && !userWantsControl) { whenTransitionEnds(el, type, cb); } }); } if (vnode.data.show) { toggleDisplay && toggleDisplay(); enterHook && enterHook(el, cb); } if (!expectsCSS && !userWantsControl) { cb(); } } function leave (vnode, rm) { var el = vnode.elm; // call enter callback now if (el._enterCb) { el._enterCb.cancelled = true; el._enterCb(); } var data = resolveTransition(vnode.data.transition); if (!data) { return rm() } /* istanbul ignore if */ if (el._leaveCb || el.nodeType !== 1) { return } var css = data.css; var type = data.type; var leaveClass = data.leaveClass; var leaveActiveClass = data.leaveActiveClass; var beforeLeave = data.beforeLeave; var leave = data.leave; var afterLeave = data.afterLeave; var leaveCancelled = data.leaveCancelled; var delayLeave = data.delayLeave; var expectsCSS = css !== false && !isIE9; var userWantsControl = leave && // leave hook may be a bound method which exposes // the length of original fn as _length (leave._length || leave.length) > 1; var cb = el._leaveCb = once(function () { if (el.parentNode && el.parentNode._pending) { el.parentNode._pending[vnode.key] = null; } if (expectsCSS) { removeTransitionClass(el, leaveActiveClass); } if (cb.cancelled) { if (expectsCSS) { removeTransitionClass(el, leaveClass); } leaveCancelled && leaveCancelled(el); } else { rm(); afterLeave && afterLeave(el); } el._leaveCb = null; }); if (delayLeave) { delayLeave(performLeave); } else { performLeave(); } function performLeave () { // the delayed leave may have already been cancelled if (cb.cancelled) { return } // record leaving element if (!vnode.data.show) { (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode; } beforeLeave && beforeLeave(el); if (expectsCSS) { addTransitionClass(el, leaveClass); addTransitionClass(el, leaveActiveClass); nextFrame(function () { removeTransitionClass(el, leaveClass); if (!cb.cancelled && !userWantsControl) { whenTransitionEnds(el, type, cb); } }); } leave && leave(el, cb); if (!expectsCSS && !userWantsControl) { cb(); } } } function resolveTransition (def$$1) { if (!def$$1) { return } /* istanbul ignore else */ if (typeof def$$1 === 'object') { var res = {}; if (def$$1.css !== false) { extend(res, autoCssTransition(def$$1.name || 'v')); } extend(res, def$$1); return res } else if (typeof def$$1 === 'string') { return autoCssTransition(def$$1) } } var autoCssTransition = cached(function (name) { return { enterClass: (name + "-enter"), leaveClass: (name + "-leave"), appearClass: (name + "-enter"), enterActiveClass: (name + "-enter-active"), leaveActiveClass: (name + "-leave-active"), appearActiveClass: (name + "-enter-active") } }); function once (fn) { var called = false; return function () { if (!called) { called = true; fn(); } } } function _enter (_, vnode) { if (!vnode.data.show) { enter(vnode); } } var transition = inBrowser ? { create: _enter, activate: _enter, remove: function remove (vnode, rm) { /* istanbul ignore else */ if (!vnode.data.show) { leave(vnode, rm); } else { rm(); } } } : {}; var platformModules = [ attrs, klass, events, domProps, style, transition ]; /* */ // the directive module should be applied last, after all // built-in modules have been applied. var modules = platformModules.concat(baseModules); var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules }); /** * Not type checking this file because flow doesn't like attaching * properties to Elements. */ var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/; /* istanbul ignore if */ if (isIE9) { // http://www.matts411.com/post/internet-explorer-9-oninput/ document.addEventListener('selectionchange', function () { var el = document.activeElement; if (el && el.vmodel) { trigger(el, 'input'); } }); } var model = { inserted: function inserted (el, binding, vnode) { if (process.env.NODE_ENV !== 'production') { if (!modelableTagRE.test(vnode.tag)) { warn( "v-model is not supported on element type: <" + (vnode.tag) + ">. " + 'If you are working with contenteditable, it\'s recommended to ' + 'wrap a library dedicated for that purpose inside a custom component.', vnode.context ); } } if (vnode.tag === 'select') { var cb = function () { setSelected(el, binding, vnode.context); }; cb(); /* istanbul ignore if */ if (isIE || isEdge) { setTimeout(cb, 0); } } else if (vnode.tag === 'textarea' || el.type === 'text') { el._vModifiers = binding.modifiers; if (!binding.modifiers.lazy) { if (!isAndroid) { el.addEventListener('compositionstart', onCompositionStart); el.addEventListener('compositionend', onCompositionEnd); } /* istanbul ignore if */ if (isIE9) { el.vmodel = true; } } } }, componentUpdated: function componentUpdated (el, binding, vnode) { if (vnode.tag === 'select') { setSelected(el, binding, vnode.context); // in case the options rendered by v-for have changed, // it's possible that the value is out-of-sync with the rendered options. // detect such cases and filter out values that no longer has a matching // option in the DOM. var needReset = el.multiple ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); }) : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options); if (needReset) { trigger(el, 'change'); } } } }; function setSelected (el, binding, vm) { var value = binding.value; var isMultiple = el.multiple; if (isMultiple && !Array.isArray(value)) { process.env.NODE_ENV !== 'production' && warn( "<select multiple v-model=\"" + (binding.expression) + "\"> " + "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), vm ); return } var selected, option; for (var i = 0, l = el.options.length; i < l; i++) { option = el.options[i]; if (isMultiple) { selected = looseIndexOf(value, getValue(option)) > -1; if (option.selected !== selected) { option.selected = selected; } } else { if (looseEqual(getValue(option), value)) { if (el.selectedIndex !== i) { el.selectedIndex = i; } return } } } if (!isMultiple) { el.selectedIndex = -1; } } function hasNoMatchingOption (value, options) { for (var i = 0, l = options.length; i < l; i++) { if (looseEqual(getValue(options[i]), value)) { return false } } return true } function getValue (option) { return '_value' in option ? option._value : option.value } function onCompositionStart (e) { e.target.composing = true; } function onCompositionEnd (e) { e.target.composing = false; trigger(e.target, 'input'); } function trigger (el, type) { var e = document.createEvent('HTMLEvents'); e.initEvent(type, true, true); el.dispatchEvent(e); } /* */ // recursively search for possible transition defined inside the component root function locateNode (vnode) { return vnode.child && (!vnode.data || !vnode.data.transition) ? locateNode(vnode.child._vnode) : vnode } var show = { bind: function bind (el, ref, vnode) { var value = ref.value; vnode = locateNode(vnode); var transition = vnode.data && vnode.data.transition; var originalDisplay = el.__vOriginalDisplay = el.style.display === 'none' ? '' : el.style.display; if (value && transition && !isIE9) { vnode.data.show = true; enter(vnode, function () { el.style.display = originalDisplay; }); } else { el.style.display = value ? originalDisplay : 'none'; } }, update: function update (el, ref, vnode) { var value = ref.value; var oldValue = ref.oldValue; /* istanbul ignore if */ if (value === oldValue) { return } vnode = locateNode(vnode); var transition = vnode.data && vnode.data.transition; if (transition && !isIE9) { vnode.data.show = true; if (value) { enter(vnode, function () { el.style.display = el.__vOriginalDisplay; }); } else { leave(vnode, function () { el.style.display = 'none'; }); } } else { el.style.display = value ? el.__vOriginalDisplay : 'none'; } } }; var platformDirectives = { model: model, show: show }; /* */ // Provides transition support for a single element/component. // supports transition mode (out-in / in-out) var transitionProps = { name: String, appear: Boolean, css: Boolean, mode: String, type: String, enterClass: String, leaveClass: String, enterActiveClass: String, leaveActiveClass: String, appearClass: String, appearActiveClass: String }; // in case the child is also an abstract component, e.g. <keep-alive> // we want to recursively retrieve the real component to be rendered function getRealChild (vnode) { var compOptions = vnode && vnode.componentOptions; if (compOptions && compOptions.Ctor.options.abstract) { return getRealChild(getFirstComponentChild(compOptions.children)) } else { return vnode } } function extractTransitionData (comp) { var data = {}; var options = comp.$options; // props for (var key in options.propsData) { data[key] = comp[key]; } // events. // extract listeners and pass them directly to the transition methods var listeners = options._parentListeners; for (var key$1 in listeners) { data[camelize(key$1)] = listeners[key$1].fn; } return data } function placeholder (h, rawChild) { return /\d-keep-alive$/.test(rawChild.tag) ? h('keep-alive') : null } function hasParentTransition (vnode) { while ((vnode = vnode.parent)) { if (vnode.data.transition) { return true } } } var Transition = { name: 'transition', props: transitionProps, abstract: true, render: function render (h) { var this$1 = this; var children = this.$slots.default; if (!children) { return } // filter out text nodes (possible whitespaces) children = children.filter(function (c) { return c.tag; }); /* istanbul ignore if */ if (!children.length) { return } // warn multiple elements if (process.env.NODE_ENV !== 'production' && children.length > 1) { warn( '<transition> can only be used on a single element. Use ' + '<transition-group> for lists.', this.$parent ); } var mode = this.mode; // warn invalid mode if (process.env.NODE_ENV !== 'production' && mode && mode !== 'in-out' && mode !== 'out-in') { warn( 'invalid <transition> mode: ' + mode, this.$parent ); } var rawChild = children[0]; // if this is a component root node and the component's // parent container node also has transition, skip. if (hasParentTransition(this.$vnode)) { return rawChild } // apply transition data to child // use getRealChild() to ignore abstract components e.g. keep-alive var child = getRealChild(rawChild); /* istanbul ignore if */ if (!child) { return rawChild } if (this._leaving) { return placeholder(h, rawChild) } var key = child.key = child.key == null || child.isStatic ? ("__v" + (child.tag + this._uid) + "__") : child.key; var data = (child.data || (child.data = {})).transition = extractTransitionData(this); var oldRawChild = this._vnode; var oldChild = getRealChild(oldRawChild); // mark v-show // so that the transition module can hand over the control to the directive if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) { child.data.show = true; } if (oldChild && oldChild.data && oldChild.key !== key) { // replace old child transition data with fresh one // important for dynamic transitions! var oldData = oldChild.data.transition = extend({}, data); // handle transition mode if (mode === 'out-in') { // return placeholder node and queue update when leave finishes this._leaving = true; mergeVNodeHook(oldData, 'afterLeave', function () { this$1._leaving = false; this$1.$forceUpdate(); }, key); return placeholder(h, rawChild) } else if (mode === 'in-out') { var delayedLeave; var performLeave = function () { delayedLeave(); }; mergeVNodeHook(data, 'afterEnter', performLeave, key); mergeVNodeHook(data, 'enterCancelled', performLeave, key); mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }, key); } } return rawChild } }; /* */ // Provides transition support for list items. // supports move transitions using the FLIP technique. // Because the vdom's children update algorithm is "unstable" - i.e. // it doesn't guarantee the relative positioning of removed elements, // we force transition-group to update its children into two passes: // in the first pass, we remove all nodes that need to be removed, // triggering their leaving transition; in the second pass, we insert/move // into the final disired state. This way in the second pass removed // nodes will remain where they should be. var props = extend({ tag: String, moveClass: String }, transitionProps); delete props.mode; var TransitionGroup = { props: props, render: function render (h) { var tag = this.tag || this.$vnode.data.tag || 'span'; var map = Object.create(null); var prevChildren = this.prevChildren = this.children; var rawChildren = this.$slots.default || []; var children = this.children = []; var transitionData = extractTransitionData(this); for (var i = 0; i < rawChildren.length; i++) { var c = rawChildren[i]; if (c.tag) { if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { children.push(c); map[c.key] = c ;(c.data || (c.data = {})).transition = transitionData; } else if (process.env.NODE_ENV !== 'production') { var opts = c.componentOptions; var name = opts ? (opts.Ctor.options.name || opts.tag) : c.tag; warn(("<transition-group> children must be keyed: <" + name + ">")); } } } if (prevChildren) { var kept = []; var removed = []; for (var i$1 = 0; i$1 < prevChildren.length; i$1++) { var c$1 = prevChildren[i$1]; c$1.data.transition = transitionData; c$1.data.pos = c$1.elm.getBoundingClientRect(); if (map[c$1.key]) { kept.push(c$1); } else { removed.push(c$1); } } this.kept = h(tag, null, kept); this.removed = removed; } return h(tag, null, children) }, beforeUpdate: function beforeUpdate () { // force removing pass this.__patch__( this._vnode, this.kept, false, // hydrating true // removeOnly (!important, avoids unnecessary moves) ); this._vnode = this.kept; }, updated: function updated () { var children = this.prevChildren; var moveClass = this.moveClass || ((this.name || 'v') + '-move'); if (!children.length || !this.hasMove(children[0].elm, moveClass)) { return } // we divide the work into three loops to avoid mixing DOM reads and writes // in each iteration - which helps prevent layout thrashing. children.forEach(callPendingCbs); children.forEach(recordPosition); children.forEach(applyTranslation); // force reflow to put everything in position var f = document.body.offsetHeight; // eslint-disable-line children.forEach(function (c) { if (c.data.moved) { var el = c.elm; var s = el.style; addTransitionClass(el, moveClass); s.transform = s.WebkitTransform = s.transitionDuration = ''; el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { if (!e || /transform$/.test(e.propertyName)) { el.removeEventListener(transitionEndEvent, cb); el._moveCb = null; removeTransitionClass(el, moveClass); } }); } }); }, methods: { hasMove: function hasMove (el, moveClass) { /* istanbul ignore if */ if (!hasTransition) { return false } if (this._hasMove != null) { return this._hasMove } addTransitionClass(el, moveClass); var info = getTransitionInfo(el); removeTransitionClass(el, moveClass); return (this._hasMove = info.hasTransform) } } }; function callPendingCbs (c) { /* istanbul ignore if */ if (c.elm._moveCb) { c.elm._moveCb(); } /* istanbul ignore if */ if (c.elm._enterCb) { c.elm._enterCb(); } } function recordPosition (c) { c.data.newPos = c.elm.getBoundingClientRect(); } function applyTranslation (c) { var oldPos = c.data.pos; var newPos = c.data.newPos; var dx = oldPos.left - newPos.left; var dy = oldPos.top - newPos.top; if (dx || dy) { c.data.moved = true; var s = c.elm.style; s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; s.transitionDuration = '0s'; } } var platformComponents = { Transition: Transition, TransitionGroup: TransitionGroup }; /* */ // install platform specific utils Vue$2.config.isUnknownElement = isUnknownElement; Vue$2.config.isReservedTag = isReservedTag; Vue$2.config.getTagNamespace = getTagNamespace; Vue$2.config.mustUseProp = mustUseProp; // install platform runtime directives & components extend(Vue$2.options.directives, platformDirectives); extend(Vue$2.options.components, platformComponents); // install platform patch function Vue$2.prototype.__patch__ = inBrowser ? patch$1 : noop; // wrap mount Vue$2.prototype.$mount = function ( el, hydrating ) { el = el && inBrowser ? query(el) : undefined; return this._mount(el, hydrating) }; // devtools global hook /* istanbul ignore next */ setTimeout(function () { if (config.devtools) { if (devtools) { devtools.emit('init', Vue$2); } else if ( process.env.NODE_ENV !== 'production' && inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent) ) { console.log( 'Download the Vue Devtools for a better development experience:\n' + 'https://github.com/vuejs/vue-devtools' ); } } }, 0); module.exports = Vue$2; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8), (function() { return this; }()))) /***/ }, /* 8 */ /***/ function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.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; }; /***/ }, /* 9 */, /* 10 */, /* 11 */, /* 12 */, /* 13 */, /* 14 */, /* 15 */, /* 16 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = install; var _mdBottomBar = __webpack_require__(17); var _mdBottomBar2 = _interopRequireDefault(_mdBottomBar); var _mdBottomBarItem = __webpack_require__(21); var _mdBottomBarItem2 = _interopRequireDefault(_mdBottomBarItem); var _mdBottomBar3 = __webpack_require__(24); var _mdBottomBar4 = _interopRequireDefault(_mdBottomBar3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function install(Vue) { Vue.component('md-bottom-bar', Vue.extend(_mdBottomBar2.default)); Vue.component('md-bottom-bar-item', Vue.extend(_mdBottomBarItem2.default)); Vue.material.styles.push(_mdBottomBar4.default); } module.exports = exports['default']; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { var __vue_exports__, __vue_options__ var __vue_styles__ = {} /* styles */ __webpack_require__(18) /* script */ __vue_exports__ = __webpack_require__(19) /* template */ var __vue_template__ = __webpack_require__(20) __vue_options__ = __vue_exports__ = __vue_exports__ || {} if ( typeof __vue_exports__.default === "object" || typeof __vue_exports__.default === "function" ) { if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")} __vue_options__ = __vue_exports__ = __vue_exports__.default } if (typeof __vue_options__ === "function") { __vue_options__ = __vue_options__.options } __vue_options__.__file = "/Users/marcosmoura/Projects/github/vue-material/src/components/mdBottomBar/mdBottomBar.vue" __vue_options__.render = __vue_template__.render __vue_options__.staticRenderFns = __vue_template__.staticRenderFns /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-039c211e", __vue_options__) } else { hotAPI.reload("data-v-039c211e", __vue_options__) } })()} if (__vue_options__.functional) {console.error("[vue-loader] mdBottomBar.vue: functional components are not supported and should be defined in plain js files using render functions.")} module.exports = __vue_exports__ /***/ }, /* 18 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _mixin = __webpack_require__(6); var _mixin2 = _interopRequireDefault(_mixin); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { props: { mdShift: Boolean }, mixins: [_mixin2.default], computed: { classes: function classes() { return this.mdShift ? 'md-shift' : 'md-fixed'; } } }; // // // // // // // // module.exports = exports['default']; /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._c; return _c('div', { staticClass: "md-bottom-bar", class: [_vm.themeClass, _vm.classes] }, [_vm._t("default")], true) },staticRenderFns: []} module.exports.render._withStripped = true if (false) { module.hot.accept() if (module.hot.data) { require("vue-hot-reload-api").rerender("data-v-039c211e", module.exports) } } /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { var __vue_exports__, __vue_options__ var __vue_styles__ = {} /* script */ __vue_exports__ = __webpack_require__(22) /* template */ var __vue_template__ = __webpack_require__(23) __vue_options__ = __vue_exports__ = __vue_exports__ || {} if ( typeof __vue_exports__.default === "object" || typeof __vue_exports__.default === "function" ) { if (Object.keys(__vue_exports__).some(function (key) { return key !== "default" && key !== "__esModule" })) {console.error("named exports are not supported in *.vue files.")} __vue_options__ = __vue_exports__ = __vue_exports__.default } if (typeof __vue_options__ === "function") { __vue_options__ = __vue_options__.options } __vue_options__.__file = "/Users/marcosmoura/Projects/github/vue-material/src/components/mdBottomBar/mdBottomBarItem.vue" __vue_options__.render = __vue_template__.render __vue_options__.staticRenderFns = __vue_template__.staticRenderFns /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-1c07f8a4", __vue_options__) } else { hotAPI.reload("data-v-1c07f8a4", __vue_options__) } })()} if (__vue_options__.functional) {console.error("[vue-loader] mdBottomBarItem.vue: functional components are not supported and should be defined in plain js files using render functions.")} module.exports = __vue_exports__ /***/ }, /* 22 */ /***/ function(module, exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // // // // // // // // // // // // // exports.default = { props: { mdIcon: String, mdActive: Boolean, href: String }, data: function data() { return { active: false }; }, computed: { classes: function classes() { return { 'md-active': this.active }; } }, watch: { mdActive: function mdActive(active) { this.setActive(active); } }, methods: { setActive: function setActive(active) { this.$parent.$children.forEach(function (item) { item.active = false; }); this.active = !!active; } }, mounted: function mounted() { if (!this.$parent.$el.classList.contains('md-bottom-bar')) { this.$destroy(); throw new Error('You should wrap the md-bottom-bar-item in a md-bottom-bar'); } if (this.mdActive) { this.active = true; } } }; module.exports = exports['default']; /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._c; return (_vm.href) ? _c('a', { directives: [{ name: "md-ink-ripple", rawName: "v-md-ink-ripple" }], staticClass: "md-bottom-bar-item", class: _vm.classes, attrs: { "href": _vm.href }, on: { "click": _vm.setActive } }, [_c('md-icon', [_vm._v(_vm._s(_vm.mdIcon))]), _vm._v(" "), _c('span', { staticClass: "md-text" }, [_vm._t("default")], true)]) : _c('button', { directives: [{ name: "md-ink-ripple", rawName: "v-md-ink-ripple" }], staticClass: "md-bottom-bar-item", class: _vm.classes, attrs: { "type": "button" }, on: { "click": _vm.setActive } }, [_c('md-icon', [_vm._v(_vm._s(_vm.mdIcon))]), _vm._v(" "), _c('span', { staticClass: "md-text" }, [_vm._t("default")], true)]) },staticRenderFns: []} module.exports.render._withStripped = true if (false) { module.hot.accept() if (module.hot.data) { require("vue-hot-reload-api").rerender("data-v-1c07f8a4", module.exports) } } /***/ }, /* 24 */ /***/ function(module, exports) { module.exports = ".THEME_NAME.md-bottom-bar.md-fixed {\n background-color: BACKGROUND-COLOR; }\n .THEME_NAME.md-bottom-bar.md-fixed .md-bottom-bar-item {\n color: BACKGROUND-CONTRAST-0.54; }\n .THEME_NAME.md-bottom-bar.md-fixed .md-bottom-bar-item:hover:not(.md-active) {\n color: BACKGROUND-CONTRAST-0.87; }\n .THEME_NAME.md-bottom-bar.md-fixed .md-bottom-bar-item.md-active {\n color: PRIMARY-COLOR; }\n .THEME_NAME.md-bottom-bar.md-fixed.md-accent .md-bottom-bar-item.md-active {\n color: ACCENT-COLOR; }\n .THEME_NAME.md-bottom-bar.md-fixed.md-warn .md-bottom-bar-item.md-active {\n color: WARN-COLOR; }\n .THEME_NAME.md-bottom-bar.md-fixed.md-transparent .md-bottom-bar-item.md-active {\n color: BACKGROUND-CONTRAST; }\n\n.THEME_NAME.md-bottom-bar.md-shift {\n background-color: PRIMARY-COLOR;\n color: PRIMARY-CONTRAST; }\n .THEME_NAME.md-bottom-bar.md-shift .md-bottom-bar-item {\n color: PRIMARY-CONTRAST-0.54; }\n .THEME_NAME.md-bottom-bar.md-shift .md-bottom-bar-item:hover:not(.md-active) {\n color: PRIMARY-CONTRAST-0.87; }\n .THEME_NAME.md-bottom-bar.md-shift .md-bottom-bar-item.md-active {\n color: PRIMARY-CONTRAST; }\n .THEME_NAME.md-bottom-bar.md-shift.md-accent {\n background-color: ACCENT-COLOR; }\n .THEME_NAME.md-bottom-bar.md-shift.md-accent .md-bottom-bar-item {\n color: ACCENT-CONTRAST-0.54; }\n .THEME_NAME.md-bottom-bar.md-shift.md-accent .md-bottom-bar-item:hover:not(.md-active) {\n color: ACCENT-CONTRAST-0.87; }\n .THEME_NAME.md-bottom-bar.md-shift.md-accent .md-bottom-bar-item.md-active {\n color: ACCENT-CONTRAST; }\n .THEME_NAME.md-bottom-bar.md-shift.md-warn {\n background-color: WARN-COLOR; }\n .THEME_NAME.md-bottom-bar.md-shift.md-warn .md-bottom-bar-item {\n color: WARN-CONTRAST-0.54; }\n .THEME_NAME.md-bottom-bar.md-shift.md-warn .md-bottom-bar-item:hover:not(.md-active) {\n color: WARN-CONTRAST-0.87; }\n .THEME_NAME.md-bottom-bar.md-shift.md-warn .md-bottom-bar-item.md-active {\n color: WARN-CONTRAST; }\n .THEME_NAME.md-bottom-bar.md-shift.md-transparent {\n background-color: transparent; }\n .THEME_NAME.md-bottom-bar.md-shift.md-transparent .md-bottom-bar-item {\n color: BACKGROUND-CONTRAST-0.54; }\n .THEME_NAME.md-bottom-bar.md-shift.md-transparent .md-bottom-bar-item:hover:not(.md-active) {\n color: BACKGROUND-CONTRAST-0.87; }\n .THEME_NAME.md-bottom-bar.md-shift.md-transparent .md-bottom-bar-item.md-active {\n color: BACKGROUND-CONTRAST; }\n" /***/ } /******/ ]) }); ; //# sourceMappingURL=index.debug.js.map
ajax/libs/video.js/4.4.2/video.dev.js
sullivanmatt/cdnjs
/** * @fileoverview Main function src. */ // HTML5 Shiv. Must be in <head> to support older browsers. document.createElement('video'); document.createElement('audio'); document.createElement('track'); /** * Doubles as the main function for users to create a player instance and also * the main library object. * * **ALIASES** videojs, _V_ (deprecated) * * The `vjs` function can be used to initialize or retrieve a player. * * var myPlayer = vjs('my_video_id'); * * @param {String|Element} id Video element or video element ID * @param {Object=} options Optional options object for config/settings * @param {Function=} ready Optional ready callback * @return {vjs.Player} A player instance * @namespace */ var vjs = function(id, options, ready){ var tag; // Element of ID // Allow for element or ID to be passed in // String ID if (typeof id === 'string') { // Adjust for jQuery ID syntax if (id.indexOf('#') === 0) { id = id.slice(1); } // If a player instance has already been created for this ID return it. if (vjs.players[id]) { return vjs.players[id]; // Otherwise get element for ID } else { tag = vjs.el(id); } // ID is a media element } else { tag = id; } // Check for a useable element if (!tag || !tag.nodeName) { // re: nodeName, could be a box div also throw new TypeError('The element or ID supplied is not valid. (videojs)'); // Returns } // Element may have a player attr referring to an already created player instance. // If not, set up a new player and return the instance. return tag['player'] || new vjs.Player(tag, options, ready); }; // Extended name, also available externally, window.videojs var videojs = vjs; window.videojs = window.vjs = vjs; // CDN Version. Used to target right flash swf. vjs.CDN_VERSION = '4.4'; vjs.ACCESS_PROTOCOL = ('https:' == document.location.protocol ? 'https://' : 'http://'); /** * Global Player instance options, surfaced from vjs.Player.prototype.options_ * vjs.options = vjs.Player.prototype.options_ * All options should use string keys so they avoid * renaming by closure compiler * @type {Object} */ vjs.options = { // Default order of fallback technology 'techOrder': ['html5','flash'], // techOrder: ['flash','html5'], 'html5': {}, 'flash': {}, // Default of web browser is 300x150. Should rely on source width/height. 'width': 300, 'height': 150, // defaultVolume: 0.85, 'defaultVolume': 0.00, // The freakin seaguls are driving me crazy! // Included control sets 'children': { 'mediaLoader': {}, 'posterImage': {}, 'textTrackDisplay': {}, 'loadingSpinner': {}, 'bigPlayButton': {}, 'controlBar': {} }, // Default message to show when a video cannot be played. 'notSupportedMessage': 'Sorry, no compatible source and playback ' + 'technology were found for this video. Try using another browser ' + 'like <a href="http://bit.ly/ccMUEC">Chrome</a> or download the ' + 'latest <a href="http://adobe.ly/mwfN1">Adobe Flash Player</a>.' }; // Set CDN Version of swf // The added (+) blocks the replace from changing this 4.4 string if (vjs.CDN_VERSION !== 'GENERATED'+'_CDN_VSN') { videojs.options['flash']['swf'] = vjs.ACCESS_PROTOCOL + 'vjs.zencdn.net/'+vjs.CDN_VERSION+'/video-js.swf'; } /** * Global player list * @type {Object} */ vjs.players = {}; /*! * Custom Universal Module Definition (UMD) * * Video.js will never be a non-browser lib so we can simplify UMD a bunch and * still support requirejs and browserify. This also needs to be closure * compiler compatible, so string keys are used. */ if (typeof define === 'function' && define['amd']) { define([], function(){ return videojs; }); // checking that module is an object too because of umdjs/umd#35 } else if (typeof exports === 'object' && typeof module === 'object') { module['exports'] = videojs; } /** * Core Object/Class for objects that use inheritance + contstructors * * To create a class that can be subclassed itself, extend the CoreObject class. * * var Animal = CoreObject.extend(); * var Horse = Animal.extend(); * * The constructor can be defined through the init property of an object argument. * * var Animal = CoreObject.extend({ * init: function(name, sound){ * this.name = name; * } * }); * * Other methods and properties can be added the same way, or directly to the * prototype. * * var Animal = CoreObject.extend({ * init: function(name){ * this.name = name; * }, * getName: function(){ * return this.name; * }, * sound: '...' * }); * * Animal.prototype.makeSound = function(){ * alert(this.sound); * }; * * To create an instance of a class, use the create method. * * var fluffy = Animal.create('Fluffy'); * fluffy.getName(); // -> Fluffy * * Methods and properties can be overridden in subclasses. * * var Horse = Animal.extend({ * sound: 'Neighhhhh!' * }); * * var horsey = Horse.create('Horsey'); * horsey.getName(); // -> Horsey * horsey.makeSound(); // -> Alert: Neighhhhh! * * @class * @constructor */ vjs.CoreObject = vjs['CoreObject'] = function(){}; // Manually exporting vjs['CoreObject'] here for Closure Compiler // because of the use of the extend/create class methods // If we didn't do this, those functions would get flattend to something like // `a = ...` and `this.prototype` would refer to the global object instead of // CoreObject /** * Create a new object that inherits from this Object * * var Animal = CoreObject.extend(); * var Horse = Animal.extend(); * * @param {Object} props Functions and properties to be applied to the * new object's prototype * @return {vjs.CoreObject} An object that inherits from CoreObject * @this {*} */ vjs.CoreObject.extend = function(props){ var init, subObj; props = props || {}; // Set up the constructor using the supplied init method // or using the init of the parent object // Make sure to check the unobfuscated version for external libs init = props['init'] || props.init || this.prototype['init'] || this.prototype.init || function(){}; // In Resig's simple class inheritance (previously used) the constructor // is a function that calls `this.init.apply(arguments)` // However that would prevent us from using `ParentObject.call(this);` // in a Child constuctor because the `this` in `this.init` // would still refer to the Child and cause an inifinite loop. // We would instead have to do // `ParentObject.prototype.init.apply(this, argumnents);` // Bleh. We're not creating a _super() function, so it's good to keep // the parent constructor reference simple. subObj = function(){ init.apply(this, arguments); }; // Inherit from this object's prototype subObj.prototype = vjs.obj.create(this.prototype); // Reset the constructor property for subObj otherwise // instances of subObj would have the constructor of the parent Object subObj.prototype.constructor = subObj; // Make the class extendable subObj.extend = vjs.CoreObject.extend; // Make a function for creating instances subObj.create = vjs.CoreObject.create; // Extend subObj's prototype with functions and other properties from props for (var name in props) { if (props.hasOwnProperty(name)) { subObj.prototype[name] = props[name]; } } return subObj; }; /** * Create a new instace of this Object class * * var myAnimal = Animal.create(); * * @return {vjs.CoreObject} An instance of a CoreObject subclass * @this {*} */ vjs.CoreObject.create = function(){ // Create a new object that inherits from this object's prototype var inst = vjs.obj.create(this.prototype); // Apply this constructor function to the new object this.apply(inst, arguments); // Return the new object return inst; }; /** * @fileoverview Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/) * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible) * This should work very similarly to jQuery's events, however it's based off the book version which isn't as * robust as jquery's, so there's probably some differences. */ /** * Add an event listener to element * It stores the handler function in a separate cache object * and adds a generic handler to the element's event, * along with a unique id (guid) to the element. * @param {Element|Object} elem Element or object to bind listeners to * @param {String} type Type of event to bind to. * @param {Function} fn Event listener. * @private */ vjs.on = function(elem, type, fn){ var data = vjs.getData(elem); // We need a place to store all our handler data if (!data.handlers) data.handlers = {}; if (!data.handlers[type]) data.handlers[type] = []; if (!fn.guid) fn.guid = vjs.guid++; data.handlers[type].push(fn); if (!data.dispatcher) { data.disabled = false; data.dispatcher = function (event){ if (data.disabled) return; event = vjs.fixEvent(event); var handlers = data.handlers[event.type]; if (handlers) { // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off. var handlersCopy = handlers.slice(0); for (var m = 0, n = handlersCopy.length; m < n; m++) { if (event.isImmediatePropagationStopped()) { break; } else { handlersCopy[m].call(elem, event); } } } }; } if (data.handlers[type].length == 1) { if (document.addEventListener) { elem.addEventListener(type, data.dispatcher, false); } else if (document.attachEvent) { elem.attachEvent('on' + type, data.dispatcher); } } }; /** * Removes event listeners from an element * @param {Element|Object} elem Object to remove listeners from * @param {String=} type Type of listener to remove. Don't include to remove all events from element. * @param {Function} fn Specific listener to remove. Don't incldue to remove listeners for an event type. * @private */ vjs.off = function(elem, type, fn) { // Don't want to add a cache object through getData if not needed if (!vjs.hasData(elem)) return; var data = vjs.getData(elem); // If no events exist, nothing to unbind if (!data.handlers) { return; } // Utility function var removeType = function(t){ data.handlers[t] = []; vjs.cleanUpEvents(elem,t); }; // Are we removing all bound events? if (!type) { for (var t in data.handlers) removeType(t); return; } var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind if (!handlers) return; // If no listener was provided, remove all listeners for type if (!fn) { removeType(type); return; } // We're only removing a single handler if (fn.guid) { for (var n = 0; n < handlers.length; n++) { if (handlers[n].guid === fn.guid) { handlers.splice(n--, 1); } } } vjs.cleanUpEvents(elem, type); }; /** * Clean up the listener cache and dispatchers * @param {Element|Object} elem Element to clean up * @param {String} type Type of event to clean up * @private */ vjs.cleanUpEvents = function(elem, type) { var data = vjs.getData(elem); // Remove the events of a particular type if there are none left if (data.handlers[type].length === 0) { delete data.handlers[type]; // data.handlers[type] = null; // Setting to null was causing an error with data.handlers // Remove the meta-handler from the element if (document.removeEventListener) { elem.removeEventListener(type, data.dispatcher, false); } else if (document.detachEvent) { elem.detachEvent('on' + type, data.dispatcher); } } // Remove the events object if there are no types left if (vjs.isEmpty(data.handlers)) { delete data.handlers; delete data.dispatcher; delete data.disabled; // data.handlers = null; // data.dispatcher = null; // data.disabled = null; } // Finally remove the expando if there is no data left if (vjs.isEmpty(data)) { vjs.removeData(elem); } }; /** * Fix a native event to have standard property values * @param {Object} event Event object to fix * @return {Object} * @private */ vjs.fixEvent = function(event) { function returnTrue() { return true; } function returnFalse() { return false; } // Test if fixing up is needed // Used to check if !event.stopPropagation instead of isPropagationStopped // But native events return true for stopPropagation, but don't have // other expected methods like isPropagationStopped. Seems to be a problem // with the Javascript Ninja code. So we're just overriding all events now. if (!event || !event.isPropagationStopped) { var old = event || window.event; event = {}; // Clone the old object so that we can modify the values event = {}; // IE8 Doesn't like when you mess with native event properties // Firefox returns false for event.hasOwnProperty('type') and other props // which makes copying more difficult. // TODO: Probably best to create a whitelist of event props for (var key in old) { // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation if (key !== 'layerX' && key !== 'layerY' && key !== 'keyboardEvent.keyLocation') { // Chrome 32+ warns if you try to copy deprecated returnValue, but // we still want to if preventDefault isn't supported (IE8). if (!(key == 'returnValue' && old.preventDefault)) { event[key] = old[key]; } } } // The event occurred on this element if (!event.target) { event.target = event.srcElement || document; } // Handle which other element the event is related to event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; // Stop the default browser action event.preventDefault = function () { if (old.preventDefault) { old.preventDefault(); } event.returnValue = false; event.isDefaultPrevented = returnTrue; }; event.isDefaultPrevented = returnFalse; // Stop the event from bubbling event.stopPropagation = function () { if (old.stopPropagation) { old.stopPropagation(); } event.cancelBubble = true; event.isPropagationStopped = returnTrue; }; event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers event.stopImmediatePropagation = function () { if (old.stopImmediatePropagation) { old.stopImmediatePropagation(); } event.isImmediatePropagationStopped = returnTrue; event.stopPropagation(); }; event.isImmediatePropagationStopped = returnFalse; // Handle mouse position if (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); } // Handle key presses event.which = event.charCode || event.keyCode; // Fix button for mouse clicks: // 0 == left; 1 == middle; 2 == right if (event.button != null) { event.button = (event.button & 1 ? 0 : (event.button & 4 ? 1 : (event.button & 2 ? 2 : 0))); } } // Returns fixed-up instance return event; }; /** * Trigger an event for an element * @param {Element|Object} elem Element to trigger an event on * @param {String} event Type of event to trigger * @private */ vjs.trigger = function(elem, event) { // Fetches element data and a reference to the parent (for bubbling). // Don't want to add a data object to cache for every parent, // so checking hasData first. var elemData = (vjs.hasData(elem)) ? vjs.getData(elem) : {}; var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event, // handler; // If an event name was passed as a string, creates an event out of it if (typeof event === 'string') { event = { type:event, target:elem }; } // Normalizes the event properties. event = vjs.fixEvent(event); // If the passed element has a dispatcher, executes the established handlers. if (elemData.dispatcher) { elemData.dispatcher.call(elem, event); } // Unless explicitly stopped or the event does not bubble (e.g. media events) // recursively calls this function to bubble the event up the DOM. if (parent && !event.isPropagationStopped() && event.bubbles !== false) { vjs.trigger(parent, event); // If at the top of the DOM, triggers the default action unless disabled. } else if (!parent && !event.isDefaultPrevented()) { var targetData = vjs.getData(event.target); // Checks if the target has a default action for this event. if (event.target[event.type]) { // Temporarily disables event dispatching on the target as we have already executed the handler. targetData.disabled = true; // Executes the default action. if (typeof event.target[event.type] === 'function') { event.target[event.type](); } // Re-enables event dispatching. targetData.disabled = false; } } // Inform the triggerer if the default was prevented by returning false return !event.isDefaultPrevented(); /* Original version of js ninja events wasn't complete. * We've since updated to the latest version, but keeping this around * for now just in case. */ // // Added in attion to book. Book code was broke. // event = typeof event === 'object' ? // event[vjs.expando] ? // event : // new vjs.Event(type, event) : // new vjs.Event(type); // event.type = type; // if (handler) { // handler.call(elem, event); // } // // Clean up the event in case it is being reused // event.result = undefined; // event.target = elem; }; /** * Trigger a listener only once for an event * @param {Element|Object} elem Element or object to * @param {String} type * @param {Function} fn * @private */ vjs.one = function(elem, type, fn) { var func = function(){ vjs.off(elem, type, func); fn.apply(this, arguments); }; func.guid = fn.guid = fn.guid || vjs.guid++; vjs.on(elem, type, func); }; var hasOwnProp = Object.prototype.hasOwnProperty; /** * Creates an element and applies properties. * @param {String=} tagName Name of tag to be created. * @param {Object=} properties Element properties to be applied. * @return {Element} * @private */ vjs.createEl = function(tagName, properties){ var el, propName; el = document.createElement(tagName || 'div'); for (propName in properties){ if (hasOwnProp.call(properties, propName)) { //el[propName] = properties[propName]; // Not remembering why we were checking for dash // but using setAttribute means you have to use getAttribute // The check for dash checks for the aria-* attributes, like aria-label, aria-valuemin. // The additional check for "role" is because the default method for adding attributes does not // add the attribute "role". My guess is because it's not a valid attribute in some namespaces, although // browsers handle the attribute just fine. The W3C allows for aria-* attributes to be used in pre-HTML5 docs. // http://www.w3.org/TR/wai-aria-primer/#ariahtml. Using setAttribute gets around this problem. if (propName.indexOf('aria-') !== -1 || propName=='role') { el.setAttribute(propName, properties[propName]); } else { el[propName] = properties[propName]; } } } return el; }; /** * Uppercase the first letter of a string * @param {String} string String to be uppercased * @return {String} * @private */ vjs.capitalize = function(string){ return string.charAt(0).toUpperCase() + string.slice(1); }; /** * Object functions container * @type {Object} * @private */ vjs.obj = {}; /** * Object.create shim for prototypal inheritance * * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create * * @function * @param {Object} obj Object to use as prototype * @private */ vjs.obj.create = Object.create || function(obj){ //Create a new function called 'F' which is just an empty object. function F() {} //the prototype of the 'F' function should point to the //parameter of the anonymous function. F.prototype = obj; //create a new constructor function based off of the 'F' function. return new F(); }; /** * Loop through each property in an object and call a function * whose arguments are (key,value) * @param {Object} obj Object of properties * @param {Function} fn Function to be called on each property. * @this {*} * @private */ vjs.obj.each = function(obj, fn, context){ for (var key in obj) { if (hasOwnProp.call(obj, key)) { fn.call(context || this, key, obj[key]); } } }; /** * Merge two objects together and return the original. * @param {Object} obj1 * @param {Object} obj2 * @return {Object} * @private */ vjs.obj.merge = function(obj1, obj2){ if (!obj2) { return obj1; } for (var key in obj2){ if (hasOwnProp.call(obj2, key)) { obj1[key] = obj2[key]; } } return obj1; }; /** * Merge two objects, and merge any properties that are objects * instead of just overwriting one. Uses to merge options hashes * where deeper default settings are important. * @param {Object} obj1 Object to override * @param {Object} obj2 Overriding object * @return {Object} New object. Obj1 and Obj2 will be untouched. * @private */ vjs.obj.deepMerge = function(obj1, obj2){ var key, val1, val2; // make a copy of obj1 so we're not ovewriting original values. // like prototype.options_ and all sub options objects obj1 = vjs.obj.copy(obj1); for (key in obj2){ if (hasOwnProp.call(obj2, key)) { val1 = obj1[key]; val2 = obj2[key]; // Check if both properties are pure objects and do a deep merge if so if (vjs.obj.isPlain(val1) && vjs.obj.isPlain(val2)) { obj1[key] = vjs.obj.deepMerge(val1, val2); } else { obj1[key] = obj2[key]; } } } return obj1; }; /** * Make a copy of the supplied object * @param {Object} obj Object to copy * @return {Object} Copy of object * @private */ vjs.obj.copy = function(obj){ return vjs.obj.merge({}, obj); }; /** * Check if an object is plain, and not a dom node or any object sub-instance * @param {Object} obj Object to check * @return {Boolean} True if plain, false otherwise * @private */ vjs.obj.isPlain = function(obj){ return !!obj && typeof obj === 'object' && obj.toString() === '[object Object]' && obj.constructor === Object; }; /** * Bind (a.k.a proxy or Context). A simple method for changing the context of a function It also stores a unique id on the function so it can be easily removed from events * @param {*} context The object to bind as scope * @param {Function} fn The function to be bound to a scope * @param {Number=} uid An optional unique ID for the function to be set * @return {Function} * @private */ vjs.bind = function(context, fn, uid) { // Make sure the function has a unique ID if (!fn.guid) { fn.guid = vjs.guid++; } // Create the new function that changes the context var ret = function() { return fn.apply(context, arguments); }; // Allow for the ability to individualize this function // Needed in the case where multiple objects might share the same prototype // IF both items add an event listener with the same function, then you try to remove just one // it will remove both because they both have the same guid. // when using this, you need to use the bind method when you remove the listener as well. // currently used in text tracks ret.guid = (uid) ? uid + '_' + fn.guid : fn.guid; return ret; }; /** * Element Data Store. Allows for binding data to an element without putting it directly on the element. * Ex. Event listneres are stored here. * (also from jsninja.com, slightly modified and updated for closure compiler) * @type {Object} * @private */ vjs.cache = {}; /** * Unique ID for an element or function * @type {Number} * @private */ vjs.guid = 1; /** * Unique attribute name to store an element's guid in * @type {String} * @constant * @private */ vjs.expando = 'vdata' + (new Date()).getTime(); /** * Returns the cache object where data for an element is stored * @param {Element} el Element to store data for. * @return {Object} * @private */ vjs.getData = function(el){ var id = el[vjs.expando]; if (!id) { id = el[vjs.expando] = vjs.guid++; vjs.cache[id] = {}; } return vjs.cache[id]; }; /** * Returns the cache object where data for an element is stored * @param {Element} el Element to store data for. * @return {Object} * @private */ vjs.hasData = function(el){ var id = el[vjs.expando]; return !(!id || vjs.isEmpty(vjs.cache[id])); }; /** * Delete data for the element from the cache and the guid attr from getElementById * @param {Element} el Remove data for an element * @private */ vjs.removeData = function(el){ var id = el[vjs.expando]; if (!id) { return; } // Remove all stored data // Changed to = null // http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/ // vjs.cache[id] = null; delete vjs.cache[id]; // Remove the expando property from the DOM node try { delete el[vjs.expando]; } catch(e) { if (el.removeAttribute) { el.removeAttribute(vjs.expando); } else { // IE doesn't appear to support removeAttribute on the document element el[vjs.expando] = null; } } }; /** * Check if an object is empty * @param {Object} obj The object to check for emptiness * @return {Boolean} * @private */ vjs.isEmpty = function(obj) { for (var prop in obj) { // Inlude null properties as empty. if (obj[prop] !== null) { return false; } } return true; }; /** * Add a CSS class name to an element * @param {Element} element Element to add class name to * @param {String} classToAdd Classname to add * @private */ vjs.addClass = function(element, classToAdd){ if ((' '+element.className+' ').indexOf(' '+classToAdd+' ') == -1) { element.className = element.className === '' ? classToAdd : element.className + ' ' + classToAdd; } }; /** * Remove a CSS class name from an element * @param {Element} element Element to remove from class name * @param {String} classToAdd Classname to remove * @private */ vjs.removeClass = function(element, classToRemove){ var classNames, i; if (element.className.indexOf(classToRemove) == -1) { return; } classNames = element.className.split(' '); // no arr.indexOf in ie8, and we don't want to add a big shim for (i = classNames.length - 1; i >= 0; i--) { if (classNames[i] === classToRemove) { classNames.splice(i,1); } } element.className = classNames.join(' '); }; /** * Element for testing browser HTML5 video capabilities * @type {Element} * @constant * @private */ vjs.TEST_VID = vjs.createEl('video'); /** * Useragent for browser testing. * @type {String} * @constant * @private */ vjs.USER_AGENT = navigator.userAgent; /** * Device is an iPhone * @type {Boolean} * @constant * @private */ vjs.IS_IPHONE = (/iPhone/i).test(vjs.USER_AGENT); vjs.IS_IPAD = (/iPad/i).test(vjs.USER_AGENT); vjs.IS_IPOD = (/iPod/i).test(vjs.USER_AGENT); vjs.IS_IOS = vjs.IS_IPHONE || vjs.IS_IPAD || vjs.IS_IPOD; vjs.IOS_VERSION = (function(){ var match = vjs.USER_AGENT.match(/OS (\d+)_/i); if (match && match[1]) { return match[1]; } })(); vjs.IS_ANDROID = (/Android/i).test(vjs.USER_AGENT); vjs.ANDROID_VERSION = (function() { // This matches Android Major.Minor.Patch versions // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned var match = vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i), major, minor; if (!match) { return null; } major = match[1] && parseFloat(match[1]); minor = match[2] && parseFloat(match[2]); if (major && minor) { return parseFloat(match[1] + '.' + match[2]); } else if (major) { return major; } else { return null; } })(); // Old Android is defined as Version older than 2.3, and requiring a webkit version of the android browser vjs.IS_OLD_ANDROID = vjs.IS_ANDROID && (/webkit/i).test(vjs.USER_AGENT) && vjs.ANDROID_VERSION < 2.3; vjs.IS_FIREFOX = (/Firefox/i).test(vjs.USER_AGENT); vjs.IS_CHROME = (/Chrome/i).test(vjs.USER_AGENT); vjs.TOUCH_ENABLED = !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch); /** * Get an element's attribute values, as defined on the HTML tag * Attributs are not the same as properties. They're defined on the tag * or with setAttribute (which shouldn't be used with HTML) * This will return true or false for boolean attributes. * @param {Element} tag Element from which to get tag attributes * @return {Object} * @private */ vjs.getAttributeValues = function(tag){ var obj, knownBooleans, attrs, attrName, attrVal; obj = {}; // known boolean attributes // we can check for matching boolean properties, but older browsers // won't know about HTML5 boolean attributes that we still read from knownBooleans = ','+'autoplay,controls,loop,muted,default'+','; if (tag && tag.attributes && tag.attributes.length > 0) { attrs = tag.attributes; for (var i = attrs.length - 1; i >= 0; i--) { attrName = attrs[i].name; attrVal = attrs[i].value; // check for known booleans // the matching element property will return a value for typeof if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(','+attrName+',') !== -1) { // the value of an included boolean attribute is typically an empty // string ('') which would equal false if we just check for a false value. // we also don't want support bad code like autoplay='false' attrVal = (attrVal !== null) ? true : false; } obj[attrName] = attrVal; } } return obj; }; /** * Get the computed style value for an element * From http://robertnyman.com/2006/04/24/get-the-rendered-style-of-an-element/ * @param {Element} el Element to get style value for * @param {String} strCssRule Style name * @return {String} Style value * @private */ vjs.getComputedDimension = function(el, strCssRule){ var strValue = ''; if(document.defaultView && document.defaultView.getComputedStyle){ strValue = document.defaultView.getComputedStyle(el, '').getPropertyValue(strCssRule); } else if(el.currentStyle){ // IE8 Width/Height support strValue = el['client'+strCssRule.substr(0,1).toUpperCase() + strCssRule.substr(1)] + 'px'; } return strValue; }; /** * Insert an element as the first child node of another * @param {Element} child Element to insert * @param {[type]} parent Element to insert child into * @private */ vjs.insertFirst = function(child, parent){ if (parent.firstChild) { parent.insertBefore(child, parent.firstChild); } else { parent.appendChild(child); } }; /** * Object to hold browser support information * @type {Object} * @private */ vjs.support = {}; /** * Shorthand for document.getElementById() * Also allows for CSS (jQuery) ID syntax. But nothing other than IDs. * @param {String} id Element ID * @return {Element} Element with supplied ID * @private */ vjs.el = function(id){ if (id.indexOf('#') === 0) { id = id.slice(1); } return document.getElementById(id); }; /** * Format seconds as a time string, H:MM:SS or M:SS * Supplying a guide (in seconds) will force a number of leading zeros * to cover the length of the guide * @param {Number} seconds Number of seconds to be turned into a string * @param {Number} guide Number (in seconds) to model the string after * @return {String} Time formatted as H:MM:SS or M:SS * @private */ vjs.formatTime = function(seconds, guide) { // Default to using seconds as guide guide = guide || seconds; var s = Math.floor(seconds % 60), m = Math.floor(seconds / 60 % 60), h = Math.floor(seconds / 3600), gm = Math.floor(guide / 60 % 60), gh = Math.floor(guide / 3600); // handle invalid times if (isNaN(seconds) || seconds === Infinity) { // '-' is false for all relational operators (e.g. <, >=) so this setting // will add the minimum number of fields specified by the guide h = m = s = '-'; } // Check if we need to show hours h = (h > 0 || gh > 0) ? h + ':' : ''; // If hours are showing, we may need to add a leading zero. // Always show at least one digit of minutes. m = (((h || gm >= 10) && m < 10) ? '0' + m : m) + ':'; // Check if leading zero is need for seconds s = (s < 10) ? '0' + s : s; return h + m + s; }; // Attempt to block the ability to select text while dragging controls vjs.blockTextSelection = function(){ document.body.focus(); document.onselectstart = function () { return false; }; }; // Turn off text selection blocking vjs.unblockTextSelection = function(){ document.onselectstart = function () { return true; }; }; /** * Trim whitespace from the ends of a string. * @param {String} string String to trim * @return {String} Trimmed string * @private */ vjs.trim = function(str){ return (str+'').replace(/^\s+|\s+$/g, ''); }; /** * Should round off a number to a decimal place * @param {Number} num Number to round * @param {Number} dec Number of decimal places to round to * @return {Number} Rounded number * @private */ vjs.round = function(num, dec) { if (!dec) { dec = 0; } return Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); }; /** * Should create a fake TimeRange object * Mimics an HTML5 time range instance, which has functions that * return the start and end times for a range * TimeRanges are returned by the buffered() method * @param {Number} start Start time in seconds * @param {Number} end End time in seconds * @return {Object} Fake TimeRange object * @private */ vjs.createTimeRange = function(start, end){ return { length: 1, start: function() { return start; }, end: function() { return end; } }; }; /** * Simple http request for retrieving external files (e.g. text tracks) * @param {String} url URL of resource * @param {Function=} onSuccess Success callback * @param {Function=} onError Error callback * @private */ vjs.get = function(url, onSuccess, onError){ var local, request; if (typeof XMLHttpRequest === 'undefined') { window.XMLHttpRequest = function () { try { return new window.ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch (e) {} try { return new window.ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch (f) {} try { return new window.ActiveXObject('Msxml2.XMLHTTP'); } catch (g) {} throw new Error('This browser does not support XMLHttpRequest.'); }; } request = new XMLHttpRequest(); try { request.open('GET', url); } catch(e) { onError(e); } local = (url.indexOf('file:') === 0 || (window.location.href.indexOf('file:') === 0 && url.indexOf('http') === -1)); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200 || local && request.status === 0) { onSuccess(request.responseText); } else { if (onError) { onError(); } } } }; try { request.send(); } catch(e) { if (onError) { onError(e); } } }; /** * Add to local storage (may removeable) * @private */ vjs.setLocalStorage = function(key, value){ try { // IE was throwing errors referencing the var anywhere without this var localStorage = window.localStorage || false; if (!localStorage) { return; } localStorage[key] = value; } catch(e) { if (e.code == 22 || e.code == 1014) { // Webkit == 22 / Firefox == 1014 vjs.log('LocalStorage Full (VideoJS)', e); } else { if (e.code == 18) { vjs.log('LocalStorage not allowed (VideoJS)', e); } else { vjs.log('LocalStorage Error (VideoJS)', e); } } } }; /** * Get abosolute version of relative URL. Used to tell flash correct URL. * http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue * @param {String} url URL to make absolute * @return {String} Absolute URL * @private */ vjs.getAbsoluteURL = function(url){ // Check if absolute URL if (!url.match(/^https?:\/\//)) { // Convert to absolute URL. Flash hosted off-site needs an absolute URL. url = vjs.createEl('div', { innerHTML: '<a href="'+url+'">x</a>' }).firstChild.href; } return url; }; // usage: log('inside coolFunc',this,arguments); // http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ vjs.log = function(){ vjs.log.history = vjs.log.history || []; // store logs to an array for reference vjs.log.history.push(arguments); if(window.console){ window.console.log(Array.prototype.slice.call(arguments)); } }; // Offset Left // getBoundingClientRect technique from John Resig http://ejohn.org/blog/getboundingclientrect-is-awesome/ vjs.findPosition = function(el) { var box, docEl, body, clientLeft, scrollLeft, left, clientTop, scrollTop, top; if (el.getBoundingClientRect && el.parentNode) { box = el.getBoundingClientRect(); } if (!box) { return { left: 0, top: 0 }; } docEl = document.documentElement; body = document.body; clientLeft = docEl.clientLeft || body.clientLeft || 0; scrollLeft = window.pageXOffset || body.scrollLeft; left = box.left + scrollLeft - clientLeft; clientTop = docEl.clientTop || body.clientTop || 0; scrollTop = window.pageYOffset || body.scrollTop; top = box.top + scrollTop - clientTop; return { left: left, top: top }; }; /** * Utility functions namespace * @namespace * @type {Object} */ vjs.util = {}; /** * Merge two options objects, * recursively merging any plain object properties as well. * Previously `deepMerge` * * @param {Object} obj1 Object to override values in * @param {Object} obj2 Overriding object * @return {Object} New object -- obj1 and obj2 will be untouched */ vjs.util.mergeOptions = function(obj1, obj2){ var key, val1, val2; // make a copy of obj1 so we're not ovewriting original values. // like prototype.options_ and all sub options objects obj1 = vjs.obj.copy(obj1); for (key in obj2){ if (obj2.hasOwnProperty(key)) { val1 = obj1[key]; val2 = obj2[key]; // Check if both properties are pure objects and do a deep merge if so if (vjs.obj.isPlain(val1) && vjs.obj.isPlain(val2)) { obj1[key] = vjs.util.mergeOptions(val1, val2); } else { obj1[key] = obj2[key]; } } } return obj1; }; /** * @fileoverview Player Component - Base class for all UI objects * */ /** * Base UI Component class * * Components are embeddable UI objects that are represented by both a * javascript object and an element in the DOM. They can be children of other * components, and can have many children themselves. * * // adding a button to the player * var button = player.addChild('button'); * button.el(); // -> button element * * <div class="video-js"> * <div class="vjs-button">Button</div> * </div> * * Components are also event emitters. * * button.on('click', function(){ * console.log('Button Clicked!'); * }); * * button.trigger('customevent'); * * @param {Object} player Main Player * @param {Object=} options * @class * @constructor * @extends vjs.CoreObject */ vjs.Component = vjs.CoreObject.extend({ /** * the constructor function for the class * * @constructor */ init: function(player, options, ready){ this.player_ = player; // Make a copy of prototype.options_ to protect against overriding global defaults this.options_ = vjs.obj.copy(this.options_); // Updated options with supplied options options = this.options(options); // Get ID from options, element, or create using player ID and unique ID this.id_ = options['id'] || ((options['el'] && options['el']['id']) ? options['el']['id'] : player.id() + '_component_' + vjs.guid++ ); this.name_ = options['name'] || null; // Create element if one wasn't provided in options this.el_ = options['el'] || this.createEl(); this.children_ = []; this.childIndex_ = {}; this.childNameIndex_ = {}; // Add any child components in options this.initChildren(); this.ready(ready); // Don't want to trigger ready here or it will before init is actually // finished for all children that run this constructor if (options.reportTouchActivity !== false) { this.enableTouchActivity(); } } }); /** * Dispose of the component and all child components */ vjs.Component.prototype.dispose = function(){ this.trigger({ type: 'dispose', 'bubbles': false }); // Dispose all children. if (this.children_) { for (var i = this.children_.length - 1; i >= 0; i--) { if (this.children_[i].dispose) { this.children_[i].dispose(); } } } // Delete child references this.children_ = null; this.childIndex_ = null; this.childNameIndex_ = null; // Remove all event listeners. this.off(); // Remove element from DOM if (this.el_.parentNode) { this.el_.parentNode.removeChild(this.el_); } vjs.removeData(this.el_); this.el_ = null; }; /** * Reference to main player instance * * @type {vjs.Player} * @private */ vjs.Component.prototype.player_ = true; /** * Return the component's player * * @return {vjs.Player} */ vjs.Component.prototype.player = function(){ return this.player_; }; /** * The component's options object * * @type {Object} * @private */ vjs.Component.prototype.options_; /** * Deep merge of options objects * * Whenever a property is an object on both options objects * the two properties will be merged using vjs.obj.deepMerge. * * This is used for merging options for child components. We * want it to be easy to override individual options on a child * component without having to rewrite all the other default options. * * Parent.prototype.options_ = { * children: { * 'childOne': { 'foo': 'bar', 'asdf': 'fdsa' }, * 'childTwo': {}, * 'childThree': {} * } * } * newOptions = { * children: { * 'childOne': { 'foo': 'baz', 'abc': '123' } * 'childTwo': null, * 'childFour': {} * } * } * * this.options(newOptions); * * RESULT * * { * children: { * 'childOne': { 'foo': 'baz', 'asdf': 'fdsa', 'abc': '123' }, * 'childTwo': null, // Disabled. Won't be initialized. * 'childThree': {}, * 'childFour': {} * } * } * * @param {Object} obj Object of new option values * @return {Object} A NEW object of this.options_ and obj merged */ vjs.Component.prototype.options = function(obj){ if (obj === undefined) return this.options_; return this.options_ = vjs.util.mergeOptions(this.options_, obj); }; /** * The DOM element for the component * * @type {Element} * @private */ vjs.Component.prototype.el_; /** * Create the component's DOM element * * @param {String=} tagName Element's node type. e.g. 'div' * @param {Object=} attributes An object of element attributes that should be set on the element * @return {Element} */ vjs.Component.prototype.createEl = function(tagName, attributes){ return vjs.createEl(tagName, attributes); }; /** * Get the component's DOM element * * var domEl = myComponent.el(); * * @return {Element} */ vjs.Component.prototype.el = function(){ return this.el_; }; /** * An optional element where, if defined, children will be inserted instead of * directly in `el_` * * @type {Element} * @private */ vjs.Component.prototype.contentEl_; /** * Return the component's DOM element for embedding content. * Will either be el_ or a new element defined in createEl. * * @return {Element} */ vjs.Component.prototype.contentEl = function(){ return this.contentEl_ || this.el_; }; /** * The ID for the component * * @type {String} * @private */ vjs.Component.prototype.id_; /** * Get the component's ID * * var id = myComponent.id(); * * @return {String} */ vjs.Component.prototype.id = function(){ return this.id_; }; /** * The name for the component. Often used to reference the component. * * @type {String} * @private */ vjs.Component.prototype.name_; /** * Get the component's name. The name is often used to reference the component. * * var name = myComponent.name(); * * @return {String} */ vjs.Component.prototype.name = function(){ return this.name_; }; /** * Array of child components * * @type {Array} * @private */ vjs.Component.prototype.children_; /** * Get an array of all child components * * var kids = myComponent.children(); * * @return {Array} The children */ vjs.Component.prototype.children = function(){ return this.children_; }; /** * Object of child components by ID * * @type {Object} * @private */ vjs.Component.prototype.childIndex_; /** * Returns a child component with the provided ID * * @return {vjs.Component} */ vjs.Component.prototype.getChildById = function(id){ return this.childIndex_[id]; }; /** * Object of child components by name * * @type {Object} * @private */ vjs.Component.prototype.childNameIndex_; /** * Returns a child component with the provided name * * @return {vjs.Component} */ vjs.Component.prototype.getChild = function(name){ return this.childNameIndex_[name]; }; /** * Adds a child component inside this component * * myComponent.el(); * // -> <div class='my-component'></div> * myComonent.children(); * // [empty array] * * var myButton = myComponent.addChild('MyButton'); * // -> <div class='my-component'><div class="my-button">myButton<div></div> * // -> myButton === myComonent.children()[0]; * * Pass in options for child constructors and options for children of the child * * var myButton = myComponent.addChild('MyButton', { * text: 'Press Me', * children: { * buttonChildExample: { * buttonChildOption: true * } * } * }); * * @param {String|vjs.Component} child The class name or instance of a child to add * @param {Object=} options Options, including options to be passed to children of the child. * @return {vjs.Component} The child component (created by this process if a string was used) * @suppress {accessControls|checkRegExp|checkTypes|checkVars|const|constantProperty|deprecated|duplicate|es5Strict|fileoverviewTags|globalThis|invalidCasts|missingProperties|nonStandardJsDocs|strictModuleDepCheck|undefinedNames|undefinedVars|unknownDefines|uselessCode|visibility} */ vjs.Component.prototype.addChild = function(child, options){ var component, componentClass, componentName, componentId; // If string, create new component with options if (typeof child === 'string') { componentName = child; // Make sure options is at least an empty object to protect against errors options = options || {}; // Assume name of set is a lowercased name of the UI Class (PlayButton, etc.) componentClass = options['componentClass'] || vjs.capitalize(componentName); // Set name through options options['name'] = componentName; // Create a new object & element for this controls set // If there's no .player_, this is a player // Closure Compiler throws an 'incomplete alias' warning if we use the vjs variable directly. // Every class should be exported, so this should never be a problem here. component = new window['videojs'][componentClass](this.player_ || this, options); // child is a component instance } else { component = child; } this.children_.push(component); if (typeof component.id === 'function') { this.childIndex_[component.id()] = component; } // If a name wasn't used to create the component, check if we can use the // name function of the component componentName = componentName || (component.name && component.name()); if (componentName) { this.childNameIndex_[componentName] = component; } // Add the UI object's element to the container div (box) // Having an element is not required if (typeof component['el'] === 'function' && component['el']()) { this.contentEl().appendChild(component['el']()); } // Return so it can stored on parent object if desired. return component; }; /** * Remove a child component from this component's list of children, and the * child component's element from this component's element * * @param {vjs.Component} component Component to remove */ vjs.Component.prototype.removeChild = function(component){ if (typeof component === 'string') { component = this.getChild(component); } if (!component || !this.children_) return; var childFound = false; for (var i = this.children_.length - 1; i >= 0; i--) { if (this.children_[i] === component) { childFound = true; this.children_.splice(i,1); break; } } if (!childFound) return; this.childIndex_[component.id] = null; this.childNameIndex_[component.name] = null; var compEl = component.el(); if (compEl && compEl.parentNode === this.contentEl()) { this.contentEl().removeChild(component.el()); } }; /** * Add and initialize default child components from options * * // when an instance of MyComponent is created, all children in options * // will be added to the instance by their name strings and options * MyComponent.prototype.options_.children = { * myChildComponent: { * myChildOption: true * } * } */ vjs.Component.prototype.initChildren = function(){ var options = this.options_; if (options && options['children']) { var self = this; // Loop through components and add them to the player vjs.obj.each(options['children'], function(name, opts){ // Allow for disabling default components // e.g. vjs.options['children']['posterImage'] = false if (opts === false) return; // Allow waiting to add components until a specific event is called var tempAdd = function(){ // Set property name on player. Could cause conflicts with other prop names, but it's worth making refs easy. self[name] = self.addChild(name, opts); }; if (opts['loadEvent']) { // this.one(opts.loadEvent, tempAdd) } else { tempAdd(); } }); } }; /** * Allows sub components to stack CSS class names * * @return {String} The constructed class name */ vjs.Component.prototype.buildCSSClass = function(){ // Child classes can include a function that does: // return 'CLASS NAME' + this._super(); return ''; }; /* Events ============================================================================= */ /** * Add an event listener to this component's element * * var myFunc = function(){ * var myPlayer = this; * // Do something when the event is fired * }; * * myPlayer.on("eventName", myFunc); * * The context will be the component. * * @param {String} type The event type e.g. 'click' * @param {Function} fn The event listener * @return {vjs.Component} self */ vjs.Component.prototype.on = function(type, fn){ vjs.on(this.el_, type, vjs.bind(this, fn)); return this; }; /** * Remove an event listener from the component's element * * myComponent.off("eventName", myFunc); * * @param {String=} type Event type. Without type it will remove all listeners. * @param {Function=} fn Event listener. Without fn it will remove all listeners for a type. * @return {vjs.Component} */ vjs.Component.prototype.off = function(type, fn){ vjs.off(this.el_, type, fn); return this; }; /** * Add an event listener to be triggered only once and then removed * * @param {String} type Event type * @param {Function} fn Event listener * @return {vjs.Component} */ vjs.Component.prototype.one = function(type, fn) { vjs.one(this.el_, type, vjs.bind(this, fn)); return this; }; /** * Trigger an event on an element * * myComponent.trigger('eventName'); * * @param {String} type The event type to trigger, e.g. 'click' * @param {Event|Object} event The event object to be passed to the listener * @return {vjs.Component} self */ vjs.Component.prototype.trigger = function(type, event){ vjs.trigger(this.el_, type, event); return this; }; /* Ready ================================================================================ */ /** * Is the component loaded * This can mean different things depending on the component. * * @private * @type {Boolean} */ vjs.Component.prototype.isReady_; /** * Trigger ready as soon as initialization is finished * * Allows for delaying ready. Override on a sub class prototype. * If you set this.isReadyOnInitFinish_ it will affect all components. * Specially used when waiting for the Flash player to asynchrnously load. * * @type {Boolean} * @private */ vjs.Component.prototype.isReadyOnInitFinish_ = true; /** * List of ready listeners * * @type {Array} * @private */ vjs.Component.prototype.readyQueue_; /** * Bind a listener to the component's ready state * * Different from event listeners in that if the ready event has already happend * it will trigger the function immediately. * * @param {Function} fn Ready listener * @return {vjs.Component} */ vjs.Component.prototype.ready = function(fn){ if (fn) { if (this.isReady_) { fn.call(this); } else { if (this.readyQueue_ === undefined) { this.readyQueue_ = []; } this.readyQueue_.push(fn); } } return this; }; /** * Trigger the ready listeners * * @return {vjs.Component} */ vjs.Component.prototype.triggerReady = function(){ this.isReady_ = true; var readyQueue = this.readyQueue_; if (readyQueue && readyQueue.length > 0) { for (var i = 0, j = readyQueue.length; i < j; i++) { readyQueue[i].call(this); } // Reset Ready Queue this.readyQueue_ = []; // Allow for using event listeners also, in case you want to do something everytime a source is ready. this.trigger('ready'); } }; /* Display ============================================================================= */ /** * Add a CSS class name to the component's element * * @param {String} classToAdd Classname to add * @return {vjs.Component} */ vjs.Component.prototype.addClass = function(classToAdd){ vjs.addClass(this.el_, classToAdd); return this; }; /** * Remove a CSS class name from the component's element * * @param {String} classToRemove Classname to remove * @return {vjs.Component} */ vjs.Component.prototype.removeClass = function(classToRemove){ vjs.removeClass(this.el_, classToRemove); return this; }; /** * Show the component element if hidden * * @return {vjs.Component} */ vjs.Component.prototype.show = function(){ this.el_.style.display = 'block'; return this; }; /** * Hide the component element if currently showing * * @return {vjs.Component} */ vjs.Component.prototype.hide = function(){ this.el_.style.display = 'none'; return this; }; /** * Lock an item in its visible state * To be used with fadeIn/fadeOut. * * @return {vjs.Component} * @private */ vjs.Component.prototype.lockShowing = function(){ this.addClass('vjs-lock-showing'); return this; }; /** * Unlock an item to be hidden * To be used with fadeIn/fadeOut. * * @return {vjs.Component} * @private */ vjs.Component.prototype.unlockShowing = function(){ this.removeClass('vjs-lock-showing'); return this; }; /** * Disable component by making it unshowable * * Currently private because we're movign towards more css-based states. * @private */ vjs.Component.prototype.disable = function(){ this.hide(); this.show = function(){}; }; /** * Set or get the width of the component (CSS values) * * Setting the video tag dimension values only works with values in pixels. * Percent values will not work. * Some percents can be used, but width()/height() will return the number + %, * not the actual computed width/height. * * @param {Number|String=} num Optional width number * @param {Boolean} skipListeners Skip the 'resize' event trigger * @return {vjs.Component} This component, when setting the width * @return {Number|String} The width, when getting */ vjs.Component.prototype.width = function(num, skipListeners){ return this.dimension('width', num, skipListeners); }; /** * Get or set the height of the component (CSS values) * * Setting the video tag dimension values only works with values in pixels. * Percent values will not work. * Some percents can be used, but width()/height() will return the number + %, * not the actual computed width/height. * * @param {Number|String=} num New component height * @param {Boolean=} skipListeners Skip the resize event trigger * @return {vjs.Component} This component, when setting the height * @return {Number|String} The height, when getting */ vjs.Component.prototype.height = function(num, skipListeners){ return this.dimension('height', num, skipListeners); }; /** * Set both width and height at the same time * * @param {Number|String} width * @param {Number|String} height * @return {vjs.Component} The component */ vjs.Component.prototype.dimensions = function(width, height){ // Skip resize listeners on width for optimization return this.width(width, true).height(height); }; /** * Get or set width or height * * This is the shared code for the width() and height() methods. * All for an integer, integer + 'px' or integer + '%'; * * Known issue: Hidden elements officially have a width of 0. We're defaulting * to the style.width value and falling back to computedStyle which has the * hidden element issue. Info, but probably not an efficient fix: * http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/ * * @param {String} widthOrHeight 'width' or 'height' * @param {Number|String=} num New dimension * @param {Boolean=} skipListeners Skip resize event trigger * @return {vjs.Component} The component if a dimension was set * @return {Number|String} The dimension if nothing was set * @private */ vjs.Component.prototype.dimension = function(widthOrHeight, num, skipListeners){ if (num !== undefined) { // Check if using css width/height (% or px) and adjust if ((''+num).indexOf('%') !== -1 || (''+num).indexOf('px') !== -1) { this.el_.style[widthOrHeight] = num; } else if (num === 'auto') { this.el_.style[widthOrHeight] = ''; } else { this.el_.style[widthOrHeight] = num+'px'; } // skipListeners allows us to avoid triggering the resize event when setting both width and height if (!skipListeners) { this.trigger('resize'); } // Return component return this; } // Not setting a value, so getting it // Make sure element exists if (!this.el_) return 0; // Get dimension value from style var val = this.el_.style[widthOrHeight]; var pxIndex = val.indexOf('px'); if (pxIndex !== -1) { // Return the pixel value with no 'px' return parseInt(val.slice(0,pxIndex), 10); // No px so using % or no style was set, so falling back to offsetWidth/height // If component has display:none, offset will return 0 // TODO: handle display:none and no dimension style using px } else { return parseInt(this.el_['offset'+vjs.capitalize(widthOrHeight)], 10); // ComputedStyle version. // Only difference is if the element is hidden it will return // the percent value (e.g. '100%'') // instead of zero like offsetWidth returns. // var val = vjs.getComputedStyleValue(this.el_, widthOrHeight); // var pxIndex = val.indexOf('px'); // if (pxIndex !== -1) { // return val.slice(0, pxIndex); // } else { // return val; // } } }; /** * Fired when the width and/or height of the component changes * @event resize */ vjs.Component.prototype.onResize; /** * Emit 'tap' events when touch events are supported * * This is used to support toggling the controls through a tap on the video. * * We're requireing them to be enabled because otherwise every component would * have this extra overhead unnecessarily, on mobile devices where extra * overhead is especially bad. * @private */ vjs.Component.prototype.emitTapEvents = function(){ var touchStart, touchTime, couldBeTap, noTap; // Track the start time so we can determine how long the touch lasted touchStart = 0; this.on('touchstart', function(event) { // Record start time so we can detect a tap vs. "touch and hold" touchStart = new Date().getTime(); // Reset couldBeTap tracking couldBeTap = true; }); noTap = function(){ couldBeTap = false; }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s this.on('touchmove', noTap); this.on('touchleave', noTap); this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate // event this.on('touchend', function(event) { // Proceed only if the touchmove/leave/cancel event didn't happen if (couldBeTap === true) { // Measure how long the touch lasted touchTime = new Date().getTime() - touchStart; // The touch needs to be quick in order to consider it a tap if (touchTime < 250) { this.trigger('tap'); // It may be good to copy the touchend event object and change the // type to tap, if the other event properties aren't exact after // vjs.fixEvent runs (e.g. event.target) } } }); }; /** * Report user touch activity when touch events occur * * User activity is used to determine when controls should show/hide. It's * relatively simple when it comes to mouse events, because any mouse event * should show the controls. So we capture mouse events that bubble up to the * player and report activity when that happens. * * With touch events it isn't as easy. We can't rely on touch events at the * player level, because a tap (touchstart + touchend) on the video itself on * mobile devices is meant to turn controls off (and on). User activity is * checked asynchronously, so what could happen is a tap event on the video * turns the controls off, then the touchend event bubbles up to the player, * which if it reported user activity, would turn the controls right back on. * (We also don't want to completely block touch events from bubbling up) * * Also a touchmove, touch+hold, and anything other than a tap is not supposed * to turn the controls back on on a mobile device. * * Here we're setting the default component behavior to report user activity * whenever touch events happen, and this can be turned off by components that * want touch events to act differently. */ vjs.Component.prototype.enableTouchActivity = function() { var report, touchHolding, touchEnd; // listener for reporting that the user is active report = vjs.bind(this.player(), this.player().reportUserActivity); this.on('touchstart', function() { report(); // For as long as the they are touching the device or have their mouse down, // we consider them active even if they're not moving their finger or mouse. // So we want to continue to update that they are active clearInterval(touchHolding); // report at the same interval as activityCheck touchHolding = setInterval(report, 250); }); touchEnd = function(event) { report(); // stop the interval that maintains activity if the touch is holding clearInterval(touchHolding); }; this.on('touchmove', report); this.on('touchend', touchEnd); this.on('touchcancel', touchEnd); }; /* Button - Base class for all buttons ================================================================================ */ /** * Base class for all buttons * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor */ vjs.Button = vjs.Component.extend({ /** * @constructor * @inheritDoc */ init: function(player, options){ vjs.Component.call(this, player, options); var touchstart = false; this.on('touchstart', function(event) { // Stop click and other mouse events from triggering also event.preventDefault(); touchstart = true; }); this.on('touchmove', function() { touchstart = false; }); var self = this; this.on('touchend', function(event) { if (touchstart) { self.onClick(event); } event.preventDefault(); }); this.on('click', this.onClick); this.on('focus', this.onFocus); this.on('blur', this.onBlur); } }); vjs.Button.prototype.createEl = function(type, props){ // Add standard Aria and Tabindex info props = vjs.obj.merge({ className: this.buildCSSClass(), innerHTML: '<div class="vjs-control-content"><span class="vjs-control-text">' + (this.buttonText || 'Need Text') + '</span></div>', 'role': 'button', 'aria-live': 'polite', // let the screen reader user know that the text of the button may change tabIndex: 0 }, props); return vjs.Component.prototype.createEl.call(this, type, props); }; vjs.Button.prototype.buildCSSClass = function(){ // TODO: Change vjs-control to vjs-button? return 'vjs-control ' + vjs.Component.prototype.buildCSSClass.call(this); }; // Click - Override with specific functionality for button vjs.Button.prototype.onClick = function(){}; // Focus - Add keyboard functionality to element vjs.Button.prototype.onFocus = function(){ vjs.on(document, 'keyup', vjs.bind(this, this.onKeyPress)); }; // KeyPress (document level) - Trigger click when keys are pressed vjs.Button.prototype.onKeyPress = function(event){ // Check for space bar (32) or enter (13) keys if (event.which == 32 || event.which == 13) { event.preventDefault(); this.onClick(); } }; // Blur - Remove keyboard triggers vjs.Button.prototype.onBlur = function(){ vjs.off(document, 'keyup', vjs.bind(this, this.onKeyPress)); }; /* Slider ================================================================================ */ /** * The base functionality for sliders like the volume bar and seek bar * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.Slider = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); // Set property names to bar and handle to match with the child Slider class is looking for this.bar = this.getChild(this.options_['barName']); this.handle = this.getChild(this.options_['handleName']); player.on(this.playerEvent, vjs.bind(this, this.update)); this.on('mousedown', this.onMouseDown); this.on('touchstart', this.onMouseDown); this.on('focus', this.onFocus); this.on('blur', this.onBlur); this.on('click', this.onClick); this.player_.on('controlsvisible', vjs.bind(this, this.update)); // This is actually to fix the volume handle position. http://twitter.com/#!/gerritvanaaken/status/159046254519787520 // this.player_.one('timeupdate', vjs.bind(this, this.update)); player.ready(vjs.bind(this, this.update)); this.boundEvents = {}; } }); vjs.Slider.prototype.createEl = function(type, props) { props = props || {}; // Add the slider element class to all sub classes props.className = props.className + ' vjs-slider'; props = vjs.obj.merge({ 'role': 'slider', 'aria-valuenow': 0, 'aria-valuemin': 0, 'aria-valuemax': 100, tabIndex: 0 }, props); return vjs.Component.prototype.createEl.call(this, type, props); }; vjs.Slider.prototype.onMouseDown = function(event){ event.preventDefault(); vjs.blockTextSelection(); this.boundEvents.move = vjs.bind(this, this.onMouseMove); this.boundEvents.end = vjs.bind(this, this.onMouseUp); vjs.on(document, 'mousemove', this.boundEvents.move); vjs.on(document, 'mouseup', this.boundEvents.end); vjs.on(document, 'touchmove', this.boundEvents.move); vjs.on(document, 'touchend', this.boundEvents.end); this.onMouseMove(event); }; vjs.Slider.prototype.onMouseUp = function() { vjs.unblockTextSelection(); vjs.off(document, 'mousemove', this.boundEvents.move, false); vjs.off(document, 'mouseup', this.boundEvents.end, false); vjs.off(document, 'touchmove', this.boundEvents.move, false); vjs.off(document, 'touchend', this.boundEvents.end, false); this.update(); }; vjs.Slider.prototype.update = function(){ // In VolumeBar init we have a setTimeout for update that pops and update to the end of the // execution stack. The player is destroyed before then update will cause an error if (!this.el_) return; // If scrubbing, we could use a cached value to make the handle keep up with the user's mouse. // On HTML5 browsers scrubbing is really smooth, but some flash players are slow, so we might want to utilize this later. // var progress = (this.player_.scrubbing) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration(); var barProgress, progress = this.getPercent(), handle = this.handle, bar = this.bar; // Protect against no duration and other division issues if (isNaN(progress)) { progress = 0; } barProgress = progress; // If there is a handle, we need to account for the handle in our calculation for progress bar // so that it doesn't fall short of or extend past the handle. if (handle) { var box = this.el_, boxWidth = box.offsetWidth, handleWidth = handle.el().offsetWidth, // The width of the handle in percent of the containing box // In IE, widths may not be ready yet causing NaN handlePercent = (handleWidth) ? handleWidth / boxWidth : 0, // Get the adjusted size of the box, considering that the handle's center never touches the left or right side. // There is a margin of half the handle's width on both sides. boxAdjustedPercent = 1 - handlePercent, // Adjust the progress that we'll use to set widths to the new adjusted box width adjustedProgress = progress * boxAdjustedPercent; // The bar does reach the left side, so we need to account for this in the bar's width barProgress = adjustedProgress + (handlePercent / 2); // Move the handle from the left based on the adjected progress handle.el().style.left = vjs.round(adjustedProgress * 100, 2) + '%'; } // Set the new bar width bar.el().style.width = vjs.round(barProgress * 100, 2) + '%'; }; vjs.Slider.prototype.calculateDistance = function(event){ var el, box, boxX, boxY, boxW, boxH, handle, pageX, pageY; el = this.el_; box = vjs.findPosition(el); boxW = boxH = el.offsetWidth; handle = this.handle; if (this.options_.vertical) { boxY = box.top; if (event.changedTouches) { pageY = event.changedTouches[0].pageY; } else { pageY = event.pageY; } if (handle) { var handleH = handle.el().offsetHeight; // Adjusted X and Width, so handle doesn't go outside the bar boxY = boxY + (handleH / 2); boxH = boxH - handleH; } // Percent that the click is through the adjusted area return Math.max(0, Math.min(1, ((boxY - pageY) + boxH) / boxH)); } else { boxX = box.left; if (event.changedTouches) { pageX = event.changedTouches[0].pageX; } else { pageX = event.pageX; } if (handle) { var handleW = handle.el().offsetWidth; // Adjusted X and Width, so handle doesn't go outside the bar boxX = boxX + (handleW / 2); boxW = boxW - handleW; } // Percent that the click is through the adjusted area return Math.max(0, Math.min(1, (pageX - boxX) / boxW)); } }; vjs.Slider.prototype.onFocus = function(){ vjs.on(document, 'keyup', vjs.bind(this, this.onKeyPress)); }; vjs.Slider.prototype.onKeyPress = function(event){ if (event.which == 37) { // Left Arrow event.preventDefault(); this.stepBack(); } else if (event.which == 39) { // Right Arrow event.preventDefault(); this.stepForward(); } }; vjs.Slider.prototype.onBlur = function(){ vjs.off(document, 'keyup', vjs.bind(this, this.onKeyPress)); }; /** * Listener for click events on slider, used to prevent clicks * from bubbling up to parent elements like button menus. * @param {Object} event Event object */ vjs.Slider.prototype.onClick = function(event){ event.stopImmediatePropagation(); event.preventDefault(); }; /** * SeekBar Behavior includes play progress bar, and seek handle * Needed so it can determine seek position based on handle position/size * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.SliderHandle = vjs.Component.extend(); /** * Default value of the slider * * @type {Number} * @private */ vjs.SliderHandle.prototype.defaultValue = 0; /** @inheritDoc */ vjs.SliderHandle.prototype.createEl = function(type, props) { props = props || {}; // Add the slider element class to all sub classes props.className = props.className + ' vjs-slider-handle'; props = vjs.obj.merge({ innerHTML: '<span class="vjs-control-text">'+this.defaultValue+'</span>' }, props); return vjs.Component.prototype.createEl.call(this, 'div', props); }; /* Menu ================================================================================ */ /** * The Menu component is used to build pop up menus, including subtitle and * captions selection menus. * * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor */ vjs.Menu = vjs.Component.extend(); /** * Add a menu item to the menu * @param {Object|String} component Component or component type to add */ vjs.Menu.prototype.addItem = function(component){ this.addChild(component); component.on('click', vjs.bind(this, function(){ this.unlockShowing(); })); }; /** @inheritDoc */ vjs.Menu.prototype.createEl = function(){ var contentElType = this.options().contentElType || 'ul'; this.contentEl_ = vjs.createEl(contentElType, { className: 'vjs-menu-content' }); var el = vjs.Component.prototype.createEl.call(this, 'div', { append: this.contentEl_, className: 'vjs-menu' }); el.appendChild(this.contentEl_); // Prevent clicks from bubbling up. Needed for Menu Buttons, // where a click on the parent is significant vjs.on(el, 'click', function(event){ event.preventDefault(); event.stopImmediatePropagation(); }); return el; }; /** * The component for a menu item. `<li>` * * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor */ vjs.MenuItem = vjs.Button.extend({ /** @constructor */ init: function(player, options){ vjs.Button.call(this, player, options); this.selected(options['selected']); } }); /** @inheritDoc */ vjs.MenuItem.prototype.createEl = function(type, props){ return vjs.Button.prototype.createEl.call(this, 'li', vjs.obj.merge({ className: 'vjs-menu-item', innerHTML: this.options_['label'] }, props)); }; /** * Handle a click on the menu item, and set it to selected */ vjs.MenuItem.prototype.onClick = function(){ this.selected(true); }; /** * Set this menu item as selected or not * @param {Boolean} selected */ vjs.MenuItem.prototype.selected = function(selected){ if (selected) { this.addClass('vjs-selected'); this.el_.setAttribute('aria-selected',true); } else { this.removeClass('vjs-selected'); this.el_.setAttribute('aria-selected',false); } }; /** * A button class with a popup menu * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.MenuButton = vjs.Button.extend({ /** @constructor */ init: function(player, options){ vjs.Button.call(this, player, options); this.menu = this.createMenu(); // Add list to element this.addChild(this.menu); // Automatically hide empty menu buttons if (this.items && this.items.length === 0) { this.hide(); } this.on('keyup', this.onKeyPress); this.el_.setAttribute('aria-haspopup', true); this.el_.setAttribute('role', 'button'); } }); /** * Track the state of the menu button * @type {Boolean} * @private */ vjs.MenuButton.prototype.buttonPressed_ = false; vjs.MenuButton.prototype.createMenu = function(){ var menu = new vjs.Menu(this.player_); // Add a title list item to the top if (this.options().title) { menu.el().appendChild(vjs.createEl('li', { className: 'vjs-menu-title', innerHTML: vjs.capitalize(this.kind_), tabindex: -1 })); } this.items = this['createItems'](); if (this.items) { // Add menu items to the menu for (var i = 0; i < this.items.length; i++) { menu.addItem(this.items[i]); } } return menu; }; /** * Create the list of menu items. Specific to each subclass. */ vjs.MenuButton.prototype.createItems = function(){}; /** @inheritDoc */ vjs.MenuButton.prototype.buildCSSClass = function(){ return this.className + ' vjs-menu-button ' + vjs.Button.prototype.buildCSSClass.call(this); }; // Focus - Add keyboard functionality to element // This function is not needed anymore. Instead, the keyboard functionality is handled by // treating the button as triggering a submenu. When the button is pressed, the submenu // appears. Pressing the button again makes the submenu disappear. vjs.MenuButton.prototype.onFocus = function(){}; // Can't turn off list display that we turned on with focus, because list would go away. vjs.MenuButton.prototype.onBlur = function(){}; vjs.MenuButton.prototype.onClick = function(){ // When you click the button it adds focus, which will show the menu indefinitely. // So we'll remove focus when the mouse leaves the button. // Focus is needed for tab navigation. this.one('mouseout', vjs.bind(this, function(){ this.menu.unlockShowing(); this.el_.blur(); })); if (this.buttonPressed_){ this.unpressButton(); } else { this.pressButton(); } }; vjs.MenuButton.prototype.onKeyPress = function(event){ event.preventDefault(); // Check for space bar (32) or enter (13) keys if (event.which == 32 || event.which == 13) { if (this.buttonPressed_){ this.unpressButton(); } else { this.pressButton(); } // Check for escape (27) key } else if (event.which == 27){ if (this.buttonPressed_){ this.unpressButton(); } } }; vjs.MenuButton.prototype.pressButton = function(){ this.buttonPressed_ = true; this.menu.lockShowing(); this.el_.setAttribute('aria-pressed', true); if (this.items && this.items.length > 0) { this.items[0].el().focus(); // set the focus to the title of the submenu } }; vjs.MenuButton.prototype.unpressButton = function(){ this.buttonPressed_ = false; this.menu.unlockShowing(); this.el_.setAttribute('aria-pressed', false); }; /** * An instance of the `vjs.Player` class is created when any of the Video.js setup methods are used to initialize a video. * * ```js * var myPlayer = videojs('example_video_1'); * ``` * * In the follwing example, the `data-setup` attribute tells the Video.js library to create a player instance when the library is ready. * * ```html * <video id="example_video_1" data-setup='{}' controls> * <source src="my-source.mp4" type="video/mp4"> * </video> * ``` * * After an instance has been created it can be accessed globally using `Video('example_video_1')`. * * @class * @extends vjs.Component */ vjs.Player = vjs.Component.extend({ /** * player's constructor function * * @constructs * @method init * @param {Element} tag The original video tag used for configuring options * @param {Object=} options Player options * @param {Function=} ready Ready callback function */ init: function(tag, options, ready){ this.tag = tag; // Store the original tag used to set options // Make sure tag ID exists tag.id = tag.id || 'vjs_video_' + vjs.guid++; // Set Options // The options argument overrides options set in the video tag // which overrides globally set options. // This latter part coincides with the load order // (tag must exist before Player) options = vjs.obj.merge(this.getTagSettings(tag), options); // Cache for video property values. this.cache_ = {}; // Set poster this.poster_ = options['poster']; // Set controls this.controls_ = options['controls']; // Original tag settings stored in options // now remove immediately so native controls don't flash. // May be turned back on by HTML5 tech if nativeControlsForTouch is true tag.controls = false; // we don't want the player to report touch activity on itself // see enableTouchActivity in Component options.reportTouchActivity = false; // Run base component initializing with new options. // Builds the element through createEl() // Inits and embeds any child components in opts vjs.Component.call(this, this, options, ready); // Update controls className. Can't do this when the controls are initially // set because the element doesn't exist yet. if (this.controls()) { this.addClass('vjs-controls-enabled'); } else { this.addClass('vjs-controls-disabled'); } // TODO: Make this smarter. Toggle user state between touching/mousing // using events, since devices can have both touch and mouse events. // if (vjs.TOUCH_ENABLED) { // this.addClass('vjs-touch-enabled'); // } // Firstplay event implimentation. Not sold on the event yet. // Could probably just check currentTime==0? this.one('play', function(e){ var fpEvent = { type: 'firstplay', target: this.el_ }; // Using vjs.trigger so we can check if default was prevented var keepGoing = vjs.trigger(this.el_, fpEvent); if (!keepGoing) { e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); } }); this.on('ended', this.onEnded); this.on('play', this.onPlay); this.on('firstplay', this.onFirstPlay); this.on('pause', this.onPause); this.on('progress', this.onProgress); this.on('durationchange', this.onDurationChange); this.on('error', this.onError); this.on('fullscreenchange', this.onFullscreenChange); // Make player easily findable by ID vjs.players[this.id_] = this; if (options['plugins']) { vjs.obj.each(options['plugins'], function(key, val){ this[key](val); }, this); } this.listenForUserActivity(); } }); /** * Player instance options, surfaced using vjs.options * vjs.options = vjs.Player.prototype.options_ * Make changes in vjs.options, not here. * All options should use string keys so they avoid * renaming by closure compiler * @type {Object} * @private */ vjs.Player.prototype.options_ = vjs.options; /** * Destroys the video player and does any necessary cleanup * * myPlayer.dispose(); * * This is especially helpful if you are dynamically adding and removing videos * to/from the DOM. */ vjs.Player.prototype.dispose = function(){ this.trigger('dispose'); // prevent dispose from being called twice this.off('dispose'); // Kill reference to this player vjs.players[this.id_] = null; if (this.tag && this.tag['player']) { this.tag['player'] = null; } if (this.el_ && this.el_['player']) { this.el_['player'] = null; } // Ensure that tracking progress and time progress will stop and plater deleted this.stopTrackingProgress(); this.stopTrackingCurrentTime(); if (this.tech) { this.tech.dispose(); } // Component dispose vjs.Component.prototype.dispose.call(this); }; vjs.Player.prototype.getTagSettings = function(tag){ var options = { 'sources': [], 'tracks': [] }; vjs.obj.merge(options, vjs.getAttributeValues(tag)); // Get tag children settings if (tag.hasChildNodes()) { var children, child, childName, i, j; children = tag.childNodes; for (i=0,j=children.length; i<j; i++) { child = children[i]; // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/ childName = child.nodeName.toLowerCase(); if (childName === 'source') { options['sources'].push(vjs.getAttributeValues(child)); } else if (childName === 'track') { options['tracks'].push(vjs.getAttributeValues(child)); } } } return options; }; vjs.Player.prototype.createEl = function(){ var el = this.el_ = vjs.Component.prototype.createEl.call(this, 'div'); var tag = this.tag; // Remove width/height attrs from tag so CSS can make it 100% width/height tag.removeAttribute('width'); tag.removeAttribute('height'); // Empty video tag tracks so the built-in player doesn't use them also. // This may not be fast enough to stop HTML5 browsers from reading the tags // so we'll need to turn off any default tracks if we're manually doing // captions and subtitles. videoElement.textTracks if (tag.hasChildNodes()) { var nodes, nodesLength, i, node, nodeName, removeNodes; nodes = tag.childNodes; nodesLength = nodes.length; removeNodes = []; while (nodesLength--) { node = nodes[nodesLength]; nodeName = node.nodeName.toLowerCase(); if (nodeName === 'track') { removeNodes.push(node); } } for (i=0; i<removeNodes.length; i++) { tag.removeChild(removeNodes[i]); } } // Give video tag ID and class to player div // ID will now reference player box, not the video tag el.id = tag.id; el.className = tag.className; // Update tag id/class for use as HTML5 playback tech // Might think we should do this after embedding in container so .vjs-tech class // doesn't flash 100% width/height, but class only applies with .video-js parent tag.id += '_html5_api'; tag.className = 'vjs-tech'; // Make player findable on elements tag['player'] = el['player'] = this; // Default state of video is paused this.addClass('vjs-paused'); // Make box use width/height of tag, or rely on default implementation // Enforce with CSS since width/height attrs don't work on divs this.width(this.options_['width'], true); // (true) Skip resize listener on load this.height(this.options_['height'], true); // Wrap video tag in div (el/box) container if (tag.parentNode) { tag.parentNode.insertBefore(el, tag); } vjs.insertFirst(tag, el); // Breaks iPhone, fixed in HTML5 setup. return el; }; // /* Media Technology (tech) // ================================================================================ */ // Load/Create an instance of playback technlogy including element and API methods // And append playback element in player div. vjs.Player.prototype.loadTech = function(techName, source){ // Pause and remove current playback technology if (this.tech) { this.unloadTech(); } // get rid of the HTML5 video tag as soon as we are using another tech if (techName !== 'Html5' && this.tag) { vjs.Html5.disposeMediaElement(this.tag); this.tag = null; } this.techName = techName; // Turn off API access because we're loading a new tech that might load asynchronously this.isReady_ = false; var techReady = function(){ this.player_.triggerReady(); // Manually track progress in cases where the browser/flash player doesn't report it. if (!this.features['progressEvents']) { this.player_.manualProgressOn(); } // Manually track timeudpates in cases where the browser/flash player doesn't report it. if (!this.features['timeupdateEvents']) { this.player_.manualTimeUpdatesOn(); } }; // Grab tech-specific options from player options and add source and parent element to use. var techOptions = vjs.obj.merge({ 'source': source, 'parentEl': this.el_ }, this.options_[techName.toLowerCase()]); if (source) { if (source.src == this.cache_.src && this.cache_.currentTime > 0) { techOptions['startTime'] = this.cache_.currentTime; } this.cache_.src = source.src; } // Initialize tech instance this.tech = new window['videojs'][techName](this, techOptions); this.tech.ready(techReady); }; vjs.Player.prototype.unloadTech = function(){ this.isReady_ = false; this.tech.dispose(); // Turn off any manual progress or timeupdate tracking if (this.manualProgress) { this.manualProgressOff(); } if (this.manualTimeUpdates) { this.manualTimeUpdatesOff(); } this.tech = false; }; // There's many issues around changing the size of a Flash (or other plugin) object. // First is a plugin reload issue in Firefox that has been around for 11 years: https://bugzilla.mozilla.org/show_bug.cgi?id=90268 // Then with the new fullscreen API, Mozilla and webkit browsers will reload the flash object after going to fullscreen. // To get around this, we're unloading the tech, caching source and currentTime values, and reloading the tech once the plugin is resized. // reloadTech: function(betweenFn){ // vjs.log('unloadingTech') // this.unloadTech(); // vjs.log('unloadedTech') // if (betweenFn) { betweenFn.call(); } // vjs.log('LoadingTech') // this.loadTech(this.techName, { src: this.cache_.src }) // vjs.log('loadedTech') // }, /* Fallbacks for unsupported event types ================================================================================ */ // Manually trigger progress events based on changes to the buffered amount // Many flash players and older HTML5 browsers don't send progress or progress-like events vjs.Player.prototype.manualProgressOn = function(){ this.manualProgress = true; // Trigger progress watching when a source begins loading this.trackProgress(); // Watch for a native progress event call on the tech element // In HTML5, some older versions don't support the progress event // So we're assuming they don't, and turning off manual progress if they do. // As opposed to doing user agent detection this.tech.one('progress', function(){ // Update known progress support for this playback technology this.features['progressEvents'] = true; // Turn off manual progress tracking this.player_.manualProgressOff(); }); }; vjs.Player.prototype.manualProgressOff = function(){ this.manualProgress = false; this.stopTrackingProgress(); }; vjs.Player.prototype.trackProgress = function(){ this.progressInterval = setInterval(vjs.bind(this, function(){ // Don't trigger unless buffered amount is greater than last time // log(this.cache_.bufferEnd, this.buffered().end(0), this.duration()) /* TODO: update for multiple buffered regions */ if (this.cache_.bufferEnd < this.buffered().end(0)) { this.trigger('progress'); } else if (this.bufferedPercent() == 1) { this.stopTrackingProgress(); this.trigger('progress'); // Last update } }), 500); }; vjs.Player.prototype.stopTrackingProgress = function(){ clearInterval(this.progressInterval); }; /*! Time Tracking -------------------------------------------------------------- */ vjs.Player.prototype.manualTimeUpdatesOn = function(){ this.manualTimeUpdates = true; this.on('play', this.trackCurrentTime); this.on('pause', this.stopTrackingCurrentTime); // timeupdate is also called by .currentTime whenever current time is set // Watch for native timeupdate event this.tech.one('timeupdate', function(){ // Update known progress support for this playback technology this.features['timeupdateEvents'] = true; // Turn off manual progress tracking this.player_.manualTimeUpdatesOff(); }); }; vjs.Player.prototype.manualTimeUpdatesOff = function(){ this.manualTimeUpdates = false; this.stopTrackingCurrentTime(); this.off('play', this.trackCurrentTime); this.off('pause', this.stopTrackingCurrentTime); }; vjs.Player.prototype.trackCurrentTime = function(){ if (this.currentTimeInterval) { this.stopTrackingCurrentTime(); } this.currentTimeInterval = setInterval(vjs.bind(this, function(){ this.trigger('timeupdate'); }), 250); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 }; // Turn off play progress tracking (when paused or dragging) vjs.Player.prototype.stopTrackingCurrentTime = function(){ clearInterval(this.currentTimeInterval); }; // /* Player event handlers (how the player reacts to certain events) // ================================================================================ */ /** * Fired when the user agent begins looking for media data * @event loadstart */ vjs.Player.prototype.onLoadStart; /** * Fired when the player has initial duration and dimension information * @event loadedmetadata */ vjs.Player.prototype.onLoadedMetaData; /** * Fired when the player has downloaded data at the current playback position * @event loadeddata */ vjs.Player.prototype.onLoadedData; /** * Fired when the player has finished downloading the source data * @event loadedalldata */ vjs.Player.prototype.onLoadedAllData; /** * Fired whenever the media begins or resumes playback * @event play */ vjs.Player.prototype.onPlay = function(){ vjs.removeClass(this.el_, 'vjs-paused'); vjs.addClass(this.el_, 'vjs-playing'); }; /** * Fired the first time a video is played * * Not part of the HLS spec, and we're not sure if this is the best * implementation yet, so use sparingly. If you don't have a reason to * prevent playback, use `myPlayer.one('play');` instead. * * @event firstplay */ vjs.Player.prototype.onFirstPlay = function(){ //If the first starttime attribute is specified //then we will start at the given offset in seconds if(this.options_['starttime']){ this.currentTime(this.options_['starttime']); } this.addClass('vjs-has-started'); }; /** * Fired whenever the media has been paused * @event pause */ vjs.Player.prototype.onPause = function(){ vjs.removeClass(this.el_, 'vjs-playing'); vjs.addClass(this.el_, 'vjs-paused'); }; /** * Fired when the current playback position has changed * * During playback this is fired every 15-250 milliseconds, depnding on the * playback technology in use. * @event timeupdate */ vjs.Player.prototype.onTimeUpdate; /** * Fired while the user agent is downloading media data * @event progress */ vjs.Player.prototype.onProgress = function(){ // Add custom event for when source is finished downloading. if (this.bufferedPercent() == 1) { this.trigger('loadedalldata'); } }; /** * Fired when the end of the media resource is reached (currentTime == duration) * @event ended */ vjs.Player.prototype.onEnded = function(){ if (this.options_['loop']) { this.currentTime(0); this.play(); } }; /** * Fired when the duration of the media resource is first known or changed * @event durationchange */ vjs.Player.prototype.onDurationChange = function(){ // Allows for cacheing value instead of asking player each time. // We need to get the techGet response and check for a value so we don't // accidentally cause the stack to blow up. var duration = this.techGet('duration'); if (duration) { this.duration(duration); } }; /** * Fired when the volume changes * @event volumechange */ vjs.Player.prototype.onVolumeChange; /** * Fired when the player switches in or out of fullscreen mode * @event fullscreenchange */ vjs.Player.prototype.onFullscreenChange = function() { if (this.isFullScreen()) { this.addClass('vjs-fullscreen'); } else { this.removeClass('vjs-fullscreen'); } }; /** * Fired when there is an error in playback * @event error */ vjs.Player.prototype.onError = function(e) { vjs.log('Video Error', e); }; // /* Player API // ================================================================================ */ /** * Object for cached values. * @private */ vjs.Player.prototype.cache_; vjs.Player.prototype.getCache = function(){ return this.cache_; }; // Pass values to the playback tech vjs.Player.prototype.techCall = function(method, arg){ // If it's not ready yet, call method when it is if (this.tech && !this.tech.isReady_) { this.tech.ready(function(){ this[method](arg); }); // Otherwise call method now } else { try { this.tech[method](arg); } catch(e) { vjs.log(e); throw e; } } }; // Get calls can't wait for the tech, and sometimes don't need to. vjs.Player.prototype.techGet = function(method){ if (this.tech && this.tech.isReady_) { // Flash likes to die and reload when you hide or reposition it. // In these cases the object methods go away and we get errors. // When that happens we'll catch the errors and inform tech that it's not ready any more. try { return this.tech[method](); } catch(e) { // When building additional tech libs, an expected method may not be defined yet if (this.tech[method] === undefined) { vjs.log('Video.js: ' + method + ' method not defined for '+this.techName+' playback technology.', e); } else { // When a method isn't available on the object it throws a TypeError if (e.name == 'TypeError') { vjs.log('Video.js: ' + method + ' unavailable on '+this.techName+' playback technology element.', e); this.tech.isReady_ = false; } else { vjs.log(e); } } throw e; } } return; }; /** * start media playback * * myPlayer.play(); * * @return {vjs.Player} self */ vjs.Player.prototype.play = function(){ this.techCall('play'); return this; }; /** * Pause the video playback * * myPlayer.pause(); * * @return {vjs.Player} self */ vjs.Player.prototype.pause = function(){ this.techCall('pause'); return this; }; /** * Check if the player is paused * * var isPaused = myPlayer.paused(); * var isPlaying = !myPlayer.paused(); * * @return {Boolean} false if the media is currently playing, or true otherwise */ vjs.Player.prototype.paused = function(){ // The initial state of paused should be true (in Safari it's actually false) return (this.techGet('paused') === false) ? false : true; }; /** * Get or set the current time (in seconds) * * // get * var whereYouAt = myPlayer.currentTime(); * * // set * myPlayer.currentTime(120); // 2 minutes into the video * * @param {Number|String=} seconds The time to seek to * @return {Number} The time in seconds, when not setting * @return {vjs.Player} self, when the current time is set */ vjs.Player.prototype.currentTime = function(seconds){ if (seconds !== undefined) { this.techCall('setCurrentTime', seconds); // improve the accuracy of manual timeupdates if (this.manualTimeUpdates) { this.trigger('timeupdate'); } return this; } // cache last currentTime and return. default to 0 seconds // // Caching the currentTime is meant to prevent a massive amount of reads on the tech's // currentTime when scrubbing, but may not provide much performace benefit afterall. // Should be tested. Also something has to read the actual current time or the cache will // never get updated. return this.cache_.currentTime = (this.techGet('currentTime') || 0); }; /** * Get the length in time of the video in seconds * * var lengthOfVideo = myPlayer.duration(); * * **NOTE**: The video must have started loading before the duration can be * known, and in the case of Flash, may not be known until the video starts * playing. * * @return {Number} The duration of the video in seconds */ vjs.Player.prototype.duration = function(seconds){ if (seconds !== undefined) { // cache the last set value for optimiized scrubbing (esp. Flash) this.cache_.duration = parseFloat(seconds); return this; } if (this.cache_.duration === undefined) { this.onDurationChange(); } return this.cache_.duration || 0; }; // Calculates how much time is left. Not in spec, but useful. vjs.Player.prototype.remainingTime = function(){ return this.duration() - this.currentTime(); }; // http://dev.w3.org/html5/spec/video.html#dom-media-buffered // Buffered returns a timerange object. // Kind of like an array of portions of the video that have been downloaded. // So far no browsers return more than one range (portion) /** * Get a TimeRange object with the times of the video that have been downloaded * * If you just want the percent of the video that's been downloaded, * use bufferedPercent. * * // Number of different ranges of time have been buffered. Usually 1. * numberOfRanges = bufferedTimeRange.length, * * // Time in seconds when the first range starts. Usually 0. * firstRangeStart = bufferedTimeRange.start(0), * * // Time in seconds when the first range ends * firstRangeEnd = bufferedTimeRange.end(0), * * // Length in seconds of the first time range * firstRangeLength = firstRangeEnd - firstRangeStart; * * @return {Object} A mock TimeRange object (following HTML spec) */ vjs.Player.prototype.buffered = function(){ var buffered = this.techGet('buffered'), start = 0, buflast = buffered.length - 1, // Default end to 0 and store in values end = this.cache_.bufferEnd = this.cache_.bufferEnd || 0; if (buffered && buflast >= 0 && buffered.end(buflast) !== end) { end = buffered.end(buflast); // Storing values allows them be overridden by setBufferedFromProgress this.cache_.bufferEnd = end; } return vjs.createTimeRange(start, end); }; /** * Get the percent (as a decimal) of the video that's been downloaded * * var howMuchIsDownloaded = myPlayer.bufferedPercent(); * * 0 means none, 1 means all. * (This method isn't in the HTML5 spec, but it's very convenient) * * @return {Number} A decimal between 0 and 1 representing the percent */ vjs.Player.prototype.bufferedPercent = function(){ return (this.duration()) ? this.buffered().end(0) / this.duration() : 0; }; /** * Get or set the current volume of the media * * // get * var howLoudIsIt = myPlayer.volume(); * * // set * myPlayer.volume(0.5); // Set volume to half * * 0 is off (muted), 1.0 is all the way up, 0.5 is half way. * * @param {Number} percentAsDecimal The new volume as a decimal percent * @return {Number} The current volume, when getting * @return {vjs.Player} self, when setting */ vjs.Player.prototype.volume = function(percentAsDecimal){ var vol; if (percentAsDecimal !== undefined) { vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal))); // Force value to between 0 and 1 this.cache_.volume = vol; this.techCall('setVolume', vol); vjs.setLocalStorage('volume', vol); return this; } // Default to 1 when returning current volume. vol = parseFloat(this.techGet('volume')); return (isNaN(vol)) ? 1 : vol; }; /** * Get the current muted state, or turn mute on or off * * // get * var isVolumeMuted = myPlayer.muted(); * * // set * myPlayer.muted(true); // mute the volume * * @param {Boolean=} muted True to mute, false to unmute * @return {Boolean} True if mute is on, false if not, when getting * @return {vjs.Player} self, when setting mute */ vjs.Player.prototype.muted = function(muted){ if (muted !== undefined) { this.techCall('setMuted', muted); return this; } return this.techGet('muted') || false; // Default to false }; // Check if current tech can support native fullscreen // (e.g. with built in controls lik iOS, so not our flash swf) vjs.Player.prototype.supportsFullScreen = function(){ return this.techGet('supportsFullScreen') || false; }; /** * is the player in fullscreen * @type {Boolean} * @private */ vjs.Player.prototype.isFullScreen_ = false; /** * Check if the player is in fullscreen mode * * // get * var fullscreenOrNot = myPlayer.isFullScreen(); * * // set * myPlayer.isFullScreen(true); // tell the player it's in fullscreen * * NOTE: As of the latest HTML5 spec, isFullScreen is no longer an official * property and instead document.fullscreenElement is used. But isFullScreen is * still a valuable property for internal player workings. * * @param {Boolean=} isFS Update the player's fullscreen state * @return {Boolean} true if fullscreen, false if not * @return {vjs.Player} self, when setting */ vjs.Player.prototype.isFullScreen = function(isFS){ if (isFS !== undefined) { this.isFullScreen_ = isFS; return this; } return this.isFullScreen_; }; /** * Increase the size of the video to full screen * * myPlayer.requestFullScreen(); * * In some browsers, full screen is not supported natively, so it enters * "full window mode", where the video fills the browser window. * In browsers and devices that support native full screen, sometimes the * browser's default controls will be shown, and not the Video.js custom skin. * This includes most mobile devices (iOS, Android) and older versions of * Safari. * * @return {vjs.Player} self */ vjs.Player.prototype.requestFullScreen = function(){ var requestFullScreen = vjs.support.requestFullScreen; this.isFullScreen(true); if (requestFullScreen) { // the browser supports going fullscreen at the element level so we can // take the controls fullscreen as well as the video // Trigger fullscreenchange event after change // We have to specifically add this each time, and remove // when cancelling fullscreen. Otherwise if there's multiple // players on a page, they would all be reacting to the same fullscreen // events vjs.on(document, requestFullScreen.eventName, vjs.bind(this, function(e){ this.isFullScreen(document[requestFullScreen.isFullScreen]); // If cancelling fullscreen, remove event listener. if (this.isFullScreen() === false) { vjs.off(document, requestFullScreen.eventName, arguments.callee); } this.trigger('fullscreenchange'); })); this.el_[requestFullScreen.requestFn](); } else if (this.tech.supportsFullScreen()) { // we can't take the video.js controls fullscreen but we can go fullscreen // with native controls this.techCall('enterFullScreen'); } else { // fullscreen isn't supported so we'll just stretch the video element to // fill the viewport this.enterFullWindow(); this.trigger('fullscreenchange'); } return this; }; /** * Return the video to its normal size after having been in full screen mode * * myPlayer.cancelFullScreen(); * * @return {vjs.Player} self */ vjs.Player.prototype.cancelFullScreen = function(){ var requestFullScreen = vjs.support.requestFullScreen; this.isFullScreen(false); // Check for browser element fullscreen support if (requestFullScreen) { document[requestFullScreen.cancelFn](); } else if (this.tech.supportsFullScreen()) { this.techCall('exitFullScreen'); } else { this.exitFullWindow(); this.trigger('fullscreenchange'); } return this; }; // When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us. vjs.Player.prototype.enterFullWindow = function(){ this.isFullWindow = true; // Storing original doc overflow value to return to when fullscreen is off this.docOrigOverflow = document.documentElement.style.overflow; // Add listener for esc key to exit fullscreen vjs.on(document, 'keydown', vjs.bind(this, this.fullWindowOnEscKey)); // Hide any scroll bars document.documentElement.style.overflow = 'hidden'; // Apply fullscreen styles vjs.addClass(document.body, 'vjs-full-window'); this.trigger('enterFullWindow'); }; vjs.Player.prototype.fullWindowOnEscKey = function(event){ if (event.keyCode === 27) { if (this.isFullScreen() === true) { this.cancelFullScreen(); } else { this.exitFullWindow(); } } }; vjs.Player.prototype.exitFullWindow = function(){ this.isFullWindow = false; vjs.off(document, 'keydown', this.fullWindowOnEscKey); // Unhide scroll bars. document.documentElement.style.overflow = this.docOrigOverflow; // Remove fullscreen styles vjs.removeClass(document.body, 'vjs-full-window'); // Resize the box, controller, and poster to original sizes // this.positionAll(); this.trigger('exitFullWindow'); }; vjs.Player.prototype.selectSource = function(sources){ // Loop through each playback technology in the options order for (var i=0,j=this.options_['techOrder'];i<j.length;i++) { var techName = vjs.capitalize(j[i]), tech = window['videojs'][techName]; // Check if the browser supports this technology if (tech.isSupported()) { // Loop through each source object for (var a=0,b=sources;a<b.length;a++) { var source = b[a]; // Check if source can be played with this technology if (tech['canPlaySource'](source)) { return { source: source, tech: techName }; } } } } return false; }; /** * The source function updates the video source * * There are three types of variables you can pass as the argument. * * **URL String**: A URL to the the video file. Use this method if you are sure * the current playback technology (HTML5/Flash) can support the source you * provide. Currently only MP4 files can be used in both HTML5 and Flash. * * myPlayer.src("http://www.example.com/path/to/video.mp4"); * * **Source Object (or element):** A javascript object containing information * about the source file. Use this method if you want the player to determine if * it can support the file using the type information. * * myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }); * * **Array of Source Objects:** To provide multiple versions of the source so * that it can be played using HTML5 across browsers you can use an array of * source objects. Video.js will detect which version is supported and load that * file. * * myPlayer.src([ * { type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" }, * { type: "video/webm", src: "http://www.example.com/path/to/video.webm" }, * { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" } * ]); * * @param {String|Object|Array=} source The source URL, object, or array of sources * @return {vjs.Player} self */ vjs.Player.prototype.src = function(source){ // Case: Array of source objects to choose from and pick the best to play if (source instanceof Array) { var sourceTech = this.selectSource(source), techName; if (sourceTech) { source = sourceTech.source; techName = sourceTech.tech; // If this technology is already loaded, set source if (techName == this.techName) { this.src(source); // Passing the source object // Otherwise load this technology with chosen source } else { this.loadTech(techName, source); } } else { this.el_.appendChild(vjs.createEl('p', { innerHTML: this.options()['notSupportedMessage'] })); } // Case: Source object { src: '', type: '' ... } } else if (source instanceof Object) { if (window['videojs'][this.techName]['canPlaySource'](source)) { this.src(source.src); } else { // Send through tech loop to check for a compatible technology. this.src([source]); } // Case: URL String (http://myvideo...) } else { // Cache for getting last set source this.cache_.src = source; if (!this.isReady_) { this.ready(function(){ this.src(source); }); } else { this.techCall('src', source); if (this.options_['preload'] == 'auto') { this.load(); } if (this.options_['autoplay']) { this.play(); } } } return this; }; // Begin loading the src data // http://dev.w3.org/html5/spec/video.html#dom-media-load vjs.Player.prototype.load = function(){ this.techCall('load'); return this; }; // http://dev.w3.org/html5/spec/video.html#dom-media-currentsrc vjs.Player.prototype.currentSrc = function(){ return this.techGet('currentSrc') || this.cache_.src || ''; }; // Attributes/Options vjs.Player.prototype.preload = function(value){ if (value !== undefined) { this.techCall('setPreload', value); this.options_['preload'] = value; return this; } return this.techGet('preload'); }; vjs.Player.prototype.autoplay = function(value){ if (value !== undefined) { this.techCall('setAutoplay', value); this.options_['autoplay'] = value; return this; } return this.techGet('autoplay', value); }; vjs.Player.prototype.loop = function(value){ if (value !== undefined) { this.techCall('setLoop', value); this.options_['loop'] = value; return this; } return this.techGet('loop'); }; /** * the url of the poster image source * @type {String} * @private */ vjs.Player.prototype.poster_; /** * get or set the poster image source url * * ##### EXAMPLE: * * // getting * var currentPoster = myPlayer.poster(); * * // setting * myPlayer.poster('http://example.com/myImage.jpg'); * * @param {String=} [src] Poster image source URL * @return {String} poster URL when getting * @return {vjs.Player} self when setting */ vjs.Player.prototype.poster = function(src){ if (src === undefined) { return this.poster_; } // update the internal poster variable this.poster_ = src; // update the tech's poster this.techCall('setPoster', src); // alert components that the poster has been set this.trigger('posterchange'); }; /** * Whether or not the controls are showing * @type {Boolean} * @private */ vjs.Player.prototype.controls_; /** * Get or set whether or not the controls are showing. * @param {Boolean} controls Set controls to showing or not * @return {Boolean} Controls are showing */ vjs.Player.prototype.controls = function(bool){ if (bool !== undefined) { bool = !!bool; // force boolean // Don't trigger a change event unless it actually changed if (this.controls_ !== bool) { this.controls_ = bool; if (bool) { this.removeClass('vjs-controls-disabled'); this.addClass('vjs-controls-enabled'); this.trigger('controlsenabled'); } else { this.removeClass('vjs-controls-enabled'); this.addClass('vjs-controls-disabled'); this.trigger('controlsdisabled'); } } return this; } return this.controls_; }; vjs.Player.prototype.usingNativeControls_; /** * Toggle native controls on/off. Native controls are the controls built into * devices (e.g. default iPhone controls), Flash, or other techs * (e.g. Vimeo Controls) * * **This should only be set by the current tech, because only the tech knows * if it can support native controls** * * @param {Boolean} bool True signals that native controls are on * @return {vjs.Player} Returns the player * @private */ vjs.Player.prototype.usingNativeControls = function(bool){ if (bool !== undefined) { bool = !!bool; // force boolean // Don't trigger a change event unless it actually changed if (this.usingNativeControls_ !== bool) { this.usingNativeControls_ = bool; if (bool) { this.addClass('vjs-using-native-controls'); /** * player is using the native device controls * * @event usingnativecontrols * @memberof vjs.Player * @instance * @private */ this.trigger('usingnativecontrols'); } else { this.removeClass('vjs-using-native-controls'); /** * player is using the custom HTML controls * * @event usingcustomcontrols * @memberof vjs.Player * @instance * @private */ this.trigger('usingcustomcontrols'); } } return this; } return this.usingNativeControls_; }; vjs.Player.prototype.error = function(){ return this.techGet('error'); }; vjs.Player.prototype.ended = function(){ return this.techGet('ended'); }; vjs.Player.prototype.seeking = function(){ return this.techGet('seeking'); }; // When the player is first initialized, trigger activity so components // like the control bar show themselves if needed vjs.Player.prototype.userActivity_ = true; vjs.Player.prototype.reportUserActivity = function(event){ this.userActivity_ = true; }; vjs.Player.prototype.userActive_ = true; vjs.Player.prototype.userActive = function(bool){ if (bool !== undefined) { bool = !!bool; if (bool !== this.userActive_) { this.userActive_ = bool; if (bool) { // If the user was inactive and is now active we want to reset the // inactivity timer this.userActivity_ = true; this.removeClass('vjs-user-inactive'); this.addClass('vjs-user-active'); this.trigger('useractive'); } else { // We're switching the state to inactive manually, so erase any other // activity this.userActivity_ = false; // Chrome/Safari/IE have bugs where when you change the cursor it can // trigger a mousemove event. This causes an issue when you're hiding // the cursor when the user is inactive, and a mousemove signals user // activity. Making it impossible to go into inactive mode. Specifically // this happens in fullscreen when we really need to hide the cursor. // // When this gets resolved in ALL browsers it can be removed // https://code.google.com/p/chromium/issues/detail?id=103041 this.tech.one('mousemove', function(e){ e.stopPropagation(); e.preventDefault(); }); this.removeClass('vjs-user-active'); this.addClass('vjs-user-inactive'); this.trigger('userinactive'); } } return this; } return this.userActive_; }; vjs.Player.prototype.listenForUserActivity = function(){ var onMouseActivity, onMouseDown, mouseInProgress, onMouseUp, activityCheck, inactivityTimeout; onMouseActivity = vjs.bind(this, this.reportUserActivity); onMouseDown = function() { onMouseActivity(); // For as long as the they are touching the device or have their mouse down, // we consider them active even if they're not moving their finger or mouse. // So we want to continue to update that they are active clearInterval(mouseInProgress); // Setting userActivity=true now and setting the interval to the same time // as the activityCheck interval (250) should ensure we never miss the // next activityCheck mouseInProgress = setInterval(onMouseActivity, 250); }; onMouseUp = function(event) { onMouseActivity(); // Stop the interval that maintains activity if the mouse/touch is down clearInterval(mouseInProgress); }; // Any mouse movement will be considered user activity this.on('mousedown', onMouseDown); this.on('mousemove', onMouseActivity); this.on('mouseup', onMouseUp); // Listen for keyboard navigation // Shouldn't need to use inProgress interval because of key repeat this.on('keydown', onMouseActivity); this.on('keyup', onMouseActivity); // Run an interval every 250 milliseconds instead of stuffing everything into // the mousemove/touchmove function itself, to prevent performance degradation. // `this.reportUserActivity` simply sets this.userActivity_ to true, which // then gets picked up by this loop // http://ejohn.org/blog/learning-from-twitter/ activityCheck = setInterval(vjs.bind(this, function() { // Check to see if mouse/touch activity has happened if (this.userActivity_) { // Reset the activity tracker this.userActivity_ = false; // If the user state was inactive, set the state to active this.userActive(true); // Clear any existing inactivity timeout to start the timer over clearTimeout(inactivityTimeout); // In X seconds, if no more activity has occurred the user will be // considered inactive inactivityTimeout = setTimeout(vjs.bind(this, function() { // Protect against the case where the inactivityTimeout can trigger just // before the next user activity is picked up by the activityCheck loop // causing a flicker if (!this.userActivity_) { this.userActive(false); } }), 2000); } }), 250); // Clean up the intervals when we kill the player this.on('dispose', function(){ clearInterval(activityCheck); clearTimeout(inactivityTimeout); }); }; // Methods to add support for // networkState: function(){ return this.techCall('networkState'); }, // readyState: function(){ return this.techCall('readyState'); }, // initialTime: function(){ return this.techCall('initialTime'); }, // startOffsetTime: function(){ return this.techCall('startOffsetTime'); }, // played: function(){ return this.techCall('played'); }, // seekable: function(){ return this.techCall('seekable'); }, // videoTracks: function(){ return this.techCall('videoTracks'); }, // audioTracks: function(){ return this.techCall('audioTracks'); }, // videoWidth: function(){ return this.techCall('videoWidth'); }, // videoHeight: function(){ return this.techCall('videoHeight'); }, // defaultPlaybackRate: function(){ return this.techCall('defaultPlaybackRate'); }, // playbackRate: function(){ return this.techCall('playbackRate'); }, // mediaGroup: function(){ return this.techCall('mediaGroup'); }, // controller: function(){ return this.techCall('controller'); }, // defaultMuted: function(){ return this.techCall('defaultMuted'); } // TODO // currentSrcList: the array of sources including other formats and bitrates // playList: array of source lists in order of playback // RequestFullscreen API (function(){ var prefix, requestFS, div; div = document.createElement('div'); requestFS = {}; // Current W3C Spec // http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api // Mozilla Draft: https://wiki.mozilla.org/Gecko:FullScreenAPI#fullscreenchange_event // New: https://dvcs.w3.org/hg/fullscreen/raw-file/529a67b8d9f3/Overview.html if (div.cancelFullscreen !== undefined) { requestFS.requestFn = 'requestFullscreen'; requestFS.cancelFn = 'exitFullscreen'; requestFS.eventName = 'fullscreenchange'; requestFS.isFullScreen = 'fullScreen'; // Webkit (Chrome/Safari) and Mozilla (Firefox) have working implementations // that use prefixes and vary slightly from the new W3C spec. Specifically, // using 'exit' instead of 'cancel', and lowercasing the 'S' in Fullscreen. // Other browsers don't have any hints of which version they might follow yet, // so not going to try to predict by looping through all prefixes. } else { if (document.mozCancelFullScreen) { prefix = 'moz'; requestFS.isFullScreen = prefix + 'FullScreen'; } else { prefix = 'webkit'; requestFS.isFullScreen = prefix + 'IsFullScreen'; } if (div[prefix + 'RequestFullScreen']) { requestFS.requestFn = prefix + 'RequestFullScreen'; requestFS.cancelFn = prefix + 'CancelFullScreen'; } requestFS.eventName = prefix + 'fullscreenchange'; } if (document[requestFS.cancelFn]) { vjs.support.requestFullScreen = requestFS; } })(); /** * Container of main controls * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor * @extends vjs.Component */ vjs.ControlBar = vjs.Component.extend(); vjs.ControlBar.prototype.options_ = { loadEvent: 'play', children: { 'playToggle': {}, 'currentTimeDisplay': {}, 'timeDivider': {}, 'durationDisplay': {}, 'remainingTimeDisplay': {}, 'progressControl': {}, 'fullscreenToggle': {}, 'volumeControl': {}, 'muteToggle': {} // 'volumeMenuButton': {} } }; vjs.ControlBar.prototype.createEl = function(){ return vjs.createEl('div', { className: 'vjs-control-bar' }); }; /** * Button to toggle between play and pause * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor */ vjs.PlayToggle = vjs.Button.extend({ /** @constructor */ init: function(player, options){ vjs.Button.call(this, player, options); player.on('play', vjs.bind(this, this.onPlay)); player.on('pause', vjs.bind(this, this.onPause)); } }); vjs.PlayToggle.prototype.buttonText = 'Play'; vjs.PlayToggle.prototype.buildCSSClass = function(){ return 'vjs-play-control ' + vjs.Button.prototype.buildCSSClass.call(this); }; // OnClick - Toggle between play and pause vjs.PlayToggle.prototype.onClick = function(){ if (this.player_.paused()) { this.player_.play(); } else { this.player_.pause(); } }; // OnPlay - Add the vjs-playing class to the element so it can change appearance vjs.PlayToggle.prototype.onPlay = function(){ vjs.removeClass(this.el_, 'vjs-paused'); vjs.addClass(this.el_, 'vjs-playing'); this.el_.children[0].children[0].innerHTML = 'Pause'; // change the button text to "Pause" }; // OnPause - Add the vjs-paused class to the element so it can change appearance vjs.PlayToggle.prototype.onPause = function(){ vjs.removeClass(this.el_, 'vjs-playing'); vjs.addClass(this.el_, 'vjs-paused'); this.el_.children[0].children[0].innerHTML = 'Play'; // change the button text to "Play" }; /** * Displays the current time * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.CurrentTimeDisplay = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); player.on('timeupdate', vjs.bind(this, this.updateContent)); } }); vjs.CurrentTimeDisplay.prototype.createEl = function(){ var el = vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-current-time vjs-time-controls vjs-control' }); this.contentEl_ = vjs.createEl('div', { className: 'vjs-current-time-display', innerHTML: '<span class="vjs-control-text">Current Time </span>' + '0:00', // label the current time for screen reader users 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes }); el.appendChild(this.contentEl_); return el; }; vjs.CurrentTimeDisplay.prototype.updateContent = function(){ // Allows for smooth scrubbing, when player can't keep up. var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); this.contentEl_.innerHTML = '<span class="vjs-control-text">Current Time </span>' + vjs.formatTime(time, this.player_.duration()); }; /** * Displays the duration * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.DurationDisplay = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); // this might need to be changed to 'durationchange' instead of 'timeupdate' eventually, // however the durationchange event fires before this.player_.duration() is set, // so the value cannot be written out using this method. // Once the order of durationchange and this.player_.duration() being set is figured out, // this can be updated. player.on('timeupdate', vjs.bind(this, this.updateContent)); } }); vjs.DurationDisplay.prototype.createEl = function(){ var el = vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-duration vjs-time-controls vjs-control' }); this.contentEl_ = vjs.createEl('div', { className: 'vjs-duration-display', innerHTML: '<span class="vjs-control-text">Duration Time </span>' + '0:00', // label the duration time for screen reader users 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes }); el.appendChild(this.contentEl_); return el; }; vjs.DurationDisplay.prototype.updateContent = function(){ var duration = this.player_.duration(); if (duration) { this.contentEl_.innerHTML = '<span class="vjs-control-text">Duration Time </span>' + vjs.formatTime(duration); // label the duration time for screen reader users } }; /** * The separator between the current time and duration * * Can be hidden if it's not needed in the design. * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.TimeDivider = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); } }); vjs.TimeDivider.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-time-divider', innerHTML: '<div><span>/</span></div>' }); }; /** * Displays the time left in the video * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.RemainingTimeDisplay = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); player.on('timeupdate', vjs.bind(this, this.updateContent)); } }); vjs.RemainingTimeDisplay.prototype.createEl = function(){ var el = vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-remaining-time vjs-time-controls vjs-control' }); this.contentEl_ = vjs.createEl('div', { className: 'vjs-remaining-time-display', innerHTML: '<span class="vjs-control-text">Remaining Time </span>' + '-0:00', // label the remaining time for screen reader users 'aria-live': 'off' // tell screen readers not to automatically read the time as it changes }); el.appendChild(this.contentEl_); return el; }; vjs.RemainingTimeDisplay.prototype.updateContent = function(){ if (this.player_.duration()) { this.contentEl_.innerHTML = '<span class="vjs-control-text">Remaining Time </span>' + '-'+ vjs.formatTime(this.player_.remainingTime()); } // Allows for smooth scrubbing, when player can't keep up. // var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); // this.contentEl_.innerHTML = vjs.formatTime(time, this.player_.duration()); }; /** * Toggle fullscreen video * @param {vjs.Player|Object} player * @param {Object=} options * @class * @extends vjs.Button */ vjs.FullscreenToggle = vjs.Button.extend({ /** * @constructor * @memberof vjs.FullscreenToggle * @instance */ init: function(player, options){ vjs.Button.call(this, player, options); } }); vjs.FullscreenToggle.prototype.buttonText = 'Fullscreen'; vjs.FullscreenToggle.prototype.buildCSSClass = function(){ return 'vjs-fullscreen-control ' + vjs.Button.prototype.buildCSSClass.call(this); }; vjs.FullscreenToggle.prototype.onClick = function(){ if (!this.player_.isFullScreen()) { this.player_.requestFullScreen(); this.el_.children[0].children[0].innerHTML = 'Non-Fullscreen'; // change the button text to "Non-Fullscreen" } else { this.player_.cancelFullScreen(); this.el_.children[0].children[0].innerHTML = 'Fullscreen'; // change the button to "Fullscreen" } }; /** * The Progress Control component contains the seek bar, load progress, * and play progress * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.ProgressControl = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); } }); vjs.ProgressControl.prototype.options_ = { children: { 'seekBar': {} } }; vjs.ProgressControl.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-progress-control vjs-control' }); }; /** * Seek Bar and holder for the progress bars * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.SeekBar = vjs.Slider.extend({ /** @constructor */ init: function(player, options){ vjs.Slider.call(this, player, options); player.on('timeupdate', vjs.bind(this, this.updateARIAAttributes)); player.ready(vjs.bind(this, this.updateARIAAttributes)); } }); vjs.SeekBar.prototype.options_ = { children: { 'loadProgressBar': {}, 'playProgressBar': {}, 'seekHandle': {} }, 'barName': 'playProgressBar', 'handleName': 'seekHandle' }; vjs.SeekBar.prototype.playerEvent = 'timeupdate'; vjs.SeekBar.prototype.createEl = function(){ return vjs.Slider.prototype.createEl.call(this, 'div', { className: 'vjs-progress-holder', 'aria-label': 'video progress bar' }); }; vjs.SeekBar.prototype.updateARIAAttributes = function(){ // Allows for smooth scrubbing, when player can't keep up. var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); this.el_.setAttribute('aria-valuenow',vjs.round(this.getPercent()*100, 2)); // machine readable value of progress bar (percentage complete) this.el_.setAttribute('aria-valuetext',vjs.formatTime(time, this.player_.duration())); // human readable value of progress bar (time complete) }; vjs.SeekBar.prototype.getPercent = function(){ return this.player_.currentTime() / this.player_.duration(); }; vjs.SeekBar.prototype.onMouseDown = function(event){ vjs.Slider.prototype.onMouseDown.call(this, event); this.player_.scrubbing = true; this.videoWasPlaying = !this.player_.paused(); this.player_.pause(); }; vjs.SeekBar.prototype.onMouseMove = function(event){ var newTime = this.calculateDistance(event) * this.player_.duration(); // Don't let video end while scrubbing. if (newTime == this.player_.duration()) { newTime = newTime - 0.1; } // Set new time (tell player to seek to new time) this.player_.currentTime(newTime); }; vjs.SeekBar.prototype.onMouseUp = function(event){ vjs.Slider.prototype.onMouseUp.call(this, event); this.player_.scrubbing = false; if (this.videoWasPlaying) { this.player_.play(); } }; vjs.SeekBar.prototype.stepForward = function(){ this.player_.currentTime(this.player_.currentTime() + 5); // more quickly fast forward for keyboard-only users }; vjs.SeekBar.prototype.stepBack = function(){ this.player_.currentTime(this.player_.currentTime() - 5); // more quickly rewind for keyboard-only users }; /** * Shows load progress * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.LoadProgressBar = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); player.on('progress', vjs.bind(this, this.update)); } }); vjs.LoadProgressBar.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-load-progress', innerHTML: '<span class="vjs-control-text">Loaded: 0%</span>' }); }; vjs.LoadProgressBar.prototype.update = function(){ if (this.el_.style) { this.el_.style.width = vjs.round(this.player_.bufferedPercent() * 100, 2) + '%'; } }; /** * Shows play progress * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.PlayProgressBar = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); } }); vjs.PlayProgressBar.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-play-progress', innerHTML: '<span class="vjs-control-text">Progress: 0%</span>' }); }; /** * The Seek Handle shows the current position of the playhead during playback, * and can be dragged to adjust the playhead. * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.SeekHandle = vjs.SliderHandle.extend({ init: function(player, options) { vjs.SliderHandle.call(this, player, options); player.on('timeupdate', vjs.bind(this, this.updateContent)); } }); /** * The default value for the handle content, which may be read by screen readers * * @type {String} * @private */ vjs.SeekHandle.prototype.defaultValue = '00:00'; /** @inheritDoc */ vjs.SeekHandle.prototype.createEl = function() { return vjs.SliderHandle.prototype.createEl.call(this, 'div', { className: 'vjs-seek-handle', 'aria-live': 'off' }); }; vjs.SeekHandle.prototype.updateContent = function() { var time = (this.player_.scrubbing) ? this.player_.getCache().currentTime : this.player_.currentTime(); this.el_.innerHTML = '<span class="vjs-control-text">' + vjs.formatTime(time, this.player_.duration()) + '</span>'; }; /** * The component for controlling the volume level * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.VolumeControl = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); // hide volume controls when they're not supported by the current tech if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } player.on('loadstart', vjs.bind(this, function(){ if (player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); } })); } }); vjs.VolumeControl.prototype.options_ = { children: { 'volumeBar': {} } }; vjs.VolumeControl.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-volume-control vjs-control' }); }; /** * The bar that contains the volume level and can be clicked on to adjust the level * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.VolumeBar = vjs.Slider.extend({ /** @constructor */ init: function(player, options){ vjs.Slider.call(this, player, options); player.on('volumechange', vjs.bind(this, this.updateARIAAttributes)); player.ready(vjs.bind(this, this.updateARIAAttributes)); setTimeout(vjs.bind(this, this.update), 0); // update when elements is in DOM } }); vjs.VolumeBar.prototype.updateARIAAttributes = function(){ // Current value of volume bar as a percentage this.el_.setAttribute('aria-valuenow',vjs.round(this.player_.volume()*100, 2)); this.el_.setAttribute('aria-valuetext',vjs.round(this.player_.volume()*100, 2)+'%'); }; vjs.VolumeBar.prototype.options_ = { children: { 'volumeLevel': {}, 'volumeHandle': {} }, 'barName': 'volumeLevel', 'handleName': 'volumeHandle' }; vjs.VolumeBar.prototype.playerEvent = 'volumechange'; vjs.VolumeBar.prototype.createEl = function(){ return vjs.Slider.prototype.createEl.call(this, 'div', { className: 'vjs-volume-bar', 'aria-label': 'volume level' }); }; vjs.VolumeBar.prototype.onMouseMove = function(event) { if (this.player_.muted()) { this.player_.muted(false); } this.player_.volume(this.calculateDistance(event)); }; vjs.VolumeBar.prototype.getPercent = function(){ if (this.player_.muted()) { return 0; } else { return this.player_.volume(); } }; vjs.VolumeBar.prototype.stepForward = function(){ this.player_.volume(this.player_.volume() + 0.1); }; vjs.VolumeBar.prototype.stepBack = function(){ this.player_.volume(this.player_.volume() - 0.1); }; /** * Shows volume level * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.VolumeLevel = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); } }); vjs.VolumeLevel.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-volume-level', innerHTML: '<span class="vjs-control-text"></span>' }); }; /** * The volume handle can be dragged to adjust the volume level * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.VolumeHandle = vjs.SliderHandle.extend(); vjs.VolumeHandle.prototype.defaultValue = '00:00'; /** @inheritDoc */ vjs.VolumeHandle.prototype.createEl = function(){ return vjs.SliderHandle.prototype.createEl.call(this, 'div', { className: 'vjs-volume-handle' }); }; /** * A button component for muting the audio * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.MuteToggle = vjs.Button.extend({ /** @constructor */ init: function(player, options){ vjs.Button.call(this, player, options); player.on('volumechange', vjs.bind(this, this.update)); // hide mute toggle if the current tech doesn't support volume control if (player.tech && player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } player.on('loadstart', vjs.bind(this, function(){ if (player.tech.features && player.tech.features['volumeControl'] === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); } })); } }); vjs.MuteToggle.prototype.createEl = function(){ return vjs.Button.prototype.createEl.call(this, 'div', { className: 'vjs-mute-control vjs-control', innerHTML: '<div><span class="vjs-control-text">Mute</span></div>' }); }; vjs.MuteToggle.prototype.onClick = function(){ this.player_.muted( this.player_.muted() ? false : true ); }; vjs.MuteToggle.prototype.update = function(){ var vol = this.player_.volume(), level = 3; if (vol === 0 || this.player_.muted()) { level = 0; } else if (vol < 0.33) { level = 1; } else if (vol < 0.67) { level = 2; } // Don't rewrite the button text if the actual text doesn't change. // This causes unnecessary and confusing information for screen reader users. // This check is needed because this function gets called every time the volume level is changed. if(this.player_.muted()){ if(this.el_.children[0].children[0].innerHTML!='Unmute'){ this.el_.children[0].children[0].innerHTML = 'Unmute'; // change the button text to "Unmute" } } else { if(this.el_.children[0].children[0].innerHTML!='Mute'){ this.el_.children[0].children[0].innerHTML = 'Mute'; // change the button text to "Mute" } } /* TODO improve muted icon classes */ for (var i = 0; i < 4; i++) { vjs.removeClass(this.el_, 'vjs-vol-'+i); } vjs.addClass(this.el_, 'vjs-vol-'+level); }; /** * Menu button with a popup for showing the volume slider. * @constructor */ vjs.VolumeMenuButton = vjs.MenuButton.extend({ /** @constructor */ init: function(player, options){ vjs.MenuButton.call(this, player, options); // Same listeners as MuteToggle player.on('volumechange', vjs.bind(this, this.update)); // hide mute toggle if the current tech doesn't support volume control if (player.tech && player.tech.features && player.tech.features.volumeControl === false) { this.addClass('vjs-hidden'); } player.on('loadstart', vjs.bind(this, function(){ if (player.tech.features && player.tech.features.volumeControl === false) { this.addClass('vjs-hidden'); } else { this.removeClass('vjs-hidden'); } })); this.addClass('vjs-menu-button'); } }); vjs.VolumeMenuButton.prototype.createMenu = function(){ var menu = new vjs.Menu(this.player_, { contentElType: 'div' }); var vc = new vjs.VolumeBar(this.player_, vjs.obj.merge({vertical: true}, this.options_.volumeBar)); menu.addChild(vc); return menu; }; vjs.VolumeMenuButton.prototype.onClick = function(){ vjs.MuteToggle.prototype.onClick.call(this); vjs.MenuButton.prototype.onClick.call(this); }; vjs.VolumeMenuButton.prototype.createEl = function(){ return vjs.Button.prototype.createEl.call(this, 'div', { className: 'vjs-volume-menu-button vjs-menu-button vjs-control', innerHTML: '<div><span class="vjs-control-text">Mute</span></div>' }); }; vjs.VolumeMenuButton.prototype.update = vjs.MuteToggle.prototype.update; /* Poster Image ================================================================================ */ /** * The component that handles showing the poster image. * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.PosterImage = vjs.Button.extend({ /** @constructor */ init: function(player, options){ vjs.Button.call(this, player, options); if (player.poster()) { this.src(player.poster()); } if (!player.poster() || !player.controls()) { this.hide(); } player.on('posterchange', vjs.bind(this, function(){ this.src(player.poster()); })); player.on('play', vjs.bind(this, this.hide)); } }); // use the test el to check for backgroundSize style support var _backgroundSizeSupported = 'backgroundSize' in vjs.TEST_VID.style; vjs.PosterImage.prototype.createEl = function(){ var el = vjs.createEl('div', { className: 'vjs-poster', // Don't want poster to be tabbable. tabIndex: -1 }); if (!_backgroundSizeSupported) { // setup an img element as a fallback for IE8 el.appendChild(vjs.createEl('img')); } return el; }; vjs.PosterImage.prototype.src = function(url){ var el = this.el(); // getter // can't think of a need for a getter here // see #838 if on is needed in the future // still don't want a getter to set src as undefined if (url === undefined) { return; } // setter // To ensure the poster image resizes while maintaining its original aspect // ratio, use a div with `background-size` when available. For browsers that // do not support `background-size` (e.g. IE8), fall back on using a regular // img element. if (_backgroundSizeSupported) { el.style.backgroundImage = 'url("' + url + '")'; } else { el.firstChild.src = url; } }; vjs.PosterImage.prototype.onClick = function(){ // Only accept clicks when controls are enabled if (this.player().controls()) { this.player_.play(); } }; /* Loading Spinner ================================================================================ */ /** * Loading spinner for waiting events * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor */ vjs.LoadingSpinner = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); player.on('canplay', vjs.bind(this, this.hide)); player.on('canplaythrough', vjs.bind(this, this.hide)); player.on('playing', vjs.bind(this, this.hide)); player.on('seeked', vjs.bind(this, this.hide)); player.on('seeking', vjs.bind(this, this.show)); // in some browsers seeking does not trigger the 'playing' event, // so we also need to trap 'seeked' if we are going to set a // 'seeking' event player.on('seeked', vjs.bind(this, this.hide)); player.on('error', vjs.bind(this, this.show)); // Not showing spinner on stalled any more. Browsers may stall and then not trigger any events that would remove the spinner. // Checked in Chrome 16 and Safari 5.1.2. http://help.videojs.com/discussions/problems/883-why-is-the-download-progress-showing // player.on('stalled', vjs.bind(this, this.show)); player.on('waiting', vjs.bind(this, this.show)); } }); vjs.LoadingSpinner.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-loading-spinner' }); }; /* Big Play Button ================================================================================ */ /** * Initial play button. Shows before the video has played. The hiding of the * big play button is done via CSS and player states. * @param {vjs.Player|Object} player * @param {Object=} options * @class * @constructor */ vjs.BigPlayButton = vjs.Button.extend(); vjs.BigPlayButton.prototype.createEl = function(){ return vjs.Button.prototype.createEl.call(this, 'div', { className: 'vjs-big-play-button', innerHTML: '<span aria-hidden="true"></span>', 'aria-label': 'play video' }); }; vjs.BigPlayButton.prototype.onClick = function(){ this.player_.play(); }; /** * @fileoverview Media Technology Controller - Base class for media playback * technology controllers like Flash and HTML5 */ /** * Base class for media (HTML5 Video, Flash) controllers * @param {vjs.Player|Object} player Central player instance * @param {Object=} options Options object * @constructor */ vjs.MediaTechController = vjs.Component.extend({ /** @constructor */ init: function(player, options, ready){ options = options || {}; // we don't want the tech to report user activity automatically. // This is done manually in addControlsListeners options.reportTouchActivity = false; vjs.Component.call(this, player, options, ready); this.initControlsListeners(); } }); /** * Set up click and touch listeners for the playback element * On desktops, a click on the video itself will toggle playback, * on a mobile device a click on the video toggles controls. * (toggling controls is done by toggling the user state between active and * inactive) * * A tap can signal that a user has become active, or has become inactive * e.g. a quick tap on an iPhone movie should reveal the controls. Another * quick tap should hide them again (signaling the user is in an inactive * viewing state) * * In addition to this, we still want the user to be considered inactive after * a few seconds of inactivity. * * Note: the only part of iOS interaction we can't mimic with this setup * is a touch and hold on the video element counting as activity in order to * keep the controls showing, but that shouldn't be an issue. A touch and hold on * any controls will still keep the user active */ vjs.MediaTechController.prototype.initControlsListeners = function(){ var player, tech, activateControls, deactivateControls; tech = this; player = this.player(); var activateControls = function(){ if (player.controls() && !player.usingNativeControls()) { tech.addControlsListeners(); } }; deactivateControls = vjs.bind(tech, tech.removeControlsListeners); // Set up event listeners once the tech is ready and has an element to apply // listeners to this.ready(activateControls); player.on('controlsenabled', activateControls); player.on('controlsdisabled', deactivateControls); }; vjs.MediaTechController.prototype.addControlsListeners = function(){ var userWasActive; // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do // trigger mousedown/up. // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object // Any touch events are set to block the mousedown event from happening this.on('mousedown', this.onClick); // If the controls were hidden we don't want that to change without a tap event // so we'll check if the controls were already showing before reporting user // activity this.on('touchstart', function(event) { // Stop the mouse events from also happening event.preventDefault(); userWasActive = this.player_.userActive(); }); this.on('touchmove', function(event) { if (userWasActive){ this.player().reportUserActivity(); } }); // Turn on component tap events this.emitTapEvents(); // The tap listener needs to come after the touchend listener because the tap // listener cancels out any reportedUserActivity when setting userActive(false) this.on('tap', this.onTap); }; /** * Remove the listeners used for click and tap controls. This is needed for * toggling to controls disabled, where a tap/touch should do nothing. */ vjs.MediaTechController.prototype.removeControlsListeners = function(){ // We don't want to just use `this.off()` because there might be other needed // listeners added by techs that extend this. this.off('tap'); this.off('touchstart'); this.off('touchmove'); this.off('touchleave'); this.off('touchcancel'); this.off('touchend'); this.off('click'); this.off('mousedown'); }; /** * Handle a click on the media element. By default will play/pause the media. */ vjs.MediaTechController.prototype.onClick = function(event){ // We're using mousedown to detect clicks thanks to Flash, but mousedown // will also be triggered with right-clicks, so we need to prevent that if (event.button !== 0) return; // When controls are disabled a click should not toggle playback because // the click is considered a control if (this.player().controls()) { if (this.player().paused()) { this.player().play(); } else { this.player().pause(); } } }; /** * Handle a tap on the media element. By default it will toggle the user * activity state, which hides and shows the controls. */ vjs.MediaTechController.prototype.onTap = function(){ this.player().userActive(!this.player().userActive()); }; vjs.MediaTechController.prototype.features = { 'volumeControl': true, // Resizing plugins using request fullscreen reloads the plugin 'fullscreenResize': false, // Optional events that we can manually mimic with timers // currently not triggered by video-js-swf 'progressEvents': false, 'timeupdateEvents': false }; vjs.media = {}; /** * List of default API methods for any MediaTechController * @type {String} */ vjs.media.ApiMethods = 'play,pause,paused,currentTime,setCurrentTime,duration,buffered,volume,setVolume,muted,setMuted,width,height,supportsFullScreen,enterFullScreen,src,load,currentSrc,preload,setPreload,autoplay,setAutoplay,loop,setLoop,error,networkState,readyState,seeking,initialTime,startOffsetTime,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks,defaultPlaybackRate,playbackRate,mediaGroup,controller,controls,defaultMuted'.split(','); // Create placeholder methods for each that warn when a method isn't supported by the current playback technology function createMethod(methodName){ return function(){ throw new Error('The "'+methodName+'" method is not available on the playback technology\'s API'); }; } for (var i = vjs.media.ApiMethods.length - 1; i >= 0; i--) { var methodName = vjs.media.ApiMethods[i]; vjs.MediaTechController.prototype[vjs.media.ApiMethods[i]] = createMethod(methodName); } /** * @fileoverview HTML5 Media Controller - Wrapper for HTML5 Media API */ /** * HTML5 Media Controller - Wrapper for HTML5 Media API * @param {vjs.Player|Object} player * @param {Object=} options * @param {Function=} ready * @constructor */ vjs.Html5 = vjs.MediaTechController.extend({ /** @constructor */ init: function(player, options, ready){ // volume cannot be changed from 1 on iOS this.features['volumeControl'] = vjs.Html5.canControlVolume(); // In iOS, if you move a video element in the DOM, it breaks video playback. this.features['movingMediaElementInDOM'] = !vjs.IS_IOS; // HTML video is able to automatically resize when going to fullscreen this.features['fullscreenResize'] = true; vjs.MediaTechController.call(this, player, options, ready); this.setupTriggers(); var source = options['source']; // If the element source is already set, we may have missed the loadstart event, and want to trigger it. // We don't want to set the source again and interrupt playback. if (source && this.el_.currentSrc === source.src && this.el_.networkState > 0) { player.trigger('loadstart'); // Otherwise set the source if one was provided. } else if (source) { this.el_.src = source.src; } // Determine if native controls should be used // Our goal should be to get the custom controls on mobile solid everywhere // so we can remove this all together. Right now this will block custom // controls on touch enabled laptops like the Chrome Pixel if (vjs.TOUCH_ENABLED && player.options()['nativeControlsForTouch'] !== false) { this.useNativeControls(); } // Chrome and Safari both have issues with autoplay. // In Safari (5.1.1), when we move the video element into the container div, autoplay doesn't work. // In Chrome (15), if you have autoplay + a poster + no controls, the video gets hidden (but audio plays) // This fixes both issues. Need to wait for API, so it updates displays correctly player.ready(function(){ if (this.tag && this.options_['autoplay'] && this.paused()) { delete this.tag['poster']; // Chrome Fix. Fixed in Chrome v16. this.play(); } }); this.triggerReady(); } }); vjs.Html5.prototype.dispose = function(){ vjs.MediaTechController.prototype.dispose.call(this); }; vjs.Html5.prototype.createEl = function(){ var player = this.player_, // If possible, reuse original tag for HTML5 playback technology element el = player.tag, newEl, clone; // Check if this browser supports moving the element into the box. // On the iPhone video will break if you move the element, // So we have to create a brand new element. if (!el || this.features['movingMediaElementInDOM'] === false) { // If the original tag is still there, clone and remove it. if (el) { clone = el.cloneNode(false); vjs.Html5.disposeMediaElement(el); el = clone; player.tag = null; } else { el = vjs.createEl('video', { id:player.id() + '_html5_api', className:'vjs-tech' }); } // associate the player with the new tag el['player'] = player; vjs.insertFirst(el, player.el()); } // Update specific tag settings, in case they were overridden var attrs = ['autoplay','preload','loop','muted']; for (var i = attrs.length - 1; i >= 0; i--) { var attr = attrs[i]; if (player.options_[attr] !== null) { el[attr] = player.options_[attr]; } } return el; // jenniisawesome = true; }; // Make video events trigger player events // May seem verbose here, but makes other APIs possible. vjs.Html5.prototype.setupTriggers = function(){ for (var i = vjs.Html5.Events.length - 1; i >= 0; i--) { vjs.on(this.el_, vjs.Html5.Events[i], vjs.bind(this.player_, this.eventHandler)); } }; // Triggers removed using this.off when disposed vjs.Html5.prototype.eventHandler = function(e){ this.trigger(e); // No need for media events to bubble up. e.stopPropagation(); }; vjs.Html5.prototype.useNativeControls = function(){ var tech, player, controlsOn, controlsOff, cleanUp; tech = this; player = this.player(); // If the player controls are enabled turn on the native controls tech.setControls(player.controls()); // Update the native controls when player controls state is updated controlsOn = function(){ tech.setControls(true); }; controlsOff = function(){ tech.setControls(false); }; player.on('controlsenabled', controlsOn); player.on('controlsdisabled', controlsOff); // Clean up when not using native controls anymore cleanUp = function(){ player.off('controlsenabled', controlsOn); player.off('controlsdisabled', controlsOff); }; tech.on('dispose', cleanUp); player.on('usingcustomcontrols', cleanUp); // Update the state of the player to using native controls player.usingNativeControls(true); }; vjs.Html5.prototype.play = function(){ this.el_.play(); }; vjs.Html5.prototype.pause = function(){ this.el_.pause(); }; vjs.Html5.prototype.paused = function(){ return this.el_.paused; }; vjs.Html5.prototype.currentTime = function(){ return this.el_.currentTime; }; vjs.Html5.prototype.setCurrentTime = function(seconds){ try { this.el_.currentTime = seconds; } catch(e) { vjs.log(e, 'Video is not ready. (Video.js)'); // this.warning(VideoJS.warnings.videoNotReady); } }; vjs.Html5.prototype.duration = function(){ return this.el_.duration || 0; }; vjs.Html5.prototype.buffered = function(){ return this.el_.buffered; }; vjs.Html5.prototype.volume = function(){ return this.el_.volume; }; vjs.Html5.prototype.setVolume = function(percentAsDecimal){ this.el_.volume = percentAsDecimal; }; vjs.Html5.prototype.muted = function(){ return this.el_.muted; }; vjs.Html5.prototype.setMuted = function(muted){ this.el_.muted = muted; }; vjs.Html5.prototype.width = function(){ return this.el_.offsetWidth; }; vjs.Html5.prototype.height = function(){ return this.el_.offsetHeight; }; vjs.Html5.prototype.supportsFullScreen = function(){ if (typeof this.el_.webkitEnterFullScreen == 'function') { // Seems to be broken in Chromium/Chrome && Safari in Leopard if (/Android/.test(vjs.USER_AGENT) || !/Chrome|Mac OS X 10.5/.test(vjs.USER_AGENT)) { return true; } } return false; }; vjs.Html5.prototype.enterFullScreen = function(){ var video = this.el_; if (video.paused && video.networkState <= video.HAVE_METADATA) { // attempt to prime the video element for programmatic access // this isn't necessary on the desktop but shouldn't hurt this.el_.play(); // playing and pausing synchronously during the transition to fullscreen // can get iOS ~6.1 devices into a play/pause loop setTimeout(function(){ video.pause(); video.webkitEnterFullScreen(); }, 0); } else { video.webkitEnterFullScreen(); } }; vjs.Html5.prototype.exitFullScreen = function(){ this.el_.webkitExitFullScreen(); }; vjs.Html5.prototype.src = function(src){ this.el_.src = src; }; vjs.Html5.prototype.load = function(){ this.el_.load(); }; vjs.Html5.prototype.currentSrc = function(){ return this.el_.currentSrc; }; vjs.Html5.prototype.poster = function(){ return this.el_.poster; }; vjs.Html5.prototype.setPoster = function(val){ this.el_.poster = val; }; vjs.Html5.prototype.preload = function(){ return this.el_.preload; }; vjs.Html5.prototype.setPreload = function(val){ this.el_.preload = val; }; vjs.Html5.prototype.autoplay = function(){ return this.el_.autoplay; }; vjs.Html5.prototype.setAutoplay = function(val){ this.el_.autoplay = val; }; vjs.Html5.prototype.controls = function(){ return this.el_.controls; } vjs.Html5.prototype.setControls = function(val){ this.el_.controls = !!val; } vjs.Html5.prototype.loop = function(){ return this.el_.loop; }; vjs.Html5.prototype.setLoop = function(val){ this.el_.loop = val; }; vjs.Html5.prototype.error = function(){ return this.el_.error; }; vjs.Html5.prototype.seeking = function(){ return this.el_.seeking; }; vjs.Html5.prototype.ended = function(){ return this.el_.ended; }; vjs.Html5.prototype.defaultMuted = function(){ return this.el_.defaultMuted; }; /* HTML5 Support Testing ---------------------------------------------------- */ vjs.Html5.isSupported = function(){ return !!vjs.TEST_VID.canPlayType; }; vjs.Html5.canPlaySource = function(srcObj){ // IE9 on Windows 7 without MediaPlayer throws an error here // https://github.com/videojs/video.js/issues/519 try { return !!vjs.TEST_VID.canPlayType(srcObj.type); } catch(e) { return ''; } // TODO: Check Type // If no Type, check ext // Check Media Type }; vjs.Html5.canControlVolume = function(){ var volume = vjs.TEST_VID.volume; vjs.TEST_VID.volume = (volume / 2) + 0.1; return volume !== vjs.TEST_VID.volume; }; // List of all HTML5 events (various uses). vjs.Html5.Events = 'loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange'.split(','); vjs.Html5.disposeMediaElement = function(el){ if (!el) { return; } el['player'] = null; if (el.parentNode) { el.parentNode.removeChild(el); } // remove any child track or source nodes to prevent their loading while(el.hasChildNodes()) { el.removeChild(el.firstChild); } // remove any src reference. not setting `src=''` because that causes a warning // in firefox el.removeAttribute('src'); // force the media element to update its loading state by calling load() if (typeof el.load === 'function') { el.load(); } }; // HTML5 Feature detection and Device Fixes --------------------------------- // // Override Android 2.2 and less canPlayType method which is broken if (vjs.IS_OLD_ANDROID) { document.createElement('video').constructor.prototype.canPlayType = function(type){ return (type && type.toLowerCase().indexOf('video/mp4') != -1) ? 'maybe' : ''; }; } /** * @fileoverview VideoJS-SWF - Custom Flash Player with HTML5-ish API * https://github.com/zencoder/video-js-swf * Not using setupTriggers. Using global onEvent func to distribute events */ /** * Flash Media Controller - Wrapper for fallback SWF API * * @param {vjs.Player} player * @param {Object=} options * @param {Function=} ready * @constructor */ vjs.Flash = vjs.MediaTechController.extend({ /** @constructor */ init: function(player, options, ready){ vjs.MediaTechController.call(this, player, options, ready); var source = options['source'], // Which element to embed in parentEl = options['parentEl'], // Create a temporary element to be replaced by swf object placeHolder = this.el_ = vjs.createEl('div', { id: player.id() + '_temp_flash' }), // Generate ID for swf object objId = player.id()+'_flash_api', // Store player options in local var for optimization // TODO: switch to using player methods instead of options // e.g. player.autoplay(); playerOptions = player.options_, // Merge default flashvars with ones passed in to init flashVars = vjs.obj.merge({ // SWF Callback Functions 'readyFunction': 'videojs.Flash.onReady', 'eventProxyFunction': 'videojs.Flash.onEvent', 'errorEventProxyFunction': 'videojs.Flash.onError', // Player Settings 'autoplay': playerOptions.autoplay, 'preload': playerOptions.preload, 'loop': playerOptions.loop, 'muted': playerOptions.muted }, options['flashVars']), // Merge default parames with ones passed in params = vjs.obj.merge({ 'wmode': 'opaque', // Opaque is needed to overlay controls, but can affect playback performance 'bgcolor': '#000000' // Using bgcolor prevents a white flash when the object is loading }, options['params']), // Merge default attributes with ones passed in attributes = vjs.obj.merge({ 'id': objId, 'name': objId, // Both ID and Name needed or swf to identifty itself 'class': 'vjs-tech' }, options['attributes']), lastSeekTarget ; // If source was supplied pass as a flash var. if (source) { if (source.type && vjs.Flash.isStreamingType(source.type)) { var parts = vjs.Flash.streamToParts(source.src); flashVars['rtmpConnection'] = encodeURIComponent(parts.connection); flashVars['rtmpStream'] = encodeURIComponent(parts.stream); } else { flashVars['src'] = encodeURIComponent(vjs.getAbsoluteURL(source.src)); } } this['setCurrentTime'] = function(time){ lastSeekTarget = time; this.el_.vjs_setProperty('currentTime', time); }; this['currentTime'] = function(time){ // when seeking make the reported time keep up with the requested time // by reading the time we're seeking to if (this.seeking()) { return lastSeekTarget; } return this.el_.vjs_getProperty('currentTime'); }; // Add placeholder to player div vjs.insertFirst(placeHolder, parentEl); // Having issues with Flash reloading on certain page actions (hide/resize/fullscreen) in certain browsers // This allows resetting the playhead when we catch the reload if (options['startTime']) { this.ready(function(){ this.load(); this.play(); this.currentTime(options['startTime']); }); } // firefox doesn't bubble mousemove events to parent. videojs/video-js-swf#37 // bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=836786 if (vjs.IS_FIREFOX) { this.ready(function(){ vjs.on(this.el(), 'mousemove', vjs.bind(this, function(){ // since it's a custom event, don't bubble higher than the player this.player().trigger({ 'type':'mousemove', 'bubbles': false }); })); }); } // Flash iFrame Mode // In web browsers there are multiple instances where changing the parent element or visibility of a plugin causes the plugin to reload. // - Firefox just about always. https://bugzilla.mozilla.org/show_bug.cgi?id=90268 (might be fixed by version 13) // - Webkit when hiding the plugin // - Webkit and Firefox when using requestFullScreen on a parent element // Loading the flash plugin into a dynamically generated iFrame gets around most of these issues. // Issues that remain include hiding the element and requestFullScreen in Firefox specifically // There's on particularly annoying issue with this method which is that Firefox throws a security error on an offsite Flash object loaded into a dynamically created iFrame. // Even though the iframe was inserted into a page on the web, Firefox + Flash considers it a local app trying to access an internet file. // I tried mulitple ways of setting the iframe src attribute but couldn't find a src that worked well. Tried a real/fake source, in/out of domain. // Also tried a method from stackoverflow that caused a security error in all browsers. http://stackoverflow.com/questions/2486901/how-to-set-document-domain-for-a-dynamically-generated-iframe // In the end the solution I found to work was setting the iframe window.location.href right before doing a document.write of the Flash object. // The only downside of this it seems to trigger another http request to the original page (no matter what's put in the href). Not sure why that is. // NOTE (2012-01-29): Cannot get Firefox to load the remote hosted SWF into a dynamically created iFrame // Firefox 9 throws a security error, unleess you call location.href right before doc.write. // Not sure why that even works, but it causes the browser to look like it's continuously trying to load the page. // Firefox 3.6 keeps calling the iframe onload function anytime I write to it, causing an endless loop. if (options['iFrameMode'] === true && !vjs.IS_FIREFOX) { // Create iFrame with vjs-tech class so it's 100% width/height var iFrm = vjs.createEl('iframe', { 'id': objId + '_iframe', 'name': objId + '_iframe', 'className': 'vjs-tech', 'scrolling': 'no', 'marginWidth': 0, 'marginHeight': 0, 'frameBorder': 0 }); // Update ready function names in flash vars for iframe window flashVars['readyFunction'] = 'ready'; flashVars['eventProxyFunction'] = 'events'; flashVars['errorEventProxyFunction'] = 'errors'; // Tried multiple methods to get this to work in all browsers // Tried embedding the flash object in the page first, and then adding a place holder to the iframe, then replacing the placeholder with the page object. // The goal here was to try to load the swf URL in the parent page first and hope that got around the firefox security error // var newObj = vjs.Flash.embed(options['swf'], placeHolder, flashVars, params, attributes); // (in onload) // var temp = vjs.createEl('a', { id:'asdf', innerHTML: 'asdf' } ); // iDoc.body.appendChild(temp); // Tried embedding the flash object through javascript in the iframe source. // This works in webkit but still triggers the firefox security error // iFrm.src = 'javascript: document.write('"+vjs.Flash.getEmbedCode(options['swf'], flashVars, params, attributes)+"');"; // Tried an actual local iframe just to make sure that works, but it kills the easiness of the CDN version if you require the user to host an iframe // We should add an option to host the iframe locally though, because it could help a lot of issues. // iFrm.src = "iframe.html"; // Wait until iFrame has loaded to write into it. vjs.on(iFrm, 'load', vjs.bind(this, function(){ var iDoc, iWin = iFrm.contentWindow; // The one working method I found was to use the iframe's document.write() to create the swf object // This got around the security issue in all browsers except firefox. // I did find a hack where if I call the iframe's window.location.href='', it would get around the security error // However, the main page would look like it was loading indefinitely (URL bar loading spinner would never stop) // Plus Firefox 3.6 didn't work no matter what I tried. // if (vjs.USER_AGENT.match('Firefox')) { // iWin.location.href = ''; // } // Get the iFrame's document depending on what the browser supports iDoc = iFrm.contentDocument ? iFrm.contentDocument : iFrm.contentWindow.document; // Tried ensuring both document domains were the same, but they already were, so that wasn't the issue. // Even tried adding /. that was mentioned in a browser security writeup // document.domain = document.domain+'/.'; // iDoc.domain = document.domain+'/.'; // Tried adding the object to the iframe doc's innerHTML. Security error in all browsers. // iDoc.body.innerHTML = swfObjectHTML; // Tried appending the object to the iframe doc's body. Security error in all browsers. // iDoc.body.appendChild(swfObject); // Using document.write actually got around the security error that browsers were throwing. // Again, it's a dynamically generated (same domain) iframe, loading an external Flash swf. // Not sure why that's a security issue, but apparently it is. iDoc.write(vjs.Flash.getEmbedCode(options['swf'], flashVars, params, attributes)); // Setting variables on the window needs to come after the doc write because otherwise they can get reset in some browsers // So far no issues with swf ready event being called before it's set on the window. iWin['player'] = this.player_; // Create swf ready function for iFrame window iWin['ready'] = vjs.bind(this.player_, function(currSwf){ var el = iDoc.getElementById(currSwf), player = this, tech = player.tech; // Update reference to playback technology element tech.el_ = el; // Make sure swf is actually ready. Sometimes the API isn't actually yet. vjs.Flash.checkReady(tech); }); // Create event listener for all swf events iWin['events'] = vjs.bind(this.player_, function(swfID, eventName){ var player = this; if (player && player.techName === 'flash') { player.trigger(eventName); } }); // Create error listener for all swf errors iWin['errors'] = vjs.bind(this.player_, function(swfID, eventName){ vjs.log('Flash Error', eventName); }); })); // Replace placeholder with iFrame (it will load now) placeHolder.parentNode.replaceChild(iFrm, placeHolder); // If not using iFrame mode, embed as normal object } else { vjs.Flash.embed(options['swf'], placeHolder, flashVars, params, attributes); } } }); vjs.Flash.prototype.dispose = function(){ vjs.MediaTechController.prototype.dispose.call(this); }; vjs.Flash.prototype.play = function(){ this.el_.vjs_play(); }; vjs.Flash.prototype.pause = function(){ this.el_.vjs_pause(); }; vjs.Flash.prototype.src = function(src){ if (vjs.Flash.isStreamingSrc(src)) { src = vjs.Flash.streamToParts(src); this.setRtmpConnection(src.connection); this.setRtmpStream(src.stream); } else { // Make sure source URL is abosolute. src = vjs.getAbsoluteURL(src); this.el_.vjs_src(src); } // Currently the SWF doesn't autoplay if you load a source later. // e.g. Load player w/ no source, wait 2s, set src. if (this.player_.autoplay()) { var tech = this; setTimeout(function(){ tech.play(); }, 0); } }; vjs.Flash.prototype.currentSrc = function(){ var src = this.el_.vjs_getProperty('currentSrc'); // no src, check and see if RTMP if (src == null) { var connection = this.rtmpConnection(), stream = this.rtmpStream(); if (connection && stream) { src = vjs.Flash.streamFromParts(connection, stream); } } return src; }; vjs.Flash.prototype.load = function(){ this.el_.vjs_load(); }; vjs.Flash.prototype.poster = function(){ this.el_.vjs_getProperty('poster'); }; vjs.Flash.prototype.setPoster = function(){ // poster images are not handled by the Flash tech so make this a no-op }; vjs.Flash.prototype.buffered = function(){ return vjs.createTimeRange(0, this.el_.vjs_getProperty('buffered')); }; vjs.Flash.prototype.supportsFullScreen = function(){ return false; // Flash does not allow fullscreen through javascript }; vjs.Flash.prototype.enterFullScreen = function(){ return false; }; // Create setters and getters for attributes var api = vjs.Flash.prototype, readWrite = 'rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted'.split(','), readOnly = 'error,currentSrc,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks'.split(','); // Overridden: buffered, currentTime /** * @this {*} * @private */ var createSetter = function(attr){ var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1); api['set'+attrUpper] = function(val){ return this.el_.vjs_setProperty(attr, val); }; }; /** * @this {*} * @private */ var createGetter = function(attr){ api[attr] = function(){ return this.el_.vjs_getProperty(attr); }; }; (function(){ var i; // Create getter and setters for all read/write attributes for (i = 0; i < readWrite.length; i++) { createGetter(readWrite[i]); createSetter(readWrite[i]); } // Create getters for read-only attributes for (i = 0; i < readOnly.length; i++) { createGetter(readOnly[i]); } })(); /* Flash Support Testing -------------------------------------------------------- */ vjs.Flash.isSupported = function(){ return vjs.Flash.version()[0] >= 10; // return swfobject.hasFlashPlayerVersion('10'); }; vjs.Flash.canPlaySource = function(srcObj){ var type; if (!srcObj.type) { return ''; } type = srcObj.type.replace(/;.*/,'').toLowerCase(); if (type in vjs.Flash.formats || type in vjs.Flash.streamingFormats) { return 'maybe'; } }; vjs.Flash.formats = { 'video/flv': 'FLV', 'video/x-flv': 'FLV', 'video/mp4': 'MP4', 'video/m4v': 'MP4' }; vjs.Flash.streamingFormats = { 'rtmp/mp4': 'MP4', 'rtmp/flv': 'FLV' }; vjs.Flash['onReady'] = function(currSwf){ var el = vjs.el(currSwf); // Get player from box // On firefox reloads, el might already have a player var player = el['player'] || el.parentNode['player'], tech = player.tech; // Reference player on tech element el['player'] = player; // Update reference to playback technology element tech.el_ = el; vjs.Flash.checkReady(tech); }; // The SWF isn't alwasy ready when it says it is. Sometimes the API functions still need to be added to the object. // If it's not ready, we set a timeout to check again shortly. vjs.Flash.checkReady = function(tech){ // Check if API property exists if (tech.el().vjs_getProperty) { // If so, tell tech it's ready tech.triggerReady(); // Otherwise wait longer. } else { setTimeout(function(){ vjs.Flash.checkReady(tech); }, 50); } }; // Trigger events from the swf on the player vjs.Flash['onEvent'] = function(swfID, eventName){ var player = vjs.el(swfID)['player']; player.trigger(eventName); }; // Log errors from the swf vjs.Flash['onError'] = function(swfID, err){ var player = vjs.el(swfID)['player']; player.trigger('error'); vjs.log('Flash Error', err, swfID); }; // Flash Version Check vjs.Flash.version = function(){ var version = '0,0,0'; // IE try { version = new window.ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; // other browsers } catch(e) { try { if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin){ version = (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash']).description.replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; } } catch(err) {} } return version.split(','); }; // Flash embedding method. Only used in non-iframe mode vjs.Flash.embed = function(swf, placeHolder, flashVars, params, attributes){ var code = vjs.Flash.getEmbedCode(swf, flashVars, params, attributes), // Get element by embedding code and retrieving created element obj = vjs.createEl('div', { innerHTML: code }).childNodes[0], par = placeHolder.parentNode ; placeHolder.parentNode.replaceChild(obj, placeHolder); // IE6 seems to have an issue where it won't initialize the swf object after injecting it. // This is a dumb fix var newObj = par.childNodes[0]; setTimeout(function(){ newObj.style.display = 'block'; }, 1000); return obj; }; vjs.Flash.getEmbedCode = function(swf, flashVars, params, attributes){ var objTag = '<object type="application/x-shockwave-flash"', flashVarsString = '', paramsString = '', attrsString = ''; // Convert flash vars to string if (flashVars) { vjs.obj.each(flashVars, function(key, val){ flashVarsString += (key + '=' + val + '&amp;'); }); } // Add swf, flashVars, and other default params params = vjs.obj.merge({ 'movie': swf, 'flashvars': flashVarsString, 'allowScriptAccess': 'always', // Required to talk to swf 'allowNetworking': 'all' // All should be default, but having security issues. }, params); // Create param tags string vjs.obj.each(params, function(key, val){ paramsString += '<param name="'+key+'" value="'+val+'" />'; }); attributes = vjs.obj.merge({ // Add swf to attributes (need both for IE and Others to work) 'data': swf, // Default to 100% width/height 'width': '100%', 'height': '100%' }, attributes); // Create Attributes string vjs.obj.each(attributes, function(key, val){ attrsString += (key + '="' + val + '" '); }); return objTag + attrsString + '>' + paramsString + '</object>'; }; vjs.Flash.streamFromParts = function(connection, stream) { return connection + '&' + stream; }; vjs.Flash.streamToParts = function(src) { var parts = { connection: '', stream: '' }; if (! src) { return parts; } // Look for the normal URL separator we expect, '&'. // If found, we split the URL into two pieces around the // first '&'. var connEnd = src.indexOf('&'); var streamBegin; if (connEnd !== -1) { streamBegin = connEnd + 1; } else { // If there's not a '&', we use the last '/' as the delimiter. connEnd = streamBegin = src.lastIndexOf('/') + 1; if (connEnd === 0) { // really, there's not a '/'? connEnd = streamBegin = src.length; } } parts.connection = src.substring(0, connEnd); parts.stream = src.substring(streamBegin, src.length); return parts; }; vjs.Flash.isStreamingType = function(srcType) { return srcType in vjs.Flash.streamingFormats; }; // RTMP has four variations, any string starting // with one of these protocols should be valid vjs.Flash.RTMP_RE = /^rtmp[set]?:\/\//i; vjs.Flash.isStreamingSrc = function(src) { return vjs.Flash.RTMP_RE.test(src); }; /** * The Media Loader is the component that decides which playback technology to load * when the player is initialized. * * @constructor */ vjs.MediaLoader = vjs.Component.extend({ /** @constructor */ init: function(player, options, ready){ vjs.Component.call(this, player, options, ready); // If there are no sources when the player is initialized, // load the first supported playback technology. if (!player.options_['sources'] || player.options_['sources'].length === 0) { for (var i=0,j=player.options_['techOrder']; i<j.length; i++) { var techName = vjs.capitalize(j[i]), tech = window['videojs'][techName]; // Check if the browser supports this technology if (tech && tech.isSupported()) { player.loadTech(techName); break; } } } else { // // Loop through playback technologies (HTML5, Flash) and check for support. // // Then load the best source. // // A few assumptions here: // // All playback technologies respect preload false. player.src(player.options_['sources']); } } }); /** * @fileoverview Text Tracks * Text tracks are tracks of timed text events. * Captions - text displayed over the video for the hearing impared * Subtitles - text displayed over the video for those who don't understand langauge in the video * Chapters - text displayed in a menu allowing the user to jump to particular points (chapters) in the video * Descriptions (not supported yet) - audio descriptions that are read back to the user by a screen reading device */ // Player Additions - Functions add to the player object for easier access to tracks /** * List of associated text tracks * @type {Array} * @private */ vjs.Player.prototype.textTracks_; /** * Get an array of associated text tracks. captions, subtitles, chapters, descriptions * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks * @return {Array} Array of track objects * @private */ vjs.Player.prototype.textTracks = function(){ this.textTracks_ = this.textTracks_ || []; return this.textTracks_; }; /** * Add a text track * In addition to the W3C settings we allow adding additional info through options. * http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack * @param {String} kind Captions, subtitles, chapters, descriptions, or metadata * @param {String=} label Optional label * @param {String=} language Optional language * @param {Object=} options Additional track options, like src * @private */ vjs.Player.prototype.addTextTrack = function(kind, label, language, options){ var tracks = this.textTracks_ = this.textTracks_ || []; options = options || {}; options['kind'] = kind; options['label'] = label; options['language'] = language; // HTML5 Spec says default to subtitles. // Uppercase first letter to match class names var Kind = vjs.capitalize(kind || 'subtitles'); // Create correct texttrack class. CaptionsTrack, etc. var track = new window['videojs'][Kind + 'Track'](this, options); tracks.push(track); // If track.dflt() is set, start showing immediately // TODO: Add a process to deterime the best track to show for the specific kind // Incase there are mulitple defaulted tracks of the same kind // Or the user has a set preference of a specific language that should override the default // if (track.dflt()) { // this.ready(vjs.bind(track, track.show)); // } return track; }; /** * Add an array of text tracks. captions, subtitles, chapters, descriptions * Track objects will be stored in the player.textTracks() array * @param {Array} trackList Array of track elements or objects (fake track elements) * @private */ vjs.Player.prototype.addTextTracks = function(trackList){ var trackObj; for (var i = 0; i < trackList.length; i++) { trackObj = trackList[i]; this.addTextTrack(trackObj['kind'], trackObj['label'], trackObj['language'], trackObj); } return this; }; // Show a text track // disableSameKind: disable all other tracks of the same kind. Value should be a track kind (captions, etc.) vjs.Player.prototype.showTextTrack = function(id, disableSameKind){ var tracks = this.textTracks_, i = 0, j = tracks.length, track, showTrack, kind; // Find Track with same ID for (;i<j;i++) { track = tracks[i]; if (track.id() === id) { track.show(); showTrack = track; // Disable tracks of the same kind } else if (disableSameKind && track.kind() == disableSameKind && track.mode() > 0) { track.disable(); } } // Get track kind from shown track or disableSameKind kind = (showTrack) ? showTrack.kind() : ((disableSameKind) ? disableSameKind : false); // Trigger trackchange event, captionstrackchange, subtitlestrackchange, etc. if (kind) { this.trigger(kind+'trackchange'); } return this; }; /** * The base class for all text tracks * * Handles the parsing, hiding, and showing of text track cues * * @param {vjs.Player|Object} player * @param {Object=} options * @constructor */ vjs.TextTrack = vjs.Component.extend({ /** @constructor */ init: function(player, options){ vjs.Component.call(this, player, options); // Apply track info to track object // Options will often be a track element // Build ID if one doesn't exist this.id_ = options['id'] || ('vjs_' + options['kind'] + '_' + options['language'] + '_' + vjs.guid++); this.src_ = options['src']; // 'default' is a reserved keyword in js so we use an abbreviated version this.dflt_ = options['default'] || options['dflt']; this.title_ = options['title']; this.language_ = options['srclang']; this.label_ = options['label']; this.cues_ = []; this.activeCues_ = []; this.readyState_ = 0; this.mode_ = 0; this.player_.on('fullscreenchange', vjs.bind(this, this.adjustFontSize)); } }); /** * Track kind value. Captions, subtitles, etc. * @private */ vjs.TextTrack.prototype.kind_; /** * Get the track kind value * @return {String} */ vjs.TextTrack.prototype.kind = function(){ return this.kind_; }; /** * Track src value * @private */ vjs.TextTrack.prototype.src_; /** * Get the track src value * @return {String} */ vjs.TextTrack.prototype.src = function(){ return this.src_; }; /** * Track default value * If default is used, subtitles/captions to start showing * @private */ vjs.TextTrack.prototype.dflt_; /** * Get the track default value. ('default' is a reserved keyword) * @return {Boolean} */ vjs.TextTrack.prototype.dflt = function(){ return this.dflt_; }; /** * Track title value * @private */ vjs.TextTrack.prototype.title_; /** * Get the track title value * @return {String} */ vjs.TextTrack.prototype.title = function(){ return this.title_; }; /** * Language - two letter string to represent track language, e.g. 'en' for English * Spec def: readonly attribute DOMString language; * @private */ vjs.TextTrack.prototype.language_; /** * Get the track language value * @return {String} */ vjs.TextTrack.prototype.language = function(){ return this.language_; }; /** * Track label e.g. 'English' * Spec def: readonly attribute DOMString label; * @private */ vjs.TextTrack.prototype.label_; /** * Get the track label value * @return {String} */ vjs.TextTrack.prototype.label = function(){ return this.label_; }; /** * All cues of the track. Cues have a startTime, endTime, text, and other properties. * Spec def: readonly attribute TextTrackCueList cues; * @private */ vjs.TextTrack.prototype.cues_; /** * Get the track cues * @return {Array} */ vjs.TextTrack.prototype.cues = function(){ return this.cues_; }; /** * ActiveCues is all cues that are currently showing * Spec def: readonly attribute TextTrackCueList activeCues; * @private */ vjs.TextTrack.prototype.activeCues_; /** * Get the track active cues * @return {Array} */ vjs.TextTrack.prototype.activeCues = function(){ return this.activeCues_; }; /** * ReadyState describes if the text file has been loaded * const unsigned short NONE = 0; * const unsigned short LOADING = 1; * const unsigned short LOADED = 2; * const unsigned short ERROR = 3; * readonly attribute unsigned short readyState; * @private */ vjs.TextTrack.prototype.readyState_; /** * Get the track readyState * @return {Number} */ vjs.TextTrack.prototype.readyState = function(){ return this.readyState_; }; /** * Mode describes if the track is showing, hidden, or disabled * const unsigned short OFF = 0; * const unsigned short HIDDEN = 1; (still triggering cuechange events, but not visible) * const unsigned short SHOWING = 2; * attribute unsigned short mode; * @private */ vjs.TextTrack.prototype.mode_; /** * Get the track mode * @return {Number} */ vjs.TextTrack.prototype.mode = function(){ return this.mode_; }; /** * Change the font size of the text track to make it larger when playing in fullscreen mode * and restore it to its normal size when not in fullscreen mode. */ vjs.TextTrack.prototype.adjustFontSize = function(){ if (this.player_.isFullScreen()) { // Scale the font by the same factor as increasing the video width to the full screen window width. // Additionally, multiply that factor by 1.4, which is the default font size for // the caption track (from the CSS) this.el_.style.fontSize = screen.width / this.player_.width() * 1.4 * 100 + '%'; } else { // Change the font size of the text track back to its original non-fullscreen size this.el_.style.fontSize = ''; } }; /** * Create basic div to hold cue text * @return {Element} */ vjs.TextTrack.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-' + this.kind_ + ' vjs-text-track' }); }; /** * Show: Mode Showing (2) * Indicates that the text track is active. If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. * The user agent is maintaining a list of which cues are active, and events are being fired accordingly. * In addition, for text tracks whose kind is subtitles or captions, the cues are being displayed over the video as appropriate; * for text tracks whose kind is descriptions, the user agent is making the cues available to the user in a non-visual fashion; * and for text tracks whose kind is chapters, the user agent is making available to the user a mechanism by which the user can navigate to any point in the media resource by selecting a cue. * The showing by default state is used in conjunction with the default attribute on track elements to indicate that the text track was enabled due to that attribute. * This allows the user agent to override the state if a later track is discovered that is more appropriate per the user's preferences. */ vjs.TextTrack.prototype.show = function(){ this.activate(); this.mode_ = 2; // Show element. vjs.Component.prototype.show.call(this); }; /** * Hide: Mode Hidden (1) * Indicates that the text track is active, but that the user agent is not actively displaying the cues. * If no attempt has yet been made to obtain the track's cues, the user agent will perform such an attempt momentarily. * The user agent is maintaining a list of which cues are active, and events are being fired accordingly. */ vjs.TextTrack.prototype.hide = function(){ // When hidden, cues are still triggered. Disable to stop triggering. this.activate(); this.mode_ = 1; // Hide element. vjs.Component.prototype.hide.call(this); }; /** * Disable: Mode Off/Disable (0) * Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. * No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues. */ vjs.TextTrack.prototype.disable = function(){ // If showing, hide. if (this.mode_ == 2) { this.hide(); } // Stop triggering cues this.deactivate(); // Switch Mode to Off this.mode_ = 0; }; /** * Turn on cue tracking. Tracks that are showing OR hidden are active. */ vjs.TextTrack.prototype.activate = function(){ // Load text file if it hasn't been yet. if (this.readyState_ === 0) { this.load(); } // Only activate if not already active. if (this.mode_ === 0) { // Update current cue on timeupdate // Using unique ID for bind function so other tracks don't remove listener this.player_.on('timeupdate', vjs.bind(this, this.update, this.id_)); // Reset cue time on media end this.player_.on('ended', vjs.bind(this, this.reset, this.id_)); // Add to display if (this.kind_ === 'captions' || this.kind_ === 'subtitles') { this.player_.getChild('textTrackDisplay').addChild(this); } } }; /** * Turn off cue tracking. */ vjs.TextTrack.prototype.deactivate = function(){ // Using unique ID for bind function so other tracks don't remove listener this.player_.off('timeupdate', vjs.bind(this, this.update, this.id_)); this.player_.off('ended', vjs.bind(this, this.reset, this.id_)); this.reset(); // Reset // Remove from display this.player_.getChild('textTrackDisplay').removeChild(this); }; // A readiness state // One of the following: // // Not loaded // Indicates that the text track is known to exist (e.g. it has been declared with a track element), but its cues have not been obtained. // // Loading // Indicates that the text track is loading and there have been no fatal errors encountered so far. Further cues might still be added to the track. // // Loaded // Indicates that the text track has been loaded with no fatal errors. No new cues will be added to the track except if the text track corresponds to a MutableTextTrack object. // // Failed to load // Indicates that the text track was enabled, but when the user agent attempted to obtain it, this failed in some way (e.g. URL could not be resolved, network error, unknown text track format). Some or all of the cues are likely missing and will not be obtained. vjs.TextTrack.prototype.load = function(){ // Only load if not loaded yet. if (this.readyState_ === 0) { this.readyState_ = 1; vjs.get(this.src_, vjs.bind(this, this.parseCues), vjs.bind(this, this.onError)); } }; vjs.TextTrack.prototype.onError = function(err){ this.error = err; this.readyState_ = 3; this.trigger('error'); }; // Parse the WebVTT text format for cue times. // TODO: Separate parser into own class so alternative timed text formats can be used. (TTML, DFXP) vjs.TextTrack.prototype.parseCues = function(srcContent) { var cue, time, text, lines = srcContent.split('\n'), line = '', id; for (var i=1, j=lines.length; i<j; i++) { // Line 0 should be 'WEBVTT', so skipping i=0 line = vjs.trim(lines[i]); // Trim whitespace and linebreaks if (line) { // Loop until a line with content // First line could be an optional cue ID // Check if line has the time separator if (line.indexOf('-->') == -1) { id = line; // Advance to next line for timing. line = vjs.trim(lines[++i]); } else { id = this.cues_.length; } // First line - Number cue = { id: id, // Cue Number index: this.cues_.length // Position in Array }; // Timing line time = line.split(' --> '); cue.startTime = this.parseCueTime(time[0]); cue.endTime = this.parseCueTime(time[1]); // Additional lines - Cue Text text = []; // Loop until a blank line or end of lines // Assumeing trim('') returns false for blank lines while (lines[++i] && (line = vjs.trim(lines[i]))) { text.push(line); } cue.text = text.join('<br/>'); // Add this cue this.cues_.push(cue); } } this.readyState_ = 2; this.trigger('loaded'); }; vjs.TextTrack.prototype.parseCueTime = function(timeText) { var parts = timeText.split(':'), time = 0, hours, minutes, other, seconds, ms; // Check if optional hours place is included // 00:00:00.000 vs. 00:00.000 if (parts.length == 3) { hours = parts[0]; minutes = parts[1]; other = parts[2]; } else { hours = 0; minutes = parts[0]; other = parts[1]; } // Break other (seconds, milliseconds, and flags) by spaces // TODO: Make additional cue layout settings work with flags other = other.split(/\s+/); // Remove seconds. Seconds is the first part before any spaces. seconds = other.splice(0,1)[0]; // Could use either . or , for decimal seconds = seconds.split(/\.|,/); // Get milliseconds ms = parseFloat(seconds[1]); seconds = seconds[0]; // hours => seconds time += parseFloat(hours) * 3600; // minutes => seconds time += parseFloat(minutes) * 60; // Add seconds time += parseFloat(seconds); // Add milliseconds if (ms) { time += ms/1000; } return time; }; // Update active cues whenever timeupdate events are triggered on the player. vjs.TextTrack.prototype.update = function(){ if (this.cues_.length > 0) { // Get curent player time var time = this.player_.currentTime(); // Check if the new time is outside the time box created by the the last update. if (this.prevChange === undefined || time < this.prevChange || this.nextChange <= time) { var cues = this.cues_, // Create a new time box for this state. newNextChange = this.player_.duration(), // Start at beginning of the timeline newPrevChange = 0, // Start at end reverse = false, // Set the direction of the loop through the cues. Optimized the cue check. newCues = [], // Store new active cues. // Store where in the loop the current active cues are, to provide a smart starting point for the next loop. firstActiveIndex, lastActiveIndex, cue, i; // Loop vars // Check if time is going forwards or backwards (scrubbing/rewinding) // If we know the direction we can optimize the starting position and direction of the loop through the cues array. if (time >= this.nextChange || this.nextChange === undefined) { // NextChange should happen // Forwards, so start at the index of the first active cue and loop forward i = (this.firstActiveIndex !== undefined) ? this.firstActiveIndex : 0; } else { // Backwards, so start at the index of the last active cue and loop backward reverse = true; i = (this.lastActiveIndex !== undefined) ? this.lastActiveIndex : cues.length - 1; } while (true) { // Loop until broken cue = cues[i]; // Cue ended at this point if (cue.endTime <= time) { newPrevChange = Math.max(newPrevChange, cue.endTime); if (cue.active) { cue.active = false; } // No earlier cues should have an active start time. // Nevermind. Assume first cue could have a duration the same as the video. // In that case we need to loop all the way back to the beginning. // if (reverse && cue.startTime) { break; } // Cue hasn't started } else if (time < cue.startTime) { newNextChange = Math.min(newNextChange, cue.startTime); if (cue.active) { cue.active = false; } // No later cues should have an active start time. if (!reverse) { break; } // Cue is current } else { if (reverse) { // Add cue to front of array to keep in time order newCues.splice(0,0,cue); // If in reverse, the first current cue is our lastActiveCue if (lastActiveIndex === undefined) { lastActiveIndex = i; } firstActiveIndex = i; } else { // Add cue to end of array newCues.push(cue); // If forward, the first current cue is our firstActiveIndex if (firstActiveIndex === undefined) { firstActiveIndex = i; } lastActiveIndex = i; } newNextChange = Math.min(newNextChange, cue.endTime); newPrevChange = Math.max(newPrevChange, cue.startTime); cue.active = true; } if (reverse) { // Reverse down the array of cues, break if at first if (i === 0) { break; } else { i--; } } else { // Walk up the array fo cues, break if at last if (i === cues.length - 1) { break; } else { i++; } } } this.activeCues_ = newCues; this.nextChange = newNextChange; this.prevChange = newPrevChange; this.firstActiveIndex = firstActiveIndex; this.lastActiveIndex = lastActiveIndex; this.updateDisplay(); this.trigger('cuechange'); } } }; // Add cue HTML to display vjs.TextTrack.prototype.updateDisplay = function(){ var cues = this.activeCues_, html = '', i=0,j=cues.length; for (;i<j;i++) { html += '<span class="vjs-tt-cue">'+cues[i].text+'</span>'; } this.el_.innerHTML = html; }; // Set all loop helper values back vjs.TextTrack.prototype.reset = function(){ this.nextChange = 0; this.prevChange = this.player_.duration(); this.firstActiveIndex = 0; this.lastActiveIndex = 0; }; // Create specific track types /** * The track component for managing the hiding and showing of captions * * @constructor */ vjs.CaptionsTrack = vjs.TextTrack.extend(); vjs.CaptionsTrack.prototype.kind_ = 'captions'; // Exporting here because Track creation requires the track kind // to be available on global object. e.g. new window['videojs'][Kind + 'Track'] /** * The track component for managing the hiding and showing of subtitles * * @constructor */ vjs.SubtitlesTrack = vjs.TextTrack.extend(); vjs.SubtitlesTrack.prototype.kind_ = 'subtitles'; /** * The track component for managing the hiding and showing of chapters * * @constructor */ vjs.ChaptersTrack = vjs.TextTrack.extend(); vjs.ChaptersTrack.prototype.kind_ = 'chapters'; /* Text Track Display ============================================================================= */ // Global container for both subtitle and captions text. Simple div container. /** * The component for displaying text track cues * * @constructor */ vjs.TextTrackDisplay = vjs.Component.extend({ /** @constructor */ init: function(player, options, ready){ vjs.Component.call(this, player, options, ready); // This used to be called during player init, but was causing an error // if a track should show by default and the display hadn't loaded yet. // Should probably be moved to an external track loader when we support // tracks that don't need a display. if (player.options_['tracks'] && player.options_['tracks'].length > 0) { this.player_.addTextTracks(player.options_['tracks']); } } }); vjs.TextTrackDisplay.prototype.createEl = function(){ return vjs.Component.prototype.createEl.call(this, 'div', { className: 'vjs-text-track-display' }); }; /** * The specific menu item type for selecting a language within a text track kind * * @constructor */ vjs.TextTrackMenuItem = vjs.MenuItem.extend({ /** @constructor */ init: function(player, options){ var track = this.track = options['track']; // Modify options for parent MenuItem class's init. options['label'] = track.label(); options['selected'] = track.dflt(); vjs.MenuItem.call(this, player, options); this.player_.on(track.kind() + 'trackchange', vjs.bind(this, this.update)); } }); vjs.TextTrackMenuItem.prototype.onClick = function(){ vjs.MenuItem.prototype.onClick.call(this); this.player_.showTextTrack(this.track.id_, this.track.kind()); }; vjs.TextTrackMenuItem.prototype.update = function(){ this.selected(this.track.mode() == 2); }; /** * A special menu item for turning of a specific type of text track * * @constructor */ vjs.OffTextTrackMenuItem = vjs.TextTrackMenuItem.extend({ /** @constructor */ init: function(player, options){ // Create pseudo track info // Requires options['kind'] options['track'] = { kind: function() { return options['kind']; }, player: player, label: function(){ return options['kind'] + ' off'; }, dflt: function(){ return false; }, mode: function(){ return false; } }; vjs.TextTrackMenuItem.call(this, player, options); this.selected(true); } }); vjs.OffTextTrackMenuItem.prototype.onClick = function(){ vjs.TextTrackMenuItem.prototype.onClick.call(this); this.player_.showTextTrack(this.track.id_, this.track.kind()); }; vjs.OffTextTrackMenuItem.prototype.update = function(){ var tracks = this.player_.textTracks(), i=0, j=tracks.length, track, off = true; for (;i<j;i++) { track = tracks[i]; if (track.kind() == this.track.kind() && track.mode() == 2) { off = false; } } this.selected(off); }; /** * The base class for buttons that toggle specific text track types (e.g. subtitles) * * @constructor */ vjs.TextTrackButton = vjs.MenuButton.extend({ /** @constructor */ init: function(player, options){ vjs.MenuButton.call(this, player, options); if (this.items.length <= 1) { this.hide(); } } }); // vjs.TextTrackButton.prototype.buttonPressed = false; // vjs.TextTrackButton.prototype.createMenu = function(){ // var menu = new vjs.Menu(this.player_); // // Add a title list item to the top // // menu.el().appendChild(vjs.createEl('li', { // // className: 'vjs-menu-title', // // innerHTML: vjs.capitalize(this.kind_), // // tabindex: -1 // // })); // this.items = this.createItems(); // // Add menu items to the menu // for (var i = 0; i < this.items.length; i++) { // menu.addItem(this.items[i]); // } // // Add list to element // this.addChild(menu); // return menu; // }; // Create a menu item for each text track vjs.TextTrackButton.prototype.createItems = function(){ var items = [], track; // Add an OFF menu item to turn all tracks off items.push(new vjs.OffTextTrackMenuItem(this.player_, { 'kind': this.kind_ })); for (var i = 0; i < this.player_.textTracks().length; i++) { track = this.player_.textTracks()[i]; if (track.kind() === this.kind_) { items.push(new vjs.TextTrackMenuItem(this.player_, { 'track': track })); } } return items; }; /** * The button component for toggling and selecting captions * * @constructor */ vjs.CaptionsButton = vjs.TextTrackButton.extend({ /** @constructor */ init: function(player, options, ready){ vjs.TextTrackButton.call(this, player, options, ready); this.el_.setAttribute('aria-label','Captions Menu'); } }); vjs.CaptionsButton.prototype.kind_ = 'captions'; vjs.CaptionsButton.prototype.buttonText = 'Captions'; vjs.CaptionsButton.prototype.className = 'vjs-captions-button'; /** * The button component for toggling and selecting subtitles * * @constructor */ vjs.SubtitlesButton = vjs.TextTrackButton.extend({ /** @constructor */ init: function(player, options, ready){ vjs.TextTrackButton.call(this, player, options, ready); this.el_.setAttribute('aria-label','Subtitles Menu'); } }); vjs.SubtitlesButton.prototype.kind_ = 'subtitles'; vjs.SubtitlesButton.prototype.buttonText = 'Subtitles'; vjs.SubtitlesButton.prototype.className = 'vjs-subtitles-button'; // Chapters act much differently than other text tracks // Cues are navigation vs. other tracks of alternative languages /** * The button component for toggling and selecting chapters * * @constructor */ vjs.ChaptersButton = vjs.TextTrackButton.extend({ /** @constructor */ init: function(player, options, ready){ vjs.TextTrackButton.call(this, player, options, ready); this.el_.setAttribute('aria-label','Chapters Menu'); } }); vjs.ChaptersButton.prototype.kind_ = 'chapters'; vjs.ChaptersButton.prototype.buttonText = 'Chapters'; vjs.ChaptersButton.prototype.className = 'vjs-chapters-button'; // Create a menu item for each text track vjs.ChaptersButton.prototype.createItems = function(){ var items = [], track; for (var i = 0; i < this.player_.textTracks().length; i++) { track = this.player_.textTracks()[i]; if (track.kind() === this.kind_) { items.push(new vjs.TextTrackMenuItem(this.player_, { 'track': track })); } } return items; }; vjs.ChaptersButton.prototype.createMenu = function(){ var tracks = this.player_.textTracks(), i = 0, j = tracks.length, track, chaptersTrack, items = this.items = []; for (;i<j;i++) { track = tracks[i]; if (track.kind() == this.kind_ && track.dflt()) { if (track.readyState() < 2) { this.chaptersTrack = track; track.on('loaded', vjs.bind(this, this.createMenu)); return; } else { chaptersTrack = track; break; } } } var menu = this.menu = new vjs.Menu(this.player_); menu.el_.appendChild(vjs.createEl('li', { className: 'vjs-menu-title', innerHTML: vjs.capitalize(this.kind_), tabindex: -1 })); if (chaptersTrack) { var cues = chaptersTrack.cues_, cue, mi; i = 0; j = cues.length; for (;i<j;i++) { cue = cues[i]; mi = new vjs.ChaptersTrackMenuItem(this.player_, { 'track': chaptersTrack, 'cue': cue }); items.push(mi); menu.addChild(mi); } } if (this.items.length > 0) { this.show(); } return menu; }; /** * @constructor */ vjs.ChaptersTrackMenuItem = vjs.MenuItem.extend({ /** @constructor */ init: function(player, options){ var track = this.track = options['track'], cue = this.cue = options['cue'], currentTime = player.currentTime(); // Modify options for parent MenuItem class's init. options['label'] = cue.text; options['selected'] = (cue.startTime <= currentTime && currentTime < cue.endTime); vjs.MenuItem.call(this, player, options); track.on('cuechange', vjs.bind(this, this.update)); } }); vjs.ChaptersTrackMenuItem.prototype.onClick = function(){ vjs.MenuItem.prototype.onClick.call(this); this.player_.currentTime(this.cue.startTime); this.update(this.cue.startTime); }; vjs.ChaptersTrackMenuItem.prototype.update = function(){ var cue = this.cue, currentTime = this.player_.currentTime(); // vjs.log(currentTime, cue.startTime); this.selected(cue.startTime <= currentTime && currentTime < cue.endTime); }; // Add Buttons to controlBar vjs.obj.merge(vjs.ControlBar.prototype.options_['children'], { 'subtitlesButton': {}, 'captionsButton': {}, 'chaptersButton': {} }); // vjs.Cue = vjs.Component.extend({ // /** @constructor */ // init: function(player, options){ // vjs.Component.call(this, player, options); // } // }); /** * @fileoverview Add JSON support * @suppress {undefinedVars} * (Compiler doesn't like JSON not being declared) */ /** * Javascript JSON implementation * (Parse Method Only) * https://github.com/douglascrockford/JSON-js/blob/master/json2.js * Only using for parse method when parsing data-setup attribute JSON. * @suppress {undefinedVars} * @namespace * @private */ vjs.JSON; if (typeof window.JSON !== 'undefined' && window.JSON.parse === 'function') { vjs.JSON = window.JSON; } else { vjs.JSON = {}; var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; /** * parse the json * * @memberof vjs.JSON * @param {String} text The JSON string to parse * @param {Function=} [reviver] Optional function that can transform the results * @return {Object|Array} The parsed JSON */ vjs.JSON.parse = function (text, reviver) { var j; function walk(holder, key) { var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); } text = String(text); cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } if (/^[\],:{}\s]*$/ .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { j = eval('(' + text + ')'); return typeof reviver === 'function' ? walk({'': j}, '') : j; } throw new SyntaxError('JSON.parse(): invalid or malformed JSON data'); }; } /** * @fileoverview Functions for automatically setting up a player * based on the data-setup attribute of the video tag */ // Automatically set up any tags that have a data-setup attribute vjs.autoSetup = function(){ var options, vid, player, vids = document.getElementsByTagName('video'); // Check if any media elements exist if (vids && vids.length > 0) { for (var i=0,j=vids.length; i<j; i++) { vid = vids[i]; // Check if element exists, has getAttribute func. // IE seems to consider typeof el.getAttribute == 'object' instead of 'function' like expected, at least when loading the player immediately. if (vid && vid.getAttribute) { // Make sure this player hasn't already been set up. if (vid['player'] === undefined) { options = vid.getAttribute('data-setup'); // Check if data-setup attr exists. // We only auto-setup if they've added the data-setup attr. if (options !== null) { // Parse options JSON // If empty string, make it a parsable json object. options = vjs.JSON.parse(options || '{}'); // Create new video.js instance. player = videojs(vid, options); } } // If getAttribute isn't defined, we need to wait for the DOM. } else { vjs.autoSetupTimeout(1); break; } } // No videos were found, so keep looping unless page is finisehd loading. } else if (!vjs.windowLoaded) { vjs.autoSetupTimeout(1); } }; // Pause to let the DOM keep processing vjs.autoSetupTimeout = function(wait){ setTimeout(vjs.autoSetup, wait); }; if (document.readyState === 'complete') { vjs.windowLoaded = true; } else { vjs.one(window, 'load', function(){ vjs.windowLoaded = true; }); } // Run Auto-load players // You have to wait at least once in case this script is loaded after your video in the DOM (weird behavior only with minified version) vjs.autoSetupTimeout(1); /** * the method for registering a video.js plugin * * @param {String} name The name of the plugin * @param {Function} init The function that is run when the player inits */ vjs.plugin = function(name, init){ vjs.Player.prototype[name] = init; };
ajax/libs/react-intl/1.1.0-rc-1/react-intl-with-locales.min.js
mscharl/cdnjs
(function(){"use strict";function a(a){var b,c,d,e,f=Array.prototype.slice.call(arguments,1);for(b=0,c=f.length;c>b;b+=1)if(d=f[b])for(e in d)q.call(d,e)&&(a[e]=d[e]);return a}function b(a,b,c){this.locales=a,this.formats=b,this.pluralFn=c}function c(a){this.id=a}function d(a,b,c,d){this.id=a,this.offset=b,this.options=c,this.pluralFn=d}function e(a,b,c,d){this.id=a,this.offset=b,this.numberFormat=c,this.string=d}function f(a,b){this.id=a,this.options=b}function g(a,b,c){var d="string"==typeof a?g.__parse(a):a;if(!d||"messageFormatPattern"!==d.type)throw new TypeError("A message must be provided as a String or AST.");c=this._mergeFormats(g.formats,c),s(this,"_locale",{value:this._resolveLocale(b)});var e=g.__localeData__[this._locale].pluralRuleFunction,f=this._compilePattern(d,b,c,e),h=this;this.format=function(a){return h._format(f,a)}}function h(a){return 400*a/146097}function i(a,b){b=b||{},"[object Array]"===Object.prototype.toString.call(a)&&(a=a.concat()),B(this,"_locale",{value:this._resolveLocale(a)}),B(this,"_locales",{value:a}),B(this,"_options",{value:{style:this._resolveStyle(b.style),units:this._isValidUnits(b.units)&&b.units}}),B(this,"_messages",{value:C(null)});var c=this;this.format=function(a){return c._format(a)}}function j(a){var b=Q(null);return function(){var c=Array.prototype.slice.call(arguments),d=k(c),e=d&&b[d];return e||(e=Q(a.prototype),a.apply(e,c),d&&(b[d]=e)),e}}function k(a){if("undefined"!=typeof JSON){var b,c,d,e=[];for(b=0,c=a.length;c>b;b+=1)d=a[b],e.push(d&&"object"==typeof d?l(d):d);return JSON.stringify(e)}}function l(a){var b,c,d,e,f=[],g=[];for(b in a)a.hasOwnProperty(b)&&g.push(b);var h=g.sort();for(c=0,d=h.length;d>c;c+=1)b=h[c],e={},e[b]=a[b],f[c]=e;return f}function m(a,b){if(!isFinite(a))throw new TypeError(b)}function n(a,b){if("number"!=typeof a)throw new TypeError(b)}function o(a){return Object.keys(a).reduce(function(b,c){var d=a[c];return"string"==typeof d&&(d=eb(d)),b[c]=d,b},{})}function p(a){y.__addLocaleData(a),L.__addLocaleData(a)}var q=Object.prototype.hasOwnProperty,r=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),s=(!r&&!Object.prototype.__defineGetter__,r?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!q.call(a,b)||"value"in c)&&(a[b]=c.value)}),t=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)q.call(b,e)&&s(d,e,b[e]);return d},u=b;b.prototype.compile=function(a){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(a)},b.prototype.compileMessage=function(a){if(!a||"messageFormatPattern"!==a.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var b,c,d,e=a.elements,f=[];for(b=0,c=e.length;c>b;b+=1)switch(d=e[b],d.type){case"messageTextElement":f.push(this.compileMessageText(d));break;case"argumentElement":f.push(this.compileArgument(d));break;default:throw new Error("Message element does not have a valid type")}return f},b.prototype.compileMessageText=function(a){return this.currentPlural&&/(^|[^\\])#/g.test(a.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new e(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,a.value)):a.value.replace(/\\#/g,"#")},b.prototype.compileArgument=function(a){var b=a.format;if(!b)return new c(a.id);var e,g=this.formats,h=this.locales,i=this.pluralFn;switch(b.type){case"numberFormat":return e=g.number[b.style],{id:a.id,format:new Intl.NumberFormat(h,e).format};case"dateFormat":return e=g.date[b.style],{id:a.id,format:new Intl.DateTimeFormat(h,e).format};case"timeFormat":return e=g.time[b.style],{id:a.id,format:new Intl.DateTimeFormat(h,e).format};case"pluralFormat":return e=this.compileOptions(a),new d(a.id,b.offset,e,i);case"selectFormat":return e=this.compileOptions(a),new f(a.id,e);default:throw new Error("Message element does not have a valid format type")}},b.prototype.compileOptions=function(a){var b=a.format,c=b.options,d={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===b.type?a:null;var e,f,g;for(e=0,f=c.length;f>e;e+=1)g=c[e],d[g.selector]=this.compileMessage(g.value);return this.currentPlural=this.pluralStack.pop(),d},c.prototype.format=function(a){return a?"string"==typeof a?a:String(a):""},d.prototype.getOption=function(a){var b=this.options,c=b["="+a]||b[this.pluralFn(a-this.offset)];return c||b.other},e.prototype.format=function(a){var b=this.numberFormat.format(a-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+b).replace(/\\#/g,"#")},f.prototype.getOption=function(a){var b=this.options;return b[a]||b.other};var v=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Ob!==b&&(Ob>b&&(Ob=0,Pb={line:1,column:1,seenCR:!1}),c(Pb,Ob,b),Ob=b),Pb}function d(a){Qb>Mb||(Mb>Qb&&(Qb=Mb,Rb=[]),Rb.push(a))}function e(d,e,f){function g(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function h(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var d,e,f,g=new Array(a.length);for(f=0;f<a.length;f++)g[f]=a[f].description;return d=a.length>1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=c(f),j=f<a.length?a.charAt(f):null;return null!==e&&g(e),new b(null!==d?d:h(e,j),e,j,f,i.line,i.column)}function f(){var a;return a=g()}function g(){var a,b,c;for(a=Mb,b=[],c=h();c!==C;)b.push(c),c=h();return b!==C&&(Nb=a,b=F(b)),a=b}function h(){var a;return a=j(),a===C&&(a=l()),a}function i(){var b,c,d,e,f,g;if(b=Mb,c=[],d=Mb,e=u(),e!==C?(f=z(),f!==C?(g=u(),g!==C?(e=[e,f,g],d=e):(Mb=d,d=G)):(Mb=d,d=G)):(Mb=d,d=G),d!==C)for(;d!==C;)c.push(d),d=Mb,e=u(),e!==C?(f=z(),f!==C?(g=u(),g!==C?(e=[e,f,g],d=e):(Mb=d,d=G)):(Mb=d,d=G)):(Mb=d,d=G);else c=G;return c!==C&&(Nb=b,c=H(c)),b=c,b===C&&(b=Mb,c=t(),c!==C&&(c=a.substring(b,Mb)),b=c),b}function j(){var a,b;return a=Mb,b=i(),b!==C&&(Nb=a,b=I(b)),a=b}function k(){var b,c,e;if(b=x(),b===C){if(b=Mb,c=[],J.test(a.charAt(Mb))?(e=a.charAt(Mb),Mb++):(e=C,0===Sb&&d(K)),e!==C)for(;e!==C;)c.push(e),J.test(a.charAt(Mb))?(e=a.charAt(Mb),Mb++):(e=C,0===Sb&&d(K));else c=G;c!==C&&(c=a.substring(b,Mb)),b=c}return b}function l(){var b,c,e,f,g,h,i,j,l;return b=Mb,123===a.charCodeAt(Mb)?(c=L,Mb++):(c=C,0===Sb&&d(M)),c!==C?(e=u(),e!==C?(f=k(),f!==C?(g=u(),g!==C?(h=Mb,44===a.charCodeAt(Mb)?(i=O,Mb++):(i=C,0===Sb&&d(P)),i!==C?(j=u(),j!==C?(l=m(),l!==C?(i=[i,j,l],h=i):(Mb=h,h=G)):(Mb=h,h=G)):(Mb=h,h=G),h===C&&(h=N),h!==C?(i=u(),i!==C?(125===a.charCodeAt(Mb)?(j=Q,Mb++):(j=C,0===Sb&&d(R)),j!==C?(Nb=b,c=S(f,h),b=c):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G),b}function m(){var a;return a=n(),a===C&&(a=o(),a===C&&(a=p())),a}function n(){var b,c,e,f,g,h,i;return b=Mb,a.substr(Mb,6)===T?(c=T,Mb+=6):(c=C,0===Sb&&d(U)),c===C&&(a.substr(Mb,4)===V?(c=V,Mb+=4):(c=C,0===Sb&&d(W)),c===C&&(a.substr(Mb,4)===X?(c=X,Mb+=4):(c=C,0===Sb&&d(Y)))),c!==C?(e=u(),e!==C?(f=Mb,44===a.charCodeAt(Mb)?(g=O,Mb++):(g=C,0===Sb&&d(P)),g!==C?(h=u(),h!==C?(i=z(),i!==C?(g=[g,h,i],f=g):(Mb=f,f=G)):(Mb=f,f=G)):(Mb=f,f=G),f===C&&(f=N),f!==C?(Nb=b,c=Z(c,f),b=c):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G),b}function o(){var b,c,e,f,g,h,i,j,k;if(b=Mb,a.substr(Mb,6)===$?(c=$,Mb+=6):(c=C,0===Sb&&d(_)),c!==C)if(e=u(),e!==C)if(44===a.charCodeAt(Mb)?(f=O,Mb++):(f=C,0===Sb&&d(P)),f!==C)if(g=u(),g!==C)if(h=s(),h===C&&(h=N),h!==C)if(i=u(),i!==C){if(j=[],k=r(),k!==C)for(;k!==C;)j.push(k),k=r();else j=G;j!==C?(Nb=b,c=ab(h,j),b=c):(Mb=b,b=G)}else Mb=b,b=G;else Mb=b,b=G;else Mb=b,b=G;else Mb=b,b=G;else Mb=b,b=G;else Mb=b,b=G;return b}function p(){var b,c,e,f,g,h,i;if(b=Mb,a.substr(Mb,6)===bb?(c=bb,Mb+=6):(c=C,0===Sb&&d(cb)),c!==C)if(e=u(),e!==C)if(44===a.charCodeAt(Mb)?(f=O,Mb++):(f=C,0===Sb&&d(P)),f!==C)if(g=u(),g!==C){if(h=[],i=r(),i!==C)for(;i!==C;)h.push(i),i=r();else h=G;h!==C?(Nb=b,c=db(h),b=c):(Mb=b,b=G)}else Mb=b,b=G;else Mb=b,b=G;else Mb=b,b=G;else Mb=b,b=G;return b}function q(){var b,c,e,f;return b=Mb,c=Mb,61===a.charCodeAt(Mb)?(e=eb,Mb++):(e=C,0===Sb&&d(fb)),e!==C?(f=x(),f!==C?(e=[e,f],c=e):(Mb=c,c=G)):(Mb=c,c=G),c!==C&&(c=a.substring(b,Mb)),b=c,b===C&&(b=z()),b}function r(){var b,c,e,f,h,i,j,k,l;return b=Mb,c=u(),c!==C?(e=q(),e!==C?(f=u(),f!==C?(123===a.charCodeAt(Mb)?(h=L,Mb++):(h=C,0===Sb&&d(M)),h!==C?(i=u(),i!==C?(j=g(),j!==C?(k=u(),k!==C?(125===a.charCodeAt(Mb)?(l=Q,Mb++):(l=C,0===Sb&&d(R)),l!==C?(Nb=b,c=gb(e,j),b=c):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G),b}function s(){var b,c,e,f;return b=Mb,a.substr(Mb,7)===hb?(c=hb,Mb+=7):(c=C,0===Sb&&d(ib)),c!==C?(e=u(),e!==C?(f=x(),f!==C?(Nb=b,c=jb(f),b=c):(Mb=b,b=G)):(Mb=b,b=G)):(Mb=b,b=G),b}function t(){var b,c;if(Sb++,b=[],lb.test(a.charAt(Mb))?(c=a.charAt(Mb),Mb++):(c=C,0===Sb&&d(mb)),c!==C)for(;c!==C;)b.push(c),lb.test(a.charAt(Mb))?(c=a.charAt(Mb),Mb++):(c=C,0===Sb&&d(mb));else b=G;return Sb--,b===C&&(c=C,0===Sb&&d(kb)),b}function u(){var b,c,e;for(Sb++,b=Mb,c=[],e=t();e!==C;)c.push(e),e=t();return c!==C&&(c=a.substring(b,Mb)),b=c,Sb--,b===C&&(c=C,0===Sb&&d(nb)),b}function v(){var b;return ob.test(a.charAt(Mb))?(b=a.charAt(Mb),Mb++):(b=C,0===Sb&&d(pb)),b}function w(){var b;return qb.test(a.charAt(Mb))?(b=a.charAt(Mb),Mb++):(b=C,0===Sb&&d(rb)),b}function x(){var b,c,e,f,g,h;if(b=Mb,48===a.charCodeAt(Mb)?(c=sb,Mb++):(c=C,0===Sb&&d(tb)),c===C){if(c=Mb,e=Mb,ub.test(a.charAt(Mb))?(f=a.charAt(Mb),Mb++):(f=C,0===Sb&&d(vb)),f!==C){for(g=[],h=v();h!==C;)g.push(h),h=v();g!==C?(f=[f,g],e=f):(Mb=e,e=G)}else Mb=e,e=G;e!==C&&(e=a.substring(c,Mb)),c=e}return c!==C&&(Nb=b,c=wb(c)),b=c}function y(){var b,c,e,f,g,h,i,j;return xb.test(a.charAt(Mb))?(b=a.charAt(Mb),Mb++):(b=C,0===Sb&&d(yb)),b===C&&(b=Mb,a.substr(Mb,2)===zb?(c=zb,Mb+=2):(c=C,0===Sb&&d(Ab)),c!==C&&(Nb=b,c=Bb()),b=c,b===C&&(b=Mb,a.substr(Mb,2)===Cb?(c=Cb,Mb+=2):(c=C,0===Sb&&d(Db)),c!==C&&(Nb=b,c=Eb()),b=c,b===C&&(b=Mb,a.substr(Mb,2)===Fb?(c=Fb,Mb+=2):(c=C,0===Sb&&d(Gb)),c!==C&&(Nb=b,c=Hb()),b=c,b===C&&(b=Mb,a.substr(Mb,2)===Ib?(c=Ib,Mb+=2):(c=C,0===Sb&&d(Jb)),c!==C?(e=Mb,f=Mb,g=w(),g!==C?(h=w(),h!==C?(i=w(),i!==C?(j=w(),j!==C?(g=[g,h,i,j],f=g):(Mb=f,f=G)):(Mb=f,f=G)):(Mb=f,f=G)):(Mb=f,f=G),f!==C&&(f=a.substring(e,Mb)),e=f,e!==C?(Nb=b,c=Kb(e),b=c):(Mb=b,b=G)):(Mb=b,b=G))))),b}function z(){var a,b,c;if(a=Mb,b=[],c=y(),c!==C)for(;c!==C;)b.push(c),c=y();else b=G;return b!==C&&(Nb=a,b=Lb(b)),a=b}var A,B=arguments.length>1?arguments[1]:{},C={},D={start:f},E=f,F=function(a){return{type:"messageFormatPattern",elements:a}},G=C,H=function(a){var b,c,d,e,f,g="";for(b=0,d=a.length;d>b;b+=1)for(e=a[b],c=0,f=e.length;f>c;c+=1)g+=e[c];return g},I=function(a){return{type:"messageTextElement",value:a}},J=/^[^ \t\n\r,.+={}#]/,K={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},L="{",M={type:"literal",value:"{",description:'"{"'},N=null,O=",",P={type:"literal",value:",",description:'","'},Q="}",R={type:"literal",value:"}",description:'"}"'},S=function(a,b){return{type:"argumentElement",id:a,format:b&&b[2]}},T="number",U={type:"literal",value:"number",description:'"number"'},V="date",W={type:"literal",value:"date",description:'"date"'},X="time",Y={type:"literal",value:"time",description:'"time"'},Z=function(a,b){return{type:a+"Format",style:b&&b[2]}},$="plural",_={type:"literal",value:"plural",description:'"plural"'},ab=function(a,b){return{type:"pluralFormat",offset:a||0,options:b}},bb="select",cb={type:"literal",value:"select",description:'"select"'},db=function(a){return{type:"selectFormat",options:a}},eb="=",fb={type:"literal",value:"=",description:'"="'},gb=function(a,b){return{type:"optionalFormatPattern",selector:a,value:b}},hb="offset:",ib={type:"literal",value:"offset:",description:'"offset:"'},jb=function(a){return a},kb={type:"other",description:"whitespace"},lb=/^[ \t\n\r]/,mb={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},nb={type:"other",description:"optionalWhitespace"},ob=/^[0-9]/,pb={type:"class",value:"[0-9]",description:"[0-9]"},qb=/^[0-9a-f]/i,rb={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},sb="0",tb={type:"literal",value:"0",description:'"0"'},ub=/^[1-9]/,vb={type:"class",value:"[1-9]",description:"[1-9]"},wb=function(a){return parseInt(a,10)},xb=/^[^{}\\\0-\x1F \t\n\r]/,yb={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},zb="\\#",Ab={type:"literal",value:"\\#",description:'"\\\\#"'},Bb=function(){return"\\#"},Cb="\\{",Db={type:"literal",value:"\\{",description:'"\\\\{"'},Eb=function(){return"{"},Fb="\\}",Gb={type:"literal",value:"\\}",description:'"\\\\}"'},Hb=function(){return"}"},Ib="\\u",Jb={type:"literal",value:"\\u",description:'"\\\\u"'},Kb=function(a){return String.fromCharCode(parseInt(a,16))},Lb=function(a){return a.join("")},Mb=0,Nb=0,Ob=0,Pb={line:1,column:1,seenCR:!1},Qb=0,Rb=[],Sb=0;if("startRule"in B){if(!(B.startRule in D))throw new Error("Can't start parsing from rule \""+B.startRule+'".');E=D[B.startRule]}if(A=E(),A!==C&&Mb===a.length)return A;throw A!==C&&Mb<a.length&&d({type:"end",description:"end of input"}),e(null,Rb,Qb)}return a(b,Error),{SyntaxError:b,parse:c}}(),w=g;s(g,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{"short":{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},"long":{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{"short":{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},"long":{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),s(g,"__localeData__",{value:t(null)}),s(g,"__addLocaleData",{value:function(a){if(!a||!a.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");if(!a.pluralRuleFunction)throw new Error("Locale data provided to IntlMessageFormat is missing a `pluralRuleFunction` property");var b=a.locale.toLowerCase().split("-")[0];g.__localeData__[b]=a}}),s(g,"__parse",{value:v.parse}),s(g,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),g.prototype.resolvedOptions=function(){return{locale:this._locale}},g.prototype._compilePattern=function(a,b,c,d){var e=new u(b,c,d);return e.compile(a)},g.prototype._format=function(a,b){var c,d,e,f,g,h="";for(c=0,d=a.length;d>c;c+=1)if(e=a[c],"string"!=typeof e){if(f=e.id,!b||!q.call(b,f))throw new Error("A value must be provided for: "+f);g=b[f],h+=e.options?this._format(e.getOption(g),b):e.format(g)}else h+=e;return h},g.prototype._mergeFormats=function(b,c){var d,e,f={};for(d in b)q.call(b,d)&&(f[d]=e=t(b[d]),c&&q.call(c,d)&&a(e,c[d]));return f},g.prototype._resolveLocale=function(a){a||(a=g.defaultLocale),"string"==typeof a&&(a=[a]);var b,c,d,e=g.__localeData__;for(b=0,c=a.length;c>b;b+=1){if(d=a[b].split("-")[0].toLowerCase(),!/[a-z]{2,3}/.test(d))throw new Error("Language tag provided to IntlMessageFormat is not structrually valid: "+d);if(q.call(e,d))return d}throw new Error("No locale data has been added to IntlMessageFormat for: "+a.join(", "))};var x={locale:"en",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"}};w.__addLocaleData(x),w.defaultLocale="en";var y=w,z=Object.prototype.hasOwnProperty,A=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),B=(!A&&!Object.prototype.__defineGetter__,A?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!z.call(a,b)||"value"in c)&&(a[b]=c.value)}),C=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)z.call(b,e)&&B(d,e,b[e]);return d},D=Array.prototype.indexOf||function(a,b){var c=this;if(!c.length)return-1;for(var d=b||0,e=c.length;e>d;d++)if(c[d]===a)return d;return-1},E=Math.round,F=function(a,b){a=+a,b=+b;var c=E(b-a),d=E(c/1e3),e=E(d/60),f=E(e/60),g=E(f/24),i=E(g/7),j=h(g),k=E(12*j),l=E(j);return{millisecond:c,second:d,minute:e,hour:f,day:g,week:i,month:k,year:l}},G=i,H=["second","minute","hour","day","month","year"],I=["best fit","numeric"],J=Date.now?Date.now:function(){return(new Date).getTime()};B(i,"__localeData__",{value:C(null)}),B(i,"__addLocaleData",{value:function(a){if(!a||!a.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");if(!a.fields)throw new Error("Locale data provided to IntlRelativeFormat is missing a `fields` property value");y.__addLocaleData(a);var b=a.locale.toLowerCase().split("-")[0];i.__localeData__[b]=a}}),B(i,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),B(i,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),i.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},i.prototype._compileMessage=function(a){var b,c=this._locales,d=this._locale,e=i.__localeData__,f=e[d].fields[a],g=f.relativeTime,h="",j="";for(b in g.future)g.future.hasOwnProperty(b)&&(h+=" "+b+" {"+g.future[b].replace("{0}","#")+"}");for(b in g.past)g.past.hasOwnProperty(b)&&(j+=" "+b+" {"+g.past[b].replace("{0}","#")+"}");var k="{when, select, future {{0, plural, "+h+"}}past {{0, plural, "+j+"}}}";return new y(k,c)},i.prototype._format=function(a){var b=J();if(void 0===a&&(a=b),!isFinite(a))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var c=F(b,a),d=this._options.units||this._selectUnits(c),e=c[d];if("numeric"!==this._options.style){var f=this._resolveRelativeUnits(e,d);if(f)return f}return this._resolveMessage(d).format({0:Math.abs(e),when:0>e?"past":"future"})},i.prototype._isValidUnits=function(a){if(!a||D.call(H,a)>=0)return!0;if("string"==typeof a){var b=/s$/.test(a)&&a.substr(0,a.length-1);if(b&&D.call(H,b)>=0)throw new Error('"'+a+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+b)}throw new Error('"'+a+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+H.join('", "')+'"')},i.prototype._resolveLocale=function(a){a||(a=i.defaultLocale),"string"==typeof a&&(a=[a]);var b,c,d,e=Object.prototype.hasOwnProperty,f=i.__localeData__;for(b=0,c=a.length;c>b;b+=1){if(d=a[b].split("-")[0].toLowerCase(),!/[a-z]{2,3}/.test(d))throw new Error("Language tag provided to IntlRelativeFormat is not structrually valid: "+d);if(e.call(f,d))return d}throw new Error("No locale data has been added to IntlRelativeFormat for: "+a.join(", "))},i.prototype._resolveMessage=function(a){var b=this._messages;return b[a]||(b[a]=this._compileMessage(a)),b[a]},i.prototype._resolveRelativeUnits=function(a,b){var c=i.__localeData__[this._locale].fields[b];return c.relative?c.relative[a]:void 0},i.prototype._resolveStyle=function(a){if(!a)return I[0];if(D.call(I,a)>=0)return a;throw new Error('"'+a+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+I.join('", "')+'"')},i.prototype._selectUnits=function(a){var b,c,d;for(b=0,c=H.length;c>b&&(d=H[b],!(Math.abs(a[d])<i.thresholds[d]));b+=1);return d};var K={locale:"en",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}}}};G.__addLocaleData(K),G.defaultLocale="en";var L=G,M={locale:"en",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}}}},N=Object.prototype.hasOwnProperty,O=function(){try{return!!Object.defineProperty({},"a",{})}catch(a){return!1}}(),P=(!O&&!Object.prototype.__defineGetter__,O?Object.defineProperty:function(a,b,c){"get"in c&&a.__defineGetter__?a.__defineGetter__(b,c.get):(!N.call(a,b)||"value"in c)&&(a[b]=c.value)}),Q=Object.create||function(a,b){function c(){}var d,e;c.prototype=a,d=new c;for(e in b)N.call(b,e)&&P(d,e,b[e]);return d},R=j,S={locales:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.array]),formats:React.PropTypes.object,messages:React.PropTypes.object},T={statics:{filterFormatOptions:function(a){return(this.formatOptions||[]).reduce(function(b,c){return a.hasOwnProperty(c)&&(b[c]=a[c]),b},{})}},propsTypes:S,contextTypes:S,childContextTypes:S,getNumberFormat:R(Intl.NumberFormat),getDateTimeFormat:R(Intl.DateTimeFormat),getMessageFormat:R(y),getRelativeFormat:R(L),getChildContext:function(){var a=this.context,b=this.props;return{locales:b.locales||a.locales,formats:b.formats||a.formats,messages:b.messages||a.messages}},formatDate:function(a,b){return a=new Date(a),m(a,"A date or timestamp must be provided to formatDate()"),this._format("date",a,b)},formatTime:function(a,b){return a=new Date(a),m(a,"A date or timestamp must be provided to formatTime()"),this._format("time",a,b)},formatRelative:function(a,b){return a=new Date(a),m(a,"A date or timestamp must be provided to formatRelative()"),this._format("relative",a,b)},formatNumber:function(a,b){return n(a,"A number must be provided to formatNumber()"),this._format("number",a,b)},formatMessage:function(a,b){var c=this.props.locales||this.context.locales,d=this.props.formats||this.context.formats;return"function"==typeof a?a(b):("string"==typeof a&&(a=this.getMessageFormat(a,c,d)),a.format(b))},getIntlMessage:function(a){var b,c=this.props.messages||this.context.messages,d=a.split(".");try{b=d.reduce(function(a,b){return a[b]},c)}finally{if(void 0===b)throw new ReferenceError("Could not find Intl message: "+a)}return b},_format:function(a,b,c){var d=this.props.locales||this.context.locales,e=this.props.formats||this.context.formats;if(c&&"string"==typeof c)try{c=e[a][c]}catch(f){c=void 0}finally{if(void 0===c)throw new ReferenceError("No "+a+" format named: "+c)}switch(a){case"date":case"time":return this.getDateTimeFormat(d,c).format(b);case"number":return this.getNumberFormat(d,c).format(b);case"relative":return this.getRelativeFormat(d,c).format(b);default:throw new Error("Unrecognized format type: "+a)}}},U=React.createClass({displayName:"IntlDate",mixins:[T],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},render:function(){var a=this.props,b=a.children,c=a.format||U.filterFormatOptions(a);return React.DOM.span(null,this.formatDate(b,c))}}),V=U,W=React.createClass({displayName:"IntlTime",mixins:[T],statics:{formatOptions:["localeMatcher","timeZone","hour12","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"]},render:function(){var a=this.props,b=a.children,c=a.format||W.filterFormatOptions(a);return React.DOM.span(null,this.formatTime(b,c))}}),X=W,Y=React.createClass({displayName:"IntlRelative",mixins:[T],statics:{formatOptions:["style","units"]},render:function(){var a=this.props,b=a.children,c=a.format||Y.filterFormatOptions(a);return React.DOM.span(null,this.formatRelative(b,c))}}),Z=Y,$=React.createClass({displayName:"IntlNumber",mixins:[T],statics:{formatOptions:["localeMatcher","style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"]},render:function(){var a=this.props,b=a.children,c=a.format||$.filterFormatOptions(a);return React.DOM.span(null,this.formatNumber(b,c))}}),_=$,ab=React.createClass({displayName:"IntlMessage",mixins:[T],render:function(){var a=this.props,b=a.children;return React.DOM.span(null,this.formatMessage(b,a))}}),bb=ab,cb={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},db=/[&><"']/g,eb=function(a){return(""+a).replace(db,function(a){return cb[a]})},fb=React.createClass({displayName:"IntlHTMLMessage",mixins:[T],getDefaultProps:function(){return{__tagName:"span"}},render:function(){var a=this.props,b=a.__tagName,c=a.children,d=o(a);return React.DOM[b]({dangerouslySetInnerHTML:{__html:this.formatMessage(c,d)}})}}),gb=fb;p(M);var hb={Mixin:T,Date:V,Time:X,Relative:Z,Number:_,Message:bb,HTMLMessage:gb,__addLocaleData:p};"undefined"!=typeof window&&(window.ReactIntlMixin=T,T.__addLocaleData=p),this.ReactIntl=hb}).call(this),ReactIntl.__addLocaleData({locale:"af",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekonde",relative:{0:"nou"},relativeTime:{future:{one:"Oor {0} sekonde",other:"Oor {0} sekondes"},past:{one:"{0} sekonde gelede",other:"{0} sekondes gelede"}}},minute:{displayName:"Minuut",relativeTime:{future:{one:"Oor {0} minuut",other:"Oor {0} minute"},past:{one:"{0} minuut gelede",other:"{0} minute gelede"}}},hour:{displayName:"Uur",relativeTime:{future:{one:"Oor {0} uur",other:"Oor {0} uur"},past:{one:"{0} uur gelede",other:"{0} uur gelede"}}},day:{displayName:"Dag",relative:{0:"vandag",1:"môre",2:"Die dag na môre","-2":"Die dag voor gister","-1":"gister"},relativeTime:{future:{one:"Oor {0} dag",other:"Oor {0} dae"},past:{one:"{0} dag gelede",other:"{0} dae gelede"}}},month:{displayName:"Maand",relative:{0:"vandeesmaand",1:"volgende maand","-1":"verlede maand"},relativeTime:{future:{one:"Oor {0} maand",other:"Oor {0} maande"},past:{one:"{0} maand gelede",other:"{0} maande gelede"}}},year:{displayName:"Jaar",relative:{0:"hierdie jaar",1:"volgende jaar","-1":"verlede jaar"},relativeTime:{future:{one:"Oor {0} jaar",other:"Oor {0} jaar"},past:{one:"{0} jaar gelede",other:"{0} jaar gelede"}}}}}),ReactIntl.__addLocaleData({locale:"ak",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a?"one":"other"},fields:{second:{displayName:"Sɛkɛnd",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Sema",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Dɔnhwer",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Da",relative:{0:"Ndɛ",1:"Ɔkyena","-1":"Ndeda"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Bosome",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Afe",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"am",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"ሰከንድ",relative:{0:"አሁን"},relativeTime:{future:{one:"በ{0} ሰከንድ ውስጥ",other:"በ{0} ሰከንዶች ውስጥ"},past:{one:"ከ{0} ሰከንድ በፊት",other:"ከ{0} ሰከንዶች በፊት"}}},minute:{displayName:"ደቂቃ",relativeTime:{future:{one:"በ{0} ደቂቃ ውስጥ",other:"በ{0} ደቂቃዎች ውስጥ"},past:{one:"ከ{0} ደቂቃ በፊት",other:"ከ{0} ደቂቃዎች በፊት"}}},hour:{displayName:"ሰዓት",relativeTime:{future:{one:"በ{0} ሰዓት ውስጥ",other:"በ{0} ሰዓቶች ውስጥ"},past:{one:"ከ{0} ሰዓት በፊት",other:"ከ{0} ሰዓቶች በፊት"}}},day:{displayName:"ቀን",relative:{0:"ዛሬ",1:"ነገ",2:"ከነገ ወዲያ","-2":"ከትናንት ወዲያ","-1":"ትናንት"},relativeTime:{future:{one:"በ{0} ቀን ውስጥ",other:"በ{0} ቀናት ውስጥ"},past:{one:"ከ{0} ቀን በፊት",other:"ከ{0} ቀናት በፊት"}}},month:{displayName:"ወር",relative:{0:"በዚህ ወር",1:"የሚቀጥለው ወር","-1":"ያለፈው ወር"},relativeTime:{future:{one:"በ{0} ወር ውስጥ",other:"በ{0} ወራት ውስጥ"},past:{one:"ከ{0} ወር በፊት",other:"ከ{0} ወራት በፊት"}}},year:{displayName:"ዓመት",relative:{0:"በዚህ ዓመት",1:"የሚቀጥለው ዓመት","-1":"ያለፈው ዓመት"},relativeTime:{future:{one:"በ{0} ዓመታት ውስጥ",other:"በ{0} ዓመታት ውስጥ"},past:{one:"ከ{0} ዓመት በፊት",other:"ከ{0} ዓመታት በፊት"}}}}}),ReactIntl.__addLocaleData({locale:"ar",pluralRuleFunction:function(a){return a=Math.floor(a),0===a?"zero":1===a?"one":2===a?"two":a%100===Math.floor(a%100)&&a%100>=3&&10>=a%100?"few":a%100===Math.floor(a%100)&&a%100>=11&&99>=a%100?"many":"other"},fields:{second:{displayName:"الثواني",relative:{0:"الآن"},relativeTime:{future:{zero:"خلال {0} من الثواني",one:"خلال {0} من الثواني",two:"خلال ثانيتين",few:"خلال {0} ثوانِ",many:"خلال {0} ثانية",other:"خلال {0} من الثواني"},past:{zero:"قبل {0} من الثواني",one:"قبل {0} من الثواني",two:"قبل ثانيتين",few:"قبل {0} ثوانِ",many:"قبل {0} ثانية",other:"قبل {0} من الثواني"}}},minute:{displayName:"الدقائق",relativeTime:{future:{zero:"خلال {0} من الدقائق",one:"خلال {0} من الدقائق",two:"خلال دقيقتين",few:"خلال {0} دقائق",many:"خلال {0} دقيقة",other:"خلال {0} من الدقائق"},past:{zero:"قبل {0} من الدقائق",one:"قبل {0} من الدقائق",two:"قبل دقيقتين",few:"قبل {0} دقائق",many:"قبل {0} دقيقة",other:"قبل {0} من الدقائق"}}},hour:{displayName:"الساعات",relativeTime:{future:{zero:"خلال {0} من الساعات",one:"خلال {0} من الساعات",two:"خلال ساعتين",few:"خلال {0} ساعات",many:"خلال {0} ساعة",other:"خلال {0} من الساعات"},past:{zero:"قبل {0} من الساعات",one:"قبل {0} من الساعات",two:"قبل ساعتين",few:"قبل {0} ساعات",many:"قبل {0} ساعة",other:"قبل {0} من الساعات"}}},day:{displayName:"يوم",relative:{0:"اليوم",1:"غدًا",2:"بعد الغد","-2":"أول أمس","-1":"أمس"},relativeTime:{future:{zero:"خلال {0} من الأيام",one:"خلال {0} من الأيام",two:"خلال يومين",few:"خلال {0} أيام",many:"خلال {0} يومًا",other:"خلال {0} من الأيام"},past:{zero:"قبل {0} من الأيام",one:"قبل {0} من الأيام",two:"قبل يومين",few:"قبل {0} أيام",many:"قبل {0} يومًا",other:"قبل {0} من الأيام"}}},month:{displayName:"الشهر",relative:{0:"هذا الشهر",1:"الشهر التالي","-1":"الشهر الماضي"},relativeTime:{future:{zero:"خلال {0} من الشهور",one:"خلال {0} من الشهور",two:"خلال شهرين",few:"خلال {0} شهور",many:"خلال {0} شهرًا",other:"خلال {0} من الشهور"},past:{zero:"قبل {0} من الشهور",one:"قبل {0} من الشهور",two:"قبل شهرين",few:"قبل {0} أشهر",many:"قبل {0} شهرًا",other:"قبل {0} من الشهور"}}},year:{displayName:"السنة",relative:{0:"هذه السنة",1:"السنة التالية","-1":"السنة الماضية"},relativeTime:{future:{zero:"خلال {0} من السنوات",one:"خلال {0} من السنوات",two:"خلال سنتين",few:"خلال {0} سنوات",many:"خلال {0} سنة",other:"خلال {0} من السنوات"},past:{zero:"قبل {0} من السنوات",one:"قبل {0} من السنوات",two:"قبل سنتين",few:"قبل {0} سنوات",many:"قبل {0} سنة",other:"قبل {0} من السنوات"}}}}}),ReactIntl.__addLocaleData({locale:"as",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length; return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"ছেকেণ্ড",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"মিনিট",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"ঘণ্টা",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"দিন",relative:{0:"today",1:"কাইলৈ",2:"পৰহিলৈ","-2":"পৰহি","-1":"কালি"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"মাহ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"বছৰ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"asa",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Thekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Thaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Thiku",relative:{0:"Iyoo",1:"Yavo","-1":"Ighuo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mweji",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ast",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"segundu",relative:{0:"now"},relativeTime:{future:{one:"En {0} segundu",other:"En {0} segundos"},past:{one:"Hai {0} segundu",other:"Hai {0} segundos"}}},minute:{displayName:"minutu",relativeTime:{future:{one:"En {0} minutu",other:"En {0} minutos"},past:{one:"Hai {0} minutu",other:"Hai {0} minutos"}}},hour:{displayName:"hora",relativeTime:{future:{one:"En {0} hora",other:"En {0} hores"},past:{one:"Hai {0} hora",other:"Hai {0} hores"}}},day:{displayName:"día",relative:{0:"güei",1:"mañana",2:"pasao mañana","-3":"antantayeri","-2":"antayeri","-1":"ayeri"},relativeTime:{future:{one:"En {0} dia",other:"En {0} díes"},past:{one:"Hai {0} dia",other:"Hai {0} díes"}}},month:{displayName:"mes",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"En {0} mes",other:"En {0} meses"},past:{one:"Hai {0} mes",other:"Hai {0} meses"}}},year:{displayName:"añu",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"En {0} añu",other:"En {0} años"},past:{one:"Hai {0} añu",other:"Hai {0} años"}}}}}),ReactIntl.__addLocaleData({locale:"az",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"saniyə",relative:{0:"indi"},relativeTime:{future:{one:"{0} saniyə ərzində",other:"{0} saniyə ərzində"},past:{one:"{0} saniyə öncə",other:"{0} saniyə öncə"}}},minute:{displayName:"dəqiqə",relativeTime:{future:{one:"{0} dəqiqə ərzində",other:"{0} dəqiqə ərzində"},past:{one:"{0} dəqiqə öncə",other:"{0} dəqiqə öncə"}}},hour:{displayName:"saat",relativeTime:{future:{one:"{0} saat ərzində",other:"{0} saat ərzində"},past:{one:"{0} saat öncə",other:"{0} saat öncə"}}},day:{displayName:"bu gün",relative:{0:"bu gün",1:"sabah","-1":"dünən"},relativeTime:{future:{one:"{0} gün ərində",other:"{0} gün ərində"},past:{one:"{0} gün öncə",other:"{0} gün öncə"}}},month:{displayName:"ay",relative:{0:"bu ay",1:"gələn ay","-1":"keçən ay"},relativeTime:{future:{one:"{0} ay ərzində",other:"{0} ay ərzində"},past:{one:"{0} ay öncə",other:"{0} ay öncə"}}},year:{displayName:"il",relative:{0:"bu il",1:"gələn il","-1":"keçən il"},relativeTime:{future:{one:"{0} il ərzində",other:"{0} il ərzində"},past:{one:"{0} il öncə",other:"{0} il öncə"}}}}}),ReactIntl.__addLocaleData({locale:"be",pluralRuleFunction:function(a){return a=Math.floor(a),a%10===1&&a%100!==11?"one":a%10===Math.floor(a%10)&&a%10>=2&&4>=a%10&&!(a%100>=12&&14>=a%100)?"few":a%10===0||a%10===Math.floor(a%10)&&a%10>=5&&9>=a%10||a%100===Math.floor(a%100)&&a%100>=11&&14>=a%100?"many":"other"},fields:{second:{displayName:"секунда",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"хвіліна",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"гадзіна",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"дзень",relative:{0:"сёння",1:"заўтра",2:"паслязаўтра","-2":"пазаўчора","-1":"учора"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"месяц",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"год",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"bem",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Mineti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Insa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ubushiku",relative:{0:"Lelo",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Umweshi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Umwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"bez",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Sihu",relative:{0:"Neng'u ni",1:"Hilawu","-1":"Igolo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mwedzi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Mwaha",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"bg",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"секунда",relative:{0:"сега"},relativeTime:{future:{one:"след {0} секунда",other:"след {0} секунди"},past:{one:"преди {0} секунда",other:"преди {0} секунди"}}},minute:{displayName:"минута",relativeTime:{future:{one:"след {0} минута",other:"след {0} минути"},past:{one:"преди {0} минута",other:"преди {0} минути"}}},hour:{displayName:"час",relativeTime:{future:{one:"след {0} час",other:"след {0} часа"},past:{one:"преди {0} час",other:"преди {0} часа"}}},day:{displayName:"ден",relative:{0:"днес",1:"утре",2:"вдругиден","-2":"онзи ден","-1":"вчера"},relativeTime:{future:{one:"след {0} дни",other:"след {0} дни"},past:{one:"преди {0} ден",other:"преди {0} дни"}}},month:{displayName:"месец",relative:{0:"този месец",1:"следващият месец","-1":"миналият месец"},relativeTime:{future:{one:"след {0} месец",other:"след {0} месеца"},past:{one:"преди {0} месец",other:"преди {0} месеца"}}},year:{displayName:"година",relative:{0:"тази година",1:"следващата година","-1":"миналата година"},relativeTime:{future:{one:"след {0} година",other:"след {0} години"},past:{one:"преди {0} година",other:"преди {0} години"}}}}}),ReactIntl.__addLocaleData({locale:"bm",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"lɛrɛ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"don",relative:{0:"bi",1:"sini","-1":"kunu"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"kalo",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"san",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"bn",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"সেকেন্ড",relative:{0:"এখন"},relativeTime:{future:{one:"{0} সেকেন্ডে",other:"{0} সেকেন্ডে"},past:{one:"{0} সেকেন্ড পূর্বে",other:"{0} সেকেন্ড পূর্বে"}}},minute:{displayName:"মিনিট",relativeTime:{future:{one:"{0} মিনিটে",other:"{0} মিনিটে"},past:{one:"{0} মিনিট পূর্বে",other:"{0} মিনিট পূর্বে"}}},hour:{displayName:"ঘন্টা",relativeTime:{future:{one:"{0} ঘন্টায়",other:"{0} ঘন্টায়"},past:{one:"{0} ঘন্টা আগে",other:"{0} ঘন্টা আগে"}}},day:{displayName:"দিন",relative:{0:"আজ",1:"আগামীকাল",2:"আগামী পরশু","-2":"গত পরশু","-1":"গতকাল"},relativeTime:{future:{one:"{0} দিনের মধ্যে",other:"{0} দিনের মধ্যে"},past:{one:"{0} দিন পূর্বে",other:"{0} দিন পূর্বে"}}},month:{displayName:"মাস",relative:{0:"এই মাস",1:"পরের মাস","-1":"গত মাস"},relativeTime:{future:{one:"{0} মাসে",other:"{0} মাসে"},past:{one:"{0} মাস পূর্বে",other:"{0} মাস পূর্বে"}}},year:{displayName:"বছর",relative:{0:"এই বছর",1:"পরের বছর","-1":"গত বছর"},relativeTime:{future:{one:"{0} বছরে",other:"{0} বছরে"},past:{one:"{0} বছর পূর্বে",other:"{0} বছর পূর্বে"}}}}}),ReactIntl.__addLocaleData({locale:"bo",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"སྐར་ཆ།",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"སྐར་མ།",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"ཆུ་ཙོ་",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"ཉིན།",relative:{0:"དེ་རིང་",1:"སང་ཉིན་",2:"གནངས་ཉིན་ཀ་","-2":"ཁས་ཉིན་ཀ་","-1":"ཁས་ས་"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"ཟླ་བ་",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ལོ།",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"br",pluralRuleFunction:function(a){return a=Math.floor(a),a%10===1&&a%100!==11&&a%100!==71&&a%100!==91?"one":a%10===2&&a%100!==12&&a%100!==72&&a%100!==92?"two":a%10===Math.floor(a%10)&&(a%10>=3&&4>=a%10||a%10===9)&&!(a%100>=10&&19>=a%100||a%100>=70&&79>=a%100||a%100>=90&&99>=a%100)?"few":0!==a&&a%1e6===0?"many":"other"},fields:{second:{displayName:"eilenn",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"munut",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"eur",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"hiziv",1:"warcʼhoazh","-2":"dercʼhent-decʼh","-1":"decʼh"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"miz",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"brx",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"सेखेन्द",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"मिनिथ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"रिंगा",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"सान",relative:{0:"दिनै",1:"गाबोन","-1":"मैया"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"दान",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"बोसोर",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"bs",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length,d=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),0===c&&b%10===1&&(b%100!==11||d%10===1&&d%100!==11)?"one":0===c&&b%10===Math.floor(b%10)&&b%10>=2&&4>=b%10&&(!(b%100>=12&&14>=b%100)||d%10===Math.floor(d%10)&&d%10>=2&&4>=d%10&&!(d%100>=12&&14>=d%100))?"few":"other"},fields:{second:{displayName:"sekund",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"minut",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"čas",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"dan",relative:{0:"danas",1:"sutra",2:"prekosutra","-2":"prekjuče","-1":"juče"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"mesec",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"godina",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ca",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"segon",relative:{0:"ara"},relativeTime:{future:{one:"D'aquí a {0} segon",other:"D'aquí a {0} segons"},past:{one:"Fa {0} segon",other:"Fa {0} segons"}}},minute:{displayName:"minut",relativeTime:{future:{one:"D'aquí a {0} minut",other:"D'aquí a {0} minuts"},past:{one:"Fa {0} minut",other:"Fa {0} minuts"}}},hour:{displayName:"hora",relativeTime:{future:{one:"D'aquí a {0} hora",other:"D'aquí a {0} hores"},past:{one:"Fa {0} hora",other:"Fa {0} hores"}}},day:{displayName:"dia",relative:{0:"avui",1:"demà",2:"demà passat","-2":"abans-d'ahir","-1":"ahir"},relativeTime:{future:{one:"D'aquí a {0} dia",other:"D'aquí a {0} dies"},past:{one:"Fa {0} dia",other:"Fa {0} dies"}}},month:{displayName:"mes",relative:{0:"aquest mes",1:"el mes que ve","-1":"el mes passat"},relativeTime:{future:{one:"D'aquí a {0} mes",other:"D'aquí a {0} mesos"},past:{one:"Fa {0} mes",other:"Fa {0} mesos"}}},year:{displayName:"any",relative:{0:"enguany",1:"l'any que ve","-1":"l'any passat"},relativeTime:{future:{one:"D'aquí a {0} any",other:"D'aquí a {0} anys"},past:{one:"Fa {0} any",other:"Fa {0} anys"}}}}}),ReactIntl.__addLocaleData({locale:"cgg",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Obucweka/Esekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Edakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Shaaha",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Eizooba",relative:{0:"Erizooba",1:"Nyenkyakare","-1":"Nyomwabazyo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Omwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"chr",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"ᎠᏎᏢ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"ᎢᏯᏔᏬᏍᏔᏅ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"ᏑᏣᎶᏓ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"ᏏᎦ",relative:{0:"ᎪᎯ ᎢᎦ",1:"ᏌᎾᎴᎢ","-1":"ᏒᎯ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"ᏏᏅᏓ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ᏑᏕᏘᏴᏓ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"cs",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":b===Math.floor(b)&&b>=2&&4>=b&&0===c?"few":0!==c?"many":"other"},fields:{second:{displayName:"Sekunda",relative:{0:"nyní"},relativeTime:{future:{one:"za {0} sekundu",few:"za {0} sekundy",many:"za {0} sekundy",other:"za {0} sekund"},past:{one:"před {0} sekundou",few:"před {0} sekundami",many:"před {0} sekundou",other:"před {0} sekundami"}}},minute:{displayName:"Minuta",relativeTime:{future:{one:"za {0} minutu",few:"za {0} minuty",many:"za {0} minuty",other:"za {0} minut"},past:{one:"před {0} minutou",few:"před {0} minutami",many:"před {0} minutou",other:"před {0} minutami"}}},hour:{displayName:"Hodina",relativeTime:{future:{one:"za {0} hodinu",few:"za {0} hodiny",many:"za {0} hodiny",other:"za {0} hodin"},past:{one:"před {0} hodinou",few:"před {0} hodinami",many:"před {0} hodinou",other:"před {0} hodinami"}}},day:{displayName:"Den",relative:{0:"dnes",1:"zítra",2:"pozítří","-2":"předevčírem","-1":"včera"},relativeTime:{future:{one:"za {0} den",few:"za {0} dny",many:"za {0} dne",other:"za {0} dní"},past:{one:"před {0} dnem",few:"před {0} dny",many:"před {0} dnem",other:"před {0} dny"}}},month:{displayName:"Měsíc",relative:{0:"tento měsíc",1:"příští měsíc","-1":"minulý měsíc"},relativeTime:{future:{one:"za {0} měsíc",few:"za {0} měsíce",many:"za {0} měsíce",other:"za {0} měsíců"},past:{one:"před {0} měsícem",few:"před {0} měsíci",many:"před {0} měsícem",other:"před {0} měsíci"}}},year:{displayName:"Rok",relative:{0:"tento rok",1:"příští rok","-1":"minulý rok"},relativeTime:{future:{one:"za {0} rok",few:"za {0} roky",many:"za {0} roku",other:"za {0} let"},past:{one:"před {0} rokem",few:"před {0} lety",many:"před {0} rokem",other:"před {0} lety"}}}}}),ReactIntl.__addLocaleData({locale:"cy",pluralRuleFunction:function(a){return a=Math.floor(a),0===a?"zero":1===a?"one":2===a?"two":3===a?"few":6===a?"many":"other"},fields:{second:{displayName:"Eiliad",relative:{0:"nawr"},relativeTime:{future:{zero:"Ymhen {0} eiliad",one:"Ymhen eiliad",two:"Ymhen {0} eiliad",few:"Ymhen {0} eiliad",many:"Ymhen {0} eiliad",other:"Ymhen {0} eiliad"},past:{zero:"{0} eiliad yn ôl",one:"eiliad yn ôl",two:"{0} eiliad yn ôl",few:"{0} eiliad yn ôl",many:"{0} eiliad yn ôl",other:"{0} eiliad yn ôl"}}},minute:{displayName:"Munud",relativeTime:{future:{zero:"Ymhen {0} munud",one:"Ymhen munud",two:"Ymhen {0} funud",few:"Ymhen {0} munud",many:"Ymhen {0} munud",other:"Ymhen {0} munud"},past:{zero:"{0} munud yn ôl",one:"{0} munud yn ôl",two:"{0} funud yn ôl",few:"{0} munud yn ôl",many:"{0} munud yn ôl",other:"{0} munud yn ôl"}}},hour:{displayName:"Awr",relativeTime:{future:{zero:"Ymhen {0} awr",one:"Ymhen {0} awr",two:"Ymhen {0} awr",few:"Ymhen {0} awr",many:"Ymhen {0} awr",other:"Ymhen {0} awr"},past:{zero:"{0} awr yn ôl",one:"awr yn ôl",two:"{0} awr yn ôl",few:"{0} awr yn ôl",many:"{0} awr yn ôl",other:"{0} awr yn ôl"}}},day:{displayName:"Dydd",relative:{0:"heddiw",1:"yfory",2:"drennydd","-2":"echdoe","-1":"ddoe"},relativeTime:{future:{zero:"Ymhen {0} diwrnod",one:"Ymhen diwrnod",two:"Ymhen deuddydd",few:"Ymhen tridiau",many:"Ymhen {0} diwrnod",other:"Ymhen {0} diwrnod"},past:{zero:"{0} diwrnod yn ôl",one:"{0} diwrnod yn ôl",two:"{0} ddiwrnod yn ôl",few:"{0} diwrnod yn ôl",many:"{0} diwrnod yn ôl",other:"{0} diwrnod yn ôl"}}},month:{displayName:"Mis",relative:{0:"y mis hwn",1:"mis nesaf","-1":"mis diwethaf"},relativeTime:{future:{zero:"Ymhen {0} mis",one:"Ymhen mis",two:"Ymhen deufis",few:"Ymhen {0} mis",many:"Ymhen {0} mis",other:"Ymhen {0} mis"},past:{zero:"{0} mis yn ôl",one:"{0} mis yn ôl",two:"{0} fis yn ôl",few:"{0} mis yn ôl",many:"{0} mis yn ôl",other:"{0} mis yn ôl"}}},year:{displayName:"Blwyddyn",relative:{0:"eleni",1:"blwyddyn nesaf","-1":"llynedd"},relativeTime:{future:{zero:"Ymhen {0} mlynedd",one:"Ymhen blwyddyn",two:"Ymhen {0} flynedd",few:"Ymhen {0} blynedd",many:"Ymhen {0} blynedd",other:"Ymhen {0} mlynedd"},past:{zero:"{0} o flynyddoedd yn ôl",one:"blwyddyn yn ôl",two:"{0} flynedd yn ôl",few:"{0} blynedd yn ôl",many:"{0} blynedd yn ôl",other:"{0} o flynyddoedd yn ôl"}}}}}),ReactIntl.__addLocaleData({locale:"da",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=parseInt(a.toString().replace(/^[^.]*\.?|0+$/g,""),10);return a=Math.floor(a),1===a||0!==c&&(0===b||1===b)?"one":"other"},fields:{second:{displayName:"Sekund",relative:{0:"nu"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"for {0} sekund siden",other:"for {0} sekunder siden"}}},minute:{displayName:"Minut",relativeTime:{future:{one:"om {0} minut",other:"om {0} minutter"},past:{one:"for {0} minut siden",other:"for {0} minutter siden"}}},hour:{displayName:"Time",relativeTime:{future:{one:"om {0} time",other:"om {0} timer"},past:{one:"for {0} time siden",other:"for {0} timer siden"}}},day:{displayName:"Dag",relative:{0:"i dag",1:"i morgen",2:"i overmorgen","-2":"i forgårs","-1":"i går"},relativeTime:{future:{one:"om {0} døgn",other:"om {0} døgn"},past:{one:"for {0} døgn siden",other:"for {0} døgn siden"}}},month:{displayName:"Måned",relative:{0:"denne måned",1:"næste måned","-1":"sidste måned"},relativeTime:{future:{one:"om {0} måned",other:"om {0} måneder"},past:{one:"for {0} måned siden",other:"for {0} måneder siden"}}},year:{displayName:"År",relative:{0:"i år",1:"næste år","-1":"sidste år"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"for {0} år siden",other:"for {0} år siden"}}}}}),ReactIntl.__addLocaleData({locale:"de",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"jetzt"},relativeTime:{future:{one:"In {0} Sekunde",other:"In {0} Sekunden"},past:{one:"Vor {0} Sekunde",other:"Vor {0} Sekunden"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"In {0} Minute",other:"In {0} Minuten"},past:{one:"Vor {0} Minute",other:"Vor {0} Minuten"}}},hour:{displayName:"Stunde",relativeTime:{future:{one:"In {0} Stunde",other:"In {0} Stunden"},past:{one:"Vor {0} Stunde",other:"Vor {0} Stunden"}}},day:{displayName:"Tag",relative:{0:"Heute",1:"Morgen",2:"Übermorgen","-2":"Vorgestern","-1":"Gestern"},relativeTime:{future:{one:"In {0} Tag",other:"In {0} Tagen"},past:{one:"Vor {0} Tag",other:"Vor {0} Tagen"}}},month:{displayName:"Monat",relative:{0:"Dieser Monat",1:"Nächster Monat","-1":"Letzter Monat"},relativeTime:{future:{one:"In {0} Monat",other:"In {0} Monaten"},past:{one:"Vor {0} Monat",other:"Vor {0} Monaten"}}},year:{displayName:"Jahr",relative:{0:"Dieses Jahr",1:"Nächstes Jahr","-1":"Letztes Jahr"},relativeTime:{future:{one:"In {0} Jahr",other:"In {0} Jahren"},past:{one:"Vor {0} Jahr",other:"Vor {0} Jahren"}}}}}),ReactIntl.__addLocaleData({locale:"dz",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"སྐར་ཆཱ་",relative:{0:"now"},relativeTime:{future:{other:"སྐར་ཆ་ {0} ནང་"},past:{other:"སྐར་ཆ་ {0} ཧེ་མ་"}}},minute:{displayName:"སྐར་མ",relativeTime:{future:{other:"སྐར་མ་ {0} ནང་"},past:{other:"སྐར་མ་ {0} ཧེ་མ་"}}},hour:{displayName:"ཆུ་ཚོད",relativeTime:{future:{other:"ཆུ་ཚོད་ {0} ནང་"},past:{other:"ཆུ་ཚོད་ {0} ཧེ་མ་"}}},day:{displayName:"ཚེས་",relative:{0:"ད་རིས་",1:"ནངས་པ་",2:"གནངས་ཚེ","-2":"ཁ་ཉིམ","-1":"ཁ་ཙ་"},relativeTime:{future:{other:"ཉིནམ་ {0} ནང་"},past:{other:"ཉིནམ་ {0} ཧེ་མ་"}}},month:{displayName:"ཟླ་ཝ་",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"ཟླཝ་ {0} ནང་"},past:{other:"ཟླཝ་ {0} ཧེ་མ་"}}},year:{displayName:"ལོ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"ལོ་འཁོར་ {0} ནང་"},past:{other:"ལོ་འཁོར་ {0} ཧེ་མ་"}}}}}),ReactIntl.__addLocaleData({locale:"ee",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"sekend",relative:{0:"fifi"},relativeTime:{future:{one:"le sekend {0} me",other:"le sekend {0} wo me"},past:{one:"sekend {0} si va yi",other:"sekend {0} si wo va yi"}}},minute:{displayName:"aɖabaƒoƒo",relativeTime:{future:{one:"le aɖabaƒoƒo {0} me",other:"le aɖabaƒoƒo {0} wo me"},past:{one:"aɖabaƒoƒo {0} si va yi",other:"aɖabaƒoƒo {0} si wo va yi"}}},hour:{displayName:"gaƒoƒo",relativeTime:{future:{one:"le gaƒoƒo {0} me",other:"le gaƒoƒo {0} wo me"},past:{one:"gaƒoƒo {0} si va yi",other:"gaƒoƒo {0} si wo va yi"}}},day:{displayName:"ŋkeke",relative:{0:"egbe",1:"etsɔ si gbɔna",2:"nyitsɔ si gbɔna","-2":"nyitsɔ si va yi","-1":"etsɔ si va yi"},relativeTime:{future:{one:"le ŋkeke {0} me",other:"le ŋkeke {0} wo me"},past:{one:"ŋkeke {0} si va yi",other:"ŋkeke {0} si wo va yi"}}},month:{displayName:"ɣleti",relative:{0:"ɣleti sia",1:"ɣleti si gbɔ na","-1":"ɣleti si va yi"},relativeTime:{future:{one:"le ɣleti {0} me",other:"le ɣleti {0} wo me"},past:{one:"ɣleti {0} si va yi",other:"ɣleti {0} si wo va yi"}}},year:{displayName:"ƒe",relative:{0:"ƒe sia",1:"ƒe si gbɔ na","-1":"ƒe si va yi"},relativeTime:{future:{one:"le ƒe {0} me",other:"le ƒe {0} wo me"},past:{one:"ƒe {0} si va yi",other:"ƒe {0} si wo va yi"}}}}}),ReactIntl.__addLocaleData({locale:"el",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Δευτερόλεπτο",relative:{0:"τώρα"},relativeTime:{future:{one:"Σε {0} δευτερόλεπτο",other:"Σε {0} δευτερόλεπτα"},past:{one:"Πριν από {0} δευτερόλεπτο",other:"Πριν από {0} δευτερόλεπτα"}}},minute:{displayName:"Λεπτό",relativeTime:{future:{one:"Σε {0} λεπτό",other:"Σε {0} λεπτά"},past:{one:"Πριν από {0} λεπτό",other:"Πριν από {0} λεπτά"}}},hour:{displayName:"Ώρα",relativeTime:{future:{one:"Σε {0} ώρα",other:"Σε {0} ώρες"},past:{one:"Πριν από {0} ώρα",other:"Πριν από {0} ώρες"}}},day:{displayName:"Ημέρα",relative:{0:"σήμερα",1:"αύριο",2:"μεθαύριο","-2":"προχθές","-1":"χθες"},relativeTime:{future:{one:"Σε {0} ημέρα",other:"Σε {0} ημέρες"},past:{one:"Πριν από {0} ημέρα",other:"Πριν από {0} ημέρες"}}},month:{displayName:"Μήνας",relative:{0:"τρέχων μήνας",1:"επόμενος μήνας","-1":"προηγούμενος μήνας"},relativeTime:{future:{one:"Σε {0} μήνα",other:"Σε {0} μήνες"},past:{one:"Πριν από {0} μήνα",other:"Πριν από {0} μήνες"}}},year:{displayName:"Έτος",relative:{0:"φέτος",1:"επόμενο έτος","-1":"προηγούμενο έτος"},relativeTime:{future:{one:"Σε {0} έτος",other:"Σε {0} έτη"},past:{one:"Πριν από {0} έτος",other:"Πριν από {0} έτη"}}}}}),ReactIntl.__addLocaleData({locale:"en",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}}}}),ReactIntl.__addLocaleData({locale:"eo",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"es",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"segundo",relative:{0:"ahora"},relativeTime:{future:{one:"dentro de {0} segundo",other:"dentro de {0} segundos"},past:{one:"hace {0} segundo",other:"hace {0} segundos"}}},minute:{displayName:"minuto",relativeTime:{future:{one:"dentro de {0} minuto",other:"dentro de {0} minutos"},past:{one:"hace {0} minuto",other:"hace {0} minutos"}}},hour:{displayName:"hora",relativeTime:{future:{one:"dentro de {0} hora",other:"dentro de {0} horas"},past:{one:"hace {0} hora",other:"hace {0} horas"}}},day:{displayName:"día",relative:{0:"hoy",1:"mañana",2:"pasado mañana","-2":"antes de ayer","-1":"ayer"},relativeTime:{future:{one:"dentro de {0} día",other:"dentro de {0} días"},past:{one:"hace {0} día",other:"hace {0} días"}}},month:{displayName:"mes",relative:{0:"este mes",1:"el próximo mes","-1":"el mes pasado"},relativeTime:{future:{one:"dentro de {0} mes",other:"dentro de {0} meses"},past:{one:"hace {0} mes",other:"hace {0} meses"}}},year:{displayName:"año",relative:{0:"este año",1:"el próximo año","-1":"el año pasado"},relativeTime:{future:{one:"dentro de {0} año",other:"dentro de {0} años"},past:{one:"hace {0} año",other:"hace {0} años"}}}}}),ReactIntl.__addLocaleData({locale:"et",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"sekund",relative:{0:"nüüd"},relativeTime:{future:{one:"{0} sekundi pärast",other:"{0} sekundi pärast"},past:{one:"{0} sekundi eest",other:"{0} sekundi eest"}}},minute:{displayName:"minut",relativeTime:{future:{one:"{0} minuti pärast",other:"{0} minuti pärast"},past:{one:"{0} minuti eest",other:"{0} minuti eest"}}},hour:{displayName:"tund",relativeTime:{future:{one:"{0} tunni pärast",other:"{0} tunni pärast"},past:{one:"{0} tunni eest",other:"{0} tunni eest"}}},day:{displayName:"päev",relative:{0:"täna",1:"homme",2:"ülehomme","-2":"üleeile","-1":"eile"},relativeTime:{future:{one:"{0} päeva pärast",other:"{0} päeva pärast"},past:{one:"{0} päeva eest",other:"{0} päeva eest"}}},month:{displayName:"kuu",relative:{0:"käesolev kuu",1:"järgmine kuu","-1":"eelmine kuu"},relativeTime:{future:{one:"{0} kuu pärast",other:"{0} kuu pärast"},past:{one:"{0} kuu eest",other:"{0} kuu eest"}}},year:{displayName:"aasta",relative:{0:"käesolev aasta",1:"järgmine aasta","-1":"eelmine aasta"},relativeTime:{future:{one:"{0} aasta pärast",other:"{0} aasta pärast"},past:{one:"{0} aasta eest",other:"{0} aasta eest"}}}}}),ReactIntl.__addLocaleData({locale:"eu",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other" },fields:{second:{displayName:"Segundoa",relative:{0:"orain"},relativeTime:{future:{one:"{0} segundo barru",other:"{0} segundo barru"},past:{one:"Duela {0} segundo",other:"Duela {0} segundo"}}},minute:{displayName:"Minutua",relativeTime:{future:{one:"{0} minutu barru",other:"{0} minutu barru"},past:{one:"Duela {0} minutu",other:"Duela {0} minutu"}}},hour:{displayName:"Ordua",relativeTime:{future:{one:"{0} ordu barru",other:"{0} ordu barru"},past:{one:"Duela {0} ordu",other:"Duela {0} ordu"}}},day:{displayName:"Eguna",relative:{0:"gaur",1:"bihar",2:"etzi","-2":"herenegun","-1":"atzo"},relativeTime:{future:{one:"{0} egun barru",other:"{0} egun barru"},past:{one:"Duela {0} egun",other:"Duela {0} egun"}}},month:{displayName:"Hilabetea",relative:{0:"hilabete hau",1:"hurrengo hilabetea","-1":"aurreko hilabetea"},relativeTime:{future:{one:"{0} hilabete barru",other:"{0} hilabete barru"},past:{one:"Duela {0} hilabete",other:"Duela {0} hilabete"}}},year:{displayName:"Urtea",relative:{0:"aurten",1:"hurrengo urtea","-1":"aurreko urtea"},relativeTime:{future:{one:"{0} urte barru",other:"{0} urte barru"},past:{one:"Duela {0} urte",other:"Duela {0} urte"}}}}}),ReactIntl.__addLocaleData({locale:"fa",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"ثانیه",relative:{0:"اکنون"},relativeTime:{future:{one:"{0} ثانیه بعد",other:"{0} ثانیه بعد"},past:{one:"{0} ثانیه پیش",other:"{0} ثانیه پیش"}}},minute:{displayName:"دقیقه",relativeTime:{future:{one:"{0} دقیقه بعد",other:"{0} دقیقه بعد"},past:{one:"{0} دقیقه پیش",other:"{0} دقیقه پیش"}}},hour:{displayName:"ساعت",relativeTime:{future:{one:"{0} ساعت بعد",other:"{0} ساعت بعد"},past:{one:"{0} ساعت پیش",other:"{0} ساعت پیش"}}},day:{displayName:"روز",relative:{0:"امروز",1:"فردا",2:"پس‌فردا","-2":"پریروز","-1":"دیروز"},relativeTime:{future:{one:"{0} روز بعد",other:"{0} روز بعد"},past:{one:"{0} روز پیش",other:"{0} روز پیش"}}},month:{displayName:"ماه",relative:{0:"این ماه",1:"ماه آینده","-1":"ماه گذشته"},relativeTime:{future:{one:"{0} ماه بعد",other:"{0} ماه بعد"},past:{one:"{0} ماه پیش",other:"{0} ماه پیش"}}},year:{displayName:"سال",relative:{0:"امسال",1:"سال آینده","-1":"سال گذشته"},relativeTime:{future:{one:"{0} سال بعد",other:"{0} سال بعد"},past:{one:"{0} سال پیش",other:"{0} سال پیش"}}}}}),ReactIntl.__addLocaleData({locale:"ff",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===b?"one":"other"},fields:{second:{displayName:"Majaango",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Hoƴom",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Waktu",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ñalnde",relative:{0:"Hannde",1:"Jaŋngo","-1":"Haŋki"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Lewru",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Hitaande",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"fi",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"sekunti",relative:{0:"nyt"},relativeTime:{future:{one:"{0} sekunnin päästä",other:"{0} sekunnin päästä"},past:{one:"{0} sekunti sitten",other:"{0} sekuntia sitten"}}},minute:{displayName:"minuutti",relativeTime:{future:{one:"{0} minuutin päästä",other:"{0} minuutin päästä"},past:{one:"{0} minuutti sitten",other:"{0} minuuttia sitten"}}},hour:{displayName:"tunti",relativeTime:{future:{one:"{0} tunnin päästä",other:"{0} tunnin päästä"},past:{one:"{0} tunti sitten",other:"{0} tuntia sitten"}}},day:{displayName:"päivä",relative:{0:"tänään",1:"huomenna",2:"ylihuomenna","-2":"toissapäivänä","-1":"eilen"},relativeTime:{future:{one:"{0} päivän päästä",other:"{0} päivän päästä"},past:{one:"{0} päivä sitten",other:"{0} päivää sitten"}}},month:{displayName:"kuukausi",relative:{0:"tässä kuussa",1:"ensi kuussa","-1":"viime kuussa"},relativeTime:{future:{one:"{0} kuukauden päästä",other:"{0} kuukauden päästä"},past:{one:"{0} kuukausi sitten",other:"{0} kuukautta sitten"}}},year:{displayName:"vuosi",relative:{0:"tänä vuonna",1:"ensi vuonna","-1":"viime vuonna"},relativeTime:{future:{one:"{0} vuoden päästä",other:"{0} vuoden päästä"},past:{one:"{0} vuosi sitten",other:"{0} vuotta sitten"}}}}}),ReactIntl.__addLocaleData({locale:"fil",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length,d=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),0===c&&(1===b||2===b||3===b||0===c&&(b%10!==4&&b%10!==6&&b%10!==9||0!==c&&d%10!==4&&d%10!==6&&d%10!==9))?"one":"other"},fields:{second:{displayName:"Segundo",relative:{0:"ngayon"},relativeTime:{future:{one:"Sa loob ng {0} segundo",other:"Sa loob ng {0} segundo"},past:{one:"{0} segundo ang nakalipas",other:"{0} segundo ang nakalipas"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"Sa loob ng {0} minuto",other:"Sa loob ng {0} minuto"},past:{one:"{0} minuto ang nakalipas",other:"{0} minuto ang nakalipas"}}},hour:{displayName:"Oras",relativeTime:{future:{one:"Sa loob ng {0} oras",other:"Sa loob ng {0} oras"},past:{one:"{0} oras ang nakalipas",other:"{0} oras ang nakalipas"}}},day:{displayName:"Araw",relative:{0:"Ngayon",1:"Bukas",2:"Samakalawa","-2":"Araw bago ang kahapon","-1":"Kahapon"},relativeTime:{future:{one:"Sa loob ng {0} araw",other:"Sa loob ng {0} araw"},past:{one:"{0} araw ang nakalipas",other:"{0} araw ang nakalipas"}}},month:{displayName:"Buwan",relative:{0:"ngayong buwan",1:"susunod na buwan","-1":"nakaraang buwan"},relativeTime:{future:{one:"Sa loob ng {0} buwan",other:"Sa loob ng {0} buwan"},past:{one:"{0} buwan ang nakalipas",other:"{0} buwan ang nakalipas"}}},year:{displayName:"Taon",relative:{0:"ngayong taon",1:"susunod na taon","-1":"nakaraang taon"},relativeTime:{future:{one:"Sa loob ng {0} taon",other:"Sa loob ng {0} taon"},past:{one:"{0} taon ang nakalipas",other:"{0} taon ang nakalipas"}}}}}),ReactIntl.__addLocaleData({locale:"fo",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"sekund",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"mínúta",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"klukkustund",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"dagur",relative:{0:"í dag",1:"á morgunn",2:"á yfirmorgunn","-2":"í fyrradag","-1":"í gær"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"mánuður",relative:{0:"henda mánuður",1:"næstu mánuður","-1":"síðstu mánuður"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ár",relative:{0:"hetta ár",1:"næstu ár","-1":"síðstu ár"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"fr",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===b?"one":"other"},fields:{second:{displayName:"seconde",relative:{0:"maintenant"},relativeTime:{future:{one:"dans {0} seconde",other:"dans {0} secondes"},past:{one:"il y a {0} seconde",other:"il y a {0} secondes"}}},minute:{displayName:"minute",relativeTime:{future:{one:"dans {0} minute",other:"dans {0} minutes"},past:{one:"il y a {0} minute",other:"il y a {0} minutes"}}},hour:{displayName:"heure",relativeTime:{future:{one:"dans {0} heure",other:"dans {0} heures"},past:{one:"il y a {0} heure",other:"il y a {0} heures"}}},day:{displayName:"jour",relative:{0:"aujourd’hui",1:"demain",2:"après-demain","-2":"avant-hier","-1":"hier"},relativeTime:{future:{one:"dans {0} jour",other:"dans {0} jours"},past:{one:"il y a {0} jour",other:"il y a {0} jours"}}},month:{displayName:"mois",relative:{0:"ce mois-ci",1:"le mois prochain","-1":"le mois dernier"},relativeTime:{future:{one:"dans {0} mois",other:"dans {0} mois"},past:{one:"il y a {0} mois",other:"il y a {0} mois"}}},year:{displayName:"année",relative:{0:"cette année",1:"l’année prochaine","-1":"l’année dernière"},relativeTime:{future:{one:"dans {0} an",other:"dans {0} ans"},past:{one:"il y a {0} an",other:"il y a {0} ans"}}}}}),ReactIntl.__addLocaleData({locale:"fur",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"secont",relative:{0:"now"},relativeTime:{future:{one:"ca di {0} secont",other:"ca di {0} seconts"},past:{one:"{0} secont indaûr",other:"{0} seconts indaûr"}}},minute:{displayName:"minût",relativeTime:{future:{one:"ca di {0} minût",other:"ca di {0} minûts"},past:{one:"{0} minût indaûr",other:"{0} minûts indaûr"}}},hour:{displayName:"ore",relativeTime:{future:{one:"ca di {0} ore",other:"ca di {0} oris"},past:{one:"{0} ore indaûr",other:"{0} oris indaûr"}}},day:{displayName:"dì",relative:{0:"vuê",1:"doman",2:"passantdoman","-2":"îr l'altri","-1":"îr"},relativeTime:{future:{one:"ca di {0} zornade",other:"ca di {0} zornadis"},past:{one:"{0} zornade indaûr",other:"{0} zornadis indaûr"}}},month:{displayName:"mês",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"ca di {0} mês",other:"ca di {0} mês"},past:{one:"{0} mês indaûr",other:"{0} mês indaûr"}}},year:{displayName:"an",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"ca di {0} an",other:"ca di {0} agns"},past:{one:"{0} an indaûr",other:"{0} agns indaûr"}}}}}),ReactIntl.__addLocaleData({locale:"fy",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Sekonde",relative:{0:"nu"},relativeTime:{future:{one:"Oer {0} sekonde",other:"Oer {0} sekonden"},past:{one:"{0} sekonde lyn",other:"{0} sekonden lyn"}}},minute:{displayName:"Minút",relativeTime:{future:{one:"Oer {0} minút",other:"Oer {0} minuten"},past:{one:"{0} minút lyn",other:"{0} minuten lyn"}}},hour:{displayName:"oere",relativeTime:{future:{one:"Oer {0} oere",other:"Oer {0} oere"},past:{one:"{0} oere lyn",other:"{0} oere lyn"}}},day:{displayName:"dei",relative:{0:"vandaag",1:"morgen",2:"Oermorgen","-2":"eergisteren","-1":"gisteren"},relativeTime:{future:{one:"Oer {0} dei",other:"Oer {0} deien"},past:{one:"{0} dei lyn",other:"{0} deien lyn"}}},month:{displayName:"Moanne",relative:{0:"dizze moanne",1:"folgjende moanne","-1":"foarige moanne"},relativeTime:{future:{one:"Oer {0} moanne",other:"Oer {0} moannen"},past:{one:"{0} moanne lyn",other:"{0} moannen lyn"}}},year:{displayName:"Jier",relative:{0:"dit jier",1:"folgjend jier","-1":"foarich jier"},relativeTime:{future:{one:"Oer {0} jier",other:"Oer {0} jier"},past:{one:"{0} jier lyn",other:"{0} jier lyn"}}}}}),ReactIntl.__addLocaleData({locale:"ga",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":2===a?"two":a===Math.floor(a)&&a>=3&&6>=a?"few":a===Math.floor(a)&&a>=7&&10>=a?"many":"other"},fields:{second:{displayName:"Soicind",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Nóiméad",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Uair",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Lá",relative:{0:"Inniu",1:"Amárach",2:"Arú amárach","-2":"Arú inné","-1":"Inné"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mí",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Bliain",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"gd",pluralRuleFunction:function(a){return a=Math.floor(a),1===a||11===a?"one":2===a||12===a?"two":a===Math.floor(a)&&(a>=3&&10>=a||a>=13&&19>=a)?"few":"other"},fields:{second:{displayName:"Diog",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Mionaid",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Uair a thìde",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Latha",relative:{0:"An-diugh",1:"A-màireach",2:"An-earar","-2":"A-bhòin-dè","-1":"An-dè"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mìos",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Bliadhna",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"gl",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Segundo",relative:{0:"agora"},relativeTime:{future:{one:"En {0} segundo",other:"En {0} segundos"},past:{one:"Hai {0} segundo",other:"Hai {0} segundos"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"En {0} minuto",other:"En {0} minutos"},past:{one:"Hai {0} minuto",other:"Hai {0} minutos"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"En {0} hora",other:"En {0} horas"},past:{one:"Hai {0} hora",other:"Hai {0} horas"}}},day:{displayName:"Día",relative:{0:"hoxe",1:"mañá",2:"pasadomañá","-2":"antonte","-1":"onte"},relativeTime:{future:{one:"En {0} día",other:"En {0} días"},past:{one:"Hai {0} día",other:"Hai {0} días"}}},month:{displayName:"Mes",relative:{0:"este mes",1:"mes seguinte","-1":"mes pasado"},relativeTime:{future:{one:"En {0} mes",other:"En {0} meses"},past:{one:"Hai {0} mes",other:"Hai {0} meses"}}},year:{displayName:"Ano",relative:{0:"este ano",1:"seguinte ano","-1":"ano pasado"},relativeTime:{future:{one:"En {0} ano",other:"En {0} anos"},past:{one:"Hai {0} ano",other:"Hai {0} anos"}}}}}),ReactIntl.__addLocaleData({locale:"gsw",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minuute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Schtund",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Tag",relative:{0:"hüt",1:"moorn",2:"übermoorn","-2":"vorgeschter","-1":"geschter"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Monet",relative:{0:"diese Monet",1:"nächste Monet","-1":"letzte Monet"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Jaar",relative:{0:"diese Jaar",1:"nächste Jaar","-1":"letzte Jaar"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"gu",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"સેકન્ડ",relative:{0:"હમણાં"},relativeTime:{future:{one:"{0} સેકંડમાં",other:"{0} સેકંડમાં"},past:{one:"{0} સેકંડ પહેલા",other:"{0} સેકંડ પહેલા"}}},minute:{displayName:"મિનિટ",relativeTime:{future:{one:"{0} મિનિટમાં",other:"{0} મિનિટમાં"},past:{one:"{0} મિનિટ પહેલા",other:"{0} મિનિટ પહેલા"}}},hour:{displayName:"કલાક",relativeTime:{future:{one:"{0} કલાકમાં",other:"{0} કલાકમાં"},past:{one:"{0} કલાક પહેલા",other:"{0} કલાક પહેલા"}}},day:{displayName:"દિવસ",relative:{0:"આજે",1:"આવતીકાલે",2:"પરમદિવસે","-2":"ગયા પરમદિવસે","-1":"ગઈકાલે"},relativeTime:{future:{one:"{0} દિવસમાં",other:"{0} દિવસમાં"},past:{one:"{0} દિવસ પહેલા",other:"{0} દિવસ પહેલા"}}},month:{displayName:"મહિનો",relative:{0:"આ મહિને",1:"આવતા મહિને","-1":"ગયા મહિને"},relativeTime:{future:{one:"{0} મહિનામાં",other:"{0} મહિનામાં"},past:{one:"{0} મહિના પહેલા",other:"{0} મહિના પહેલા"}}},year:{displayName:"વર્ષ",relative:{0:"આ વર્ષે",1:"આવતા વર્ષે","-1":"ગયા વર્ષે"},relativeTime:{future:{one:"{0} વર્ષમાં",other:"{0} વર્ષમાં"},past:{one:"{0} વર્ષ પહેલા",other:"{0} વર્ષ પહેલા"}}}}}),ReactIntl.__addLocaleData({locale:"gv",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),0===c&&b%10===1?"one":0===c&&b%10===2?"two":0!==c||b%100!==0&&b%100!==20&&b%100!==40&&b%100!==60&&b%100!==80?0!==c?"many":"other":"few"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ha",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Daƙiƙa",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Awa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Kwana",relative:{0:"Yau",1:"Gobe","-1":"Jiya"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Wata",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Shekara",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"haw",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"he",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":2===b&&0===c?"two":0!==c||a>=0&&10>=a||a%10!==0?"other":"many"},fields:{second:{displayName:"שנייה",relative:{0:"עכשיו"},relativeTime:{future:{one:"בעוד שנייה {0}",two:"בעוד {0} שניות",many:"בעוד {0} שניות",other:"בעוד {0} שניות"},past:{one:"לפני שנייה {0}",two:"לפני {0} שניות",many:"לפני {0} שניות",other:"לפני {0} שניות"}}},minute:{displayName:"דקה",relativeTime:{future:{one:"בעוד דקה {0}",two:"בעוד {0} דקות",many:"בעוד {0} דקות",other:"בעוד {0} דקות"},past:{one:"לפני דקה {0}",two:"לפני {0} דקות",many:"לפני {0} דקות",other:"לפני {0} דקות"}}},hour:{displayName:"שעה",relativeTime:{future:{one:"בעוד שעה {0}",two:"בעוד {0} שעות",many:"בעוד {0} שעות",other:"בעוד {0} שעות"},past:{one:"לפני שעה {0}",two:"לפני {0} שעות",many:"לפני {0} שעות",other:"לפני {0} שעות"}}},day:{displayName:"יום",relative:{0:"היום",1:"מחר",2:"מחרתיים","-2":"שלשום","-1":"אתמול"},relativeTime:{future:{one:"בעוד יום {0}",two:"בעוד {0} ימים",many:"בעוד {0} ימים",other:"בעוד {0} ימים"},past:{one:"לפני יום {0}",two:"לפני {0} ימים",many:"לפני {0} ימים",other:"לפני {0} ימים"}}},month:{displayName:"חודש",relative:{0:"החודש",1:"החודש הבא","-1":"החודש שעבר"},relativeTime:{future:{one:"בעוד חודש {0}",two:"בעוד {0} חודשים",many:"בעוד {0} חודשים",other:"בעוד {0} חודשים"},past:{one:"לפני חודש {0}",two:"לפני {0} חודשים",many:"לפני {0} חודשים",other:"לפני {0} חודשים"}}},year:{displayName:"שנה",relative:{0:"השנה",1:"השנה הבאה","-1":"השנה שעברה"},relativeTime:{future:{one:"בעוד שנה {0}",two:"בעוד {0} שנים",many:"בעוד {0} שנים",other:"בעוד {0} שנים"},past:{one:"לפני שנה {0}",two:"לפני {0} שנים",many:"לפני {0} שנים",other:"לפני {0} שנים"}}}}}),ReactIntl.__addLocaleData({locale:"hi",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"सेकंड",relative:{0:"अब"},relativeTime:{future:{one:"{0} सेकंड में",other:"{0} सेकंड में"},past:{one:"{0} सेकंड पहले",other:"{0} सेकंड पहले"}}},minute:{displayName:"मिनट",relativeTime:{future:{one:"{0} मिनट में",other:"{0} मिनट में"},past:{one:"{0} मिनट पहले",other:"{0} मिनट पहले"}}},hour:{displayName:"घंटा",relativeTime:{future:{one:"{0} घंटे में",other:"{0} घंटे में"},past:{one:"{0} घंटे पहले",other:"{0} घंटे पहले"}}},day:{displayName:"दिन",relative:{0:"आज",1:"आने वाला कल",2:"परसों","-2":"बीता परसों","-1":"बीता कल"},relativeTime:{future:{one:"{0} दिन में",other:"{0} दिन में"},past:{one:"{0} दिन पहले",other:"{0} दिन पहले"}}},month:{displayName:"माह",relative:{0:"यह माह",1:"अगला माह","-1":"पिछला माह"},relativeTime:{future:{one:"{0} माह में",other:"{0} माह में"},past:{one:"{0} माह पहले",other:"{0} माह पहले"}}},year:{displayName:"वर्ष",relative:{0:"यह वर्ष",1:"अगला वर्ष","-1":"पिछला वर्ष"},relativeTime:{future:{one:"{0} वर्ष में",other:"{0} वर्ष में"},past:{one:"{0} वर्ष पहले",other:"{0} वर्ष पहले"}}}}}),ReactIntl.__addLocaleData({locale:"hr",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length,d=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),0===c&&b%10===1&&(b%100!==11||d%10===1&&d%100!==11)?"one":0===c&&b%10===Math.floor(b%10)&&b%10>=2&&4>=b%10&&(!(b%100>=12&&14>=b%100)||d%10===Math.floor(d%10)&&d%10>=2&&4>=d%10&&!(d%100>=12&&14>=d%100))?"few":"other"},fields:{second:{displayName:"Sekunda",relative:{0:"sada"},relativeTime:{future:{one:"za {0} sekundu",few:"za {0} sekunde",other:"za {0} sekundi"},past:{one:"prije {0} sekundu",few:"prije {0} sekunde",other:"prije {0} sekundi"}}},minute:{displayName:"Minuta",relativeTime:{future:{one:"za {0} minutu",few:"za {0} minute",other:"za {0} minuta"},past:{one:"prije {0} minutu",few:"prije {0} minute",other:"prije {0} minuta"}}},hour:{displayName:"Sat",relativeTime:{future:{one:"za {0} sat",few:"za {0} sata",other:"za {0} sati"},past:{one:"prije {0} sat",few:"prije {0} sata",other:"prije {0} sati"}}},day:{displayName:"Dan",relative:{0:"danas",1:"sutra",2:"prekosutra","-2":"prekjučer","-1":"jučer"},relativeTime:{future:{one:"za {0} dan",few:"za {0} dana",other:"za {0} dana"},past:{one:"prije {0} dan",few:"prije {0} dana",other:"prije {0} dana"}}},month:{displayName:"Mjesec",relative:{0:"ovaj mjesec",1:"sljedeći mjesec","-1":"prošli mjesec"},relativeTime:{future:{one:"za {0} mjesec",few:"za {0} mjeseca",other:"za {0} mjeseci"},past:{one:"prije {0} mjesec",few:"prije {0} mjeseca",other:"prije {0} mjeseci"}}},year:{displayName:"Godina",relative:{0:"ove godine",1:"sljedeće godine","-1":"prošle godine"},relativeTime:{future:{one:"za {0} godinu",few:"za {0} godine",other:"za {0} godina"},past:{one:"prije {0} godinu",few:"prije {0} godine",other:"prije {0} godina"}}}}}),ReactIntl.__addLocaleData({locale:"hu",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"másodperc",relative:{0:"most"},relativeTime:{future:{one:"{0} másodperc múlva",other:"{0} másodperc múlva"},past:{one:"{0} másodperccel ezelőtt",other:"{0} másodperccel ezelőtt"}}},minute:{displayName:"perc",relativeTime:{future:{one:"{0} perc múlva",other:"{0} perc múlva"},past:{one:"{0} perccel ezelőtt",other:"{0} perccel ezelőtt"}}},hour:{displayName:"óra",relativeTime:{future:{one:"{0} óra múlva",other:"{0} óra múlva"},past:{one:"{0} órával ezelőtt",other:"{0} órával ezelőtt"}}},day:{displayName:"nap",relative:{0:"ma",1:"holnap",2:"holnapután","-2":"tegnapelőtt","-1":"tegnap"},relativeTime:{future:{one:"{0} nap múlva",other:"{0} nap múlva"},past:{one:"{0} nappal ezelőtt",other:"{0} nappal ezelőtt"}}},month:{displayName:"hónap",relative:{0:"ez a hónap",1:"következő hónap","-1":"előző hónap"},relativeTime:{future:{one:"{0} hónap múlva",other:"{0} hónap múlva"},past:{one:"{0} hónappal ezelőtt",other:"{0} hónappal ezelőtt"}}},year:{displayName:"év",relative:{0:"ez az év",1:"következő év","-1":"előző év"},relativeTime:{future:{one:"{0} év múlva",other:"{0} év múlva"},past:{one:"{0} évvel ezelőtt",other:"{0} évvel ezelőtt"}}}}}),ReactIntl.__addLocaleData({locale:"hy",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===b?"one":"other"},fields:{second:{displayName:"Վայրկյան",relative:{0:"այժմ"},relativeTime:{future:{one:"{0} վայրկյան անց",other:"{0} վայրկյան անց"},past:{one:"{0} վայրկյան առաջ",other:"{0} վայրկյան առաջ"}}},minute:{displayName:"Րոպե",relativeTime:{future:{one:"{0} րոպե անց",other:"{0} րոպե անց"},past:{one:"{0} րոպե առաջ",other:"{0} րոպե առաջ"}}},hour:{displayName:"Ժամ",relativeTime:{future:{one:"{0} ժամ անց",other:"{0} ժամ անց"},past:{one:"{0} ժամ առաջ",other:"{0} ժամ առաջ"}}},day:{displayName:"Օր",relative:{0:"այսօր",1:"վաղը",2:"վաղը չէ մյուս օրը","-2":"երեկ չէ առաջի օրը","-1":"երեկ"},relativeTime:{future:{one:"{0} օր անց",other:"{0} օր անց"},past:{one:"{0} օր առաջ",other:"{0} օր առաջ"}}},month:{displayName:"Ամիս",relative:{0:"այս ամիս",1:"հաջորդ ամիս","-1":"անցյալ ամիս"},relativeTime:{future:{one:"{0} ամիս անց",other:"{0} ամիս անց"},past:{one:"{0} ամիս առաջ",other:"{0} ամիս առաջ"}}},year:{displayName:"Տարի",relative:{0:"այս տարի",1:"հաջորդ տարի","-1":"անցյալ տարի"},relativeTime:{future:{one:"{0} տարի անց",other:"{0} տարի անց"},past:{one:"{0} տարի առաջ",other:"{0} տարի առաջ"}}}}}),ReactIntl.__addLocaleData({locale:"id",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Detik",relative:{0:"sekarang"},relativeTime:{future:{other:"Dalam {0} detik"},past:{other:"{0} detik yang lalu"}}},minute:{displayName:"Menit",relativeTime:{future:{other:"Dalam {0} menit"},past:{other:"{0} menit yang lalu"}}},hour:{displayName:"Jam",relativeTime:{future:{other:"Dalam {0} jam"},past:{other:"{0} jam yang lalu"}}},day:{displayName:"Hari",relative:{0:"hari ini",1:"besok",2:"lusa","-2":"kemarin lusa","-1":"kemarin"},relativeTime:{future:{other:"Dalam {0} hari"},past:{other:"{0} hari yang lalu"}}},month:{displayName:"Bulan",relative:{0:"bulan ini",1:"Bulan berikutnya","-1":"bulan lalu"},relativeTime:{future:{other:"Dalam {0} bulan"},past:{other:"{0} bulan yang lalu"}}},year:{displayName:"Tahun",relative:{0:"tahun ini",1:"tahun depan","-1":"tahun lalu"},relativeTime:{future:{other:"Dalam {0} tahun"},past:{other:"{0} tahun yang lalu"}}}}}),ReactIntl.__addLocaleData({locale:"ig",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Nkejinta",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Nkeji",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Elekere",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ụbọchị",relative:{0:"Taata",1:"Echi","-1":"Nnyaafụ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Ọnwa",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Afọ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ii",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"ꇙ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"ꃏ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"ꄮꈉ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"ꑍ",relative:{0:"ꀃꑍ",1:"ꃆꏂꑍ",2:"ꌕꀿꑍ","-2":"ꎴꂿꋍꑍ","-1":"ꀋꅔꉈ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"ꆪ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ꈎ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"is",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=parseInt(a.toString().replace(/^[^.]*\.?|0+$/g,""),10);return a=Math.floor(a),0!==c||b%10!==1||b%100===11&&0===c?"other":"one"},fields:{second:{displayName:"sekúnda",relative:{0:"núna"},relativeTime:{future:{one:"eftir {0} sekúndu",other:"eftir {0} sekúndur"},past:{one:"fyrir {0} sekúndu",other:"fyrir {0} sekúndum"}}},minute:{displayName:"mínúta",relativeTime:{future:{one:"eftir {0} mínútu",other:"eftir {0} mínútur"},past:{one:"fyrir {0} mínútu",other:"fyrir {0} mínútum"}}},hour:{displayName:"klukkustund",relativeTime:{future:{one:"eftir {0} klukkustund",other:"eftir {0} klukkustundir"},past:{one:"fyrir {0} klukkustund",other:"fyrir {0} klukkustundum"}}},day:{displayName:"dagur",relative:{0:"í dag",1:"á morgun",2:"eftir tvo daga","-2":"í fyrradag","-1":"í gær"},relativeTime:{future:{one:"eftir {0} dag",other:"eftir {0} daga"},past:{one:"fyrir {0} degi",other:"fyrir {0} dögum"}}},month:{displayName:"mánuður",relative:{0:"í þessum mánuði",1:"í næsta mánuði","-1":"í síðasta mánuði"},relativeTime:{future:{one:"eftir {0} mánuð",other:"eftir {0} mánuði"},past:{one:"fyrir {0} mánuði",other:"fyrir {0} mánuðum"}}},year:{displayName:"ár",relative:{0:"á þessu ári",1:"á næsta ári","-1":"á síðasta ári"},relativeTime:{future:{one:"eftir {0} ár",other:"eftir {0} ár"},past:{one:"fyrir {0} ári",other:"fyrir {0} árum"}}}}}),ReactIntl.__addLocaleData({locale:"it",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"secondo",relative:{0:"ora"},relativeTime:{future:{one:"tra {0} secondo",other:"tra {0} secondi"},past:{one:"{0} secondo fa",other:"{0} secondi fa"}}},minute:{displayName:"minuto",relativeTime:{future:{one:"tra {0} minuto",other:"tra {0} minuti"},past:{one:"{0} minuto fa",other:"{0} minuti fa"}}},hour:{displayName:"ora",relativeTime:{future:{one:"tra {0} ora",other:"tra {0} ore"},past:{one:"{0} ora fa",other:"{0} ore fa"}}},day:{displayName:"giorno",relative:{0:"oggi",1:"domani",2:"dopodomani","-2":"l'altro ieri","-1":"ieri"},relativeTime:{future:{one:"tra {0} giorno",other:"tra {0} giorni"},past:{one:"{0} giorno fa",other:"{0} giorni fa"}}},month:{displayName:"mese",relative:{0:"questo mese",1:"mese prossimo","-1":"mese scorso"},relativeTime:{future:{one:"tra {0} mese",other:"tra {0} mesi"},past:{one:"{0} mese fa",other:"{0} mesi fa"}}},year:{displayName:"anno",relative:{0:"quest'anno",1:"anno prossimo","-1":"anno scorso"},relativeTime:{future:{one:"tra {0} anno",other:"tra {0} anni"},past:{one:"{0} anno fa",other:"{0} anni fa"}}}}}),ReactIntl.__addLocaleData({locale:"ja",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"秒",relative:{0:"今すぐ"},relativeTime:{future:{other:"{0} 秒後"},past:{other:"{0} 秒前"}}},minute:{displayName:"分",relativeTime:{future:{other:"{0} 分後"},past:{other:"{0} 分前"}}},hour:{displayName:"時",relativeTime:{future:{other:"{0} 時間後"},past:{other:"{0} 時間前"}}},day:{displayName:"日",relative:{0:"今日",1:"明日",2:"明後日","-2":"一昨日","-1":"昨日"},relativeTime:{future:{other:"{0} 日後"},past:{other:"{0} 日前"}}},month:{displayName:"月",relative:{0:"今月",1:"翌月","-1":"先月"},relativeTime:{future:{other:"{0} か月後"},past:{other:"{0} か月前"}}},year:{displayName:"年",relative:{0:"今年",1:"翌年","-1":"昨年"},relativeTime:{future:{other:"{0} 年後"},past:{other:"{0} 年前"}}}}}),ReactIntl.__addLocaleData({locale:"jgo",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other" },fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"nǔu {0} minút",other:"nǔu {0} minút"},past:{one:"ɛ́ gɛ́ mɔ́ minút {0}",other:"ɛ́ gɛ́ mɔ́ minút {0}"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"nǔu háwa {0}",other:"nǔu háwa {0}"},past:{one:"ɛ́ gɛ mɔ́ {0} háwa",other:"ɛ́ gɛ mɔ́ {0} háwa"}}},day:{displayName:"Day",relative:{0:"lɔꞋɔ",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"Nǔu lɛ́Ꞌ {0}",other:"Nǔu lɛ́Ꞌ {0}"},past:{one:"Ɛ́ gɛ́ mɔ́ lɛ́Ꞌ {0}",other:"Ɛ́ gɛ́ mɔ́ lɛ́Ꞌ {0}"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"Nǔu {0} saŋ",other:"Nǔu {0} saŋ"},past:{one:"ɛ́ gɛ́ mɔ́ pɛsaŋ {0}",other:"ɛ́ gɛ́ mɔ́ pɛsaŋ {0}"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"Nǔu ŋguꞋ {0}",other:"Nǔu ŋguꞋ {0}"},past:{one:"Ɛ́gɛ́ mɔ́ ŋguꞋ {0}",other:"Ɛ́gɛ́ mɔ́ ŋguꞋ {0}"}}}}}),ReactIntl.__addLocaleData({locale:"jmc",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakyika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Mfiri",relative:{0:"Inu",1:"Ngama","-1":"Ukou"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Maka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ka",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"წამი",relative:{0:"ახლა"},relativeTime:{future:{one:"{0} წამში",other:"{0} წამში"},past:{one:"{0} წამის წინ",other:"{0} წამის წინ"}}},minute:{displayName:"წუთი",relativeTime:{future:{one:"{0} წუთში",other:"{0} წუთში"},past:{one:"{0} წუთის წინ",other:"{0} წუთის წინ"}}},hour:{displayName:"საათი",relativeTime:{future:{one:"{0} საათში",other:"{0} საათში"},past:{one:"{0} საათის წინ",other:"{0} საათის წინ"}}},day:{displayName:"დღე",relative:{0:"დღეს",1:"ხვალ",2:"ზეგ","-2":"გუშინწინ","-1":"გუშინ"},relativeTime:{future:{one:"{0} დღეში",other:"{0} დღეში"},past:{one:"{0} დღის წინ",other:"{0} დღის წინ"}}},month:{displayName:"თვე",relative:{0:"ამ თვეში",1:"მომავალ თვეს","-1":"გასულ თვეს"},relativeTime:{future:{one:"{0} თვეში",other:"{0} თვეში"},past:{one:"{0} თვის წინ",other:"{0} თვის წინ"}}},year:{displayName:"წელი",relative:{0:"ამ წელს",1:"მომავალ წელს","-1":"გასულ წელს"},relativeTime:{future:{one:"{0} წელიწადში",other:"{0} წელიწადში"},past:{one:"{0} წლის წინ",other:"{0} წლის წინ"}}}}}),ReactIntl.__addLocaleData({locale:"kab",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===b?"one":"other"},fields:{second:{displayName:"Tasint",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Tamrect",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Tamert",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ass",relative:{0:"Ass-a",1:"Azekka","-1":"Iḍelli"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Aggur",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Aseggas",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"kde",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Lihiku",relative:{0:"Nelo",1:"Nundu","-1":"Lido"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mwedi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"kea",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Sigundu",relative:{0:"now"},relativeTime:{future:{other:"di li {0} sigundu"},past:{other:"a ten {0} sigundu"}}},minute:{displayName:"Minutu",relativeTime:{future:{other:"di li {0} minutu"},past:{other:"a ten {0} minutu"}}},hour:{displayName:"Ora",relativeTime:{future:{other:"di li {0} ora"},past:{other:"a ten {0} ora"}}},day:{displayName:"Dia",relative:{0:"Oji",1:"Manha","-1":"Onti"},relativeTime:{future:{other:"di li {0} dia"},past:{other:"a ten {0} dia"}}},month:{displayName:"Mes",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"di li {0} mes"},past:{other:"a ten {0} mes"}}},year:{displayName:"Anu",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"di li {0} anu"},past:{other:"a ten {0} anu"}}}}}),ReactIntl.__addLocaleData({locale:"kk",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"секунд",relative:{0:"қазір"},relativeTime:{future:{one:"{0} секундтан кейін",other:"{0} секундтан кейін"},past:{one:"{0} секунд бұрын",other:"{0} секунд бұрын"}}},minute:{displayName:"минут",relativeTime:{future:{one:"{0} минуттан кейін",other:"{0} минуттан кейін"},past:{one:"{0} минут бұрын",other:"{0} минут бұрын"}}},hour:{displayName:"сағат",relativeTime:{future:{one:"{0} сағаттан кейін",other:"{0} сағаттан кейін"},past:{one:"{0} сағат бұрын",other:"{0} сағат бұрын"}}},day:{displayName:"күн",relative:{0:"бүгін",1:"ертең",2:"арғы күні","-2":"алдыңғы күні","-1":"кеше"},relativeTime:{future:{one:"{0} күннен кейін",other:"{0} күннен кейін"},past:{one:"{0} күн бұрын",other:"{0} күн бұрын"}}},month:{displayName:"ай",relative:{0:"осы ай",1:"келесі ай","-1":"өткен ай"},relativeTime:{future:{one:"{0} айдан кейін",other:"{0} айдан кейін"},past:{one:"{0} ай бұрын",other:"{0} ай бұрын"}}},year:{displayName:"жыл",relative:{0:"биылғы жыл",1:"келесі жыл","-1":"былтырғы жыл"},relativeTime:{future:{one:"{0} жылдан кейін",other:"{0} жылдан кейін"},past:{one:"{0} жыл бұрын",other:"{0} жыл бұрын"}}}}}),ReactIntl.__addLocaleData({locale:"kkj",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"muka",1:"nɛmɛnɔ","-1":"kwey"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"kl",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"sekundi",relative:{0:"now"},relativeTime:{future:{one:"om {0} sekundi",other:"om {0} sekundi"},past:{one:"for {0} sekundi siden",other:"for {0} sekundi siden"}}},minute:{displayName:"minutsi",relativeTime:{future:{one:"om {0} minutsi",other:"om {0} minutsi"},past:{one:"for {0} minutsi siden",other:"for {0} minutsi siden"}}},hour:{displayName:"nalunaaquttap-akunnera",relativeTime:{future:{one:"om {0} nalunaaquttap-akunnera",other:"om {0} nalunaaquttap-akunnera"},past:{one:"for {0} nalunaaquttap-akunnera siden",other:"for {0} nalunaaquttap-akunnera siden"}}},day:{displayName:"ulloq",relative:{0:"ullumi",1:"aqagu",2:"aqaguagu","-2":"ippassaani","-1":"ippassaq"},relativeTime:{future:{one:"om {0} ulloq unnuarlu",other:"om {0} ulloq unnuarlu"},past:{one:"for {0} ulloq unnuarlu siden",other:"for {0} ulloq unnuarlu siden"}}},month:{displayName:"qaammat",relative:{0:"manna qaammat",1:"tulleq qaammat","-1":"kingulleq qaammat"},relativeTime:{future:{one:"om {0} qaammat",other:"om {0} qaammat"},past:{one:"for {0} qaammat siden",other:"for {0} qaammat siden"}}},year:{displayName:"ukioq",relative:{0:"manna ukioq",1:"tulleq ukioq","-1":"kingulleq ukioq"},relativeTime:{future:{one:"om {0} ukioq",other:"om {0} ukioq"},past:{one:"for {0} ukioq siden",other:"for {0} ukioq siden"}}}}}),ReactIntl.__addLocaleData({locale:"km",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"វិនាទី",relative:{0:"ឥឡូវ"},relativeTime:{future:{other:"ក្នុង​រយៈពេល {0} វិនាទី"},past:{other:"{0} វិនាទី​មុន"}}},minute:{displayName:"នាទី",relativeTime:{future:{other:"ក្នុង​រយៈពេល {0} នាទី"},past:{other:"{0} នាទី​មុន"}}},hour:{displayName:"ម៉ោង",relativeTime:{future:{other:"ក្នុង​រយៈ​ពេល {0} ម៉ោង"},past:{other:"{0} ម៉ោង​មុន"}}},day:{displayName:"ថ្ងៃ",relative:{0:"ថ្ងៃ​នេះ",1:"ថ្ងៃ​ស្អែក",2:"​ខាន​ស្អែក","-2":"ម្សិល​ម៉្ងៃ","-1":"ម្សិលមិញ"},relativeTime:{future:{other:"ក្នុង​រយៈ​ពេល {0} ថ្ងៃ"},past:{other:"{0} ថ្ងៃ​មុន"}}},month:{displayName:"ខែ",relative:{0:"ខែ​នេះ",1:"ខែ​ក្រោយ","-1":"ខែ​មុន"},relativeTime:{future:{other:"ក្នុង​រយៈ​ពេល {0} ខែ"},past:{other:"{0} ខែមុន"}}},year:{displayName:"ឆ្នាំ",relative:{0:"ឆ្នាំ​នេះ",1:"ឆ្នាំ​ក្រោយ","-1":"ឆ្នាំ​មុន"},relativeTime:{future:{other:"ក្នុង​រយៈ​ពេល {0} ឆ្នាំ"},past:{other:"{0} ឆ្នាំ​មុន"}}}}}),ReactIntl.__addLocaleData({locale:"kn",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"ಸೆಕೆಂಡ್",relative:{0:"ಇದೀಗ"},relativeTime:{future:{one:"{0} ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ",other:"{0} ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ"},past:{one:"{0} ಸೆಕೆಂಡುಗಳ ಹಿಂದೆ",other:"{0} ಸೆಕೆಂಡುಗಳ ಹಿಂದೆ"}}},minute:{displayName:"ನಿಮಿಷ",relativeTime:{future:{one:"{0} ನಿಮಿಷಗಳಲ್ಲಿ",other:"{0} ನಿಮಿಷಗಳಲ್ಲಿ"},past:{one:"{0} ನಿಮಿಷಗಳ ಹಿಂದೆ",other:"{0} ನಿಮಿಷಗಳ ಹಿಂದೆ"}}},hour:{displayName:"ಗಂಟೆ",relativeTime:{future:{one:"{0} ಗಂಟೆಗಳಲ್ಲಿ",other:"{0} ಗಂಟೆಗಳಲ್ಲಿ"},past:{one:"{0} ಗಂಟೆಗಳ ಹಿಂದೆ",other:"{0} ಗಂಟೆಗಳ ಹಿಂದೆ"}}},day:{displayName:"ದಿನ",relative:{0:"ಇಂದು",1:"ನಾಳೆ",2:"ನಾಡಿದ್ದು","-2":"ಮೊನ್ನೆ","-1":"ನಿನ್ನೆ"},relativeTime:{future:{one:"{0} ದಿನಗಳಲ್ಲಿ",other:"{0} ದಿನಗಳಲ್ಲಿ"},past:{one:"{0} ದಿನಗಳ ಹಿಂದೆ",other:"{0} ದಿನಗಳ ಹಿಂದೆ"}}},month:{displayName:"ತಿಂಗಳು",relative:{0:"ಈ ತಿಂಗಳು",1:"ಮುಂದಿನ ತಿಂಗಳು","-1":"ಕಳೆದ ತಿಂಗಳು"},relativeTime:{future:{one:"{0} ತಿಂಗಳುಗಳಲ್ಲಿ",other:"{0} ತಿಂಗಳುಗಳಲ್ಲಿ"},past:{one:"{0} ತಿಂಗಳುಗಳ ಹಿಂದೆ",other:"{0} ತಿಂಗಳುಗಳ ಹಿಂದೆ"}}},year:{displayName:"ವರ್ಷ",relative:{0:"ಈ ವರ್ಷ",1:"ಮುಂದಿನ ವರ್ಷ","-1":"ಕಳೆದ ವರ್ಷ"},relativeTime:{future:{one:"{0} ವರ್ಷಗಳಲ್ಲಿ",other:"{0} ವರ್ಷಗಳಲ್ಲಿ"},past:{one:"{0} ವರ್ಷಗಳ ಹಿಂದೆ",other:"{0} ವರ್ಷಗಳ ಹಿಂದೆ"}}}}}),ReactIntl.__addLocaleData({locale:"ko",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"초",relative:{0:"지금"},relativeTime:{future:{other:"{0}초 후"},past:{other:"{0}초 전"}}},minute:{displayName:"분",relativeTime:{future:{other:"{0}분 후"},past:{other:"{0}분 전"}}},hour:{displayName:"시",relativeTime:{future:{other:"{0}시간 후"},past:{other:"{0}시간 전"}}},day:{displayName:"일",relative:{0:"오늘",1:"내일",2:"모레","-2":"그저께","-1":"어제"},relativeTime:{future:{other:"{0}일 후"},past:{other:"{0}일 전"}}},month:{displayName:"월",relative:{0:"이번 달",1:"다음 달","-1":"지난달"},relativeTime:{future:{other:"{0}개월 후"},past:{other:"{0}개월 전"}}},year:{displayName:"년",relative:{0:"올해",1:"내년","-1":"지난해"},relativeTime:{future:{other:"{0}년 후"},past:{other:"{0}년 전"}}}}}),ReactIntl.__addLocaleData({locale:"ks",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"سٮ۪کَنڑ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"مِنَٹ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"گٲنٛٹہٕ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"دۄہ",relative:{0:"اَز",1:"پگاہ","-1":"راتھ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"رٮ۪تھ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ؤری",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ksb",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Siku",relative:{0:"Evi eo",1:"Keloi","-1":"Ghuo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Ng'ezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Ng'waka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ksh",pluralRuleFunction:function(a){return a=Math.floor(a),0===a?"zero":1===a?"one":"other"},fields:{second:{displayName:"Sekond",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Menutt",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Schtund",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Daach",relative:{0:"hück",1:"morje",2:"övvermorje","-2":"vörjestere","-1":"jestere"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mohnd",relative:{0:"diese Mohnd",1:"nächste Mohnd","-1":"lätzde Mohnd"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Johr",relative:{0:"diese Johr",1:"nächste Johr","-1":"läz Johr"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"kw",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":2===a?"two":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Eur",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Dedh",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mis",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Bledhen",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ky",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"секунд",relative:{0:"азыр"},relativeTime:{future:{one:"{0} секунддан кийин",other:"{0} секунддан кийин"},past:{one:"{0} секунд мурун",other:"{0} секунд мурун"}}},minute:{displayName:"мүнөт",relativeTime:{future:{one:"{0} мүнөттөн кийин",other:"{0} мүнөттөн кийин"},past:{one:"{0} мүнөт мурун",other:"{0} мүнөт мурун"}}},hour:{displayName:"саат",relativeTime:{future:{one:"{0} сааттан кийин",other:"{0} сааттан кийин"},past:{one:"{0} саат мурун",other:"{0} саат мурун"}}},day:{displayName:"күн",relative:{0:"бүгүн",1:"эртеӊ",2:"бүрсүгүнү","-2":"мурдагы күнү","-1":"кечээ"},relativeTime:{future:{one:"{0} күндөн кийин",other:"{0} күндөн кийин"},past:{one:"{0} күн мурун",other:"{0} күн мурун"}}},month:{displayName:"ай",relative:{0:"бул айда",1:"эмдиги айда","-1":"өткөн айда"},relativeTime:{future:{one:"{0} айдан кийин",other:"{0} айдан кийин"},past:{one:"{0} ай мурун",other:"{0} ай мурун"}}},year:{displayName:"жыл",relative:{0:"быйыл",1:"эмдиги жылы","-1":"былтыр"},relativeTime:{future:{one:"{0} жылдан кийин",other:"{0} жылдан кийин"},past:{one:"{0} жыл мурун",other:"{0} жыл мурун"}}}}}),ReactIntl.__addLocaleData({locale:"lag",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===a?"zero":0!==b&&1!==b||0===a?"other":"one"},fields:{second:{displayName:"Sekúunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakíka",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Sáa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Sikʉ",relative:{0:"Isikʉ",1:"Lamʉtoondo","-1":"Niijo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mweéri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Mwaáka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"lg",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Kasikonda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saawa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Lunaku",relative:{0:"Lwaleero",1:"Nkya","-1":"Ggulo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Mwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"lkt",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Okpí",relative:{0:"now"},relativeTime:{future:{other:"Letáŋhaŋ okpí {0} kiŋháŋ"},past:{other:"Hékta okpí {0} k’uŋ héhaŋ"}}},minute:{displayName:"Owápȟe oȟʼáŋkȟo",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Owápȟe",relativeTime:{future:{other:"Letáŋhaŋ owápȟe {0} kiŋháŋ"},past:{other:"Hékta owápȟe {0} kʼuŋ héhaŋ"}}},day:{displayName:"Aŋpétu",relative:{0:"Lé aŋpétu kiŋ",1:"Híŋhaŋni kiŋháŋ","-1":"Lé aŋpétu kiŋ"},relativeTime:{future:{other:"Letáŋhaŋ {0}-čháŋ kiŋháŋ"},past:{other:"Hékta {0}-čháŋ k’uŋ héhaŋ"}}},month:{displayName:"Wí",relative:{0:"Lé wí kiŋ",1:"Wí kiŋháŋ","-1":"Wí kʼuŋ héhaŋ"},relativeTime:{future:{other:"Letáŋhaŋ wíyawapi {0} kiŋháŋ"},past:{other:"Hékta wíyawapi {0} kʼuŋ héhaŋ"}}},year:{displayName:"Ómakȟa",relative:{0:"Lé ómakȟa kiŋ",1:"Tȟokáta ómakȟa kiŋháŋ","-1":"Ómakȟa kʼuŋ héhaŋ"},relativeTime:{future:{other:"Letáŋhaŋ ómakȟa {0} kiŋháŋ"},past:{other:"Hékta ómakȟa {0} kʼuŋ héhaŋ"}}}}}),ReactIntl.__addLocaleData({locale:"ln",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a?"one":"other"},fields:{second:{displayName:"Sɛkɔ́ndɛ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Monúti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Ngonga",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Mokɔlɔ",relative:{0:"Lɛlɔ́",1:"Lóbi ekoyâ","-1":"Lóbi elékí"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Sánzá",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Mobú",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"lo",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"ວິນາທີ",relative:{0:"ຕອນນີ້"},relativeTime:{future:{other:"ໃນອີກ {0} ວິນາທີ"},past:{other:"{0} ວິນາທີກ່ອນ"}}},minute:{displayName:"ນາທີ",relativeTime:{future:{other:"{0} ໃນອີກ 0 ນາທີ"},past:{other:"{0} ນາທີກ່ອນ"}}},hour:{displayName:"ຊົ່ວໂມງ",relativeTime:{future:{other:"ໃນອີກ {0} ຊົ່ວໂມງ"},past:{other:"{0} ຊົ່ວໂມງກ່ອນ"}}},day:{displayName:"ມື້",relative:{0:"ມື້ນີ້",1:"ມື້ອື່ນ",2:"ມື້ຮື","-2":"ມື້ກ່ອນ","-1":"ມື້ວານ"},relativeTime:{future:{other:"ໃນອີກ {0} ມື້"},past:{other:"{0} ມື້ກ່ອນ"}}},month:{displayName:"ເດືອນ",relative:{0:"ເດືອນນີ້",1:"ເດືອນໜ້າ","-1":"ເດືອນແລ້ວ"},relativeTime:{future:{other:"ໃນອີກ {0} ເດືອນ"},past:{other:"{0} ເດືອນກ່ອນ"}}},year:{displayName:"ປີ",relative:{0:"ປີນີ້",1:"ປີໜ້າ","-1":"ປີກາຍ"},relativeTime:{future:{other:"ໃນອີກ {0} ປີ"},past:{other:"{0} ປີກ່ອນ"}}}}}),ReactIntl.__addLocaleData({locale:"lt",pluralRuleFunction:function(a){var b=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),a%10!==1||a%100>=11&&19>=a%100?a%10===Math.floor(a%10)&&a%10>=2&&9>=a%10&&!(a%100>=11&&19>=a%100)?"few":0!==b?"many":"other":"one"},fields:{second:{displayName:"Sekundė",relative:{0:"dabar"},relativeTime:{future:{one:"po {0} sekundės",few:"po {0} sekundžių",many:"po {0} sekundės",other:"po {0} sekundžių"},past:{one:"prieš {0} sekundę",few:"prieš {0} sekundes",many:"prieš {0} sekundės",other:"prieš {0} sekundžių"}}},minute:{displayName:"Minutė",relativeTime:{future:{one:"po {0} minutės",few:"po {0} minučių",many:"po {0} minutės",other:"po {0} minučių"},past:{one:"prieš {0} minutę",few:"prieš {0} minutes",many:"prieš {0} minutės",other:"prieš {0} minučių"}}},hour:{displayName:"Valanda",relativeTime:{future:{one:"po {0} valandos",few:"po {0} valandų",many:"po {0} valandos",other:"po {0} valandų"},past:{one:"prieš {0} valandą",few:"prieš {0} valandas",many:"prieš {0} valandos",other:"prieš {0} valandų"}}},day:{displayName:"Diena",relative:{0:"šiandien",1:"rytoj",2:"poryt","-2":"užvakar","-1":"vakar"},relativeTime:{future:{one:"po {0} dienos",few:"po {0} dienų",many:"po {0} dienos",other:"po {0} dienų"},past:{one:"prieš {0} dieną",few:"prieš {0} dienas",many:"prieš {0} dienos",other:"prieš {0} dienų"}}},month:{displayName:"Mėnuo",relative:{0:"šį mėnesį",1:"kitą mėnesį","-1":"praėjusį mėnesį"},relativeTime:{future:{one:"po {0} mėnesio",few:"po {0} mėnesių",many:"po {0} mėnesio",other:"po {0} mėnesių"},past:{one:"prieš {0} mėnesį",few:"prieš {0} mėnesius",many:"prieš {0} mėnesio",other:"prieš {0} mėnesių"}}},year:{displayName:"Metai",relative:{0:"šiais metais",1:"kitais metais","-1":"praėjusiais metais"},relativeTime:{future:{one:"po {0} metų",few:"po {0} metų",many:"po {0} metų",other:"po {0} metų"},past:{one:"prieš {0} metus",few:"prieš {0} metus",many:"prieš {0} metų",other:"prieš {0} metų"}}}}}),ReactIntl.__addLocaleData({locale:"lv",pluralRuleFunction:function(a){var b=a.toString().replace(/^[^.]*\.?/,"").length,c=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),a%10===0||a%100===Math.floor(a%100)&&a%100>=11&&19>=a%100||2===b&&c%100===Math.floor(c%100)&&c%100>=11&&19>=c%100?"zero":a%10===1&&(a%100!==11||2===b&&c%10===1&&(c%100!==11||2!==b&&c%10===1))?"one":"other"},fields:{second:{displayName:"Sekundes",relative:{0:"tagad"},relativeTime:{future:{zero:"Pēc {0} sekundēm",one:"Pēc {0} sekundes",other:"Pēc {0} sekundēm"},past:{zero:"Pirms {0} sekundēm",one:"Pirms {0} sekundes",other:"Pirms {0} sekundēm"}}},minute:{displayName:"Minūtes",relativeTime:{future:{zero:"Pēc {0} minūtēm",one:"Pēc {0} minūtes",other:"Pēc {0} minūtēm"},past:{zero:"Pirms {0} minūtēm",one:"Pirms {0} minūtes",other:"Pirms {0} minūtēm"}}},hour:{displayName:"Stundas",relativeTime:{future:{zero:"Pēc {0} stundām",one:"Pēc {0} stundas",other:"Pēc {0} stundām"},past:{zero:"Pirms {0} stundām",one:"Pirms {0} stundas",other:"Pirms {0} stundām"}}},day:{displayName:"Diena",relative:{0:"šodien",1:"rīt",2:"parīt","-2":"aizvakar","-1":"vakar"},relativeTime:{future:{zero:"Pēc {0} dienām",one:"Pēc {0} dienas",other:"Pēc {0} dienām"},past:{zero:"Pirms {0} dienām",one:"Pirms {0} dienas",other:"Pirms {0} dienām"}}},month:{displayName:"Mēnesis",relative:{0:"šomēnes",1:"nākammēnes","-1":"pagājušajā mēnesī"},relativeTime:{future:{zero:"Pēc {0} mēnešiem",one:"Pēc {0} mēneša",other:"Pēc {0} mēnešiem"},past:{zero:"Pirms {0} mēnešiem",one:"Pirms {0} mēneša",other:"Pirms {0} mēnešiem"}}},year:{displayName:"Gads",relative:{0:"šogad",1:"nākamgad","-1":"pagājušajā gadā"},relativeTime:{future:{zero:"Pēc {0} gadiem",one:"Pēc {0} gada",other:"Pēc {0} gadiem"},past:{zero:"Pirms {0} gadiem",one:"Pirms {0} gada",other:"Pirms {0} gadiem"}}}}}),ReactIntl.__addLocaleData({locale:"mas",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Oldákikaè",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Ɛ́sáâ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ɛnkɔlɔ́ŋ",relative:{0:"Táatá",1:"Tááisérè","-1":"Ŋolé"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Ɔlápà",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Ɔlárì",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"mg",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a?"one":"other"},fields:{second:{displayName:"Segondra",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minitra",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Ora",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Andro",relative:{0:"Anio",1:"Rahampitso","-1":"Omaly"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Volana",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Taona",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"mgo",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{one:"+{0} s",other:"+{0} s"},past:{one:"-{0} s",other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{one:"+{0} min",other:"+{0} min"},past:{one:"-{0} min",other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{one:"+{0} h",other:"+{0} h"},past:{one:"-{0} h",other:"-{0} h"}}},day:{displayName:"anəg",relative:{0:"tèchɔ̀ŋ",1:"isu",2:"isu ywi","-1":"ikwiri"},relativeTime:{future:{one:"+{0} d",other:"+{0} d"},past:{one:"-{0} d",other:"-{0} d"}}},month:{displayName:"iməg",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"+{0} m",other:"+{0} m"},past:{one:"-{0} m",other:"-{0} m"}}},year:{displayName:"fituʼ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"mk",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length,d=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),0!==c||b%10!==1&&d%10!==1?"other":"one"},fields:{second:{displayName:"Секунда",relative:{0:"сега"},relativeTime:{future:{one:"За {0} секунда",other:"За {0} секунди"},past:{one:"Пред {0} секунда",other:"Пред {0} секунди"}}},minute:{displayName:"Минута",relativeTime:{future:{one:"За {0} минута",other:"За {0} минути"},past:{one:"Пред {0} минута",other:"Пред {0} минути"}}},hour:{displayName:"Час",relativeTime:{future:{one:"За {0} час",other:"За {0} часа"},past:{one:"Пред {0} час",other:"Пред {0} часа"}}},day:{displayName:"ден",relative:{0:"Денес",1:"утре",2:"задутре","-2":"завчера","-1":"вчера"},relativeTime:{future:{one:"За {0} ден",other:"За {0} дена"},past:{one:"Пред {0} ден",other:"Пред {0} дена"}}},month:{displayName:"Месец",relative:{0:"овој месец",1:"следниот месец","-1":"минатиот месец"},relativeTime:{future:{one:"За {0} месец",other:"За {0} месеци"},past:{one:"Пред {0} месец",other:"Пред {0} месеци"}}},year:{displayName:"година",relative:{0:"оваа година",1:"следната година","-1":"минатата година"},relativeTime:{future:{one:"За {0} година",other:"За {0} години"},past:{one:"Пред {0} година",other:"Пред {0} години"}}}}}),ReactIntl.__addLocaleData({locale:"ml",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"സെക്കൻറ്",relative:{0:"ഇപ്പോൾ"},relativeTime:{future:{one:"{0} സെക്കൻഡിൽ",other:"{0} സെക്കൻഡിൽ"},past:{one:"{0} സെക്കൻറ് മുമ്പ്",other:"{0} സെക്കൻറ് മുമ്പ്"}}},minute:{displayName:"മിനിട്ട്",relativeTime:{future:{one:"{0} മിനിറ്റിൽ",other:"{0} മിനിറ്റിനുള്ളിൽ"},past:{one:"{0} മിനിറ്റ് മുമ്പ്",other:"{0} മിനിറ്റ് മുമ്പ്"}}},hour:{displayName:"മണിക്കൂർ",relativeTime:{future:{one:"{0} മണിക്കൂറിൽ",other:"{0} മണിക്കൂറിൽ"},past:{one:"{0} മണിക്കൂർ മുമ്പ്",other:"{0} മണിക്കൂർ മുമ്പ്"}}},day:{displayName:"ദിവസം",relative:{0:"ഇന്ന്",1:"നാളെ",2:"മറ്റന്നാൾ","-2":"മിനിഞ്ഞാന്ന്","-1":"ഇന്നലെ"},relativeTime:{future:{one:"{0} ദിവസത്തിൽ",other:"{0} ദിവസത്തിൽ"},past:{one:"{0} ദിവസം മുമ്പ്",other:"{0} ദിവസം മുമ്പ്"}}},month:{displayName:"മാസം",relative:{0:"ഈ മാസം",1:"അടുത്ത മാസം","-1":"കഴിഞ്ഞ മാസം"},relativeTime:{future:{one:"{0} മാസത്തിൽ",other:"{0} മാസത്തിൽ"},past:{one:"{0} മാസം മുമ്പ്",other:"{0} മാസം മുമ്പ്"}}},year:{displayName:"വർഷം",relative:{0:"ഈ വർ‌ഷം",1:"അടുത്തവർഷം","-1":"കഴിഞ്ഞ വർഷം"},relativeTime:{future:{one:"{0} വർഷത്തിൽ",other:"{0} വർഷത്തിൽ"},past:{one:"{0} വർഷം മുമ്പ്",other:"{0} വർഷം മുമ്പ്"}}}}}),ReactIntl.__addLocaleData({locale:"mn",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Секунд",relative:{0:"Одоо"},relativeTime:{future:{one:"{0} секундын дараа",other:"{0} секундын дараа"},past:{one:"{0} секундын өмнө",other:"{0} секундын өмнө"}}},minute:{displayName:"Минут",relativeTime:{future:{one:"{0} минутын дараа",other:"{0} минутын дараа"},past:{one:"{0} минутын өмнө",other:"{0} минутын өмнө"}}},hour:{displayName:"Цаг",relativeTime:{future:{one:"{0} цагийн дараа",other:"{0} цагийн дараа"},past:{one:"{0} цагийн өмнө",other:"{0} цагийн өмнө"}}},day:{displayName:"Өдөр",relative:{0:"өнөөдөр",1:"маргааш",2:"Нөгөөдөр","-2":"Уржигдар","-1":"өчигдөр"},relativeTime:{future:{one:"{0} өдрийн дараа",other:"{0} өдрийн дараа"},past:{one:"{0} өдрийн өмнө",other:"{0} өдрийн өмнө"}}},month:{displayName:"Сар",relative:{0:"энэ сар",1:"ирэх сар","-1":"өнгөрсөн сар"},relativeTime:{future:{one:"{0} сарын дараа",other:"{0} сарын дараа"},past:{one:"{0} сарын өмнө",other:"{0} сарын өмнө"}}},year:{displayName:"Жил",relative:{0:"энэ жил",1:"ирэх жил","-1":"өнгөрсөн жил"},relativeTime:{future:{one:"{0} жилийн дараа",other:"{0} жилийн дараа"},past:{one:"{0} жилийн өмнө",other:"{0} жилийн өмнө"}}}}}),ReactIntl.__addLocaleData({locale:"mr",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"सेकंद",relative:{0:"आत्ता"},relativeTime:{future:{one:"{0} सेकंदामध्ये",other:"{0} सेकंदांमध्ये"},past:{one:"{0} सेकंदापूर्वी",other:"{0} सेकंदांपूर्वी"}}},minute:{displayName:"मिनिट",relativeTime:{future:{one:"{0} मिनिटामध्ये",other:"{0} मिनिटांमध्ये"},past:{one:"{0} मिनिटापूर्वी",other:"{0} मिनिटांपूर्वी"}}},hour:{displayName:"तास",relativeTime:{future:{one:"{0} तासामध्ये",other:"{0} तासांमध्ये"},past:{one:"{0} तासापूर्वी",other:"{0} तासांपूर्वी"}}},day:{displayName:"दिवस",relative:{0:"आज",1:"उद्या","-1":"काल"},relativeTime:{future:{one:"{0} दिवसामध्ये",other:"{0} दिवसांमध्ये"},past:{one:"{0} दिवसापूर्वी",other:"{0} दिवसांपूर्वी"}}},month:{displayName:"महिना",relative:{0:"हा महिना",1:"पुढील महिना","-1":"मागील महिना"},relativeTime:{future:{one:"{0} महिन्यामध्ये",other:"{0} महिन्यांमध्ये"},past:{one:"{0} महिन्यापूर्वी",other:"{0} महिन्यांपूर्वी"}}},year:{displayName:"वर्ष",relative:{0:"हे वर्ष",1:"पुढील वर्ष","-1":"मागील वर्ष"},relativeTime:{future:{one:"{0} वर्षामध्ये",other:"{0} वर्षांमध्ये"},past:{one:"{0} वर्षापूर्वी",other:"{0} वर्षांपूर्वी"}}}}}),ReactIntl.__addLocaleData({locale:"ms",pluralRuleFunction:function(){return"other" },fields:{second:{displayName:"Kedua",relative:{0:"sekarang"},relativeTime:{future:{other:"Dalam {0} saat"},past:{other:"{0} saat lalu"}}},minute:{displayName:"Minit",relativeTime:{future:{other:"Dalam {0} minit"},past:{other:"{0} minit lalu"}}},hour:{displayName:"Jam",relativeTime:{future:{other:"Dalam {0} jam"},past:{other:"{0} jam lalu"}}},day:{displayName:"Hari",relative:{0:"Hari ini",1:"Esok",2:"Hari selepas esok","-2":"Hari sebelum semalam","-1":"Semalam"},relativeTime:{future:{other:"Dalam {0} hari"},past:{other:"{0} hari lalu"}}},month:{displayName:"Bulan",relative:{0:"bulan ini",1:"bulan depan","-1":"bulan lalu"},relativeTime:{future:{other:"Dalam {0} bulan"},past:{other:"{0} bulan lalu"}}},year:{displayName:"Tahun",relative:{0:"tahun ini",1:"tahun depan","-1":"tahun lepas"},relativeTime:{future:{other:"Dalam {0} tahun"},past:{other:"{0} tahun lalu"}}}}}),ReactIntl.__addLocaleData({locale:"mt",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":0===a||a%100===Math.floor(a%100)&&a%100>=2&&10>=a%100?"few":a%100===Math.floor(a%100)&&a%100>=11&&19>=a%100?"many":"other"},fields:{second:{displayName:"Sekonda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minuta",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Siegħa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Jum",relative:{0:"Illum",1:"Għada","-1":"Ilbieraħ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Xahar",relative:{0:"Dan ix-xahar",1:"Ix-xahar id-dieħel","-1":"Ix-xahar li għadda"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Sena",relative:{0:"Din is-sena",1:"Is-sena d-dieħla","-1":"Is-sena li għaddiet"},relativeTime:{past:{one:"{0} sena ilu",few:"{0} snin ilu",many:"{0} snin ilu",other:"{0} snin ilu"},future:{other:"+{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"my",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"စက္ကန့်",relative:{0:"ယခု"},relativeTime:{future:{other:"{0}စက္ကန့်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}စက္ကန့်"}}},minute:{displayName:"မိနစ်",relativeTime:{future:{other:"{0}မိနစ်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}မိနစ်"}}},hour:{displayName:"နာရီ",relativeTime:{future:{other:"{0}နာရီအတွင်း"},past:{other:"လွန်ခဲ့သော{0}နာရီ"}}},day:{displayName:"ရက်",relative:{0:"ယနေ့",1:"မနက်ဖြန်",2:"သဘက်ခါ","-2":"တနေ့က","-1":"မနေ့က"},relativeTime:{future:{other:"{0}ရက်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}ရက်"}}},month:{displayName:"လ",relative:{0:"ယခုလ",1:"နောက်လ","-1":"ယမန်လ"},relativeTime:{future:{other:"{0}လအတွင်း"},past:{other:"လွန်ခဲ့သော{0}လ"}}},year:{displayName:"နှစ်",relative:{0:"ယခုနှစ်",1:"နောက်နှစ်","-1":"ယမန်နှစ်"},relativeTime:{future:{other:"{0}နှစ်အတွင်း"},past:{other:"လွန်ခဲ့သော{0}နှစ်"}}}}}),ReactIntl.__addLocaleData({locale:"naq",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":2===a?"two":"other"},fields:{second:{displayName:"ǀGâub",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Haib",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Iiri",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Tsees",relative:{0:"Neetsee",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"ǁKhâb",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Kurib",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"nb",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekund",relative:{0:"nå"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"for {0} sekund siden",other:"for {0} sekunder siden"}}},minute:{displayName:"Minutt",relativeTime:{future:{one:"om {0} minutt",other:"om {0} minutter"},past:{one:"for {0} minutt siden",other:"for {0} minutter siden"}}},hour:{displayName:"Time",relativeTime:{future:{one:"om {0} time",other:"om {0} timer"},past:{one:"for {0} time siden",other:"for {0} timer siden"}}},day:{displayName:"Dag",relative:{0:"i dag",1:"i morgen",2:"i overmorgen","-2":"i forgårs","-1":"i går"},relativeTime:{future:{one:"om {0} døgn",other:"om {0} døgn"},past:{one:"for {0} døgn siden",other:"for {0} døgn siden"}}},month:{displayName:"Måned",relative:{0:"Denne måneden",1:"Neste måned","-1":"Sist måned"},relativeTime:{future:{one:"om {0} måned",other:"om {0} måneder"},past:{one:"for {0} måned siden",other:"for {0} måneder siden"}}},year:{displayName:"År",relative:{0:"Dette året",1:"Neste år","-1":"I fjor"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"for {0} år siden",other:"for {0} år siden"}}}}}),ReactIntl.__addLocaleData({locale:"nd",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Isekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Umuzuzu",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Ihola",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ilanga",relative:{0:"Lamuhla",1:"Kusasa","-1":"Izolo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Inyangacale",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Umnyaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ne",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"दोस्रो",relative:{0:"अब"},relativeTime:{future:{one:"{0} सेकेण्डमा",other:"{0} सेकेण्डमा"},past:{one:"{0} सेकेण्ड पहिले",other:"{0} सेकेण्ड पहिले"}}},minute:{displayName:"मिनेट",relativeTime:{future:{one:"{0} मिनेटमा",other:"{0} मिनेटमा"},past:{one:"{0} मिनेट पहिले",other:"{0} मिनेट पहिले"}}},hour:{displayName:"घण्टा",relativeTime:{future:{one:"{0} घण्टामा",other:"{0} घण्टामा"},past:{one:"{0} घण्टा पहिले",other:"{0} घण्टा पहिले"}}},day:{displayName:"बार",relative:{0:"आज",1:"भोली","-2":"अस्ति","-1":"हिजो"},relativeTime:{future:{one:"{0} दिनमा",other:"{0} दिनमा"},past:{one:"{0} दिन पहिले",other:"{0} दिन पहिले"}}},month:{displayName:"महिना",relative:{0:"यो महिना",1:"अर्को महिना","-1":"गएको महिना"},relativeTime:{future:{one:"{0} महिनामा",other:"{0} महिनामा"},past:{one:"{0} महिना पहिले",other:"{0} महिना पहिले"}}},year:{displayName:"बर्ष",relative:{0:"यो वर्ष",1:"अर्को वर्ष","-1":"पहिलो वर्ष"},relativeTime:{future:{one:"{0} वर्षमा",other:"{0} वर्षमा"},past:{one:"{0} वर्ष अघि",other:"{0} वर्ष अघि"}}}}}),ReactIntl.__addLocaleData({locale:"nl",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Seconde",relative:{0:"nu"},relativeTime:{future:{one:"Over {0} seconde",other:"Over {0} seconden"},past:{one:"{0} seconde geleden",other:"{0} seconden geleden"}}},minute:{displayName:"Minuut",relativeTime:{future:{one:"Over {0} minuut",other:"Over {0} minuten"},past:{one:"{0} minuut geleden",other:"{0} minuten geleden"}}},hour:{displayName:"Uur",relativeTime:{future:{one:"Over {0} uur",other:"Over {0} uur"},past:{one:"{0} uur geleden",other:"{0} uur geleden"}}},day:{displayName:"Dag",relative:{0:"vandaag",1:"morgen",2:"overmorgen","-2":"eergisteren","-1":"gisteren"},relativeTime:{future:{one:"Over {0} dag",other:"Over {0} dagen"},past:{one:"{0} dag geleden",other:"{0} dagen geleden"}}},month:{displayName:"Maand",relative:{0:"deze maand",1:"volgende maand","-1":"vorige maand"},relativeTime:{future:{one:"Over {0} maand",other:"Over {0} maanden"},past:{one:"{0} maand geleden",other:"{0} maanden geleden"}}},year:{displayName:"Jaar",relative:{0:"dit jaar",1:"volgend jaar","-1":"vorig jaar"},relativeTime:{future:{one:"Over {0} jaar",other:"Over {0} jaar"},past:{one:"{0} jaar geleden",other:"{0} jaar geleden"}}}}}),ReactIntl.__addLocaleData({locale:"nn",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"sekund",relative:{0:"now"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"for {0} sekund siden",other:"for {0} sekunder siden"}}},minute:{displayName:"minutt",relativeTime:{future:{one:"om {0} minutt",other:"om {0} minutter"},past:{one:"for {0} minutt siden",other:"for {0} minutter siden"}}},hour:{displayName:"time",relativeTime:{future:{one:"om {0} time",other:"om {0} timer"},past:{one:"for {0} time siden",other:"for {0} timer siden"}}},day:{displayName:"dag",relative:{0:"i dag",1:"i morgon",2:"i overmorgon","-2":"i forgårs","-1":"i går"},relativeTime:{future:{one:"om {0} døgn",other:"om {0} døgn"},past:{one:"for {0} døgn siden",other:"for {0} døgn siden"}}},month:{displayName:"månad",relative:{0:"denne månad",1:"neste månad","-1":"forrige månad"},relativeTime:{future:{one:"om {0} måned",other:"om {0} måneder"},past:{one:"for {0} måned siden",other:"for {0} måneder siden"}}},year:{displayName:"år",relative:{0:"dette år",1:"neste år","-1":"i fjor"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"for {0} år siden",other:"for {0} år siden"}}}}}),ReactIntl.__addLocaleData({locale:"nnh",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"fʉ̀ʼ nèm",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"lyɛ̌ʼ",relative:{0:"lyɛ̌ʼɔɔn",1:"jǔɔ gẅie à ne ntóo","-1":"jǔɔ gẅie à ka tɔ̌g"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ngùʼ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"nr",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"nso",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"nyn",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Obucweka/Esekendi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Edakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Shaaha",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Eizooba",relative:{0:"Erizooba",1:"Nyenkyakare","-1":"Nyomwabazyo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Omwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"om",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"or",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"os",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Секунд",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Минут",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Сахат",relativeTime:{future:{one:"{0} сахаты фӕстӕ",other:"{0} сахаты фӕстӕ"},past:{one:"{0} сахаты размӕ",other:"{0} сахаты размӕ"}}},day:{displayName:"Бон",relative:{0:"Абон",1:"Сом",2:"Иннӕбон","-2":"Ӕндӕрӕбон","-1":"Знон"},relativeTime:{future:{one:"{0} боны фӕстӕ",other:"{0} боны фӕстӕ"},past:{one:"{0} бон раздӕр",other:"{0} боны размӕ"}}},month:{displayName:"Мӕй",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Аз",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"pa",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a?"one":"other"},fields:{second:{displayName:"ਸਕਿੰਟ",relative:{0:"ਹੁਣ"},relativeTime:{future:{one:"{0} ਸਕਿੰਟ ਵਿਚ",other:"{0} ਸਕਿੰਟ ਵਿਚ"},past:{one:"{0} ਸਕਿੰਟ ਪਹਿਲਾਂ",other:"{0} ਸਕਿੰਟ ਪਹਿਲਾਂ"}}},minute:{displayName:"ਮਿੰਟ",relativeTime:{future:{one:"{0} ਮਿੰਟ ਵਿਚ",other:"{0} ਮਿੰਟ ਵਿਚ"},past:{one:"{0} ਮਿੰਟ ਪਹਿਲਾਂ",other:"{0} ਮਿੰਟ ਪਹਿਲਾਂ"}}},hour:{displayName:"ਘੰਟਾ",relativeTime:{future:{one:"{0} ਘੰਟੇ ਵਿਚ",other:"{0} ਘੰਟੇ ਵਿਚ"},past:{one:"{0} ਘੰਟਾ ਪਹਿਲਾਂ",other:"{0} ਘੰਟੇ ਪਹਿਲਾਂ"}}},day:{displayName:"ਦਿਨ",relative:{0:"ਅੱਜ",1:"ਭਲਕੇ","-1":"ਲੰਘਿਆ ਕੱਲ"},relativeTime:{future:{one:"{0} ਦਿਨ ਵਿਚ",other:"{0} ਦਿਨਾਂ ਵਿਚ"},past:{one:"{0} ਦਿਨ ਪਹਿਲਾਂ",other:"{0} ਦਿਨ ਪਹਿਲਾਂ"}}},month:{displayName:"ਮਹੀਨਾ",relative:{0:"ਇਹ ਮਹੀਨਾ",1:"ਅਗਲਾ ਮਹੀਨਾ","-1":"ਪਿਛਲਾ ਮਹੀਨਾ"},relativeTime:{future:{one:"{0} ਮਹੀਨੇ ਵਿਚ",other:"{0} ਮਹੀਨੇ ਵਿਚ"},past:{one:"{0} ਮਹੀਨੇ ਪਹਿਲਾਂ",other:"{0} ਮਹੀਨੇ ਪਹਿਲਾਂ"}}},year:{displayName:"ਸਾਲ",relative:{0:"ਇਹ ਸਾਲ",1:"ਅਗਲਾ ਸਾਲ","-1":"ਪਿਛਲਾ ਸਾਲ"},relativeTime:{future:{one:"{0} ਸਾਲ ਵਿਚ",other:"{0} ਸਾਲ ਵਿਚ"},past:{one:"{0} ਸਾਲ ਪਹਿਲਾਂ",other:"{0} ਸਾਲ ਪਹਿਲਾਂ"}}}}}),ReactIntl.__addLocaleData({locale:"pl",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":0===c&&b%10===Math.floor(b%10)&&b%10>=2&&4>=b%10&&!(b%100>=12&&14>=b%100)?"few":0===c&&1!==b&&(b%10===Math.floor(b%10)&&b%10>=0&&1>=b%10||0===c&&(b%10===Math.floor(b%10)&&b%10>=5&&9>=b%10||0===c&&b%100===Math.floor(b%100)&&b%100>=12&&14>=b%100))?"many":"other"},fields:{second:{displayName:"sekunda",relative:{0:"teraz"},relativeTime:{future:{one:"Za {0} sekundę",few:"Za {0} sekundy",many:"Za {0} sekund",other:"Za {0} sekundy"},past:{one:"{0} sekundę temu",few:"{0} sekundy temu",many:"{0} sekund temu",other:"{0} sekundy temu"}}},minute:{displayName:"minuta",relativeTime:{future:{one:"Za {0} minutę",few:"Za {0} minuty",many:"Za {0} minut",other:"Za {0} minuty"},past:{one:"{0} minutę temu",few:"{0} minuty temu",many:"{0} minut temu",other:"{0} minuty temu"}}},hour:{displayName:"godzina",relativeTime:{future:{one:"Za {0} godzinę",few:"Za {0} godziny",many:"Za {0} godzin",other:"Za {0} godziny"},past:{one:"{0} godzinę temu",few:"{0} godziny temu",many:"{0} godzin temu",other:"{0} godziny temu"}}},day:{displayName:"dzień",relative:{0:"dzisiaj",1:"jutro",2:"pojutrze","-2":"przedwczoraj","-1":"wczoraj"},relativeTime:{future:{one:"Za {0} dzień",few:"Za {0} dni",many:"Za {0} dni",other:"Za {0} dnia"},past:{one:"{0} dzień temu",few:"{0} dni temu",many:"{0} dni temu",other:"{0} dnia temu"}}},month:{displayName:"miesiąc",relative:{0:"w tym miesiącu",1:"w przyszłym miesiącu","-1":"w zeszłym miesiącu"},relativeTime:{future:{one:"Za {0} miesiąc",few:"Za {0} miesiące",many:"Za {0} miesięcy",other:"Za {0} miesiąca"},past:{one:"{0} miesiąc temu",few:"{0} miesiące temu",many:"{0} miesięcy temu",other:"{0} miesiąca temu"}}},year:{displayName:"rok",relative:{0:"w tym roku",1:"w przyszłym roku","-1":"w zeszłym roku"},relativeTime:{future:{one:"Za {0} rok",few:"Za {0} lata",many:"Za {0} lat",other:"Za {0} roku"},past:{one:"{0} rok temu",few:"{0} lata temu",many:"{0} lat temu",other:"{0} roku temu"}}}}}),ReactIntl.__addLocaleData({locale:"ps",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"pt",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length,d=parseInt(a.toString().replace(/^[^.]*\.?|0+$/g,""),10);return a=Math.floor(a),1===b&&(0===c||0===b&&1===d)?"one":"other"},fields:{second:{displayName:"Segundo",relative:{0:"agora"},relativeTime:{future:{one:"Dentro de {0} segundo",other:"Dentro de {0} segundos"},past:{one:"Há {0} segundo",other:"Há {0} segundos"}}},minute:{displayName:"Minuto",relativeTime:{future:{one:"Dentro de {0} minuto",other:"Dentro de {0} minutos"},past:{one:"Há {0} minuto",other:"Há {0} minutos"}}},hour:{displayName:"Hora",relativeTime:{future:{one:"Dentro de {0} hora",other:"Dentro de {0} horas"},past:{one:"Há {0} hora",other:"Há {0} horas"}}},day:{displayName:"Dia",relative:{0:"hoje",1:"amanhã",2:"depois de amanhã","-2":"anteontem","-1":"ontem"},relativeTime:{future:{one:"Dentro de {0} dia",other:"Dentro de {0} dias"},past:{one:"Há {0} dia",other:"Há {0} dias"}}},month:{displayName:"Mês",relative:{0:"este mês",1:"próximo mês","-1":"mês passado"},relativeTime:{future:{one:"Dentro de {0} mês",other:"Dentro de {0} meses"},past:{one:"Há {0} mês",other:"Há {0} meses"}}},year:{displayName:"Ano",relative:{0:"este ano",1:"próximo ano","-1":"ano passado"},relativeTime:{future:{one:"Dentro de {0} ano",other:"Dentro de {0} anos"},past:{one:"Há {0} ano",other:"Há {0} anos"}}}}}),ReactIntl.__addLocaleData({locale:"rm",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"secunda",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"minuta",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"ura",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Tag",relative:{0:"oz",1:"damaun",2:"puschmaun","-2":"stersas","-1":"ier"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"mais",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"onn",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ro",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":0!==c||0===a||1!==a&&a%100===Math.floor(a%100)&&a%100>=1&&19>=a%100?"few":"other"},fields:{second:{displayName:"secundă",relative:{0:"acum"},relativeTime:{future:{one:"Peste {0} secundă",few:"Peste {0} secunde",other:"Peste {0} de secunde"},past:{one:"Acum {0} secundă",few:"Acum {0} secunde",other:"Acum {0} de secunde"}}},minute:{displayName:"minut",relativeTime:{future:{one:"Peste {0} minut",few:"Peste {0} minute",other:"Peste {0} de minute"},past:{one:"Acum {0} minut",few:"Acum {0} minute",other:"Acum {0} de minute"}}},hour:{displayName:"oră",relativeTime:{future:{one:"Peste {0} oră",few:"Peste {0} ore",other:"Peste {0} de ore"},past:{one:"Acum {0} oră",few:"Acum {0} ore",other:"Acum {0} de ore"}}},day:{displayName:"zi",relative:{0:"azi",1:"mâine",2:"poimâine","-2":"alaltăieri","-1":"ieri"},relativeTime:{future:{one:"Peste {0} zi",few:"Peste {0} zile",other:"Peste {0} de zile"},past:{one:"Acum {0} zi",few:"Acum {0} zile",other:"Acum {0} de zile"}}},month:{displayName:"lună",relative:{0:"luna aceasta",1:"luna viitoare","-1":"luna trecută"},relativeTime:{future:{one:"Peste {0} lună",few:"Peste {0} luni",other:"Peste {0} de luni"},past:{one:"Acum {0} lună",few:"Acum {0} luni",other:"Acum {0} de luni"}}},year:{displayName:"an",relative:{0:"anul acesta",1:"anul viitor","-1":"anul trecut"},relativeTime:{future:{one:"Peste {0} an",few:"Peste {0} ani",other:"Peste {0} de ani"},past:{one:"Acum {0} an",few:"Acum {0} ani",other:"Acum {0} de ani"}}}}}),ReactIntl.__addLocaleData({locale:"rof",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Isaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Mfiri",relative:{0:"Linu",1:"Ng'ama","-1":"Hiyo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mweri",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Muaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ru",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),0===c&&b%10===1&&b%100!==11?"one":0===c&&b%10===Math.floor(b%10)&&b%10>=2&&4>=b%10&&!(b%100>=12&&14>=b%100)?"few":0===c&&(b%10===0||0===c&&(b%10===Math.floor(b%10)&&b%10>=5&&9>=b%10||0===c&&b%100===Math.floor(b%100)&&b%100>=11&&14>=b%100))?"many":"other"},fields:{second:{displayName:"Секунда",relative:{0:"сейчас"},relativeTime:{future:{one:"Через {0} секунду",few:"Через {0} секунды",many:"Через {0} секунд",other:"Через {0} секунды"},past:{one:"{0} секунду назад",few:"{0} секунды назад",many:"{0} секунд назад",other:"{0} секунды назад"}}},minute:{displayName:"Минута",relativeTime:{future:{one:"Через {0} минуту",few:"Через {0} минуты",many:"Через {0} минут",other:"Через {0} минуты"},past:{one:"{0} минуту назад",few:"{0} минуты назад",many:"{0} минут назад",other:"{0} минуты назад"}}},hour:{displayName:"Час",relativeTime:{future:{one:"Через {0} час",few:"Через {0} часа",many:"Через {0} часов",other:"Через {0} часа"},past:{one:"{0} час назад",few:"{0} часа назад",many:"{0} часов назад",other:"{0} часа назад"}}},day:{displayName:"День",relative:{0:"сегодня",1:"завтра",2:"послезавтра","-2":"позавчера","-1":"вчера"},relativeTime:{future:{one:"Через {0} день",few:"Через {0} дня",many:"Через {0} дней",other:"Через {0} дня"},past:{one:"{0} день назад",few:"{0} дня назад",many:"{0} дней назад",other:"{0} дня назад"}}},month:{displayName:"Месяц",relative:{0:"в этом месяце",1:"в следующем месяце","-1":"в прошлом месяце"},relativeTime:{future:{one:"Через {0} месяц",few:"Через {0} месяца",many:"Через {0} месяцев",other:"Через {0} месяца"},past:{one:"{0} месяц назад",few:"{0} месяца назад",many:"{0} месяцев назад",other:"{0} месяца назад"}}},year:{displayName:"Год",relative:{0:"в этому году",1:"в следующем году","-1":"в прошлом году"},relativeTime:{future:{one:"Через {0} год",few:"Через {0} года",many:"Через {0} лет",other:"Через {0} года"},past:{one:"{0} год назад",few:"{0} года назад",many:"{0} лет назад",other:"{0} года назад"}}}}}),ReactIntl.__addLocaleData({locale:"rwk",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakyika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Mfiri",relative:{0:"Inu",1:"Ngama","-1":"Ukou"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Maka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"sah",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Сөкүүндэ",relative:{0:"now"},relativeTime:{future:{other:"{0} сөкүүндэннэн"},past:{other:"{0} сөкүүндэ ынараа өттүгэр"}}},minute:{displayName:"Мүнүүтэ",relativeTime:{future:{other:"{0} мүнүүтэннэн"},past:{other:"{0} мүнүүтэ ынараа өттүгэр"}}},hour:{displayName:"Чаас",relativeTime:{future:{other:"{0} чааһынан"},past:{other:"{0} чаас ынараа өттүгэр"}}},day:{displayName:"Күн",relative:{0:"Бүгүн",1:"Сарсын",2:"Өйүүн","-2":"Иллэрээ күн","-1":"Бэҕэһээ"},relativeTime:{future:{other:"{0} күнүнэн"},past:{other:"{0} күн ынараа өттүгэр"}}},month:{displayName:"Ый",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"{0} ыйынан"},past:{other:"{0} ый ынараа өттүгэр"}}},year:{displayName:"Сыл",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"{0} сылынан"},past:{other:"{0} сыл ынараа өттүгэр"}}}}}),ReactIntl.__addLocaleData({locale:"saq",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Isekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Idakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saai",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Mpari",relative:{0:"Duo",1:"Taisere","-1":"Ng'ole"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Lapa",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Lari",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"se",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":2===a?"two":"other"},fields:{second:{displayName:"sekunda",relative:{0:"now"},relativeTime:{future:{one:"{0} sekunda maŋŋilit",two:"{0} sekundda maŋŋilit",other:"{0} sekundda maŋŋilit"},past:{one:"{0} sekunda árat",two:"{0} sekundda árat",other:"{0} sekundda árat"}}},minute:{displayName:"minuhtta",relativeTime:{future:{one:"{0} minuhta maŋŋilit",two:"{0} minuhtta maŋŋilit",other:"{0} minuhtta maŋŋilit"},past:{one:"{0} minuhta árat",two:"{0} minuhtta árat",other:"{0} minuhtta árat"}}},hour:{displayName:"diibmu",relativeTime:{future:{one:"{0} diibmu maŋŋilit",two:"{0} diibmur maŋŋilit",other:"{0} diibmur maŋŋilit"},past:{one:"{0} diibmu árat",two:"{0} diibmur árat",other:"{0} diibmur árat"}}},day:{displayName:"beaivi",relative:{0:"odne",1:"ihttin",2:"paijeelittáá","-2":"oovdebpeivvi","-1":"ikte"},relativeTime:{future:{one:"{0} jándor maŋŋilit",two:"{0} jándor amaŋŋilit",other:"{0} jándora maŋŋilit"},past:{one:"{0} jándor árat",two:"{0} jándora árat",other:"{0} jándora árat"}}},month:{displayName:"mánnu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"{0} mánotbadji maŋŋilit",two:"{0} mánotbadji maŋŋilit",other:"{0} mánotbadji maŋŋilit"},past:{one:"{0} mánotbadji árat",two:"{0} mánotbadji árat",other:"{0} mánotbadji árat"}}},year:{displayName:"jáhki",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"{0} jahki maŋŋilit",two:"{0} jahkki maŋŋilit",other:"{0} jahkki maŋŋilit"},past:{one:"{0} jahki árat",two:"{0} jahkki árat",other:"{0} jahkki árat"}}}}}),ReactIntl.__addLocaleData({locale:"seh",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Segundo",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minuto",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hora",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ntsiku",relative:{0:"Lero",1:"Manguana","-1":"Zuro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Chaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ses",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Miti",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Miniti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Guuru",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Zaari",relative:{0:"Hõo",1:"Suba","-1":"Bi"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Handu",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Jiiri",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"sg",pluralRuleFunction:function(){return"other" },fields:{second:{displayName:"Nzîna ngbonga",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Ndurü ngbonga",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Ngbonga",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Lâ",relative:{0:"Lâsô",1:"Kêkerêke","-1":"Bîrï"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Nze",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Ngû",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"shi",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":a===Math.floor(a)&&a>=2&&10>=a?"few":"other"},fields:{second:{displayName:"ⵜⴰⵙⵉⵏⵜ",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"ⵜⵓⵙⴷⵉⴷⵜ",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"ⵜⴰⵙⵔⴰⴳⵜ",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"ⴰⵙⵙ",relative:{0:"ⴰⵙⵙⴰ",1:"ⴰⵙⴽⴽⴰ","-1":"ⵉⴹⵍⵍⵉ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"ⴰⵢⵢⵓⵔ",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"ⴰⵙⴳⴳⵯⴰⵙ",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"si",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),0===a||1===a||0===b&&1===c?"one":"other"},fields:{second:{displayName:"තත්පරය",relative:{0:"දැන්"},relativeTime:{future:{one:"තත්පර {0} කින්",other:"තත්පර {0} කින්"},past:{one:"තත්පර {0}කට පෙර",other:"තත්පර {0}කට පෙර"}}},minute:{displayName:"මිනිත්තුව",relativeTime:{future:{one:"මිනිත්තු {0} කින්",other:"මිනිත්තු {0} කින්"},past:{one:"මිනිත්තු {0}ට පෙර",other:"මිනිත්තු {0}ට පෙර"}}},hour:{displayName:"පැය",relativeTime:{future:{one:"පැය {0} කින්",other:"පැය {0} කින්"},past:{one:"පැය {0}ට පෙර",other:"පැය {0}ට පෙර"}}},day:{displayName:"දිනය",relative:{0:"අද",1:"හෙට",2:"අනිද්දා","-2":"පෙරේදා","-1":"ඊයෙ"},relativeTime:{future:{one:"දින {0}න්",other:"දින {0}න්"},past:{one:"දින {0} ට පෙර",other:"දින {0} ට පෙර"}}},month:{displayName:"මාසය",relative:{0:"මෙම මාසය",1:"ඊළඟ මාසය","-1":"පසුගිය මාසය"},relativeTime:{future:{one:"මාස {0}කින්",other:"මාස {0}කින්"},past:{one:"මාස {0}කට පෙර",other:"මාස {0}කට පෙර"}}},year:{displayName:"වර්ෂය",relative:{0:"මෙම වසර",1:"ඊළඟ වසර","-1":"පසුගිය වසර"},relativeTime:{future:{one:"වසර {0} කින්",other:"වසර {0} කින්"},past:{one:"වසර {0}ට පෙර",other:"වසර {0}ට පෙර"}}}}}),ReactIntl.__addLocaleData({locale:"sk",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":b===Math.floor(b)&&b>=2&&4>=b&&0===c?"few":0!==c?"many":"other"},fields:{second:{displayName:"Sekunda",relative:{0:"teraz"},relativeTime:{future:{one:"O {0} sekundu",few:"O {0} sekundy",many:"O {0} sekundy",other:"O {0} sekúnd"},past:{one:"Pred {0} sekundou",few:"Pred {0} sekundami",many:"Pred {0} sekundami",other:"Pred {0} sekundami"}}},minute:{displayName:"Minúta",relativeTime:{future:{one:"O {0} minútu",few:"O {0} minúty",many:"O {0} minúty",other:"O {0} minút"},past:{one:"Pred {0} minútou",few:"Pred {0} minútami",many:"Pred {0} minútami",other:"Pred {0} minútami"}}},hour:{displayName:"Hodina",relativeTime:{future:{one:"O {0} hodinu",few:"O {0} hodiny",many:"O {0} hodiny",other:"O {0} hodín"},past:{one:"Pred {0} hodinou",few:"Pred {0} hodinami",many:"Pred {0} hodinami",other:"Pred {0} hodinami"}}},day:{displayName:"Deň",relative:{0:"Dnes",1:"Zajtra",2:"Pozajtra","-2":"Predvčerom","-1":"Včera"},relativeTime:{future:{one:"O {0} deň",few:"O {0} dni",many:"O {0} dňa",other:"O {0} dní"},past:{one:"Pred {0} dňom",few:"Pred {0} dňami",many:"Pred {0} dňami",other:"Pred {0} dňami"}}},month:{displayName:"Mesiac",relative:{0:"Tento mesiac",1:"Budúci mesiac","-1":"Posledný mesiac"},relativeTime:{future:{one:"O {0} mesiac",few:"O {0} mesiace",many:"O {0} mesiaca",other:"O {0} mesiacov"},past:{one:"Pred {0} mesiacom",few:"Pred {0} mesiacmi",many:"Pred {0} mesiacmi",other:"Pred {0} mesiacmi"}}},year:{displayName:"Rok",relative:{0:"Tento rok",1:"Budúci rok","-1":"Minulý rok"},relativeTime:{future:{one:"O {0} rok",few:"O {0} roky",many:"O {0} roka",other:"O {0} rokov"},past:{one:"Pred {0} rokom",few:"Pred {0} rokmi",many:"Pred {0} rokmi",other:"Pred {0} rokmi"}}}}}),ReactIntl.__addLocaleData({locale:"sl",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),0===c&&b%100===1?"one":0===c&&b%100===2?"two":0===c&&(b%100===Math.floor(b%100)&&b%100>=3&&4>=b%100||0!==c)?"few":"other"},fields:{second:{displayName:"Sekunda",relative:{0:"zdaj"},relativeTime:{future:{one:"Čez {0} sekundo",two:"Čez {0} sekundi",few:"Čez {0} sekunde",other:"Čez {0} sekundi"},past:{one:"Pred {0} sekundo",two:"Pred {0} sekundama",few:"Pred {0} sekundami",other:"Pred {0} sekundami"}}},minute:{displayName:"Minuta",relativeTime:{future:{one:"Čez {0} min.",two:"Čez {0} min.",few:"Čez {0} min.",other:"Čez {0} min."},past:{one:"Pred {0} min.",two:"Pred {0} min.",few:"Pred {0} min.",other:"Pred {0} min."}}},hour:{displayName:"Ura",relativeTime:{future:{one:"Čez {0} h",two:"Čez {0} h",few:"Čez {0} h",other:"Čez {0} h"},past:{one:"Pred {0} h",two:"Pred {0} h",few:"Pred {0} h",other:"Pred {0} h"}}},day:{displayName:"Dan",relative:{0:"Danes",1:"Jutri",2:"Pojutrišnjem","-2":"Predvčerajšnjim","-1":"Včeraj"},relativeTime:{future:{one:"Čez {0} dan",two:"Čez {0} dni",few:"Čez {0} dni",other:"Čez {0} dni"},past:{one:"Pred {0} dnevom",two:"Pred {0} dnevoma",few:"Pred {0} dnevi",other:"Pred {0} dnevi"}}},month:{displayName:"Mesec",relative:{0:"Ta mesec",1:"Naslednji mesec","-1":"Prejšnji mesec"},relativeTime:{future:{one:"Čez {0} mesec",two:"Čez {0} meseca",few:"Čez {0} mesece",other:"Čez {0} mesecev"},past:{one:"Pred {0} mesecem",two:"Pred {0} meseci",few:"Pred {0} meseci",other:"Pred {0} meseci"}}},year:{displayName:"Leto",relative:{0:"Letos",1:"Naslednje leto","-1":"Lani"},relativeTime:{future:{one:"Čez {0} leto",two:"Čez {0} leti",few:"Čez {0} leta",other:"Čez {0} let"},past:{one:"Pred {0} letom",two:"Pred {0} leti",few:"Pred {0} leti",other:"Pred {0} leti"}}}}}),ReactIntl.__addLocaleData({locale:"sn",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekondi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Mineti",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Awa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Zuva",relative:{0:"Nhasi",1:"Mangwana","-1":"Nezuro"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mwedzi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Gore",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"so",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Il biriqsi",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Daqiiqad",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saacad",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Maalin",relative:{0:"Maanta",1:"Berri","-1":"Shalay"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Bil",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Sanad",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"sq",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"sekondë",relative:{0:"tani"},relativeTime:{future:{one:"pas {0} sekonde",other:"pas {0} sekondash"},past:{one:"para {0} sekonde",other:"para {0} sekondash"}}},minute:{displayName:"minutë",relativeTime:{future:{one:"pas {0} minute",other:"pas {0} minutash"},past:{one:"para {0} minute",other:"para {0} minutash"}}},hour:{displayName:"orë",relativeTime:{future:{one:"pas {0} ore",other:"pas {0} orësh"},past:{one:"para {0} ore",other:"para {0} orësh"}}},day:{displayName:"ditë",relative:{0:"sot",1:"nesër","-1":"dje"},relativeTime:{future:{one:"pas {0} dite",other:"pas {0} ditësh"},past:{one:"para {0} dite",other:"para {0} ditësh"}}},month:{displayName:"muaj",relative:{0:"këtë muaj",1:"muajin e ardhshëm","-1":"muajin e kaluar"},relativeTime:{future:{one:"pas {0} muaji",other:"pas {0} muajsh"},past:{one:"para {0} muaji",other:"para {0} muajsh"}}},year:{displayName:"vit",relative:{0:"këtë vit",1:"vitin e ardhshëm","-1":"vitin e kaluar"},relativeTime:{future:{one:"pas {0} viti",other:"pas {0} vjetësh"},past:{one:"para {0} viti",other:"para {0} vjetësh"}}}}}),ReactIntl.__addLocaleData({locale:"sr",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length,d=parseInt(a.toString().replace(/^[^.]*\.?/,""),10);return a=Math.floor(a),0===c&&b%10===1&&(b%100!==11||d%10===1&&d%100!==11)?"one":0===c&&b%10===Math.floor(b%10)&&b%10>=2&&4>=b%10&&(!(b%100>=12&&14>=b%100)||d%10===Math.floor(d%10)&&d%10>=2&&4>=d%10&&!(d%100>=12&&14>=d%100))?"few":"other"},fields:{second:{displayName:"секунд",relative:{0:"сада"},relativeTime:{future:{one:"за {0} секунду",few:"за {0} секунде",other:"за {0} секунди"},past:{one:"пре {0} секунде",few:"пре {0} секунде",other:"пре {0} секунди"}}},minute:{displayName:"минут",relativeTime:{future:{one:"за {0} минут",few:"за {0} минута",other:"за {0} минута"},past:{one:"пре {0} минута",few:"пре {0} минута",other:"пре {0} минута"}}},hour:{displayName:"час",relativeTime:{future:{one:"за {0} сат",few:"за {0} сата",other:"за {0} сати"},past:{one:"пре {0} сата",few:"пре {0} сата",other:"пре {0} сати"}}},day:{displayName:"дан",relative:{0:"данас",1:"сутра",2:"прекосутра","-2":"прекјуче","-1":"јуче"},relativeTime:{future:{one:"за {0} дан",few:"за {0} дана",other:"за {0} дана"},past:{one:"пре {0} дана",few:"пре {0} дана",other:"пре {0} дана"}}},month:{displayName:"месец",relative:{0:"Овог месеца",1:"Следећег месеца","-1":"Прошлог месеца"},relativeTime:{future:{one:"за {0} месец",few:"за {0} месеца",other:"за {0} месеци"},past:{one:"пре {0} месеца",few:"пре {0} месеца",other:"пре {0} месеци"}}},year:{displayName:"година",relative:{0:"Ове године",1:"Следеће године","-1":"Прошле године"},relativeTime:{future:{one:"за {0} годину",few:"за {0} године",other:"за {0} година"},past:{one:"пре {0} године",few:"пре {0} године",other:"пре {0} година"}}}}}),ReactIntl.__addLocaleData({locale:"ss",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ssy",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"st",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"sv",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Sekund",relative:{0:"nu"},relativeTime:{future:{one:"om {0} sekund",other:"om {0} sekunder"},past:{one:"för {0} sekund sedan",other:"för {0} sekunder sedan"}}},minute:{displayName:"Minut",relativeTime:{future:{one:"om {0} minut",other:"om {0} minuter"},past:{one:"för {0} minut sedan",other:"för {0} minuter sedan"}}},hour:{displayName:"timme",relativeTime:{future:{one:"om {0} timme",other:"om {0} timmar"},past:{one:"för {0} timme sedan",other:"för {0} timmar sedan"}}},day:{displayName:"Dag",relative:{0:"i dag",1:"i morgon",2:"i övermorgon","-2":"i förrgår","-1":"i går"},relativeTime:{future:{one:"om {0} dag",other:"om {0} dagar"},past:{one:"för {0} dag sedan",other:"för {0} dagar sedan"}}},month:{displayName:"Månad",relative:{0:"denna månad",1:"nästa månad","-1":"förra månaden"},relativeTime:{future:{one:"om {0} månad",other:"om {0} månader"},past:{one:"för {0} månad sedan",other:"för {0} månader sedan"}}},year:{displayName:"År",relative:{0:"i år",1:"nästa år","-1":"i fjol"},relativeTime:{future:{one:"om {0} år",other:"om {0} år"},past:{one:"för {0} år sedan",other:"för {0} år sedan"}}}}}),ReactIntl.__addLocaleData({locale:"sw",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"sasa"},relativeTime:{future:{one:"Baada ya sekunde {0}",other:"Baada ya sekunde {0}"},past:{one:"Sekunde {0} iliyopita",other:"Sekunde {0} zilizopita"}}},minute:{displayName:"Dakika",relativeTime:{future:{one:"Baada ya dakika {0}",other:"Baada ya dakika {0}"},past:{one:"Dakika {0} iliyopita",other:"Dakika {0} zilizopita"}}},hour:{displayName:"Saa",relativeTime:{future:{one:"Baada ya saa {0}",other:"Baada ya saa {0}"},past:{one:"Saa {0} iliyopita",other:"Saa {0} zilizopita"}}},day:{displayName:"Siku",relative:{0:"leo",1:"kesho",2:"kesho kutwa","-2":"juzi","-1":"jana"},relativeTime:{future:{one:"Baada ya siku {0}",other:"Baada ya siku {0}"},past:{one:"Siku {0} iliyopita",other:"Siku {0} zilizopita"}}},month:{displayName:"Mwezi",relative:{0:"mwezi huu",1:"mwezi ujao","-1":"mwezi uliopita"},relativeTime:{future:{one:"Baada ya mwezi {0}",other:"Baada ya miezi {0}"},past:{one:"Miezi {0} iliyopita",other:"Miezi {0} iliyopita"}}},year:{displayName:"Mwaka",relative:{0:"mwaka huu",1:"mwaka ujao","-1":"mwaka uliopita"},relativeTime:{future:{one:"Baada ya mwaka {0}",other:"Baada ya miaka {0}"},past:{one:"Mwaka {0} uliopita",other:"Miaka {0} iliyopita"}}}}}),ReactIntl.__addLocaleData({locale:"ta",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"வினாடி",relative:{0:"இப்போது"},relativeTime:{future:{one:"{0} வினாடியில்",other:"{0} விநாடிகளில்"},past:{one:"{0} வினாடிக்கு முன்",other:"{0} வினாடிக்கு முன்"}}},minute:{displayName:"நிமிடம்",relativeTime:{future:{one:"{0} நிமிடத்தில்",other:"{0} நிமிடங்களில்"},past:{one:"{0} நிமிடத்திற்கு முன்",other:"{0} நிமிடங்களுக்கு முன்"}}},hour:{displayName:"மணி",relativeTime:{future:{one:"{0} மணிநேரத்தில்",other:"{0} மணிநேரத்தில்"},past:{one:"{0} மணிநேரம் முன்",other:"{0} மணிநேரம் முன்"}}},day:{displayName:"நாள்",relative:{0:"இன்று",1:"நாளை",2:"நாளை மறுநாள்","-2":"நேற்று முன் தினம்","-1":"நேற்று"},relativeTime:{future:{one:"{0} நாளில்",other:"{0} நாட்களில்"},past:{one:"{0} நாளுக்கு முன்",other:"{0} நாட்களுக்கு முன்"}}},month:{displayName:"மாதம்",relative:{0:"இந்த மாதம்",1:"அடுத்த மாதம்","-1":"கடந்த மாதம்"},relativeTime:{future:{one:"{0} மாதத்தில்",other:"{0} மாதங்களில்"},past:{one:"{0} மாதத்துக்கு முன்",other:"{0} மாதங்களுக்கு முன்"}}},year:{displayName:"ஆண்டு",relative:{0:"இந்த ஆண்டு",1:"அடுத்த ஆண்டு","-1":"கடந்த ஆண்டு"},relativeTime:{future:{one:"{0} ஆண்டில்",other:"{0} ஆண்டுகளில்"},past:{one:"{0} ஆண்டிற்கு முன்",other:"{0} ஆண்டுகளுக்கு முன்"}}}}}),ReactIntl.__addLocaleData({locale:"te",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"క్షణం",relative:{0:"ప్రస్తుతం"},relativeTime:{future:{one:"{0} సెకన్‌లో",other:"{0} సెకన్లలో"},past:{one:"{0} సెకను క్రితం",other:"{0} సెకన్ల క్రితం"}}},minute:{displayName:"నిమిషము",relativeTime:{future:{one:"{0} నిమిషంలో",other:"{0} నిమిషాల్లో"},past:{one:"{0} నిమిషం క్రితం",other:"{0} నిమిషాల క్రితం"}}},hour:{displayName:"గంట",relativeTime:{future:{one:"{0} గంటలో",other:"{0} గంటల్లో"},past:{one:"{0} గంట క్రితం",other:"{0} గంటల క్రితం"}}},day:{displayName:"దినం",relative:{0:"ఈ రోజు",1:"రేపు",2:"ఎల్లుండి","-2":"మొన్న","-1":"నిన్న"},relativeTime:{future:{one:"{0} రోజులో",other:"{0} రోజుల్లో"},past:{one:"{0} రోజు క్రితం",other:"{0} రోజుల క్రితం"}}},month:{displayName:"నెల",relative:{0:"ఈ నెల",1:"తదుపరి నెల","-1":"గత నెల"},relativeTime:{future:{one:"{0} నెలలో",other:"{0} నెలల్లో"},past:{one:"{0} నెల క్రితం",other:"{0} నెలల క్రితం"}}},year:{displayName:"సంవత్సరం",relative:{0:"ఈ సంవత్సరం",1:"తదుపరి సంవత్సరం","-1":"గత సంవత్సరం"},relativeTime:{future:{one:"{0} సంవత్సరంలో",other:"{0} సంవత్సరాల్లో"},past:{one:"{0} సంవత్సరం క్రితం",other:"{0} సంవత్సరాల క్రితం"}}}}}),ReactIntl.__addLocaleData({locale:"teo",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Isekonde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Idakika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Esaa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Aparan",relative:{0:"Lolo",1:"Moi","-1":"Jaan"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Elap",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Ekan",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"th",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"วินาที",relative:{0:"ขณะนี้"},relativeTime:{future:{other:"ในอีก {0} วินาที"},past:{other:"{0} วินาทีที่ผ่านมา"}}},minute:{displayName:"นาที",relativeTime:{future:{other:"ในอีก {0} นาที"},past:{other:"{0} นาทีที่ผ่านมา"}}},hour:{displayName:"ชั่วโมง",relativeTime:{future:{other:"ในอีก {0} ชั่วโมง"},past:{other:"{0} ชั่วโมงที่ผ่านมา"}}},day:{displayName:"วัน",relative:{0:"วันนี้",1:"พรุ่งนี้",2:"มะรืนนี้","-2":"เมื่อวานซืน","-1":"เมื่อวาน"},relativeTime:{future:{other:"ในอีก {0} วัน"},past:{other:"{0} วันที่ผ่านมา"}}},month:{displayName:"เดือน",relative:{0:"เดือนนี้",1:"เดือนหน้า","-1":"เดือนที่แล้ว"},relativeTime:{future:{other:"ในอีก {0} เดือน"},past:{other:"{0} เดือนที่ผ่านมา"}}},year:{displayName:"ปี",relative:{0:"ปีนี้",1:"ปีหน้า","-1":"ปีที่แล้ว"},relativeTime:{future:{other:"ในอีก {0} ปี"},past:{other:"{0} ปีที่แล้ว"}}}}}),ReactIntl.__addLocaleData({locale:"ti",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"tig",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"tn",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"to",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"sekoni",relative:{0:"taimiʻni"},relativeTime:{future:{other:"ʻi he sekoni ʻe {0}"},past:{other:"sekoni ʻe {0} kuoʻosi"}}},minute:{displayName:"miniti",relativeTime:{future:{other:"ʻi he miniti ʻe {0}"},past:{other:"miniti ʻe {0} kuoʻosi"}}},hour:{displayName:"houa",relativeTime:{future:{other:"ʻi he houa ʻe {0}"},past:{other:"houa ʻe {0} kuoʻosi"}}},day:{displayName:"ʻaho",relative:{0:"ʻaho⸍ni",1:"ʻapongipongi",2:"ʻahepongipongi","-2":"ʻaneheafi","-1":"ʻaneafi"},relativeTime:{future:{other:"ʻi he ʻaho ʻe {0}"},past:{other:"ʻaho ʻe {0} kuoʻosi"}}},month:{displayName:"māhina",relative:{0:"māhina⸍ni",1:"māhina kahaʻu","-1":"māhina kuoʻosi"},relativeTime:{future:{other:"ʻi he māhina ʻe {0}"},past:{other:"māhina ʻe {0} kuoʻosi"}}},year:{displayName:"taʻu",relative:{0:"taʻu⸍ni",1:"taʻu kahaʻu","-1":"taʻu kuoʻosi"},relativeTime:{future:{other:"ʻi he taʻu ʻe {0}"},past:{other:"taʻu ʻe {0} kuo hili"}}}}}),ReactIntl.__addLocaleData({locale:"tr",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Saniye",relative:{0:"şimdi"},relativeTime:{future:{one:"{0} saniye sonra",other:"{0} saniye sonra"},past:{one:"{0} saniye önce",other:"{0} saniye önce"}}},minute:{displayName:"Dakika",relativeTime:{future:{one:"{0} dakika sonra",other:"{0} dakika sonra"},past:{one:"{0} dakika önce",other:"{0} dakika önce"}}},hour:{displayName:"Saat",relativeTime:{future:{one:"{0} saat sonra",other:"{0} saat sonra"},past:{one:"{0} saat önce",other:"{0} saat önce"}}},day:{displayName:"Gün",relative:{0:"bugün",1:"yarın",2:"öbür gün","-2":"evvelsi gün","-1":"dün"},relativeTime:{future:{one:"{0} gün sonra",other:"{0} gün sonra"},past:{one:"{0} gün önce",other:"{0} gün önce"}}},month:{displayName:"Ay",relative:{0:"bu ay",1:"gelecek ay","-1":"geçen ay"},relativeTime:{future:{one:"{0} ay sonra",other:"{0} ay sonra"},past:{one:"{0} ay önce",other:"{0} ay önce"}}},year:{displayName:"Yıl",relative:{0:"bu yıl",1:"gelecek yıl","-1":"geçen yıl"},relativeTime:{future:{one:"{0} yıl sonra",other:"{0} yıl sonra"},past:{one:"{0} yıl önce",other:"{0} yıl önce"}}}}}),ReactIntl.__addLocaleData({locale:"ts",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"tzm",pluralRuleFunction:function(a){return a=Math.floor(a),a===Math.floor(a)&&a>=0&&1>=a||a===Math.floor(a)&&a>=11&&99>=a?"one":"other"},fields:{second:{displayName:"Tusnat",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Tusdat",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Tasragt",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ass",relative:{0:"Assa",1:"Asekka","-1":"Assenaṭ"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Ayur",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Asseggas",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"ug",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"سېكۇنت",relative:{0:"now"},relativeTime:{future:{one:"{0} سېكۇنتتىن كېيىن",other:"{0} سېكۇنتتىن كېيىن"},past:{one:"{0} سېكۇنت ئىلگىرى",other:"{0} سېكۇنت ئىلگىرى"}}},minute:{displayName:"مىنۇت",relativeTime:{future:{one:"{0} مىنۇتتىن كېيىن",other:"{0} مىنۇتتىن كېيىن"},past:{one:"{0} مىنۇت ئىلگىرى",other:"{0} مىنۇت ئىلگىرى"}}},hour:{displayName:"سائەت",relativeTime:{future:{one:"{0} سائەتتىن كېيىن",other:"{0} سائەتتىن كېيىن"},past:{one:"{0} سائەت ئىلگىرى",other:"{0} سائەت ئىلگىرى"}}},day:{displayName:"كۈن",relative:{0:"بۈگۈن",1:"ئەتە","-1":"تۈنۈگۈن"},relativeTime:{future:{one:"{0} كۈندىن كېيىن",other:"{0} كۈندىن كېيىن"},past:{one:"{0} كۈن ئىلگىرى",other:"{0} كۈن ئىلگىرى"}}},month:{displayName:"ئاي",relative:{0:"بۇ ئاي",1:"كېلەر ئاي","-1":"ئۆتكەن ئاي"},relativeTime:{future:{one:"{0} ئايدىن كېيىن",other:"{0} ئايدىن كېيىن"},past:{one:"{0} ئاي ئىلگىرى",other:"{0} ئاي ئىلگىرى"}}},year:{displayName:"يىل",relative:{0:"بۇ يىل",1:"كېلەر يىل","-1":"ئۆتكەن يىل"},relativeTime:{future:{one:"{0} يىلدىن كېيىن",other:"{0} يىلدىن كېيىن"},past:{one:"{0} يىل ئىلگىرى",other:"{0} يىل ئىلگىرى"}}}}}),ReactIntl.__addLocaleData({locale:"uk",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),0===c&&b%10===1&&b%100!==11?"one":0===c&&b%10===Math.floor(b%10)&&b%10>=2&&4>=b%10&&!(b%100>=12&&14>=b%100)?"few":0===c&&(b%10===0||0===c&&(b%10===Math.floor(b%10)&&b%10>=5&&9>=b%10||0===c&&b%100===Math.floor(b%100)&&b%100>=11&&14>=b%100))?"many":"other"},fields:{second:{displayName:"Секунда",relative:{0:"зараз"},relativeTime:{future:{one:"Через {0} секунду",few:"Через {0} секунди",many:"Через {0} секунд",other:"Через {0} секунди"},past:{one:"{0} секунду тому",few:"{0} секунди тому",many:"{0} секунд тому",other:"{0} секунди тому"}}},minute:{displayName:"Хвилина",relativeTime:{future:{one:"Через {0} хвилину",few:"Через {0} хвилини",many:"Через {0} хвилин",other:"Через {0} хвилини"},past:{one:"{0} хвилину тому",few:"{0} хвилини тому",many:"{0} хвилин тому",other:"{0} хвилини тому"}}},hour:{displayName:"Година",relativeTime:{future:{one:"Через {0} годину",few:"Через {0} години",many:"Через {0} годин",other:"Через {0} години"},past:{one:"{0} годину тому",few:"{0} години тому",many:"{0} годин тому",other:"{0} години тому"}}},day:{displayName:"День",relative:{0:"сьогодні",1:"завтра",2:"післязавтра","-2":"позавчора","-1":"учора"},relativeTime:{future:{one:"Через {0} день",few:"Через {0} дні",many:"Через {0} днів",other:"Через {0} дня"},past:{one:"{0} день тому",few:"{0} дні тому",many:"{0} днів тому",other:"{0} дня тому"}}},month:{displayName:"Місяць",relative:{0:"цього місяця",1:"наступного місяця","-1":"минулого місяця"},relativeTime:{future:{one:"Через {0} місяць",few:"Через {0} місяці",many:"Через {0} місяців",other:"Через {0} місяця"},past:{one:"{0} місяць тому",few:"{0} місяці тому",many:"{0} місяців тому",other:"{0} місяця тому"}}},year:{displayName:"Рік",relative:{0:"цього року",1:"наступного року","-1":"минулого року"},relativeTime:{future:{one:"Через {0} рік",few:"Через {0} роки",many:"Через {0} років",other:"Через {0} року"},past:{one:"{0} рік тому",few:"{0} роки тому",many:"{0} років тому",other:"{0} року тому"}}}}}),ReactIntl.__addLocaleData({locale:"ur",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a)),c=a.toString().replace(/^[^.]*\.?/,"").length;return a=Math.floor(a),1===b&&0===c?"one":"other"},fields:{second:{displayName:"سیکنڈ",relative:{0:"اب"},relativeTime:{future:{one:"{0} سیکنڈ میں",other:"{0} سیکنڈ میں"},past:{one:"{0} سیکنڈ پہلے",other:"{0} سیکنڈ پہلے"}}},minute:{displayName:"منٹ",relativeTime:{future:{one:"{0} منٹ میں",other:"{0} منٹ میں"},past:{one:"{0} منٹ پہلے",other:"{0} منٹ پہلے"}}},hour:{displayName:"گھنٹہ",relativeTime:{future:{one:"{0} گھنٹہ میں",other:"{0} گھنٹے میں"},past:{one:"{0} گھنٹہ پہلے",other:"{0} گھنٹے پہلے"}}},day:{displayName:"دن",relative:{0:"آج",1:"آئندہ کل",2:"آنے والا پرسوں","-2":"گزشتہ پرسوں","-1":"گزشتہ کل"},relativeTime:{future:{one:"{0} دن میں",other:"{0} دن میں"},past:{one:"{0} دن پہلے",other:"{0} دن پہلے"}}},month:{displayName:"مہینہ",relative:{0:"اس مہینہ",1:"اگلے مہینہ","-1":"پچھلے مہینہ"},relativeTime:{future:{one:"{0} مہینہ میں",other:"{0} مہینے میں"},past:{one:"{0} مہینہ پہلے",other:"{0} مہینے پہلے"}}},year:{displayName:"سال",relative:{0:"اس سال",1:"اگلے سال","-1":"پچھلے سال"},relativeTime:{future:{one:"{0} سال میں",other:"{0} سال میں"},past:{one:"{0} سال پہلے",other:"{0} سال پہلے"}}}}}),ReactIntl.__addLocaleData({locale:"uz",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other" },fields:{second:{displayName:"Soniya",relative:{0:"hozir"},relativeTime:{future:{one:"{0} soniyadan soʻng",other:"{0} soniyadan soʻng"},past:{one:"{0} soniya oldin",other:"{0} soniya oldin"}}},minute:{displayName:"Daqiqa",relativeTime:{future:{one:"{0} daqiqadan soʻng",other:"{0} daqiqadan soʻng"},past:{one:"{0} daqiqa oldin",other:"{0} daqiqa oldin"}}},hour:{displayName:"Soat",relativeTime:{future:{one:"{0} soatdan soʻng",other:"{0} soatdan soʻng"},past:{one:"{0} soat oldin",other:"{0} soat oldin"}}},day:{displayName:"Kun",relative:{0:"bugun",1:"ertaga","-1":"kecha"},relativeTime:{future:{one:"{0} kundan soʻng",other:"{0} kundan soʻng"},past:{one:"{0} kun oldin",other:"{0} kun oldin"}}},month:{displayName:"Oy",relative:{0:"bu oy",1:"keyingi oy","-1":"oʻtgan oy"},relativeTime:{future:{one:"{0} oydan soʻng",other:"{0} oydan soʻng"},past:{one:"{0} oy avval",other:"{0} oy avval"}}},year:{displayName:"Yil",relative:{0:"bu yil",1:"keyingi yil","-1":"oʻtgan yil"},relativeTime:{future:{one:"{0} yildan soʻng",other:"{0} yildan soʻng"},past:{one:"{0} yil avval",other:"{0} yil avval"}}}}}),ReactIntl.__addLocaleData({locale:"ve",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"vi",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Giây",relative:{0:"bây giờ"},relativeTime:{future:{other:"Trong {0} giây nữa"},past:{other:"{0} giây trước"}}},minute:{displayName:"Phút",relativeTime:{future:{other:"Trong {0} phút nữa"},past:{other:"{0} phút trước"}}},hour:{displayName:"Giờ",relativeTime:{future:{other:"Trong {0} giờ nữa"},past:{other:"{0} giờ trước"}}},day:{displayName:"Ngày",relative:{0:"Hôm nay",1:"Ngày mai",2:"Ngày kia","-2":"Hôm kia","-1":"Hôm qua"},relativeTime:{future:{other:"Trong {0} ngày nữa"},past:{other:"{0} ngày trước"}}},month:{displayName:"Tháng",relative:{0:"tháng này",1:"tháng sau","-1":"tháng trước"},relativeTime:{future:{other:"Trong {0} tháng nữa"},past:{other:"{0} tháng trước"}}},year:{displayName:"Năm",relative:{0:"năm nay",1:"năm sau","-1":"năm ngoái"},relativeTime:{future:{other:"Trong {0} năm nữa"},past:{other:"{0} năm trước"}}}}}),ReactIntl.__addLocaleData({locale:"vo",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"sekun",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"minut",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"düp",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Tag",relative:{0:"adelo",1:"odelo",2:"udelo","-2":"edelo","-1":"ädelo"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"mul",relative:{0:"amulo",1:"omulo","-1":"ämulo"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"yel",relative:{0:"ayelo",1:"oyelo","-1":"äyelo"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"vun",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunde",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Dakyika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Saa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Mfiri",relative:{0:"Inu",1:"Ngama","-1":"Ukou"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Mori",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Maka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"wae",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Sekunda",relative:{0:"now"},relativeTime:{future:{one:"i {0} sekund",other:"i {0} sekunde"},past:{one:"vor {0} sekund",other:"vor {0} sekunde"}}},minute:{displayName:"Mínütta",relativeTime:{future:{one:"i {0} minüta",other:"i {0} minüte"},past:{one:"vor {0} minüta",other:"vor {0} minüte"}}},hour:{displayName:"Schtund",relativeTime:{future:{one:"i {0} stund",other:"i {0} stunde"},past:{one:"vor {0} stund",other:"vor {0} stunde"}}},day:{displayName:"Tag",relative:{0:"Hitte",1:"Móre",2:"Ubermóre","-2":"Vorgešter","-1":"Gešter"},relativeTime:{future:{one:"i {0} tag",other:"i {0} täg"},past:{one:"vor {0} tag",other:"vor {0} täg"}}},month:{displayName:"Mánet",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"I {0} mánet",other:"I {0} mánet"},past:{one:"vor {0} mánet",other:"vor {0} mánet"}}},year:{displayName:"Jár",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"I {0} jár",other:"I {0} jár"},past:{one:"vor {0} jár",other:"cor {0} jár"}}}}}),ReactIntl.__addLocaleData({locale:"xh",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Second",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Minute",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Hour",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"xog",pluralRuleFunction:function(a){return a=Math.floor(a),1===a?"one":"other"},fields:{second:{displayName:"Obutikitiki",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Edakiika",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"Essawa",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Olunaku",relative:{0:"Olwaleelo (leelo)",1:"Enkyo","-1":"Edho"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Omwezi",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Omwaka",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"yo",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"Ìsẹ́jú Ààyá",relative:{0:"now"},relativeTime:{future:{other:"+{0} s"},past:{other:"-{0} s"}}},minute:{displayName:"Ìsẹ́jú",relativeTime:{future:{other:"+{0} min"},past:{other:"-{0} min"}}},hour:{displayName:"wákàtí",relativeTime:{future:{other:"+{0} h"},past:{other:"-{0} h"}}},day:{displayName:"Ọjọ́",relative:{0:"Òní",1:"Ọ̀la",2:"òtúùnla","-2":"íjẹta","-1":"Àná"},relativeTime:{future:{other:"+{0} d"},past:{other:"-{0} d"}}},month:{displayName:"Osù",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{other:"+{0} m"},past:{other:"-{0} m"}}},year:{displayName:"Ọdún",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{other:"+{0} y"},past:{other:"-{0} y"}}}}}),ReactIntl.__addLocaleData({locale:"zh",pluralRuleFunction:function(){return"other"},fields:{second:{displayName:"秒钟",relative:{0:"现在"},relativeTime:{future:{other:"{0}秒钟后"},past:{other:"{0}秒钟前"}}},minute:{displayName:"分钟",relativeTime:{future:{other:"{0}分钟后"},past:{other:"{0}分钟前"}}},hour:{displayName:"小时",relativeTime:{future:{other:"{0}小时后"},past:{other:"{0}小时前"}}},day:{displayName:"日",relative:{0:"今天",1:"明天",2:"后天","-2":"前天","-1":"昨天"},relativeTime:{future:{other:"{0}天后"},past:{other:"{0}天前"}}},month:{displayName:"月",relative:{0:"本月",1:"下个月","-1":"上个月"},relativeTime:{future:{other:"{0}个月后"},past:{other:"{0}个月前"}}},year:{displayName:"年",relative:{0:"今年",1:"明年","-1":"去年"},relativeTime:{future:{other:"{0}年后"},past:{other:"{0}年前"}}}}}),ReactIntl.__addLocaleData({locale:"zu",pluralRuleFunction:function(a){var b=Math.floor(Math.abs(a));return a=Math.floor(a),0===b||1===a?"one":"other"},fields:{second:{displayName:"Isekhondi",relative:{0:"manje"},relativeTime:{future:{one:"Kusekhondi elingu-{0}",other:"Kumasekhondi angu-{0}"},past:{one:"isekhondi elingu-{0} eledlule",other:"amasekhondi angu-{0} adlule"}}},minute:{displayName:"Iminithi",relativeTime:{future:{one:"Kumunithi engu-{0}",other:"Emaminithini angu-{0}"},past:{one:"eminithini elingu-{0} eledlule",other:"amaminithi angu-{0} adlule"}}},hour:{displayName:"Ihora",relativeTime:{future:{one:"Ehoreni elingu-{0}",other:"Emahoreni angu-{0}"},past:{one:"ehoreni eligu-{0} eledluli",other:"emahoreni angu-{0} edlule"}}},day:{displayName:"Usuku",relative:{0:"namhlanje",1:"kusasa",2:"Usuku olulandela olakusasa","-2":"Usuku olwandulela olwayizolo","-1":"izolo"},relativeTime:{future:{one:"Osukwini olungu-{0}",other:"Ezinsukwini ezingu-{0}"},past:{one:"osukwini olungu-{0} olwedlule",other:"ezinsukwini ezingu-{0} ezedlule."}}},month:{displayName:"Inyanga",relative:{0:"le nyanga",1:"inyanga ezayo","-1":"inyanga edlule"},relativeTime:{future:{one:"Enyangeni engu-{0}",other:"Ezinyangeni ezingu-{0}"},past:{one:"enyangeni engu-{0} eyedlule",other:"ezinyangeni ezingu-{0} ezedlule"}}},year:{displayName:"Unyaka",relative:{0:"kulo nyaka",1:"unyaka ozayo","-1":"onyakeni odlule"},relativeTime:{future:{one:"Onyakeni ongu-{0}",other:"Eminyakeni engu-{0}"},past:{one:"enyakeni ongu-{0} owedlule",other:"iminyaka engu-{0} eyedlule"}}}}}); //# sourceMappingURL=react-intl-with-locales.min.js.map
src/DropdownMenu.js
dozoisch/react-bootstrap
import classNames from 'classnames'; import keycode from 'keycode'; import React from 'react'; import ReactDOM from 'react-dom'; import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper'; import { bsClass, getClassSet, prefix, splitBsProps } from './utils/bootstrapUtils'; import createChainedFunction from './utils/createChainedFunction'; import ValidComponentChildren from './utils/ValidComponentChildren'; const propTypes = { open: React.PropTypes.bool, pullRight: React.PropTypes.bool, onClose: React.PropTypes.func, labelledBy: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.number, ]), onSelect: React.PropTypes.func, }; const defaultProps = { bsRole: 'menu', pullRight: false, }; class DropdownMenu extends React.Component { constructor(props) { super(props); this.handleKeyDown = this.handleKeyDown.bind(this); } handleKeyDown(event) { switch (event.keyCode) { case keycode.codes.down: this.focusNext(); event.preventDefault(); break; case keycode.codes.up: this.focusPrevious(); event.preventDefault(); break; case keycode.codes.esc: case keycode.codes.tab: this.props.onClose(event); break; default: } } getItemsAndActiveIndex() { const items = this.getFocusableMenuItems(); const activeIndex = items.indexOf(document.activeElement); return { items, activeIndex }; } getFocusableMenuItems() { const node = ReactDOM.findDOMNode(this); if (!node) { return []; } return Array.from(node.querySelectorAll('[tabIndex="-1"]')); } focusNext() { const { items, activeIndex } = this.getItemsAndActiveIndex(); if (items.length === 0) { return; } const nextIndex = activeIndex === items.length - 1 ? 0 : activeIndex + 1; items[nextIndex].focus(); } focusPrevious() { const { items, activeIndex } = this.getItemsAndActiveIndex(); if (items.length === 0) { return; } const prevIndex = activeIndex === 0 ? items.length - 1 : activeIndex - 1; items[prevIndex].focus(); } render() { const { open, pullRight, onClose, labelledBy, onSelect, className, children, ...props, } = this.props; const [bsProps, elementProps] = splitBsProps(props); const classes = { ...getClassSet(bsProps), [prefix(bsProps, 'right')]: pullRight, }; return ( <RootCloseWrapper noWrap disabled={!open} onRootClose={onClose} > <ul {...elementProps} role="menu" className={classNames(className, classes)} aria-labelledby={labelledBy} > {ValidComponentChildren.map(children, child => ( React.cloneElement(child, { onKeyDown: createChainedFunction( child.props.onKeyDown, this.handleKeyDown ), onSelect: createChainedFunction(child.props.onSelect, onSelect), }) ))} </ul> </RootCloseWrapper> ); } } DropdownMenu.propTypes = propTypes; DropdownMenu.defaultProps = defaultProps; export default bsClass('dropdown-menu', DropdownMenu);
src/routes/boards/Boards.js
jhlav/mpn-web-app
/* eslint-disable no-shadow */ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { graphql } from 'react-apollo'; import reactMDCSS from 'react-md/dist/react-md.red-light_blue.min.css'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import { changeCategory, changeView, navigate } from '../../actions/boards'; import NavRibbon from '../../components/NavRibbon'; // Wimport BoardHeader from '../../components/BoardHeader'; import BoardRow from '../../components/BoardRow'; import players from './players.graphql'; // const rows = [ // { // name: 'Gi-a Fosu', // discordID: 'Gi-a Fosu#9108', // wins: 1, // games: 2, // points: 5, // }, // { // name: 'Jeffery', // discordID: 'Jeffery 🦉🍃#4336', // wins: 99, // games: 210, // points: 1309, // }, // { // name: 'jef', // discordID: 'jef#9862', // wins: 15, // games: 23, // points: 98, // }, // { // name: 'Sly', // discordID: 'Sly 🔥🍕#4741', // wins: 100, // games: 238, // points: 1290, // }, // { // name: 'Player', // discordID: 'Player#5555', // wins: 0, // games: 0, // points: 0, // }, // ]; @connect( state => ({ category: state.boards.category, view: state.boards.view, isNavigating: state.boards.isNavigating, }), { changeCategory, changeView, navigate, }, ) @graphql(players) @withStyles(reactMDCSS) class Boards extends React.Component { static propTypes = { changeCategory: PropTypes.func.isRequired, changeView: PropTypes.func.isRequired, data: PropTypes.shape({ loading: PropTypes.bool.isRequired, players: PropTypes.arrayOf( PropTypes.shape({ id: PropTypes.string.isRequired, avatarURL: PropTypes.string.isRequired, nickname: PropTypes.string, tag: PropTypes.string.isRequired, }), ), }).isRequired, isNavigating: PropTypes.bool.isRequired, navigate: PropTypes.func.isRequired, // category: PropTypes.string.isRequired, view: PropTypes.string.isRequired, }; componentDidMount() { require('webfontloader').load({ // eslint-disable-line google: { families: ['Roboto', 'Roboto Condensed', 'Material Icons'], }, }); } render() { const { // category, view, changeCategory, changeView, isNavigating, navigate, } = this.props; if (isNavigating) { return ( <div> {view === 'root' && <div> <NavRibbon title="Platform" onClick={() => { changeView('platform'); }} to="/boards/platform" /> <NavRibbon title="Game" onClick={() => { changeView('game'); }} to="/boards/game" /> <NavRibbon title="Gamemode" onClick={() => { changeView('gamemode'); }} to="/boards/gamemode" /> </div>} {view === 'platform' && <div> <NavRibbon goesBack onClick={() => { changeView('root'); }} to="/boards" /> <NavRibbon title="N64" onClick={() => { navigate(false); changeCategory('N64'); }} to="/boards/platform/n64" /> <NavRibbon title="Gamecube" onClick={() => { navigate(false); changeCategory('Gamecube'); }} to="/boards/platform/gc" /> <NavRibbon title="Wii" onClick={() => { navigate(false); changeCategory('Wii'); }} to="/boards/platform/wii" /> </div>} {view === 'gamemode' && <div> <NavRibbon goesBack onClick={() => { changeView('root'); }} to="/boards" /> <NavRibbon title="Battle Royale" onClick={() => { navigate(false); changeCategory('Battle Royale'); }} to="/boards/gamemode/br" /> <NavRibbon title="Mini-Games" onClick={() => { navigate(false); changeCategory('Mini-Games'); }} to="/boards/gamemode/mini" /> <NavRibbon title="Duel" onClick={() => { navigate(false); changeCategory('Duel'); }} to="/boards/gamemode/duel" /> <NavRibbon title="Team Battle" onClick={() => { navigate(false); changeCategory('Team Battle'); }} to="/boards/gamemode/tb" /> </div>} {view === 'game' && <div> <NavRibbon goesBack onClick={() => { changeView('root'); }} to="/boards" /> <NavRibbon title="Mario Party 1" onClick={() => { navigate(false); changeCategory('Mario Party 1'); }} to="/boards/game/mp1" /> <NavRibbon title="Mario Party 2" onClick={() => { navigate(false); changeCategory('Mario Party 2'); }} to="/boards/game/mp2" /> <NavRibbon title="Mario Party 3" onClick={() => { navigate(false); changeCategory('Mario Party 3'); }} to="/boards/game/mp3" /> <NavRibbon title="Mario Party 4" onClick={() => { navigate(false); changeCategory('Mario Party 4'); }} to="/boards/game/mp4" /> <NavRibbon title="Mario Party 5" onClick={() => { navigate(false); changeCategory('Mario Party 5'); }} to="/boards/game/mp5" /> <NavRibbon title="Mario Party 6" onClick={() => { navigate(false); changeCategory('Mario Party 6'); }} to="/boards/game/mp6" /> <NavRibbon title="Mario Party 7" onClick={() => { navigate(false); changeCategory('Mario Party 7'); }} to="/boards/game/mp7" /> <NavRibbon title="Mario Party 8" onClick={() => { navigate(false); changeCategory('Mario Party 8'); }} to="/boards/game/mp8" /> <NavRibbon title="Mario Party 9" onClick={() => { navigate(false); changeCategory('Mario Party 9'); }} to="/boards/game/mp9" /> </div>} </div> ); } return ( <div style={{ backgroundColor: '#fbfbfb' }}> {this.props.data.players.map(player => <BoardRow key={player.id} player={player} />, )} {/* rows.map(row => <BoardRow key={row.id} row={row} />) */} </div> ); } } export default Boards;
src/routes/Archives/containers/Archives.js
mywentu/react-blog
import { connect } from 'react-redux' import { fetchArchives } from './../modules/archives' import Archives from '../components/Archives' const mapDispatchtoProps = { fetchArchives } const mapStateToProps = (state) => ({ archives: state.archives }) export default connect(mapStateToProps, mapDispatchtoProps)(Archives)
templates/app/js/index.js
111StudioKK/lambda-cli
import React from 'react'; import { Provider } from 'react-redux'; import { render } from 'react-dom'; import App from './app/App/App.jsx'; import '../styles/config.less'; import {store} from './redux/'; import {actions} from './redux/'; actions.initConfig({ bootstrapped: true }); render(<Provider store={store}><App /></Provider>, document.getElementById('root'));
packages/reactReduxFormBase/src/Model.spec.js
daniloster/react-experiments
import React from 'react'; import sinon from 'sinon'; import { mount } from 'enzyme'; import AppModel from '../DEV/AppModel'; import Input from '../DEV/Input'; import { change, click } from '../../../tools/helpers/test/simulate'; import { assertValue, length } from '../../../tools/helpers/test/assert'; let element; let props; function getComponentAsNode(customProps = {}) { props = { ...customProps, onSubmit: sinon.spy(), }; return <AppModel noLogging />; } function mountComponent(props) { element = mount(getComponentAsNode(props), { lifecycleExperimental: true, }); } function getStateForm() { return element.find(StateForm); } describe('<Model />', () => { describe('Model should render children', () => { it('Given the AppModel has some inputs', () => { mountComponent(); }); it('Expect to see 5 inputs', () => { const inputs = element.find(Input); length(inputs).eql(5, 'There are no 5 elements rendered'); }); }); describe('Model should update the correct field', () => { it('Given the AppModel has some inputs', () => { mountComponent(); }); it('When the user updates the firstname input field with "Mont"', () => { change(element.find('input[type="text"][id="firstname"]'), 'Mont'); }); it('Then the state should have the firstname as "Mont"', () => { const store = element.instance().store; const state = store.getState().personSection; assertValue(state[state.dataName]).eql({ firstname: 'Mont' }, 'Data is not the expected'); }); }); describe('Model should not show message for valid fields', () => { it('Given the AppModel has some inputs', () => { mountComponent(); }); it('When the user updates the firstname input field with "Mont"', () => { change(element.find('input[type="text"][id="firstname"]'), 'Mont'); }); it('And the user clicks on the validate button', () => { click(element.find('button[type="button"][id="btnValidate"]')); }); it('Then the state should have the firstname as "Mont"', () => { const store = element.instance().store; const state = store.getState().personSection; assertValue(state[state.dataName]).eql({ firstname: 'Mont' }, 'Data is not the expected'); }); it('And it should have 6 invalid messages', () => { length(element.find('.react__form-item-validation-message')).eql( 6, 'There are no 6 validation messages', ); }); }); describe('Model should update the correct field', () => { const onChangeValue = sinon.spy(); it('Given the AppModel has firstname filled in', () => { mountComponent(); change(element.find('input[type="text"][id="firstname"]'), 'Mont'); const props = element.props(); element.setProps({ onChangeValue: (path, value) => { onChangeValue(path, value); props.onChangeValue(path, value); }, }); }); it('When the user updates the firstname with the same value "Mont"', () => { change(element.find('input[type="text"][id="firstname"]'), 'Mont'); }); it('Then the state should have the firstname as "Mont"', () => { const store = element.instance().store; const state = store.getState().personSection; assertValue(state[state.dataName]).eql({ firstname: 'Mont' }, 'Data is not the expected'); }); it('And the change value should have not been called', () => { assertValue(onChangeValue.calledOnce).eql(false, 'onChangeValue has been called'); }); }); });
static/src/containers/Authorize.js
detailyang/cas-server
/** * @Author: BingWu Yang <detailyang> * @Date: 2016-03-13T22:43:06+08:00 * @Email: [email protected] * @Last modified by: detailyang * @Last modified time: 2016-06-24T10:31:12+08:00 * @License: The MIT License (MIT) */ import { Icon, Button, Row, Col, message } from 'antd'; import url from 'url'; import querystring from 'querystring'; import React from 'react'; import { fetch } from '../utils'; export default React.createClass({ handleClick(e) { e.preventDefault(); fetch('', { method: 'POST' }) .then((res) => { location.href = res.value; }) .catch((err, resp) => { message.error(resp.data.value, 3); }); }, render() { const qs = querystring.parse(url.parse(location.href).query); const name = qs.name || ''; const AvatarStyle = { height: 100, width: 100, borderRadius: '50%', }; const IconStyle = { 'fontSize': 16, 'marginRight': 16, }; const CheckIconStyle = { 'fontSize': 16, color: '#79d858', }; const Style = { 'marginTop': 100, }; const H1Style = { 'color': '#333', }; const ButtonStyle = { 'marginTop': 25, 'marginBottom': 15, }; const NameStyle = { color: 'red', }; return ( <div className="row-flex row-flex-center"> <div className="col-12 box" style={Style} > <Row style={{ 'borderBottom': '1px solid #ddd', 'marginBottom': 15, }} > <Col span="18"> <h1 style={H1Style}>Authorize application</h1> <p> <strong style={NameStyle}>{name}</strong> would like permission to access your account </p> </Col> <Col span="6"> <img style={AvatarStyle} src="/api/users/self/avatar" /> </Col> </Row> <Row> <h1 style={H1Style}> Review Permissions </h1> </Row> <div style={{ border: '1px solid #ddd', padding: '25px', }} > <Row style= {{ padding: '10px', }} > <Col span="10"> <Icon type="user" style={IconStyle} /> Read your personal user data </Col> <Col span="1" offset="11"> <Icon type="check" style={CheckIconStyle} /> </Col> </Row> <Row style= {{ padding: '10px', }} > <Col span="10"> <Icon type="setting" style={IconStyle} /> Setting your personal user data </Col> <Col span="1" offset="11"> <Icon type="check" style={CheckIconStyle} /> </Col> </Row> </div> <Row> <Button onClick={this.handleClick} style={ButtonStyle} type="primary" size="large"> 确认 </Button> </Row> </div> </div> ); }, });
src/components/screenBeaconList.js
CMP-Studio/BeaconDeploymentTool
// @flow import React from 'react'; import { View, ScrollView, TouchableOpacity, Text, StyleSheet } from 'react-native'; import type { NavigateType } from '../actions/navigation'; import type { BeaconType, DeleteBeaconType } from '../actions/beacons'; import type { RegionsByFloorType } from '../reducers/beacons'; import { activeColor, listHeaderColor, listSeparatorColor, textSupportingColor, screenBackgroundColor, headingTextSize, largeTextSize, plusTextSize, } from '../styles'; import { SCREEN_BEACON_INFO_BEACONS } from '../actions/navigation'; import DisclosureCell from './disclosureCell'; import { pureStatelessComponent } from '../utilityViews'; const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'column', backgroundColor: screenBackgroundColor, }, rowItem: { height: 44, flexDirection: 'row', alignItems: 'center', paddingLeft: 10, }, floorTitleRow: { backgroundColor: screenBackgroundColor, borderBottomWidth: 1, borderBottomColor: listSeparatorColor, }, floorTitle: { fontSize: largeTextSize, color: textSupportingColor, }, regionTitleRow: { height: 30, backgroundColor: listHeaderColor, }, regionTitle: { fontSize: headingTextSize, color: textSupportingColor, }, rowSeparator: { marginLeft: 10, height: 0.5, backgroundColor: listSeparatorColor, }, }); const renderFloorTitle = (floorTitle, currentIndex) => { return ( <View key={currentIndex} style={[styles.rowItem, styles.floorTitleRow]}> <Text style={styles.floorTitle}> {`Floor ${floorTitle}`} </Text> </View> ); }; const renderRegionTitle = (regionTitle, currentIndex) => { return ( <View key={currentIndex} style={[styles.rowItem, styles.regionTitleRow]}> <Text style={styles.regionTitle}> {`${regionTitle}`} </Text> </View> ); }; const renderBeaconRow = ( beacon: BeaconType, currentIndex: number, renderSeparator: boolean, navigate: NavigateType, deleteBeacon: DeleteBeaconType, ) => { const beaconName = beacon.name; return ( <DisclosureCell key={currentIndex} title={beaconName} renderSeparator={renderSeparator} onPress={() => { navigate(SCREEN_BEACON_INFO_BEACONS, { beaconUuid: beacon.uuid, screenTitle: beaconName, deleteBeacon, }); }} /> ); }; type ScreenBeaconListProps = { regionsByFloor: RegionsByFloorType, screenProps: { navActions: { navigate: NavigateType, // eslint-disable-line }, }, deleteBeacon: DeleteBeaconType, }; const ScreenBeaconList = (props: ScreenBeaconListProps) => { const { screenProps, deleteBeacon } = props; const { navigate } = screenProps.navActions; const renderedFloors = []; const content = []; let currentIndex = 0; const stickyHeaderIndices = []; if (props.regionsByFloor.size === 0) { content.push( <DisclosureCell key={'emptyMessage'} title={'No Beacons yet. Tap to create one.'} renderSeparator={false} onPress={() => { navigate(SCREEN_BEACON_INFO_BEACONS, { text: 'New Beacon', screenTitle: 'New Beacon', }); }} />, ); } // eslint-disable-next-line no-restricted-syntax for (const [floorTitle, regions] of props.regionsByFloor.entries()) { if (!renderedFloors.includes(floorTitle)) { content.push(renderFloorTitle(floorTitle, currentIndex)); renderedFloors.push(floorTitle); stickyHeaderIndices.push(currentIndex); currentIndex += 1; // eslint-disable-next-line no-restricted-syntax for (const [regionTitle, beaconList] of regions.entries()) { content.push(renderRegionTitle(regionTitle, currentIndex)); currentIndex += 1; // eslint-disable-next-line no-loop-func beaconList.forEach((beacon, index) => { const renderSeparator = beaconList.size === 1 ? false : beaconList.size - 1 !== index; content.push( renderBeaconRow(beacon, currentIndex, renderSeparator, navigate, deleteBeacon), ); currentIndex += 1; }); } } } return ( <ScrollView stickyHeaderIndices={stickyHeaderIndices} style={styles.container}> {content} </ScrollView> ); }; ScreenBeaconList.navigationOptions = ({ navigation, screenProps }) => { const { navigate, numBeacons } = screenProps.navActions; const title = `${numBeacons} Beacon${numBeacons === 1 ? '' : 's'}`; return { title, headerRight: ( <View style={{ width: 40, flex: 1, justifyContent: 'center', alignItems: 'center', }} > <TouchableOpacity onPress={() => { navigate(SCREEN_BEACON_INFO_BEACONS, { text: 'New Beacon', screenTitle: 'New Beacon', }); }} > <Text style={{ color: activeColor, fontSize: plusTextSize }}> {'+'} </Text> </TouchableOpacity> </View> ), }; }; export default pureStatelessComponent(ScreenBeaconList, (oldProps, newProps) => { return oldProps.regionsByFloor !== newProps.regionsByFloor; });
src/components/Common/TierBlock.js
oraclesorg/ico-wizard
import React from 'react' import { Field } from 'react-final-form' import { OnChange } from 'react-final-form-listeners' import { InputField2 } from './InputField2' import { WhitelistInputBlock } from './WhitelistInputBlock' import { composeValidators, isDateInFuture, isDateLaterThan, isDatePreviousThan, isDateSameOrLaterThan, isDateSameOrPreviousThan, isInteger, isLessOrEqualThan, isPositive, isRequired, isMaxLength, } from '../../utils/validations' import { DESCRIPTION, TEXT_FIELDS } from '../../utils/constants' const { ALLOWMODIFYING, CROWDSALE_SETUP_NAME, START_TIME, END_TIME, RATE, SUPPLY } = TEXT_FIELDS const inputErrorStyle = { color: 'red', fontWeight: 'bold', fontSize: '12px', width: '100%', height: '20px', } export const TierBlock = ({ fields, ...props }) => { const validateTierStartDate = (index) => (value, values) => { const listOfValidations = [ isRequired(), isDateInFuture(), isDatePreviousThan("Should be previous than same tier's End Time")(values.tiers[index].endTime), ] if (index > 0) { listOfValidations.push(isDateSameOrLaterThan("Should be same or later than previous tier's End Time")(values.tiers[index - 1].endTime)) } return composeValidators(...listOfValidations)(value) } const validateTierEndDate = (index) => (value, values) => { const listOfValidations = [ isRequired(), isDateInFuture(), isDateLaterThan("Should be later than same tier's Start Time")(values.tiers[index].startTime), ] if (index < values.tiers.length - 1) { listOfValidations.push(isDateSameOrPreviousThan("Should be same or previous than next tier's Start Time")(values.tiers[index + 1].startTime)) } return composeValidators(...listOfValidations)(value) } return ( <div> {fields.map((name, index) => ( <div style={{ marginTop: '40px' }} className='steps-content container' key={index}> <div className="hidden"> <div className="input-block-container"> <Field name={`${name}.tier`} validate={(value) => { const errors = composeValidators( isRequired(), isMaxLength()(30) )(value) if (errors) return errors.shift() }} errorStyle={inputErrorStyle} component={InputField2} type="text" side="left" label={CROWDSALE_SETUP_NAME} description={DESCRIPTION.CROWDSALE_SETUP_NAME} /> <Field name={`${name}.updatable`} render={({ input }) => ( <div className='right'> <label className="label">{ALLOWMODIFYING}</label> <div className='radios-inline'> <label className='radio-inline'> <input type='radio' checked={input.value === 'on'} onChange={() => input.onChange('on')} value='on' /> <span className='title'>on</span> </label> <label className='radio-inline'> <input type='radio' checked={input.value === 'off'} value='off' onChange={() => input.onChange('off')} /> <span className='title'>off</span> </label> </div> <p className='description'>{DESCRIPTION.ALLOW_MODIFYING}</p> </div> )} /> </div> <div className="input-block-container"> <Field name={`${name}.startTime`} component={InputField2} validate={validateTierStartDate(index)} errorStyle={inputErrorStyle} type="datetime-local" side="left" label={START_TIME} description={DESCRIPTION.START_TIME} /> <Field name={`${name}.endTime`} component={InputField2} validate={validateTierEndDate(index)} errorStyle={inputErrorStyle} type="datetime-local" side="right" label={END_TIME} description={DESCRIPTION.END_TIME} /> </div> <div className="input-block-container"> <Field name={`${name}.rate`} component={InputField2} validate={composeValidators( isPositive(), isInteger(), isLessOrEqualThan('Should not be greater than 1 quintillion (10^18)')('1e18') )} errorStyle={inputErrorStyle} type="text" side="left" label={RATE} description={DESCRIPTION.RATE} /> <Field name={`${name}.supply`} component={InputField2} validate={isPositive()} errorStyle={inputErrorStyle} type="text" side="right" label={SUPPLY} description={DESCRIPTION.SUPPLY} /> { /* * TODO: REVIEW. I'm not sure about this approach. * But it worked for me to keep the error messages properly updated for the minCap field. */ } <Field name="minCap" subscription={{}}> {({ input: { onChange } }) => ( <OnChange name={`${name}.supply`}> {() => { onChange(0) onChange(props.minCap) }} </OnChange> )} </Field> </div> </div> { props.tierStore.tiers[0].whitelistEnabled === 'yes' ? ( <div> <div className="section-title"> <p className="title">Whitelist</p> </div> <WhitelistInputBlock num={index} decimals={props.decimals} /> </div> ) : null } </div> ))} </div> ) }
packages/starter-scripts/fixtures/kitchensink/src/features/env/ShellEnvVariables.js
chungchiehlun/create-starter-app
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; export default () => ( <span id="feature-shell-env-variables"> {process.env.REACT_APP_SHELL_ENV_MESSAGE}. </span> );
app/javascript/mastodon/components/icon_with_badge.js
tootcafe/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, issueBadge, className }) => ( <i className='icon-with-badge'> <Icon id={id} fixedWidth className={className} /> {count > 0 && <i className='icon-with-badge__badge'>{formatNumber(count)}</i>} {issueBadge && <i className='icon-with-badge__issue-badge' />} </i> ); IconWithBadge.propTypes = { id: PropTypes.string.isRequired, count: PropTypes.number.isRequired, issueBadge: PropTypes.bool, className: PropTypes.string, }; export default IconWithBadge;
src/Header/index.js
yrezgui/napersona
import React from 'react'; export default class Header extends React.Component { constructor(props) { super(props); } generateLink(item, index) { if (item.newTab) { return <a key={index} href={item.url} target="_blank">{item.name}</a>; } else { return <a key={index} href={item.url}>{item.name}</a>; } } render() { return ( <header className="masthead"> <div className="container"> <a className="masthead-logo" href={this.props.baseUrl}> {this.props.fullName} </a> <nav className="masthead-nav no-print"> {this.props.links.map(this.generateLink)} </nav> </div> </header> ); } }
test/performance/comparisons/jquery-latest.js
marshall007/rethinkdb
/*! jQuery v1.7.2 jquery.com | jquery.org/license */ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+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(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},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(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.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(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.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(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={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,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[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","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.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 a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
src/components/FrenchToastQuestion.spec.js
raq929/react-french-toast
import chai from 'chai'; import cheerio from 'cheerio'; import AboutPage from './AboutPage'; import React from 'react'; import ReactDOMServer from 'react/lib/ReactDOMServer'; chai.should();
src/components/Loader.js
react-in-action/letters-social
import React from 'react'; /** * See https://www.npmjs.com/package/loaders.css for more info * @method Loader */ const Loader = () => ( <div className="loader"> <div className="ball-pulse-sync"> <div /> <div /> <div /> </div> </div> ); export default Loader;
src/files/header/Header.js
ipfs/webui
import React from 'react' import classNames from 'classnames' import { connect } from 'redux-bundler-react' import { withTranslation } from 'react-i18next' import { humanSize } from '../../lib/files' // Components import Breadcrumbs from '../breadcrumbs/Breadcrumbs' import FileInput from '../file-input/FileInput' import Button from '../../components/button/Button' // Icons import GlyphDots from '../../icons/GlyphDots' const BarOption = ({ children, text, isLink = false, className = '', ...etc }) => ( <div className={classNames(className, 'tc pa3', etc.onClick && 'pointer')} {...etc}> <span className='nowrap db f4 charcoal'>{children}</span> <span className={`nowrap db ttu f6 montserrat fw4 ${isLink ? 'link' : 'charcoal-muted'}`}>{text}</span> </div> ) // Tweak human-readable size format to be more compact const size = (s) => humanSize(s, { round: s >= 1073741824 ? 1 : 0, // show decimal > 1GiB spacer: '' }) class Header extends React.Component { handleContextMenu = (ev) => { const pos = this.dotsWrapper.getBoundingClientRect() this.props.handleContextMenu(ev, 'TOP', { ...this.props.files, // TODO: change to "pinning" and not "pinned" pinned: this.props.pins.includes(this.props.files.cid.toString()) }, pos) } handleBreadCrumbsContextMenu = (ev, breadcrumbsRef, file) => { const pos = breadcrumbsRef.getBoundingClientRect() this.props.handleContextMenu(ev, 'TOP', file, pos) } render () { const { currentDirectorySize, hasUpperDirectory, files, filesPathInfo, filesSize, onNavigate, repoSize, t } = this.props return ( <div className='db flex-l justify-between items-center'> <div className='mb3 overflow-hidden mr2'> <Breadcrumbs className="joyride-files-breadcrumbs" path={files ? files.path : '/404'} onClick={onNavigate} onContextMenuHandle={(...args) => this.handleBreadCrumbsContextMenu(...args)} onAddFiles={this.props.onAddFiles} onMove={this.props.onMove}/> </div> <div className='mb3 flex justify-between items-center bg-snow-muted joyride-files-add'> <BarOption title={t('filesDescription')} text={t('app:terms:files')}> { hasUpperDirectory ? ( <span> { size(currentDirectorySize) }<span className='f5 gray'>/{ size(filesSize) }</span> </span> ) : size(filesSize) } </BarOption> <BarOption title={t('allBlocksDescription')} text={t('allBlocks')}> { size(repoSize) } </BarOption> <div className='pa3'> <div className='ml-auto flex items-center'> { (files && files.type === 'directory' && filesPathInfo.isMfs) ? <FileInput onNewFolder={this.props.onNewFolder} onAddFiles={this.props.onAddFiles} onAddByPath={this.props.onAddByPath} onCliTutorMode={this.props.onCliTutorMode} /> : <div ref={el => { this.dotsWrapper = el }}> <Button bg='bg-navy' color='white' fill='fill-aqua' className='f6 relative flex justify-center items-center tc' minWidth='100px' disabled={!files || filesPathInfo.isRoot || files.type === 'unknown'} onClick={this.handleContextMenu}> <GlyphDots className='w1 mr2' /> { t('app:actions.more') } </Button> </div> } </div> </div> </div> </div> ) } } export default connect( 'selectPins', 'selectHasUpperDirectory', 'selectFilesSize', 'selectRepoSize', 'selectRepoNumObjects', 'selectFilesPathInfo', 'selectCurrentDirectorySize', withTranslation('files')(Header) )
tests/ExpandRow.spec.js
react-component/table
import React from 'react'; import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { resetWarned } from 'rc-util/lib/warning'; import { spyElementPrototype } from 'rc-util/lib/test/domHook'; import Table from '../src'; describe('Table.Expand', () => { const expandedRowRender = () => <p>extra data</p>; const sampleColumns = [ { title: 'Name', dataIndex: 'name', key: 'name' }, { title: 'Age', dataIndex: 'age', key: 'age' }, ]; const sampleData = [ { key: 0, name: 'Lucy', age: 27 }, { key: 1, name: 'Jack', age: 28 }, ]; const createTable = props => <Table columns={sampleColumns} data={sampleData} {...props} />; it('renders expand row correctly', () => { resetWarned(); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount(createTable({ expandedRowRender })); expect(wrapper.find('tbody tr')).toHaveLength(2); expect(errorSpy).toHaveBeenCalledWith( 'Warning: expanded related props have been moved into `expandable`.', ); errorSpy.mockRestore(); }); it('pass proper parameters to expandedRowRender', () => { const rowRender = jest.fn(() => <div>expanded row</div>); const expandableProps = props => ({ expandable: { expandedRowRender: rowRender, ...props } }); const wrapper = mount(createTable(expandableProps())); wrapper.setProps(expandableProps({ expandedRowKeys: [0] })); expect(rowRender).toHaveBeenLastCalledWith(sampleData[0], 0, 1, true); wrapper.setProps(expandableProps({ expandedRowKeys: [] })); expect(rowRender).toHaveBeenLastCalledWith(sampleData[0], 0, 1, false); }); it('renders tree row correctly', () => { const data = [ { key: 0, name: 'Lucy', age: 27, children: [{ key: 2, name: 'Jim', age: 1 }], }, { key: 1, name: 'Jack', age: 28 }, ]; const wrapper = mount(createTable({ data, expandable: { defaultExpandAllRows: true } })); expect(wrapper.find('tbody tr')).toHaveLength(3); expect(wrapper.render()).toMatchSnapshot(); }); it('renders tree row correctly with different children', () => { const data = [ { key: 0, name: 'Lucy', age: 27, children: [{ key: 2, name: 'Jim', age: 1 }], }, { key: 1, name: 'Jack', age: 28 }, { key: 2, name: 'Jack', age: 28, children: null }, { key: 3, name: 'Jack', age: 28, children: [] }, { key: 4, name: 'Jack', age: 28, children: undefined }, { key: 5, name: 'Jack', age: 28, children: false }, ]; const wrapper = mount(createTable({ data })); expect(wrapper.render()).toMatchSnapshot(); }); it('not use nest when children is invalidate', () => { const data = [ { key: 2, name: 'Jack', age: 28, children: null }, { key: 4, name: 'Jack', age: 28, children: undefined }, { key: 5, name: 'Jack', age: 28, children: false }, ]; const wrapper = mount(createTable({ data })); expect(wrapper.render()).toMatchSnapshot(); }); it('childrenColumnName', () => { const data = [ { key: 0, name: 'Lucy', age: 27, list: [{ key: 2, name: 'Jim', age: 1 }], }, { key: 1, name: 'Jack', age: 28 }, ]; const wrapper = mount( createTable({ data, expandable: { defaultExpandAllRows: true, childrenColumnName: 'list' } }), ); expect(wrapper.find('tbody tr')).toHaveLength(3); expect(wrapper.render()).toMatchSnapshot(); }); describe('renders fixed column correctly', () => { let domSpy; beforeAll(() => { domSpy = spyElementPrototype(HTMLDivElement, 'offsetWidth', { get: () => 1128, }); }); afterAll(() => { domSpy.mockRestore(); }); it('work', () => { const columns = [ { title: 'Name', dataIndex: 'name', key: 'name', fixed: true }, { title: 'Age', dataIndex: 'age', key: 'age' }, { title: 'Gender', dataIndex: 'gender', key: 'gender', fixed: 'right' }, ]; const data = [ { key: 0, name: 'Lucy', age: 27, gender: 'F' }, { key: 1, name: 'Jack', age: 28, gender: 'M' }, ]; const wrapper = mount( createTable({ columns, data, scroll: { x: 903 }, expandable: { expandedRowRender, defaultExpandAllRows: true }, }), ); act(() => { wrapper.find('ResizeObserver').first().props().onResize({ width: 1128 }); }); wrapper.update(); expect(wrapper.render()).toMatchSnapshot(); }); }); it('work in expandable fix', () => { const columns = [ { title: 'Name', dataIndex: 'name', key: 'name' }, { title: 'Age', dataIndex: 'age', key: 'age' }, { title: 'Gender', dataIndex: 'gender', key: 'gender' }, ]; const data = [ { key: 0, name: 'Lucy', age: 27, gender: 'F' }, { key: 1, name: 'Jack', age: 28, gender: 'M' }, ]; const wrapper = mount( createTable({ columns, data, scroll: { x: 903 }, expandable: { expandedRowRender, fixed: true }, }), ); const wrapper2 = mount( createTable({ columns, data, scroll: { x: 903 }, expandable: { expandedRowRender, fixed: true, expandIconColumnIndex: 3 }, }), ); expect(wrapper.render()).toMatchSnapshot(); expect(wrapper2.render()).toMatchSnapshot(); }); it('does not crash if scroll is not set', () => { const columns = [ { title: 'Name', dataIndex: 'name', key: 'name' }, { title: 'Age', dataIndex: 'age', key: 'age' }, { title: 'Gender', dataIndex: 'gender', key: 'gender' }, ]; const data = [ { key: 0, name: 'Lucy', age: 27, gender: 'F' }, { key: 1, name: 'Jack', age: 28, gender: 'M' }, ]; const wrapper = mount( createTable({ columns, data, scroll: {}, expandable: { expandedRowRender, fixed: true }, }), ); const wrapper2 = mount( createTable({ columns, data, expandable: { expandedRowRender, fixed: true }, }), ); expect(wrapper.render()).toMatchSnapshot(); expect(wrapper2.render()).toMatchSnapshot(); }); it('expandable fix not when expandIconColumnIndex', () => { const columns = [ { title: 'Name', dataIndex: 'name', key: 'name' }, { title: 'Age', dataIndex: 'age', key: 'age' }, { title: 'Gender', dataIndex: 'gender', key: 'gender' }, ]; const data = [ { key: 0, name: 'Lucy', age: 27, gender: 'F' }, { key: 1, name: 'Jack', age: 28, gender: 'M' }, ]; const wrapper = mount( createTable({ columns, data, scroll: { x: 903 }, expandable: { expandedRowRender, fixed: 'left', expandIconColumnIndex: 1 }, }), ); const wrapper2 = mount( createTable({ columns, data, scroll: { x: 903 }, expandable: { expandedRowRender, fixed: 'right', expandIconColumnIndex: 2 }, }), ); expect(wrapper.find('.rc-table-has-fix-left').length).toBe(0); expect(wrapper2.find('.rc-table-has-fix-right').length).toBe(0); }); describe('config expand column index', () => { it('not show EXPAND_COLUMN if expandable is false', () => { resetWarned(); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount( createTable({ columns: [...sampleColumns, Table.EXPAND_COLUMN], }), ); expect(wrapper.exists('.rc-table-row-expand-icon-cell')).toBeFalsy(); expect(errorSpy).toHaveBeenCalledWith( 'Warning: `expandable` is not config but there exist `EXPAND_COLUMN` in `columns`.', ); errorSpy.mockRestore(); }); it('renders expand icon to the specify column', () => { resetWarned(); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandIconColumnIndex: 1, }, }), ); expect( wrapper.find('tbody tr td').at(1).hasClass('rc-table-row-expand-icon-cell'), ).toBeTruthy(); expect(errorSpy).toHaveBeenCalledWith( 'Warning: `expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead.', ); errorSpy.mockRestore(); }); it('order with EXPAND_COLUMN', () => { const wrapper = mount( createTable({ columns: [...sampleColumns, Table.EXPAND_COLUMN], expandable: { expandedRowRender, }, }), ); expect( wrapper.find('tbody tr td').at(2).hasClass('rc-table-row-expand-icon-cell'), ).toBeTruthy(); }); it('de-duplicate of EXPAND_COLUMN', () => { resetWarned(); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount( createTable({ columns: [Table.EXPAND_COLUMN, ...sampleColumns, Table.EXPAND_COLUMN], expandable: { expandedRowRender, }, }), ); expect( wrapper.find('tbody tr td').at(0).hasClass('rc-table-row-expand-icon-cell'), ).toBeTruthy(); expect(wrapper.find('tbody tr').first().find('td')).toHaveLength(3); expect(errorSpy).toHaveBeenCalledWith( 'Warning: There exist more than one `EXPAND_COLUMN` in `columns`.', ); errorSpy.mockRestore(); }); }); describe('hide expandColumn', () => { // https://github.com/ant-design/ant-design/issues/24129 it('should not render expand icon column when expandIconColumnIndex is negative', () => { const wrapper = mount( createTable({ expandable: { expandedRowRender, expandIconColumnIndex: -1, }, }), ); expect(wrapper.find('.rc-table-row-expand-icon-cell').length).toBe(0); }); it('showExpandColumn = false', () => { const wrapper = mount( createTable({ expandable: { expandedRowRender, showExpandColumn: false, }, }), ); expect(wrapper.find('.rc-table-row-expand-icon-cell').length).toBe(0); }); }); it('renders a custom icon', () => { function CustomExpandIcon(props) { return ( <a className="expand-row-icon" onClick={e => props.onExpand(props.record, e)}> <i className="some-class" /> </a> ); } const wrapper = mount( createTable({ expandable: { expandedRowRender, expandIcon: ({ onExpand, record }) => ( <CustomExpandIcon onExpand={onExpand} record={record} /> ), }, }), ); expect(wrapper.find('a.expand-row-icon').length).toBeTruthy(); }); it('expand all rows by default', () => { const wrapper = mount( createTable({ expandedRowRender, defaultExpandAllRows: true, }), ); expect(wrapper.find('tbody tr')).toHaveLength(4); }); it('expand rows by defaultExpandedRowKeys', () => { const wrapper = mount( createTable({ expandable: { expandedRowRender, defaultExpandedRowKeys: [1], }, }), ); expect(wrapper.find('tbody tr')).toHaveLength(3); expect(wrapper.find('tbody tr').at(2).hasClass('rc-table-expanded-row')).toBeTruthy(); }); it('controlled by expandedRowKeys', () => { const wrapper = mount( createTable({ expandedRowRender, expandedRowKeys: [0], }), ); expect(wrapper.find('tbody tr')).toHaveLength(3); expect(wrapper.find('tbody tr').at(1).hasClass('rc-table-expanded-row')).toBeTruthy(); wrapper.setProps({ expandedRowKeys: [1] }); expect(wrapper.find('tbody tr')).toHaveLength(4); expect(wrapper.find('tbody tr').at(1).hasClass('rc-table-expanded-row')).toBeTruthy(); expect(wrapper.find('tbody tr').at(1).props().style.display).toEqual('none'); expect(wrapper.find('tbody tr').at(3).hasClass('rc-table-expanded-row')).toBeTruthy(); }); it('renders expend row class correctly', () => { const expandedRowClassName = jest.fn().mockReturnValue('expand-row-test-class-name'); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandedRowKeys: [0], expandedRowClassName, }, }), ); expect(wrapper.find('tbody tr').at(1).hasClass('expand-row-test-class-name')).toBeTruthy(); }); it('fires expand change event', () => { const onExpand = jest.fn(); const wrapper = mount( createTable({ expandable: { expandedRowRender, onExpand, }, }), ); wrapper.find('.rc-table-row-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(true, sampleData[0]); wrapper.find('.rc-table-row-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(false, sampleData[0]); }); it('fires onExpandedRowsChange event', () => { const onExpandedRowsChange = jest.fn(); const wrapper = mount( createTable({ expandedRowRender, onExpandedRowsChange, }), ); wrapper.find('.rc-table-row-expand-icon').first().simulate('click'); expect(onExpandedRowsChange).toHaveBeenCalledWith([0]); }); it('show icon if use `expandIcon` & `expandRowByClick`', () => { const wrapper = mount( createTable({ expandedRowRender, expandRowByClick: true, expandIcon: () => <span className="should-display" />, data: [{ key: 0, name: 'Lucy', age: 27, children: [{ key: 1, name: 'Jack', age: 28 }] }], }), ); expect(wrapper.find('.should-display').length).toBeTruthy(); }); it('expandRowByClick', () => { const onExpand = jest.fn(); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandRowByClick: true, onExpand, }, }), ); wrapper.find('tbody tr').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(true, sampleData[0]); wrapper.find('tbody tr').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(false, sampleData[0]); }); it('some row should not expandable', () => { const wrapper = mount( createTable({ expandable: { expandedRowRender, rowExpandable: ({ key }) => key === 1, }, }), ); expect( wrapper .find('tbody tr') .first() .find('.rc-table-row-expand-icon') .hasClass('rc-table-row-spaced'), ).toBeTruthy(); expect( wrapper .find('tbody tr') .last() .find('.rc-table-row-expand-icon') .hasClass('rc-table-row-collapsed'), ).toBeTruthy(); }); // https://github.com/ant-design/ant-design/issues/21788 it('`defaultExpandAllRows` with `childrenColumnName`', () => { const data = [ { key: 0, sub: [{ key: 1, sub: [{ key: 2 }] }], }, ]; const wrapper = mount( createTable({ data, childrenColumnName: 'sub', expandable: { defaultExpandAllRows: true } }), ); expect(wrapper.find('tbody tr')).toHaveLength(3); }); // https://github.com/ant-design/ant-design/issues/23894 it('should be collapsible when use `expandIcon` & `expandRowByClick`', () => { const data = [{ key: 0, name: 'Lucy', age: 27 }]; const onExpand = jest.fn(); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandRowByClick: true, onExpand, expandIcon: ({ onExpand: onIconExpand, record }) => ( <span className="custom-expand-icon" onClick={() => onIconExpand(record)} /> ), }, data, }), ); expect(wrapper.find('.rc-table-expanded-row').length).toBe(0); wrapper.find('.custom-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(true, data[0]); expect(onExpand).toHaveBeenCalledTimes(1); expect(wrapper.find('.rc-table-expanded-row').first().getDOMNode().style.display).toBe(''); wrapper.find('.custom-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(false, data[0]); expect(onExpand).toHaveBeenCalledTimes(2); expect(wrapper.find('.rc-table-expanded-row').first().getDOMNode().style.display).toBe('none'); }); // https://github.com/ant-design/ant-design/issues/23894 it('should be collapsible when `expandRowByClick` without custom `expandIcon`', () => { const data = [{ key: 0, name: 'Lucy', age: 27 }]; const onExpand = jest.fn(); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandRowByClick: true, onExpand, }, data, }), ); wrapper.find('.rc-table-row-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(true, data[0]); expect(onExpand).toHaveBeenCalledTimes(1); wrapper.find('.rc-table-row-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(false, data[0]); expect(onExpand).toHaveBeenCalledTimes(2); }); it('should be collapsible when `expandRowByClick` with custom `expandIcon` and event.stopPropagation', () => { const data = [{ key: 0, name: 'Lucy', age: 27 }]; const onExpand = jest.fn(); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandRowByClick: true, onExpand, expandIcon: ({ onExpand: onIconExpand, record }) => ( <span className="custom-expand-icon" onClick={e => { e.stopPropagation(); onIconExpand(record); }} /> ), }, data, }), ); wrapper.find('.custom-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(true, data[0]); expect(onExpand).toHaveBeenCalledTimes(1); wrapper.find('.custom-expand-icon').first().simulate('click'); expect(onExpand).toHaveBeenCalledWith(false, data[0]); expect(onExpand).toHaveBeenCalledTimes(2); }); it('support invalid expandIcon', () => { const data = [{ key: 0, name: 'Lucy', age: 27 }]; const onExpand = jest.fn(); const wrapper = mount( createTable({ expandable: { expandedRowRender, expandRowByClick: true, onExpand, expandIcon: () => null, }, data, }), ); expect(wrapper.find('.rc-table-expanded-row').length).toBe(0); }); it('warning for use `expandedRowRender` and nested table in the same time', () => { resetWarned(); const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); mount(createTable({ expandedRowRender, data: [{ children: [] }] })); expect(errorSpy).toHaveBeenCalledWith( 'Warning: `expandedRowRender` should not use with nested Table', ); errorSpy.mockRestore(); }); });
src/scripts/components/MainLayout/Nav.js
Joywok/Joywok-Mobility-Framework
import React from 'react'; import { Menu, Icon } from 'antd'; import { Link } from 'dva/router'; import navs from './../../../styles/Nav.css'; function Nav({ location }) { return ( <div className={navs.nav}> <img className={navs.nav} /> </div> ); } export default Nav;
icandevit/src/components/Home.js
yeli-buonya/icandevit.io
import React from 'react'; import { fadeInLeft, fadeInRight } from 'react-animations'; import Radium, { Style, StyleRoot } from 'radium'; import { bounce } from 'react-animations'; const styles = { fadeInLeft: { animation: 'x 2s', animationName: Radium.keyframes(fadeInLeft, 'fadeInLeft') }, fadeInRight: { animation: 'x 2s', animationName: Radium.keyframes(fadeInRight, 'fadeInRight') } } class Home extends React.Component { render() { return ( <div className='jumbotron'> <div className="intro w3-display-middle w3-margin-top w3-center"> <h1 style={styles.fadeInLeft} className="w3-xxlarge w3-text-white"> <span className="w3-padding w3-black w3-opacity-min"><b>My Journey Into Code</b></span> </h1> <p style={styles.fadeInRight} className="title w3-padding w3-black w3-opacity-min w3-text">From Novice Programmer to Web Developer</p> </div> </div> ) } } export default Radium(Home);
client/js/components/environments/Feedback.js
Code4HR/hrtb.us
import React from 'react'; import Radium from 'radium'; class Feedback extends React.Component { render() { return ( <pre>Feedback</pre> ); } } export default Feedback
src/components/Layout.js
AlexNarayanan/setlist-forecast
import React from 'react'; export default class Layout extends React.Component { render() { return ( <div className="app-container"> <header> <p> Here is a header VERSION 2</p> </header> <div className="app-content">{this.props.children}</div> <footer> <p> This is a footer </p> </footer> </div> ); } }
node_modules/react-icons/fa/mars-stroke-v.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const FaMarsStrokeV = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m21.8 14.4q4.8 0.5 8.1 4.2t3.3 8.5q0 3.8-1.9 6.9t-5.3 4.7-7.1 1.2q-3-0.3-5.5-2t-4.1-4.1-1.8-5.6q-0.2-3.5 1.2-6.5t4.2-5 6-2.3v-3h-3.5q-0.4 0-0.6-0.2t-0.2-0.5v-1.4q0-0.3 0.2-0.5t0.6-0.2h3.5v-3.7l-2 2q-0.2 0.2-0.5 0.2t-0.5-0.2l-1.1-1q-0.2-0.2-0.2-0.5t0.2-0.5l4.6-4.5q0.4-0.4 1-0.4t1 0.4l4.5 4.5q0.2 0.2 0.2 0.5t-0.2 0.5l-1.1 1q-0.2 0.2-0.4 0.2t-0.6-0.2l-2-2v3.7h3.6q0.3 0 0.5 0.2t0.2 0.5v1.4q0 0.3-0.2 0.5t-0.5 0.2h-3.6v3z m-1.4 22.7q4.1 0 7-2.9t3-7.1-3-7-7-3-7.1 3-2.9 7 2.9 7.1 7.1 2.9z"/></g> </Icon> ) export default FaMarsStrokeV
project-templates/reactfiber/externals/react-fiber/src/renderers/native/ReactNativeTagHandles.js
itsa-server/itsa-cli
/** * 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;
1l_React_ET_Lynda/Ex_Files_React_EssT/Ch07/07_01/finish/src/routes.js
yevheniyc/Autodidact
import React from 'react' import { Router, Route, hashHistory } from 'react-router' import Home from './components/ui/Home' import About from './components/ui/About' import MemberList from './components/ui/MemberList' import { Left, Right, Whoops404 } from './components' const routes = ( <Router history={hashHistory}> <Route path="/" component={Home} /> <Route path="/" component={Left}> <Route path="about" component={About} /> <Route path="members" component={MemberList} /> </Route> <Route path="*" component={Whoops404} /> </Router> ) export default routes
examples/todomvc-flux/js/components/MainSection.react.js
gdi2290/react
/** * Copyright 2013-2014 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. * * @jsx React.DOM */ var React = require('react'); var ReactPropTypes = React.PropTypes; var TodoActions = require('../actions/TodoActions'); var TodoItem = require('./TodoItem.react'); var MainSection = React.createClass({ propTypes: { allTodos: ReactPropTypes.object.isRequired, areAllComplete: ReactPropTypes.bool.isRequired }, /** * @return {object} */ render: function() { // This section should be hidden by default // and shown when there are todos. if (Object.keys(this.props.allTodos).length < 1) { return null; } var allTodos = this.props.allTodos; var todos = []; for (var key in allTodos) { todos.push(<TodoItem key={key} todo={allTodos[key]} />); } return ( <section id="main"> <input id="toggle-all" type="checkbox" onChange={this._onToggleCompleteAll} checked={this.props.areAllComplete ? 'checked' : ''} /> <label htmlFor="toggle-all">Mark all as complete</label> <ul id="todo-list">{todos}</ul> </section> ); }, /** * Event handler to mark all TODOs as complete */ _onToggleCompleteAll: function() { TodoActions.toggleCompleteAll(); } }); module.exports = MainSection;
src/components/Header.js
davendesai/twitchcast
import React, { Component } from 'react'; import '../styles/Header.css'; import github from '../../res/github.png'; export default class Header extends Component { render() { const GITHUB_URL = "http://github.com/davendesai/twitchcast"; return ( <div id="twitchcast-header"> <a href={ GITHUB_URL } > <img src={ github } alt="GitHub" /> </a> </div> ) } }
ajax/libs/rxjs/2.2.7/rx.lite.compat.js
timnew/cdnjs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. (function (window, undefined) { var freeExports = typeof exports == 'object' && exports, freeModule = typeof module == 'object' && module && module.exports == freeExports && module, freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal) { window = freeGlobal; } /** * @name Rx * @type Object */ var Rx = { Internals: {} }; // Defaults function noop() { } function identity(x) { return x; } var defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()); function defaultComparer(x, y) { return isEqual(x, y); } function defaultSubComparer(x, y) { return x - y; } function defaultKeySerializer(x) { return x.toString(); } function defaultError(err) { throw err; } // Errors var sequenceContainsNoElements = 'Sequence contains no elements.'; var argumentOutOfRange = 'Argument out of range'; var objectDisposed = 'Object has been disposed'; function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } } /** Used to determine if values are of the language type Object */ var objectTypes = { 'boolean': false, 'function': true, 'object': true, 'number': false, 'string': false, 'undefined': false }; /** `Object#toString` result shortcuts */ var argsClass = '[object Arguments]', arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', regexpClass = '[object RegExp]', stringClass = '[object String]'; var toString = Object.prototype.toString, hasOwnProperty = Object.prototype.hasOwnProperty, supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4 suportNodeClass; try { suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + '')); } catch(e) { suportNodeClass = true; } function isNode(value) { // IE < 9 presents DOM nodes as `Object` objects except they have `toString` // methods that are `typeof` "string" and still can coerce nodes to strings return typeof value.toString != 'function' && typeof (value + '') == 'string'; } function isArguments(value) { return (value && typeof value == 'object') ? toString.call(value) == argsClass : false; } // fallback for browsers that can't detect `arguments` objects by [[Class]] if (!supportsArgsClass) { isArguments = function(value) { return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false; }; } function isFunction(value) { return typeof value == 'function'; } // fallback for older versions of Chrome and Safari if (isFunction(/x/)) { isFunction = function(value) { return typeof value == 'function' && toString.call(value) == funcClass; }; } var isEqual = Rx.Internals.isEqual = function (x, y) { return deepEquals(x, y, [], []); }; /** @private * Used for deep comparison **/ function deepEquals(a, b, stackA, stackB) { var result; // exit early for identical values if (a === b) { // treat `+0` vs. `-0` as not equal return a !== 0 || (1 / a == 1 / b); } var type = typeof a, otherType = typeof b; // exit early for unlike primitive values if (a === a && !(a && objectTypes[type]) && !(b && objectTypes[otherType])) { return false; } // exit early for `null` and `undefined`, avoiding ES3's Function#call behavior // http://es5.github.io/#x15.3.4.4 if (a == null || b == null) { return a === b; } // compare [[Class]] names var className = toString.call(a), otherClass = toString.call(b); if (className == argsClass) { className = objectClass; } if (otherClass == argsClass) { otherClass = objectClass; } if (className != otherClass) { return false; } switch (className) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal return +a == +b; case numberClass: // treat `NaN` vs. `NaN` as equal return (a != +a) ? b != +b // but treat `+0` vs. `-0` as not equal : (a == 0 ? (1 / a == 1 / b) : a == +b); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal return a == String(b); } var isArr = className == arrayClass; if (!isArr) { // exit for functions and DOM nodes if (className != objectClass || (!suportNodeClass && (isNode(a) || isNode(b)))) { return false; } // in older versions of Opera, `arguments` objects have `Array` constructors var ctorA = !supportsArgsClass && isArguments(a) ? Object : a.constructor, ctorB = !supportsArgsClass && isArguments(b) ? Object : b.constructor; // non `Object` object instances with different constructors are not equal if (ctorA != ctorB && !( isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB )) { return false; } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) var length = stackA.length; while (length--) { if (stackA[length] == a) { return stackB[length] == b; } } var size = 0; result = true; // add `a` and `b` to the stack of traversed objects stackA.push(a); stackB.push(b); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { length = a.length; size = b.length; // compare lengths to determine if a deep comparison is necessary result = size == a.length; // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, value = b[size]; if (!(result = deepEquals(a[size], value, stackA, stackB))) { break; } } return result; } // deep compare each object for(var key in b) { if (hasOwnProperty.call(b, key)) { // count properties and deep compare each property value size++; return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], b[key], stackA, stackB)); } } if (result) { // ensure both objects have the same number of properties for (var key in a) { if (hasOwnProperty.call(a, key)) { // `size` will be `-1` if `a` has more properties than `b` return (result = --size > -1); } } } stackA.pop(); stackB.pop(); return result; } var slice = Array.prototype.slice; function argsOrArray(args, idx) { return args.length === 1 && Array.isArray(args[idx]) ? args[idx] : slice.call(args); } var hasProp = {}.hasOwnProperty; /** @private */ var inherits = this.inherits = Rx.Internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); }; /** @private */ var addProperties = Rx.Internals.addProperties = function (obj) { var sources = slice.call(arguments, 1); for (var i = 0, len = sources.length; i < len; i++) { var source = sources[i]; for (var prop in source) { obj[prop] = source[prop]; } } }; // Rx Utils var addRef = Rx.Internals.addRef = function (xs, r) { return new AnonymousObservable(function (observer) { return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); }); }; // Collection polyfills function arrayInitialize(count, factory) { var a = new Array(count); for (var i = 0; i < count; i++) { a[i] = factory(); } return a; } // Utilities if (!Function.prototype.bind) { Function.prototype.bind = function (that) { var target = this, args = slice.call(arguments, 1); var bound = function () { if (this instanceof bound) { function F() { } F.prototype = target.prototype; var self = new F(); var result = target.apply(self, args.concat(slice.call(arguments))); if (Object(result) === result) { return result; } return self; } else { return target.apply(that, args.concat(slice.call(arguments))); } }; return bound; }; } var boxedString = Object("a"), splitString = boxedString[0] != "a" || !(0 in boxedString); if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { var object = Object(this), self = splitString && {}.toString.call(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, thisp = arguments[1]; if ({}.toString.call(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self && !fun.call(thisp, self[i], i, object)) { return false; } } return true; }; } if (!Array.prototype.map) { Array.prototype.map = function map(fun /*, thisp*/) { var object = Object(this), self = splitString && {}.toString.call(this) == "[object String]" ? this.split("") : object, length = self.length >>> 0, result = Array(length), thisp = arguments[1]; if ({}.toString.call(fun) != "[object Function]") { throw new TypeError(fun + " is not a function"); } for (var i = 0; i < length; i++) { if (i in self) result[i] = fun.call(thisp, self[i], i, object); } return result; }; } if (!Array.prototype.filter) { Array.prototype.filter = function (predicate) { var results = [], item, t = new Object(this); for (var i = 0, len = t.length >>> 0; i < len; i++) { item = t[i]; if (i in t && predicate.call(arguments[1], item, i, t)) { results.push(item); } } return results; }; } if (!Array.isArray) { Array.isArray = function (arg) { return Object.prototype.toString.call(arg) == '[object Array]'; }; } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf(searchElement) { 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) { 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; }; } // Collections var IndexedItem = function (id, value) { this.id = id; this.value = value; }; IndexedItem.prototype.compareTo = function (other) { var c = this.value.compareTo(other.value); if (c === 0) { c = this.id - other.id; } return c; }; // Priority Queue for Scheduling var PriorityQueue = Rx.Internals.PriorityQueue = function (capacity) { this.items = new Array(capacity); this.length = 0; }; var priorityProto = PriorityQueue.prototype; priorityProto.isHigherPriority = function (left, right) { return this.items[left].compareTo(this.items[right]) < 0; }; priorityProto.percolate = function (index) { if (index >= this.length || index < 0) { return; } var parent = index - 1 >> 1; if (parent < 0 || parent === index) { return; } if (this.isHigherPriority(index, parent)) { var temp = this.items[index]; this.items[index] = this.items[parent]; this.items[parent] = temp; this.percolate(parent); } }; priorityProto.heapify = function (index) { if (index === undefined) { index = 0; } if (index >= this.length || index < 0) { return; } var left = 2 * index + 1, right = 2 * index + 2, first = index; if (left < this.length && this.isHigherPriority(left, first)) { first = left; } if (right < this.length && this.isHigherPriority(right, first)) { first = right; } if (first !== index) { var temp = this.items[index]; this.items[index] = this.items[first]; this.items[first] = temp; this.heapify(first); } }; priorityProto.peek = function () { return this.items[0].value; }; priorityProto.removeAt = function (index) { this.items[index] = this.items[--this.length]; delete this.items[this.length]; this.heapify(); }; priorityProto.dequeue = function () { var result = this.peek(); this.removeAt(0); return result; }; priorityProto.enqueue = function (item) { var index = this.length++; this.items[index] = new IndexedItem(PriorityQueue.count++, item); this.percolate(index); }; priorityProto.remove = function (item) { for (var i = 0; i < this.length; i++) { if (this.items[i].value === item) { this.removeAt(i); return true; } } return false; }; PriorityQueue.count = 0; /** * Represents a group of disposable resources that are disposed together. * @constructor */ var CompositeDisposable = Rx.CompositeDisposable = function () { this.disposables = argsOrArray(arguments, 0); this.isDisposed = false; this.length = this.disposables.length; }; var CompositeDisposablePrototype = CompositeDisposable.prototype; /** * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. * @param {Mixed} item Disposable to add. */ CompositeDisposablePrototype.add = function (item) { if (this.isDisposed) { item.dispose(); } else { this.disposables.push(item); this.length++; } }; /** * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. * @param {Mixed} item Disposable to remove. * @returns {Boolean} true if found; false otherwise. */ CompositeDisposablePrototype.remove = function (item) { var shouldDispose = false; if (!this.isDisposed) { var idx = this.disposables.indexOf(item); if (idx !== -1) { shouldDispose = true; this.disposables.splice(idx, 1); this.length--; item.dispose(); } } return shouldDispose; }; /** * Disposes all disposables in the group and removes them from the group. */ CompositeDisposablePrototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } } }; /** * Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable. */ CompositeDisposablePrototype.clear = function () { var currentDisposables = this.disposables.slice(0); this.disposables = []; this.length = 0; for (var i = 0, len = currentDisposables.length; i < len; i++) { currentDisposables[i].dispose(); } }; /** * Determines whether the CompositeDisposable contains a specific disposable. * @param {Mixed} item Disposable to search for. * @returns {Boolean} true if the disposable was found; otherwise, false. */ CompositeDisposablePrototype.contains = function (item) { return this.disposables.indexOf(item) !== -1; }; /** * Converts the existing CompositeDisposable to an array of disposables * @returns {Array} An array of disposable objects. */ CompositeDisposablePrototype.toArray = function () { return this.disposables.slice(0); }; /** * Provides a set of static methods for creating Disposables. * * @constructor * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. */ var Disposable = Rx.Disposable = function (action) { this.isDisposed = false; this.action = action || noop; }; /** Performs the task of cleaning up resources. */ Disposable.prototype.dispose = function () { if (!this.isDisposed) { this.action(); this.isDisposed = true; } }; /** * Creates a disposable object that invokes the specified action when disposed. * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. * @return {Disposable} The disposable object that runs the given action upon disposal. */ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; /** * Gets the disposable that does nothing when disposed. */ var disposableEmpty = Disposable.empty = { dispose: noop }; /** * Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. * @constructor */ var BooleanDisposable = Rx.BooleanDisposable = function () { this.isDisposed = false; this.current = null; }; // Set up aliases Rx.SingleAssignmentDisposable = Rx.SerialDisposable = BooleanDisposable; var booleanDisposablePrototype = BooleanDisposable.prototype; var SingleAssignmentDisposable = BooleanDisposable, SerialDisposable = BooleanDisposable; /** * Gets the underlying disposable. * @return The underlying disposable. */ booleanDisposablePrototype.getDisposable = function () { return this.current; }; /** * Sets the underlying disposable. * @param {Disposable} value The new underlying disposable. */ booleanDisposablePrototype.setDisposable = function (value) { var shouldDispose = this.isDisposed, old; if (!shouldDispose) { old = this.current; this.current = value; } if (old) { old.dispose(); } if (shouldDispose && value) { value.dispose(); } }; /* @private */ booleanDisposablePrototype.disposable = function (value) { if (!value) { return this.getDisposable(); } else { this.setDisposable(value); } }; /** * Disposes the underlying disposable as well as all future replacements. */ booleanDisposablePrototype.dispose = function () { var old; if (!this.isDisposed) { this.isDisposed = true; old = this.current; this.current = null; } if (old) { old.dispose(); } }; /** * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. */ var RefCountDisposable = Rx.RefCountDisposable = (function () { function InnerDisposable(disposable) { this.disposable = disposable; this.disposable.count++; this.isInnerDisposed = false; } InnerDisposable.prototype.dispose = function () { if (!this.disposable.isDisposed) { if (!this.isInnerDisposed) { this.isInnerDisposed = true; this.disposable.count--; if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { this.disposable.isDisposed = true; this.disposable.underlyingDisposable.dispose(); } } } }; /** * Initializes a new instance of the RefCountDisposable with the specified disposable. * @constructor * @param {Disposable} disposable Underlying disposable. */ function RefCountDisposable(disposable) { this.underlyingDisposable = disposable; this.isDisposed = false; this.isPrimaryDisposed = false; this.count = 0; } /** * Disposes the underlying disposable only when all dependent disposables have been disposed */ RefCountDisposable.prototype.dispose = function () { if (!this.isDisposed) { if (!this.isPrimaryDisposed) { this.isPrimaryDisposed = true; if (this.count === 0) { this.isDisposed = true; this.underlyingDisposable.dispose(); } } } }; /** * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. */ RefCountDisposable.prototype.getDisposable = function () { return this.isDisposed ? disposableEmpty : new InnerDisposable(this); }; return RefCountDisposable; })(); var ScheduledItem = Rx.Internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { this.scheduler = scheduler; this.state = state; this.action = action; this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); } ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); }; ScheduledItem.prototype.compareTo = function (other) { return this.comparer(this.dueTime, other.dueTime); }; ScheduledItem.prototype.isCancelled = function () { return this.disposable.isDisposed; }; ScheduledItem.prototype.invokeCore = function () { return this.action(this.scheduler, this.state); }; /** Provides a set of static properties to access commonly used schedulers. */ var Scheduler = Rx.Scheduler = (function () { /** * @constructor * @private */ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { this.now = now; this._schedule = schedule; this._scheduleRelative = scheduleRelative; this._scheduleAbsolute = scheduleAbsolute; } function invokeRecImmediate(scheduler, pair) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2) { var isAdded = false, isDone = false, d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeRecDate(scheduler, pair, method) { var state = pair.first, action = pair.second, group = new CompositeDisposable(), recursiveAction = function (state1) { action(state1, function (state2, dueTime1) { var isAdded = false, isDone = false, d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) { if (isAdded) { group.remove(d); } else { isDone = true; } recursiveAction(state3); return disposableEmpty; }); if (!isDone) { group.add(d); isAdded = true; } }); }; recursiveAction(state); return group; } function invokeAction(scheduler, action) { action(); return disposableEmpty; } var schedulerProto = Scheduler.prototype; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodic = function (period, action) { return this.schedulePeriodicWithState(null, period, function () { action(); }); }; /** * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. * @param {Mixed} state Initial state passed to the action upon the first iteration. * @param {Number} period Period for running the work periodically. * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ schedulerProto.schedulePeriodicWithState = function (state, period, action) { var s = state, id = window.setInterval(function () { s = action(s); }, period); return disposableCreate(function () { window.clearInterval(id); }); }; /** * Schedules an action to be executed. * @param {Function} action Action to execute. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.schedule = function (action) { return this._schedule(action, invokeAction); }; /** * Schedules an action to be executed. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithState = function (state, action) { return this._schedule(state, action); }; /** * Schedules an action to be executed after the specified relative due time. * @param {Function} action Action to execute. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelative = function (dueTime, action) { return this._scheduleRelative(action, dueTime, invokeAction); }; /** * Schedules an action to be executed after dueTime. * @param state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number} dueTime Relative time after which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative(state, dueTime, action); }; /** * Schedules an action to be executed at the specified absolute due time. * @param {Function} action Action to execute. * @param {Number} dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsolute = function (dueTime, action) { return this._scheduleAbsolute(action, dueTime, invokeAction); }; /** * Schedules an action to be executed at dueTime. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to be executed. * @param {Number}dueTime Absolute time at which to execute the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute(state, dueTime, action); }; /** * Schedules an action to be executed recursively. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursive = function (action) { return this.scheduleRecursiveWithState(action, function (_action, self) { _action(function () { self(_action); }); }); }; /** * Schedules an action to be executed recursively. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithState = function (state, action) { return this.scheduleWithState({ first: state, second: action }, function (s, p) { return invokeRecImmediate(s, p); }); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { return this.scheduleRecursiveWithRelativeAndState(action, dueTime, function (_action, self) { _action(function (dt) { self(_action, dt); }); }); }; /** * Schedules an action to be executed recursively after a specified relative due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Relative time after which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, function (_action, self) { _action(function (dt) { self(_action, dt); }); }); }; /** * Schedules an action to be executed recursively at a specified absolute due time. * @param {Mixed} state State passed to the action to be executed. * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. * @param {Number}dueTime Absolute time at which to execute the action for the first time. * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) { return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); }); }; /** Gets the current time according to the local machine's system clock. */ Scheduler.now = defaultNow; /** * Normalizes the specified TimeSpan value to a positive value. * @param {Number} timeSpan The time span value to normalize. * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 */ Scheduler.normalize = function (timeSpan) { if (timeSpan < 0) { timeSpan = 0; } return timeSpan; }; return Scheduler; }()); var normalizeTime = Scheduler.normalize; /** * Gets a scheduler that schedules work as soon as possible on the current thread. */ var currentThreadScheduler = Scheduler.currentThread = Scheduler.immediate = (function () { var queue; function Trampoline() { queue = new PriorityQueue(4); } Trampoline.prototype.dispose = function () { queue = null; }; Trampoline.prototype.run = function () { var item; while (queue.length > 0) { item = queue.dequeue(); if (!item.isCancelled()) { while (item.dueTime - Scheduler.now() > 0) { } if (!item.isCancelled()) { item.invoke(); } } } }; function scheduleNow(state, action) { return this.scheduleWithRelativeAndState(state, 0, action); } function scheduleRelative(state, dueTime, action) { var dt = this.now() + Scheduler.normalize(dueTime), si = new ScheduledItem(this, state, action, dt), t; if (!queue) { t = new Trampoline(); try { queue.enqueue(si); t.run(); } catch (e) { throw e; } finally { t.dispose(); } } else { queue.enqueue(si); } return si.disposable; } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); currentScheduler.scheduleRequired = function () { return queue === null; }; currentScheduler.ensureTrampoline = function (action) { if (queue === null) { return this.schedule(action); } else { return action(); } }; return currentScheduler; }()); var immediateScheduler = currentThreadScheduler; var SchedulePeriodicRecursive = Rx.Internals.SchedulePeriodicRecursive = (function () { function tick(command, recurse) { recurse(0, this._period); try { this._state = this._action(this._state); } catch (e) { this._cancel.dispose(); throw e; } } function SchedulePeriodicRecursive(scheduler, state, period, action) { this._scheduler = scheduler; this._state = state; this._period = period; this._action = action; } SchedulePeriodicRecursive.prototype.start = function () { var d = new SingleAssignmentDisposable(); this._cancel = d; d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); return d; }; return SchedulePeriodicRecursive; }()); var scheduleMethod, clearMethod = noop; (function () { function postMessageSupported () { // Ensure not in a worker if (!window.postMessage || window.importScripts) { return false; } var isAsync = false, oldHandler = window.onmessage; // Test for async window.onmessage = function () { isAsync = true; }; window.postMessage('','*'); window.onmessage = oldHandler; return isAsync; } // Check for setImmediate first for Node v0.11+ if (typeof window.setImmediate === 'function') { scheduleMethod = window.setImmediate; clearMethod = clearImmediate; } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { scheduleMethod = process.nextTick; } else if (postMessageSupported()) { var MSG_PREFIX = 'ms.rx.schedule' + Math.random(), tasks = {}, taskId = 0; function onGlobalPostMessage(event) { // Only if we're a match to avoid any other global events if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { var handleId = event.data.substring(MSG_PREFIX.length), action = tasks[handleId]; action(); delete tasks[handleId]; } } if (window.addEventListener) { window.addEventListener('message', onGlobalPostMessage, false); } else { window.attachEvent('onmessage', onGlobalPostMessage, false); } scheduleMethod = function (action) { var currentId = taskId++; tasks[currentId] = action; window.postMessage(MSG_PREFIX + currentId, '*'); }; } else if (!!window.MessageChannel) { var channel = new window.MessageChannel(), channelTasks = {}, channelTaskId = 0; channel.port1.onmessage = function (event) { var id = event.data, action = channelTasks[id]; action(); delete channelTasks[id]; }; scheduleMethod = function (action) { var id = channelTaskId++; channelTasks[id] = action; channel.port2.postMessage(id); }; } else if ('document' in window && 'onreadystatechange' in window.document.createElement('script')) { scheduleMethod = function (action) { var scriptElement = window.document.createElement('script'); scriptElement.onreadystatechange = function () { action(); scriptElement.onreadystatechange = null; scriptElement.parentNode.removeChild(scriptElement); scriptElement = null; }; window.document.documentElement.appendChild(scriptElement); }; } else { scheduleMethod = function (action) { return window.setTimeout(action, 0); }; clearMethod = window.clearTimeout; } }()); /** * Gets a scheduler that schedules work via a timed callback based upon platform. */ var timeoutScheduler = Scheduler.timeout = (function () { function scheduleNow(state, action) { var scheduler = this, disposable = new SingleAssignmentDisposable(); var id = scheduleMethod(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }); return new CompositeDisposable(disposable, disposableCreate(function () { clearMethod(id); })); } function scheduleRelative(state, dueTime, action) { var scheduler = this, dt = Scheduler.normalize(dueTime); if (dt === 0) { return scheduler.scheduleWithState(state, action); } var disposable = new SingleAssignmentDisposable(); var id = window.setTimeout(function () { if (!disposable.isDisposed) { disposable.setDisposable(action(scheduler, state)); } }, dt); return new CompositeDisposable(disposable, disposableCreate(function () { window.clearTimeout(id); })); } function scheduleAbsolute(state, dueTime, action) { return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); } return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); })(); /** * Represents a notification to an observer. */ var Notification = Rx.Notification = (function () { function Notification(kind, hasValue) { this.hasValue = hasValue == null ? false : hasValue; this.kind = kind; } var NotificationPrototype = Notification.prototype; /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. * * @memberOf Notification * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. * @param {Function} onError Delegate to invoke for an OnError notification. * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ NotificationPrototype.accept = function (observerOrOnNext, onError, onCompleted) { if (arguments.length === 1 && typeof observerOrOnNext === 'object') { return this._acceptObservable(observerOrOnNext); } return this._accept(observerOrOnNext, onError, onCompleted); }; /** * Returns an observable sequence with a single notification. * * @memberOf Notification * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. */ NotificationPrototype.toObservable = function (scheduler) { var notification = this; scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { notification._acceptObservable(observer); if (notification.kind === 'N') { observer.onCompleted(); } }); }); }; return Notification; })(); /** * Creates an object that represents an OnNext notification to an observer. * @param {Any} value The value contained in the notification. * @returns {Notification} The OnNext notification containing the value. */ var notificationCreateOnNext = Notification.createOnNext = (function () { function _accept (onNext) { return onNext(this.value); } function _acceptObservable(observer) { return observer.onNext(this.value); } function toString () { return 'OnNext(' + this.value + ')'; } return function (value) { var notification = new Notification('N', true); notification.value = value; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnError notification to an observer. * @param {Any} error The exception contained in the notification. * @returns {Notification} The OnError notification containing the exception. */ var notificationCreateOnError = Notification.createOnError = (function () { function _accept (onNext, onError) { return onError(this.exception); } function _acceptObservable(observer) { return observer.onError(this.exception); } function toString () { return 'OnError(' + this.exception + ')'; } return function (exception) { var notification = new Notification('E'); notification.exception = exception; notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * Creates an object that represents an OnCompleted notification to an observer. * @returns {Notification} The OnCompleted notification. */ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { function _accept (onNext, onError, onCompleted) { return onCompleted(); } function _acceptObservable(observer) { return observer.onCompleted(); } function toString () { return 'OnCompleted()'; } return function () { var notification = new Notification('C'); notification._accept = _accept; notification._acceptObservable = _acceptObservable; notification.toString = toString; return notification; }; }()); /** * @constructor * @private */ var Enumerator = Rx.Internals.Enumerator = function (moveNext, getCurrent, dispose) { this.moveNext = moveNext; this.getCurrent = getCurrent; this.dispose = dispose; }; /** * @static * @memberOf Enumerator * @private */ var enumeratorCreate = Enumerator.create = function (moveNext, getCurrent, dispose) { var done = false; dispose || (dispose = noop); return new Enumerator(function () { if (done) { return false; } var result = moveNext(); if (!result) { done = true; dispose(); } return result; }, function () { return getCurrent(); }, function () { if (!done) { dispose(); done = true; } }); }; /** @private */ var Enumerable = Rx.Internals.Enumerable = (function () { /** * @constructor * @private */ function Enumerable(getEnumerator) { this.getEnumerator = getEnumerator; } /** * @private * @memberOf Enumerable# */ Enumerable.prototype.concat = function () { var sources = this; return new AnonymousObservable(function (observer) { var e = sources.getEnumerator(), isDisposed = false, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, ex, hasNext = false; if (!isDisposed) { try { hasNext = e.moveNext(); if (hasNext) { current = e.getCurrent(); } else { e.dispose(); } } catch (exception) { ex = exception; e.dispose(); } } else { return; } if (ex) { observer.onError(ex); return; } if (!hasNext) { observer.onCompleted(); return; } var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe( observer.onNext.bind(observer), observer.onError.bind(observer), function () { self(); }) ); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; e.dispose(); })); }); }; /** * @private * @memberOf Enumerable# */ Enumerable.prototype.catchException = function () { var sources = this; return new AnonymousObservable(function (observer) { var e = sources.getEnumerator(), isDisposed = false, lastException; var subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursive(function (self) { var current, ex, hasNext; hasNext = false; if (!isDisposed) { try { hasNext = e.moveNext(); if (hasNext) { current = e.getCurrent(); } } catch (exception) { ex = exception; } } else { return; } if (ex) { observer.onError(ex); return; } if (!hasNext) { if (lastException) { observer.onError(lastException); } else { observer.onCompleted(); } return; } var d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(current.subscribe( observer.onNext.bind(observer), function (exn) { lastException = exn; self(); }, observer.onCompleted.bind(observer))); }); return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { isDisposed = true; })); }); }; return Enumerable; }()); /** * @static * @private * @memberOf Enumerable */ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { if (repeatCount === undefined) { repeatCount = -1; } return new Enumerable(function () { var current, left = repeatCount; return enumeratorCreate(function () { if (left === 0) { return false; } if (left > 0) { left--; } current = value; return true; }, function () { return current; }); }); }; /** * @static * @private * @memberOf Enumerable */ var enumerableFor = Enumerable.forEach = function (source, selector) { selector || (selector = identity); return new Enumerable(function () { var current, index = -1; return enumeratorCreate( function () { if (++index < source.length) { current = selector(source[index], index); return true; } return false; }, function () { return current; } ); }); }; /** * Supports push-style iteration over an observable sequence. */ var Observer = Rx.Observer = function () { }; /** * Creates a notification callback from an observer. * * @param observer Observer object. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this)); }; /** * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. * * @static * @memberOf Observer * @param {Function} [onNext] Observer's OnNext action implementation. * @param {Function} [onError] Observer's OnError action implementation. * @param {Function} [onCompleted] Observer's OnCompleted action implementation. * @returns {Observer} The observer object implemented using the given actions. */ var observerCreate = Observer.create = function (onNext, onError, onCompleted) { onNext || (onNext = noop); onError || (onError = defaultError); onCompleted || (onCompleted = noop); return new AnonymousObserver(onNext, onError, onCompleted); }; /** * Creates an observer from a notification callback. * * @static * @memberOf Observer * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler) { return new AnonymousObserver(function (x) { return handler(notificationCreateOnNext(x)); }, function (exception) { return handler(notificationCreateOnError(exception)); }, function () { return handler(notificationCreateOnCompleted()); }); }; /** * Abstract base class for implementations of the Observer class. * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. */ var AbstractObserver = Rx.Internals.AbstractObserver = (function (_super) { inherits(AbstractObserver, _super); /** * Creates a new observer in a non-stopped state. * * @constructor */ function AbstractObserver() { this.isStopped = false; _super.call(this); } /** * Notifies the observer of a new element in the sequence. * * @memberOf AbstractObserver * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { if (!this.isStopped) { this.next(value); } }; /** * Notifies the observer that an exception has occurred. * * @memberOf AbstractObserver * @param {Any} error The error that has occurred. */ AbstractObserver.prototype.onError = function (error) { if (!this.isStopped) { this.isStopped = true; this.error(error); } }; /** * Notifies the observer of the end of the sequence. */ AbstractObserver.prototype.onCompleted = function () { if (!this.isStopped) { this.isStopped = true; this.completed(); } }; /** * Disposes the observer, causing it to transition to the stopped state. */ AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { this.isStopped = true; this.error(e); return true; } return false; }; return AbstractObserver; }(Observer)); /** * Class to create an Observer instance from delegate-based implementations of the on* methods. */ var AnonymousObserver = Rx.AnonymousObserver = (function (_super) { inherits(AnonymousObserver, _super); /** * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. * * @constructor * @param {Any} onNext Observer's OnNext action implementation. * @param {Any} onError Observer's OnError action implementation. * @param {Any} onCompleted Observer's OnCompleted action implementation. */ function AnonymousObserver(onNext, onError, onCompleted) { _super.call(this); this._onNext = onNext; this._onError = onError; this._onCompleted = onCompleted; } /** * Calls the onNext action. * * @memberOf AnonymousObserver * @param {Any} value Next element in the sequence. */ AnonymousObserver.prototype.next = function (value) { this._onNext(value); }; /** * Calls the onError action. * * @memberOf AnonymousObserver * @param {Any{ error The error that has occurred. */ AnonymousObserver.prototype.error = function (exception) { this._onError(exception); }; /** * Calls the onCompleted action. * * @memberOf AnonymousObserver */ AnonymousObserver.prototype.completed = function () { this._onCompleted(); }; return AnonymousObserver; }(AbstractObserver)); var observableProto; /** * Represents a push-style collection. */ var Observable = Rx.Observable = (function () { /** * @constructor * @private */ function Observable(subscribe) { this._subscribe = subscribe; } observableProto = Observable.prototype; observableProto.finalValue = function () { var source = this; return new AnonymousObservable(function (observer) { var hasValue = false, value; return source.subscribe(function (x) { hasValue = true; value = x; }, observer.onError.bind(observer), function () { if (!hasValue) { observer.onError(new Error(sequenceContainsNoElements)); } else { observer.onNext(value); observer.onCompleted(); } }); }); }; /** * Subscribes an observer to the observable sequence. * * @example * 1 - source.subscribe(); * 2 - source.subscribe(observer); * 3 - source.subscribe(function (x) { console.log(x); }); * 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }); * 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); }); * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { var subscriber; if (typeof observerOrOnNext === 'object') { subscriber = observerOrOnNext; } else { subscriber = observerCreate(observerOrOnNext, onError, onCompleted); } return this._subscribe(subscriber); }; /** * Creates a list from an observable sequence. * * @memberOf Observable * @returns An observable sequence containing a single element with a list containing all the elements of the source sequence. */ observableProto.toArray = function () { function accumulator(list, i) { var newList = list.slice(0); newList.push(i); return newList; } return this.scan([], accumulator).startWith([]).finalValue(); }; return Observable; })(); /** @private */ var ScheduledObserver = Rx.Internals.ScheduledObserver = (function (_super) { inherits(ScheduledObserver, _super); function ScheduledObserver(scheduler, observer) { _super.call(this); this.scheduler = scheduler; this.observer = observer; this.isAcquired = false; this.hasFaulted = false; this.queue = []; this.disposable = new SerialDisposable(); } /** @private */ ScheduledObserver.prototype.next = function (value) { var self = this; this.queue.push(function () { self.observer.onNext(value); }); }; /** @private */ ScheduledObserver.prototype.error = function (exception) { var self = this; this.queue.push(function () { self.observer.onError(exception); }); }; /** @private */ ScheduledObserver.prototype.completed = function () { var self = this; this.queue.push(function () { self.observer.onCompleted(); }); }; /** @private */ ScheduledObserver.prototype.ensureActive = function () { var isOwner = false, parent = this; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); } else { parent.isAcquired = false; return; } try { work(); } catch (ex) { parent.queue = []; parent.hasFaulted = true; throw ex; } self(); })); } }; /** @private */ ScheduledObserver.prototype.dispose = function () { _super.prototype.dispose.call(this); this.disposable.dispose(); }; return ScheduledObserver; }(AbstractObserver)); /** * Creates an observable sequence from a specified subscribe method implementation. * * @example * var res = Rx.Observable.create(function (observer) { return function () { } ); * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); * var res = Rx.Observable.create(function (observer) { } ); * * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ Observable.create = Observable.createWithDisposable = function (subscribe) { return new AnonymousObservable(subscribe); }; /** * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. * * @example * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence. * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. */ var observableDefer = Observable.defer = function (observableFactory) { return new AnonymousObservable(function (observer) { var result; try { result = observableFactory(); } catch (e) { return observableThrow(e).subscribe(observer); } return result.subscribe(observer); }); }; /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * * @example * var res = Rx.Observable.empty(); * var res = Rx.Observable.empty(Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to send the termination call on. * @returns {Observable} An observable sequence with no elements. */ var observableEmpty = Observable.empty = function (scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onCompleted(); }); }); }; /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * * @example * var res = Rx.Observable.fromArray([1,2,3]); * var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout); * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. */ var observableFromArray = Observable.fromArray = function (array, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var count = 0; return scheduler.scheduleRecursive(function (self) { if (count < array.length) { observer.onNext(array[count++]); self(); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { var first = true, state = initialState; return scheduler.scheduleRecursive(function (self) { var hasResult, result; try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); } } catch (exception) { observer.onError(exception); return; } if (hasResult) { observer.onNext(result); self(); } else { observer.onCompleted(); } }); }); }; /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { return new AnonymousObservable(function () { return disposableEmpty; }); }; /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.range(0, 10); * var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout); * @param {Number} start The value of the first integer in the sequence. * @param {Number} count The number of sequential integers to generate. * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. */ Observable.range = function (start, count, scheduler) { scheduler || (scheduler = currentThreadScheduler); return new AnonymousObservable(function (observer) { return scheduler.scheduleRecursiveWithState(0, function (i, self) { if (i < count) { observer.onNext(start + i); self(i + 1); } else { observer.onCompleted(); } }); }); }; /** * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.repeat(42); * var res = Rx.Observable.repeat(42, 4); * 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout); * 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout); * @param {Mixed} value Element to repeat. * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence that repeats the given element the specified number of times. */ Observable.repeat = function (value, repeatCount, scheduler) { scheduler || (scheduler = currentThreadScheduler); if (repeatCount == null) { repeatCount = -1; } return observableReturn(value, scheduler).repeat(repeatCount); }; /** * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. * There is an alias called 'returnValue' for browsers <IE9. * * @example * var res = Rx.Observable.return(42); * var res = Rx.Observable.return(42, Rx.Scheduler.timeout); * @param {Mixed} value Single element in the resulting observable sequence. * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ var observableReturn = Observable['return'] = Observable.returnValue = function (value, scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onNext(value); observer.onCompleted(); }); }); }; /** * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message. * There is an alias to this method called 'throwException' for browsers <IE9. * * @example * var res = Rx.Observable.throwException(new Error('Error')); * var res = Rx.Observable.throwException(new Error('Error'), Rx.Scheduler.timeout); * @param {Mixed} exception An object used for the sequence's termination. * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) { scheduler || (scheduler = immediateScheduler); return new AnonymousObservable(function (observer) { return scheduler.schedule(function () { observer.onError(exception); }); }); }; function observableCatchHandler(source, handler) { return new AnonymousObservable(function (observer) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) { var d, result; try { result = handler(exception); } catch (ex) { observer.onError(ex); return; } d = new SingleAssignmentDisposable(); subscription.setDisposable(d); d.setDisposable(result.subscribe(observer)); }, observer.onCompleted.bind(observer))); return subscription; }); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * @example * 1 - xs.catchException(ys) * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) { if (typeof handlerOrSecond === 'function') { return observableCatchHandler(this, handlerOrSecond); } return observableCatch([this, handlerOrSecond]); }; /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. * * @example * 1 - res = Rx.Observable.catchException(xs, ys, zs); * 2 - res = Rx.Observable.catchException([xs, ys, zs]); * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ var observableCatch = Observable.catchException = Observable['catch'] = function () { var items = argsOrArray(arguments, 0); return enumerableFor(items).catchException(); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. * This can be in the form of an argument list of observables or an array. * * @example * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.combineLatest = function () { var args = slice.call(arguments); if (Array.isArray(args[0])) { args[0].unshift(this); } else { args.unshift(this); } return combineLatest.apply(this, args); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. * * @example * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; }); * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; }); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ var combineLatest = Observable.combineLatest = function () { var args = slice.call(arguments), resultSelector = args.pop(); if (Array.isArray(args[0])) { args = args[0]; } return new AnonymousObservable(function (observer) { var falseFactory = function () { return false; }, n = args.length, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), values = new Array(n); function next(i) { var res; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { try { res = resultSelector.apply(null, values); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } } function done (i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(args[i].subscribe(function (x) { values[i] = x; next(i); }, observer.onError.bind(observer), function () { done(i); })); }(idx)); } return new CompositeDisposable(subscriptions); }); }; /** * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate. * * @example * 1 - concatenated = xs.concat(ys, zs); * 2 - concatenated = xs.concat([ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ observableProto.concat = function () { var items = slice.call(arguments, 0); items.unshift(this); return observableConcat.apply(this, items); }; /** * Concatenates all the observable sequences. * * @example * 1 - res = Rx.Observable.concat(xs, ys, zs); * 2 - res = Rx.Observable.concat([xs, ys, zs]); * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order. */ var observableConcat = Observable.concat = function () { var sources = argsOrArray(arguments, 0); return enumerableFor(sources).concat(); }; /** * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ observableProto.concatObservable = observableProto.concatAll =function () { return this.merge(1); }; /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. * * @example * 1 - merged = sources.merge(1); * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.merge = function (maxConcurrentOrOther) { if (typeof maxConcurrentOrOther !== 'number') { return observableMerge(this, maxConcurrentOrOther); } var sources = this; return new AnonymousObservable(function (observer) { var activeCount = 0, group = new CompositeDisposable(), isStopped = false, q = [], subscribe = function (xs) { var subscription = new SingleAssignmentDisposable(); group.add(subscription); subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () { var s; group.remove(subscription); if (q.length > 0) { s = q.shift(); subscribe(s); } else { activeCount--; if (isStopped && activeCount === 0) { observer.onCompleted(); } } })); }; group.add(sources.subscribe(function (innerSource) { if (activeCount < maxConcurrentOrOther) { activeCount++; subscribe(innerSource); } else { q.push(innerSource); } }, observer.onError.bind(observer), function () { isStopped = true; if (activeCount === 0) { observer.onCompleted(); } })); return group; }); }; /** * Merges all the observable sequences into a single observable sequence. * The scheduler is optional and if not specified, the immediate scheduler is used. * * @example * 1 - merged = Rx.Observable.merge(xs, ys, zs); * 2 - merged = Rx.Observable.merge([xs, ys, zs]); * 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs); * 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]); * @returns {Observable} The observable sequence that merges the elements of the observable sequences. */ var observableMerge = Observable.merge = function () { var scheduler, sources; if (!arguments[0]) { scheduler = immediateScheduler; sources = slice.call(arguments, 1); } else if (arguments[0].now) { scheduler = arguments[0]; sources = slice.call(arguments, 1); } else { scheduler = immediateScheduler; sources = slice.call(arguments, 0); } if (Array.isArray(sources[0])) { sources = sources[0]; } return observableFromArray(sources, scheduler).mergeObservable(); }; /** * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ observableProto.mergeObservable = observableProto.mergeAll =function () { var sources = this; return new AnonymousObservable(function (observer) { var group = new CompositeDisposable(), isStopped = false, m = new SingleAssignmentDisposable(); group.add(m); m.setDisposable(sources.subscribe(function (innerSource) { var innerSubscription = new SingleAssignmentDisposable(); group.add(innerSubscription); innerSubscription.setDisposable(innerSource.subscribe(function (x) { observer.onNext(x); }, observer.onError.bind(observer), function () { group.remove(innerSubscription); if (isStopped && group.length === 1) { observer.onCompleted(); } })); }, observer.onError.bind(observer), function () { isStopped = true; if (group.length === 1) { observer.onCompleted(); } })); return group; }); }; /** * Returns the values from the source observable sequence only after the other observable sequence produces a value. * @param {Observable} other The observable sequence that triggers propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. */ observableProto.skipUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { var isOpen = false; var disposables = new CompositeDisposable(source.subscribe(function (left) { if (isOpen) { observer.onNext(left); } }, observer.onError.bind(observer), function () { if (isOpen) { observer.onCompleted(); } })); var rightSubscription = new SingleAssignmentDisposable(); disposables.add(rightSubscription); rightSubscription.setDisposable(other.subscribe(function () { isOpen = true; rightSubscription.dispose(); }, observer.onError.bind(observer), function () { rightSubscription.dispose(); })); return disposables; }); }; /** * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto['switch'] = observableProto.switchLatest = function () { var sources = this; return new AnonymousObservable(function (observer) { var hasLatest = false, innerSubscription = new SerialDisposable(), isStopped = false, latest = 0, subscription = sources.subscribe(function (innerSource) { var d = new SingleAssignmentDisposable(), id = ++latest; hasLatest = true; innerSubscription.setDisposable(d); d.setDisposable(innerSource.subscribe(function (x) { if (latest === id) { observer.onNext(x); } }, function (e) { if (latest === id) { observer.onError(e); } }, function () { if (latest === id) { hasLatest = false; if (isStopped) { observer.onCompleted(); } } })); }, observer.onError.bind(observer), function () { isStopped = true; if (!hasLatest) { observer.onCompleted(); } }); return new CompositeDisposable(subscription, innerSubscription); }); }; /** * Returns the values from the source observable sequence until the other observable sequence produces a value. * @param {Observable} other Observable sequence that terminates propagation of elements of the source sequence. * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. */ observableProto.takeUntil = function (other) { var source = this; return new AnonymousObservable(function (observer) { return new CompositeDisposable( source.subscribe(observer), other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop) ); }); }; function zipArray(second, resultSelector) { var first = this; return new AnonymousObservable(function (observer) { var index = 0, len = second.length; return first.subscribe(function (left) { if (index < len) { var right = second[index++], result; try { result = resultSelector(left, right); } catch (e) { observer.onError(e); return; } observer.onNext(result); } else { observer.onCompleted(); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources. * * @example * 1 - res = obs1.zip(obs2, fn); * 1 - res = x1.zip([1,2,3], fn); * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ observableProto.zip = function () { if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } var parent = this, sources = slice.call(arguments), resultSelector = sources.pop(); sources.unshift(parent); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); var next = function (i) { var res, queuedValues; if (queues.every(function (x) { return x.length > 0; })) { try { queuedValues = queues.map(function (x) { return x.shift(); }); res = resultSelector.apply(parent, queuedValues); } catch (ex) { observer.onError(ex); return; } observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); } }; function done(i) { isDone[i] = true; if (isDone.every(function (x) { return x; })) { observer.onCompleted(); } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } return new CompositeDisposable(subscriptions); }); }; /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. * @param arguments Observable sources. * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. */ Observable.zip = function () { var args = slice.call(arguments, 0), first = args.shift(); return first.zip.apply(first, args); }; /** * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. * @param arguments Observable sources. * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. */ Observable.zipArray = function () { var sources = slice.call(arguments); return new AnonymousObservable(function (observer) { var n = sources.length, queues = arrayInitialize(n, function () { return []; }), isDone = arrayInitialize(n, function () { return false; }); function next(i) { if (queues.every(function (x) { return x.length > 0; })) { var res = queues.map(function (x) { return x.shift(); }); observer.onNext(res); } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { observer.onCompleted(); return; } }; function done(i) { isDone[i] = true; if (isDone.every(identity)) { observer.onCompleted(); return; } } var subscriptions = new Array(n); for (var idx = 0; idx < n; idx++) { (function (i) { subscriptions[i] = new SingleAssignmentDisposable(); subscriptions[i].setDisposable(sources[i].subscribe(function (x) { queues[i].push(x); next(i); }, observer.onError.bind(observer), function () { done(i); })); })(idx); } var compositeDisposable = new CompositeDisposable(subscriptions); compositeDisposable.add(disposableCreate(function () { for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) { queues[qIdx] = []; } })); return compositeDisposable; }); }; /** * Hides the identity of an observable sequence. * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ observableProto.asObservable = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(observer); }); }; /** * Dematerializes the explicit notification values of an observable sequence as implicit notifications. * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. */ observableProto.dematerialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { return x.accept(observer); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. * * var obs = observable.distinctUntilChanged(); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); * * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. */ observableProto.distinctUntilChanged = function (keySelector, comparer) { var source = this; keySelector || (keySelector = identity); comparer || (comparer = defaultComparer); return new AnonymousObservable(function (observer) { var hasCurrentKey = false, currentKey; return source.subscribe(function (value) { var comparerEquals = false, key; try { key = keySelector(value); } catch (exception) { observer.onError(exception); return; } if (hasCurrentKey) { try { comparerEquals = comparer(currentKey, key); } catch (exception) { observer.onError(exception); return; } } if (!hasCurrentKey || !comparerEquals) { hasCurrentKey = true; currentKey = key; observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. * * @example * var res = observable.doAction(observer); * var res = observable.doAction(onNext); * var res = observable.doAction(onNext, onError); * var res = observable.doAction(onNext, onError, onCompleted); * @param {Mixed} observerOrOnNext Action to invoke for each element in the observable sequence or an observer. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. * @returns {Observable} The source sequence with the side-effecting behavior applied. */ observableProto['do'] = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { var source = this, onNextFunc; if (typeof observerOrOnNext === 'function') { onNextFunc = observerOrOnNext; } else { onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext); onError = observerOrOnNext.onError.bind(observerOrOnNext); onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext); } return new AnonymousObservable(function (observer) { return source.subscribe(function (x) { try { onNextFunc(x); } catch (e) { observer.onError(e); } observer.onNext(x); }, function (exception) { if (!onError) { observer.onError(exception); } else { try { onError(exception); } catch (e) { observer.onError(e); } observer.onError(exception); } }, function () { if (!onCompleted) { observer.onCompleted(); } else { try { onCompleted(); } catch (e) { observer.onError(e); } observer.onCompleted(); } }); }); }; /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * * @example * var res = observable.finallyAction(function () { console.log('sequence ended'; }); * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ observableProto['finally'] = observableProto.finallyAction = function (action) { var source = this; return new AnonymousObservable(function (observer) { var subscription = source.subscribe(observer); return disposableCreate(function () { try { subscription.dispose(); } catch (e) { throw e; } finally { action(); } }); }); }; /** * Ignores all elements in an observable sequence leaving only the termination messages. * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. */ observableProto.ignoreElements = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Materializes the implicit notifications of an observable sequence as explicit notification values. * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. */ observableProto.materialize = function () { var source = this; return new AnonymousObservable(function (observer) { return source.subscribe(function (value) { observer.onNext(notificationCreateOnNext(value)); }, function (e) { observer.onNext(notificationCreateOnError(e)); observer.onCompleted(); }, function () { observer.onNext(notificationCreateOnCompleted()); observer.onCompleted(); }); }); }; /** * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. * * @example * var res = repeated = source.repeat(); * var res = repeated = source.repeat(42); * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. */ observableProto.repeat = function (repeatCount) { return enumerableRepeat(this, repeatCount).concat(); }; /** * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. * * @example * var res = retried = retry.repeat(); * var res = retried = retry.repeat(42); * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. */ observableProto.retry = function (retryCount) { return enumerableRepeat(this, retryCount).catchException(); }; /** * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. * For aggregation behavior with no intermediate results, see Observable.aggregate. * @example * var res = source.scan(function (acc, x) { return acc + x; }); * var res = source.scan(0, function (acc, x) { return acc + x; }); * @param {Mixed} [seed] The initial accumulator value. * @param {Function} accumulator An accumulator function to be invoked on each element. * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { var hasSeed = false, seed, accumulator, source = this; if (arguments.length === 2) { hasSeed = true; seed = arguments[0]; accumulator = arguments[1]; } else { accumulator = arguments[0]; } return new AnonymousObservable(function (observer) { var hasAccumulation, accumulation, hasValue; return source.subscribe ( function (x) { try { if (!hasValue) { hasValue = true; } if (hasAccumulation) { accumulation = accumulator(accumulation, x); } else { accumulation = hasSeed ? accumulator(seed, x) : x; hasAccumulation = true; } } catch (e) { observer.onError(e); return; } observer.onNext(accumulation); }, observer.onError.bind(observer), function () { if (!hasValue && hasSeed) { observer.onNext(seed); } observer.onCompleted(); } ); }); }; /** * Bypasses a specified number of elements at the end of an observable sequence. * @description * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. * @param count Number of elements to bypass at the end of the source sequence. * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. */ observableProto.skipLast = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { observer.onNext(q.shift()); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. * * var res = source.startWith(1, 2, 3); * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); * * @memberOf Observable# * @returns {Observable} The source sequence prepended with the specified values. */ observableProto.startWith = function () { var values, scheduler, start = 0; if (!!arguments.length && 'now' in Object(arguments[0])) { scheduler = arguments[0]; start = 1; } else { scheduler = immediateScheduler; } values = slice.call(arguments, start); return enumerableFor([observableFromArray(values, scheduler), this]).concat(); }; /** * Returns a specified number of contiguous elements from the end of an observable sequence, using an optional scheduler to drain the queue. * * @example * var res = source.takeLast(5); * var res = source.takeLast(5, Rx.Scheduler.timeout); * * @description * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. * @param {Number} count Number of elements to take from the end of the source sequence. * @param {Scheduler} [scheduler] Scheduler used to drain the queue upon completion of the source sequence. * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. */ observableProto.takeLast = function (count, scheduler) { return this.takeLastBuffer(count).selectMany(function (xs) { return observableFromArray(xs, scheduler); }); }; /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { q.push(x); if (q.length > count) { q.shift(); } }, observer.onError.bind(observer), function () { observer.onNext(q); observer.onCompleted(); }); }); }; /** * Projects each element of an observable sequence into a new form by incorporating the element's index. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. */ observableProto.select = observableProto.map = function (selector, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var result; try { result = selector.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } observer.onNext(result); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; function selectMany(selector) { return this.select(selector).mergeObservable(); } /** * One of the Following: * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. * * @example * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); * Or: * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. * * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); * Or: * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. * * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); * @param selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto. * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. */ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector) { if (resultSelector) { return this.selectMany(function (x) { return selector(x).select(function (y) { return resultSelector(x, y); }); }); } if (typeof selector === 'function') { return selectMany.call(this, selector); } return selectMany.call(this, function () { return selector; }); }; /** * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. */ observableProto.selectSwitch = observableProto.flatMapLatest = function (selector, thisArg) { return this.select(selector, thisArg).switchLatest(); }; /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. */ observableProto.skip = function (count) { if (count < 0) { throw new Error(argumentOutOfRange); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining <= 0) { observer.onNext(x); } else { remaining--; } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. * The element's index is used in the logic of the predicate function. * * var res = source.skipWhile(function (value) { return value < 10; }); * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. */ observableProto.skipWhile = function (predicate, thisArg) { var source = this; return new AnonymousObservable(function (observer) { var i = 0, running = false; return source.subscribe(function (x) { if (!running) { try { running = !predicate.call(thisArg, x, i++, source); } catch (e) { observer.onError(e); return; } } if (running) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * * var res = source.take(5); * var res = source.take(0, Rx.Scheduler.timeout); * @param {Number} count The number of elements to return. * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0. * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence. */ observableProto.take = function (count, scheduler) { if (count < 0) { throw new Error(argumentOutOfRange); } if (count === 0) { return observableEmpty(scheduler); } var observable = this; return new AnonymousObservable(function (observer) { var remaining = count; return observable.subscribe(function (x) { if (remaining > 0) { remaining--; observer.onNext(x); if (remaining === 0) { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Returns elements from an observable sequence as long as a specified condition is true. * The element's index is used in the logic of the predicate function. * * @example * var res = source.takeWhile(function (value) { return value < 10; }); * var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. */ observableProto.takeWhile = function (predicate, thisArg) { var observable = this; return new AnonymousObservable(function (observer) { var i = 0, running = true; return observable.subscribe(function (x) { if (running) { try { running = predicate.call(thisArg, x, i++, observable); } catch (e) { observer.onError(e); return; } if (running) { observer.onNext(x); } else { observer.onCompleted(); } } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Filters the elements of an observable sequence based on a predicate by incorporating the element's index. * * @example * var res = source.where(function (value) { return value < 10; }); * var res = source.where(function (value, index) { return value < 10 || index < 10; }); * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element. * @param {Any} [thisArg] Object to use as this when executing callback. * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition. */ observableProto.where = observableProto.filter = function (predicate, thisArg) { var parent = this; return new AnonymousObservable(function (observer) { var count = 0; return parent.subscribe(function (value) { var shouldRun; try { shouldRun = predicate.call(thisArg, value, count++, parent); } catch (exception) { observer.onError(exception); return; } if (shouldRun) { observer.onNext(value); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); }); }; /** * Converts a callback function to an observable sequence. * * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. */ Observable.fromCallback = function (func, scheduler, context, selector) { scheduler || (scheduler = timeoutScheduler); return function () { var args = slice.call(arguments, 0), subject = new AsyncSubject(); scheduler.schedule(function () { function handler(e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { subject.onError(err); return; } } else { if (results.length === 1) { results = results[0]; } } subject.onNext(results); subject.onCompleted(); } args.push(handler); func.apply(context, args); }); return subject.asObservable(); }; }; /** * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. * @param {Function} func The function to call * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. */ Observable.fromNodeCallback = function (func, scheduler, context, selector) { scheduler || (scheduler = timeoutScheduler); return function () { var args = slice.call(arguments, 0), subject = new AsyncSubject(); scheduler.schedule(function () { function handler(err) { if (err) { subject.onError(err); return; } var results = slice.call(arguments, 1); if (selector) { try { results = selector(results); } catch (e) { subject.onError(e); return; } } else { if (results.length === 1) { results = results[0]; } } subject.onNext(results); subject.onCompleted(); } args.push(handler); func.apply(context, args); }); return subject.asObservable(); }; }; function fixEvent(event) { var stopPropagation = function () { this.cancelBubble = true; }; var preventDefault = function () { this.bubbledKeyCode = this.keyCode; if (this.ctrlKey) { try { this.keyCode = 0; } catch (e) { } } this.defaultPrevented = true; this.returnValue = false; this.modified = true; }; event || (event = window.event); if (!event.target) { event.target = event.target || event.srcElement; if (event.type == 'mouseover') { event.relatedTarget = event.fromElement; } if (event.type == 'mouseout') { event.relatedTarget = event.toElement; } // Adding stopPropogation and preventDefault to IE if (!event.stopPropagation){ event.stopPropagation = stopPropagation; event.preventDefault = preventDefault; } // Normalize key events switch(event.type){ case 'keypress': var c = ('charCode' in event ? event.charCode : event.keyCode); if (c == 10) { c = 0; event.keyCode = 13; } else if (c == 13 || c == 27) { c = 0; } else if (c == 3) { c = 99; } event.charCode = c; event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : ''; break; } } return event; } function createListener (element, name, handler) { // Node.js specific if (element.addListener) { element.addListener(name, handler); return disposableCreate(function () { element.removeListener(name, handler); }); } // Standards compliant if (element.addEventListener) { element.addEventListener(name, handler, false); return disposableCreate(function () { element.removeEventListener(name, handler, false); }); } else if (element.attachEvent) { // IE Specific var innerHandler = function (event) { handler(fixEvent(event)); }; element.attachEvent('on' + name, innerHandler); return disposableCreate(function () { element.detachEvent('on' + name, innerHandler); }); } else { // Level 1 DOM Events element['on' + name] = handler; return disposableCreate(function () { element['on' + name] = null; }); } } function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList if (el && el.length) { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el[i], eventName, handler)); } } else if (el) { disposables.add(createListener(el, eventName, handler)); } return disposables; } /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. * * @example * var source = Rx.Observable.fromEvent(element, 'mouseup'); * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence of events from the specified element and the specified event. */ Observable.fromEvent = function (element, eventName, selector) { return new AnonymousObservable(function (observer) { return createEventListener( element, eventName, function handler (e) { var results = e; if (selector) { try { results = selector(arguments); } catch (err) { observer.onError(err); return } } observer.onNext(results); }); }).publish().refCount(); }; /** * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ Observable.fromEventPattern = function (addHandler, removeHandler, selector) { return new AnonymousObservable(function (observer) { function innerHandler (e) { var result = e; if (selector) { try { result = selector(arguments); } catch (err) { observer.onError(err); return; } } observer.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { if (removeHandler) { removeHandler(innerHandler, returnValue); } }); }).publish().refCount(); }; /** * Converts a Promise to an Observable sequence * @param {Promise} A Promises A+ implementation instance. * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. */ Observable.fromPromise = function (promise) { var subject = new AsyncSubject(); promise.then( function (value) { subject.onNext(value); subject.onCompleted(); }, function (reason) { subject.onError(reason); }); return subject.asObservable(); }; /** * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay. * * @example * 1 - res = source.multicast(observable); * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; }); * * @param {Function|Subject} subjectOrSubjectSelector * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. * Or: * Subject to push source elements into. * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.multicast = function (subjectOrSubjectSelector, selector) { var source = this; return typeof subjectOrSubjectSelector === 'function' ? new AnonymousObservable(function (observer) { var connectable = source.multicast(subjectOrSubjectSelector()); return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect()); }) : new ConnectableObservable(source, subjectOrSubjectSelector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. * This operator is a specialization of Multicast using a regular Subject. * * @example * var resres = source.publish(); * var res = source.publish(function (x) { return x; }); * * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publish = function (selector) { return !selector ? this.multicast(new Subject()) : this.multicast(function () { return new Subject(); }, selector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification. * This operator is a specialization of Multicast using a AsyncSubject. * * @example * var res = source.publishLast(); * var res = source.publishLast(function (x) { return x; }); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishLast = function (selector) { return !selector ? this.multicast(new AsyncSubject()) : this.multicast(function () { return new AsyncSubject(); }, selector); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. * This operator is a specialization of Multicast using a BehaviorSubject. * * @example * var res = source.publishValue(42); * var res = source.publishLast(function (x) { return x.select(function (y) { return y * y; }) }, 42); * * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on. * @param {Mixed} initialValue Initial value received by observers upon subscription. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.publishValue = function (initialValueOrSelector, initialValue) { return arguments.length === 2 ? this.multicast(function () { return new BehaviorSubject(initialValue); }, initialValueOrSelector) : this.multicast(new BehaviorSubject(initialValueOrSelector)); }; /** * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. * This operator is a specialization of Multicast using a ReplaySubject. * * @example * var res = source.replay(null, 3); * var res = source.replay(null, 3, 500); * var res = source.replay(null, 3, 500, scheduler); * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler); * * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. * @param bufferSize [Optional] Maximum element count of the replay buffer. * @param window [Optional] Maximum time length of the replay buffer. * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on. * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. */ observableProto.replay = function (selector, bufferSize, window, scheduler) { return !selector ? this.multicast(new ReplaySubject(bufferSize, window, scheduler)) : this.multicast(function () { return new ReplaySubject(bufferSize, window, scheduler); }, selector); }; /** @private */ var ConnectableObservable = (function (_super) { inherits(ConnectableObservable, _super); /** * @constructor * @private */ function ConnectableObservable(source, subject) { var state = { subject: subject, source: source.asObservable(), hasSubscription: false, subscription: null }; this.connect = function () { if (!state.hasSubscription) { state.hasSubscription = true; state.subscription = new CompositeDisposable(state.source.subscribe(state.subject), disposableCreate(function () { state.hasSubscription = false; })); } return state.subscription; }; function subscribe(observer) { return state.subject.subscribe(observer); } _super.call(this, subscribe); } /** * @private * @memberOf ConnectableObservable */ ConnectableObservable.prototype.connect = function () { return this.connect(); }; /** * @private * @memberOf ConnectableObservable */ ConnectableObservable.prototype.refCount = function () { var connectableSubscription = null, count = 0, source = this; return new AnonymousObservable(function (observer) { var shouldConnect, subscription; count++; shouldConnect = count === 1; subscription = source.subscribe(observer); if (shouldConnect) { connectableSubscription = source.connect(); } return disposableCreate(function () { subscription.dispose(); count--; if (count === 0) { connectableSubscription.dispose(); } }); }); }; return ConnectableObservable; }(Observable)); function observableTimerTimeSpan(dueTime, scheduler) { var d = normalizeTime(dueTime); return new AnonymousObservable(function (observer) { return scheduler.scheduleWithRelative(d, function () { observer.onNext(0); observer.onCompleted(); }); }); } function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { if (dueTime === period) { return new AnonymousObservable(function (observer) { return scheduler.schedulePeriodicWithState(0, period, function (count) { observer.onNext(count); return count + 1; }); }); } return observableDefer(function () { return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); }); } /** * Returns an observable sequence that produces a value after each period. * * @example * 1 - res = Rx.Observable.interval(1000); * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); * * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. * @returns {Observable} An observable sequence that produces a value after each period. */ var observableinterval = Observable.interval = function (period, scheduler) { scheduler || (scheduler = timeoutScheduler); return observableTimerTimeSpanAndPeriod(period, period, scheduler); }; /** * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. * * @example * var res = Rx.Observable.timer(5000); * var res = Rx.Observable.timer(5000, 1000); * var res = Rx.Observable.timer(5000, Rx.Scheduler.timeout); * var res = Rx.Observable.timer(5000, 1000, Rx.Scheduler.timeout); * * @param {Number} dueTime Relative time (specified as an integer denoting milliseconds) at which to produce the first value. * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. */ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; scheduler || (scheduler = timeoutScheduler); if (typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (typeof periodOrScheduler === 'object' && 'now' in periodOrScheduler) { scheduler = periodOrScheduler; } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; /** * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. * * @example * var res = Rx.Observable.delay(5000); * var res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delay = function (dueTime, scheduler) { scheduler || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var active = false, cancelable = new SerialDisposable(), exception = null, q = [], running = false, subscription; subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { var d, shouldRun; if (notification.value.kind === 'E') { q = []; q.push(notification); exception = notification.value.exception; shouldRun = !running; } else { q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); shouldRun = !active; active = true; } if (shouldRun) { if (exception !== null) { observer.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { var e, recurseDueTime, result, shouldRecurse; if (exception !== null) { return; } running = true; do { result = null; if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { result = q.shift().value; } if (result !== null) { result.accept(observer); } } while (result !== null); shouldRecurse = false; recurseDueTime = 0; if (q.length > 0) { shouldRecurse = true; recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); } else { active = false; } e = exception; running = false; if (e !== null) { observer.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } })); } } }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Ignores values from an observable sequence which are followed by another value before dueTime. * * @example * 1 - res = source.throttle(5000); // 5 seconds * 2 - res = source.throttle(5000, scheduler); * * @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds). * @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The throttled sequence. */ observableProto.throttle = function (dueTime, scheduler) { scheduler || (scheduler = timeoutScheduler); var source = this; return this.throttleWithSelector(function () { return observableTimer(dueTime, scheduler); }) }; /** * Records the time interval between consecutive values in an observable sequence. * * @example * 1 - res = source.timeInterval(); * 2 - res = source.timeInterval(Rx.Scheduler.timeout); * * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with time interval information on values. */ observableProto.timeInterval = function (scheduler) { var source = this; scheduler || (scheduler = timeoutScheduler); return observableDefer(function () { var last = scheduler.now(); return source.select(function (x) { var now = scheduler.now(), span = now - last; last = now; return { value: x, interval: span }; }); }); }; /** * Records the timestamp for each value in an observable sequence. * * @example * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } * 2 - res = source.timestamp(Rx.Scheduler.timeout); * * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used. * @returns {Observable} An observable sequence with timestamp information on values. */ observableProto.timestamp = function (scheduler) { scheduler || (scheduler = timeoutScheduler); return this.select(function (x) { return { value: x, timestamp: scheduler.now() }; }); }; function sampleObservable(source, sampler) { return new AnonymousObservable(function (observer) { var atEnd, value, hasValue; function sampleSubscribe() { if (hasValue) { hasValue = false; observer.onNext(value); } if (atEnd) { observer.onCompleted(); } } return new CompositeDisposable( source.subscribe(function (newValue) { hasValue = true; value = newValue; }, observer.onError.bind(observer), function () { atEnd = true; }), sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe) ); }); } /** * Samples the observable sequence at each interval. * * @example * 1 - res = source.sample(sampleObservable); // Sampler tick sequence * 2 - res = source.sample(5000); // 5 seconds * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Sampled observable sequence. */ observableProto.sample = function (intervalOrSampler, scheduler) { scheduler || (scheduler = timeoutScheduler); if (typeof intervalOrSampler === 'number') { return sampleObservable(this, observableinterval(intervalOrSampler, scheduler)); } return sampleObservable(this, intervalOrSampler); }; /** * Returns the source observable sequence or the other observable sequence if dueTime elapses. * * @example * 1 - res = source.timeout(new Date()); // As a date * 2 - res = source.timeout(5000); // 5 seconds * 3 - res = source.timeout(new Date(), Rx.Observable.returnValue(42)); // As a date and timeout observable * 4 - res = source.timeout(5000, Rx.Observable.returnValue(42)); // 5 seconds and timeout observable * 5 - res = source.timeout(new Date(), Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // As a date and timeout observable * 6 - res = source.timeout(5000, Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // 5 seconds and timeout observable * * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeout = function (dueTime, other, scheduler) { var schedulerMethod, source = this; other || (other = observableThrow(new Error('Timeout'))); scheduler || (scheduler = timeoutScheduler); if (dueTime instanceof Date) { schedulerMethod = function (dt, action) { scheduler.scheduleWithAbsolute(dt, action); }; } else { schedulerMethod = function (dt, action) { scheduler.scheduleWithRelative(dt, action); }; } return new AnonymousObservable(function (observer) { var createTimer, id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), switched = false, timer = new SerialDisposable(); subscription.setDisposable(original); createTimer = function () { var myId = id; timer.setDisposable(schedulerMethod(dueTime, function () { switched = id === myId; var timerWins = switched; if (timerWins) { subscription.setDisposable(other.subscribe(observer)); } })); }; createTimer(); original.setDisposable(source.subscribe(function (x) { var onNextWins = !switched; if (onNextWins) { id++; observer.onNext(x); createTimer(); } }, function (e) { var onErrorWins = !switched; if (onErrorWins) { id++; observer.onError(e); } }, function () { var onCompletedWins = !switched; if (onCompletedWins) { id++; observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * Generates an observable sequence by iterating a state from an initial state until the condition fails. * * @example * res = source.generateWithRelativeTime(0, * function (x) { return return true; }, * function (x) { return x + 1; }, * function (x) { return x; }, * function (x) { return 500; } * ); * * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. * @returns {Observable} The generated sequence. */ Observable.generateWithTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { scheduler || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var first = true, hasResult = false, result, state = initialState, time; return scheduler.scheduleRecursiveWithRelative(0, function (self) { if (hasResult) { observer.onNext(result); } try { if (first) { first = false; } else { state = iterate(state); } hasResult = condition(state); if (hasResult) { result = resultSelector(state); time = timeSelector(state); } } catch (e) { observer.onError(e); return; } if (hasResult) { self(time); } else { observer.onCompleted(); } }); }); }; /** * Time shifts the observable sequence by delaying the subscription. * * @example * 1 - res = source.delaySubscription(5000); // 5s * 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds * * @param {Number} dueTime Absolute or relative time to perform the subscription at. * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ observableProto.delaySubscription = function (dueTime, scheduler) { scheduler || (scheduler = timeoutScheduler); return this.delayWithSelector(observableTimer(dueTime, scheduler), function () { return observableEmpty(); }); }; /** * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector * * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source. * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element. * @returns {Observable} Time-shifted sequence. */ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) { var source = this, subDelay, selector; if (typeof subscriptionDelay === 'function') { selector = subscriptionDelay; } else { subDelay = subscriptionDelay; selector = delayDurationSelector; } return new AnonymousObservable(function (observer) { var delays = new CompositeDisposable(), atEnd = false, done = function () { if (atEnd && delays.length === 0) { observer.onCompleted(); } }, subscription = new SerialDisposable(), start = function () { subscription.setDisposable(source.subscribe(function (x) { var delay; try { delay = selector(x); } catch (error) { observer.onError(error); return; } var d = new SingleAssignmentDisposable(); delays.add(d); d.setDisposable(delay.subscribe(function () { observer.onNext(x); delays.remove(d); done(); }, observer.onError.bind(observer), function () { observer.onNext(x); delays.remove(d); done(); })); }, observer.onError.bind(observer), function () { atEnd = true; subscription.dispose(); done(); })); }; if (!subDelay) { start(); } else { subscription.setDisposable(subDelay.subscribe(function () { start(); }, observer.onError.bind(observer), function () { start(); })); } return new CompositeDisposable(subscription, delays); }); }; /** * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled. * * @example * 1 - res = source.timeoutWithSelector(Rx.Observable.timer(500)); * 2 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }); * 3 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }, Rx.Observable.returnValue(42)); * * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never(). * @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element. * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException(). * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. */ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) { if (arguments.length === 1) { timeoutdurationSelector = firstTimeout; var firstTimeout = observableNever(); } other || (other = observableThrow(new Error('Timeout'))); var source = this; return new AnonymousObservable(function (observer) { var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); subscription.setDisposable(original); var id = 0, switched = false, setTimer = function (timeout) { var myId = id, timerWins = function () { return id === myId; }; var d = new SingleAssignmentDisposable(); timer.setDisposable(d); d.setDisposable(timeout.subscribe(function () { if (timerWins()) { subscription.setDisposable(other.subscribe(observer)); } d.dispose(); }, function (e) { if (timerWins()) { observer.onError(e); } }, function () { if (timerWins()) { subscription.setDisposable(other.subscribe(observer)); } })); }; setTimer(firstTimeout); var observerWins = function () { var res = !switched; if (res) { id++; } return res; }; original.setDisposable(source.subscribe(function (x) { if (observerWins()) { observer.onNext(x); var timeout; try { timeout = timeoutdurationSelector(x); } catch (e) { observer.onError(e); return; } setTimer(timeout); } }, function (e) { if (observerWins()) { observer.onError(e); } }, function () { if (observerWins()) { observer.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }); }; /** * Ignores values from an observable sequence which are followed by another value within a computed throttle duration. * * @example * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(x + x); }); * * @param {Function} throttleDurationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element. * @returns {Observable} The throttled sequence. */ observableProto.throttleWithSelector = function (throttleDurationSelector) { var source = this; return new AnonymousObservable(function (observer) { var value, hasValue = false, cancelable = new SerialDisposable(), id = 0, subscription = source.subscribe(function (x) { var throttle; try { throttle = throttleDurationSelector(x); } catch (e) { observer.onError(e); return; } hasValue = true; value = x; id++; var currentid = id, d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); d.setDisposable(throttle.subscribe(function () { if (hasValue && id === currentid) { observer.onNext(value); } hasValue = false; d.dispose(); }, observer.onError.bind(observer), function () { if (hasValue && id === currentid) { observer.onNext(value); } hasValue = false; d.dispose(); })); }, function (e) { cancelable.dispose(); observer.onError(e); hasValue = false; id++; }, function () { cancelable.dispose(); if (hasValue) { observer.onNext(value); } observer.onCompleted(); hasValue = false; id++; }); return new CompositeDisposable(subscription, cancelable); }); }; /** * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * * 1 - res = source.skipLastWithTime(5000); * 2 - res = source.skipLastWithTime(5000, scheduler); * * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for skipping elements from the end of the sequence. * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence. */ observableProto.skipLastWithTime = function (duration, scheduler) { scheduler || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } }, observer.onError.bind(observer), function () { var now = scheduler.now(); while (q.length > 0 && now - q[0].interval >= duration) { observer.onNext(q.shift().value); } observer.onCompleted(); }); }); }; /** * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. * * @example * 1 - res = source.takeLastWithTime(5000, [optional timer scheduler], [optional loop scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} [timerScheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @param {Scheduler} [loopScheduler] Scheduler to drain the collected elements. If not specified, defaults to Rx.Scheduler.immediate. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastWithTime = function (duration, timerScheduler, loopScheduler) { return this.takeLastBufferWithTime(duration, timerScheduler).selectMany(function (xs) { return observableFromArray(xs, loopScheduler); }); }; /** * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.takeLastBufferWithTime(5000, [optional scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the end of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence. */ observableProto.takeLastBufferWithTime = function (duration, scheduler) { var source = this; scheduler || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var q = []; return source.subscribe(function (x) { var now = scheduler.now(); q.push({ interval: now, value: x }); while (q.length > 0 && now - q[0].interval >= duration) { q.shift(); } }, observer.onError.bind(observer), function () { var now = scheduler.now(), res = []; while (q.length > 0) { var next = q.shift(); if (now - next.interval <= duration) { res.push(next.value); } } observer.onNext(res); observer.onCompleted(); }); }); }; /** * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.takeWithTime(5000, [optional scheduler]); * @description * This operator accumulates a queue with a length enough to store elements received during the initial duration window. * As more elements are received, elements older than the specified duration are taken from the queue and produced on the * result sequence. This causes elements to be delayed with duration. * @param {Number} duration Duration for taking elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence. */ observableProto.takeWithTime = function (duration, scheduler) { var source = this; scheduler || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var t = scheduler.scheduleWithRelative(duration, function () { observer.onCompleted(); }); return new CompositeDisposable(t, source.subscribe(observer)); }); }; /** * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. * * @example * 1 - res = source.skipWithTime(5000, [optional scheduler]); * * @description * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence. * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded * may not execute immediately, despite the zero due time. * * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration. * @param {Number} duration Duration for skipping elements from the start of the sequence. * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence. */ observableProto.skipWithTime = function (duration, scheduler) { var source = this; scheduler || (scheduler = timeoutScheduler); return new AnonymousObservable(function (observer) { var open = false, t = scheduler.scheduleWithRelative(duration, function () { open = true; }), d = source.subscribe(function (x) { if (open) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); return new CompositeDisposable(t, d); }); }; /** * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers. * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time>. * * @examples * 1 - res = source.skipUntilWithTime(new Date(), [optional scheduler]); * @param startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped. * @param scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. * @returns {Observable} An observable sequence with the elements skipped until the specified start time. */ observableProto.skipUntilWithTime = function (startTime, scheduler) { scheduler || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { var open = false, t = scheduler.scheduleWithAbsolute(startTime, function () { open = true; }), d = source.subscribe(function (x) { if (open) { observer.onNext(x); } }, observer.onError.bind(observer), observer.onCompleted.bind(observer)); return new CompositeDisposable(t, d); }); }; /** * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers. * * @example * 1 - res = source.takeUntilWithTime(new Date(), [optional scheduler]); * @param {Number} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately. * @param {Scheduler} scheduler Scheduler to run the timer on. * @returns {Observable} An observable sequence with the elements taken until the specified end time. */ observableProto.takeUntilWithTime = function (endTime, scheduler) { scheduler || (scheduler = timeoutScheduler); var source = this; return new AnonymousObservable(function (observer) { return new CompositeDisposable(scheduler.scheduleWithAbsolute(endTime, function () { observer.onCompleted(); }), source.subscribe(observer)); }); }; var AnonymousObservable = Rx.Internals.AnonymousObservable = (function (_super) { inherits(AnonymousObservable, _super); // Fix subscriber to check for undefined or function returned to decorate as Disposable function fixSubscriber(subscriber) { if (typeof subscriber === 'undefined') { subscriber = disposableEmpty; } else if (typeof subscriber === 'function') { subscriber = disposableCreate(subscriber); } return subscriber; } function AnonymousObservable(subscribe) { if (!(this instanceof AnonymousObservable)) { return new AnonymousObservable(subscribe); } function s(observer) { var autoDetachObserver = new AutoDetachObserver(observer); if (currentThreadScheduler.scheduleRequired()) { currentThreadScheduler.schedule(function () { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } }); } else { try { autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver))); } catch (e) { if (!autoDetachObserver.fail(e)) { throw e; } } } return autoDetachObserver; } _super.call(this, s); } return AnonymousObservable; }(Observable)); /** @private */ var AutoDetachObserver = (function (_super) { inherits(AutoDetachObserver, _super); function AutoDetachObserver(observer) { _super.call(this); this.observer = observer; this.m = new SingleAssignmentDisposable(); } var AutoDetachObserverPrototype = AutoDetachObserver.prototype; AutoDetachObserverPrototype.next = function (value) { var noError = false; try { this.observer.onNext(value); noError = true; } catch (e) { throw e; } finally { if (!noError) { this.dispose(); } } }; AutoDetachObserverPrototype.error = function (exn) { try { this.observer.onError(exn); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.completed = function () { try { this.observer.onCompleted(); } catch (e) { throw e; } finally { this.dispose(); } }; AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); }; /* @private */ AutoDetachObserverPrototype.disposable = function (value) { return arguments.length ? this.getDisposable() : setDisposable(value); }; AutoDetachObserverPrototype.dispose = function () { _super.prototype.dispose.call(this); this.m.dispose(); }; return AutoDetachObserver; }(AbstractObserver)); /** @private */ var InnerSubscription = function (subject, observer) { this.subject = subject; this.observer = observer; }; /** * @private * @memberOf InnerSubscription */ InnerSubscription.prototype.dispose = function () { if (!this.subject.isDisposed && this.observer !== null) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); this.observer = null; } }; /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed observers. */ var Subject = Rx.Subject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } if (this.exception) { observer.onError(this.exception); return disposableEmpty; } observer.onCompleted(); return disposableEmpty; } inherits(Subject, _super); /** * Creates a subject. * @constructor */ function Subject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.observers = []; } addProperties(Subject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); /** * Creates a subject from the specified observer and observable. * @param {Observer} observer The observer used to send messages to the subject. * @param {Observable} observable The observable used to subscribe to messages sent from the subject. * @returns {Subject} Subject implemented using the given observer and observable. */ Subject.create = function (observer, observable) { return new AnonymousSubject(observer, observable); }; return Subject; }(Observable)); /** * Represents the result of an asynchronous operation. * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. */ var AsyncSubject = Rx.AsyncSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); return new InnerSubscription(this, observer); } var ex = this.exception; var hv = this.hasValue; var v = this.value; if (ex) { observer.onError(ex); } else if (hv) { observer.onNext(v); observer.onCompleted(); } else { observer.onCompleted(); } return disposableEmpty; } inherits(AsyncSubject, _super); /** * Creates a subject that can only receive one value and that value is cached for all future observations. * @constructor */ function AsyncSubject() { _super.call(this, subscribe); this.isDisposed = false, this.isStopped = false, this.value = null, this.hasValue = false, this.observers = [], this.exception = null; } addProperties(AsyncSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). */ onCompleted: function () { var o, i, len; checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; var v = this.value; var hv = this.hasValue; if (hv) { for (i = 0, len = os.length; i < len; i++) { o = os[i]; o.onNext(v); o.onCompleted(); } } else { for (i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (exception) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = exception; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(exception); } this.observers = []; } }, /** * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. * @param {Mixed} value The value to store in the subject. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; this.hasValue = true; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.exception = null; this.value = null; } }); return AsyncSubject; }(Observable)); /** @private */ var AnonymousSubject = (function (_super) { inherits(AnonymousSubject, _super); function subscribe(observer) { return this.observable.subscribe(observer); } /** * @private * @constructor */ function AnonymousSubject(observer, observable) { _super.call(this, subscribe); this.observer = observer; this.observable = observable; } addProperties(AnonymousSubject.prototype, Observer, { /** * @private * @memberOf AnonymousSubject# */ onCompleted: function () { this.observer.onCompleted(); }, /** * @private * @memberOf AnonymousSubject# */ onError: function (exception) { this.observer.onError(exception); }, /** * @private * @memberOf AnonymousSubject# */ onNext: function (value) { this.observer.onNext(value); } }); return AnonymousSubject; }(Observable)); /** * Represents a value that changes over time. * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. */ var BehaviorSubject = Rx.BehaviorSubject = (function (_super) { function subscribe(observer) { checkDisposed.call(this); if (!this.isStopped) { this.observers.push(observer); observer.onNext(this.value); return new InnerSubscription(this, observer); } var ex = this.exception; if (ex) { observer.onError(ex); } else { observer.onCompleted(); } return disposableEmpty; } inherits(BehaviorSubject, _super); /** * @constructor * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. */ function BehaviorSubject(value) { _super.call(this, subscribe); this.value = value, this.observers = [], this.isDisposed = false, this.isStopped = false, this.exception = null; } addProperties(BehaviorSubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; for (var i = 0, len = os.length; i < len; i++) { os[i].onCompleted(); } this.observers = []; } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { checkDisposed.call(this); if (!this.isStopped) { var os = this.observers.slice(0); this.isStopped = true; this.exception = error; for (var i = 0, len = os.length; i < len; i++) { os[i].onError(error); } this.observers = []; } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { checkDisposed.call(this); if (!this.isStopped) { this.value = value; var os = this.observers.slice(0); for (var i = 0, len = os.length; i < len; i++) { os[i].onNext(value); } } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; this.value = null; this.exception = null; } }); return BehaviorSubject; }(Observable)); /** * Represents an object that is both an observable sequence as well as an observer. * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. */ var ReplaySubject = Rx.ReplaySubject = (function (_super) { function RemovableDisposable (subject, observer) { this.subject = subject; this.observer = observer; }; RemovableDisposable.prototype.dispose = function () { this.observer.dispose(); if (!this.subject.isDisposed) { var idx = this.subject.observers.indexOf(this.observer); this.subject.observers.splice(idx, 1); } }; function subscribe(observer) { var so = new ScheduledObserver(this.scheduler, observer), subscription = new RemovableDisposable(this, so); checkDisposed.call(this); this._trim(this.scheduler.now()); this.observers.push(so); var n = this.q.length; for (var i = 0, len = this.q.length; i < len; i++) { so.onNext(this.q[i].value); } if (this.hasError) { n++; so.onError(this.error); } else if (this.isStopped) { n++; so.onCompleted(); } so.ensureActive(n); return subscription; } inherits(ReplaySubject, _super); /** * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. * @param {Number} [bufferSize] Maximum element count of the replay buffer. * @param {Number} [windowSize] Maximum time length of the replay buffer. * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. */ function ReplaySubject(bufferSize, windowSize, scheduler) { this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize; this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize; this.scheduler = scheduler || currentThreadScheduler; this.q = []; this.observers = []; this.isStopped = false; this.isDisposed = false; this.hasError = false; this.error = null; _super.call(this, subscribe); } addProperties(ReplaySubject.prototype, Observer, { /** * Indicates whether the subject has observers subscribed to it. * @returns {Boolean} Indicates whether the subject has observers subscribed to it. */ hasObservers: function () { return this.observers.length > 0; }, /* @private */ _trim: function (now) { while (this.q.length > this.bufferSize) { this.q.shift(); } while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { this.q.shift(); } }, /** * Notifies all subscribed observers about the arrival of the specified element in the sequence. * @param {Mixed} value The value to send to all observers. */ onNext: function (value) { var observer; checkDisposed.call(this); if (!this.isStopped) { var now = this.scheduler.now(); this.q.push({ interval: now, value: value }); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onNext(value); observer.ensureActive(); } } }, /** * Notifies all subscribed observers about the exception. * @param {Mixed} error The exception to send to all observers. */ onError: function (error) { var observer; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; this.error = error; this.hasError = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onError(error); observer.ensureActive(); } this.observers = []; } }, /** * Notifies all subscribed observers about the end of the sequence. */ onCompleted: function () { var observer; checkDisposed.call(this); if (!this.isStopped) { this.isStopped = true; var now = this.scheduler.now(); this._trim(now); var o = this.observers.slice(0); for (var i = 0, len = o.length; i < len; i++) { observer = o[i]; observer.onCompleted(); observer.ensureActive(); } this.observers = []; } }, /** * Unsubscribe all observers and release resources. */ dispose: function () { this.isDisposed = true; this.observers = null; } }); return ReplaySubject; }(Observable)); // Check for AMD if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { window.Rx = Rx; return define(function () { return Rx; }); } else if (freeExports) { if (typeof module == 'object' && module && module.exports == freeExports) { module.exports = Rx; } else { freeExports = Rx; } } else { window.Rx = Rx; } }(this));
src/pages/components/About/BirdWatching.js
uwrov/uwrov.github.io
import React from 'react' import { StaticImage } from 'gatsby-plugin-image' import video from "../../../images/Bird-Watching/CrowVideo.mp4" import NavBar from '../NavBar/NavBar' import './BirdWatching.css' import Footer from "../Footer/Footer" import HtmlHelmet from '../../HtmlHelmet.js' const BirdWatching = () => ( <div className="bird-watching"> <HtmlHelmet/> <div className="nav-wrapper"> <NavBar/> </div> <br/><br/> <h1>Welcome to the UWROV Bird Watching page!</h1> <br/><br/> <figure> <StaticImage alt="MiscellaneousBirds" src="../../../images/Bird-Watching/MiscellaneousBirds.jpeg" width={500} height={400}/> <figcaption><div>Although it is an urban campus in Seattle, the UW’s location on Lake Washington and proximity to the 230-acre <a href="https://botanicgardens.uw.edu/washington-park-arboretum/">Washington Park Arboretum</a> and 74-acre <a href="https://botanicgardens.uw.edu/center-for-urban-horticulture/visit/union-bay-natural-area/"> Union Bay Natural Area</a> invite a wide variety of birds to campus. The location of the UWROV club in the <a href="http://www.washington.edu/maps/#!/oce">Oceanography Building</a>, just feet away from Lake Union’s Portage Bay, gives members a prime viewing spot to watch native waterfowl, shown in the image at right.</div></figcaption> </figure> <figure> <StaticImage alt="AdrianWithDuck" src="../../../images/Bird-Watching/AdrianWithDuck.jpeg" width={500} height={400}/> <figcaption><div>Adrian Junus of the 2013 - 2014 team stands near a male <a href="http://www.audubon.org/field-guide/bird/mallard">Mallard (<em>Anas platyrhynchos</em>)</a> on the dock nearest to the UWROV room.</div></figcaption> </figure> <figure> <StaticImage alt="Bafflehead" src="../../../images/Bird-Watching/Bafflehead.jpeg" width={500} height={400}/> <figcaption><div>A lone male <a href="http://www.audubon.org/field-guide/bird/bufflehead">Bufflehead (<em>Bucephala albeola</em>) </a> enjoys Drumheller Fountain.</div></figcaption> </figure> <figure> <StaticImage alt="Osprey" src="../../../images/Bird-Watching/Osprey.jpeg" width={500} height={400}/> <figcaption><div>An <a href="http://www.audubon.org/field-guide/bird/canada-goose">Osprey (<em>Pandion haliaetus</em>)</a> perches on the lights of Husky Stadium.</div></figcaption> </figure> <figure> <StaticImage alt="CanadianGeeseOnGrass" src="../../../images/Bird-Watching/CanadianGeeseOnGrass.jpeg" width={500} height={400}/> <figcaption><div>A permanent flock of friendly <a href="http://www.audubon.org/field-guide/bird/canada-goose">Canada Geese (<em>Branta canadensis</em>)</a> live on the UW campus.</div></figcaption> </figure> <figure> <StaticImage alt="Gosling" src="../../../images/Bird-Watching/Gosling.jpeg" width={500}height={400}/> <figcaption><div>Here's a Canada Goose gosling on campus by Portage Bay.</div></figcaption> </figure> <figure> <StaticImage alt="HeronsNesting" src="../../../images/Bird-Watching/HeronsNesting.jpeg" width={500} height={400}/> <figcaption><div><a href="http://www.audubon.org/field-guide/bird/great-blue-heron">Great Blue Herons (<em>Ardea herodias</em>)</a> nest in the UW’s Sylvan Grove during the spring.</div></figcaption> </figure> <figure> <StaticImage alt="WhiteFrontedGoose" src="../../../images/Bird-Watching/WhiteFrontedGoose.jpeg" width={500} height={400}/> <figcaption><div>A <a href="http://www.audubon.org/field-guide/bird/greater-white-fronted-goose">Greater White-fronted Goose (<em>Anser albifrons</em>)</a> visits the UW campus during its migration.</div></figcaption> </figure> <figure> <StaticImage alt="RingNeckedDuck" src="../../../images/Bird-Watching/RingNeckedDuck.jpeg" width={500} height={400}/> <figcaption><div>Several <a href="http://www.audubon.org/field-guide/bird/ring-necked-duck">Ring-necked Ducks (<em>Aythya collaris</em>)</a> swim through the Montlake Cut, as photographed from campus.</div></figcaption> </figure> <figure> <StaticImage alt="WoodDuck" src="../../../images/Bird-Watching/WoodDuck.jpeg" width={500} height={400}/> <figcaption><div>This colorful drake is a <a href="http://www.audubon.org/field-guide/bird/wood-duck">Wood Duck (<em>Aix sponsa</em>)</a>, who makes his home in the wooded wetlands on the south side of the Montlake Cut but occasionally paddles over to campus.</div></figcaption> </figure> <figure> <StaticImage alt="CommonMergansers" src="../../../images/Bird-Watching/CommonMergansers.jpeg" width={500} height={400}/> <figcaption><div>Four female (left) and two male (right) <a href="http://www.audubon.org/field-guide/bird/common-merganser">Common Mergansers (<em>Mergus merganser</em>),</a> with the <a href="https://www.ocean.washington.edu/story/RV_Clifford_A_Barnes ">RV Clifford A Barnes.</a></div></figcaption> </figure> <figure> <StaticImage alt="SnowGeese" src="../../../images/Bird-Watching/SnowGeese.jpeg" width={500} height={400}/> <figcaption><div>A pair of <a href="http://www.audubon.org/field-guide/bird/snow-goose">Snow Geese (<em>Chen caerulescens</em>)</a> (white, center) visit campus during the Winter.</div></figcaption> </figure> <figure> <StaticImage alt="TrumpeterSwans" src="../../../images/Bird-Watching/TrumpeterSwans.jpeg" width={500} height={400}/> <figcaption><div>Four <a href="http://www.audubon.org/field-guide/bird/trumpeter-swan">Trumpeter Swans (<em>Cygnus buccinator</em>)</a> begin foraging just after dawn in front of the iconic Husky Stadium.</div></figcaption> </figure> <figure> <StaticImage alt="WesternGulls" src="../../../images/Bird-Watching/WesternGulls.jpeg" width={500} height={400}/> <figcaption><div>A flock of <a href=" http://www.audubon.org/field-guide/bird/western-gull">Western Gulls (<em>Larus occidentalis</em>)</a> graze next to the HUB. Rarely seen inland, the Westen Gull's presence seems out of place on a grass lawn, despite the HUB being only 3 1/2 miles from the Pacific Ocean.</div></figcaption> </figure> <figure> <StaticImage alt="HouseFinch" src="../../../images/Bird-Watching/HouseFinch.jpeg" width={500} height={400}/> <figcaption><div>A <a href=" http://www.audubon.org/field-guide/bird/house-finch">House Finch (<em>Haemorhous mexicanus</em>)</a> perches on the vines covering the Oceanography Building. Originally native to the Southwest, these birds were sold in the early 20th century as Hollywood Finches and spread rapidly across the continent.</div></figcaption> </figure> <figure> <StaticImage alt="Stellersjay" src="../../../images/Bird-Watching/Stellersjay.jpeg" width={500} height={400}/> <figcaption><div>The <a href="http://www.audubon.org/field-guide/bird/stellers-jay">Steller’s jay (<em> Cyanocitta stelleri</em>),</a> is among the loudest birds in Seattle’s suburbs, and frequents UW’s wooded campus. Blue feathers in birds are not pigmented, but rather caused by constructive interference of light, a phenomenon studied extensively by biologists <a href="http://www.nature.com/articles/pj2014125"> and studied in connection to polymer research.</a></div></figcaption> </figure> <figure> <StaticImage alt="CScrubjay" src="../../../images/Bird-Watching/CScrubjay2.png" width={500} height={400}/> <figcaption><div>A <a href="http://www.audubon.org/field-guide/bird/common-merganser">California Scrub-Jay (<em>Aphelocoma californica</em>),</a> perches in front of the Ocean Science Building. It is one of the two species known until 2016 as the Western Scrub-Jay. Corvid intelligence ranks on par with the non-human apes, and scrub jays in particular have shown <a href="https://www.sciencedirect.com/science/article/pii/S002396900500024X "> evidence of possessing episodic-like memory.</a> </div></figcaption> </figure> <figure> <video width="500px" height="380px" controls> <source src={video} type='video/mp4' /> <track src="" kind="captions" srclang="en" label="english_captions"/> </video> <figcaption><div>An <a href="http://www.audubon.org/field-guide/bird/american-crow">American Crow (<em>Corvus brachyrhynchos</em>)</a> eats a peanut.<br/> The University of Washington’s <a href="http://sefs.washington.edu/research.acl/">Avian Conservation Laboratory</a> is among the nation’s best. Crows are of particular interest due to their intelligence, and crow research at the University of Washington has yielded some potentially <a href="http://www.opb.org/news/article/could-crows-have-helped-bring-down-bin-laden/">unusual and intriguing applications</a>.<br/> The University of Washington’s Bothell campus is also home to a nightly <a href="https://www.uwb.edu/visitors/crows">crow roost</a> from fall to spring.</div></figcaption> </figure> <Footer/> </div> ) export default BirdWatching
packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder-story.js
carbon-design-system/carbon-components
/** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ /* eslint-disable no-console */ import React from 'react'; import { withKnobs, select } from '@storybook/addon-knobs'; import SkeletonPlaceholder from '../SkeletonPlaceholder'; import mdx from './SkeletonPlaceholder.mdx'; const classNames = { 'my--skeleton__placeholder--small': 'my--skeleton__placeholder--small', 'my--skeleton__placeholder--medium': 'my--skeleton__placeholder--medium', 'my--skeleton__placeholder--large': 'my--skeleton__placeholder--large', }; const props = () => ({ className: select('Classes with different sizes', classNames), }); export default { title: 'Components/Skeleton/SkeletonPlaceholder', decorators: [withKnobs], parameters: { component: SkeletonPlaceholder, docs: { page: mdx, }, }, }; export const Default = () => ( <div style={{ height: '250px', width: '250px' }}> <style dangerouslySetInnerHTML={{ __html: ` .my--skeleton__placeholder--small { height: 100px; width: 100px; } .my--skeleton__placeholder--medium { height: 150px; width: 150px; } .my--skeleton__placeholder--large { height: 250px; width: 250px; } `, }} /> <SkeletonPlaceholder {...props()} /> </div> ); Default.parameters = { info: { text: ` Skeleton states are used as a progressive loading state while the user waits for content to load. By taking a height and/or width property, this component can be used when you know the exact dimensions of the incoming content, such as an image. However, for performance reasons, it's recommended to create a class in your stylesheet to set the dimensions. `, }, };
test/test_helper.js
rafaalb/BlogsReact
import _$ from 'jquery'; import React from 'react'; import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; import jsdom from 'jsdom'; import chai, { expect } from 'chai'; import chaiJquery from 'chai-jquery'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import reducers from '../src/reducers'; global.document = jsdom.jsdom('<!doctype html><html><body></body></html>'); global.window = global.document.defaultView; global.navigator = global.window.navigator; const $ = _$(window); chaiJquery(chai, chai.util, $); function renderComponent(ComponentClass, props = {}, state = {}) { const componentInstance = TestUtils.renderIntoDocument( <Provider store={createStore(reducers, state)}> <ComponentClass {...props} /> </Provider> ); return $(ReactDOM.findDOMNode(componentInstance)); } $.fn.simulate = function(eventName, value) { if (value) { this.val(value); } TestUtils.Simulate[eventName](this[0]); }; export {renderComponent, expect};
examples/UnigridExample9.js
yoonka/unigrid
/* Copyright (c) 2018, Grzegorz Junka All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import React from 'react'; import tableData from './json/tableResp5.json!'; import { Unigrid, UnigridHeader, UnigridSegment, UnigridRow, UnigridTextCell } from 'src/index'; export class UnigridExample9 extends React.Component { render() { const formatA = (cfg, item) => item.a === "apple" ? {style: {backgroundColor: '#55ff55'}} : undefined; const handleClick = function() { console.log('handleClick', this.props.item); }; return ( <div> <p>Example 9 : Mixed definition table (JSX/noJSX - mixed components)</p> <Unigrid data={tableData}> <UnigridHeader cells={['a', 'b']}> <Unigrid cells={['c', 'd']} /> </UnigridHeader> <UnigridSegment> <Unigrid cells={['e', 'f']} /> </UnigridSegment> <UnigridSegment select={'all'}> <UnigridRow amend={formatA} onClick={handleClick} bindToElement={'onClick'}> <UnigridTextCell show="a" /> <UnigridTextCell show="b" /> </UnigridRow> </UnigridSegment> <Unigrid section={'footer'}> <Unigrid cells={['g', 'h']} /> </Unigrid> </Unigrid> </div> ); } }
src/Grid.js
deerawan/react-bootstrap
import React from 'react'; import classNames from 'classnames'; import CustomPropTypes from './utils/CustomPropTypes'; const Grid = React.createClass({ propTypes: { /** * Turn any fixed-width grid layout into a full-width layout by this property. * * Adds `container-fluid` class. */ fluid: React.PropTypes.bool, /** * You can use a custom element for this component */ componentClass: CustomPropTypes.elementType }, getDefaultProps() { return { componentClass: 'div', fluid: false }; }, render() { let ComponentClass = this.props.componentClass; let className = this.props.fluid ? 'container-fluid' : 'container'; return ( <ComponentClass {...this.props} className={classNames(this.props.className, className)}> {this.props.children} </ComponentClass> ); } }); export default Grid;
ajax/libs/yui/3.3.0/simpleyui/simpleyui.js
steakknife/cdnjs
/** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and * the core utilities for the library. * @module yui * @submodule yui-base */ if (typeof YUI != 'undefined') { YUI._YUI = YUI; } /** * The YUI global namespace object. If YUI is already defined, the * existing YUI object will not be overwritten so that defined * namespaces are preserved. It is the constructor for the object * the end user interacts with. As indicated below, each instance * has full custom event support, but only if the event system * is available. This is a self-instantiable factory function. You * can invoke it directly like this: * * YUI().use('*', function(Y) { * // ready * }); * * But it also works like this: * * var Y = YUI(); * * @class YUI * @constructor * @global * @uses EventTarget * @param o* {object} 0..n optional configuration objects. these values * are store in Y.config. See config for the list of supported * properties. */ /*global YUI*/ /*global YUI_config*/ var YUI = function() { var i = 0, Y = this, args = arguments, l = args.length, instanceOf = function(o, type) { return (o && o.hasOwnProperty && (o instanceof type)); }, gconf = (typeof YUI_config !== 'undefined') && YUI_config; if (!(instanceOf(Y, YUI))) { Y = new YUI(); } else { // set up the core environment Y._init(); // YUI.GlobalConfig is a master configuration that might span // multiple contexts in a non-browser environment. It is applied // first to all instances in all contexts. if (YUI.GlobalConfig) { Y.applyConfig(YUI.GlobalConfig); } // YUI_Config is a page-level config. It is applied to all // instances created on the page. This is applied after // YUI.GlobalConfig, and before the instance level configuration // objects. if (gconf) { Y.applyConfig(gconf); } // bind the specified additional modules for this instance if (!l) { Y._setup(); } } if (l) { // Each instance can accept one or more configuration objects. // These are applied after YUI.GlobalConfig and YUI_Config, // overriding values set in those config files if there is a ' // matching property. for (; i < l; i++) { Y.applyConfig(args[i]); } Y._setup(); } Y.instanceOf = instanceOf; return Y; }; (function() { var proto, prop, VERSION = '@VERSION@', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', DOC_LABEL = 'yui3-js-enabled', NOOP = function() {}, SLICE = Array.prototype.slice, APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo 'io.xdrResponse': 1, // can call. this should 'SWF.eventHandler': 1 }, // be done at build time hasWin = (typeof window != 'undefined'), win = (hasWin) ? window : null, doc = (hasWin) ? win.document : null, docEl = doc && doc.documentElement, docClass = docEl && docEl.className, instances = {}, time = new Date().getTime(), add = function(el, type, fn, capture) { if (el && el.addEventListener) { el.addEventListener(type, fn, capture); } else if (el && el.attachEvent) { el.attachEvent('on' + type, fn); } }, remove = function(el, type, fn, capture) { if (el && el.removeEventListener) { // this can throw an uncaught exception in FF try { el.removeEventListener(type, fn, capture); } catch (ex) {} } else if (el && el.detachEvent) { el.detachEvent('on' + type, fn); } }, handleLoad = function() { YUI.Env.windowLoaded = true; YUI.Env.DOMReady = true; if (hasWin) { remove(window, 'load', handleLoad); } }, getLoader = function(Y, o) { var loader = Y.Env._loader; if (loader) { loader.ignoreRegistered = false; loader.onEnd = null; loader.data = null; loader.required = []; loader.loadType = null; } else { loader = new Y.Loader(Y.config); Y.Env._loader = loader; } return loader; }, clobber = function(r, s) { for (var i in s) { if (s.hasOwnProperty(i)) { r[i] = s[i]; } } }, ALREADY_DONE = { success: true }; // Stamp the documentElement (HTML) with a class of "yui-loaded" to // enable styles that need to key off of JS being enabled. if (docEl && docClass.indexOf(DOC_LABEL) == -1) { if (docClass) { docClass += ' '; } docClass += DOC_LABEL; docEl.className = docClass; } if (VERSION.indexOf('@') > -1) { VERSION = '3.2.0'; // dev time hack for cdn test } proto = { /** * Applies a new configuration object to the YUI instance config. * This will merge new group/module definitions, and will also * update the loader cache if necessary. Updating Y.config directly * will not update the cache. * @method applyConfig * @param {object} the configuration object. * @since 3.2.0 */ applyConfig: function(o) { o = o || NOOP; var attr, name, // detail, config = this.config, mods = config.modules, groups = config.groups, rls = config.rls, loader = this.Env._loader; for (name in o) { if (o.hasOwnProperty(name)) { attr = o[name]; if (mods && name == 'modules') { clobber(mods, attr); } else if (groups && name == 'groups') { clobber(groups, attr); } else if (rls && name == 'rls') { clobber(rls, attr); } else if (name == 'win') { config[name] = attr.contentWindow || attr; config.doc = config[name].document; } else if (name == '_yuid') { // preserve the guid } else { config[name] = attr; } } } if (loader) { loader._config(o); } }, _config: function(o) { this.applyConfig(o); }, /** * Initialize this YUI instance * @private */ _init: function() { var filter, Y = this, G_ENV = YUI.Env, Env = Y.Env, prop; /** * The version number of the YUI instance. * @property version * @type string */ Y.version = VERSION; if (!Env) { Y.Env = { mods: {}, // flat module map versions: {}, // version module map base: BASE, cdn: BASE + VERSION + '/build/', // bootstrapped: false, _idx: 0, _used: {}, _attached: {}, _yidx: 0, _uidx: 0, _guidp: 'y', _loaded: {}, serviced: {}, getBase: G_ENV && G_ENV.getBase || function(srcPattern, comboPattern) { var b, nodes, i, src, match; // get from querystring nodes = (doc && doc.getElementsByTagName('script')) || []; for (i = 0; i < nodes.length; i = i + 1) { src = nodes[i].src; if (src) { match = src.match(srcPattern); b = match && match[1]; if (b) { // this is to set up the path to the loader. The file // filter for loader should match the yui include. filter = match[2]; if (filter) { match = filter.indexOf('js'); if (match > -1) { filter = filter.substr(0, match); } } // extract correct path for mixed combo urls // http://yuilibrary.com/projects/yui3/ticket/2528423 match = src.match(comboPattern); if (match && match[3]) { b = match[1] + match[3]; } break; } } } // use CDN default return b || Env.cdn; } }; Env = Y.Env; Env._loaded[VERSION] = {}; if (G_ENV && Y !== YUI) { Env._yidx = ++G_ENV._yidx; Env._guidp = ('yui_' + VERSION + '_' + Env._yidx + '_' + time).replace(/\./g, '_'); } else if (YUI._YUI) { G_ENV = YUI._YUI.Env; Env._yidx += G_ENV._yidx; Env._uidx += G_ENV._uidx; for (prop in G_ENV) { if (!(prop in Env)) { Env[prop] = G_ENV[prop]; } } delete YUI._YUI; } Y.id = Y.stamp(Y); instances[Y.id] = Y; } Y.constructor = YUI; // configuration defaults Y.config = Y.config || { win: win, doc: doc, debug: true, useBrowserConsole: true, throwFail: true, bootstrap: true, cacheUse: true, fetchCSS: true }; Y.config.base = YUI.config.base || Y.Env.getBase(/^(.*)yui\/yui([\.\-].*)js(\?.*)?$/, /^(.*\?)(.*\&)(.*)yui\/yui[\.\-].*js(\?.*)?$/); if (!filter || (!('-min.-debug.').indexOf(filter))) { filter = '-min.'; } Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + (filter || '-min.') + 'js'; }, /** * Finishes the instance setup. Attaches whatever modules were defined * when the yui modules was registered. * @method _setup * @private */ _setup: function(o) { var i, Y = this, core = [], mods = YUI.Env.mods, extras = Y.config.core || ['get', 'rls', 'intl-base', 'loader', 'yui-log', 'yui-later', 'yui-throttle']; for (i = 0; i < extras.length; i++) { if (mods[extras[i]]) { core.push(extras[i]); } } Y._attach(['yui-base']); Y._attach(core); }, /** * Executes a method on a YUI instance with * the specified id if the specified method is whitelisted. * @method applyTo * @param id {string} the YUI instance id. * @param method {string} the name of the method to exectute. * Ex: 'Object.keys'. * @param args {Array} the arguments to apply to the method. * @return {object} the return value from the applied method or null. */ applyTo: function(id, method, args) { if (!(method in APPLY_TO_AUTH)) { this.log(method + ': applyTo not allowed', 'warn', 'yui'); return null; } var instance = instances[id], nest, m, i; if (instance) { nest = method.split('.'); m = instance; for (i = 0; i < nest.length; i = i + 1) { m = m[nest[i]]; if (!m) { this.log('applyTo not found: ' + method, 'warn', 'yui'); } } return m.apply(instance, args); } return null; }, /** * Registers a module with the YUI global. The easiest way to create a * first-class YUI module is to use the YUI component build tool. * * http://yuilibrary.com/projects/builder * * The build system will produce the YUI.add wrapper for you module, along * with any configuration info required for the module. * @method add * @param name {string} module name. * @param fn {Function} entry point into the module that * is used to bind module to the YUI instance. * @param version {string} version string. * @param details {object} optional config data: * requires: features that must be present before this module can be * attached. * optional: optional features that should be present if loadOptional * is defined. Note: modules are not often loaded this way in YUI 3, * but this field is still useful to inform the user that certain * features in the component will require additional dependencies. * use: features that are included within this module which need to * be attached automatically when this module is attached. This * supports the YUI 3 rollup system -- a module with submodules * defined will need to have the submodules listed in the 'use' * config. The YUI component build tool does this for you. * @return {YUI} the YUI instance. * */ add: function(name, fn, version, details) { details = details || {}; var env = YUI.Env, mod = { name: name, fn: fn, version: version, details: details }, loader, i, versions = env.versions; env.mods[name] = mod; versions[version] = versions[version] || {}; versions[version][name] = mod; for (i in instances) { if (instances.hasOwnProperty(i)) { loader = instances[i].Env._loader; if (loader) { if (!loader.moduleInfo[name]) { loader.addModule(details, name); } } } } return this; }, /** * Executes the function associated with each required * module, binding the module to the YUI instance. * @method _attach * @private */ _attach: function(r, fromLoader) { var i, name, mod, details, req, use, after, mods = YUI.Env.mods, Y = this, j, done = Y.Env._attached, len = r.length, loader; for (i = 0; i < len; i++) { if (!done[r[i]]) { name = r[i]; mod = mods[name]; if (!mod) { loader = Y.Env._loader; if (!loader || !loader.moduleInfo[name]) { Y.message('NOT loaded: ' + name, 'warn', 'yui'); } } else { done[name] = true; details = mod.details; req = details.requires; use = details.use; after = details.after; if (req) { for (j = 0; j < req.length; j++) { if (!done[req[j]]) { if (!Y._attach(req)) { return false; } break; } } } if (after) { for (j = 0; j < after.length; j++) { if (!done[after[j]]) { if (!Y._attach(after)) { return false; } break; } } } if (use) { for (j = 0; j < use.length; j++) { if (!done[use[j]]) { if (!Y._attach(use)) { return false; } break; } } } if (mod.fn) { try { mod.fn(Y, name); } catch (e) { Y.error('Attach error: ' + name, e, name); return false; } } } } } return true; }, /** * Attaches one or more modules to the YUI instance. When this * is executed, the requirements are analyzed, and one of * several things can happen: * * - All requirements are available on the page -- The modules * are attached to the instance. If supplied, the use callback * is executed synchronously. * * - Modules are missing, the Get utility is not available OR * the 'bootstrap' config is false -- A warning is issued about * the missing modules and all available modules are attached. * * - Modules are missing, the Loader is not available but the Get * utility is and boostrap is not false -- The loader is bootstrapped * before doing the following.... * * - Modules are missing and the Loader is available -- The loader * expands the dependency tree and fetches missing modules. When * the loader is finshed the callback supplied to use is executed * asynchronously. * * @param modules* {string} 1-n modules to bind (uses arguments array). * @param *callback {function} callback function executed when * the instance has the required functionality. If included, it * must be the last parameter. * <code> * // loads and attaches drag and drop and its dependencies * YUI().use('dd', function(Y) &#123;&#125); * // attaches all modules that are available on the page * YUI().use('*', function(Y) &#123;&#125); * // intrinsic YUI gallery support (since 3.1.0) * YUI().use('gallery-yql', function(Y) &#123;&#125); * // intrinsic YUI 2in3 support (since 3.1.0) * YUI().use('yui2-datatable', function(Y) &#123;&#125);. * </code> * * @return {YUI} the YUI instance. */ use: function() { var args = SLICE.call(arguments, 0), callback = args[args.length - 1], Y = this, key; // The last argument supplied to use can be a load complete callback if (Y.Lang.isFunction(callback)) { args.pop(); } else { callback = null; } if (Y._loading) { Y._useQueue = Y._useQueue || new Y.Queue(); Y._useQueue.add([args, callback]); } else { key = args.join(); if (Y.config.cacheUse && Y.Env.serviced[key]) { Y._notify(callback, ALREADY_DONE, args); } else { Y._use(args, function(Y, response) { if (Y.config.cacheUse) { Y.Env.serviced[key] = true; } Y._notify(callback, response, args); }); } } return Y; }, _notify: function(callback, response, args) { if (!response.success && this.config.loadErrorFn) { this.config.loadErrorFn.call(this, this, callback, response, args); } else if (callback) { try { callback(this, response); } catch (e) { this.error('use callback error', e, args); } } }, _use: function(args, callback) { if (!this.Array) { this._attach(['yui-base']); } var len, loader, handleBoot, Y = this, G_ENV = YUI.Env, mods = G_ENV.mods, Env = Y.Env, used = Env._used, queue = G_ENV._loaderQueue, firstArg = args[0], YArray = Y.Array, config = Y.config, boot = config.bootstrap, missing = [], r = [], ret = true, fetchCSS = config.fetchCSS, process = function(names, skip) { if (!names.length) { return; } YArray.each(names, function(name) { // add this module to full list of things to attach if (!skip) { r.push(name); } // only attach a module once if (used[name]) { return; } var m = mods[name], req, use; if (m) { used[name] = true; req = m.details.requires; use = m.details.use; } else { // CSS files don't register themselves, see if it has // been loaded if (!G_ENV._loaded[VERSION][name]) { missing.push(name); } else { used[name] = true; // probably css } } // make sure requirements are attached if (req && req.length) { process(req); } // make sure we grab the submodule dependencies too if (use && use.length) { process(use, 1); } }); }, handleLoader = function(fromLoader) { var response = fromLoader || { success: true, msg: 'not dynamic' }, redo, origMissing, ret = true, data = response.data; Y._loading = false; if (data) { origMissing = missing; missing = []; r = []; process(data); redo = missing.length; if (redo) { if (missing.sort().join() == origMissing.sort().join()) { redo = false; } } } if (redo && data) { Y._loading = false; Y._use(args, function() { if (Y._attach(data)) { Y._notify(callback, response, data); } }); } else { if (data) { ret = Y._attach(data); } if (ret) { Y._notify(callback, response, args); } } if (Y._useQueue && Y._useQueue.size() && !Y._loading) { Y._use.apply(Y, Y._useQueue.next()); } }; // YUI().use('*'); // bind everything available if (firstArg === '*') { ret = Y._attach(Y.Object.keys(mods)); if (ret) { handleLoader(); } return Y; } // use loader to expand dependencies and sort the // requirements if it is available. if (boot && Y.Loader && args.length) { loader = getLoader(Y); loader.require(args); loader.ignoreRegistered = true; loader.calculate(null, (fetchCSS) ? null : 'js'); args = loader.sorted; } // process each requirement and any additional requirements // the module metadata specifies process(args); len = missing.length; if (len) { missing = Y.Object.keys(YArray.hash(missing)); len = missing.length; } // dynamic load if (boot && len && Y.Loader) { Y._loading = true; loader = getLoader(Y); loader.onEnd = handleLoader; loader.context = Y; loader.data = args; loader.ignoreRegistered = false; loader.require(args); loader.insert(null, (fetchCSS) ? null : 'js'); // loader.partial(missing, (fetchCSS) ? null : 'js'); } else if (len && Y.config.use_rls) { // server side loader service Y.Get.script(Y._rls(args), { onEnd: function(o) { handleLoader(o); }, data: args }); } else if (boot && len && Y.Get && !Env.bootstrapped) { Y._loading = true; handleBoot = function() { Y._loading = false; queue.running = false; Env.bootstrapped = true; if (Y._attach(['loader'])) { Y._use(args, callback); } }; if (G_ENV._bootstrapping) { queue.add(handleBoot); } else { G_ENV._bootstrapping = true; Y.Get.script(config.base + config.loaderPath, { onEnd: handleBoot }); } } else { ret = Y._attach(args); if (ret) { handleLoader(); } } return Y; }, /** * Returns the namespace specified and creates it if it doesn't exist * <pre> * YUI.namespace("property.package"); * YUI.namespace("YAHOO.property.package"); * </pre> * Either of the above would create YUI.property, then * YUI.property.package (YAHOO is scrubbed out, this is * to remain compatible with YUI2) * * Be careful when naming packages. Reserved words may work in some browsers * and not others. For instance, the following will fail in Safari: * <pre> * YUI.namespace("really.long.nested.namespace"); * </pre> * This fails because "long" is a future reserved word in ECMAScript * * @method namespace * @param {string*} arguments 1-n namespaces to create. * @return {object} A reference to the last namespace object created. */ namespace: function() { var a = arguments, o = this, i = 0, j, d, arg; for (; i < a.length; i++) { // d = ('' + a[i]).split('.'); arg = a[i]; if (arg.indexOf(PERIOD)) { d = arg.split(PERIOD); for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) { o[d[j]] = o[d[j]] || {}; o = o[d[j]]; } } else { o[arg] = o[arg] || {}; } } return o; }, // this is replaced if the log module is included log: NOOP, message: NOOP, /** * Report an error. The reporting mechanism is controled by * the 'throwFail' configuration attribute. If throwFail is * not specified, the message is written to the Logger, otherwise * a JS error is thrown * @method error * @param msg {string} the error message. * @param e {Error|string} Optional JS error that was caught, or an error string. * @param data Optional additional info * and throwFail is specified, this error will be re-thrown. * @return {YUI} this YUI instance. */ error: function(msg, e, data) { var Y = this, ret; if (Y.config.errorFn) { ret = Y.config.errorFn.apply(Y, arguments); } if (Y.config.throwFail && !ret) { throw (e || new Error(msg)); } else { Y.message(msg, 'error'); // don't scrub this one } return Y; }, /** * Generate an id that is unique among all YUI instances * @method guid * @param pre {string} optional guid prefix. * @return {string} the guid. */ guid: function(pre) { var id = this.Env._guidp + (++this.Env._uidx); return (pre) ? (pre + id) : id; }, /** * Returns a guid associated with an object. If the object * does not have one, a new one is created unless readOnly * is specified. * @method stamp * @param o The object to stamp. * @param readOnly {boolean} if true, a valid guid will only * be returned if the object has one assigned to it. * @return {string} The object's guid or null. */ stamp: function(o, readOnly) { var uid; if (!o) { return o; } // IE generates its own unique ID for dom nodes // The uniqueID property of a document node returns a new ID if (o.uniqueID && o.nodeType && o.nodeType !== 9) { uid = o.uniqueID; } else { uid = (typeof o === 'string') ? o : o._yuid; } if (!uid) { uid = this.guid(); if (!readOnly) { try { o._yuid = uid; } catch (e) { uid = null; } } } return uid; }, /** * Destroys the YUI instance * @method destroy * @since 3.3.0 */ destroy: function() { var Y = this; if (Y.Event) { Y.Event._unload(); } delete instances[Y.id]; delete Y.Env; delete Y.config; } /** * instanceof check for objects that works around * memory leak in IE when the item tested is * window/document * @method instanceOf * @since 3.3.0 */ }; YUI.prototype = proto; // inheritance utilities are not available yet for (prop in proto) { if (proto.hasOwnProperty(prop)) { YUI[prop] = proto[prop]; } } // set up the environment YUI._init(); if (hasWin) { // add a window load event at load time so we can capture // the case where it fires before dynamic loading is // complete. add(window, 'load', handleLoad); } else { handleLoad(); } YUI.Env.add = add; YUI.Env.remove = remove; /*global exports*/ // Support the CommonJS method for exporting our single global if (typeof exports == 'object') { exports.YUI = YUI; } }()); /** * The config object contains all of the configuration options for * the YUI instance. This object is supplied by the implementer * when instantiating a YUI instance. Some properties have default * values if they are not supplied by the implementer. This should * not be updated directly because some values are cached. Use * applyConfig() to update the config object on a YUI instance that * has already been configured. * * @class config * @static */ /** * Allows the YUI seed file to fetch the loader component and library * metadata to dynamically load additional dependencies. * * @property bootstrap * @type boolean * @default true */ /** * Log to the browser console if debug is on and the browser has a * supported console. * * @property useBrowserConsole * @type boolean * @default true */ /** * A hash of log sources that should be logged. If specified, only * log messages from these sources will be logged. * * @property logInclude * @type object */ /** * A hash of log sources that should be not be logged. If specified, * all sources are logged if not on this list. * * @property logExclude * @type object */ /** * Set to true if the yui seed file was dynamically loaded in * order to bootstrap components relying on the window load event * and the 'domready' custom event. * * @property injected * @type boolean * @default false */ /** * If throwFail is set, Y.error will generate or re-throw a JS Error. * Otherwise the failure is logged. * * @property throwFail * @type boolean * @default true */ /** * The window/frame that this instance should operate in. * * @property win * @type Window * @default the window hosting YUI */ /** * The document associated with the 'win' configuration. * * @property doc * @type Document * @default the document hosting YUI */ /** * A list of modules that defines the YUI core (overrides the default). * * @property core * @type string[] */ /** * A list of languages in order of preference. This list is matched against * the list of available languages in modules that the YUI instance uses to * determine the best possible localization of language sensitive modules. * Languages are represented using BCP 47 language tags, such as "en-GB" for * English as used in the United Kingdom, or "zh-Hans-CN" for simplified * Chinese as used in China. The list can be provided as a comma-separated * list or as an array. * * @property lang * @type string|string[] */ /** * The default date format * @property dateFormat * @type string * @deprecated use configuration in DataType.Date.format() instead. */ /** * The default locale * @property locale * @type string * @deprecated use config.lang instead. */ /** * The default interval when polling in milliseconds. * @property pollInterval * @type int * @default 20 */ /** * The number of dynamic nodes to insert by default before * automatically removing them. This applies to script nodes * because remove the node will not make the evaluated script * unavailable. Dynamic CSS is not auto purged, because removing * a linked style sheet will also remove the style definitions. * @property purgethreshold * @type int * @default 20 */ /** * The default interval when polling in milliseconds. * @property windowResizeDelay * @type int * @default 40 */ /** * Base directory for dynamic loading * @property base * @type string */ /* * The secure base dir (not implemented) * For dynamic loading. * @property secureBase * @type string */ /** * The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo? * For dynamic loading. * @property comboBase * @type string */ /** * The root path to prepend to module path for the combo service. * Ex: 3.0.0b1/build/ * For dynamic loading. * @property root * @type string */ /** * A filter to apply to result urls. This filter will modify the default * path for all modules. The default path for the YUI library is the * minified version of the files (e.g., event-min.js). The filter property * can be a predefined filter or a custom filter. The valid predefined * filters are: * <dl> * <dt>DEBUG</dt> * <dd>Selects the debug versions of the library (e.g., event-debug.js). * This option will automatically include the Logger widget</dd> * <dt>RAW</dt> * <dd>Selects the non-minified version of the library (e.g., event.js).</dd> * </dl> * You can also define a custom filter, which must be an object literal * containing a search expression and a replace string: * <pre> * myFilter: &#123; * 'searchExp': "-min\\.js", * 'replaceStr': "-debug.js" * &#125; * </pre> * * For dynamic loading. * * @property filter * @type string|object */ /** * The 'skin' config let's you configure application level skin * customizations. It contains the following attributes which * can be specified to override the defaults: * * // The default skin, which is automatically applied if not * // overriden by a component-specific skin definition. * // Change this in to apply a different skin globally * defaultSkin: 'sam', * * // This is combined with the loader base property to get * // the default root directory for a skin. * base: 'assets/skins/', * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin * // for a given component as well. * overrides: { * slider: ['capsule', 'round'] * } * * For dynamic loading. * * @property skin */ /** * Hash of per-component filter specification. If specified for a given * component, this overrides the filter config. * * For dynamic loading. * * @property filters */ /** * Use the YUI combo service to reduce the number of http connections * required to load your dependencies. Turning this off will * disable combo handling for YUI and all module groups configured * with a combo service. * * For dynamic loading. * * @property combine * @type boolean * @default true if 'base' is not supplied, false if it is. */ /** * A list of modules that should never be dynamically loaded * * @property ignore * @type string[] */ /** * A list of modules that should always be loaded when required, even if already * present on the page. * * @property force * @type string[] */ /** * Node or id for a node that should be used as the insertion point for new * nodes. For dynamic loading. * * @property insertBefore * @type string */ /** * Object literal containing attributes to add to dynamically loaded script * nodes. * @property jsAttributes * @type string */ /** * Object literal containing attributes to add to dynamically loaded link * nodes. * @property cssAttributes * @type string */ /** * Number of milliseconds before a timeout occurs when dynamically * loading nodes. If not set, there is no timeout. * @property timeout * @type int */ /** * Callback for the 'CSSComplete' event. When dynamically loading YUI * components with CSS, this property fires when the CSS is finished * loading but script loading is still ongoing. This provides an * opportunity to enhance the presentation of a loading page a little * bit before the entire loading process is done. * * @property onCSS * @type function */ /** * A hash of module definitions to add to the list of YUI components. * These components can then be dynamically loaded side by side with * YUI via the use() method. This is a hash, the key is the module * name, and the value is an object literal specifying the metdata * for the module. * See Loader.addModule for the supported module * metadata fields. Also @see groups, which provides a way to * configure the base and combo spec for a set of modules. * <code> * modules: { * &nbsp; mymod1: { * &nbsp; requires: ['node'], * &nbsp; fullpath: 'http://myserver.mydomain.com/mymod1/mymod1.js' * &nbsp; }, * &nbsp; mymod2: { * &nbsp; requires: ['mymod1'], * &nbsp; fullpath: 'http://myserver.mydomain.com/mymod2/mymod2.js' * &nbsp; } * } * </code> * * @property modules * @type object */ /** * A hash of module group definitions. It for each group you * can specify a list of modules and the base path and * combo spec to use when dynamically loading the modules. @see * @see modules for the details about the modules part of the * group definition. * <code> * &nbsp; groups: { * &nbsp; yui2: { * &nbsp; // specify whether or not this group has a combo service * &nbsp; combine: true, * &nbsp; * &nbsp; // the base path for non-combo paths * &nbsp; base: 'http://yui.yahooapis.com/2.8.0r4/build/', * &nbsp; * &nbsp; // the path to the combo service * &nbsp; comboBase: 'http://yui.yahooapis.com/combo?', * &nbsp; * &nbsp; // a fragment to prepend to the path attribute when * &nbsp; // when building combo urls * &nbsp; root: '2.8.0r4/build/', * &nbsp; * &nbsp; // the module definitions * &nbsp; modules: { * &nbsp; yui2_yde: { * &nbsp; path: "yahoo-dom-event/yahoo-dom-event.js" * &nbsp; }, * &nbsp; yui2_anim: { * &nbsp; path: "animation/animation.js", * &nbsp; requires: ['yui2_yde'] * &nbsp; } * &nbsp; } * &nbsp; } * &nbsp; } * </code> * @property modules * @type object */ /** * The loader 'path' attribute to the loader itself. This is combined * with the 'base' attribute to dynamically load the loader component * when boostrapping with the get utility alone. * * @property loaderPath * @type string * @default loader/loader-min.js */ /** * Specifies whether or not YUI().use(...) will attempt to load CSS * resources at all. Any truthy value will cause CSS dependencies * to load when fetching script. The special value 'force' will * cause CSS dependencies to be loaded even if no script is needed. * * @property fetchCSS * @type boolean|string * @default true */ /** * The default gallery version to build gallery module urls * @property gallery * @type string * @since 3.1.0 */ /** * The default YUI 2 version to build yui2 module urls. This is for * intrinsic YUI 2 support via the 2in3 project. Also @see the '2in3' * config for pulling different revisions of the wrapped YUI 2 * modules. * @since 3.1.0 * @property yui2 * @type string * @default 2.8.1 */ /** * The 2in3 project is a deployment of the various versions of YUI 2 * deployed as first-class YUI 3 modules. Eventually, the wrapper * for the modules will change (but the underlying YUI 2 code will * be the same), and you can select a particular version of * the wrapper modules via this config. * @since 3.1.0 * @property 2in3 * @type string * @default 1 */ /** * Alternative console log function for use in environments without * a supported native console. The function is executed in the * YUI instance context. * @since 3.1.0 * @property logFn * @type Function */ /** * A callback to execute when Y.error is called. It receives the * error message and an javascript error object if Y.error was * executed because a javascript error was caught. The function * is executed in the YUI instance context. * * @since 3.2.0 * @property errorFn * @type Function */ /** * A callback to execute when the loader fails to load one or * more resource. This could be because of a script load * failure. It can also fail if a javascript module fails * to register itself, but only when the 'requireRegistration' * is true. If this function is defined, the use() callback will * only be called when the loader succeeds, otherwise it always * executes unless there was a javascript error when attaching * a module. * * @since 3.3.0 * @property loadErrorFn * @type Function */ /** * When set to true, the YUI loader will expect that all modules * it is responsible for loading will be first-class YUI modules * that register themselves with the YUI global. If this is * set to true, loader will fail if the module registration fails * to happen after the script is loaded. * * @since 3.3.0 * @property requireRegistration * @type boolean * @default false */ /** * Cache serviced use() requests. * @since 3.3.0 * @property cacheUse * @type boolean * @default true */ /** * The parameter defaults for the remote loader service. * Requires the rls submodule. The properties that are * supported: * <pre> * m: comma separated list of module requirements. This * must be the param name even for custom implemetations. * v: the version of YUI to load. Defaults to the version * of YUI that is being used. * gv: the version of the gallery to load (@see the gallery config) * env: comma separated list of modules already on the page. * this must be the param name even for custom implemetations. * lang: the languages supported on the page (@see the lang config) * '2in3v': the version of the 2in3 wrapper to use (@see the 2in3 config). * '2v': the version of yui2 to use in the yui 2in3 wrappers * (@see the yui2 config) * filt: a filter def to apply to the urls (@see the filter config). * filts: a list of custom filters to apply per module * (@see the filters config). * tests: this is a map of conditional module test function id keys * with the values of 1 if the test passes, 0 if not. This must be * the name of the querystring param in custom templates. *</pre> * * @since 3.2.0 * @property rls */ /** * The base path to the remote loader service * * @since 3.2.0 * @property rls_base */ /** * The template to use for building the querystring portion * of the remote loader service url. The default is determined * by the rls config -- each property that has a value will be * represented. * * ex: m={m}&v={v}&env={env}&lang={lang}&filt={filt}&tests={tests} * * * @since 3.2.0 * @property rls_tmpl */ /** * Configure the instance to use a remote loader service instead of * the client loader. * * @since 3.2.0 * @property use_rls */ YUI.add('yui-base', function(Y) { /* * YUI stub * @module yui * @submodule yui-base */ /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * Provides the language utilites and extensions used by the library * @class Lang * @static */ Y.Lang = Y.Lang || {}; var L = Y.Lang, ARRAY = 'array', BOOLEAN = 'boolean', DATE = 'date', ERROR = 'error', FUNCTION = 'function', NUMBER = 'number', NULL = 'null', OBJECT = 'object', REGEX = 'regexp', STRING = 'string', STRING_PROTO = String.prototype, TOSTRING = Object.prototype.toString, UNDEFINED = 'undefined', TYPES = { 'undefined' : UNDEFINED, 'number' : NUMBER, 'boolean' : BOOLEAN, 'string' : STRING, '[object Function]' : FUNCTION, '[object RegExp]' : REGEX, '[object Array]' : ARRAY, '[object Date]' : DATE, '[object Error]' : ERROR }, TRIMREGEX = /^\s+|\s+$/g, EMPTYSTRING = '', SUBREGEX = /\{\s*([^\|\}]+?)\s*(?:\|([^\}]*))?\s*\}/g; /** * Determines whether or not the provided item is an array. * Returns false for array-like collections such as the * function arguments collection or HTMLElement collection * will return false. Use <code>Y.Array.test</code> if you * want to test for an array-like collection. * @method isArray * @static * @param o The object to test. * @return {boolean} true if o is an array. */ // L.isArray = Array.isArray || function(o) { // return L.type(o) === ARRAY; // }; L.isArray = function(o) { return L.type(o) === ARRAY; }; /** * Determines whether or not the provided item is a boolean. * @method isBoolean * @static * @param o The object to test. * @return {boolean} true if o is a boolean. */ L.isBoolean = function(o) { return typeof o === BOOLEAN; }; /** * <p> * Determines whether or not the provided item is a function. * Note: Internet Explorer thinks certain functions are objects: * </p> * * <pre> * var obj = document.createElement("object"); * Y.Lang.isFunction(obj.getAttribute) // reports false in IE * &nbsp; * var input = document.createElement("input"); // append to body * Y.Lang.isFunction(input.focus) // reports false in IE * </pre> * * <p> * You will have to implement additional tests if these functions * matter to you. * </p> * * @method isFunction * @static * @param o The object to test. * @return {boolean} true if o is a function. */ L.isFunction = function(o) { return L.type(o) === FUNCTION; }; /** * Determines whether or not the supplied item is a date instance. * @method isDate * @static * @param o The object to test. * @return {boolean} true if o is a date. */ L.isDate = function(o) { // return o instanceof Date; return L.type(o) === DATE && o.toString() !== 'Invalid Date' && !isNaN(o); }; /** * Determines whether or not the provided item is null. * @method isNull * @static * @param o The object to test. * @return {boolean} true if o is null. */ L.isNull = function(o) { return o === null; }; /** * Determines whether or not the provided item is a legal number. * @method isNumber * @static * @param o The object to test. * @return {boolean} true if o is a number. */ L.isNumber = function(o) { return typeof o === NUMBER && isFinite(o); }; /** * Determines whether or not the provided item is of type object * or function. Note that arrays are also objects, so * <code>Y.Lang.isObject([]) === true</code>. * @method isObject * @static * @param o The object to test. * @param failfn {boolean} fail if the input is a function. * @return {boolean} true if o is an object. */ L.isObject = function(o, failfn) { var t = typeof o; return (o && (t === OBJECT || (!failfn && (t === FUNCTION || L.isFunction(o))))) || false; }; /** * Determines whether or not the provided item is a string. * @method isString * @static * @param o The object to test. * @return {boolean} true if o is a string. */ L.isString = function(o) { return typeof o === STRING; }; /** * Determines whether or not the provided item is undefined. * @method isUndefined * @static * @param o The object to test. * @return {boolean} true if o is undefined. */ L.isUndefined = function(o) { return typeof o === UNDEFINED; }; /** * Returns a string without any leading or trailing whitespace. If * the input is not a string, the input will be returned untouched. * @method trim * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trim = STRING_PROTO.trim ? function(s) { return (s && s.trim) ? s.trim() : s; } : function (s) { try { return s.replace(TRIMREGEX, EMPTYSTRING); } catch (e) { return s; } }; /** * Returns a string without any leading whitespace. * @method trimLeft * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trimLeft = STRING_PROTO.trimLeft ? function (s) { return s.trimLeft(); } : function (s) { return s.replace(/^\s+/, ''); }; /** * Returns a string without any trailing whitespace. * @method trimRight * @static * @param s {string} the string to trim. * @return {string} the trimmed string. */ L.trimRight = STRING_PROTO.trimRight ? function (s) { return s.trimRight(); } : function (s) { return s.replace(/\s+$/, ''); }; /** * A convenience method for detecting a legitimate non-null value. * Returns false for null/undefined/NaN, true for other values, * including 0/false/'' * @method isValue * @static * @param o The item to test. * @return {boolean} true if it is not null/undefined/NaN || false. */ L.isValue = function(o) { var t = L.type(o); switch (t) { case NUMBER: return isFinite(o); case NULL: case UNDEFINED: return false; default: return !!(t); } }; /** * <p> * Returns a string representing the type of the item passed in. * </p> * * <p> * Known issues: * </p> * * <ul> * <li> * <code>typeof HTMLElementCollection</code> returns function in Safari, but * <code>Y.type()</code> reports object, which could be a good thing -- * but it actually caused the logic in <code>Y.Lang.isObject</code> to fail. * </li> * </ul> * * @method type * @param o the item to test. * @return {string} the detected type. * @static */ L.type = function(o) { return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? OBJECT : NULL); }; /** * Lightweight version of <code>Y.substitute</code>. Uses the same template * structure as <code>Y.substitute</code>, but doesn't support recursion, * auto-object coersion, or formats. * @method sub * @param {string} s String to be modified. * @param {object} o Object containing replacement values. * @return {string} the substitute result. * @static * @since 3.2.0 */ L.sub = function(s, o) { return ((s.replace) ? s.replace(SUBREGEX, function(match, key) { return (!L.isUndefined(o[key])) ? o[key] : match; }) : s); }; /** * Returns the current time in milliseconds. * @method now * @return {int} the current date * @since 3.3.0 */ L.now = Date.now || function () { return new Date().getTime(); }; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and the * core utilities for the library. * @module yui * @submodule yui-base */ var Native = Array.prototype, LENGTH = 'length', /** * Adds the following array utilities to the YUI instance. Additional * array helpers can be found in the collection component. * @class Array */ /** * Y.Array(o) returns an array: * - Arrays are return unmodified unless the start position is specified. * - "Array-like" collections (@see Array.test) are converted to arrays * - For everything else, a new array is created with the input as the sole * item. * - The start position is used if the input is or is like an array to return * a subset of the collection. * * @todo this will not automatically convert elements that are also * collections such as forms and selects. Passing true as the third * param will force a conversion. * * @method () * @static * @param {object} o the item to arrayify. * @param {int} startIdx if an array or array-like, this is the start index. * @param {boolean} arraylike if true, it forces the array-like fork. This * can be used to avoid multiple Array.test calls. * @return {Array} the resulting array. */ YArray = function(o, startIdx, arraylike) { var t = (arraylike) ? 2 : YArray.test(o), l, a, start = startIdx || 0; if (t) { // IE errors when trying to slice HTMLElement collections try { return Native.slice.call(o, start); } catch (e) { a = []; l = o.length; for (; start < l; start++) { a.push(o[start]); } return a; } } else { return [o]; } }; Y.Array = YArray; /** * Evaluates the input to determine if it is an array, array-like, or * something else. This is used to handle the arguments collection * available within functions, and HTMLElement collections * * @method test * @static * * @todo current implementation (intenionally) will not implicitly * handle html elements that are array-like (forms, selects, etc). * * @param {object} o the object to test. * * @return {int} a number indicating the results: * 0: Not an array or an array-like collection * 1: A real array. * 2: array-like collection. */ YArray.test = function(o) { var r = 0; if (Y.Lang.isObject(o)) { if (Y.Lang.isArray(o)) { r = 1; } else { try { // indexed, but no tagName (element) or alert (window), // or functions without apply/call (Safari // HTMLElementCollection bug). if ((LENGTH in o) && !o.tagName && !o.alert && !o.apply) { r = 2; } } catch (e) {} } } return r; }; /** * Executes the supplied function on each item in the array. * @method each * @param {Array} a the array to iterate. * @param {Function} f the function to execute on each item. The * function receives three arguments: the value, the index, the full array. * @param {object} o Optional context object. * @static * @return {YUI} the YUI instance. */ YArray.each = (Native.forEach) ? function(a, f, o) { Native.forEach.call(a || [], f, o || Y); return Y; } : function(a, f, o) { var l = (a && a.length) || 0, i; for (i = 0; i < l; i = i + 1) { f.call(o || Y, a[i], i, a); } return Y; }; /** * Returns an object using the first array as keys, and * the second as values. If the second array is not * provided the value is set to true for each. * @method hash * @static * @param {Array} k keyset. * @param {Array} v optional valueset. * @return {object} the hash. */ YArray.hash = function(k, v) { var o = {}, l = k.length, vl = v && v.length, i; for (i = 0; i < l; i = i + 1) { o[k[i]] = (vl && vl > i) ? v[i] : true; } return o; }; /** * Returns the index of the first item in the array * that contains the specified value, -1 if the * value isn't found. * @method indexOf * @static * @param {Array} a the array to search. * @param {any} val the value to search for. * @return {int} the index of the item that contains the value or -1. */ YArray.indexOf = (Native.indexOf) ? function(a, val) { return Native.indexOf.call(a, val); } : function(a, val) { for (var i = 0; i < a.length; i = i + 1) { if (a[i] === val) { return i; } } return -1; }; /** * Numeric sort convenience function. * Y.ArrayAssert.itemsAreEqual([1,2,3], [3,1,2].sort(Y.Array.numericSort)); * @method numericSort * @static * @param {number} a a number. * @param {number} b a number. */ YArray.numericSort = function(a, b) { return (a - b); }; /** * Executes the supplied function on each item in the array. * Returning true from the processing function will stop the * processing of the remaining items. * @method some * @param {Array} a the array to iterate. * @param {Function} f the function to execute on each item. The function * receives three arguments: the value, the index, the full array. * @param {object} o Optional context object. * @static * @return {boolean} true if the function returns true on * any of the items in the array. */ YArray.some = (Native.some) ? function(a, f, o) { return Native.some.call(a, f, o); } : function(a, f, o) { var l = a.length, i; for (i = 0; i < l; i = i + 1) { if (f.call(o, a[i], i, a)) { return true; } } return false; }; /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * A simple FIFO queue. Items are added to the Queue with add(1..n items) and * removed using next(). * * @class Queue * @constructor * @param {MIXED} item* 0..n items to seed the queue. */ function Queue() { this._init(); this.add.apply(this, arguments); } Queue.prototype = { /** * Initialize the queue * * @method _init * @protected */ _init: function() { /** * The collection of enqueued items * * @property _q * @type Array * @protected */ this._q = []; }, /** * Get the next item in the queue. FIFO support * * @method next * @return {MIXED} the next item in the queue. */ next: function() { return this._q.shift(); }, /** * Get the last in the queue. LIFO support. * * @method last * @return {MIXED} the last item in the queue. */ last: function() { return this._q.pop(); }, /** * Add 0..n items to the end of the queue. * * @method add * @param {MIXED} item* 0..n items. * @return {object} this queue. */ add: function() { this._q.push.apply(this._q, arguments); return this; }, /** * Returns the current number of queued items. * * @method size * @return {Number} The size. */ size: function() { return this._q.length; } }; Y.Queue = Queue; YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue(); /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ var CACHED_DELIMITER = '__', /* * IE will not enumerate native functions in a derived object even if the * function was overridden. This is a workaround for specific functions * we care about on the Object prototype. * @property _iefix * @for YUI * @param {Function} r the object to receive the augmentation * @param {Function} s the object that supplies the properties to augment * @private */ _iefix = function(r, s) { var fn = s.toString; if (Y.Lang.isFunction(fn) && fn != Object.prototype.toString) { r.toString = fn; } }; /** * Returns a new object containing all of the properties of * all the supplied objects. The properties from later objects * will overwrite those in earlier objects. Passing in a * single object will create a shallow copy of it. For a deep * copy, use clone. * @method merge * @for YUI * @param arguments {Object*} the objects to merge. * @return {object} the new merged object. */ Y.merge = function() { var a = arguments, o = {}, i, l = a.length; for (i = 0; i < l; i = i + 1) { Y.mix(o, a[i], true); } return o; }; /** * Applies the supplier's properties to the receiver. By default * all prototype and static propertes on the supplier are applied * to the corresponding spot on the receiver. By default all * properties are applied, and a property that is already on the * reciever will not be overwritten. The default behavior can * be modified by supplying the appropriate parameters. * * @todo add constants for the modes * * @method mix * @param {Function} r the object to receive the augmentation. * @param {Function} s the object that supplies the properties to augment. * @param ov {boolean} if true, properties already on the receiver * will be overwritten if found on the supplier. * @param wl {string[]} a whitelist. If supplied, only properties in * this list will be applied to the receiver. * @param {int} mode what should be copies, and to where * default(0): object to object * 1: prototype to prototype (old augment) * 2: prototype to prototype and object props (new augment) * 3: prototype to object * 4: object to prototype. * @param merge {boolean/int} merge objects instead of overwriting/ignoring. * A value of 2 will skip array merge * Used by Y.aggregate. * @return {object} the augmented object. */ Y.mix = function(r, s, ov, wl, mode, merge) { if (!s || !r) { return r || Y; } if (mode) { switch (mode) { case 1: // proto to proto return Y.mix(r.prototype, s.prototype, ov, wl, 0, merge); case 2: // object to object and proto to proto Y.mix(r.prototype, s.prototype, ov, wl, 0, merge); break; // pass through case 3: // proto to static return Y.mix(r, s.prototype, ov, wl, 0, merge); case 4: // static to proto return Y.mix(r.prototype, s, ov, wl, 0, merge); default: // object to object is what happens below } } // Maybe don't even need this wl && wl.length check anymore?? var i, l, p, type; if (wl && wl.length) { for (i = 0, l = wl.length; i < l; ++i) { p = wl[i]; type = Y.Lang.type(r[p]); if (s.hasOwnProperty(p)) { if (merge && type == 'object') { Y.mix(r[p], s[p]); } else if (ov || !(p in r)) { r[p] = s[p]; } } } } else { for (i in s) { // if (s.hasOwnProperty(i) && !(i in FROZEN)) { if (s.hasOwnProperty(i)) { // check white list if it was supplied // if the receiver has this property, it is an object, // and merge is specified, merge the two objects. if (merge && Y.Lang.isObject(r[i], true)) { Y.mix(r[i], s[i], ov, wl, 0, true); // recursive // otherwise apply the property only if overwrite // is specified or the receiver doesn't have one. } else if (ov || !(i in r)) { r[i] = s[i]; } // if merge is specified and the receiver is an array, // append the array item // } else if (arr) { // r.push(s[i]); // } } } if (Y.UA.ie) { _iefix(r, s); } } return r; }; /** * Returns a wrapper for a function which caches the * return value of that function, keyed off of the combined * argument values. * @method cached * @param source {function} the function to memoize. * @param cache an optional cache seed. * @param refetch if supplied, this value is tested against the cached * value. If the values are equal, the wrapped function is executed again. * @return {Function} the wrapped function. */ Y.cached = function(source, cache, refetch) { cache = cache || {}; return function(arg1) { var k = (arguments.length > 1) ? Array.prototype.join.call(arguments, CACHED_DELIMITER) : arg1; if (!(k in cache) || (refetch && cache[k] == refetch)) { cache[k] = source.apply(source, arguments); } return cache[k]; }; }; /** * The YUI module contains the components required for building the YUI * seed file. This includes the script loading mechanism, a simple queue, * and the core utilities for the library. * @module yui * @submodule yui-base */ /** * Adds the following Object utilities to the YUI instance * @class Object */ /** * Y.Object(o) returns a new object based upon the supplied object. * @method () * @static * @param o the supplier object. * @return {Object} the new object. */ var F = function() {}, // O = Object.create || function(o) { // F.prototype = o; // return new F(); // }, O = function(o) { F.prototype = o; return new F(); }, owns = function(o, k) { return o && o.hasOwnProperty && o.hasOwnProperty(k); // return Object.prototype.hasOwnProperty.call(o, k); }, UNDEF, /** * Extracts the keys, values, or size from an object * * @method _extract * @param o the object. * @param what what to extract (0: keys, 1: values, 2: size). * @return {boolean|Array} the extracted info. * @static * @private */ _extract = function(o, what) { var count = (what === 2), out = (count) ? 0 : [], i; for (i in o) { if (owns(o, i)) { if (count) { out++; } else { out.push((what) ? o[i] : i); } } } return out; }; Y.Object = O; /** * Returns an array containing the object's keys * @method keys * @static * @param o an object. * @return {string[]} the keys. */ // O.keys = Object.keys || function(o) { // return _extract(o); // }; O.keys = function(o) { return _extract(o); }; /** * Returns an array containing the object's values * @method values * @static * @param o an object. * @return {Array} the values. */ // O.values = Object.values || function(o) { // return _extract(o, 1); // }; O.values = function(o) { return _extract(o, 1); }; /** * Returns the size of an object * @method size * @static * @param o an object. * @return {int} the size. */ O.size = Object.size || function(o) { return _extract(o, 2); }; /** * Returns true if the object contains a given key * @method hasKey * @static * @param o an object. * @param k the key to query. * @return {boolean} true if the object contains the key. */ O.hasKey = owns; /** * Returns true if the object contains a given value * @method hasValue * @static * @param o an object. * @param v the value to query. * @return {boolean} true if the object contains the value. */ O.hasValue = function(o, v) { return (Y.Array.indexOf(O.values(o), v) > -1); }; /** * Determines whether or not the property was added * to the object instance. Returns false if the property is not present * in the object, or was inherited from the prototype. * * @method owns * @static * @param o {any} The object being testing. * @param p {string} the property to look for. * @return {boolean} true if the object has the property on the instance. */ O.owns = owns; /** * Executes a function on each item. The function * receives the value, the key, and the object * as parameters (in that order). * @method each * @static * @param o the object to iterate. * @param f {Function} the function to execute on each item. The function * receives three arguments: the value, the the key, the full object. * @param c the execution context. * @param proto {boolean} include proto. * @return {YUI} the YUI instance. */ O.each = function(o, f, c, proto) { var s = c || Y, i; for (i in o) { if (proto || owns(o, i)) { f.call(s, o[i], i, o); } } return Y; }; /** * Executes a function on each item, but halts if the * function returns true. The function * receives the value, the key, and the object * as paramters (in that order). * @method some * @static * @param o the object to iterate. * @param f {Function} the function to execute on each item. The function * receives three arguments: the value, the the key, the full object. * @param c the execution context. * @param proto {boolean} include proto. * @return {boolean} true if any execution of the function returns true, * false otherwise. */ O.some = function(o, f, c, proto) { var s = c || Y, i; for (i in o) { if (proto || owns(o, i)) { if (f.call(s, o[i], i, o)) { return true; } } } return false; }; /** * Retrieves the sub value at the provided path, * from the value object provided. * * @method getValue * @static * @param o The object from which to extract the property value. * @param path {Array} A path array, specifying the object traversal path * from which to obtain the sub value. * @return {Any} The value stored in the path, undefined if not found, * undefined if the source is not an object. Returns the source object * if an empty path is provided. */ O.getValue = function(o, path) { if (!Y.Lang.isObject(o)) { return UNDEF; } var i, p = Y.Array(path), l = p.length; for (i = 0; o !== UNDEF && i < l; i++) { o = o[p[i]]; } return o; }; /** * Sets the sub-attribute value at the provided path on the * value object. Returns the modified value object, or * undefined if the path is invalid. * * @method setValue * @static * @param o The object on which to set the sub value. * @param path {Array} A path array, specifying the object traversal path * at which to set the sub value. * @param val {Any} The new value for the sub-attribute. * @return {Object} The modified object, with the new sub value set, or * undefined, if the path was invalid. */ O.setValue = function(o, path, val) { var i, p = Y.Array(path), leafIdx = p.length - 1, ref = o; if (leafIdx >= 0) { for (i = 0; ref !== UNDEF && i < leafIdx; i++) { ref = ref[p[i]]; } if (ref !== UNDEF) { ref[p[i]] = val; } else { return UNDEF; } } return o; }; /** * Returns true if the object has no properties of its own * @method isEmpty * @static * @return {boolean} true if the object is empty. * @since 3.2.0 */ O.isEmpty = function(o) { for (var i in o) { if (owns(o, i)) { return false; } } return true; }; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and the * core utilities for the library. * @module yui * @submodule yui-base */ /** * YUI user agent detection. * Do not fork for a browser if it can be avoided. Use feature detection when * you can. Use the user agent as a last resort. UA stores a version * number for the browser engine, 0 otherwise. This value may or may not map * to the version number of the browser using the engine. The value is * presented as a float so that it can easily be used for boolean evaluation * as well as for looking for a particular range of versions. Because of this, * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 * reports 1.8). * @class UA * @static */ /** * Static method for parsing the UA string. Defaults to assigning it's value to Y.UA * @static * @method Env.parseUA * @param {String} subUA Parse this UA string instead of navigator.userAgent * @returns {Object} The Y.UA object */ YUI.Env.parseUA = function(subUA) { var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() { return (c++ == 1) ? '' : '.'; })); }, win = Y.config.win, nav = win && win.navigator, o = { /** * Internet Explorer version number or 0. Example: 6 * @property ie * @type float * @static */ ie: 0, /** * Opera version number or 0. Example: 9.2 * @property opera * @type float * @static */ opera: 0, /** * Gecko engine revision number. Will evaluate to 1 if Gecko * is detected but the revision could not be found. Other browsers * will be 0. Example: 1.8 * <pre> * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7 * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8 * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81 * Firefox 3.0 <-- 1.9 * Firefox 3.5 <-- 1.91 * </pre> * @property gecko * @type float * @static */ gecko: 0, /** * AppleWebKit version. KHTML browsers that are not WebKit browsers * will evaluate to 1, other browsers 0. Example: 418.9 * <pre> * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the * latest available for Mac OSX 10.3. * Safari 2.0.2: 416 <-- hasOwnProperty introduced * Safari 2.0.4: 418 <-- preventDefault fixed * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run * different versions of webkit * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been * updated, but not updated * to the latest patch. * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native * SVG and many major issues fixed). * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic * update from 2.x via the 10.4.11 OS patch. * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event. * yahoo.com user agent hack removed. * </pre> * http://en.wikipedia.org/wiki/Safari_version_history * @property webkit * @type float * @static */ webkit: 0, /** * Chrome will be detected as webkit, but this property will also * be populated with the Chrome version number * @property chrome * @type float * @static */ chrome: 0, /** * The mobile property will be set to a string containing any relevant * user agent information when a modern mobile browser is detected. * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series * devices with the WebKit-based browser, and Opera Mini. * @property mobile * @type string * @static */ mobile: null, /** * Adobe AIR version number or 0. Only populated if webkit is detected. * Example: 1.0 * @property air * @type float */ air: 0, /** * Detects Apple iPad's OS version * @property ipad * @type float * @static */ ipad: 0, /** * Detects Apple iPhone's OS version * @property iphone * @type float * @static */ iphone: 0, /** * Detects Apples iPod's OS version * @property ipod * @type float * @static */ ipod: 0, /** * General truthy check for iPad, iPhone or iPod * @property ios * @type float * @static */ ios: null, /** * Detects Googles Android OS version * @property android * @type float * @static */ android: 0, /** * Detects Palms WebOS version * @property webos * @type float * @static */ webos: 0, /** * Google Caja version number or 0. * @property caja * @type float */ caja: nav && nav.cajaVersion, /** * Set to true if the page appears to be in SSL * @property secure * @type boolean * @static */ secure: false, /** * The operating system. Currently only detecting windows or macintosh * @property os * @type string * @static */ os: null }, ua = subUA || nav && nav.userAgent, loc = win && win.location, href = loc && loc.href, m; o.secure = href && (href.toLowerCase().indexOf('https') === 0); if (ua) { if ((/windows|win32/i).test(ua)) { o.os = 'windows'; } else if ((/macintosh/i).test(ua)) { o.os = 'macintosh'; } else if ((/rhino/i).test(ua)) { o.os = 'rhino'; } // Modern KHTML browsers should qualify as Safari X-Grade if ((/KHTML/).test(ua)) { o.webkit = 1; } // Modern WebKit browsers are at least X-Grade m = ua.match(/AppleWebKit\/([^\s]*)/); if (m && m[1]) { o.webkit = numberify(m[1]); // Mobile browser check if (/ Mobile\//.test(ua)) { o.mobile = 'Apple'; // iPhone or iPod Touch m = ua.match(/OS ([^\s]*)/); if (m && m[1]) { m = numberify(m[1].replace('_', '.')); } o.ios = m; o.ipad = o.ipod = o.iphone = 0; m = ua.match(/iPad|iPod|iPhone/); if (m && m[0]) { o[m[0].toLowerCase()] = o.ios; } } else { m = ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/); if (m) { // Nokia N-series, Android, webOS, ex: NokiaN95 o.mobile = m[0]; } if (/webOS/.test(ua)) { o.mobile = 'WebOS'; m = ua.match(/webOS\/([^\s]*);/); if (m && m[1]) { o.webos = numberify(m[1]); } } if (/ Android/.test(ua)) { o.mobile = 'Android'; m = ua.match(/Android ([^\s]*);/); if (m && m[1]) { o.android = numberify(m[1]); } } } m = ua.match(/Chrome\/([^\s]*)/); if (m && m[1]) { o.chrome = numberify(m[1]); // Chrome } else { m = ua.match(/AdobeAIR\/([^\s]*)/); if (m) { o.air = m[0]; // Adobe AIR 1.0 or better } } } if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr) m = ua.match(/Opera[\s\/]([^\s]*)/); if (m && m[1]) { o.opera = numberify(m[1]); m = ua.match(/Opera Mini[^;]*/); if (m) { o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit m = ua.match(/MSIE\s([^;]*)/); if (m && m[1]) { o.ie = numberify(m[1]); } else { // not opera, webkit, or ie m = ua.match(/Gecko\/([^\s]*)/); if (m) { o.gecko = 1; // Gecko detected, look for revision m = ua.match(/rv:([^\s\)]*)/); if (m && m[1]) { o.gecko = numberify(m[1]); } } } } } } YUI.Env.UA = o; return o; }; Y.UA = YUI.Env.UA || YUI.Env.parseUA(); }, '@VERSION@' ); YUI.add('get', function(Y) { /** * Provides a mechanism to fetch remote resources and * insert them into a document. * @module yui * @submodule get */ var ua = Y.UA, L = Y.Lang, TYPE_JS = 'text/javascript', TYPE_CSS = 'text/css', STYLESHEET = 'stylesheet'; /** * Fetches and inserts one or more script or link nodes into the document * @class Get * @static */ Y.Get = function() { /** * hash of queues to manage multiple requests * @property queues * @private */ var _get, _purge, _track, queues = {}, /** * queue index used to generate transaction ids * @property qidx * @type int * @private */ qidx = 0, /** * interal property used to prevent multiple simultaneous purge * processes * @property purging * @type boolean * @private */ purging, /** * Generates an HTML element, this is not appended to a document * @method _node * @param {string} type the type of element. * @param {string} attr the attributes. * @param {Window} win optional window to create the element in. * @return {HTMLElement} the generated node. * @private */ _node = function(type, attr, win) { var w = win || Y.config.win, d = w.document, n = d.createElement(type), i; for (i in attr) { if (attr[i] && attr.hasOwnProperty(i)) { n.setAttribute(i, attr[i]); } } return n; }, /** * Generates a link node * @method _linkNode * @param {string} url the url for the css file. * @param {Window} win optional window to create the node in. * @param {object} attributes optional attributes collection to apply to the * new node. * @return {HTMLElement} the generated node. * @private */ _linkNode = function(url, win, attributes) { var o = { id: Y.guid(), type: TYPE_CSS, rel: STYLESHEET, href: url }; if (attributes) { Y.mix(o, attributes); } return _node('link', o, win); }, /** * Generates a script node * @method _scriptNode * @param {string} url the url for the script file. * @param {Window} win optional window to create the node in. * @param {object} attributes optional attributes collection to apply to the * new node. * @return {HTMLElement} the generated node. * @private */ _scriptNode = function(url, win, attributes) { var o = { id: Y.guid(), type: TYPE_JS }; if (attributes) { Y.mix(o, attributes); } o.src = url; return _node('script', o, win); }, /** * Returns the data payload for callback functions. * @method _returnData * @param {object} q the queue. * @param {string} msg the result message. * @param {string} result the status message from the request. * @return {object} the state data from the request. * @private */ _returnData = function(q, msg, result) { return { tId: q.tId, win: q.win, data: q.data, nodes: q.nodes, msg: msg, statusText: result, purge: function() { _purge(this.tId); } }; }, /** * The transaction is finished * @method _end * @param {string} id the id of the request. * @param {string} msg the result message. * @param {string} result the status message from the request. * @private */ _end = function(id, msg, result) { var q = queues[id], sc; if (q && q.onEnd) { sc = q.context || q; q.onEnd.call(sc, _returnData(q, msg, result)); } }, /* * The request failed, execute fail handler with whatever * was accomplished. There isn't a failure case at the * moment unless you count aborted transactions * @method _fail * @param {string} id the id of the request * @private */ _fail = function(id, msg) { var q = queues[id], sc; if (q.timer) { // q.timer.cancel(); clearTimeout(q.timer); } // execute failure callback if (q.onFailure) { sc = q.context || q; q.onFailure.call(sc, _returnData(q, msg)); } _end(id, msg, 'failure'); }, /** * The request is complete, so executing the requester's callback * @method _finish * @param {string} id the id of the request. * @private */ _finish = function(id) { var q = queues[id], msg, sc; if (q.timer) { // q.timer.cancel(); clearTimeout(q.timer); } q.finished = true; if (q.aborted) { msg = 'transaction ' + id + ' was aborted'; _fail(id, msg); return; } // execute success callback if (q.onSuccess) { sc = q.context || q; q.onSuccess.call(sc, _returnData(q)); } _end(id, msg, 'OK'); }, /** * Timeout detected * @method _timeout * @param {string} id the id of the request. * @private */ _timeout = function(id) { var q = queues[id], sc; if (q.onTimeout) { sc = q.context || q; q.onTimeout.call(sc, _returnData(q)); } _end(id, 'timeout', 'timeout'); }, /** * Loads the next item for a given request * @method _next * @param {string} id the id of the request. * @param {string} loaded the url that was just loaded, if any. * @return {string} the result. * @private */ _next = function(id, loaded) { var q = queues[id], msg, w, d, h, n, url, s, insertBefore; if (q.timer) { // q.timer.cancel(); clearTimeout(q.timer); } if (q.aborted) { msg = 'transaction ' + id + ' was aborted'; _fail(id, msg); return; } if (loaded) { q.url.shift(); if (q.varName) { q.varName.shift(); } } else { // This is the first pass: make sure the url is an array q.url = (L.isString(q.url)) ? [q.url] : q.url; if (q.varName) { q.varName = (L.isString(q.varName)) ? [q.varName] : q.varName; } } w = q.win; d = w.document; h = d.getElementsByTagName('head')[0]; if (q.url.length === 0) { _finish(id); return; } url = q.url[0]; // if the url is undefined, this is probably a trailing comma // problem in IE. if (!url) { q.url.shift(); return _next(id); } if (q.timeout) { // q.timer = L.later(q.timeout, q, _timeout, id); q.timer = setTimeout(function() { _timeout(id); }, q.timeout); } if (q.type === 'script') { n = _scriptNode(url, w, q.attributes); } else { n = _linkNode(url, w, q.attributes); } // track this node's load progress _track(q.type, n, id, url, w, q.url.length); // add the node to the queue so we can return it to the user supplied // callback q.nodes.push(n); // add it to the head or insert it before 'insertBefore'. Work around // IE bug if there is a base tag. insertBefore = q.insertBefore || d.getElementsByTagName('base')[0]; if (insertBefore) { s = _get(insertBefore, id); if (s) { s.parentNode.insertBefore(n, s); } } else { h.appendChild(n); } // FireFox does not support the onload event for link nodes, so // there is no way to make the css requests synchronous. This means // that the css rules in multiple files could be applied out of order // in this browser if a later request returns before an earlier one. // Safari too. if ((ua.webkit || ua.gecko) && q.type === 'css') { _next(id, url); } }, /** * Removes processed queues and corresponding nodes * @method _autoPurge * @private */ _autoPurge = function() { if (purging) { return; } purging = true; var i, q; for (i in queues) { if (queues.hasOwnProperty(i)) { q = queues[i]; if (q.autopurge && q.finished) { _purge(q.tId); delete queues[i]; } } } purging = false; }, /** * Saves the state for the request and begins loading * the requested urls * @method queue * @param {string} type the type of node to insert. * @param {string} url the url to load. * @param {object} opts the hash of options for this request. * @return {object} transaction object. * @private */ _queue = function(type, url, opts) { opts = opts || {}; var id = 'q' + (qidx++), q, thresh = opts.purgethreshold || Y.Get.PURGE_THRESH; if (qidx % thresh === 0) { _autoPurge(); } queues[id] = Y.merge(opts, { tId: id, type: type, url: url, finished: false, nodes: [] }); q = queues[id]; q.win = q.win || Y.config.win; q.context = q.context || q; q.autopurge = ('autopurge' in q) ? q.autopurge : (type === 'script') ? true : false; q.attributes = q.attributes || {}; q.attributes.charset = opts.charset || q.attributes.charset || 'utf-8'; _next(id); return { tId: id }; }; /** * Detects when a node has been loaded. In the case of * script nodes, this does not guarantee that contained * script is ready to use. * @method _track * @param {string} type the type of node to track. * @param {HTMLElement} n the node to track. * @param {string} id the id of the request. * @param {string} url the url that is being loaded. * @param {Window} win the targeted window. * @param {int} qlength the number of remaining items in the queue, * including this one. * @param {Function} trackfn function to execute when finished * the default is _next. * @private */ _track = function(type, n, id, url, win, qlength, trackfn) { var f = trackfn || _next; // IE supports the readystatechange event for script and css nodes // Opera only for script nodes. Opera support onload for script // nodes, but this doesn't fire when there is a load failure. // The onreadystatechange appears to be a better way to respond // to both success and failure. if (ua.ie) { n.onreadystatechange = function() { var rs = this.readyState; if ('loaded' === rs || 'complete' === rs) { n.onreadystatechange = null; f(id, url); } }; // webkit prior to 3.x is no longer supported } else if (ua.webkit) { if (type === 'script') { // Safari 3.x supports the load event for script nodes (DOM2) n.addEventListener('load', function() { f(id, url); }); } // FireFox and Opera support onload (but not DOM2 in FF) handlers for // script nodes. Opera, but not FF, supports the onload event for link // nodes. } else { n.onload = function() { f(id, url); }; n.onerror = function(e) { _fail(id, e + ': ' + url); }; } }; _get = function(nId, tId) { var q = queues[tId], n = (L.isString(nId)) ? q.win.document.getElementById(nId) : nId; if (!n) { _fail(tId, 'target node not found: ' + nId); } return n; }; /** * Removes the nodes for the specified queue * @method _purge * @param {string} tId the transaction id. * @private */ _purge = function(tId) { var n, l, d, h, s, i, node, attr, insertBefore, q = queues[tId]; if (q) { n = q.nodes; l = n.length; d = q.win.document; h = d.getElementsByTagName('head')[0]; insertBefore = q.insertBefore || d.getElementsByTagName('base')[0]; if (insertBefore) { s = _get(insertBefore, tId); if (s) { h = s.parentNode; } } for (i = 0; i < l; i = i + 1) { node = n[i]; if (node.clearAttributes) { node.clearAttributes(); } else { for (attr in node) { if (node.hasOwnProperty(attr)) { delete node[attr]; } } } h.removeChild(node); } } q.nodes = []; }; return { /** * The number of request required before an automatic purge. * Can be configured via the 'purgethreshold' config * property PURGE_THRESH * @static * @type int * @default 20 * @private */ PURGE_THRESH: 20, /** * Called by the the helper for detecting script load in Safari * @method _finalize * @static * @param {string} id the transaction id. * @private */ _finalize: function(id) { setTimeout(function() { _finish(id); }, 0); }, /** * Abort a transaction * @method abort * @static * @param {string|object} o Either the tId or the object returned from * script() or css(). */ abort: function(o) { var id = (L.isString(o)) ? o : o.tId, q = queues[id]; if (q) { q.aborted = true; } }, /** * Fetches and inserts one or more script nodes into the head * of the current document or the document in a specified window. * * @method script * @static * @param {string|string[]} url the url or urls to the script(s). * @param {object} opts Options: * <dl> * <dt>onSuccess</dt> * <dd> * callback to execute when the script(s) are finished loading * The callback receives an object back with the following * data: * <dl> * <dt>win</dt> * <dd>the window the script(s) were inserted into</dd> * <dt>data</dt> * <dd>the data object passed in when the request was made</dd> * <dt>nodes</dt> * <dd>An array containing references to the nodes that were * inserted</dd> * <dt>purge</dt> * <dd>A function that, when executed, will remove the nodes * that were inserted</dd> * <dt> * </dl> * </dd> * <dt>onTimeout</dt> * <dd> * callback to execute when a timeout occurs. * The callback receives an object back with the following * data: * <dl> * <dt>win</dt> * <dd>the window the script(s) were inserted into</dd> * <dt>data</dt> * <dd>the data object passed in when the request was made</dd> * <dt>nodes</dt> * <dd>An array containing references to the nodes that were * inserted</dd> * <dt>purge</dt> * <dd>A function that, when executed, will remove the nodes * that were inserted</dd> * <dt> * </dl> * </dd> * <dt>onEnd</dt> * <dd>a function that executes when the transaction finishes, * regardless of the exit path</dd> * <dt>onFailure</dt> * <dd> * callback to execute when the script load operation fails * The callback receives an object back with the following * data: * <dl> * <dt>win</dt> * <dd>the window the script(s) were inserted into</dd> * <dt>data</dt> * <dd>the data object passed in when the request was made</dd> * <dt>nodes</dt> * <dd>An array containing references to the nodes that were * inserted successfully</dd> * <dt>purge</dt> * <dd>A function that, when executed, will remove any nodes * that were inserted</dd> * <dt> * </dl> * </dd> * <dt>context</dt> * <dd>the execution context for the callbacks</dd> * <dt>win</dt> * <dd>a window other than the one the utility occupies</dd> * <dt>autopurge</dt> * <dd> * setting to true will let the utilities cleanup routine purge * the script once loaded * </dd> * <dt>purgethreshold</dt> * <dd> * The number of transaction before autopurge should be initiated * </dd> * <dt>data</dt> * <dd> * data that is supplied to the callback when the script(s) are * loaded. * </dd> * <dt>insertBefore</dt> * <dd>node or node id that will become the new node's nextSibling. * If this is not specified, nodes will be inserted before a base * tag should it exist. Otherwise, the nodes will be appended to the * end of the document head.</dd> * </dl> * <dt>charset</dt> * <dd>Node charset, default utf-8 (deprecated, use the attributes * config)</dd> * <dt>attributes</dt> * <dd>An object literal containing additional attributes to add to * the link tags</dd> * <dt>timeout</dt> * <dd>Number of milliseconds to wait before aborting and firing * the timeout event</dd> * <pre> * &nbsp; Y.Get.script( * &nbsp; ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js", * &nbsp; "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"], * &nbsp; &#123; * &nbsp; onSuccess: function(o) &#123; * &nbsp; this.log("won't cause error because Y is the context"); * &nbsp; // immediately * &nbsp; &#125;, * &nbsp; onFailure: function(o) &#123; * &nbsp; &#125;, * &nbsp; onTimeout: function(o) &#123; * &nbsp; &#125;, * &nbsp; data: "foo", * &nbsp; timeout: 10000, // 10 second timeout * &nbsp; context: Y, // make the YUI instance * &nbsp; // win: otherframe // target another window/frame * &nbsp; autopurge: true // allow the utility to choose when to * &nbsp; // remove the nodes * &nbsp; purgetheshold: 1 // purge previous transaction before * &nbsp; // next transaction * &nbsp; &#125;);. * </pre> * @return {tId: string} an object containing info about the * transaction. */ script: function(url, opts) { return _queue('script', url, opts); }, /** * Fetches and inserts one or more css link nodes into the * head of the current document or the document in a specified * window. * @method css * @static * @param {string} url the url or urls to the css file(s). * @param {object} opts Options: * <dl> * <dt>onSuccess</dt> * <dd> * callback to execute when the css file(s) are finished loading * The callback receives an object back with the following * data: * <dl>win</dl> * <dd>the window the link nodes(s) were inserted into</dd> * <dt>data</dt> * <dd>the data object passed in when the request was made</dd> * <dt>nodes</dt> * <dd>An array containing references to the nodes that were * inserted</dd> * <dt>purge</dt> * <dd>A function that, when executed, will remove the nodes * that were inserted</dd> * <dt> * </dl> * </dd> * <dt>context</dt> * <dd>the execution context for the callbacks</dd> * <dt>win</dt> * <dd>a window other than the one the utility occupies</dd> * <dt>data</dt> * <dd> * data that is supplied to the callbacks when the nodes(s) are * loaded. * </dd> * <dt>insertBefore</dt> * <dd>node or node id that will become the new node's nextSibling</dd> * <dt>charset</dt> * <dd>Node charset, default utf-8 (deprecated, use the attributes * config)</dd> * <dt>attributes</dt> * <dd>An object literal containing additional attributes to add to * the link tags</dd> * </dl> * <pre> * Y.Get.css("http://localhost/css/menu.css"); * </pre> * <pre> * &nbsp; Y.Get.css( * &nbsp; ["http://localhost/css/menu.css", * &nbsp; insertBefore: 'custom-styles' // nodes will be inserted * &nbsp; // before the specified node * &nbsp; &#125;);. * </pre> * @return {tId: string} an object containing info about the * transaction. */ css: function(url, opts) { return _queue('css', url, opts); } }; }(); }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('features', function(Y) { var feature_tests = {}; Y.mix(Y.namespace('Features'), { tests: feature_tests, add: function(cat, name, o) { feature_tests[cat] = feature_tests[cat] || {}; feature_tests[cat][name] = o; }, all: function(cat, args) { var cat_o = feature_tests[cat], // results = {}; result = ''; if (cat_o) { Y.Object.each(cat_o, function(v, k) { // results[k] = Y.Features.test(cat, k, args); result += k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0) + ';'; }); } return result; }, test: function(cat, name, args) { args = args || []; var result, ua, test, cat_o = feature_tests[cat], feature = cat_o && cat_o[name]; if (!feature) { } else { result = feature.result; if (Y.Lang.isUndefined(result)) { ua = feature.ua; if (ua) { result = (Y.UA[ua]); } test = feature.test; if (test && ((!ua) || result)) { result = test.apply(Y, args); } feature.result = result; } } return result; } }); // Y.Features.add("load", "1", {}); // Y.Features.test("load", "1"); // caps=1:1;2:0;3:1; /* This file is auto-generated by src/loader/meta_join.py */ var add = Y.Features.add; // autocomplete-list-keys-sniff.js add('load', '0', { "test": function (Y) { // Only add keyboard support to autocomplete-list if this doesn't appear to // be an iOS or Android-based mobile device. // // There's currently no feasible way to actually detect whether a device has // a hardware keyboard, so this sniff will have to do. It can easily be // overridden by manually loading the autocomplete-list-keys module. // // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari // doesn't fire the keyboard events used by AutoCompleteList, so there's // no point loading the -keys module even when a bluetooth keyboard may be // available. return !(Y.UA.ios || Y.UA.android); }, "trigger": "autocomplete-list" }); // ie-style-test.js add('load', '1', { "test": function (Y) { var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win, DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', ret = false; addFeature('style', 'computedStyle', { test: function() { return WINDOW && 'getComputedStyle' in WINDOW; } }); addFeature('style', 'opacity', { test: function() { return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); return ret; }, "trigger": "dom-style" }); // 0 add('load', '2', { "trigger": "widget-base", "ua": "ie" }); // ie-base-test.js add('load', '3', { "test": function(Y) { var imp = Y.config.doc && Y.config.doc.implementation; return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }); // dd-gestures-test.js add('load', '4', { "test": function(Y) { return (Y.config.win && ('ontouchstart' in Y.config.win && !Y.UA.chrome)); }, "trigger": "dd-drag" }); // history-hash-ie-test.js add('load', '5', { "test": function (Y) { var docMode = Y.config.doc.documentMode; return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }); }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('rls', function(Y) { /** * Implentation for building the remote loader service url. * @method _rls * @param {Array} what the requested modules. * @since 3.2.0 * @return {string} the url for the remote loader service call. */ Y._rls = function(what) { var config = Y.config, // the configuration rls = config.rls || { m: 1, // required in the template v: Y.version, gv: config.gallery, env: 1, // required in the template lang: config.lang, '2in3v': config['2in3'], '2v': config.yui2, filt: config.filter, filts: config.filters, tests: 1 // required in the template }, // The rls base path rls_base = config.rls_base || 'load?', // the template rls_tmpl = config.rls_tmpl || function() { var s = '', param; for (param in rls) { if (param in rls && rls[param]) { s += param + '={' + param + '}&'; } } // console.log('rls_tmpl: ' + s); return s; }(), url; // update the request rls.m = what; rls.env = Y.Object.keys(YUI.Env.mods); rls.tests = Y.Features.all('load', [Y]); url = Y.Lang.sub(rls_base + rls_tmpl, rls); config.rls = rls; config.rls_tmpl = rls_tmpl; // console.log(url); return url; }; }, '@VERSION@' ,{requires:['get','features']}); YUI.add('intl-base', function(Y) { /** * The Intl utility provides a central location for managing sets of * localized resources (strings and formatting patterns). * * @class Intl * @uses EventTarget * @static */ var SPLIT_REGEX = /[, ]/; Y.mix(Y.namespace('Intl'), { /** * Returns the language among those available that * best matches the preferred language list, using the Lookup * algorithm of BCP 47. * If none of the available languages meets the user's preferences, * then "" is returned. * Extended language ranges are not supported. * * @method lookupBestLang * @param {String[] | String} preferredLanguages The list of preferred * languages in descending preference order, represented as BCP 47 * language tags. A string array or a comma-separated list. * @param {String[]} availableLanguages The list of languages * that the application supports, represented as BCP 47 language * tags. * * @return {String} The available language that best matches the * preferred language list, or "". * @since 3.1.0 */ lookupBestLang: function(preferredLanguages, availableLanguages) { var i, language, result, index; // check whether the list of available languages contains language; // if so return it function scan(language) { var i; for (i = 0; i < availableLanguages.length; i += 1) { if (language.toLowerCase() === availableLanguages[i].toLowerCase()) { return availableLanguages[i]; } } } if (Y.Lang.isString(preferredLanguages)) { preferredLanguages = preferredLanguages.split(SPLIT_REGEX); } for (i = 0; i < preferredLanguages.length; i += 1) { language = preferredLanguages[i]; if (!language || language === '*') { continue; } // check the fallback sequence for one language while (language.length > 0) { result = scan(language); if (result) { return result; } else { index = language.lastIndexOf('-'); if (index >= 0) { language = language.substring(0, index); // one-character subtags get cut along with the // following subtag if (index >= 2 && language.charAt(index - 2) === '-') { language = language.substring(0, index - 2); } } else { // nothing available for this language break; } } } } return ''; } }); }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui-log', function(Y) { /** * Provides console log capability and exposes a custom event for * console implementations. * @module yui * @submodule yui-log */ var INSTANCE = Y, LOGEVENT = 'yui:log', UNDEFINED = 'undefined', LEVELS = { debug: 1, info: 1, warn: 1, error: 1 }; /** * If the 'debug' config is true, a 'yui:log' event will be * dispatched, which the Console widget and anything else * can consume. If the 'useBrowserConsole' config is true, it will * write to the browser console if available. YUI-specific log * messages will only be present in the -debug versions of the * JS files. The build system is supposed to remove log statements * from the raw and minified versions of the files. * * @method log * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.log = function(msg, cat, src, silent) { var bail, excl, incl, m, f, Y = INSTANCE, c = Y.config, publisher = (Y.fire) ? Y : YUI.Env.globalEvents; // suppress log message if the config is off or the event stack // or the event call stack contains a consumer of the yui:log event if (c.debug) { // apply source filters if (src) { excl = c.logExclude; incl = c.logInclude; if (incl && !(src in incl)) { bail = 1; } else if (excl && (src in excl)) { bail = 1; } } if (!bail) { if (c.useBrowserConsole) { m = (src) ? src + ': ' + msg : msg; if (Y.Lang.isFunction(c.logFn)) { c.logFn.call(Y, msg, cat, src); } else if (typeof console != UNDEFINED && console.log) { f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log'; console[f](m); } else if (typeof opera != UNDEFINED) { opera.postError(m); } } if (publisher && !silent) { if (publisher == Y && (!publisher.getEvent(LOGEVENT))) { publisher.publish(LOGEVENT, { broadcast: 2 }); } publisher.fire(LOGEVENT, { msg: msg, cat: cat, src: src }); } } } return Y; }; /** * Write a system message. This message will be preserved in the * minified and raw versions of the YUI files, unlike log statements. * @method message * @for YUI * @param {String} msg The message to log. * @param {String} cat The log category for the message. Default * categories are "info", "warn", "error", time". * Custom categories can be used as well. (opt). * @param {String} src The source of the the message (opt). * @param {boolean} silent If true, the log event won't fire. * @return {YUI} YUI instance. */ INSTANCE.message = function() { return INSTANCE.log.apply(INSTANCE, arguments); }; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui-later', function(Y) { /** * Provides a setTimeout/setInterval wrapper * @module yui * @submodule yui-later */ /** * Executes the supplied function in the context of the supplied * object 'when' milliseconds later. Executes the function a * single time unless periodic is set to true. * @method later * @for YUI * @param when {int} the number of milliseconds to wait until the fn * is executed. * @param o the context object. * @param fn {Function|String} the function to execute or the name of * the method in the 'o' object to execute. * @param data [Array] data that is provided to the function. This * accepts either a single item or an array. If an array is provided, * the function is executed with one parameter for each array item. * If you need to pass a single array parameter, it needs to be wrapped * in an array [myarray]. * @param periodic {boolean} if true, executes continuously at supplied * interval until canceled. * @return {object} a timer object. Call the cancel() method on this * object to stop the timer. */ Y.later = function(when, o, fn, data, periodic) { when = when || 0; var m = fn, f, id; if (o && Y.Lang.isString(fn)) { m = o[fn]; } f = !Y.Lang.isUndefined(data) ? function() { m.apply(o, Y.Array(data)); } : function() { m.call(o); }; id = (periodic) ? setInterval(f, when) : setTimeout(f, when); return { id: id, interval: periodic, cancel: function() { if (this.interval) { clearInterval(id); } else { clearTimeout(id); } } }; }; Y.Lang.later = Y.later; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui-throttle', function(Y) { /** * Provides a throttle/limiter for function calls * @module yui * @submodule yui-throttle */ /*! Based on work by Simon Willison: http://gist.github.com/292562 */ /** * Throttles a call to a method based on the time between calls. * @method throttle * @for YUI * @param fn {function} The function call to throttle. * @param ms {int} The number of milliseconds to throttle the method call. * Can set globally with Y.config.throttleTime or by call. Passing a -1 will * disable the throttle. Defaults to 150. * @return {function} Returns a wrapped function that calls fn throttled. * @since 3.1.0 */ Y.throttle = function(fn, ms) { ms = (ms) ? ms : (Y.config.throttleTime || 150); if (ms === -1) { return (function() { fn.apply(null, arguments); }); } var last = Y.Lang.now(); return (function() { var now = Y.Lang.now(); if (now - last > ms) { last = now; fn.apply(null, arguments); } }); }; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('yui', function(Y){}, '@VERSION@' ,{use:['yui-base','get','features','rls','intl-base','yui-log','yui-later','yui-throttle']}); YUI.add('oop', function(Y) { /** * Supplies object inheritance and manipulation utilities. This adds * additional functionaity to what is provided in yui-base, and the * methods are applied directly to the YUI instance. This module * is required for most YUI components. * @module oop */ /** * The following methods are added to the YUI instance * @class YUI~oop */ var L = Y.Lang, A = Y.Array, OP = Object.prototype, CLONE_MARKER = '_~yuim~_', EACH = 'each', SOME = 'some', dispatch = function(o, f, c, proto, action) { if (o && o[action] && o !== Y) { return o[action].call(o, f, c); } else { switch (A.test(o)) { case 1: return A[action](o, f, c); case 2: return A[action](Y.Array(o, 0, true), f, c); default: return Y.Object[action](o, f, c, proto); } } }; /** * Applies prototype properties from the supplier to the receiver. * The receiver can be a constructor or an instance. * @method augment * @param {function} r the object to receive the augmentation. * @param {function} s the object that supplies the properties to augment. * @param {boolean} ov if true, properties already on the receiver * will be overwritten if found on the supplier. * @param {string[]} wl a whitelist. If supplied, only properties in * this list will be applied to the receiver. * @param {Array | Any} args arg or arguments to apply to the supplier * constructor when initializing. * @return {object} the augmented object. * * @todo constructor optional? * @todo understanding what an instance is augmented with * @todo best practices for overriding sequestered methods. */ Y.augment = function(r, s, ov, wl, args) { var sProto = s.prototype, newProto = null, construct = s, a = (args) ? Y.Array(args) : [], rProto = r.prototype, target = rProto || r, applyConstructor = false, sequestered, replacements; // working on a class, so apply constructor infrastructure if (rProto && construct) { sequestered = {}; replacements = {}; newProto = {}; // sequester all of the functions in the supplier and replace with // one that will restore all of them. Y.Object.each(sProto, function(v, k) { replacements[k] = function() { // overwrite the prototype with all of the sequestered functions, // but only if it hasn't been overridden for (var i in sequestered) { if (sequestered.hasOwnProperty(i) && (this[i] === replacements[i])) { this[i] = sequestered[i]; } } // apply the constructor construct.apply(this, a); // apply the original sequestered function return sequestered[k].apply(this, arguments); }; if ((!wl || (k in wl)) && (ov || !(k in this))) { if (L.isFunction(v)) { // sequester the function sequestered[k] = v; // replace the sequestered function with a function that will // restore all sequestered functions and exectue the constructor. this[k] = replacements[k]; } else { this[k] = v; } } }, newProto, true); // augmenting an instance, so apply the constructor immediately } else { applyConstructor = true; } Y.mix(target, newProto || sProto, ov, wl); if (applyConstructor) { s.apply(target, a); } return r; }; /** * Applies object properties from the supplier to the receiver. If * the target has the property, and the property is an object, the target * object will be augmented with the supplier's value. If the property * is an array, the suppliers value will be appended to the target. * @method aggregate * @param {function} r the object to receive the augmentation. * @param {function} s the object that supplies the properties to augment. * @param {boolean} ov if true, properties already on the receiver * will be overwritten if found on the supplier. * @param {string[]} wl a whitelist. If supplied, only properties in * this list will be applied to the receiver. * @return {object} the extended object. */ Y.aggregate = function(r, s, ov, wl) { return Y.mix(r, s, ov, wl, 0, true); }; /** * Utility to set up the prototype, constructor and superclass properties to * support an inheritance strategy that can chain constructors and methods. * Static members will not be inherited. * * @method extend * @param {function} r the object to modify. * @param {function} s the object to inherit. * @param {object} px prototype properties to add/override. * @param {object} sx static properties to add/override. * @return {object} the extended object. */ Y.extend = function(r, s, px, sx) { if (!s || !r) { Y.error('extend failed, verify dependencies'); } var sp = s.prototype, rp = Y.Object(sp); r.prototype = rp; rp.constructor = r; r.superclass = sp; // assign constructor property if (s != Object && sp.constructor == OP.constructor) { sp.constructor = s; } // add prototype overrides if (px) { Y.mix(rp, px, true); } // add object overrides if (sx) { Y.mix(r, sx, true); } return r; }; /** * Executes the supplied function for each item in * a collection. Supports arrays, objects, and * Y.NodeLists * @method each * @param {object} o the object to iterate. * @param {function} f the function to execute. This function * receives the value, key, and object as parameters. * @param {object} c the execution context for the function. * @param {boolean} proto if true, prototype properties are * iterated on objects. * @return {YUI} the YUI instance. */ Y.each = function(o, f, c, proto) { return dispatch(o, f, c, proto, EACH); }; /** * Executes the supplied function for each item in * a collection. The operation stops if the function * returns true. Supports arrays, objects, and * Y.NodeLists. * @method some * @param {object} o the object to iterate. * @param {function} f the function to execute. This function * receives the value, key, and object as parameters. * @param {object} c the execution context for the function. * @param {boolean} proto if true, prototype properties are * iterated on objects. * @return {boolean} true if the function ever returns true, * false otherwise. */ Y.some = function(o, f, c, proto) { return dispatch(o, f, c, proto, SOME); }; /** * Deep obj/array copy. Function clones are actually * wrappers around the original function. * Array-like objects are treated as arrays. * Primitives are returned untouched. Optionally, a * function can be provided to handle other data types, * filter keys, validate values, etc. * * @method clone * @param {object} o what to clone. * @param {boolean} safe if true, objects will not have prototype * items from the source. If false, they will. In this case, the * original is initially protected, but the clone is not completely * immune from changes to the source object prototype. Also, cloned * prototype items that are deleted from the clone will result * in the value of the source prototype being exposed. If operating * on a non-safe clone, items should be nulled out rather than deleted. * @param {function} f optional function to apply to each item in a * collection; it will be executed prior to applying the value to * the new object. Return false to prevent the copy. * @param {object} c optional execution context for f. * @param {object} owner Owner object passed when clone is iterating * an object. Used to set up context for cloned functions. * @param {object} cloned hash of previously cloned objects to avoid * multiple clones. * @return {Array|Object} the cloned object. */ Y.clone = function(o, safe, f, c, owner, cloned) { if (!L.isObject(o)) { return o; } // @todo cloning YUI instances doesn't currently work if (Y.instanceOf(o, YUI)) { return o; } var o2, marked = cloned || {}, stamp, yeach = Y.each; switch (L.type(o)) { case 'date': return new Date(o); case 'regexp': // if we do this we need to set the flags too // return new RegExp(o.source); return o; case 'function': // o2 = Y.bind(o, owner); // break; return o; case 'array': o2 = []; break; default: // #2528250 only one clone of a given object should be created. if (o[CLONE_MARKER]) { return marked[o[CLONE_MARKER]]; } stamp = Y.guid(); o2 = (safe) ? {} : Y.Object(o); o[CLONE_MARKER] = stamp; marked[stamp] = o; } // #2528250 don't try to clone element properties if (!o.addEventListener && !o.attachEvent) { yeach(o, function(v, k) { if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) { if (k !== CLONE_MARKER) { if (k == 'prototype') { // skip the prototype // } else if (o[k] === o) { // this[k] = this; } else { this[k] = Y.clone(v, safe, f, c, owner || o, marked); } } } }, o2); } if (!cloned) { Y.Object.each(marked, function(v, k) { if (v[CLONE_MARKER]) { try { delete v[CLONE_MARKER]; } catch (e) { v[CLONE_MARKER] = null; } } }, this); marked = null; } return o2; }; /** * Returns a function that will execute the supplied function in the * supplied object's context, optionally adding any additional * supplied parameters to the beginning of the arguments collection the * supplied to the function. * * @method bind * @param {Function|String} f the function to bind, or a function name * to execute on the context object. * @param {object} c the execution context. * @param {any} args* 0..n arguments to include before the arguments the * function is executed with. * @return {function} the wrapped function. */ Y.bind = function(f, c) { var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null; return function() { var fn = L.isString(f) ? c[f] : f, args = (xargs) ? xargs.concat(Y.Array(arguments, 0, true)) : arguments; return fn.apply(c || fn, args); }; }; /** * Returns a function that will execute the supplied function in the * supplied object's context, optionally adding any additional * supplied parameters to the end of the arguments the function * is executed with. * * @method rbind * @param {Function|String} f the function to bind, or a function name * to execute on the context object. * @param {object} c the execution context. * @param {any} args* 0..n arguments to append to the end of * arguments collection supplied to the function. * @return {function} the wrapped function. */ Y.rbind = function(f, c) { var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null; return function() { var fn = L.isString(f) ? c[f] : f, args = (xargs) ? Y.Array(arguments, 0, true).concat(xargs) : arguments; return fn.apply(c || fn, args); }; }; }, '@VERSION@' ); YUI.add('dom-base', function(Y) { (function(Y) { /** * The DOM utility provides a cross-browser abtraction layer * normalizing DOM tasks, and adds extra helper functionality * for other common tasks. * @module dom * @submodule dom-base * @for DOM * */ /** * Provides DOM helper methods. * @class DOM * */ var NODE_TYPE = 'nodeType', OWNER_DOCUMENT = 'ownerDocument', DOCUMENT_ELEMENT = 'documentElement', DEFAULT_VIEW = 'defaultView', PARENT_WINDOW = 'parentWindow', TAG_NAME = 'tagName', PARENT_NODE = 'parentNode', FIRST_CHILD = 'firstChild', PREVIOUS_SIBLING = 'previousSibling', NEXT_SIBLING = 'nextSibling', CONTAINS = 'contains', COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition', EMPTY_STRING = '', EMPTY_ARRAY = [], documentElement = Y.config.doc.documentElement, re_tag = /<([a-z]+)/i, createFromDIV = function(html, tag) { var div = Y.config.doc.createElement('div'), ret = true; div.innerHTML = html; if (!div.firstChild || div.firstChild.tagName !== tag.toUpperCase()) { ret = false; } return ret; }, addFeature = Y.Features.add, testFeature = Y.Features.test, Y_DOM = { /** * Returns the HTMLElement with the given ID (Wrapper for document.getElementById). * @method byId * @param {String} id the id attribute * @param {Object} doc optional The document to search. Defaults to current document * @return {HTMLElement | null} The HTMLElement with the id, or null if none found. */ byId: function(id, doc) { // handle dupe IDs and IE name collision return Y_DOM.allById(id, doc)[0] || null; }, /** * Returns the text content of the HTMLElement. * @method getText * @param {HTMLElement} element The html element. * @return {String} The text content of the element (includes text of any descending elements). */ getText: (documentElement.textContent !== undefined) ? function(element) { var ret = ''; if (element) { ret = element.textContent; } return ret || ''; } : function(element) { var ret = ''; if (element) { ret = element.innerText || element.nodeValue; // might be a textNode } return ret || ''; }, /** * Sets the text content of the HTMLElement. * @method setText * @param {HTMLElement} element The html element. * @param {String} content The content to add. */ setText: (documentElement.textContent !== undefined) ? function(element, content) { if (element) { element.textContent = content; } } : function(element, content) { if ('innerText' in element) { element.innerText = content; } else if ('nodeValue' in element) { element.nodeValue = content; } }, /* * Finds the ancestor of the element. * @method ancestor * @param {HTMLElement} element The html element. * @param {Function} fn optional An optional boolean test to apply. * The optional function is passed the current DOM node being tested as its only argument. * If no function is given, the parentNode is returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @return {HTMLElement | null} The matching DOM node or null if none found. */ ancestor: function(element, fn, testSelf) { var ret = null; if (testSelf) { ret = (!fn || fn(element)) ? element : null; } return ret || Y_DOM.elementByAxis(element, PARENT_NODE, fn, null); }, /* * Finds the ancestors of the element. * @method ancestors * @param {HTMLElement} element The html element. * @param {Function} fn optional An optional boolean test to apply. * The optional function is passed the current DOM node being tested as its only argument. * If no function is given, all ancestors are returned. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @return {Array} An array containing all matching DOM nodes. */ ancestors: function(element, fn, testSelf) { var ancestor = Y_DOM.ancestor.apply(Y_DOM, arguments), ret = (ancestor) ? [ancestor] : []; while ((ancestor = Y_DOM.ancestor(ancestor, fn))) { if (ancestor) { ret.unshift(ancestor); } } return ret; }, /** * Searches the element by the given axis for the first matching element. * @method elementByAxis * @param {HTMLElement} element The html element. * @param {String} axis The axis to search (parentNode, nextSibling, previousSibling). * @param {Function} fn optional An optional boolean test to apply. * @param {Boolean} all optional Whether all node types should be returned, or just element nodes. * The optional function is passed the current HTMLElement being tested as its only argument. * If no function is given, the first element is returned. * @return {HTMLElement | null} The matching element or null if none found. */ elementByAxis: function(element, axis, fn, all) { while (element && (element = element[axis])) { // NOTE: assignment if ( (all || element[TAG_NAME]) && (!fn || fn(element)) ) { return element; } } return null; }, /** * Determines whether or not one HTMLElement is or contains another HTMLElement. * @method contains * @param {HTMLElement} element The containing html element. * @param {HTMLElement} needle The html element that may be contained. * @return {Boolean} Whether or not the element is or contains the needle. */ contains: function(element, needle) { var ret = false; if ( !needle || !element || !needle[NODE_TYPE] || !element[NODE_TYPE]) { ret = false; } else if (element[CONTAINS]) { if (Y.UA.opera || needle[NODE_TYPE] === 1) { // IE & SAF contains fail if needle not an ELEMENT_NODE ret = element[CONTAINS](needle); } else { ret = Y_DOM._bruteContains(element, needle); } } else if (element[COMPARE_DOCUMENT_POSITION]) { // gecko if (element === needle || !!(element[COMPARE_DOCUMENT_POSITION](needle) & 16)) { ret = true; } } return ret; }, /** * Determines whether or not the HTMLElement is part of the document. * @method inDoc * @param {HTMLElement} element The containing html element. * @param {HTMLElement} doc optional The document to check. * @return {Boolean} Whether or not the element is attached to the document. */ inDoc: function(element, doc) { var ret = false, rootNode; if (element && element.nodeType) { (doc) || (doc = element[OWNER_DOCUMENT]); rootNode = doc[DOCUMENT_ELEMENT]; // contains only works with HTML_ELEMENT if (rootNode && rootNode.contains && element.tagName) { ret = rootNode.contains(element); } else { ret = Y_DOM.contains(rootNode, element); } } return ret; }, allById: function(id, root) { root = root || Y.config.doc; var nodes = [], ret = [], i, node; if (root.querySelectorAll) { ret = root.querySelectorAll('[id="' + id + '"]'); } else if (root.all) { nodes = root.all(id); if (nodes) { // root.all may return HTMLElement or HTMLCollection. // some elements are also HTMLCollection (FORM, SELECT). if (nodes.nodeName) { if (nodes.id === id) { // avoid false positive on name ret.push(nodes); nodes = EMPTY_ARRAY; // done, no need to filter } else { // prep for filtering nodes = [nodes]; } } if (nodes.length) { // filter out matches on node.name // and element.id as reference to element with id === 'id' for (i = 0; node = nodes[i++];) { if (node.id === id || (node.attributes && node.attributes.id && node.attributes.id.value === id)) { ret.push(node); } } } } } else { ret = [Y_DOM._getDoc(root).getElementById(id)]; } return ret; }, /** * Creates a new dom node using the provided markup string. * @method create * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {HTMLElement|DocumentFragment} returns a single HTMLElement * when creating one node, and a documentFragment when creating * multiple nodes. */ create: function(html, doc) { if (typeof html === 'string') { html = Y.Lang.trim(html); // match IE which trims whitespace from innerHTML } doc = doc || Y.config.doc; var m = re_tag.exec(html), create = Y_DOM._create, custom = Y_DOM.creators, ret = null, creator, tag, nodes; if (html != undefined) { // not undefined or null if (m && m[1]) { creator = custom[m[1].toLowerCase()]; if (typeof creator === 'function') { create = creator; } else { tag = creator; } } nodes = create(html, doc, tag).childNodes; if (nodes.length === 1) { // return single node, breaking parentNode ref from "fragment" ret = nodes[0].parentNode.removeChild(nodes[0]); } else if (nodes[0] && nodes[0].className === 'yui3-big-dummy') { // using dummy node to preserve some attributes (e.g. OPTION not selected) if (nodes.length === 2) { ret = nodes[0].nextSibling; } else { nodes[0].parentNode.removeChild(nodes[0]); ret = Y_DOM._nl2frag(nodes, doc); } } else { // return multiple nodes as a fragment ret = Y_DOM._nl2frag(nodes, doc); } } return ret; }, _nl2frag: function(nodes, doc) { var ret = null, i, len; if (nodes && (nodes.push || nodes.item) && nodes[0]) { doc = doc || nodes[0].ownerDocument; ret = doc.createDocumentFragment(); if (nodes.item) { // convert live list to static array nodes = Y.Array(nodes, 0, true); } for (i = 0, len = nodes.length; i < len; i++) { ret.appendChild(nodes[i]); } } // else inline with log for minification return ret; }, CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8 'for': 'htmlFor', 'class': 'className' } : { // w3c 'htmlFor': 'for', 'className': 'class' }, /** * Provides a normalized attribute interface. * @method setAttibute * @param {HTMLElement} el The target element for the attribute. * @param {String} attr The attribute to set. * @param {String} val The value of the attribute. */ setAttribute: function(el, attr, val, ieAttr) { if (el && attr && el.setAttribute) { attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr; el.setAttribute(attr, val, ieAttr); } }, /** * Provides a normalized attribute interface. * @method getAttibute * @param {HTMLElement} el The target element for the attribute. * @param {String} attr The attribute to get. * @return {String} The current value of the attribute. */ getAttribute: function(el, attr, ieAttr) { ieAttr = (ieAttr !== undefined) ? ieAttr : 2; var ret = ''; if (el && attr && el.getAttribute) { attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr; ret = el.getAttribute(attr, ieAttr); if (ret === null) { ret = ''; // per DOM spec } } return ret; }, isWindow: function(obj) { return !!(obj && obj.alert && obj.document); }, _fragClones: {}, _create: function(html, doc, tag) { tag = tag || 'div'; var frag = Y_DOM._fragClones[tag]; if (frag) { frag = frag.cloneNode(false); } else { frag = Y_DOM._fragClones[tag] = doc.createElement(tag); } frag.innerHTML = html; return frag; }, _removeChildNodes: function(node) { while (node.firstChild) { node.removeChild(node.firstChild); } }, /** * Inserts content in a node at the given location * @method addHTML * @param {HTMLElement} node The node to insert into * @param {HTMLElement | Array | HTMLCollection} content The content to be inserted * @param {HTMLElement} where Where to insert the content * If no "where" is given, content is appended to the node * Possible values for "where" * <dl> * <dt>HTMLElement</dt> * <dd>The element to insert before</dd> * <dt>"replace"</dt> * <dd>Replaces the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts before the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts content before the node</dd> * <dt>"after"</dt> * <dd>Inserts content after the node</dd> * </dl> */ addHTML: function(node, content, where) { var nodeParent = node.parentNode, i = 0, item, ret = content, newNode; if (content != undefined) { // not null or undefined (maybe 0) if (content.nodeType) { // DOM node, just add it newNode = content; } else if (typeof content == 'string' || typeof content == 'number') { ret = newNode = Y_DOM.create(content); } else if (content[0] && content[0].nodeType) { // array or collection newNode = Y.config.doc.createDocumentFragment(); while ((item = content[i++])) { newNode.appendChild(item); // append to fragment for insertion } } } if (where) { if (where.nodeType) { // insert regardless of relationship to node where.parentNode.insertBefore(newNode, where); } else { switch (where) { case 'replace': while (node.firstChild) { node.removeChild(node.firstChild); } if (newNode) { // allow empty content to clear node node.appendChild(newNode); } break; case 'before': nodeParent.insertBefore(newNode, node); break; case 'after': if (node.nextSibling) { // IE errors if refNode is null nodeParent.insertBefore(newNode, node.nextSibling); } else { nodeParent.appendChild(newNode); } break; default: node.appendChild(newNode); } } } else if (newNode) { node.appendChild(newNode); } return ret; }, VALUE_SETTERS: {}, VALUE_GETTERS: {}, getValue: function(node) { var ret = '', // TODO: return null? getter; if (node && node[TAG_NAME]) { getter = Y_DOM.VALUE_GETTERS[node[TAG_NAME].toLowerCase()]; if (getter) { ret = getter(node); } else { ret = node.value; } } // workaround for IE8 JSON stringify bug // which converts empty string values to null if (ret === EMPTY_STRING) { ret = EMPTY_STRING; // for real } return (typeof ret === 'string') ? ret : ''; }, setValue: function(node, val) { var setter; if (node && node[TAG_NAME]) { setter = Y_DOM.VALUE_SETTERS[node[TAG_NAME].toLowerCase()]; if (setter) { setter(node, val); } else { node.value = val; } } }, siblings: function(node, fn) { var nodes = [], sibling = node; while ((sibling = sibling[PREVIOUS_SIBLING])) { if (sibling[TAG_NAME] && (!fn || fn(sibling))) { nodes.unshift(sibling); } } sibling = node; while ((sibling = sibling[NEXT_SIBLING])) { if (sibling[TAG_NAME] && (!fn || fn(sibling))) { nodes.push(sibling); } } return nodes; }, /** * Brute force version of contains. * Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc). * @method _bruteContains * @private * @param {HTMLElement} element The containing html element. * @param {HTMLElement} needle The html element that may be contained. * @return {Boolean} Whether or not the element is or contains the needle. */ _bruteContains: function(element, needle) { while (needle) { if (element === needle) { return true; } needle = needle.parentNode; } return false; }, // TODO: move to Lang? /** * Memoizes dynamic regular expressions to boost runtime performance. * @method _getRegExp * @private * @param {String} str The string to convert to a regular expression. * @param {String} flags optional An optinal string of flags. * @return {RegExp} An instance of RegExp */ _getRegExp: function(str, flags) { flags = flags || ''; Y_DOM._regexCache = Y_DOM._regexCache || {}; if (!Y_DOM._regexCache[str + flags]) { Y_DOM._regexCache[str + flags] = new RegExp(str, flags); } return Y_DOM._regexCache[str + flags]; }, // TODO: make getDoc/Win true privates? /** * returns the appropriate document. * @method _getDoc * @private * @param {HTMLElement} element optional Target element. * @return {Object} The document for the given element or the default document. */ _getDoc: function(element) { var doc = Y.config.doc; if (element) { doc = (element[NODE_TYPE] === 9) ? element : // element === document element[OWNER_DOCUMENT] || // element === DOM node element.document || // element === window Y.config.doc; // default } return doc; }, /** * returns the appropriate window. * @method _getWin * @private * @param {HTMLElement} element optional Target element. * @return {Object} The window for the given element or the default window. */ _getWin: function(element) { var doc = Y_DOM._getDoc(element); return doc[DEFAULT_VIEW] || doc[PARENT_WINDOW] || Y.config.win; }, _batch: function(nodes, fn, arg1, arg2, arg3, etc) { fn = (typeof fn === 'string') ? Y_DOM[fn] : fn; var result, args = Array.prototype.slice.call(arguments, 2), i = 0, node, ret; if (fn && nodes) { while ((node = nodes[i++])) { result = result = fn.call(Y_DOM, node, arg1, arg2, arg3, etc); if (typeof result !== 'undefined') { (ret) || (ret = []); ret.push(result); } } } return (typeof ret !== 'undefined') ? ret : nodes; }, wrap: function(node, html) { var parent = Y.DOM.create(html), nodes = parent.getElementsByTagName('*'); if (nodes.length) { parent = nodes[nodes.length - 1]; } if (node.parentNode) { node.parentNode.replaceChild(parent, node); } parent.appendChild(node); }, unwrap: function(node) { var parent = node.parentNode, lastChild = parent.lastChild, node = parent.firstChild, next = node, grandparent; if (parent) { grandparent = parent.parentNode; if (grandparent) { while (node !== lastChild) { next = node.nextSibling; grandparent.insertBefore(node, parent); node = next; } grandparent.replaceChild(lastChild, parent); } else { parent.removeChild(node); } } }, generateID: function(el) { var id = el.id; if (!id) { id = Y.stamp(el); el.id = id; } return id; }, creators: {} }; addFeature('innerhtml', 'table', { test: function() { var node = Y.config.doc.createElement('table'); try { node.innerHTML = '<tbody></tbody>'; } catch(e) { return false; } return (node.firstChild && node.firstChild.nodeName === 'TBODY'); } }); addFeature('innerhtml-div', 'tr', { test: function() { return createFromDIV('<tr></tr>', 'tr'); } }); addFeature('innerhtml-div', 'script', { test: function() { return createFromDIV('<script></script>', 'script'); } }); addFeature('value-set', 'select', { test: function() { var node = Y.config.doc.createElement('select'); node.innerHTML = '<option>1</option><option>2</option>'; node.value = '2'; return (node.value && node.value === '2'); } }); (function(Y) { var creators = Y_DOM.creators, create = Y_DOM.create, re_tbody = /(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/, TABLE_OPEN = '<table>', TABLE_CLOSE = '</table>'; if (!testFeature('innerhtml', 'table')) { // TODO: thead/tfoot with nested tbody // IE adds TBODY when creating TABLE elements (which may share this impl) creators.tbody = function(html, doc) { var frag = create(TABLE_OPEN + html + TABLE_CLOSE, doc), tb = frag.children.tags('tbody')[0]; if (frag.children.length > 1 && tb && !re_tbody.test(html)) { tb[PARENT_NODE].removeChild(tb); // strip extraneous tbody } return frag; }; } if (!testFeature('innerhtml-div', 'script')) { creators.script = function(html, doc) { var frag = doc.createElement('div'); frag.innerHTML = '-' + html; frag.removeChild(frag[FIRST_CHILD]); return frag; } Y_DOM.creators.link = Y_DOM.creators.style = Y_DOM.creators.script; } if (!testFeature('value-set', 'select')) { Y_DOM.VALUE_SETTERS.select = function(node, val) { for (var i = 0, options = node.getElementsByTagName('option'), option; option = options[i++];) { if (Y_DOM.getValue(option) === val) { option.selected = true; //Y_DOM.setAttribute(option, 'selected', 'selected'); break; } } } } Y.mix(Y_DOM.VALUE_GETTERS, { button: function(node) { return (node.attributes && node.attributes.value) ? node.attributes.value.value : ''; } }); Y.mix(Y_DOM.VALUE_SETTERS, { // IE: node.value changes the button text, which should be handled via innerHTML button: function(node, val) { var attr = node.attributes.value; if (!attr) { attr = node[OWNER_DOCUMENT].createAttribute('value'); node.setAttributeNode(attr); } attr.value = val; } }); if (!testFeature('innerhtml-div', 'tr')) { Y.mix(creators, { option: function(html, doc) { return create('<select><option class="yui3-big-dummy" selected></option>' + html + '</select>', doc); }, tr: function(html, doc) { return create('<tbody>' + html + '</tbody>', doc); }, td: function(html, doc) { return create('<tr>' + html + '</tr>', doc); }, col: function(html, doc) { return create('<colgroup>' + html + '</colgroup>', doc); }, tbody: 'table' }); Y.mix(creators, { legend: 'fieldset', th: creators.td, thead: creators.tbody, tfoot: creators.tbody, caption: creators.tbody, colgroup: creators.tbody, optgroup: creators.option }); } Y.mix(Y_DOM.VALUE_GETTERS, { option: function(node) { var attrs = node.attributes; return (attrs.value && attrs.value.specified) ? node.value : node.text; }, select: function(node) { var val = node.value, options = node.options; if (options && options.length) { // TODO: implement multipe select if (node.multiple) { } else { val = Y_DOM.getValue(options[node.selectedIndex]); } } return val; } }); })(Y); Y.DOM = Y_DOM; })(Y); var addClass, hasClass, removeClass; Y.mix(Y.DOM, { /** * Determines whether a DOM element has the given className. * @method hasClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to search for * @return {Boolean} Whether or not the element has the given class. */ hasClass: function(node, className) { var re = Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)'); return re.test(node.className); }, /** * Adds a class name to a given DOM element. * @method addClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to add to the class attribute */ addClass: function(node, className) { if (!Y.DOM.hasClass(node, className)) { // skip if already present node.className = Y.Lang.trim([node.className, className].join(' ')); } }, /** * Removes a class name from a given element. * @method removeClass * @for DOM * @param {HTMLElement} element The DOM element. * @param {String} className the class name to remove from the class attribute */ removeClass: function(node, className) { if (className && hasClass(node, className)) { node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\s+)' + className + '(?:\\s+|$)'), ' ')); if ( hasClass(node, className) ) { // in case of multiple adjacent removeClass(node, className); } } }, /** * Replace a class with another class for a given element. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @for DOM * @param {HTMLElement} element The DOM element * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name */ replaceClass: function(node, oldC, newC) { removeClass(node, oldC); // remove first in case oldC === newC addClass(node, newC); }, /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @for DOM * @param {HTMLElement} element The DOM element * @param {String} className the class name to be toggled * @param {Boolean} addClass optional boolean to indicate whether class * should be added or removed regardless of current state */ toggleClass: function(node, className, force) { var add = (force !== undefined) ? force : !(hasClass(node, className)); if (add) { addClass(node, className); } else { removeClass(node, className); } } }); hasClass = Y.DOM.hasClass; removeClass = Y.DOM.removeClass; addClass = Y.DOM.addClass; Y.mix(Y.DOM, { /** * Sets the width of the element to the given size, regardless * of box model, border, padding, etc. * @method setWidth * @param {HTMLElement} element The DOM element. * @param {String|Int} size The pixel height to size to */ setWidth: function(node, size) { Y.DOM._setSize(node, 'width', size); }, /** * Sets the height of the element to the given size, regardless * of box model, border, padding, etc. * @method setHeight * @param {HTMLElement} element The DOM element. * @param {String|Int} size The pixel height to size to */ setHeight: function(node, size) { Y.DOM._setSize(node, 'height', size); }, _setSize: function(node, prop, val) { val = (val > 0) ? val : 0; var size = 0; node.style[prop] = val + 'px'; size = (prop === 'height') ? node.offsetHeight : node.offsetWidth; if (size > val) { val = val - (size - val); if (val < 0) { val = 0; } node.style[prop] = val + 'px'; } } }); }, '@VERSION@' ,{requires:['oop']}); YUI.add('dom-style', function(Y) { (function(Y) { /** * Add style management functionality to DOM. * @module dom * @submodule dom-style * @for DOM */ var DOCUMENT_ELEMENT = 'documentElement', DEFAULT_VIEW = 'defaultView', OWNER_DOCUMENT = 'ownerDocument', STYLE = 'style', FLOAT = 'float', CSS_FLOAT = 'cssFloat', STYLE_FLOAT = 'styleFloat', TRANSPARENT = 'transparent', GET_COMPUTED_STYLE = 'getComputedStyle', GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect', WINDOW = Y.config.win, DOCUMENT = Y.config.doc, UNDEFINED = undefined, Y_DOM = Y.DOM, TRANSFORM = 'transform', VENDOR_TRANSFORM = [ 'WebkitTransform', 'MozTransform', 'OTransform' ], re_color = /color$/i, re_unit = /width|height|top|left|right|bottom|margin|padding/i; Y.Array.each(VENDOR_TRANSFORM, function(val) { if (val in DOCUMENT[DOCUMENT_ELEMENT].style) { TRANSFORM = val; } }); Y.mix(Y_DOM, { DEFAULT_UNIT: 'px', CUSTOM_STYLES: { }, /** * Sets a style property for a given element. * @method setStyle * @param {HTMLElement} An HTMLElement to apply the style to. * @param {String} att The style property to set. * @param {String|Number} val The value. */ setStyle: function(node, att, val, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES; if (style) { if (val === null || val === '') { // normalize unsetting val = ''; } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit val += Y_DOM.DEFAULT_UNIT; } if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].set) { CUSTOM_STYLES[att].set(node, val, style); return; // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } else if (att === '') { // unset inline styles att = 'cssText'; val = ''; } style[att] = val; } }, /** * Returns the current style value for the given property. * @method getStyle * @param {HTMLElement} An HTMLElement to get the style from. * @param {String} att The style property to get. */ getStyle: function(node, att, style) { style = style || node.style; var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES, val = ''; if (style) { if (att in CUSTOM_STYLES) { if (CUSTOM_STYLES[att].get) { return CUSTOM_STYLES[att].get(node, att, style); // NOTE: return } else if (typeof CUSTOM_STYLES[att] === 'string') { att = CUSTOM_STYLES[att]; } } val = style[att]; if (val === '') { // TODO: is empty string sufficient? val = Y_DOM[GET_COMPUTED_STYLE](node, att); } } return val; }, /** * Sets multiple style properties. * @method setStyles * @param {HTMLElement} node An HTMLElement to apply the styles to. * @param {Object} hash An object literal of property:value pairs. */ setStyles: function(node, hash) { var style = node.style; Y.each(hash, function(v, n) { Y_DOM.setStyle(node, n, v, style); }, Y_DOM); }, /** * Returns the computed style for the given node. * @method getComputedStyle * @param {HTMLElement} An HTMLElement to get the style from. * @param {String} att The style property to get. * @return {String} The computed value of the style property. */ getComputedStyle: function(node, att) { var val = '', doc = node[OWNER_DOCUMENT]; if (node[STYLE] && doc[DEFAULT_VIEW] && doc[DEFAULT_VIEW][GET_COMPUTED_STYLE]) { val = doc[DEFAULT_VIEW][GET_COMPUTED_STYLE](node, null)[att]; } return val; } }); // normalize reserved word float alternatives ("cssFloat" or "styleFloat") if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][CSS_FLOAT] !== UNDEFINED) { Y_DOM.CUSTOM_STYLES[FLOAT] = CSS_FLOAT; } else if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][STYLE_FLOAT] !== UNDEFINED) { Y_DOM.CUSTOM_STYLES[FLOAT] = STYLE_FLOAT; } // fix opera computedStyle default color unit (convert to rgb) if (Y.UA.opera) { Y_DOM[GET_COMPUTED_STYLE] = function(node, att) { var view = node[OWNER_DOCUMENT][DEFAULT_VIEW], val = view[GET_COMPUTED_STYLE](node, '')[att]; if (re_color.test(att)) { val = Y.Color.toRGB(val); } return val; }; } // safari converts transparent to rgba(), others use "transparent" if (Y.UA.webkit) { Y_DOM[GET_COMPUTED_STYLE] = function(node, att) { var view = node[OWNER_DOCUMENT][DEFAULT_VIEW], val = view[GET_COMPUTED_STYLE](node, '')[att]; if (val === 'rgba(0, 0, 0, 0)') { val = TRANSPARENT; } return val; }; } Y.DOM._getAttrOffset = function(node, attr) { var val = Y.DOM[GET_COMPUTED_STYLE](node, attr), offsetParent = node.offsetParent, position, parentOffset, offset; if (val === 'auto') { position = Y.DOM.getStyle(node, 'position'); if (position === 'static' || position === 'relative') { val = 0; } else if (offsetParent && offsetParent[GET_BOUNDING_CLIENT_RECT]) { parentOffset = offsetParent[GET_BOUNDING_CLIENT_RECT]()[attr]; offset = node[GET_BOUNDING_CLIENT_RECT]()[attr]; if (attr === 'left' || attr === 'top') { val = offset - parentOffset; } else { val = parentOffset - node[GET_BOUNDING_CLIENT_RECT]()[attr]; } } } return val; }; Y.DOM._getOffset = function(node) { var pos, xy = null; if (node) { pos = Y_DOM.getStyle(node, 'position'); xy = [ parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'left'), 10), parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'top'), 10) ]; if ( isNaN(xy[0]) ) { // in case of 'auto' xy[0] = parseInt(Y_DOM.getStyle(node, 'left'), 10); // try inline if ( isNaN(xy[0]) ) { // default to offset value xy[0] = (pos === 'relative') ? 0 : node.offsetLeft || 0; } } if ( isNaN(xy[1]) ) { // in case of 'auto' xy[1] = parseInt(Y_DOM.getStyle(node, 'top'), 10); // try inline if ( isNaN(xy[1]) ) { // default to offset value xy[1] = (pos === 'relative') ? 0 : node.offsetTop || 0; } } } return xy; }; Y_DOM.CUSTOM_STYLES.transform = { set: function(node, val, style) { style[TRANSFORM] = val; }, get: function(node, style) { return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORM); } }; })(Y); (function(Y) { var PARSE_INT = parseInt, RE = RegExp; Y.Color = { KEYWORDS: { black: '000', silver: 'c0c0c0', gray: '808080', white: 'fff', maroon: '800000', red: 'f00', purple: '800080', fuchsia: 'f0f', green: '008000', lime: '0f0', olive: '808000', yellow: 'ff0', navy: '000080', blue: '00f', teal: '008080', aqua: '0ff' }, re_RGB: /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i, re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i, re_hex3: /([0-9A-F])/gi, toRGB: function(val) { if (!Y.Color.re_RGB.test(val)) { val = Y.Color.toHex(val); } if(Y.Color.re_hex.exec(val)) { val = 'rgb(' + [ PARSE_INT(RE.$1, 16), PARSE_INT(RE.$2, 16), PARSE_INT(RE.$3, 16) ].join(', ') + ')'; } return val; }, toHex: function(val) { val = Y.Color.KEYWORDS[val] || val; if (Y.Color.re_RGB.exec(val)) { val = [ Number(RE.$1).toString(16), Number(RE.$2).toString(16), Number(RE.$3).toString(16) ]; for (var i = 0; i < val.length; i++) { if (val[i].length < 2) { val[i] = '0' + val[i]; } } val = val.join(''); } if (val.length < 6) { val = val.replace(Y.Color.re_hex3, '$1$1'); } if (val !== 'transparent' && val.indexOf('#') < 0) { val = '#' + val; } return val.toUpperCase(); } }; })(Y); }, '@VERSION@' ,{requires:['dom-base']}); YUI.add('dom-screen', function(Y) { (function(Y) { /** * Adds position and region management functionality to DOM. * @module dom * @submodule dom-screen * @for DOM */ var DOCUMENT_ELEMENT = 'documentElement', COMPAT_MODE = 'compatMode', POSITION = 'position', FIXED = 'fixed', RELATIVE = 'relative', LEFT = 'left', TOP = 'top', _BACK_COMPAT = 'BackCompat', MEDIUM = 'medium', BORDER_LEFT_WIDTH = 'borderLeftWidth', BORDER_TOP_WIDTH = 'borderTopWidth', GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect', GET_COMPUTED_STYLE = 'getComputedStyle', Y_DOM = Y.DOM, // TODO: how about thead/tbody/tfoot/tr? // TODO: does caption matter? RE_TABLE = /^t(?:able|d|h)$/i, SCROLL_NODE; if (Y.UA.ie) { if (Y.config.doc[COMPAT_MODE] !== 'quirks') { SCROLL_NODE = DOCUMENT_ELEMENT; } else { SCROLL_NODE = 'body'; } } Y.mix(Y_DOM, { /** * Returns the inner height of the viewport (exludes scrollbar). * @method winHeight * @return {Number} The current height of the viewport. */ winHeight: function(node) { var h = Y_DOM._getWinSize(node).height; return h; }, /** * Returns the inner width of the viewport (exludes scrollbar). * @method winWidth * @return {Number} The current width of the viewport. */ winWidth: function(node) { var w = Y_DOM._getWinSize(node).width; return w; }, /** * Document height * @method docHeight * @return {Number} The current height of the document. */ docHeight: function(node) { var h = Y_DOM._getDocSize(node).height; return Math.max(h, Y_DOM._getWinSize(node).height); }, /** * Document width * @method docWidth * @return {Number} The current width of the document. */ docWidth: function(node) { var w = Y_DOM._getDocSize(node).width; return Math.max(w, Y_DOM._getWinSize(node).width); }, /** * Amount page has been scroll horizontally * @method docScrollX * @return {Number} The current amount the screen is scrolled horizontally. */ docScrollX: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization var dv = doc.defaultView, pageOffset = (dv) ? dv.pageXOffset : 0; return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft, pageOffset); }, /** * Amount page has been scroll vertically * @method docScrollY * @return {Number} The current amount the screen is scrolled vertically. */ docScrollY: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization var dv = doc.defaultView, pageOffset = (dv) ? dv.pageYOffset : 0; return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop, pageOffset); }, /** * Gets the current position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getXY * @param element The target element * @return {Array} The XY position of the element TODO: test inDocument/display? */ getXY: function() { if (Y.config.doc[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) { return function(node) { var xy = null, scrollLeft, scrollTop, box, off1, off2, bLeft, bTop, mode, doc, inDoc, rootNode; if (node && node.tagName) { doc = node.ownerDocument; rootNode = doc[DOCUMENT_ELEMENT]; // inline inDoc check for perf if (rootNode.contains) { inDoc = rootNode.contains(node); } else { inDoc = Y.DOM.contains(rootNode, node); } if (inDoc) { scrollLeft = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollLeft : Y_DOM.docScrollX(node, doc); scrollTop = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollTop : Y_DOM.docScrollY(node, doc); box = node[GET_BOUNDING_CLIENT_RECT](); xy = [box.left, box.top]; if (Y.UA.ie) { off1 = 2; off2 = 2; mode = doc[COMPAT_MODE]; bLeft = Y_DOM[GET_COMPUTED_STYLE](doc[DOCUMENT_ELEMENT], BORDER_LEFT_WIDTH); bTop = Y_DOM[GET_COMPUTED_STYLE](doc[DOCUMENT_ELEMENT], BORDER_TOP_WIDTH); if (Y.UA.ie === 6) { if (mode !== _BACK_COMPAT) { off1 = 0; off2 = 0; } } if ((mode == _BACK_COMPAT)) { if (bLeft !== MEDIUM) { off1 = parseInt(bLeft, 10); } if (bTop !== MEDIUM) { off2 = parseInt(bTop, 10); } } xy[0] -= off1; xy[1] -= off2; } if ((scrollTop || scrollLeft)) { if (!Y.UA.ios) { xy[0] += scrollLeft; xy[1] += scrollTop; } } } else { xy = Y_DOM._getOffset(node); } } return xy; } } else { return function(node) { // manually calculate by crawling up offsetParents //Calculate the Top and Left border sizes (assumes pixels) var xy = null, doc, parentNode, bCheck, scrollTop, scrollLeft; if (node) { if (Y_DOM.inDoc(node)) { xy = [node.offsetLeft, node.offsetTop]; doc = node.ownerDocument; parentNode = node; // TODO: refactor with !! or just falsey bCheck = ((Y.UA.gecko || Y.UA.webkit > 519) ? true : false); // TODO: worth refactoring for TOP/LEFT only? while ((parentNode = parentNode.offsetParent)) { xy[0] += parentNode.offsetLeft; xy[1] += parentNode.offsetTop; if (bCheck) { xy = Y_DOM._calcBorders(parentNode, xy); } } // account for any scrolled ancestors if (Y_DOM.getStyle(node, POSITION) != FIXED) { parentNode = node; while ((parentNode = parentNode.parentNode)) { scrollTop = parentNode.scrollTop; scrollLeft = parentNode.scrollLeft; //Firefox does something funky with borders when overflow is not visible. if (Y.UA.gecko && (Y_DOM.getStyle(parentNode, 'overflow') !== 'visible')) { xy = Y_DOM._calcBorders(parentNode, xy); } if (scrollTop || scrollLeft) { xy[0] -= scrollLeft; xy[1] -= scrollTop; } } xy[0] += Y_DOM.docScrollX(node, doc); xy[1] += Y_DOM.docScrollY(node, doc); } else { //Fix FIXED position -- add scrollbars xy[0] += Y_DOM.docScrollX(node, doc); xy[1] += Y_DOM.docScrollY(node, doc); } } else { xy = Y_DOM._getOffset(node); } } return xy; }; } }(),// NOTE: Executing for loadtime branching /** * Gets the current X position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getX * @param element The target element * @return {Int} The X position of the element */ getX: function(node) { return Y_DOM.getXY(node)[0]; }, /** * Gets the current Y position of an element based on page coordinates. * Element must be part of the DOM tree to have page coordinates * (display:none or elements not appended return false). * @method getY * @param element The target element * @return {Int} The Y position of the element */ getY: function(node) { return Y_DOM.getXY(node)[1]; }, /** * Set the position of an html element in page coordinates. * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setXY * @param element The target element * @param {Array} xy Contains X & Y values for new position (coordinates are page-based) * @param {Boolean} noRetry By default we try and set the position a second time if the first fails */ setXY: function(node, xy, noRetry) { var setStyle = Y_DOM.setStyle, pos, delta, newXY, currentXY; if (node && xy) { pos = Y_DOM.getStyle(node, POSITION); delta = Y_DOM._getOffset(node); if (pos == 'static') { // default to relative pos = RELATIVE; setStyle(node, POSITION, pos); } currentXY = Y_DOM.getXY(node); if (xy[0] !== null) { setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px'); } if (xy[1] !== null) { setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px'); } if (!noRetry) { newXY = Y_DOM.getXY(node); if (newXY[0] !== xy[0] || newXY[1] !== xy[1]) { Y_DOM.setXY(node, xy, true); } } } else { } }, /** * Set the X position of an html element in page coordinates, regardless of how the element is positioned. * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setX * @param element The target element * @param {Int} x The X values for new position (coordinates are page-based) */ setX: function(node, x) { return Y_DOM.setXY(node, [x, null]); }, /** * Set the Y position of an html element in page coordinates, regardless of how the element is positioned. * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false). * @method setY * @param element The target element * @param {Int} y The Y values for new position (coordinates are page-based) */ setY: function(node, y) { return Y_DOM.setXY(node, [null, y]); }, /** * @method swapXY * @description Swap the xy position with another node * @param {Node} node The node to swap with * @param {Node} otherNode The other node to swap with * @return {Node} */ swapXY: function(node, otherNode) { var xy = Y_DOM.getXY(node); Y_DOM.setXY(node, Y_DOM.getXY(otherNode)); Y_DOM.setXY(otherNode, xy); }, _calcBorders: function(node, xy2) { var t = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0, l = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0; if (Y.UA.gecko) { if (RE_TABLE.test(node.tagName)) { t = 0; l = 0; } } xy2[0] += l; xy2[1] += t; return xy2; }, _getWinSize: function(node, doc) { doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; var win = doc.defaultView || doc.parentWindow, mode = doc[COMPAT_MODE], h = win.innerHeight, w = win.innerWidth, root = doc[DOCUMENT_ELEMENT]; if ( mode && !Y.UA.opera ) { // IE, Gecko if (mode != 'CSS1Compat') { // Quirks root = doc.body; } h = root.clientHeight; w = root.clientWidth; } return { height: h, width: w }; }, _getDocSize: function(node) { var doc = (node) ? Y_DOM._getDoc(node) : Y.config.doc, root = doc[DOCUMENT_ELEMENT]; if (doc[COMPAT_MODE] != 'CSS1Compat') { root = doc.body; } return { height: root.scrollHeight, width: root.scrollWidth }; } }); })(Y); (function(Y) { var TOP = 'top', RIGHT = 'right', BOTTOM = 'bottom', LEFT = 'left', getOffsets = function(r1, r2) { var t = Math.max(r1[TOP], r2[TOP]), r = Math.min(r1[RIGHT], r2[RIGHT]), b = Math.min(r1[BOTTOM], r2[BOTTOM]), l = Math.max(r1[LEFT], r2[LEFT]), ret = {}; ret[TOP] = t; ret[RIGHT] = r; ret[BOTTOM] = b; ret[LEFT] = l; return ret; }, DOM = Y.DOM; Y.mix(DOM, { /** * Returns an Object literal containing the following about this element: (top, right, bottom, left) * @for DOM * @method region * @param {HTMLElement} element The DOM element. @return {Object} Object literal containing the following about this element: (top, right, bottom, left) */ region: function(node) { var xy = DOM.getXY(node), ret = false; if (node && xy) { ret = DOM._getRegion( xy[1], // top xy[0] + node.offsetWidth, // right xy[1] + node.offsetHeight, // bottom xy[0] // left ); } return ret; }, /** * Find the intersect information for the passes nodes. * @method intersect * @for DOM * @param {HTMLElement} element The first element * @param {HTMLElement | Object} element2 The element or region to check the interect with * @param {Object} altRegion An object literal containing the region for the first element if we already have the data (for performance i.e. DragDrop) @return {Object} Object literal containing the following intersection data: (top, right, bottom, left, area, yoff, xoff, inRegion) */ intersect: function(node, node2, altRegion) { var r = altRegion || DOM.region(node), region = {}, n = node2, off; if (n.tagName) { region = DOM.region(n); } else if (Y.Lang.isObject(node2)) { region = node2; } else { return false; } off = getOffsets(region, r); return { top: off[TOP], right: off[RIGHT], bottom: off[BOTTOM], left: off[LEFT], area: ((off[BOTTOM] - off[TOP]) * (off[RIGHT] - off[LEFT])), yoff: ((off[BOTTOM] - off[TOP])), xoff: (off[RIGHT] - off[LEFT]), inRegion: DOM.inRegion(node, node2, false, altRegion) }; }, /** * Check if any part of this node is in the passed region * @method inRegion * @for DOM * @param {Object} node2 The node to get the region from or an Object literal of the region * $param {Boolean} all Should all of the node be inside the region * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance i.e. DragDrop) * @return {Boolean} True if in region, false if not. */ inRegion: function(node, node2, all, altRegion) { var region = {}, r = altRegion || DOM.region(node), n = node2, off; if (n.tagName) { region = DOM.region(n); } else if (Y.Lang.isObject(node2)) { region = node2; } else { return false; } if (all) { return ( r[LEFT] >= region[LEFT] && r[RIGHT] <= region[RIGHT] && r[TOP] >= region[TOP] && r[BOTTOM] <= region[BOTTOM] ); } else { off = getOffsets(region, r); if (off[BOTTOM] >= off[TOP] && off[RIGHT] >= off[LEFT]) { return true; } else { return false; } } }, /** * Check if any part of this element is in the viewport * @method inViewportRegion * @for DOM * @param {HTMLElement} element The DOM element. * @param {Boolean} all Should all of the node be inside the region * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance i.e. DragDrop) * @return {Boolean} True if in region, false if not. */ inViewportRegion: function(node, all, altRegion) { return DOM.inRegion(node, DOM.viewportRegion(node), all, altRegion); }, _getRegion: function(t, r, b, l) { var region = {}; region[TOP] = region[1] = t; region[LEFT] = region[0] = l; region[BOTTOM] = b; region[RIGHT] = r; region.width = region[RIGHT] - region[LEFT]; region.height = region[BOTTOM] - region[TOP]; return region; }, /** * Returns an Object literal containing the following about the visible region of viewport: (top, right, bottom, left) * @method viewportRegion * @for DOM * @return {Object} Object literal containing the following about the visible region of the viewport: (top, right, bottom, left) */ viewportRegion: function(node) { node = node || Y.config.doc.documentElement; var ret = false, scrollX, scrollY; if (node) { scrollX = DOM.docScrollX(node); scrollY = DOM.docScrollY(node); ret = DOM._getRegion(scrollY, // top DOM.winWidth(node) + scrollX, // right scrollY + DOM.winHeight(node), // bottom scrollX); // left } return ret; } }); })(Y); }, '@VERSION@' ,{requires:['dom-base', 'dom-style', 'event-base']}); YUI.add('selector-native', function(Y) { (function(Y) { /** * The selector-native module provides support for native querySelector * @module dom * @submodule selector-native * @for Selector */ /** * Provides support for using CSS selectors to query the DOM * @class Selector * @static * @for Selector */ Y.namespace('Selector'); // allow native module to standalone var COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition', OWNER_DOCUMENT = 'ownerDocument'; var Selector = { _foundCache: [], useNative: true, _compare: ('sourceIndex' in Y.config.doc.documentElement) ? function(nodeA, nodeB) { var a = nodeA.sourceIndex, b = nodeB.sourceIndex; if (a === b) { return 0; } else if (a > b) { return 1; } return -1; } : (Y.config.doc.documentElement[COMPARE_DOCUMENT_POSITION] ? function(nodeA, nodeB) { if (nodeA[COMPARE_DOCUMENT_POSITION](nodeB) & 4) { return -1; } else { return 1; } } : function(nodeA, nodeB) { var rangeA, rangeB, compare; if (nodeA && nodeB) { rangeA = nodeA[OWNER_DOCUMENT].createRange(); rangeA.setStart(nodeA, 0); rangeB = nodeB[OWNER_DOCUMENT].createRange(); rangeB.setStart(nodeB, 0); compare = rangeA.compareBoundaryPoints(1, rangeB); // 1 === Range.START_TO_END } return compare; }), _sort: function(nodes) { if (nodes) { nodes = Y.Array(nodes, 0, true); if (nodes.sort) { nodes.sort(Selector._compare); } } return nodes; }, _deDupe: function(nodes) { var ret = [], i, node; for (i = 0; (node = nodes[i++]);) { if (!node._found) { ret[ret.length] = node; node._found = true; } } for (i = 0; (node = ret[i++]);) { node._found = null; node.removeAttribute('_found'); } return ret; }, /** * Retrieves a set of nodes based on a given CSS selector. * @method query * * @param {string} selector The CSS Selector to test the node against. * @param {HTMLElement} root optional An HTMLElement to start the query from. Defaults to Y.config.doc * @param {Boolean} firstOnly optional Whether or not to return only the first match. * @return {Array} An array of nodes that match the given selector. * @static */ query: function(selector, root, firstOnly, skipNative) { root = root || Y.config.doc; var ret = [], useNative = (Y.Selector.useNative && Y.config.doc.querySelector && !skipNative), queries = [[selector, root]], query, result, i, fn = (useNative) ? Y.Selector._nativeQuery : Y.Selector._bruteQuery; if (selector && fn) { // split group into seperate queries if (!skipNative && // already done if skipping (!useNative || root.tagName)) { // split native when element scoping is needed queries = Selector._splitQueries(selector, root); } for (i = 0; (query = queries[i++]);) { result = fn(query[0], query[1], firstOnly); if (!firstOnly) { // coerce DOM Collection to Array result = Y.Array(result, 0, true); } if (result) { ret = ret.concat(result); } } if (queries.length > 1) { // remove dupes and sort by doc order ret = Selector._sort(Selector._deDupe(ret)); } } return (firstOnly) ? (ret[0] || null) : ret; }, // allows element scoped queries to begin with combinator // e.g. query('> p', document.body) === query('body > p') _splitQueries: function(selector, node) { var groups = selector.split(','), queries = [], prefix = '', i, len; if (node) { // enforce for element scoping if (node.tagName) { node.id = node.id || Y.guid(); prefix = '[id="' + node.id + '"] '; } for (i = 0, len = groups.length; i < len; ++i) { selector = prefix + groups[i]; queries.push([selector, node]); } } return queries; }, _nativeQuery: function(selector, root, one) { if (Y.UA.webkit && selector.indexOf(':checked') > -1 && (Y.Selector.pseudos && Y.Selector.pseudos.checked)) { // webkit (chrome, safari) fails to find "selected" return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query } try { return root['querySelector' + (one ? '' : 'All')](selector); } catch(e) { // fallback to brute if available return Y.Selector.query(selector, root, one, true); // redo with skipNative true } }, filter: function(nodes, selector) { var ret = [], i, node; if (nodes && selector) { for (i = 0; (node = nodes[i++]);) { if (Y.Selector.test(node, selector)) { ret[ret.length] = node; } } } else { } return ret; }, test: function(node, selector, root) { var ret = false, groups = selector.split(','), useFrag = false, parent, item, items, frag, i, j, group; if (node && node.tagName) { // only test HTMLElements // we need a root if off-doc if (!root && !Y.DOM.inDoc(node)) { parent = node.parentNode; if (parent) { root = parent; } else { // only use frag when no parent to query frag = node[OWNER_DOCUMENT].createDocumentFragment(); frag.appendChild(node); root = frag; useFrag = true; } } root = root || node[OWNER_DOCUMENT]; if (!node.id) { node.id = Y.guid(); } for (i = 0; (group = groups[i++]);) { // TODO: off-dom test group += '[id="' + node.id + '"]'; items = Y.Selector.query(group, root); for (j = 0; item = items[j++];) { if (item === node) { ret = true; break; } } if (ret) { break; } } if (useFrag) { // cleanup frag.removeChild(node); } } return ret; }, /** * A convenience function to emulate Y.Node's aNode.ancestor(selector). * @param {HTMLElement} element An HTMLElement to start the query from. * @param {String} selector The CSS selector to test the node against. * @return {HTMLElement} The ancestor node matching the selector, or null. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * @static * @method ancestor */ ancestor: function (element, selector, testSelf) { return Y.DOM.ancestor(element, function(n) { return Y.Selector.test(n, selector); }, testSelf); } }; Y.mix(Y.Selector, Selector, true); })(Y); }, '@VERSION@' ,{requires:['dom-base']}); YUI.add('selector-css2', function(Y) { /** * The selector module provides helper methods allowing CSS2 Selectors to be used with DOM elements. * @module dom * @submodule selector-css2 * @for Selector */ /** * Provides helper methods for collecting and filtering DOM elements. */ var PARENT_NODE = 'parentNode', TAG_NAME = 'tagName', ATTRIBUTES = 'attributes', COMBINATOR = 'combinator', PSEUDOS = 'pseudos', Selector = Y.Selector, SelectorCSS2 = { _reRegExpTokens: /([\^\$\?\[\]\*\+\-\.\(\)\|\\])/, // TODO: move? SORT_RESULTS: true, _children: function(node, tag) { var ret = node.children, i, children = [], childNodes, child; if (node.children && tag && node.children.tags) { children = node.children.tags(tag); } else if ((!ret && node[TAG_NAME]) || (ret && tag)) { // only HTMLElements have children childNodes = ret || node.childNodes; ret = []; for (i = 0; (child = childNodes[i++]);) { if (child.tagName) { if (!tag || tag === child.tagName) { ret.push(child); } } } } return ret || []; }, _re: { //attr: /(\[.*\])/g, attr: /(\[[^\]]*\])/g, pseudos: /:([\-\w]+(?:\(?:['"]?(.+)['"]?\)))*/i }, /** * Mapping of shorthand tokens to corresponding attribute selector * @property shorthand * @type object */ shorthand: { '\\#(-?[_a-z]+[-\\w]*)': '[id=$1]', '\\.(-?[_a-z]+[-\\w]*)': '[className~=$1]' }, /** * List of operators and corresponding boolean functions. * These functions are passed the attribute and the current node's value of the attribute. * @property operators * @type object */ operators: { '': function(node, attr) { return Y.DOM.getAttribute(node, attr) !== ''; }, // Just test for existence of attribute //'': '.+', //'=': '^{val}$', // equality '~=': '(?:^|\\s+){val}(?:\\s+|$)', // space-delimited '|=': '^{val}-?' // optional hyphen-delimited }, pseudos: { 'first-child': function(node) { return Y.Selector._children(node[PARENT_NODE])[0] === node; } }, _bruteQuery: function(selector, root, firstOnly) { var ret = [], nodes = [], tokens = Selector._tokenize(selector), token = tokens[tokens.length - 1], rootDoc = Y.DOM._getDoc(root), child, id, className, tagName; // if we have an initial ID, set to root when in document /* if (tokens[0] && rootDoc === root && (id = tokens[0].id) && rootDoc.getElementById(id)) { root = rootDoc.getElementById(id); } */ if (token) { // prefilter nodes id = token.id; className = token.className; tagName = token.tagName || '*'; if (root.getElementsByTagName) { // non-IE lacks DOM api on doc frags // try ID first, unless no root.all && root not in document // (root.all works off document, but not getElementById) // TODO: move to allById? if (id && (root.all || (root.nodeType === 9 || Y.DOM.inDoc(root)))) { nodes = Y.DOM.allById(id, root); // try className } else if (className) { nodes = root.getElementsByClassName(className); } else { // default to tagName nodes = root.getElementsByTagName(tagName); } } else { // brute getElementsByTagName('*') child = root.firstChild; while (child) { if (child.tagName) { // only collect HTMLElements nodes.push(child); } child = child.nextSilbing || child.firstChild; } } if (nodes.length) { ret = Selector._filterNodes(nodes, tokens, firstOnly); } } return ret; }, _filterNodes: function(nodes, tokens, firstOnly) { var i = 0, j, len = tokens.length, n = len - 1, result = [], node = nodes[0], tmpNode = node, getters = Y.Selector.getters, operator, combinator, token, path, pass, //FUNCTION = 'function', value, tests, test; //do { for (i = 0; (tmpNode = node = nodes[i++]);) { n = len - 1; path = null; testLoop: while (tmpNode && tmpNode.tagName) { token = tokens[n]; tests = token.tests; j = tests.length; if (j && !pass) { while ((test = tests[--j])) { operator = test[1]; if (getters[test[0]]) { value = getters[test[0]](tmpNode, test[0]); } else { value = tmpNode[test[0]]; // use getAttribute for non-standard attributes if (value === undefined && tmpNode.getAttribute) { value = tmpNode.getAttribute(test[0]); } } if ((operator === '=' && value !== test[2]) || // fast path for equality (typeof operator !== 'string' && // protect against String.test monkey-patch (Moo) operator.test && !operator.test(value)) || // regex test (!operator.test && // protect against RegExp as function (webkit) typeof operator === 'function' && !operator(tmpNode, test[0]))) { // function test // skip non element nodes or non-matching tags if ((tmpNode = tmpNode[path])) { while (tmpNode && (!tmpNode.tagName || (token.tagName && token.tagName !== tmpNode.tagName)) ) { tmpNode = tmpNode[path]; } } continue testLoop; } } } n--; // move to next token // now that we've passed the test, move up the tree by combinator if (!pass && (combinator = token.combinator)) { path = combinator.axis; tmpNode = tmpNode[path]; // skip non element nodes while (tmpNode && !tmpNode.tagName) { tmpNode = tmpNode[path]; } if (combinator.direct) { // one pass only path = null; } } else { // success if we made it this far result.push(node); if (firstOnly) { return result; } break; } } }// while (tmpNode = node = nodes[++i]); node = tmpNode = null; return result; }, combinators: { ' ': { axis: 'parentNode' }, '>': { axis: 'parentNode', direct: true }, '+': { axis: 'previousSibling', direct: true } }, _parsers: [ { name: ATTRIBUTES, re: /^\[(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i, fn: function(match, token) { var operator = match[2] || '', operators = Y.Selector.operators, test; // add prefiltering for ID and CLASS if ((match[1] === 'id' && operator === '=') || (match[1] === 'className' && Y.config.doc.documentElement.getElementsByClassName && (operator === '~=' || operator === '='))) { token.prefilter = match[1]; token[match[1]] = match[3]; } // add tests if (operator in operators) { test = operators[operator]; if (typeof test === 'string') { match[3] = match[3].replace(Y.Selector._reRegExpTokens, '\\$1'); test = Y.DOM._getRegExp(test.replace('{val}', match[3])); } match[2] = test; } if (!token.last || token.prefilter !== match[1]) { return match.slice(1); } } }, { name: TAG_NAME, re: /^((?:-?[_a-z]+[\w-]*)|\*)/i, fn: function(match, token) { var tag = match[1].toUpperCase(); token.tagName = tag; if (tag !== '*' && (!token.last || token.prefilter)) { return [TAG_NAME, '=', tag]; } if (!token.prefilter) { token.prefilter = 'tagName'; } } }, { name: COMBINATOR, re: /^\s*([>+~]|\s)\s*/, fn: function(match, token) { } }, { name: PSEUDOS, re: /^:([\-\w]+)(?:\(['"]?(.+)['"]?\))*/i, fn: function(match, token) { var test = Selector[PSEUDOS][match[1]]; if (test) { // reorder match array return [match[2], test]; } else { // selector token not supported (possibly missing CSS3 module) return false; } } } ], _getToken: function(token) { return { tagName: null, id: null, className: null, attributes: {}, combinator: null, tests: [] }; }, /** Break selector into token units per simple selector. Combinator is attached to the previous token. */ _tokenize: function(selector) { selector = selector || ''; selector = Selector._replaceShorthand(Y.Lang.trim(selector)); var token = Selector._getToken(), // one token per simple selector (left selector holds combinator) query = selector, // original query for debug report tokens = [], // array of tokens found = false, // whether or not any matches were found this pass match, // the regex match test, i, parser; /* Search for selector patterns, store, and strip them from the selector string until no patterns match (invalid selector) or we run out of chars. Multiple attributes and pseudos are allowed, in any order. for example: 'form:first-child[type=button]:not(button)[lang|=en]' */ outer: do { found = false; // reset after full pass for (i = 0; (parser = Selector._parsers[i++]);) { if ( (match = parser.re.exec(selector)) ) { // note assignment if (parser.name !== COMBINATOR ) { token.selector = selector; } selector = selector.replace(match[0], ''); // strip current match from selector if (!selector.length) { token.last = true; } if (Selector._attrFilters[match[1]]) { // convert class to className, etc. match[1] = Selector._attrFilters[match[1]]; } test = parser.fn(match, token); if (test === false) { // selector not supported found = false; break outer; } else if (test) { token.tests.push(test); } if (!selector.length || parser.name === COMBINATOR) { tokens.push(token); token = Selector._getToken(token); if (parser.name === COMBINATOR) { token.combinator = Y.Selector.combinators[match[1]]; } } found = true; } } } while (found && selector.length); if (!found || selector.length) { // not fully parsed tokens = []; } return tokens; }, _replaceShorthand: function(selector) { var shorthand = Selector.shorthand, attrs = selector.match(Selector._re.attr), // pull attributes to avoid false pos on "." and "#" pseudos = selector.match(Selector._re.pseudos), // pull attributes to avoid false pos on "." and "#" re, i, len; if (pseudos) { selector = selector.replace(Selector._re.pseudos, '!!REPLACED_PSEUDO!!'); } if (attrs) { selector = selector.replace(Selector._re.attr, '!!REPLACED_ATTRIBUTE!!'); } for (re in shorthand) { if (shorthand.hasOwnProperty(re)) { selector = selector.replace(Y.DOM._getRegExp(re, 'gi'), shorthand[re]); } } if (attrs) { for (i = 0, len = attrs.length; i < len; ++i) { selector = selector.replace('!!REPLACED_ATTRIBUTE!!', attrs[i]); } } if (pseudos) { for (i = 0, len = pseudos.length; i < len; ++i) { selector = selector.replace('!!REPLACED_PSEUDO!!', pseudos[i]); } } return selector; }, _attrFilters: { 'class': 'className', 'for': 'htmlFor' }, getters: { href: function(node, attr) { return Y.DOM.getAttribute(node, attr); } } }; Y.mix(Y.Selector, SelectorCSS2, true); Y.Selector.getters.src = Y.Selector.getters.rel = Y.Selector.getters.href; // IE wants class with native queries if (Y.Selector.useNative && Y.config.doc.querySelector) { Y.Selector.shorthand['\\.(-?[_a-z]+[-\\w]*)'] = '[class~=$1]'; } }, '@VERSION@' ,{requires:['selector-native']}); YUI.add('selector', function(Y){}, '@VERSION@' ,{use:['selector-native', 'selector-css2']}); YUI.add('dom', function(Y){}, '@VERSION@' ,{use:['dom-base', 'dom-style', 'dom-screen', 'selector']}); YUI.add('event-custom-base', function(Y) { /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom */ Y.Env.evt = { handles: {}, plugins: {} }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * Allows for the insertion of methods that are executed before or after * a specified method * @class Do * @static */ var DO_BEFORE = 0, DO_AFTER = 1, DO = { /** * Cache of objects touched by the utility * @property objs * @static */ objs: {}, /** * Execute the supplied method before the specified function * @method before * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * when the event fires. * @return {string} handle for the subscription * @static */ before: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_BEFORE, f, obj, sFn); }, /** * Execute the supplied method after the specified function * @method after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return {string} handle for the subscription * @static */ after: function(fn, obj, sFn, c) { var f = fn, a; if (c) { a = [fn, c].concat(Y.Array(arguments, 4, true)); f = Y.rbind.apply(Y, a); } return this._inject(DO_AFTER, f, obj, sFn); }, /** * Execute the supplied method after the specified function * @method _inject * @param when {string} before or after * @param fn {Function} the function to execute * @param obj the object hosting the method to displace * @param sFn {string} the name of the method to displace * @param c The execution context for fn * @return {string} handle for the subscription * @private * @static */ _inject: function(when, fn, obj, sFn) { // object id var id = Y.stamp(obj), o, sid; if (! this.objs[id]) { // create a map entry for the obj if it doesn't exist this.objs[id] = {}; } o = this.objs[id]; if (! o[sFn]) { // create a map entry for the method if it doesn't exist o[sFn] = new Y.Do.Method(obj, sFn); // re-route the method to our wrapper obj[sFn] = function() { return o[sFn].exec.apply(o[sFn], arguments); }; } // subscriber id sid = id + Y.stamp(fn) + sFn; // register the callback o[sFn].register(sid, fn, when); return new Y.EventHandle(o[sFn], sid); }, /** * Detach a before or after subscription * @method detach * @param handle {string} the subscription handle */ detach: function(handle) { if (handle.detach) { handle.detach(); } }, _unload: function(e, me) { } }; Y.Do = DO; ////////////////////////////////////////////////////////////////////////// /** * Contains the return value from the wrapped method, accessible * by 'after' event listeners. * * @property Do.originalRetVal * @static * @since 2.3.0 */ /** * Contains the current state of the return value, consumable by * 'after' event listeners, and updated if an after subscriber * changes the return value generated by the wrapped function. * * @property Do.currentRetVal * @static * @since 2.3.0 */ ////////////////////////////////////////////////////////////////////////// /** * Wrapper for a displaced method with aop enabled * @class Do.Method * @constructor * @param obj The object to operate on * @param sFn The name of the method to displace */ DO.Method = function(obj, sFn) { this.obj = obj; this.methodName = sFn; this.method = obj[sFn]; this.before = {}; this.after = {}; }; /** * Register a aop subscriber * @method register * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype.register = function (sid, fn, when) { if (when) { this.after[sid] = fn; } else { this.before[sid] = fn; } }; /** * Unregister a aop subscriber * @method delete * @param sid {string} the subscriber id * @param fn {Function} the function to execute * @param when {string} when to execute the function */ DO.Method.prototype._delete = function (sid) { delete this.before[sid]; delete this.after[sid]; }; /** * Execute the wrapped method * @method exec */ DO.Method.prototype.exec = function () { var args = Y.Array(arguments, 0, true), i, ret, newRet, bf = this.before, af = this.after, prevented = false; // execute before for (i in bf) { if (bf.hasOwnProperty(i)) { ret = bf[i].apply(this.obj, args); if (ret) { switch (ret.constructor) { case DO.Halt: return ret.retVal; case DO.AlterArgs: args = ret.newArgs; break; case DO.Prevent: prevented = true; break; default: } } } } // execute method if (!prevented) { ret = this.method.apply(this.obj, args); } DO.originalRetVal = ret; DO.currentRetVal = ret; // execute after methods. for (i in af) { if (af.hasOwnProperty(i)) { newRet = af[i].apply(this.obj, args); // Stop processing if a Halt object is returned if (newRet && newRet.constructor == DO.Halt) { return newRet.retVal; // Check for a new return value } else if (newRet && newRet.constructor == DO.AlterReturn) { ret = newRet.newRetVal; // Update the static retval state DO.currentRetVal = ret; } } } return ret; }; ////////////////////////////////////////////////////////////////////////// /** * Return an AlterArgs object when you want to change the arguments that * were passed into the function. An example would be a service that scrubs * out illegal characters prior to executing the core business logic. * @class Do.AlterArgs */ DO.AlterArgs = function(msg, newArgs) { this.msg = msg; this.newArgs = newArgs; }; /** * Return an AlterReturn object when you want to change the result returned * from the core method to the caller * @class Do.AlterReturn */ DO.AlterReturn = function(msg, newRetVal) { this.msg = msg; this.newRetVal = newRetVal; }; /** * Return a Halt object when you want to terminate the execution * of all subsequent subscribers as well as the wrapped method * if it has not exectued yet. * @class Do.Halt */ DO.Halt = function(msg, retVal) { this.msg = msg; this.retVal = retVal; }; /** * Return a Prevent object when you want to prevent the wrapped function * from executing, but want the remaining listeners to execute * @class Do.Prevent */ DO.Prevent = function(msg) { this.msg = msg; }; /** * Return an Error object when you want to terminate the execution * of all subsequent method calls. * @class Do.Error * @deprecated use Y.Do.Halt or Y.Do.Prevent */ DO.Error = DO.Halt; ////////////////////////////////////////////////////////////////////////// // Y["Event"] && Y.Event.addListener(window, "unload", Y.Do._unload, Y.Do); /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ // var onsubscribeType = "_event:onsub", var AFTER = 'after', CONFIGS = [ 'broadcast', 'monitored', 'bubbles', 'context', 'contextFn', 'currentTarget', 'defaultFn', 'defaultTargetOnly', 'details', 'emitFacade', 'fireOnce', 'async', 'host', 'preventable', 'preventedFn', 'queuable', 'silent', 'stoppedFn', 'target', 'type' ], YUI3_SIGNATURE = 9, YUI_LOG = 'yui:log'; /** * Return value from all subscribe operations * @class EventHandle * @constructor * @param {CustomEvent} evt the custom event. * @param {Subscriber} sub the subscriber. */ Y.EventHandle = function(evt, sub) { /** * The custom event * @type CustomEvent */ this.evt = evt; /** * The subscriber object * @type Subscriber */ this.sub = sub; }; Y.EventHandle.prototype = { batch: function(f, c) { f.call(c || this, this); if (Y.Lang.isArray(this.evt)) { Y.Array.each(this.evt, function(h) { h.batch.call(c || h, f); }); } }, /** * Detaches this subscriber * @method detach * @return {int} the number of detached listeners */ detach: function() { var evt = this.evt, detached = 0, i; if (evt) { if (Y.Lang.isArray(evt)) { for (i = 0; i < evt.length; i++) { detached += evt[i].detach(); } } else { evt._delete(this.sub); detached = 1; } } return detached; }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('attach', 'detach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { return this.evt.monitor.apply(this.evt, arguments); } }; /** * The CustomEvent class lets you define events for your application * that can be subscribed to by one or more independent component. * * @param {String} type The type of event, which is passed to the callback * when the event fires. * @param {object} o configuration object. * @class CustomEvent * @constructor */ Y.CustomEvent = function(type, o) { // if (arguments.length > 2) { // this.log('CustomEvent context and silent are now in the config', 'warn', 'Event'); // } o = o || {}; this.id = Y.stamp(this); /** * The type of event, returned to subscribers when the event fires * @property type * @type string */ this.type = type; /** * The context the the event will fire from by default. Defaults to the YUI * instance. * @property context * @type object */ this.context = Y; /** * Monitor when an event is attached or detached. * * @property monitored * @type boolean */ // this.monitored = false; this.logSystem = (type == YUI_LOG); /** * If 0, this event does not broadcast. If 1, the YUI instance is notified * every time this event fires. If 2, the YUI instance and the YUI global * (if event is enabled on the global) are notified every time this event * fires. * @property broadcast * @type int */ // this.broadcast = 0; /** * By default all custom events are logged in the debug build, set silent * to true to disable debug outpu for this event. * @property silent * @type boolean */ this.silent = this.logSystem; /** * Specifies whether this event should be queued when the host is actively * processing an event. This will effect exectution order of the callbacks * for the various events. * @property queuable * @type boolean * @default false */ // this.queuable = false; /** * The subscribers to this event * @property subscribers * @type Subscriber {} */ this.subscribers = {}; /** * 'After' subscribers * @property afters * @type Subscriber {} */ this.afters = {}; /** * This event has fired if true * * @property fired * @type boolean * @default false; */ // this.fired = false; /** * An array containing the arguments the custom event * was last fired with. * @property firedWith * @type Array */ // this.firedWith; /** * This event should only fire one time if true, and if * it has fired, any new subscribers should be notified * immediately. * * @property fireOnce * @type boolean * @default false; */ // this.fireOnce = false; /** * fireOnce listeners will fire syncronously unless async * is set to true * @property async * @type boolean * @default false */ //this.async = false; /** * Flag for stopPropagation that is modified during fire() * 1 means to stop propagation to bubble targets. 2 means * to also stop additional subscribers on this target. * @property stopped * @type int */ // this.stopped = 0; /** * Flag for preventDefault that is modified during fire(). * if it is not 0, the default behavior for this event * @property prevented * @type int */ // this.prevented = 0; /** * Specifies the host for this custom event. This is used * to enable event bubbling * @property host * @type EventTarget */ // this.host = null; /** * The default function to execute after event listeners * have fire, but only if the default action was not * prevented. * @property defaultFn * @type Function */ // this.defaultFn = null; /** * The function to execute if a subscriber calls * stopPropagation or stopImmediatePropagation * @property stoppedFn * @type Function */ // this.stoppedFn = null; /** * The function to execute if a subscriber calls * preventDefault * @property preventedFn * @type Function */ // this.preventedFn = null; /** * Specifies whether or not this event's default function * can be cancelled by a subscriber by executing preventDefault() * on the event facade * @property preventable * @type boolean * @default true */ this.preventable = true; /** * Specifies whether or not a subscriber can stop the event propagation * via stopPropagation(), stopImmediatePropagation(), or halt() * * Events can only bubble if emitFacade is true. * * @property bubbles * @type boolean * @default true */ this.bubbles = true; /** * Supports multiple options for listener signatures in order to * port YUI 2 apps. * @property signature * @type int * @default 9 */ this.signature = YUI3_SIGNATURE; this.subCount = 0; this.afterCount = 0; // this.hasSubscribers = false; // this.hasAfters = false; /** * If set to true, the custom event will deliver an EventFacade object * that is similar to a DOM event object. * @property emitFacade * @type boolean * @default false */ // this.emitFacade = false; this.applyConfig(o, true); // this.log("Creating " + this.type); }; Y.CustomEvent.prototype = { hasSubs: function(when) { var s = this.subCount, a = this.afterCount, sib = this.sibling; if (sib) { s += sib.subCount; a += sib.afterCount; } if (when) { return (when == 'after') ? a : s; } return (s + a); }, /** * Monitor the event state for the subscribed event. The first parameter * is what should be monitored, the rest are the normal parameters when * subscribing to an event. * @method monitor * @param what {string} what to monitor ('detach', 'attach', 'publish'). * @return {EventHandle} return value from the monitor event subscription. */ monitor: function(what) { this.monitored = true; var type = this.id + '|' + this.type + '_' + what, args = Y.Array(arguments, 0, true); args[0] = type; return this.host.on.apply(this.host, args); }, /** * Get all of the subscribers to this event and any sibling event * @method getSubs * @return {Array} first item is the on subscribers, second the after. */ getSubs: function() { var s = Y.merge(this.subscribers), a = Y.merge(this.afters), sib = this.sibling; if (sib) { Y.mix(s, sib.subscribers); Y.mix(a, sib.afters); } return [s, a]; }, /** * Apply configuration properties. Only applies the CONFIG whitelist * @method applyConfig * @param o hash of properties to apply. * @param force {boolean} if true, properties that exist on the event * will be overwritten. */ applyConfig: function(o, force) { if (o) { Y.mix(this, o, force, CONFIGS); } }, _on: function(fn, context, args, when) { if (!fn) { this.log('Invalid callback for CE: ' + this.type); } var s = new Y.Subscriber(fn, context, args, when); if (this.fireOnce && this.fired) { if (this.async) { setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0); } else { this._notify(s, this.firedWith); } } if (when == AFTER) { this.afters[s.id] = s; this.afterCount++; } else { this.subscribers[s.id] = s; this.subCount++; } return new Y.EventHandle(this, s); }, /** * Listen for this event * @method subscribe * @param {Function} fn The function to execute. * @return {EventHandle} Unsubscribe handle. * @deprecated use on. */ subscribe: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; return this._on(fn, context, a, true); }, /** * Listen for this event * @method on * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} An object with a detach method to detch the handler(s). */ on: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; if (this.host) { this.host._monitor('attach', this.type, { args: arguments }); } return this._on(fn, context, a, true); }, /** * Listen for this event after the normal subscribers have been notified and * the default behavior has been applied. If a normal subscriber prevents the * default behavior, it also prevents after listeners from firing. * @method after * @param {Function} fn The function to execute. * @param {object} context optional execution context. * @param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {EventHandle} handle Unsubscribe handle. */ after: function(fn, context) { var a = (arguments.length > 2) ? Y.Array(arguments, 2, true) : null; return this._on(fn, context, a, AFTER); }, /** * Detach listeners. * @method detach * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int} returns the number of subscribers unsubscribed. */ detach: function(fn, context) { // unsubscribe handle if (fn && fn.detach) { return fn.detach(); } var i, s, found = 0, subs = Y.merge(this.subscribers, this.afters); for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && (!fn || fn === s.fn)) { this._delete(s); found++; } } } return found; }, /** * Detach listeners. * @method unsubscribe * @param {Function} fn The subscribed function to remove, if not supplied * all will be removed. * @param {Object} context The context object passed to subscribe. * @return {int|undefined} returns the number of subscribers unsubscribed. * @deprecated use detach. */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Notify a single subscriber * @method _notify * @param {Subscriber} s the subscriber. * @param {Array} args the arguments array to apply to the listener. * @private */ _notify: function(s, args, ef) { this.log(this.type + '->' + 'sub: ' + s.id); var ret; ret = s.notify(args, this); if (false === ret || this.stopped > 1) { this.log(this.type + ' cancelled by subscriber'); return false; } return true; }, /** * Logger abstraction to centralize the application of the silent flag * @method log * @param {string} msg message to log. * @param {string} cat log category. */ log: function(msg, cat) { if (!this.silent) { } }, /** * Notifies the subscribers. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters: * <ul> * <li>The type of event</li> * <li>All of the arguments fire() was executed with as an array</li> * <li>The custom object (if any) that was passed into the subscribe() * method</li> * </ul> * @method fire * @param {Object*} arguments an arbitrary set of parameters to pass to * the handler. * @return {boolean} false if one of the subscribers returned false, * true otherwise. * */ fire: function() { if (this.fireOnce && this.fired) { this.log('fireOnce event: ' + this.type + ' already fired'); return true; } else { var args = Y.Array(arguments, 0, true); // this doesn't happen if the event isn't published // this.host._monitor('fire', this.type, args); this.fired = true; this.firedWith = args; if (this.emitFacade) { return this.fireComplex(args); } else { return this.fireSimple(args); } } }, fireSimple: function(args) { this.stopped = 0; this.prevented = 0; if (this.hasSubs()) { // this._procSubs(Y.merge(this.subscribers, this.afters), args); var subs = this.getSubs(); this._procSubs(subs[0], args); this._procSubs(subs[1], args); } this._broadcast(args); return this.stopped ? false : true; }, // Requires the event-custom-complex module for full funcitonality. fireComplex: function(args) { args[0] = args[0] || {}; return this.fireSimple(args); }, _procSubs: function(subs, args, ef) { var s, i; for (i in subs) { if (subs.hasOwnProperty(i)) { s = subs[i]; if (s && s.fn) { if (false === this._notify(s, args, ef)) { this.stopped = 2; } if (this.stopped == 2) { return false; } } } } return true; }, _broadcast: function(args) { if (!this.stopped && this.broadcast) { var a = Y.Array(args); a.unshift(this.type); if (this.host !== Y) { Y.fire.apply(Y, a); } if (this.broadcast == 2) { Y.Global.fire.apply(Y.Global, a); } } }, /** * Removes all listeners * @method unsubscribeAll * @return {int} The number of listeners unsubscribed. * @deprecated use detachAll. */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Removes all listeners * @method detachAll * @return {int} The number of listeners unsubscribed. */ detachAll: function() { return this.detach(); }, /** * @method _delete * @param subscriber object. * @private */ _delete: function(s) { if (s) { if (this.subscribers[s.id]) { delete this.subscribers[s.id]; this.subCount--; } if (this.afters[s.id]) { delete this.afters[s.id]; this.afterCount--; } } if (this.host) { this.host._monitor('detach', this.type, { ce: this, sub: s }); } if (s) { // delete s.fn; // delete s.context; s.deleted = true; } } }; ///////////////////////////////////////////////////////////////////// /** * Stores the subscriber information to be used when the event fires. * @param {Function} fn The wrapped function to execute. * @param {Object} context The value of the keyword 'this' in the listener. * @param {Array} args* 0..n additional arguments to supply the listener. * * @class Subscriber * @constructor */ Y.Subscriber = function(fn, context, args) { /** * The callback that will be execute when the event fires * This is wrapped by Y.rbind if obj was supplied. * @property fn * @type Function */ this.fn = fn; /** * Optional 'this' keyword for the listener * @property context * @type Object */ this.context = context; /** * Unique subscriber id * @property id * @type String */ this.id = Y.stamp(this); /** * Additional arguments to propagate to the subscriber * @property args * @type Array */ this.args = args; /** * Custom events for a given fire transaction. * @property events * @type {EventTarget} */ // this.events = null; /** * This listener only reacts to the event once * @property once */ // this.once = false; }; Y.Subscriber.prototype = { _notify: function(c, args, ce) { if (this.deleted && !this.postponed) { if (this.postponed) { delete this.fn; delete this.context; } else { delete this.postponed; return null; } } var a = this.args, ret; switch (ce.signature) { case 0: ret = this.fn.call(c, ce.type, args, c); break; case 1: ret = this.fn.call(c, args[0] || null, c); break; default: if (a || args) { args = args || []; a = (a) ? args.concat(a) : args; ret = this.fn.apply(c, a); } else { ret = this.fn.call(c); } } if (this.once) { ce._delete(this); } return ret; }, /** * Executes the subscriber. * @method notify * @param args {Array} Arguments array for the subscriber. * @param ce {CustomEvent} The custom event that sent the notification. */ notify: function(args, ce) { var c = this.context, ret = true; if (!c) { c = (ce.contextFn) ? ce.contextFn() : ce.context; } // only catch errors if we will not re-throw them. if (Y.config.throwFail) { ret = this._notify(c, args, ce); } else { try { ret = this._notify(c, args, ce); } catch (e) { Y.error(this + ' failed: ' + e.message, e); } } return ret; }, /** * Returns true if the fn and obj match this objects properties. * Used by the unsubscribe method to match the right subscriber. * * @method contains * @param {Function} fn the function to execute. * @param {Object} context optional 'this' keyword for the listener. * @return {boolean} true if the supplied arguments match this * subscriber's signature. */ contains: function(fn, context) { if (context) { return ((this.fn == fn) && this.context == context); } else { return (this.fn == fn); } } }; /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event-custom * @submodule event-custom-base */ /** * EventTarget provides the implementation for any object to * publish, subscribe and fire to custom events, and also * alows other EventTargets to target the object with events * sourced from the other object. * EventTarget is designed to be used with Y.augment to wrap * EventCustom in an interface that allows events to be listened to * and fired by name. This makes it possible for implementing code to * subscribe to an event that either has not been created yet, or will * not be created at all. * @class EventTarget * @param opts a configuration object * @config emitFacade {boolean} if true, all events will emit event * facade payloads by default (default false) * @config prefix {string} the prefix to apply to non-prefixed event names * @config chain {boolean} if true, on/after/detach return the host to allow * chaining, otherwise they return an EventHandle (default false) */ var L = Y.Lang, PREFIX_DELIMITER = ':', CATEGORY_DELIMITER = '|', AFTER_PREFIX = '~AFTER~', YArray = Y.Array, _wildType = Y.cached(function(type) { return type.replace(/(.*)(:)(.*)/, "*$2$3"); }), /** * If the instance has a prefix attribute and the * event type is not prefixed, the instance prefix is * applied to the supplied type. * @method _getType * @private */ _getType = Y.cached(function(type, pre) { if (!pre || !L.isString(type) || type.indexOf(PREFIX_DELIMITER) > -1) { return type; } return pre + PREFIX_DELIMITER + type; }), /** * Returns an array with the detach key (if provided), * and the prefixed event name from _getType * Y.on('detachcategory| menu:click', fn) * @method _parseType * @private */ _parseType = Y.cached(function(type, pre) { var t = type, detachcategory, after, i; if (!L.isString(t)) { return t; } i = t.indexOf(AFTER_PREFIX); if (i > -1) { after = true; t = t.substr(AFTER_PREFIX.length); } i = t.indexOf(CATEGORY_DELIMITER); if (i > -1) { detachcategory = t.substr(0, (i)); t = t.substr(i+1); if (t == '*') { t = null; } } // detach category, full type with instance prefix, is this an after listener, short type return [detachcategory, (pre) ? _getType(t, pre) : t, after, t]; }), ET = function(opts) { var o = (L.isObject(opts)) ? opts : {}; this._yuievt = this._yuievt || { id: Y.guid(), events: {}, targets: {}, config: o, chain: ('chain' in o) ? o.chain : Y.config.chain, bubbling: false, defaults: { context: o.context || this, host: this, emitFacade: o.emitFacade, fireOnce: o.fireOnce, queuable: o.queuable, monitored: o.monitored, broadcast: o.broadcast, defaultTargetOnly: o.defaultTargetOnly, bubbles: ('bubbles' in o) ? o.bubbles : true } }; }; ET.prototype = { /** * Listen to a custom event hosted by this object one time. * This is the equivalent to <code>on</code> except the * listener is immediatelly detached when it is executed. * @method once * @param type {string} The type of the event * @param fn {Function} The callback * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return the event target or a detach handle per 'chain' config */ once: function() { var handle = this.on.apply(this, arguments); handle.batch(function(hand) { if (hand.sub) { hand.sub.once = true; } }); return handle; }, /** * Takes the type parameter passed to 'on' and parses out the * various pieces that could be included in the type. If the * event type is passed without a prefix, it will be expanded * to include the prefix one is supplied or the event target * is configured with a default prefix. * @method parseType * @param {string} type the type * @param {string} [pre=this._yuievt.config.prefix] the prefix * @since 3.3.0 * @return {Array} an array containing: * * the detach category, if supplied, * * the prefixed event type, * * whether or not this is an after listener, * * the supplied event type */ parseType: function(type, pre) { return _parseType(type, pre || this._yuievt.config.prefix); }, /** * Subscribe to a custom event hosted by this object * @method on * @param type {string} The type of the event * @param fn {Function} The callback * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return the event target or a detach handle per 'chain' config */ on: function(type, fn, context) { var parts = _parseType(type, this._yuievt.config.prefix), f, c, args, ret, ce, detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype, Node = Y.Node, n, domevent, isArr; // full name, args, detachcategory, after this._monitor('attach', parts[1], { args: arguments, category: parts[0], after: parts[2] }); if (L.isObject(type)) { if (L.isFunction(type)) { return Y.Do.before.apply(Y.Do, arguments); } f = fn; c = context; args = YArray(arguments, 0, true); ret = []; if (L.isArray(type)) { isArr = true; } after = type._after; delete type._after; Y.each(type, function(v, k) { if (L.isObject(v)) { f = v.fn || ((L.isFunction(v)) ? v : f); c = v.context || c; } var nv = (after) ? AFTER_PREFIX : ''; args[0] = nv + ((isArr) ? v : k); args[1] = f; args[2] = c; ret.push(this.on.apply(this, args)); }, this); return (this._yuievt.chain) ? this : new Y.EventHandle(ret); } detachcategory = parts[0]; after = parts[2]; shorttype = parts[3]; // extra redirection so we catch adaptor events too. take a look at this. if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) { args = YArray(arguments, 0, true); args.splice(2, 0, Node.getDOMNode(this)); return Y.on.apply(Y, args); } type = parts[1]; if (Y.instanceOf(this, YUI)) { adapt = Y.Env.evt.plugins[type]; args = YArray(arguments, 0, true); args[0] = shorttype; if (Node) { n = args[2]; if (Y.instanceOf(n, Y.NodeList)) { n = Y.NodeList.getDOMNodes(n); } else if (Y.instanceOf(n, Node)) { n = Node.getDOMNode(n); } domevent = (shorttype in Node.DOM_EVENTS); // Captures both DOM events and event plugins. if (domevent) { args[2] = n; } } // check for the existance of an event adaptor if (adapt) { handle = adapt.on.apply(Y, args); } else if ((!type) || domevent) { handle = Y.Event._attach(args); } } if (!handle) { ce = this._yuievt.events[type] || this.publish(type); handle = ce._on(fn, context, (arguments.length > 3) ? YArray(arguments, 3, true) : null, (after) ? 'after' : true); } if (detachcategory) { store[detachcategory] = store[detachcategory] || {}; store[detachcategory][type] = store[detachcategory][type] || []; store[detachcategory][type].push(handle); } return (this._yuievt.chain) ? this : handle; }, /** * subscribe to an event * @method subscribe * @deprecated use on */ subscribe: function() { return this.on.apply(this, arguments); }, /** * Detach one or more listeners the from the specified event * @method detach * @param type {string|Object} Either the handle to the subscriber or the * type of event. If the type * is not specified, it will attempt to remove * the listener from all hosted events. * @param fn {Function} The subscribed function to unsubscribe, if not * supplied, all subscribers will be removed. * @param context {Object} The custom object passed to subscribe. This is * optional, but if supplied will be used to * disambiguate multiple listeners that are the same * (e.g., you subscribe many object using a function * that lives on the prototype) * @return {EventTarget} the host */ detach: function(type, fn, context) { var evts = this._yuievt.events, i, Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node)); // detachAll disabled on the Y instance. if (!type && (this !== Y)) { for (i in evts) { if (evts.hasOwnProperty(i)) { evts[i].detach(fn, context); } } if (isNode) { Y.Event.purgeElement(Node.getDOMNode(this)); } return this; } var parts = _parseType(type, this._yuievt.config.prefix), detachcategory = L.isArray(parts) ? parts[0] : null, shorttype = (parts) ? parts[3] : null, adapt, store = Y.Env.evt.handles, detachhost, cat, args, ce, keyDetacher = function(lcat, ltype, host) { var handles = lcat[ltype], ce, i; if (handles) { for (i = handles.length - 1; i >= 0; --i) { ce = handles[i].evt; if (ce.host === host || ce.el === host) { handles[i].detach(); } } } }; if (detachcategory) { cat = store[detachcategory]; type = parts[1]; detachhost = (isNode) ? Y.Node.getDOMNode(this) : this; if (cat) { if (type) { keyDetacher(cat, type, detachhost); } else { for (i in cat) { if (cat.hasOwnProperty(i)) { keyDetacher(cat, i, detachhost); } } } return this; } // If this is an event handle, use it to detach } else if (L.isObject(type) && type.detach) { type.detach(); return this; // extra redirection so we catch adaptor events too. take a look at this. } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) { args = YArray(arguments, 0, true); args[2] = Node.getDOMNode(this); Y.detach.apply(Y, args); return this; } adapt = Y.Env.evt.plugins[shorttype]; // The YUI instance handles DOM events and adaptors if (Y.instanceOf(this, YUI)) { args = YArray(arguments, 0, true); // use the adaptor specific detach code if if (adapt && adapt.detach) { adapt.detach.apply(Y, args); return this; // DOM event fork } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) { args[0] = type; Y.Event.detach.apply(Y.Event, args); return this; } } // ce = evts[type]; ce = evts[parts[1]]; if (ce) { ce.detach(fn, context); } return this; }, /** * detach a listener * @method unsubscribe * @deprecated use detach */ unsubscribe: function() { return this.detach.apply(this, arguments); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method detachAll * @param type {string} The type, or name of the event */ detachAll: function(type) { return this.detach(type); }, /** * Removes all listeners from the specified event. If the event type * is not specified, all listeners from all hosted custom events will * be removed. * @method unsubscribeAll * @param type {string} The type, or name of the event * @deprecated use detachAll */ unsubscribeAll: function() { return this.detachAll.apply(this, arguments); }, /** * Creates a new custom event of the specified type. If a custom event * by that name already exists, it will not be re-created. In either * case the custom event is returned. * * @method publish * * @param type {string} the type, or name of the event * @param opts {object} optional config params. Valid properties are: * * <ul> * <li> * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false) * </li> * <li> * 'bubbles': whether or not this event bubbles (true) * Events can only bubble if emitFacade is true. * </li> * <li> * 'context': the default execution context for the listeners (this) * </li> * <li> * 'defaultFn': the default function to execute when this event fires if preventDefault was not called * </li> * <li> * 'emitFacade': whether or not this event emits a facade (false) * </li> * <li> * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click' * </li> * <li> * 'fireOnce': if an event is configured to fire once, new subscribers after * the fire will be notified immediately. * </li> * <li> * 'async': fireOnce event listeners will fire synchronously if the event has already * fired unless async is true. * </li> * <li> * 'preventable': whether or not preventDefault() has an effect (true) * </li> * <li> * 'preventedFn': a function that is executed when preventDefault is called * </li> * <li> * 'queuable': whether or not this event can be queued during bubbling (false) * </li> * <li> * 'silent': if silent is true, debug messages are not provided for this event. * </li> * <li> * 'stoppedFn': a function that is executed when stopPropagation is called * </li> * * <li> * 'monitored': specifies whether or not this event should send notifications about * when the event has been attached, detached, or published. * </li> * <li> * 'type': the event type (valid option if not provided as the first parameter to publish) * </li> * </ul> * * @return {CustomEvent} the custom event * */ publish: function(type, opts) { var events, ce, ret, defaults, edata = this._yuievt, pre = edata.config.prefix; type = (pre) ? _getType(type, pre) : type; this._monitor('publish', type, { args: arguments }); if (L.isObject(type)) { ret = {}; Y.each(type, function(v, k) { ret[k] = this.publish(k, v || opts); }, this); return ret; } events = edata.events; ce = events[type]; if (ce) { // ce.log("publish applying new config to published event: '"+type+"' exists", 'info', 'event'); if (opts) { ce.applyConfig(opts, true); } } else { defaults = edata.defaults; // apply defaults ce = new Y.CustomEvent(type, (opts) ? Y.merge(defaults, opts) : defaults); events[type] = ce; } // make sure we turn the broadcast flag off if this // event was published as a result of bubbling // if (opts instanceof Y.CustomEvent) { // events[type].broadcast = false; // } return events[type]; }, /** * This is the entry point for the event monitoring system. * You can monitor 'attach', 'detach', 'fire', and 'publish'. * When configured, these events generate an event. click -> * click_attach, click_detach, click_publish -- these can * be subscribed to like other events to monitor the event * system. Inividual published events can have monitoring * turned on or off (publish can't be turned off before it * it published) by setting the events 'monitor' config. * * @private */ _monitor: function(what, type, o) { var monitorevt, ce = this.getEvent(type); if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) { monitorevt = type + '_' + what; o.monitored = what; this.fire.call(this, monitorevt, o); } }, /** * Fire a custom event by name. The callback functions will be executed * from the context specified when the event was created, and with the * following parameters. * * If the custom event object hasn't been created, then the event hasn't * been published and it has no subscribers. For performance sake, we * immediate exit in this case. This means the event won't bubble, so * if the intention is that a bubble target be notified, the event must * be published on this object first. * * The first argument is the event type, and any additional arguments are * passed to the listeners as parameters. If the first of these is an * object literal, and the event is configured to emit an event facade, * that object is mixed into the event facade and the facade is provided * in place of the original object. * * @method fire * @param type {String|Object} The type of the event, or an object that contains * a 'type' property. * @param arguments {Object*} an arbitrary set of parameters to pass to * the handler. If the first of these is an object literal and the event is * configured to emit an event facade, the event facade will replace that * parameter after the properties the object literal contains are copied to * the event facade. * @return {EventTarget} the event host * */ fire: function(type) { var typeIncluded = L.isString(type), t = (typeIncluded) ? type : (type && type.type), ce, ret, pre = this._yuievt.config.prefix, ce2, args = (typeIncluded) ? YArray(arguments, 1, true) : arguments; t = (pre) ? _getType(t, pre) : t; this._monitor('fire', t, { args: args }); ce = this.getEvent(t, true); ce2 = this.getSibling(t, ce); if (ce2 && !ce) { ce = this.publish(t); } // this event has not been published or subscribed to if (!ce) { if (this._yuievt.hasTargets) { return this.bubble({ type: t }, args, this); } // otherwise there is nothing to be done ret = true; } else { ce.sibling = ce2; ret = ce.fire.apply(ce, args); } return (this._yuievt.chain) ? this : ret; }, getSibling: function(type, ce) { var ce2; // delegate to *:type events if there are subscribers if (type.indexOf(PREFIX_DELIMITER) > -1) { type = _wildType(type); // console.log(type); ce2 = this.getEvent(type, true); if (ce2) { // console.log("GOT ONE: " + type); ce2.applyConfig(ce); ce2.bubbles = false; ce2.broadcast = 0; // ret = ce2.fire.apply(ce2, a); } } return ce2; }, /** * Returns the custom event of the provided type has been created, a * falsy value otherwise * @method getEvent * @param type {string} the type, or name of the event * @param prefixed {string} if true, the type is prefixed already * @return {CustomEvent} the custom event or null */ getEvent: function(type, prefixed) { var pre, e; if (!prefixed) { pre = this._yuievt.config.prefix; type = (pre) ? _getType(type, pre) : type; } e = this._yuievt.events; return e[type] || null; }, /** * Subscribe to a custom event hosted by this object. The * supplied callback will execute after any listeners add * via the subscribe method, and after the default function, * if configured for the event, has executed. * @method after * @param type {string} The type of the event * @param fn {Function} The callback * @param context {object} optional execution context. * @param arg* {mixed} 0..n additional arguments to supply to the subscriber * @return the event target or a detach handle per 'chain' config */ after: function(type, fn) { var a = YArray(arguments, 0, true); switch (L.type(type)) { case 'function': return Y.Do.after.apply(Y.Do, arguments); case 'array': // YArray.each(a[0], function(v) { // v = AFTER_PREFIX + v; // }); // break; case 'object': a[0]._after = true; break; default: a[0] = AFTER_PREFIX + type; } return this.on.apply(this, a); }, /** * Executes the callback before a DOM event, custom event * or method. If the first argument is a function, it * is assumed the target is a method. For DOM and custom * events, this is an alias for Y.on. * * For DOM and custom events: * type, callback, context, 0-n arguments * * For methods: * callback, object (method host), methodName, context, 0-n arguments * * @method before * @return detach handle */ before: function() { return this.on.apply(this, arguments); } }; Y.EventTarget = ET; // make Y an event target Y.mix(Y, ET.prototype, false, false, { bubbles: false }); ET.call(Y); YUI.Env.globalEvents = YUI.Env.globalEvents || new ET(); /** * Hosts YUI page level events. This is where events bubble to * when the broadcast config is set to 2. This property is * only available if the custom event module is loaded. * @property Global * @type EventTarget * @for YUI */ Y.Global = YUI.Env.globalEvents; // @TODO implement a global namespace function on Y.Global? /** * <code>YUI</code>'s <code>on</code> method is a unified interface for subscribing to * most events exposed by YUI. This includes custom events, DOM events, and * function events. <code>detach</code> is also provided to remove listeners * serviced by this function. * * The signature that <code>on</code> accepts varies depending on the type * of event being consumed. Refer to the specific methods that will * service a specific request for additional information about subscribing * to that type of event. * * <ul> * <li>Custom events. These events are defined by various * modules in the library. This type of event is delegated to * <code>EventTarget</code>'s <code>on</code> method. * <ul> * <li>The type of the event</li> * <li>The callback to execute</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example: * <code>Y.on('drag:drophit', function() { // start work });</code> * </li> * <li>DOM events. These are moments reported by the browser related * to browser functionality and user interaction. * This type of event is delegated to <code>Event</code>'s * <code>attach</code> method. * <ul> * <li>The type of the event</li> * <li>The callback to execute</li> * <li>The specification for the Node(s) to attach the listener * to. This can be a selector, collections, or Node/Element * refereces.</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example: * <code>Y.on('click', function(e) { // something was clicked }, '#someelement');</code> * </li> * <li>Function events. These events can be used to react before or after a * function is executed. This type of event is delegated to <code>Event.Do</code>'s * <code>before</code> method. * <ul> * <li>The callback to execute</li> * <li>The object that has the function that will be listened for.</li> * <li>The name of the function to listen for.</li> * <li>An optional context object</li> * <li>0..n additional arguments to supply the callback.</li> * </ul> * Example <code>Y.on(function(arg1, arg2, etc) { // obj.methodname was executed }, obj 'methodname');</code> * </li> * </ul> * * <code>on</code> corresponds to the moment before any default behavior of * the event. <code>after</code> works the same way, but these listeners * execute after the event's default behavior. <code>before</code> is an * alias for <code>on</code>. * * @method on * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ /** * Listen for an event one time. Equivalent to <code>on</code>, except that * the listener is immediately detached when executed. * @see on * @method once * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ /** * after() is a unified interface for subscribing to * most events exposed by YUI. This includes custom events, * DOM events, and AOP events. This works the same way as * the on() function, only it operates after any default * behavior for the event has executed. @see <code>on</code> for more * information. * @method after * @param type event type (this parameter does not apply for function events) * @param fn the callback * @param context optionally change the value of 'this' in the callback * @param args* 0..n additional arguments to pass to the callback. * @return the event target or a detach handle per 'chain' config * @for YUI */ }, '@VERSION@' ,{requires:['oop']}); var GLOBAL_ENV = YUI.Env; if (!GLOBAL_ENV._ready) { GLOBAL_ENV._ready = function() { GLOBAL_ENV.DOMReady = true; GLOBAL_ENV.remove(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready); }; // if (!YUI.UA.ie) { GLOBAL_ENV.add(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready); // } } YUI.add('event-base', function(Y) { /* * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * The domready event fires at the moment the browser's DOM is * usable. In most cases, this is before images are fully * downloaded, allowing you to provide a more responsive user * interface. * * In YUI 3, domready subscribers will be notified immediately if * that moment has already passed when the subscription is created. * * One exception is if the yui.js file is dynamically injected into * the page. If this is done, you must tell the YUI instance that * you did this in order for DOMReady (and window load events) to * fire normally. That configuration option is 'injected' -- set * it to true if the yui.js script is not included inline. * * This method is part of the 'event-ready' module, which is a * submodule of 'event'. * * @event domready * @for YUI */ Y.publish('domready', { fireOnce: true, async: true }); if (GLOBAL_ENV.DOMReady) { Y.fire('domready'); } else { Y.Do.before(function() { Y.fire('domready'); }, YUI.Env, '_ready'); } /** * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event * @submodule event-base */ /** * Wraps a DOM event, properties requiring browser abstraction are * fixed here. Provids a security layer when required. * @class DOMEventFacade * @param ev {Event} the DOM event * @param currentTarget {HTMLElement} the element the listener was attached to * @param wrapper {Event.Custom} the custom event wrapper for this DOM event */ var ua = Y.UA, EMPTY = {}, /** * webkit key remapping required for Safari < 3.1 * @property webkitKeymap * @private */ webkitKeymap = { 63232: 38, // up 63233: 40, // down 63234: 37, // left 63235: 39, // right 63276: 33, // page up 63277: 34, // page down 25: 9, // SHIFT-TAB (Safari provides a different key code in // this case, even though the shiftKey modifier is set) 63272: 46, // delete 63273: 36, // home 63275: 35 // end }, /** * Returns a wrapped node. Intended to be used on event targets, * so it will return the node's parent if the target is a text * node. * * If accessing a property of the node throws an error, this is * probably the anonymous div wrapper Gecko adds inside text * nodes. This likely will only occur when attempting to access * the relatedTarget. In this case, we now return null because * the anonymous div is completely useless and we do not know * what the related target was because we can't even get to * the element's parent node. * * @method resolve * @private */ resolve = function(n) { if (!n) { return n; } try { if (n && 3 == n.nodeType) { n = n.parentNode; } } catch(e) { return null; } return Y.one(n); }, DOMEventFacade = function(ev, currentTarget, wrapper) { this._event = ev; this._currentTarget = currentTarget; this._wrapper = wrapper || EMPTY; // if not lazy init this.init(); }; Y.extend(DOMEventFacade, Object, { init: function() { var e = this._event, overrides = this._wrapper.overrides, x = e.pageX, y = e.pageY, c, currentTarget = this._currentTarget; this.altKey = e.altKey; this.ctrlKey = e.ctrlKey; this.metaKey = e.metaKey; this.shiftKey = e.shiftKey; this.type = (overrides && overrides.type) || e.type; this.clientX = e.clientX; this.clientY = e.clientY; this.pageX = x; this.pageY = y; c = e.keyCode || e.charCode; if (ua.webkit && (c in webkitKeymap)) { c = webkitKeymap[c]; } this.keyCode = c; this.charCode = c; this.which = e.which || e.charCode || c; // this.button = e.button; this.button = this.which; this.target = resolve(e.target); this.currentTarget = resolve(currentTarget); this.relatedTarget = resolve(e.relatedTarget); if (e.type == "mousewheel" || e.type == "DOMMouseScroll") { this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1); } if (this._touch) { this._touch(e, currentTarget, this._wrapper); } }, stopPropagation: function() { this._event.stopPropagation(); this._wrapper.stopped = 1; this.stopped = 1; }, stopImmediatePropagation: function() { var e = this._event; if (e.stopImmediatePropagation) { e.stopImmediatePropagation(); } else { this.stopPropagation(); } this._wrapper.stopped = 2; this.stopped = 2; }, preventDefault: function(returnValue) { var e = this._event; e.preventDefault(); e.returnValue = returnValue || false; this._wrapper.prevented = 1; this.prevented = 1; }, halt: function(immediate) { if (immediate) { this.stopImmediatePropagation(); } else { this.stopPropagation(); } this.preventDefault(); } }); DOMEventFacade.resolve = resolve; Y.DOM2EventFacade = DOMEventFacade; Y.DOMEventFacade = DOMEventFacade; /** * The native event * @property _event */ /** * The X location of the event on the page (including scroll) * @property pageX * @type int */ /** * The Y location of the event on the page (including scroll) * @property pageY * @type int */ /** * The keyCode for key events. Uses charCode if keyCode is not available * @property keyCode * @type int */ /** * The charCode for key events. Same as keyCode * @property charCode * @type int */ /** * The button that was pushed. * @property button * @type int */ /** * The button that was pushed. Same as button. * @property which * @type int */ /** * Node reference for the targeted element * @propery target * @type Node */ /** * Node reference for the element that the listener was attached to. * @propery currentTarget * @type Node */ /** * Node reference to the relatedTarget * @propery relatedTarget * @type Node */ /** * Number representing the direction and velocity of the movement of the mousewheel. * Negative is down, the higher the number, the faster. Applies to the mousewheel event. * @property wheelDelta * @type int */ /** * Stops the propagation to the next bubble target * @method stopPropagation */ /** * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * on the current target. * @method stopImmediatePropagation */ /** * Prevents the event's default behavior * @method preventDefault * @param returnValue {string} sets the returnValue of the event to this value * (rather than the default false value). This can be used to add a customized * confirmation query to the beforeunload event). */ /** * Stops the event propagation and prevents the default * event behavior. * @method halt * @param immediate {boolean} if true additional listeners * on the current target will not be executed */ (function() { /** * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * The event utility provides functions to add and remove event listeners, * event cleansing. It also tries to automatically remove listeners it * registers during the unload event. * * @class Event * @static */ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; var _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add, remove = YUI.Env.remove, onLoad = function() { YUI.Env.windowLoaded = true; Y.Event._load(); remove(win, "load", onLoad); }, onUnload = function() { Y.Event._unload(); }, EVENT_READY = 'domready', COMPAT_ARG = '~yui|2|compat~', shouldIterate = function(o) { try { return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !o.alert); } catch(ex) { return false; } }, Event = function() { /** * True after the onload event has fired * @property _loadComplete * @type boolean * @static * @private */ var _loadComplete = false, /** * The number of times to poll after window.onload. This number is * increased if additional late-bound handlers are requested after * the page load. * @property _retryCount * @static * @private */ _retryCount = 0, /** * onAvailable listeners * @property _avail * @static * @private */ _avail = [], /** * Custom event wrappers for DOM events. Key is * 'event:' + Element uid stamp + event type * @property _wrappers * @type Y.Event.Custom * @static * @private */ _wrappers = _eventenv.dom_wrappers, _windowLoadKey = null, /** * Custom event wrapper map DOM events. Key is * Element uid stamp. Each item is a hash of custom event * wrappers as provided in the _wrappers collection. This * provides the infrastructure for getListeners. * @property _el_events * @static * @private */ _el_events = _eventenv.dom_map; return { /** * The number of times we should look for elements that are not * in the DOM at the time the event is requested after the document * has been loaded. The default is 1000@amp;40 ms, so it will poll * for 40 seconds or until all outstanding handlers are bound * (whichever comes first). * @property POLL_RETRYS * @type int * @static * @final */ POLL_RETRYS: 1000, /** * The poll interval in milliseconds * @property POLL_INTERVAL * @type int * @static * @final */ POLL_INTERVAL: 40, /** * addListener/removeListener can throw errors in unexpected scenarios. * These errors are suppressed, the method returns false, and this property * is set * @property lastError * @static * @type Error */ lastError: null, /** * poll handle * @property _interval * @static * @private */ _interval: null, /** * document readystate poll handle * @property _dri * @static * @private */ _dri: null, /** * True when the document is initially usable * @property DOMReady * @type boolean * @static */ DOMReady: false, /** * @method startInterval * @static * @private */ startInterval: function() { if (!Event._interval) { Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL); } }, /** * Executes the supplied callback when the item with the supplied * id is found. This is meant to be used to execute behavior as * soon as possible as the page loads. If you use this after the * initial page load it will poll for a fixed time for the element. * The number of times it will poll and the frequency are * configurable. By default it will poll for 10 seconds. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onAvailable * * @param {string||string[]} id the id of the element, or an array * of ids to look for. * @param {function} fn what to execute when the element is found. * @param {object} p_obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} p_override If set to true, fn will execute * in the context of p_obj, if set to an object it * will execute in the context of that object * @param checkContent {boolean} check child node readiness (onContentReady) * @static * @deprecated Use Y.on("available") */ // @TODO fix arguments onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) { var a = Y.Array(id), i, availHandle; for (i=0; i<a.length; i=i+1) { _avail.push({ id: a[i], fn: fn, obj: p_obj, override: p_override, checkReady: checkContent, compat: compat }); } _retryCount = this.POLL_RETRYS; // We want the first test to be immediate, but async setTimeout(Event._poll, 0); availHandle = new Y.EventHandle({ _delete: function() { // set by the event system for lazy DOM listeners if (availHandle.handle) { availHandle.handle.detach(); return; } var i, j; // otherwise try to remove the onAvailable listener(s) for (i = 0; i < a.length; i++) { for (j = 0; j < _avail.length; j++) { if (a[i] === _avail[j].id) { _avail.splice(j, 1); } } } } }); return availHandle; }, /** * Works the same way as onAvailable, but additionally checks the * state of sibling elements to determine if the content of the * available element is safe to modify. * * <p>The callback is executed with a single parameter: * the custom object parameter, if provided.</p> * * @method onContentReady * * @param {string} id the id of the element to look for. * @param {function} fn what to execute when the element is ready. * @param {object} obj an optional object to be passed back as * a parameter to fn. * @param {boolean|object} override If set to true, fn will execute * in the context of p_obj. If an object, fn will * exectute in the context of that object * * @static * @deprecated Use Y.on("contentready") */ // @TODO fix arguments onContentReady: function(id, fn, obj, override, compat) { return Event.onAvailable(id, fn, obj, override, true, compat); }, /** * Adds an event listener * * @method attach * * @param {String} type The type of event to append * @param {Function} fn The method the event invokes * @param {String|HTMLElement|Array|NodeList} el An id, an element * reference, or a collection of ids and/or elements to assign the * listener to. * @param {Object} context optional context object * @param {Boolean|object} args 0..n arguments to pass to the callback * @return {EventHandle} an object to that can be used to detach the listener * * @static */ attach: function(type, fn, el, context) { return Event._attach(Y.Array(arguments, 0, true)); }, _createWrapper: function (el, type, capture, compat, facade) { var cewrapper, ek = Y.stamp(el), key = 'event:' + ek + type; if (false === facade) { key += 'native'; } if (capture) { key += 'capture'; } cewrapper = _wrappers[key]; if (!cewrapper) { // create CE wrapper cewrapper = Y.publish(key, { silent: true, bubbles: false, contextFn: function() { if (compat) { return cewrapper.el; } else { cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el); return cewrapper.nodeRef; } } }); cewrapper.overrides = {}; // for later removeListener calls cewrapper.el = el; cewrapper.key = key; cewrapper.domkey = ek; cewrapper.type = type; cewrapper.fn = function(e) { cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade)))); }; cewrapper.capture = capture; if (el == win && type == "load") { // window load happens once cewrapper.fireOnce = true; _windowLoadKey = key; } _wrappers[key] = cewrapper; _el_events[ek] = _el_events[ek] || {}; _el_events[ek][key] = cewrapper; add(el, type, cewrapper.fn, capture); } return cewrapper; }, _attach: function(args, conf) { var compat, handles, oEl, cewrapper, context, fireNow = false, ret, type = args[0], fn = args[1], el = args[2] || win, facade = conf && conf.facade, capture = conf && conf.capture, overrides = conf && conf.overrides; if (args[args.length-1] === COMPAT_ARG) { compat = true; // trimmedArgs.pop(); } if (!fn || !fn.call) { // throw new TypeError(type + " attach call failed, callback undefined"); return false; } // The el argument can be an array of elements or element ids. if (shouldIterate(el)) { handles=[]; Y.each(el, function(v, k) { args[2] = v; handles.push(Event._attach(args, conf)); }); // return (handles.length === 1) ? handles[0] : handles; return new Y.EventHandle(handles); // If the el argument is a string, we assume it is // actually the id of the element. If the page is loaded // we convert el to the actual element, otherwise we // defer attaching the event until the element is // ready } else if (Y.Lang.isString(el)) { // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) { oEl = Y.DOM.byId(el); } else { oEl = Y.Selector.query(el); switch (oEl.length) { case 0: oEl = null; break; case 1: oEl = oEl[0]; break; default: args[2] = oEl; return Event._attach(args, conf); } } if (oEl) { el = oEl; // Not found = defer adding the event until the element is available } else { ret = Event.onAvailable(el, function() { ret.handle = Event._attach(args, conf); }, Event, true, false, compat); return ret; } } // Element should be an html element or node if (!el) { return false; } if (Y.Node && Y.instanceOf(el, Y.Node)) { el = Y.Node.getDOMNode(el); } cewrapper = Event._createWrapper(el, type, capture, compat, facade); if (overrides) { Y.mix(cewrapper.overrides, overrides); } if (el == win && type == "load") { // if the load is complete, fire immediately. // all subscribers, including the current one // will be notified. if (YUI.Env.windowLoaded) { fireNow = true; } } if (compat) { args.pop(); } context = args[3]; // set context to the Node if not specified // ret = cewrapper.on.apply(cewrapper, trimmedArgs); ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null); if (fireNow) { cewrapper.fire(); } return ret; }, /** * Removes an event listener. Supports the signature the event was bound * with, but the preferred way to remove listeners is using the handle * that is returned when using Y.on * * @method detach * * @param {String} type the type of event to remove. * @param {Function} fn the method the event invokes. If fn is * undefined, then all event handlers for the type of event are * removed. * @param {String|HTMLElement|Array|NodeList|EventHandle} el An * event handle, an id, an element reference, or a collection * of ids and/or elements to remove the listener from. * @return {boolean} true if the unbind was successful, false otherwise. * @static */ detach: function(type, fn, el, obj) { var args=Y.Array(arguments, 0, true), compat, l, ok, i, id, ce; if (args[args.length-1] === COMPAT_ARG) { compat = true; // args.pop(); } if (type && type.detach) { return type.detach(); } // The el argument can be a string if (typeof el == "string") { // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) { el = Y.DOM.byId(el); } else { el = Y.Selector.query(el); l = el.length; if (l < 1) { el = null; } else if (l == 1) { el = el[0]; } } // return Event.detach.apply(Event, args); } if (!el) { return false; } if (el.detach) { args.splice(2, 1); return el.detach.apply(el, args); // The el argument can be an array of elements or element ids. } else if (shouldIterate(el)) { ok = true; for (i=0, l=el.length; i<l; ++i) { args[2] = el[i]; ok = ( Y.Event.detach.apply(Y.Event, args) && ok ); } return ok; } if (!type || !fn || !fn.call) { return Event.purgeElement(el, false, type); } id = 'event:' + Y.stamp(el) + type; ce = _wrappers[id]; if (ce) { return ce.detach(fn); } else { return false; } }, /** * Finds the event in the window object, the caller's arguments, or * in the arguments of another method in the callstack. This is * executed automatically for events registered through the event * manager, so the implementer should not normally need to execute * this function at all. * @method getEvent * @param {Event} e the event parameter from the handler * @param {HTMLElement} el the element the listener was attached to * @return {Event} the event * @static */ getEvent: function(e, el, noFacade) { var ev = e || win.event; return (noFacade) ? ev : new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]); }, /** * Generates an unique ID for the element if it does not already * have one. * @method generateId * @param el the element to create the id for * @return {string} the resulting id of the element * @static */ generateId: function(el) { return Y.DOM.generateID(el); }, /** * We want to be able to use getElementsByTagName as a collection * to attach a group of events to. Unfortunately, different * browsers return different types of collections. This function * tests to determine if the object is array-like. It will also * fail if the object is an array, but is empty. * @method _isValidCollection * @param o the object to test * @return {boolean} true if the object is array-like and populated * @deprecated was not meant to be used directly * @static * @private */ _isValidCollection: shouldIterate, /** * hook up any deferred listeners * @method _load * @static * @private */ _load: function(e) { if (!_loadComplete) { _loadComplete = true; // Just in case DOMReady did not go off for some reason // E._ready(); if (Y.fire) { Y.fire(EVENT_READY); } // Available elements may not have been detected before the // window load event fires. Try to find them now so that the // the user is more likely to get the onAvailable notifications // before the window load notification Event._poll(); } }, /** * Polling function that runs before the onload event fires, * attempting to attach to DOM Nodes as soon as they are * available * @method _poll * @static * @private */ _poll: function() { if (Event.locked) { return; } if (Y.UA.ie && !YUI.Env.DOMReady) { // Hold off if DOMReady has not fired and check current // readyState to protect against the IE operation aborted // issue. Event.startInterval(); return; } Event.locked = true; // keep trying until after the page is loaded. We need to // check the page load state prior to trying to bind the // elements so that we can be certain all elements have been // tested appropriately var i, len, item, el, notAvail, executeItem, tryAgain = !_loadComplete; if (!tryAgain) { tryAgain = (_retryCount > 0); } // onAvailable notAvail = []; executeItem = function (el, item) { var context, ov = item.override; if (item.compat) { if (item.override) { if (ov === true) { context = item.obj; } else { context = ov; } } else { context = el; } item.fn.call(context, item.obj); } else { context = item.obj || Y.one(el); item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []); } }; // onAvailable for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { executeItem(el, item); _avail[i] = null; } else { notAvail.push(item); } } } // onContentReady for (i=0,len=_avail.length; i<len; ++i) { item = _avail[i]; if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready // @todo should we test parentNode.nextSibling? if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) { executeItem(el, item); _avail[i] = null; } } else { notAvail.push(item); } } } _retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1; if (tryAgain) { // we may need to strip the nulled out items here Event.startInterval(); } else { clearInterval(Event._interval); Event._interval = null; } Event.locked = false; return; }, /** * Removes all listeners attached to the given element via addListener. * Optionally, the node's children can also be purged. * Optionally, you can specify a specific type of event to remove. * @method purgeElement * @param {HTMLElement} el the element to purge * @param {boolean} recurse recursively purge this element's children * as well. Use with caution. * @param {string} type optional type of listener to purge. If * left out, all listeners will be removed * @static */ purgeElement: function(el, recurse, type) { // var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el, var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el, lis = Event.getListeners(oEl, type), i, len, props, children, child; if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl); i = 0; len = children.length; for (; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child); } } } if (lis) { i = 0; len = lis.length; for (; i < len; ++i) { props = lis[i]; props.detachAll(); remove(props.el, props.type, props.fn, props.capture); delete _wrappers[props.key]; delete _el_events[props.domkey][props.key]; } } }, /** * Returns all listeners attached to the given element via addListener. * Optionally, you can specify a specific type of event to return. * @method getListeners * @param el {HTMLElement|string} the element or element id to inspect * @param type {string} optional type of listener to return. If * left out, all listeners will be returned * @return {Y.Custom.Event} the custom event wrapper for the DOM event(s) * @static */ getListeners: function(el, type) { var ek = Y.stamp(el, true), evts = _el_events[ek], results=[] , key = (type) ? 'event:' + ek + type : null, adapters = _eventenv.plugins; if (!evts) { return null; } if (key) { // look for synthetic events if (adapters[type] && adapters[type].eventDef) { key += '_synth'; } if (evts[key]) { results.push(evts[key]); } // get native events as well key += 'native'; if (evts[key]) { results.push(evts[key]); } } else { Y.each(evts, function(v, k) { results.push(v); }); } return (results.length) ? results : null; }, /** * Removes all listeners registered by pe.event. Called * automatically during the unload event. * @method _unload * @static * @private */ _unload: function(e) { Y.each(_wrappers, function(v, k) { v.detachAll(); remove(v.el, v.type, v.fn, v.capture); delete _wrappers[k]; delete _el_events[v.domkey][k]; }); remove(win, "unload", onUnload); }, /** * Adds a DOM event directly without the caching, cleanup, context adj, etc * * @method nativeAdd * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeAdd: add, /** * Basic remove listener * * @method nativeRemove * @param {HTMLElement} el the element to bind the handler to * @param {string} type the type of event handler * @param {function} fn the callback to invoke * @param {boolen} capture capture or bubble phase * @static * @private */ nativeRemove: remove }; }(); Y.Event = Event; if (config.injected || YUI.Env.windowLoaded) { onLoad(); } else { add(win, "load", onLoad); } // Process onAvailable/onContentReady items when when the DOM is ready in IE if (Y.UA.ie) { Y.on(EVENT_READY, Event._poll); } add(win, "unload", onUnload); Event.Custom = Y.CustomEvent; Event.Subscriber = Y.Subscriber; Event.Target = Y.EventTarget; Event.Handle = Y.EventHandle; Event.Facade = Y.EventFacade; Event._poll(); })(); /** * DOM event listener abstraction layer * @module event * @submodule event-base */ /** * Executes the callback as soon as the specified element * is detected in the DOM. This function expects a selector * string for the element(s) to detect. If you already have * an element reference, you don't need this event. * @event available * @param type {string} 'available' * @param fn {function} the callback function to execute. * @param el {string} an selector for the element(s) to attach * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.available = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null; return Y.Event.onAvailable.call(Y.Event, id, fn, o, a); } }; /** * Executes the callback as soon as the specified element * is detected in the DOM with a nextSibling property * (indicating that the element's children are available). * This function expects a selector * string for the element(s) to detect. If you already have * an element reference, you don't need this event. * @event contentready * @param type {string} 'contentready' * @param fn {function} the callback function to execute. * @param el {string} an selector for the element(s) to attach. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.Env.evt.plugins.contentready = { on: function(type, fn, id, o) { var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null; return Y.Event.onContentReady.call(Y.Event, id, fn, o, a); } }; }, '@VERSION@' ,{requires:['event-custom-base']}); (function() { var stateChangeListener, GLOBAL_ENV = YUI.Env, config = YUI.config, doc = config.doc, docElement = doc && doc.documentElement, EVENT_NAME = 'onreadystatechange', pollInterval = config.pollInterval || 40; if (docElement.doScroll && !GLOBAL_ENV._ieready) { GLOBAL_ENV._ieready = function() { GLOBAL_ENV._ready(); }; /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ // Internet Explorer: use the doScroll() method on the root element. // This isolates what appears to be a safe moment to manipulate the // DOM prior to when the document's readyState suggests it is safe to do so. if (self !== self.top) { stateChangeListener = function() { if (doc.readyState == 'complete') { GLOBAL_ENV.remove(doc, EVENT_NAME, stateChangeListener); GLOBAL_ENV.ieready(); } }; GLOBAL_ENV.add(doc, EVENT_NAME, stateChangeListener); } else { GLOBAL_ENV._dri = setInterval(function() { try { docElement.doScroll('left'); clearInterval(GLOBAL_ENV._dri); GLOBAL_ENV._dri = null; GLOBAL_ENV._ieready(); } catch (domNotReady) { } }, pollInterval); } } })(); YUI.add('event-base-ie', function(Y) { /* * Custom event engine, DOM event listener abstraction layer, synthetic DOM * events. * @module event * @submodule event-base */ var IEEventFacade = function() { // IEEventFacade.superclass.constructor.apply(this, arguments); Y.DOM2EventFacade.apply(this, arguments); }; Y.extend(IEEventFacade, Y.DOM2EventFacade, { init: function() { IEEventFacade.superclass.init.apply(this, arguments); var e = this._event, resolve = Y.DOM2EventFacade.resolve, x, y, d, b, de, t; this.target = resolve(e.srcElement); if (('clientX' in e) && (!x) && (0 !== x)) { x = e.clientX; y = e.clientY; d = Y.config.doc; b = d.body; de = d.documentElement; x += (de.scrollLeft || (b && b.scrollLeft) || 0); y += (de.scrollTop || (b && b.scrollTop) || 0); this.pageX = x; this.pageY = y; } if (e.type == "mouseout") { t = e.toElement; } else if (e.type == "mouseover") { t = e.fromElement; } this.relatedTarget = resolve(t); // which should contain the unicode key code if this is a key event // if (e.charCode) { // this.which = e.charCode; // } // for click events, which is normalized for which mouse button was // clicked. if (e.button) { switch (e.button) { case 2: this.which = 3; break; case 4: this.which = 2; break; default: this.which = e.button; } this.button = this.which; } }, stopPropagation: function() { var e = this._event; e.cancelBubble = true; this._wrapper.stopped = 1; this.stopped = 1; }, stopImmediatePropagation: function() { this.stopPropagation(); this._wrapper.stopped = 2; this.stopped = 2; }, preventDefault: function(returnValue) { this._event.returnValue = returnValue || false; this._wrapper.prevented = 1; this.prevented = 1; } }); var imp = Y.config.doc && Y.config.doc.implementation; if (imp && (!imp.hasFeature('Events', '2.0'))) { Y.DOMEventFacade = IEEventFacade; } }, '@VERSION@' ); YUI.add('pluginhost-base', function(Y) { /** * Provides the augmentable PluginHost interface, which can be added to any class. * @module pluginhost */ /** * Provides the augmentable PluginHost interface, which can be added to any class. * @module pluginhost-base */ /** * <p> * An augmentable class, which provides the augmented class with the ability to host plugins. * It adds <a href="#method_plug">plug</a> and <a href="#method_unplug">unplug</a> methods to the augmented class, which can * be used to add or remove plugins from instances of the class. * </p> * * <p>Plugins can also be added through the constructor configuration object passed to the host class' constructor using * the "plugins" property. Supported values for the "plugins" property are those defined by the <a href="#method_plug">plug</a> method. * * For example the following code would add the AnimPlugin and IOPlugin to Overlay (the plugin host): * <xmp> * var o = new Overlay({plugins: [ AnimPlugin, {fn:IOPlugin, cfg:{section:"header"}}]}); * </xmp> * </p> * <p> * Plug.Host's protected <a href="#method_initPlugins">_initPlugins</a> and <a href="#method_destroyPlugins">_destroyPlugins</a> * methods should be invoked by the host class at the appropriate point in the host's lifecyle. * </p> * * @class Plugin.Host */ var L = Y.Lang; function PluginHost() { this._plugins = {}; } PluginHost.prototype = { /** * Adds a plugin to the host object. This will instantiate the * plugin and attach it to the configured namespace on the host object. * * @method plug * @chainable * @param P {Function | Object |Array} Accepts the plugin class, or an * object with a "fn" property specifying the plugin class and * a "cfg" property specifying the configuration for the Plugin. * <p> * Additionally an Array can also be passed in, with the above function or * object values, allowing the user to add multiple plugins in a single call. * </p> * @param config (Optional) If the first argument is the plugin class, the second argument * can be the configuration for the plugin. * @return {Base} A reference to the host object */ plug: function(Plugin, config) { var i, ln, ns; if (L.isArray(Plugin)) { for (i = 0, ln = Plugin.length; i < ln; i++) { this.plug(Plugin[i]); } } else { if (Plugin && !L.isFunction(Plugin)) { config = Plugin.cfg; Plugin = Plugin.fn; } // Plugin should be fn by now if (Plugin && Plugin.NS) { ns = Plugin.NS; config = config || {}; config.host = this; if (this.hasPlugin(ns)) { // Update config this[ns].setAttrs(config); } else { // Create new instance this[ns] = new Plugin(config); this._plugins[ns] = Plugin; } } } return this; }, /** * Removes a plugin from the host object. This will destroy the * plugin instance and delete the namepsace from the host object. * * @method unplug * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided, * all registered plugins are unplugged. * @return {Base} A reference to the host object * @chainable */ unplug: function(plugin) { var ns = plugin, plugins = this._plugins; if (plugin) { if (L.isFunction(plugin)) { ns = plugin.NS; if (ns && (!plugins[ns] || plugins[ns] !== plugin)) { ns = null; } } if (ns) { if (this[ns]) { this[ns].destroy(); delete this[ns]; } if (plugins[ns]) { delete plugins[ns]; } } } else { for (ns in this._plugins) { if (this._plugins.hasOwnProperty(ns)) { this.unplug(ns); } } } return this; }, /** * Determines if a plugin has plugged into this host. * * @method hasPlugin * @param {String} ns The plugin's namespace * @return {boolean} returns true, if the plugin has been plugged into this host, false otherwise. */ hasPlugin : function(ns) { return (this._plugins[ns] && this[ns]); }, /** * Initializes static plugins registered on the host (using the * Base.plug static method) and any plugins passed to the * instance through the "plugins" configuration property. * * @method _initPlugins * @param {Config} config The configuration object with property name/value pairs. * @private */ _initPlugins: function(config) { this._plugins = this._plugins || {}; if (this._initConfigPlugins) { this._initConfigPlugins(config); } }, /** * Unplugs and destroys all plugins on the host * @method _destroyPlugins * @private */ _destroyPlugins: function() { this.unplug(); } }; Y.namespace("Plugin").Host = PluginHost; }, '@VERSION@' ,{requires:['yui-base']}); YUI.add('pluginhost-config', function(Y) { /** * Adds pluginhost constructor configuration and static configuration support * @submodule pluginhost-config */ /** * Constructor and static configuration support for plugins * * @for Plugin.Host */ var PluginHost = Y.Plugin.Host, L = Y.Lang; PluginHost.prototype._initConfigPlugins = function(config) { // Class Configuration var classes = (this._getClasses) ? this._getClasses() : [this.constructor], plug = [], unplug = {}, constructor, i, classPlug, classUnplug, pluginClassName; // TODO: Room for optimization. Can we apply statically/unplug in same pass? for (i = classes.length - 1; i >= 0; i--) { constructor = classes[i]; classUnplug = constructor._UNPLUG; if (classUnplug) { // subclasses over-write Y.mix(unplug, classUnplug, true); } classPlug = constructor._PLUG; if (classPlug) { // subclasses over-write Y.mix(plug, classPlug, true); } } for (pluginClassName in plug) { if (plug.hasOwnProperty(pluginClassName)) { if (!unplug[pluginClassName]) { this.plug(plug[pluginClassName]); } } } // User Configuration if (config && config.plugins) { this.plug(config.plugins); } }; /** * Registers plugins to be instantiated at the class level (plugins * which should be plugged into every instance of the class by default). * * @method Plugin.Host.plug * @static * * @param {Function} hostClass The host class on which to register the plugins * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined) * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin */ PluginHost.plug = function(hostClass, plugin, config) { // Cannot plug into Base, since Plugins derive from Base [ will cause infinite recurrsion ] var p, i, l, name; if (hostClass !== Y.Base) { hostClass._PLUG = hostClass._PLUG || {}; if (!L.isArray(plugin)) { if (config) { plugin = {fn:plugin, cfg:config}; } plugin = [plugin]; } for (i = 0, l = plugin.length; i < l;i++) { p = plugin[i]; name = p.NAME || p.fn.NAME; hostClass._PLUG[name] = p; } } }; /** * Unregisters any class level plugins which have been registered by the host class, or any * other class in the hierarchy. * * @method Plugin.Host.unplug * @static * * @param {Function} hostClass The host class from which to unregister the plugins * @param {Function | Array} plugin The plugin class, or an array of plugin classes */ PluginHost.unplug = function(hostClass, plugin) { var p, i, l, name; if (hostClass !== Y.Base) { hostClass._UNPLUG = hostClass._UNPLUG || {}; if (!L.isArray(plugin)) { plugin = [plugin]; } for (i = 0, l = plugin.length; i < l; i++) { p = plugin[i]; name = p.NAME; if (!hostClass._PLUG[name]) { hostClass._UNPLUG[name] = p; } else { delete hostClass._PLUG[name]; } } } }; }, '@VERSION@' ,{requires:['pluginhost-base']}); YUI.add('pluginhost', function(Y){}, '@VERSION@' ,{use:['pluginhost-base', 'pluginhost-config']}); YUI.add('node-base', function(Y) { /** * The Node Utility provides a DOM-like interface for interacting with DOM nodes. * @module node * @submodule node-base */ /** * The Node class provides a wrapper for manipulating DOM Nodes. * Node properties can be accessed via the set/get methods. * Use Y.get() to retrieve Node instances. * * <strong>NOTE:</strong> Node properties are accessed using * the <code>set</code> and <code>get</code> methods. * * @class Node * @constructor * @param {DOMNode} node the DOM node to be mapped to the Node instance. * @for Node */ // "globals" var DOT = '.', NODE_NAME = 'nodeName', NODE_TYPE = 'nodeType', OWNER_DOCUMENT = 'ownerDocument', TAG_NAME = 'tagName', UID = '_yuid', _slice = Array.prototype.slice, Y_DOM = Y.DOM, Y_Node = function(node) { var uid = (node.nodeType !== 9) ? node.uniqueID : node[UID]; if (uid && Y_Node._instances[uid] && Y_Node._instances[uid]._node !== node) { node[UID] = null; // unset existing uid to prevent collision (via clone or hack) } uid = uid || Y.stamp(node); if (!uid) { // stamp failed; likely IE non-HTMLElement uid = Y.guid(); } this[UID] = uid; /** * The underlying DOM node bound to the Y.Node instance * @property _node * @private */ this._node = node; Y_Node._instances[uid] = this; this._stateProxy = node; // when augmented with Attribute Y.EventTarget.call(this, {emitFacade:true}); if (this._initPlugins) { // when augmented with Plugin.Host this._initPlugins(); } this.SHOW_TRANSITION = Y_Node.SHOW_TRANSITION; this.HIDE_TRANSITION = Y_Node.HIDE_TRANSITION; }, // used with previous/next/ancestor tests _wrapFn = function(fn) { var ret = null; if (fn) { ret = (typeof fn == 'string') ? function(n) { return Y.Selector.test(n, fn); } : function(n) { return fn(Y.one(n)); }; } return ret; }; // end "globals" /** * The name of the component * @static * @property NAME */ Y_Node.NAME = 'node'; /* * The pattern used to identify ARIA attributes */ Y_Node.re_aria = /^(?:role$|aria-)/; Y_Node.SHOW_TRANSITION = 'fadeIn'; Y_Node.HIDE_TRANSITION = 'fadeOut'; /** * List of events that route to DOM events * @static * @property DOM_EVENTS */ Y_Node.DOM_EVENTS = { abort: 1, beforeunload: 1, blur: 1, change: 1, click: 1, close: 1, command: 1, contextmenu: 1, dblclick: 1, DOMMouseScroll: 1, drag: 1, dragstart: 1, dragenter: 1, dragover: 1, dragleave: 1, dragend: 1, drop: 1, error: 1, focus: 1, key: 1, keydown: 1, keypress: 1, keyup: 1, load: 1, message: 1, mousedown: 1, mouseenter: 1, mouseleave: 1, mousemove: 1, mousemultiwheel: 1, mouseout: 1, mouseover: 1, mouseup: 1, mousewheel: 1, orientationchange: 1, reset: 1, resize: 1, select: 1, selectstart: 1, submit: 1, scroll: 1, textInput: 1, unload: 1 }; // Add custom event adaptors to this list. This will make it so // that delegate, key, available, contentready, etc all will // be available through Node.on Y.mix(Y_Node.DOM_EVENTS, Y.Env.evt.plugins); /** * A list of Node instances that have been created * @private * @property _instances * @static * */ Y_Node._instances = {}; /** * Retrieves the DOM node bound to a Node instance * @method getDOMNode * @static * * @param {Y.Node || HTMLNode} node The Node instance or an HTMLNode * @return {HTMLNode} The DOM node bound to the Node instance. If a DOM node is passed * as the node argument, it is simply returned. */ Y_Node.getDOMNode = function(node) { if (node) { return (node.nodeType) ? node : node._node || null; } return null; }; /** * Checks Node return values and wraps DOM Nodes as Y.Node instances * and DOM Collections / Arrays as Y.NodeList instances. * Other return values just pass thru. If undefined is returned (e.g. no return) * then the Node instance is returned for chainability. * @method scrubVal * @static * * @param {any} node The Node instance or an HTMLNode * @return {Y.Node | Y.NodeList | any} Depends on what is returned from the DOM node. */ Y_Node.scrubVal = function(val, node) { if (val) { // only truthy values are risky if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window val = Y.one(val); } else if ((val.item && !val._nodes) || // dom collection or Node instance (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes val = Y.all(val); } } } else if (typeof val === 'undefined') { val = node; // for chaining } else if (val === null) { val = null; // IE: DOM null not the same as null } return val; }; /** * Adds methods to the Y.Node prototype, routing through scrubVal. * @method addMethod * @static * * @param {String} name The name of the method to add * @param {Function} fn The function that becomes the method * @param {Object} context An optional context to call the method with * (defaults to the Node instance) * @return {any} Depends on what is returned from the DOM node. */ Y_Node.addMethod = function(name, fn, context) { if (name && fn && typeof fn == 'function') { Y_Node.prototype[name] = function() { var args = _slice.call(arguments), node = this, ret; if (args[0] && Y.instanceOf(args[0], Y_Node)) { args[0] = args[0]._node; } if (args[1] && Y.instanceOf(args[1], Y_Node)) { args[1] = args[1]._node; } args.unshift(node._node); ret = fn.apply(node, args); if (ret) { // scrub truthy ret = Y_Node.scrubVal(ret, node); } (typeof ret != 'undefined') || (ret = node); return ret; }; } else { } }; /** * Imports utility methods to be added as Y.Node methods. * @method importMethod * @static * * @param {Object} host The object that contains the method to import. * @param {String} name The name of the method to import * @param {String} altName An optional name to use in place of the host name * @param {Object} context An optional context to call the method with */ Y_Node.importMethod = function(host, name, altName) { if (typeof name == 'string') { altName = altName || name; Y_Node.addMethod(altName, host[name], host); } else { Y.Array.each(name, function(n) { Y_Node.importMethod(host, n); }); } }; /** * Returns a single Node instance bound to the node or the * first element matching the given selector. Returns null if no match found. * <strong>Note:</strong> For chaining purposes you may want to * use <code>Y.all</code>, which returns a NodeList when no match is found. * @method Y.one * @static * @param {String | HTMLElement} node a node or Selector * @return {Y.Node | null} a Node instance or null if no match found. */ Y_Node.one = function(node) { var instance = null, cachedNode, uid; if (node) { if (typeof node == 'string') { if (node.indexOf('doc') === 0) { // doc OR document node = Y.config.doc; } else if (node.indexOf('win') === 0) { // win OR window node = Y.config.win; } else { node = Y.Selector.query(node, null, true); } if (!node) { return null; } } else if (Y.instanceOf(node, Y_Node)) { return node; // NOTE: return } if (node.nodeType || Y.DOM.isWindow(node)) { // avoid bad input (numbers, boolean, etc) uid = (node.uniqueID && node.nodeType !== 9) ? node.uniqueID : node._yuid; instance = Y_Node._instances[uid]; // reuse exising instances cachedNode = instance ? instance._node : null; if (!instance || (cachedNode && node !== cachedNode)) { // new Node when nodes don't match instance = new Y_Node(node); } } } return instance; }; /** * Returns a new dom node using the provided markup string. * @method create * @static * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {Node} A Node instance bound to a DOM node or fragment */ Y_Node.create = function(html, doc) { if (doc && doc._node) { doc = doc._node; } return Y.one(Y_DOM.create(html, doc)); }; /** * Static collection of configuration attributes for special handling * @property ATTRS * @static * @type object */ Y_Node.ATTRS = { /** * Allows for getting and setting the text of an element. * Formatting is preserved and special characters are treated literally. * @config text * @type String */ text: { getter: function() { return Y_DOM.getText(this._node); }, setter: function(content) { Y_DOM.setText(this._node, content); return content; } }, 'options': { getter: function() { return this._node.getElementsByTagName('option'); } }, /** * Returns a NodeList instance of all HTMLElement children. * @readOnly * @config children * @type NodeList */ 'children': { getter: function() { var node = this._node, children = node.children, childNodes, i, len; if (!children) { childNodes = node.childNodes; children = []; for (i = 0, len = childNodes.length; i < len; ++i) { if (childNodes[i][TAG_NAME]) { children[children.length] = childNodes[i]; } } } return Y.all(children); } }, value: { getter: function() { return Y_DOM.getValue(this._node); }, setter: function(val) { Y_DOM.setValue(this._node, val); return val; } } }; /** * The default setter for DOM properties * Called with instance context (this === the Node instance) * @method DEFAULT_SETTER * @static * @param {String} name The attribute/property being set * @param {any} val The value to be set * @return {any} The value */ Y_Node.DEFAULT_SETTER = function(name, val) { var node = this._stateProxy, strPath; if (name.indexOf(DOT) > -1) { strPath = name; name = name.split(DOT); // only allow when defined on node Y.Object.setValue(node, name, val); } else if (typeof node[name] != 'undefined') { // pass thru DOM properties node[name] = val; } return val; }; /** * The default getter for DOM properties * Called with instance context (this === the Node instance) * @method DEFAULT_GETTER * @static * @param {String} name The attribute/property to look up * @return {any} The current value */ Y_Node.DEFAULT_GETTER = function(name) { var node = this._stateProxy, val; if (name.indexOf && name.indexOf(DOT) > -1) { val = Y.Object.getValue(node, name.split(DOT)); } else if (typeof node[name] != 'undefined') { // pass thru from DOM val = node[name]; } return val; }; // Basic prototype augment - no lazy constructor invocation. Y.mix(Y_Node, Y.EventTarget, false, null, 1); Y.mix(Y_Node.prototype, { /** * The method called when outputting Node instances as strings * @method toString * @return {String} A string representation of the Node instance */ toString: function() { var str = this[UID] + ': not bound to a node', node = this._node, attrs, id, className; if (node) { attrs = node.attributes; id = (attrs && attrs.id) ? node.getAttribute('id') : null; className = (attrs && attrs.className) ? node.getAttribute('className') : null; str = node[NODE_NAME]; if (id) { str += '#' + id; } if (className) { str += '.' + className.replace(' ', '.'); } // TODO: add yuid? str += ' ' + this[UID]; } return str; }, /** * Returns an attribute value on the Node instance. * Unless pre-configured (via Node.ATTRS), get hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be set. * @method get * @param {String} attr The attribute * @return {any} The current value of the attribute */ get: function(attr) { var val; if (this._getAttr) { // use Attribute imple val = this._getAttr(attr); } else { val = this._get(attr); } if (val) { val = Y_Node.scrubVal(val, this); } else if (val === null) { val = null; // IE: DOM null is not true null (even though they ===) } return val; }, /** * Helper method for get. * @method _get * @private * @param {String} attr The attribute * @return {any} The current value of the attribute */ _get: function(attr) { var attrConfig = Y_Node.ATTRS[attr], val; if (attrConfig && attrConfig.getter) { val = attrConfig.getter.call(this); } else if (Y_Node.re_aria.test(attr)) { val = this._node.getAttribute(attr, 2); } else { val = Y_Node.DEFAULT_GETTER.apply(this, arguments); } return val; }, /** * Sets an attribute on the Node instance. * Unless pre-configured (via Node.ATTRS), set hands * off to the underlying DOM node. Only valid * attributes/properties for the node will be set. * To set custom attributes use setAttribute. * @method set * @param {String} attr The attribute to be set. * @param {any} val The value to set the attribute to. * @chainable */ set: function(attr, val) { var attrConfig = Y_Node.ATTRS[attr]; if (this._setAttr) { // use Attribute imple this._setAttr.apply(this, arguments); } else { // use setters inline if (attrConfig && attrConfig.setter) { attrConfig.setter.call(this, val, attr); } else if (Y_Node.re_aria.test(attr)) { // special case Aria this._node.setAttribute(attr, val); } else { Y_Node.DEFAULT_SETTER.apply(this, arguments); } } return this; }, /** * Sets multiple attributes. * @method setAttrs * @param {Object} attrMap an object of name/value pairs to set * @chainable */ setAttrs: function(attrMap) { if (this._setAttrs) { // use Attribute imple this._setAttrs(attrMap); } else { // use setters inline Y.Object.each(attrMap, function(v, n) { this.set(n, v); }, this); } return this; }, /** * Returns an object containing the values for the requested attributes. * @method getAttrs * @param {Array} attrs an array of attributes to get values * @return {Object} An object with attribute name/value pairs. */ getAttrs: function(attrs) { var ret = {}; if (this._getAttrs) { // use Attribute imple this._getAttrs(attrs); } else { // use setters inline Y.Array.each(attrs, function(v, n) { ret[v] = this.get(v); }, this); } return ret; }, /** * Creates a new Node using the provided markup string. * @method create * @param {String} html The markup used to create the element * @param {HTMLDocument} doc An optional document context * @return {Node} A Node instance bound to a DOM node or fragment */ create: Y_Node.create, /** * Compares nodes to determine if they match. * Node instances can be compared to each other and/or HTMLElements. * @method compareTo * @param {HTMLElement | Node} refNode The reference node to compare to the node. * @return {Boolean} True if the nodes match, false if they do not. */ compareTo: function(refNode) { var node = this._node; if (Y.instanceOf(refNode, Y_Node)) { refNode = refNode._node; } return node === refNode; }, /** * Determines whether the node is appended to the document. * @method inDoc * @param {Node|HTMLElement} doc optional An optional document to check against. * Defaults to current document. * @return {Boolean} Whether or not this node is appended to the document. */ inDoc: function(doc) { var node = this._node; doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT]; if (doc.documentElement) { return Y_DOM.contains(doc.documentElement, node); } }, getById: function(id) { var node = this._node, ret = Y_DOM.byId(id, node[OWNER_DOCUMENT]); if (ret && Y_DOM.contains(node, ret)) { ret = Y.one(ret); } else { ret = null; } return ret; }, /** * Returns the nearest ancestor that passes the test applied by supplied boolean method. * @method ancestor * @param {String | Function} fn A selector string or boolean method for testing elements. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * If a function is used, it receives the current node being tested as the only argument. * @return {Node} The matching Node instance or null if not found */ ancestor: function(fn, testSelf) { return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf)); }, /** * Returns the ancestors that pass the test applied by supplied boolean method. * @method ancestors * @param {String | Function} fn A selector string or boolean method for testing elements. * @param {Boolean} testSelf optional Whether or not to include the element in the scan * If a function is used, it receives the current node being tested as the only argument. * @return {NodeList} A NodeList instance containing the matching elements */ ancestors: function(fn, testSelf) { return Y.all(Y_DOM.ancestors(this._node, _wrapFn(fn), testSelf)); }, /** * Returns the previous matching sibling. * Returns the nearest element node sibling if no method provided. * @method previous * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} Node instance or null if not found */ previous: function(fn, all) { return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all)); }, /** * Returns the next matching sibling. * Returns the nearest element node sibling if no method provided. * @method next * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {Node} Node instance or null if not found */ next: function(fn, all) { return Y.one(Y_DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all)); }, /** * Returns all matching siblings. * Returns all siblings if no method provided. * @method siblings * @param {String | Function} fn A selector or boolean method for testing elements. * If a function is used, it receives the current node being tested as the only argument. * @return {NodeList} NodeList instance bound to found siblings */ siblings: function(fn) { return Y.all(Y_DOM.siblings(this._node, _wrapFn(fn))); }, /** * Retrieves a Node instance of nodes based on the given CSS selector. * @method one * * @param {string} selector The CSS selector to test against. * @return {Node} A Node instance for the matching HTMLElement. */ one: function(selector) { return Y.one(Y.Selector.query(selector, this._node, true)); }, /** * Retrieves a nodeList based on the given CSS selector. * @method all * * @param {string} selector The CSS selector to test against. * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array. */ all: function(selector) { var nodelist = Y.all(Y.Selector.query(selector, this._node)); nodelist._query = selector; nodelist._queryRoot = this._node; return nodelist; }, // TODO: allow fn test /** * Test if the supplied node matches the supplied selector. * @method test * * @param {string} selector The CSS selector to test against. * @return {boolean} Whether or not the node matches the selector. */ test: function(selector) { return Y.Selector.test(this._node, selector); }, /** * Removes the node from its parent. * Shortcut for myNode.get('parentNode').removeChild(myNode); * @method remove * @param {Boolean} destroy whether or not to call destroy() on the node * after removal. * @chainable * */ remove: function(destroy) { var node = this._node, parentNode = node.parentNode; if (parentNode) { parentNode.removeChild(node); } if (destroy) { this.destroy(); } return this; }, /** * Replace the node with the other node. This is a DOM update only * and does not change the node bound to the Node instance. * Shortcut for myNode.get('parentNode').replaceChild(newNode, myNode); * @method replace * @param {Y.Node || HTMLNode} newNode Node to be inserted * @chainable * */ replace: function(newNode) { var node = this._node; if (typeof newNode == 'string') { newNode = Y_Node.create(newNode); } node.parentNode.replaceChild(Y_Node.getDOMNode(newNode), node); return this; }, /** * @method replaceChild * @for Node * @param {String | HTMLElement | Node} node Node to be inserted * @param {HTMLElement | Node} refNode Node to be replaced * @return {Node} The replaced node */ replaceChild: function(node, refNode) { if (typeof node == 'string') { node = Y_DOM.create(node); } return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node), Y_Node.getDOMNode(refNode))); }, /** * @method appendChild * @param {String | HTMLElement | Node} node Node to be appended * @return {Node} The appended node */ appendChild: function(node) { return Y_Node.scrubVal(this._insert(node)); }, /** * @method insertBefore * @param {String | HTMLElement | Node} newNode Node to be appended * @param {HTMLElement | Node} refNode Node to be inserted before * @return {Node} The inserted node */ insertBefore: function(newNode, refNode) { return Y.Node.scrubVal(this._insert(newNode, refNode)); }, /** * Removes event listeners from the node and (optionally) its subtree * @method purge * @param {Boolean} recurse (optional) Whether or not to remove listeners from the * node's subtree * @param {String} type (optional) Only remove listeners of the specified type * @chainable * */ purge: function(recurse, type) { Y.Event.purgeElement(this._node, recurse, type); return this; }, /** * Nulls internal node references, removes any plugins and event listeners * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false) * */ destroy: function(recursive) { this.purge(); // TODO: only remove events add via this Node if (this.unplug) { // may not be a PluginHost this.unplug(); } this.clearData(); if (recursive) { this.all('*').destroy(); } this._node = null; this._stateProxy = null; delete Y_Node._instances[this[UID]]; }, /** * Invokes a method on the Node instance * @method invoke * @param {String} method The name of the method to invoke * @param {Any} a, b, c, etc. Arguments to invoke the method with. * @return Whatever the underly method returns. * DOM Nodes and Collections return values * are converted to Node/NodeList instances. * */ invoke: function(method, a, b, c, d, e) { var node = this._node, ret; if (a && Y.instanceOf(a, Y_Node)) { a = a._node; } if (b && Y.instanceOf(b, Y_Node)) { b = b._node; } ret = node[method](a, b, c, d, e); return Y_Node.scrubVal(ret, this); }, /** * Inserts the content before the reference node. * @method insert * @param {String | Y.Node | HTMLElement | Y.NodeList | HTMLCollection} content The content to insert * @param {Int | Y.Node | HTMLElement | String} where The position to insert at. * Possible "where" arguments * <dl> * <dt>Y.Node</dt> * <dd>The Node to insert before</dd> * <dt>HTMLElement</dt> * <dd>The element to insert before</dd> * <dt>Int</dt> * <dd>The index of the child element to insert before</dd> * <dt>"replace"</dt> * <dd>Replaces the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts before the existing HTML</dd> * <dt>"before"</dt> * <dd>Inserts content before the node</dd> * <dt>"after"</dt> * <dd>Inserts content after the node</dd> * </dl> * @chainable */ insert: function(content, where) { this._insert(content, where); return this; }, _insert: function(content, where) { var node = this._node, ret = null; if (typeof where == 'number') { // allow index where = this._node.childNodes[where]; } else if (where && where._node) { // Node where = where._node; } if (content && typeof content != 'string') { // allow Node or NodeList/Array instances content = content._node || content._nodes || content; } ret = Y_DOM.addHTML(node, content, where); return ret; }, /** * Inserts the content as the firstChild of the node. * @method prepend * @param {String | Y.Node | HTMLElement} content The content to insert * @chainable */ prepend: function(content) { return this.insert(content, 0); }, /** * Inserts the content as the lastChild of the node. * @method append * @param {String | Y.Node | HTMLElement} content The content to insert * @chainable */ append: function(content) { return this.insert(content, null); }, /** * Appends the node to the given node. * @method appendTo * @param {Y.Node | HTMLElement} node The node to append to * @chainable */ appendTo: function(node) { Y.one(node).append(this); }, /** * Replaces the node's current content with the content. * @method setContent * @param {String | Y.Node | HTMLElement | Y.NodeList | HTMLCollection} content The content to insert * @chainable */ setContent: function(content) { this._insert(content, 'replace'); return this; }, /** * Returns the node's current content (e.g. innerHTML) * @method getContent * @return {String} The current content */ getContent: function(content) { return this.get('innerHTML'); }, /** * @method swap * @description Swap DOM locations with the given node. * This does not change which DOM node each Node instance refers to. * @param {Node} otherNode The node to swap with * @chainable */ swap: Y.config.doc.documentElement.swapNode ? function(otherNode) { this._node.swapNode(Y_Node.getDOMNode(otherNode)); } : function(otherNode) { otherNode = Y_Node.getDOMNode(otherNode); var node = this._node, parent = otherNode.parentNode, nextSibling = otherNode.nextSibling; if (nextSibling === node) { parent.insertBefore(node, otherNode); } else if (otherNode === node.nextSibling) { parent.insertBefore(otherNode, node); } else { node.parentNode.replaceChild(otherNode, node); Y_DOM.addHTML(parent, node, nextSibling); } return this; }, /** * @method getData * @description Retrieves arbitrary data stored on a Node instance. * This is not stored with the DOM node. * @param {string} name Optional name of the data field to retrieve. * If no name is given, all data is returned. * @return {any | Object} Whatever is stored at the given field, * or an object hash of all fields. */ getData: function(name) { var ret; this._data = this._data || {}; if (arguments.length) { ret = this._data[name]; } else { ret = this._data; } return ret; }, /** * @method setData * @description Stores arbitrary data on a Node instance. * This is not stored with the DOM node. * @param {string} name The name of the field to set. If no name * is given, name is treated as the data and overrides any existing data. * @param {any} val The value to be assigned to the field. * @chainable */ setData: function(name, val) { this._data = this._data || {}; if (arguments.length > 1) { this._data[name] = val; } else { this._data = name; } return this; }, /** * @method clearData * @description Clears stored data. * @param {string} name The name of the field to clear. If no name * is given, all data is cleared. * @chainable */ clearData: function(name) { if ('_data' in this) { if (name) { delete this._data[name]; } else { delete this._data; } } return this; }, hasMethod: function(method) { var node = this._node; return !!(node && method in node && typeof node[method] != 'unknown' && (typeof node[method] == 'function' || String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space }, SHOW_TRANSITION: null, HIDE_TRANSITION: null, /** * Makes the node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @method show * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ show: function(callback) { callback = arguments[arguments.length - 1]; this.toggleView(true, callback); return this; }, /** * The implementation for showing nodes. * Default is to toggle the style.display property. * @protected * @chainable */ _show: function() { this.setStyle('display', ''); }, _isHidden: function() { return Y.DOM.getStyle(this._node, 'display') === 'none'; }, toggleView: function(on, callback) { this._toggleView.apply(this, arguments); }, _toggleView: function(on, callback) { callback = arguments[arguments.length - 1]; // base on current state if not forcing if (typeof on != 'boolean') { on = (this._isHidden()) ? 1 : 0; } if (on) { this._show(); } else { this._hide(); } if (typeof callback == 'function') { callback.call(this); } return this; }, /** * Hides the node. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @method hide * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ hide: function(callback) { callback = arguments[arguments.length - 1]; this.toggleView(false, callback); return this; }, /** * The implementation for hiding nodes. * Default is to toggle the style.display property. * @protected * @chainable */ _hide: function() { this.setStyle('display', 'none'); }, isFragment: function() { return (this.get('nodeType') === 11); }, /** * Removes all of the child nodes from the node. * @param {Boolean} destroy Whether the nodes should also be destroyed. * @chainable */ empty: function(destroy) { this.get('childNodes').remove(destroy); return this; } }, true); Y.Node = Y_Node; Y.one = Y.Node.one; /** * The NodeList module provides support for managing collections of Nodes. * @module node * @submodule nodelist */ /** * The NodeList class provides a wrapper for manipulating DOM NodeLists. * NodeList properties can be accessed via the set/get methods. * Use Y.all() to retrieve NodeList instances. * * @class NodeList * @constructor */ var NodeList = function(nodes) { var tmp = []; if (typeof nodes === 'string') { // selector query this._query = nodes; nodes = Y.Selector.query(nodes); } else if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window nodes = [nodes]; } else if (Y.instanceOf(nodes, Y.Node)) { nodes = [nodes._node]; } else if (Y.instanceOf(nodes[0], Y.Node)) { // allow array of Y.Nodes Y.Array.each(nodes, function(node) { if (node._node) { tmp.push(node._node); } }); nodes = tmp; } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes) nodes = Y.Array(nodes, 0, true); } /** * The underlying array of DOM nodes bound to the Y.NodeList instance * @property _nodes * @private */ this._nodes = nodes; }; NodeList.NAME = 'NodeList'; /** * Retrieves the DOM nodes bound to a NodeList instance * @method NodeList.getDOMNodes * @static * * @param {Y.NodeList} nodelist The NodeList instance * @return {Array} The array of DOM nodes bound to the NodeList */ NodeList.getDOMNodes = function(nodelist) { return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist; }; NodeList.each = function(instance, fn, context) { var nodes = instance._nodes; if (nodes && nodes.length) { Y.Array.each(nodes, fn, context || instance); } else { } }; NodeList.addMethod = function(name, fn, context) { if (name && fn) { NodeList.prototype[name] = function() { var ret = [], args = arguments; Y.Array.each(this._nodes, function(node) { var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid', instance = Y.Node._instances[node[UID]], ctx, result; if (!instance) { instance = NodeList._getTempNode(node); } ctx = context || instance; result = fn.apply(ctx, args); if (result !== undefined && result !== instance) { ret[ret.length] = result; } }); // TODO: remove tmp pointer return ret.length ? ret : this; }; } else { } }; NodeList.importMethod = function(host, name, altName) { if (typeof name === 'string') { altName = altName || name; NodeList.addMethod(name, host[name]); } else { Y.Array.each(name, function(n) { NodeList.importMethod(host, n); }); } }; NodeList._getTempNode = function(node) { var tmp = NodeList._tempNode; if (!tmp) { tmp = Y.Node.create('<div></div>'); NodeList._tempNode = tmp; } tmp._node = node; tmp._stateProxy = node; return tmp; }; Y.mix(NodeList.prototype, { /** * Retrieves the Node instance at the given index. * @method item * * @param {Number} index The index of the target Node. * @return {Node} The Node instance at the given index. */ item: function(index) { return Y.one((this._nodes || [])[index]); }, /** * Applies the given function to each Node in the NodeList. * @method each * @param {Function} fn The function to apply. It receives 3 arguments: * the current node instance, the node's index, and the NodeList instance * @param {Object} context optional An optional context to apply the function with * Default context is the current Node instance * @chainable */ each: function(fn, context) { var instance = this; Y.Array.each(this._nodes, function(node, index) { node = Y.one(node); return fn.call(context || node, node, index, instance); }); return instance; }, batch: function(fn, context) { var nodelist = this; Y.Array.each(this._nodes, function(node, index) { var instance = Y.Node._instances[node[UID]]; if (!instance) { instance = NodeList._getTempNode(node); } return fn.call(context || instance, instance, index, nodelist); }); return nodelist; }, /** * Executes the function once for each node until a true value is returned. * @method some * @param {Function} fn The function to apply. It receives 3 arguments: * the current node instance, the node's index, and the NodeList instance * @param {Object} context optional An optional context to execute the function from. * Default context is the current Node instance * @return {Boolean} Whether or not the function returned true for any node. */ some: function(fn, context) { var instance = this; return Y.Array.some(this._nodes, function(node, index) { node = Y.one(node); context = context || node; return fn.call(context, node, index, instance); }); }, /** * Creates a documenFragment from the nodes bound to the NodeList instance * @method toFrag * @return Node a Node instance bound to the documentFragment */ toFrag: function() { return Y.one(Y.DOM._nl2frag(this._nodes)); }, /** * Returns the index of the node in the NodeList instance * or -1 if the node isn't found. * @method indexOf * @param {Y.Node || DOMNode} node the node to search for * @return {Int} the index of the node value or -1 if not found */ indexOf: function(node) { return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node)); }, /** * Filters the NodeList instance down to only nodes matching the given selector. * @method filter * @param {String} selector The selector to filter against * @return {NodeList} NodeList containing the updated collection * @see Selector */ filter: function(selector) { return Y.all(Y.Selector.filter(this._nodes, selector)); }, /** * Creates a new NodeList containing all nodes at every n indices, where * remainder n % index equals r. * (zero-based index). * @method modulus * @param {Int} n The offset to use (return every nth node) * @param {Int} r An optional remainder to use with the modulus operation (defaults to zero) * @return {NodeList} NodeList containing the updated collection */ modulus: function(n, r) { r = r || 0; var nodes = []; NodeList.each(this, function(node, i) { if (i % n === r) { nodes.push(node); } }); return Y.all(nodes); }, /** * Creates a new NodeList containing all nodes at odd indices * (zero-based index). * @method odd * @return {NodeList} NodeList containing the updated collection */ odd: function() { return this.modulus(2, 1); }, /** * Creates a new NodeList containing all nodes at even indices * (zero-based index), including zero. * @method even * @return {NodeList} NodeList containing the updated collection */ even: function() { return this.modulus(2); }, destructor: function() { }, /** * Reruns the initial query, when created using a selector query * @method refresh * @chainable */ refresh: function() { var doc, nodes = this._nodes, query = this._query, root = this._queryRoot; if (query) { if (!root) { if (nodes && nodes[0] && nodes[0].ownerDocument) { root = nodes[0].ownerDocument; } } this._nodes = Y.Selector.query(query, root); } return this; }, _prepEvtArgs: function(type, fn, context) { // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc) var args = Y.Array(arguments, 0, true); if (args.length < 2) { // type only (event hash) just add nodes args[2] = this._nodes; } else { args.splice(2, 0, this._nodes); } args[3] = context || this; // default to NodeList instance as context return args; }, /** * Applies an event listener to each Node bound to the NodeList. * @method on * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @param {Object} context The context to call the handler with. * param {mixed} arg* 0..n additional arguments to supply to the subscriber * when the event fires. * @return {Object} Returns an event handle that can later be use to detach(). * @see Event.on */ on: function(type, fn, context) { return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an one-time event listener to each Node bound to the NodeList. * @method once * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * @see Event.on */ once: function(type, fn, context) { return Y.once.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Applies an event listener to each Node bound to the NodeList. * The handler is called only after all on() handlers are called * and the event is not prevented. * @method after * @param {String} type The event being listened for * @param {Function} fn The handler to call when the event fires * @param {Object} context The context to call the handler with. * Default is the NodeList instance. * @return {Object} Returns an event handle that can later be use to detach(). * @see Event.on */ after: function(type, fn, context) { return Y.after.apply(Y, this._prepEvtArgs.apply(this, arguments)); }, /** * Returns the current number of items in the NodeList. * @method size * @return {Int} The number of items in the NodeList. */ size: function() { return this._nodes.length; }, /** * Determines if the instance is bound to any nodes * @method isEmpty * @return {Boolean} Whether or not the NodeList is bound to any nodes */ isEmpty: function() { return this._nodes.length < 1; }, toString: function() { var str = '', errorMsg = this[UID] + ': not bound to any nodes', nodes = this._nodes, node; if (nodes && nodes[0]) { node = nodes[0]; str += node[NODE_NAME]; if (node.id) { str += '#' + node.id; } if (node.className) { str += '.' + node.className.replace(' ', '.'); } if (nodes.length > 1) { str += '...[' + nodes.length + ' items]'; } } return str || errorMsg; } }, true); NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance * @for NodeList * @method append * @see Node.append */ 'append', /** Called on each Node instance * @method destroy * @see Node.destroy */ 'destroy', /** * Called on each Node instance * @method detach * @see Node.detach */ 'detach', /** Called on each Node instance * @method detachAll * @see Node.detachAll */ 'detachAll', /** Called on each Node instance * @method empty * @see Node.empty */ 'empty', /** Called on each Node instance * @method insert * @see Node.insert */ 'insert', /** Called on each Node instance * @method prepend * @see Node.prepend */ 'prepend', /** Called on each Node instance * @method remove * @see Node.remove */ 'remove', /** Called on each Node instance * @method set * @see Node.set */ 'set', /** Called on each Node instance * @method setContent * @see Node.setContent */ 'setContent', /** * Makes each node visible. * If the "transition" module is loaded, show optionally * animates the showing of the node using either the default * transition effect ('fadeIn'), or the given named effect. * @method show * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ 'show', /** * Hides each node. * If the "transition" module is loaded, hide optionally * animates the hiding of the node using either the default * transition effect ('fadeOut'), or the given named effect. * @method hide * @param {String} name A named Transition effect to use as the show effect. * @param {Object} config Options to use with the transition. * @param {Function} callback An optional function to run after the transition completes. * @chainable */ 'hide', 'toggleView' ]); // one-off implementation to convert array of Nodes to NodeList // e.g. Y.all('input').get('parentNode'); /** Called on each Node instance * @method get * @see Node */ NodeList.prototype.get = function(attr) { var ret = [], nodes = this._nodes, isNodeList = false, getTemp = NodeList._getTempNode, instance, val; if (nodes[0]) { instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]); val = instance._get(attr); if (val && val.nodeType) { isNodeList = true; } } Y.Array.each(nodes, function(node) { instance = Y.Node._instances[node._yuid]; if (!instance) { instance = getTemp(node); } val = instance._get(attr); if (!isNodeList) { // convert array of Nodes to NodeList val = Y.Node.scrubVal(val, instance); } ret.push(val); }); return (isNodeList) ? Y.all(ret) : ret; }; Y.NodeList = NodeList; Y.all = function(nodes) { return new NodeList(nodes); }; Y.Node.all = Y.all; Y.Array.each([ /** * Passes through to DOM method. * @for Node * @method removeChild * @param {HTMLElement | Node} node Node to be removed * @return {Node} The removed node */ 'removeChild', /** * Passes through to DOM method. * @method hasChildNodes * @return {Boolean} Whether or not the node has any childNodes */ 'hasChildNodes', /** * Passes through to DOM method. * @method cloneNode * @param {Boolean} deep Whether or not to perform a deep clone, which includes * subtree and attributes * @return {Node} The clone */ 'cloneNode', /** * Passes through to DOM method. * @method hasAttribute * @param {String} attribute The attribute to test for * @return {Boolean} Whether or not the attribute is present */ 'hasAttribute', /** * Passes through to DOM method. * @method removeAttribute * @param {String} attribute The attribute to be removed * @chainable */ 'removeAttribute', /** * Passes through to DOM method. * @method scrollIntoView * @chainable */ 'scrollIntoView', /** * Passes through to DOM method. * @method getElementsByTagName * @param {String} tagName The tagName to collect * @return {NodeList} A NodeList representing the HTMLCollection */ 'getElementsByTagName', /** * Passes through to DOM method. * @method focus * @chainable */ 'focus', /** * Passes through to DOM method. * @method blur * @chainable */ 'blur', /** * Passes through to DOM method. * Only valid on FORM elements * @method submit * @chainable */ 'submit', /** * Passes through to DOM method. * Only valid on FORM elements * @method reset * @chainable */ 'reset', /** * Passes through to DOM method. * @method select * @chainable */ 'select', /** * Passes through to DOM method. * Only valid on TABLE elements * @method createCaption * @chainable */ 'createCaption' ], function(method) { Y.Node.prototype[method] = function(arg1, arg2, arg3) { var ret = this.invoke(method, arg1, arg2, arg3); return ret; }; }); Y.Node.importMethod(Y.DOM, [ /** * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. * @method contains * @param {Node | HTMLElement} needle The possible node or descendent * @return {Boolean} Whether or not this node is the needle its ancestor */ 'contains', /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @for Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @for Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute', /** * Wraps the given HTML around the node. * @method wrap * @param {String} html The markup to wrap around the node. * @chainable */ 'wrap', /** * Removes the node's parent node. * @method unwrap * @chainable */ 'unwrap', /** * Applies a unique ID to the node if none exists * @method generateID * @return {String} The existing or generated ID */ 'generateID' ]); Y.NodeList.importMethod(Y.Node.prototype, [ /** * Allows getting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method getAttribute * @see Node * @for NodeList * @param {string} name The attribute name * @return {string} The attribute value */ 'getAttribute', /** * Allows setting attributes on DOM nodes, normalizing in some cases. * This passes through to the DOM node, allowing for custom attributes. * @method setAttribute * @see Node * @for NodeList * @chainable * @param {string} name The attribute name * @param {string} value The value to set */ 'setAttribute', /** * Allows for removing attributes on DOM nodes. * This passes through to the DOM node, allowing for custom attributes. * @method removeAttribute * @see Node * @for NodeList * @param {string} name The attribute to remove */ 'removeAttribute', /** * Removes the parent node from node in the list. * @method unwrap * @chainable */ 'unwrap', /** * Wraps the given HTML around each node. * @method wrap * @param {String} html The markup to wrap around the node. * @chainable */ 'wrap', /** * Applies a unique ID to each node if none exists * @method generateID * @return {String} The existing or generated ID */ 'generateID' ]); (function(Y) { var methods = [ /** * Determines whether each node has the given className. * @method hasClass * @for Node * @param {String} className the class name to search for * @return {Boolean} Whether or not the element has the specified class */ 'hasClass', /** * Adds a class name to each node. * @method addClass * @param {String} className the class name to add to the node's class attribute * @chainable */ 'addClass', /** * Removes a class name from each node. * @method removeClass * @param {String} className the class name to remove from the node's class attribute * @chainable */ 'removeClass', /** * Replace a class with another class for each node. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name * @chainable */ 'replaceClass', /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @param {String} className the class name to be toggled * @param {Boolean} force Option to force adding or removing the class. * @chainable */ 'toggleClass' ]; Y.Node.importMethod(Y.DOM, methods); /** * Determines whether each node has the given className. * @method hasClass * @see Node.hasClass * @for NodeList * @param {String} className the class name to search for * @return {Array} An array of booleans for each node bound to the NodeList. */ /** * Adds a class name to each node. * @method addClass * @see Node.addClass * @param {String} className the class name to add to the node's class attribute * @chainable */ /** * Removes a class name from each node. * @method removeClass * @see Node.removeClass * @param {String} className the class name to remove from the node's class attribute * @chainable */ /** * Replace a class with another class for each node. * If no oldClassName is present, the newClassName is simply added. * @method replaceClass * @see Node.replaceClass * @param {String} oldClassName the class name to be replaced * @param {String} newClassName the class name that will be replacing the old class name * @chainable */ /** * If the className exists on the node it is removed, if it doesn't exist it is added. * @method toggleClass * @see Node.toggleClass * @param {String} className the class name to be toggled * @chainable */ Y.NodeList.importMethod(Y.Node.prototype, methods); })(Y); if (!Y.config.doc.documentElement.hasAttribute) { // IE < 8 Y.Node.prototype.hasAttribute = function(attr) { if (attr === 'value') { if (this.get('value') !== "") { // IE < 8 fails to populate specified when set in HTML return true; } } return !!(this._node.attributes[attr] && this._node.attributes[attr].specified); }; } // IE throws an error when calling focus() on an element that's invisible, not // displayed, or disabled. Y.Node.prototype.focus = function () { try { this._node.focus(); } catch (e) { } }; // IE throws error when setting input.type = 'hidden', // input.setAttribute('type', 'hidden') and input.attributes.type.value = 'hidden' Y.Node.ATTRS.type = { setter: function(val) { if (val === 'hidden') { try { this._node.type = 'hidden'; } catch(e) { this.setStyle('display', 'none'); this._inputType = 'hidden'; } } else { try { // IE errors when changing the type from "hidden' this._node.type = val; } catch (e) { } } return val; }, getter: function() { return this._inputType || this._node.type; }, _bypassProxy: true // don't update DOM when using with Attribute }; if (Y.config.doc.createElement('form').elements.nodeType) { // IE: elements collection is also FORM node which trips up scrubVal. Y.Node.ATTRS.elements = { getter: function() { return this.all('input, textarea, button, select'); } }; } Y.mix(Y.Node.ATTRS, { offsetHeight: { setter: function(h) { Y.DOM.setHeight(this._node, h); return h; }, getter: function() { return this._node.offsetHeight; } }, offsetWidth: { setter: function(w) { Y.DOM.setWidth(this._node, w); return w; }, getter: function() { return this._node.offsetWidth; } } }); Y.mix(Y.Node.prototype, { sizeTo: function(w, h) { var node; if (arguments.length < 2) { node = Y.one(w); w = node.get('offsetWidth'); h = node.get('offsetHeight'); } this.setAttrs({ offsetWidth: w, offsetHeight: h }); } }); var Y_NodeList = Y.NodeList, ArrayProto = Array.prototype, ArrayMethods = [ /** Returns a new NodeList combining the given NodeList(s) * @for NodeList * @method concat * @param {NodeList | Array} valueN Arrays/NodeLists and/or values to * concatenate to the resulting NodeList * @return {NodeList} A new NodeList comprised of this NodeList joined with the input. */ 'concat', /** Removes the first last from the NodeList and returns it. * @for NodeList * @method pop * @return {Node} The last item in the NodeList. */ 'pop', /** Adds the given Node(s) to the end of the NodeList. * @for NodeList * @method push * @param {Node | DOMNode} nodeN One or more nodes to add to the end of the NodeList. */ 'push', /** Removes the first item from the NodeList and returns it. * @for NodeList * @method shift * @return {Node} The first item in the NodeList. */ 'shift', /** Returns a new NodeList comprising the Nodes in the given range. * @for NodeList * @method slice * @param {Number} begin Zero-based index at which to begin extraction. As a negative index, start indicates an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element in the sequence. * @param {Number} end Zero-based index at which to end extraction. slice extracts up to but not including end. slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. If end is omitted, slice extracts to the end of the sequence. * @return {NodeList} A new NodeList comprised of this NodeList joined with the input. */ 'slice', /** Changes the content of the NodeList, adding new elements while removing old elements. * @for NodeList * @method splice * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end. * @param {Number} howMany An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you should specify at least one new element. If no howMany parameter is specified (second syntax above, which is a SpiderMonkey extension), all elements after index are removed. * {Node | DOMNode| element1, ..., elementN The elements to add to the array. If you don't specify any elements, splice simply removes elements from the array. * @return {NodeList} The element(s) removed. */ 'splice', /** Adds the given Node(s) to the beginning of the NodeList. * @for NodeList * @method push * @param {Node | DOMNode} nodeN One or more nodes to add to the NodeList. */ 'unshift' ]; Y.Array.each(ArrayMethods, function(name) { Y_NodeList.prototype[name] = function() { var args = [], i = 0, arg; while ((arg = arguments[i++])) { // use DOM nodes/nodeLists args.push(arg._node || arg._nodes || arg); } return Y.Node.scrubVal(ArrayProto[name].apply(this._nodes, args)); }; }); }, '@VERSION@' ,{requires:['dom-base', 'selector-css2', 'event-base']}); YUI.add('node-style', function(Y) { (function(Y) { /** * Extended Node interface for managing node styles. * @module node * @submodule node-style */ var methods = [ /** * Returns the style's current value. * @method getStyle * @for Node * @param {String} attr The style attribute to retrieve. * @return {String} The current value of the style property for the element. */ 'getStyle', /** * Returns the computed value for the given style property. * @method getComputedStyle * @param {String} attr The style attribute to retrieve. * @return {String} The computed value of the style property for the element. */ 'getComputedStyle', /** * Sets a style property of the node. * @method setStyle * @param {String} attr The style attribute to set. * @param {String|Number} val The value. * @chainable */ 'setStyle', /** * Sets multiple style properties on the node. * @method setStyles * @param {Object} hash An object literal of property:value pairs. * @chainable */ 'setStyles' ]; Y.Node.importMethod(Y.DOM, methods); /** * Returns an array of values for each node. * @method getStyle * @for NodeList * @see Node.getStyle * @param {String} attr The style attribute to retrieve. * @return {Array} The current values of the style property for the element. */ /** * Returns an array of the computed value for each node. * @method getComputedStyle * @see Node.getComputedStyle * @param {String} attr The style attribute to retrieve. * @return {Array} The computed values for each node. */ /** * Sets a style property on each node. * @method setStyle * @see Node.setStyle * @param {String} attr The style attribute to set. * @param {String|Number} val The value. * @chainable */ /** * Sets multiple style properties on each node. * @method setStyles * @see Node.setStyles * @param {Object} hash An object literal of property:value pairs. * @chainable */ Y.NodeList.importMethod(Y.Node.prototype, methods); })(Y); }, '@VERSION@' ,{requires:['dom-style', 'node-base']}); YUI.add('node-screen', function(Y) { /** * Extended Node interface for managing regions and screen positioning. * Adds support for positioning elements and normalizes window size and scroll detection. * @module node * @submodule node-screen */ // these are all "safe" returns, no wrapping required Y.each([ /** * Returns the inner width of the viewport (exludes scrollbar). * @config winWidth * @for Node * @type {Int} */ 'winWidth', /** * Returns the inner height of the viewport (exludes scrollbar). * @config winHeight * @type {Int} */ 'winHeight', /** * Document width * @config winHeight * @type {Int} */ 'docWidth', /** * Document height * @config docHeight * @type {Int} */ 'docHeight', /** * Amount page has been scroll vertically * @config docScrollX * @type {Int} */ 'docScrollX', /** * Amount page has been scroll horizontally * @config docScrollY * @type {Int} */ 'docScrollY' ], function(name) { Y.Node.ATTRS[name] = { getter: function() { var args = Array.prototype.slice.call(arguments); args.unshift(Y.Node.getDOMNode(this)); return Y.DOM[name].apply(this, args); } }; } ); Y.Node.ATTRS.scrollLeft = { getter: function() { var node = Y.Node.getDOMNode(this); return ('scrollLeft' in node) ? node.scrollLeft : Y.DOM.docScrollX(node); }, setter: function(val) { var node = Y.Node.getDOMNode(this); if (node) { if ('scrollLeft' in node) { node.scrollLeft = val; } else if (node.document || node.nodeType === 9) { Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc } } else { } } }; Y.Node.ATTRS.scrollTop = { getter: function() { var node = Y.Node.getDOMNode(this); return ('scrollTop' in node) ? node.scrollTop : Y.DOM.docScrollY(node); }, setter: function(val) { var node = Y.Node.getDOMNode(this); if (node) { if ('scrollTop' in node) { node.scrollTop = val; } else if (node.document || node.nodeType === 9) { Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc } } else { } } }; Y.Node.importMethod(Y.DOM, [ /** * Gets the current position of the node in page coordinates. * @method getXY * @for Node * @return {Array} The XY position of the node */ 'getXY', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setXY * @param {Array} xy Contains X & Y values for new position (coordinates are page-based) * @chainable */ 'setXY', /** * Gets the current position of the node in page coordinates. * @method getX * @return {Int} The X position of the node */ 'getX', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setX * @param {Int} x X value for new position (coordinates are page-based) * @chainable */ 'setX', /** * Gets the current position of the node in page coordinates. * @method getY * @return {Int} The Y position of the node */ 'getY', /** * Set the position of the node in page coordinates, regardless of how the node is positioned. * @method setY * @param {Int} y Y value for new position (coordinates are page-based) * @chainable */ 'setY', /** * Swaps the XY position of this node with another node. * @method swapXY * @param {Y.Node || HTMLElement} otherNode The node to swap with. * @chainable */ 'swapXY' ]); /** * Returns a region object for the node * @config region * @for Node * @type Node */ Y.Node.ATTRS.region = { getter: function() { var node = Y.Node.getDOMNode(this), region; if (node && !node.tagName) { if (node.nodeType === 9) { // document node = node.documentElement; } } if (node.alert) { region = Y.DOM.viewportRegion(node); } else { region = Y.DOM.region(node); } return region; } }; /** * Returns a region object for the node's viewport * @config viewportRegion * @type Node */ Y.Node.ATTRS.viewportRegion = { getter: function() { return Y.DOM.viewportRegion(Y.Node.getDOMNode(this)); } }; Y.Node.importMethod(Y.DOM, 'inViewportRegion'); // these need special treatment to extract 2nd node arg /** * Compares the intersection of the node with another node or region * @method intersect * @for Node * @param {Node|Object} node2 The node or region to compare with. * @param {Object} altRegion An alternate region to use (rather than this node's). * @return {Object} An object representing the intersection of the regions. */ Y.Node.prototype.intersect = function(node2, altRegion) { var node1 = Y.Node.getDOMNode(this); if (Y.instanceOf(node2, Y.Node)) { // might be a region object node2 = Y.Node.getDOMNode(node2); } return Y.DOM.intersect(node1, node2, altRegion); }; /** * Determines whether or not the node is within the giving region. * @method inRegion * @param {Node|Object} node2 The node or region to compare with. * @param {Boolean} all Whether or not all of the node must be in the region. * @param {Object} altRegion An alternate region to use (rather than this node's). * @return {Object} An object representing the intersection of the regions. */ Y.Node.prototype.inRegion = function(node2, all, altRegion) { var node1 = Y.Node.getDOMNode(this); if (Y.instanceOf(node2, Y.Node)) { // might be a region object node2 = Y.Node.getDOMNode(node2); } return Y.DOM.inRegion(node1, node2, all, altRegion); }; }, '@VERSION@' ,{requires:['dom-screen']}); YUI.add('node-pluginhost', function(Y) { /** * Registers plugins to be instantiated at the class level (plugins * which should be plugged into every instance of Node by default). * * @method Node.plug * @static * * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined) * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin */ Y.Node.plug = function() { var args = Y.Array(arguments); args.unshift(Y.Node); Y.Plugin.Host.plug.apply(Y.Base, args); return Y.Node; }; /** * Unregisters any class level plugins which have been registered by the Node * * @method Node.unplug * @static * * @param {Function | Array} plugin The plugin class, or an array of plugin classes */ Y.Node.unplug = function() { var args = Y.Array(arguments); args.unshift(Y.Node); Y.Plugin.Host.unplug.apply(Y.Base, args); return Y.Node; }; Y.mix(Y.Node, Y.Plugin.Host, false, null, 1); // allow batching of plug/unplug via NodeList // doesn't use NodeList.importMethod because we need real Nodes (not tmpNode) Y.NodeList.prototype.plug = function() { var args = arguments; Y.NodeList.each(this, function(node) { Y.Node.prototype.plug.apply(Y.one(node), args); }); }; Y.NodeList.prototype.unplug = function() { var args = arguments; Y.NodeList.each(this, function(node) { Y.Node.prototype.unplug.apply(Y.one(node), args); }); }; }, '@VERSION@' ,{requires:['node-base', 'pluginhost']}); YUI.add('node-event-delegate', function(Y) { /** * Functionality to make the node a delegated event container * @module node * @submodule node-event-delegate */ /** * <p>Sets up a delegation listener for an event occurring inside the Node. * The delegated event will be verified against a supplied selector or * filtering function to test if the event references at least one node that * should trigger the subscription callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param spec {String|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context {Object} optional argument that specifies what 'this' refers to. * @param args* {any} 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for Node */ Y.Node.prototype.delegate = function(type) { var args = Y.Array(arguments, 0, true), index = (Y.Lang.isObject(type) && !Y.Lang.isArray(type)) ? 1 : 2; args.splice(index, 0, this._node); return Y.delegate.apply(Y, args); }; }, '@VERSION@' ,{requires:['node-base', 'event-delegate']}); YUI.add('node', function(Y){}, '@VERSION@' ,{skinnable:false, requires:['dom', 'event-base', 'event-delegate', 'pluginhost'], use:['node-base', 'node-style', 'node-screen', 'node-pluginhost', 'node-event-delegate']}); YUI.add('event-delegate', function(Y) { /** * Adds event delegation support to the library. * * @module event * @submodule event-delegate */ var toArray = Y.Array, YLang = Y.Lang, isString = YLang.isString, isObject = YLang.isObject, isArray = YLang.isArray, selectorTest = Y.Selector.test, detachCategories = Y.Env.evt.handles; /** * <p>Sets up event delegation on a container element. The delegated event * will use a supplied selector or filtering function to test if the event * references at least one node that should trigger the subscription * callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {String|node} the element that is the delegation container * @param spec {string|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ function delegate(type, fn, el, filter) { var args = toArray(arguments, 0, true), query = isString(el) ? el : null, typeBits, synth, container, categories, cat, i, len, handles, handle; // Support Y.delegate({ click: fnA, key: fnB }, context, filter, ...); // and Y.delegate(['click', 'key'], fn, context, filter, ...); if (isObject(type)) { handles = []; if (isArray(type)) { for (i = 0, len = type.length; i < len; ++i) { args[0] = type[i]; handles.push(Y.delegate.apply(Y, args)); } } else { // Y.delegate({'click', fn}, context, filter) => // Y.delegate('click', fn, context, filter) args.unshift(null); // one arg becomes two; need to make space for (i in type) { if (type.hasOwnProperty(i)) { args[0] = i; args[1] = type[i]; handles.push(Y.delegate.apply(Y, args)); } } } return new Y.EventHandle(handles); } typeBits = type.split(/\|/); if (typeBits.length > 1) { cat = typeBits.shift(); type = typeBits.shift(); } synth = Y.Node.DOM_EVENTS[type]; if (isObject(synth) && synth.delegate) { handle = synth.delegate.apply(synth, arguments); } if (!handle) { if (!type || !fn || !el || !filter) { return; } container = (query) ? Y.Selector.query(query, null, true) : el; if (!container && isString(el)) { handle = Y.on('available', function () { Y.mix(handle, Y.delegate.apply(Y, args), true); }, el); } if (!handle && container) { args.splice(2, 2, container); // remove the filter handle = Y.Event._attach(args, { facade: false }); handle.sub.filter = filter; handle.sub._notify = delegate.notifySub; } } if (handle && cat) { categories = detachCategories[cat] || (detachCategories[cat] = {}); categories = categories[type] || (categories[type] = []); categories.push(handle); } return handle; } /** * Overrides the <code>_notify</code> method on the normal DOM subscription to * inject the filtering logic and only proceed in the case of a match. * * @method delegate.notifySub * @param thisObj {Object} default 'this' object for the callback * @param args {Array} arguments passed to the event's <code>fire()</code> * @param ce {CustomEvent} the custom event managing the DOM subscriptions for * the subscribed event on the subscribing node. * @return {Boolean} false if the event was stopped * @private * @static * @since 3.2.0 */ delegate.notifySub = function (thisObj, args, ce) { // Preserve args for other subscribers args = args.slice(); if (this.args) { args.push.apply(args, this.args); } // Only notify subs if the event occurred on a targeted element var currentTarget = delegate._applyFilter(this.filter, args, ce), //container = e.currentTarget, e, i, len, ret; if (currentTarget) { // Support multiple matches up the the container subtree currentTarget = toArray(currentTarget); // The second arg is the currentTarget, but we'll be reusing this // facade, replacing the currentTarget for each use, so it doesn't // matter what element we seed it with. e = args[0] = new Y.DOMEventFacade(args[0], ce.el, ce); e.container = Y.one(ce.el); for (i = 0, len = currentTarget.length; i < len && !e.stopped; ++i) { e.currentTarget = Y.one(currentTarget[i]); ret = this.fn.apply(this.context || e.currentTarget, args); if (ret === false) { // stop further notifications break; } } return ret; } }; /** * <p>Compiles a selector string into a filter function to identify whether * Nodes along the parent axis of an event's target should trigger event * notification.</p> * * <p>This function is memoized, so previously compiled filter functions are * returned if the same selector string is provided.</p> * * <p>This function may be useful when defining synthetic events for delegate * handling.</p> * * @method delegate.compileFilter * @param selector {String} the selector string to base the filtration on * @return {Function} * @since 3.2.0 * @static */ delegate.compileFilter = Y.cached(function (selector) { return function (target, e) { return selectorTest(target._node, selector, e.currentTarget._node); }; }); /** * Walks up the parent axis of an event's target, and tests each element * against a supplied filter function. If any Nodes, including the container, * satisfy the filter, the delegated callback will be triggered for each. * * @method delegate._applyFilter * @param filter {Function} boolean function to test for inclusion in event * notification * @param args {Array} the arguments that would be passed to subscribers * @param ce {CustomEvent} the DOM event wrapper * @return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter * @protected */ delegate._applyFilter = function (filter, args, ce) { var e = args[0], container = ce.el, // facadeless events in IE, have no e.currentTarget target = e.target || e.srcElement, match = [], isContainer = false; // Resolve text nodes to their containing element if (target.nodeType === 3) { target = target.parentNode; } // passing target as the first arg rather than leaving well enough alone // making 'this' in the filter function refer to the target. This is to // support bound filter functions. args.unshift(target); if (isString(filter)) { while (target) { isContainer = (target === container); if (selectorTest(target, filter, (isContainer ?null: container))) { match.push(target); } if (isContainer) { break; } target = target.parentNode; } } else { // filter functions are implementer code and should receive wrappers args[0] = Y.one(target); args[1] = new Y.DOMEventFacade(e, container, ce); while (target) { // filter(target, e, extra args...) - this === target if (filter.apply(args[0], args)) { match.push(target); } if (target === container) { break; } target = target.parentNode; args[0] = Y.one(target); } args[1] = e; // restore the raw DOM event } if (match.length <= 1) { match = match[0]; // single match or undefined } // remove the target args.shift(); return match; }; /** * Sets up event delegation on a container element. The delegated event * will use a supplied filter to test if the callback should be executed. * This filter can be either a selector string or a function that returns * a Node to use as the currentTarget for the event. * * The event object for the delegated event is supplied to the callback * function. It is modified slightly in order to support all properties * that may be needed for event delegation. 'currentTarget' is set to * the element that matched the selector string filter or the Node returned * from the filter function. 'container' is set to the element that the * listener is delegated from (this normally would be the 'currentTarget'). * * Filter functions will be called with the arguments that would be passed to * the callback function, including the event object as the first parameter. * The function should return false (or a falsey value) if the success criteria * aren't met, and the Node to use as the event's currentTarget and 'this' * object if they are. * * @method delegate * @param type {string} the event type to delegate * @param fn {function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param el {string|node} the element that is the delegation container * @param filter {string|function} a selector that must match the target of the * event or a function that returns a Node or false. * @param context optional argument that specifies what 'this' refers to. * @param args* 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for YUI */ Y.delegate = Y.Event.delegate = delegate; }, '@VERSION@' ,{requires:['node-base']}); YUI.add('io-base', function(Y) { /** * Base IO functionality. Provides basic XHR transport support. * @module io * @submodule io-base */ /** * The io class is a utility that brokers HTTP requests through a simplified * interface. Specifically, it allows JavaScript to make HTTP requests to * a resource without a page reload. The underlying transport for making * same-domain requests is the XMLHttpRequest object. YUI.io can also use * Flash, if specified as a transport, for cross-domain requests. * * @class io */ /** * @event io:start * @description This event is fired by YUI.io when a transaction is initiated. * @type Event Custom */ var E_START = 'io:start', /** * @event io:complete * @description This event is fired by YUI.io when a transaction is complete. * Response status and data are accessible, if available. * @type Event Custom */ E_COMPLETE = 'io:complete', /** * @event io:success * @description This event is fired by YUI.io when a transaction is complete, and * the HTTP status resolves to HTTP2xx. * @type Event Custom */ E_SUCCESS = 'io:success', /** * @event io:failure * @description This event is fired by YUI.io when a transaction is complete, and * the HTTP status resolves to HTTP4xx, 5xx and above. * @type Event Custom */ E_FAILURE = 'io:failure', /** * @event io:end * @description This event signifies the end of the transaction lifecycle. The * transaction transport is destroyed. * @type Event Custom */ E_END = 'io:end', //-------------------------------------- // Properties //-------------------------------------- /** * @description A transaction counter that increments for each transaction. * * @property transactionId * @private * @static * @type int */ transactionId = 0, /** * @description Object of default HTTP headers to be initialized and sent * for all transactions. * * @property _headers * @private * @static * @type object */ _headers = { 'X-Requested-With' : 'XMLHttpRequest' }, /** * @description Object that stores timeout values for any transaction with * a defined "timeout" configuration property. * * @property _timeout * @private * @static * @type object */ _timeout = {}, // Window reference w = Y.config.win; //-------------------------------------- // Methods //-------------------------------------- /** * @description Method that creates the XMLHttpRequest transport * * @method _xhr * @private * @static * @return object */ function _xhr() { return w.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); } /** * @description Method that increments _transactionId for each transaction. * * @method _id * @private * @static * @return int */ function _id() { var id = transactionId; transactionId++; return id; } /** * @description Method that creates a unique transaction object for each * request. * * @method _create * @private * @static * @param {number} c - configuration object subset to determine if * the transaction is an XDR or file upload, * requiring an alternate transport. * @param {number} i - transaction id * @return object */ function _create(c, i) { var o = {}; o.id = Y.Lang.isNumber(i) ? i : _id(); c = c || {}; if (!c.use && !c.upload) { o.c = _xhr(); } else if (c.use) { if (c.use === 'native') { if (w.XDomainRequest) { o.c = new XDomainRequest(); o.t = c.use; } else { o.c = _xhr(); } } else { o.c = Y.io._transport[c.use]; o.t = c.use; } } else { o.c = {}; } return o; } function _destroy(o) { if (w) { if (o.c && w.XMLHttpRequest) { o.c.onreadystatechange = null; } else if (Y.UA.ie === 6 && !o.t) { // IE, when using XMLHttpRequest as an ActiveX Object, will throw // a "Type Mismatch" error if the event handler is set to "null". o.c.abort(); } } o.c = null; o = null; } /** * @description Method for creating and subscribing transaction events. * * @method _tE * @private * @static * @param {string} e - event to be published * @param {object} c - configuration data subset for event subscription. * * @return void */ function _tE(e, c) { var eT = new Y.EventTarget().publish('transaction:' + e), a = c.arguments, cT = c.context || Y; if (a) { eT.on(c.on[e], cT, a); } else { eT.on(c.on[e], cT); } return eT; } /** * @description Fires event "io:start" and creates, fires a * transaction-specific start event, if config.on.start is * defined. * * @method _ioStart * @private * @static * @param {number} id - transaction id * @param {object} c - configuration object for the transaction. * * @return void */ function _ioStart(id, c) { var a = c.arguments; if (a) { Y.fire(E_START, id, a); } else { Y.fire(E_START, id); } if (c.on && c.on.start) { _tE('start', c).fire(id); } } /** * @description Fires event "io:complete" and creates, fires a * transaction-specific "complete" event, if config.on.complete is * defined. * * @method _ioComplete * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioComplete(o, c) { var r = o.e ? { status: 0, statusText: o.e } : o.c, a = c.arguments; if (a) { Y.fire(E_COMPLETE, o.id, r, a); } else { Y.fire(E_COMPLETE, o.id, r); } if (c.on && c.on.complete) { _tE('complete', c).fire(o.id, r); } } /** * @description Fires event "io:end" and creates, fires a * transaction-specific "end" event, if config.on.end is * defined. * * @method _ioEnd * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioEnd(o, c) { var a = c.arguments; if (a) { Y.fire(E_END, o.id, a); } else { Y.fire(E_END, o.id); } if (c.on && c.on.end) { _tE('end', c).fire(o.id); } _destroy(o); } /** * @description Fires event "io:success" and creates, fires a * transaction-specific "success" event, if config.on.success is * defined. * * @method _ioSuccess * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioSuccess(o, c) { var a = c.arguments; if (a) { Y.fire(E_SUCCESS, o.id, o.c, a); } else { Y.fire(E_SUCCESS, o.id, o.c); } if (c.on && c.on.success) { _tE('success', c).fire(o.id, o.c); } _ioEnd(o, c); } /** * @description Fires event "io:failure" and creates, fires a * transaction-specific "failure" event, if config.on.failure is * defined. * * @method _ioFailure * @private * @static * @param {object} o - transaction object. * @param {object} c - configuration object for the transaction. * * @return void */ function _ioFailure(o, c) { var r = o.e ? { status: 0, statusText: o.e } : o.c, a = c.arguments; if (a) { Y.fire(E_FAILURE, o.id, r, a); } else { Y.fire(E_FAILURE, o.id, r); } if (c.on && c.on.failure) { _tE('failure', c).fire(o.id, r); } _ioEnd(o, c); } /** * @description Resends an XDR transaction, using the Flash tranport, * if the native transport fails. * * @method _resend * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {string} uri - qualified path to transaction resource. * @param {object} c - configuration object for the transaction. * * @return void */ function _resend(o, uri, c, d) { _destroy(o); c.xdr.use = 'flash'; // If the original request included serialized form data and // additional data are defined in configuration.data, it must // be reset to prevent data duplication. c.data = c.form && d ? d : null; return Y.io(uri, c, o.id); } /** * @description Method that concatenates string data for HTTP GET transactions. * * @method _concat * @private * @static * @param {string} s - URI or root data. * @param {string} d - data to be concatenated onto URI. * @return int */ function _concat(s, d) { s += ((s.indexOf('?') == -1) ? '?' : '&') + d; return s; } /** * @description Method that stores default client headers for all transactions. * If a label is passed with no value argument, the header will be deleted. * * @method _setHeader * @private * @static * @param {string} l - HTTP header * @param {string} v - HTTP header value * @return int */ function _setHeader(l, v) { if (v) { _headers[l] = v; } else { delete _headers[l]; } } /** * @description Method that sets all HTTP headers to be sent in a transaction. * * @method _setHeaders * @private * @static * @param {object} o - XHR instance for the specific transaction. * @param {object} h - HTTP headers for the specific transaction, as defined * in the configuration object passed to YUI.io(). * @return void */ function _setHeaders(o, h) { var p; h = h || {}; for (p in _headers) { if (_headers.hasOwnProperty(p)) { /* if (h[p]) { // Configuration headers will supersede preset io headers, // if headers match. continue; } else { h[p] = _headers[p]; } */ if (!h[p]) { h[p] = _headers[p]; } } } for (p in h) { if (h.hasOwnProperty(p)) { if (h[p] !== 'disable') { o.setRequestHeader(p, h[p]); } } } } /** * @description Terminates a transaction due to an explicit abort or * timeout. * * @method _ioCancel * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {string} s - Identifies timed out or aborted transaction. * * @return void */ function _ioCancel(o, s) { if (o && o.c) { o.e = s; o.c.abort(); } } /** * @description Starts timeout count if the configuration object * has a defined timeout property. * * @method _startTimeout * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {object} t - Timeout in milliseconds. * @return void */ function _startTimeout(o, t) { _timeout[o.id] = w.setTimeout(function() { _ioCancel(o, 'timeout'); }, t); } /** * @description Clears the timeout interval started by _startTimeout(). * * @method _clearTimeout * @private * @static * @param {number} id - Transaction id. * @return void */ function _clearTimeout(id) { w.clearTimeout(_timeout[id]); delete _timeout[id]; } /** * @description Method that determines if a transaction response qualifies * as success or failure, based on the response HTTP status code, and * fires the appropriate success or failure events. * * @method _handleResponse * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {object} c - Configuration object passed to io(). * @return void */ function _handleResponse(o, c) { var status; try { status = (o.c.status && o.c.status !== 0) ? o.c.status : 0; } catch(e) { status = 0; } // IE reports HTTP 204 as HTTP 1223. if (status >= 200 && status < 300 || status === 1223) { _ioSuccess(o, c); } else { _ioFailure(o, c); } } /** * @description Event handler bound to onreadystatechange. * * @method _readyState * @private * @static * @param {object} o - Transaction object generated by _create(). * @param {object} c - Configuration object passed to YUI.io(). * @return void */ function _readyState(o, c) { if (o.c.readyState === 4) { if (c.timeout) { _clearTimeout(o.id); } w.setTimeout( function() { _ioComplete(o, c); _handleResponse(o, c); }, 0); } } /** * @description Method for requesting a transaction. _io() is implemented as * yui.io(). Each transaction may include a configuration object. Its * properties are: * * method: HTTP method verb (e.g., GET or POST). If this property is not * not defined, the default value will be GET. * * data: This is the name-value string that will be sent as the transaction * data. If the request is HTTP GET, the data become part of * querystring. If HTTP POST, the data are sent in the message body. * * xdr: Defines the transport to be used for cross-domain requests. By * setting this property, the transaction will use the specified * transport instead of XMLHttpRequest. * The properties are: * { * use: Specify the transport to be used: 'flash' and 'native' * dataType: Set the value to 'XML' if that is the expected * response content type. * } * * * form: This is a defined object used to process HTML form as data. The * properties are: * { * id: Node object or id of HTML form. * useDisabled: Boolean value to allow disabled HTML form field * values to be sent as part of the data. * } * * on: This is a defined object used to create and handle specific * events during a transaction lifecycle. These events will fire in * addition to the global io events. The events are: * start - This event is fired when a request is sent to a resource. * complete - This event fires when the transaction is complete. * success - This event fires when the response status resolves to * HTTP 2xx. * failure - This event fires when the response status resolves to * HTTP 4xx, 5xx; and, for all transaction exceptions, * including aborted transactions and transaction timeouts. * end - This even is fired at the conclusion of the transaction * lifecycle, after a success or failure resolution. * * The properties are: * { * start: function(id, arguments){}, * complete: function(id, responseobject, arguments){}, * success: function(id, responseobject, arguments){}, * failure: function(id, responseobject, arguments){}, * end: function(id, arguments){} * } * Each property can reference a function or be written as an * inline function. * * sync: To enable synchronous transactions, set the configuration property * "sync" to true; the default behavior is false. Synchronous * transactions are limited to same-domain requests only. * * context: Object reference for all defined transaction event handlers * when it is implemented as a method of a base object. Defining * "context" will set the reference of "this," used in the * event handlers, to the context value. In the case where * different event handlers all have different contexts, * use Y.bind() to set the execution context, bypassing this * configuration. * * headers: This is a defined object of client headers, as many as. * desired for the transaction. The object pattern is: * { 'header': 'value' }. * * timeout: This value, defined as milliseconds, is a time threshold for the * transaction. When this threshold is reached, and the transaction's * Complete event has not yet fired, the transaction will be aborted. * * arguments: Object, array, string, or number passed to all registered * event handlers. This value is available as the second * argument in the "start" and "abort" event handlers; and, it is * the third argument in the "complete", "success", and "failure" * event handlers. * * @method _io * @private * @static * @param {string} uri - qualified path to transaction resource. * @param {object} c - configuration object for the transaction. * @param {number} i - transaction id, if already set. * @return object */ function _io(uri, c, i) { var f, o, d, m, r, s, oD, a, j, u = uri; c = Y.Object(c); o = _create(c.xdr || c.form, i); m = c.method ? c.method = c.method.toUpperCase() : c.method = 'GET'; s = c.sync; oD = c.data; //To serialize an object into a key-value string, add the //QueryString module to the YUI instance's 'use' method. if (Y.Lang.isObject(c.data) && Y.QueryString) { c.data = Y.QueryString.stringify(c.data); } if (c.form) { if (c.form.upload) { // This is a file upload transaction, calling // upload() in io-upload-iframe. return Y.io.upload(o, uri, c); } else { // Serialize HTML form data. f = Y.io._serialize(c.form, c.data); if (m === 'POST' || m === 'PUT') { c.data = f; } else if (m === 'GET') { uri = _concat(uri, f); } } } if (c.data && m === 'GET') { uri = _concat(uri, c.data); } if (c.data && m === 'POST') { c.headers = Y.merge({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, c.headers); } if (o.t) { return Y.io.xdr(uri, o, c); } if (!s) { o.c.onreadystatechange = function() { _readyState(o, c); }; } try { o.c.open(m, uri, s ? false : true); // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft. if (c.xdr && c.xdr.credentials) { o.c.withCredentials = true; } } catch(e1) { if (c.xdr) { // This exception is usually thrown by browsers // that do not support native XDR transactions. return _resend(o, u, c, oD); } } _setHeaders(o.c, c.headers); _ioStart(o.id, c); try { // Using "null" with HTTP POST will result in a request // with no Content-Length header defined. o.c.send(c.data || ''); if (s) { d = o.c; a = ['status', 'statusText', 'responseText', 'responseXML']; r = c.arguments ? { id: o.id, arguments: c.arguments } : { id: o.id }; for (j = 0; j < 4; j++) { r[a[j]] = o.c[a[j]]; } r.getAllResponseHeaders = function() { return d.getAllResponseHeaders(); }; r.getResponseHeader = function(h) { return d.getResponseHeader(h); }; _ioComplete(o, c); _handleResponse(o, c); return r; } } catch(e2) { if (c.xdr) { // This exception is usually thrown by browsers // that do not support native XDR transactions. return _resend(o, u, c, oD); } } // If config.timeout is defined, and the request is standard XHR, // initialize timeout polling. if (c.timeout) { _startTimeout(o, c.timeout); } return { id: o.id, abort: function() { return o.c ? _ioCancel(o, 'abort') : false; }, isInProgress: function() { return o.c ? o.c.readyState !== 4 && o.c.readyState !== 0 : false; } }; } _io.start = _ioStart; _io.complete = _ioComplete; _io.success = _ioSuccess; _io.failure = _ioFailure; _io.end = _ioEnd; _io._id = _id; _io._timeout = _timeout; //-------------------------------------- // Begin public interface definition //-------------------------------------- /** * @description Method that stores default client headers for all transactions. * If a label is passed with no value argument, the header will be deleted. * This is the interface for _setHeader(). * * @method header * @public * @static * @param {string} l - HTTP header * @param {string} v - HTTP header value * @return int */ _io.header = _setHeader; /** * @description Method for requesting a transaction. This * is the interface for _io(). * * @method io * @public * @static * @param {string} uri - qualified path to transaction resource. * @param {object} c - configuration object for the transaction. * @return object */ Y.io = _io; Y.io.http = _io; }, '@VERSION@' ,{requires:['event-custom-base', 'querystring-stringify-simple']}); YUI.add('querystring-stringify-simple', function(Y) { /*global Y */ /** * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings. * This is a subset implementation of the full querystring-stringify.</p> * <p>This module provides the bare minimum functionality (encoding a hash of simple values), * without the additional support for nested data structures. Every key-value pair is * encoded by encodeURIComponent.</p> * <p>This module provides a minimalistic way for io to handle single-level objects * as transaction data.</p> * * @module querystring * @submodule querystring-stringify-simple * @for QueryString * @static */ var QueryString = Y.namespace("QueryString"), EUC = encodeURIComponent; /** * <p>Converts a simple object to a Query String representation.</p> * <p>Nested objects, Arrays, and so on, are not supported.</p> * * @method stringify * @for QueryString * @public * @submodule querystring-stringify-simple * @param obj {Object} A single-level object to convert to a querystring. * @param cfg {Object} (optional) Configuration object. In the simple * module, only the arrayKey setting is * supported. When set to true, the key of an * array will have the '[]' notation appended * to the key;. * @static */ QueryString.stringify = function (obj, c) { var qs = [], // Default behavior is false; standard key notation. s = c && c.arrayKey ? true : false, key, i, l; for (key in obj) { if (obj.hasOwnProperty(key)) { if (Y.Lang.isArray(obj[key])) { for (i = 0, l = obj[key].length; i < l; i++) { qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i])); } } else { qs.push(EUC(key) + '=' + EUC(obj[key])); } } } return qs.join('&'); }; }, '@VERSION@' ); YUI.add('json-parse', function(Y) { /** * <p>The JSON module adds support for serializing JavaScript objects into * JSON strings and parsing JavaScript objects from strings in JSON format.</p> * * <p>The JSON namespace is added to your YUI instance including static methods * Y.JSON.parse(..) and Y.JSON.stringify(..).</p> * * <p>The functionality and method signatures follow the ECMAScript 5 * specification. In browsers with native JSON support, the native * implementation is used.</p> * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p> * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to * include either of the submodules individually if you don't need the * complementary functionality, or include the rollup for both.</p> * * @module json * @class JSON * @static */ /** * Provides Y.JSON.parse method to accept JSON strings and return native * JavaScript objects. * * @module json * @submodule json-parse * @for JSON * @static */ // All internals kept private for security reasons function fromGlobal(ref) { return (Y.config.win || this || {})[ref]; } /** * Alias to native browser implementation of the JSON object if available. * * @property Native * @type {Object} * @private */ var _JSON = fromGlobal('JSON'), // Create an indirect reference to eval to allow for minification _eval = fromGlobal('eval'), Native = (Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON), useNative = !!Native, /** * Replace certain Unicode characters that JavaScript may handle incorrectly * during eval--either by deleting them or treating them as line * endings--with escape sequences. * IMPORTANT NOTE: This regex will be used to modify the input if a match is * found. * * @property _UNICODE_EXCEPTIONS * @type {RegExp} * @private */ _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, /** * First step in the safety evaluation. Regex used to replace all escape * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character). * * @property _ESCAPES * @type {RegExp} * @private */ _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, /** * Second step in the safety evaluation. Regex used to replace all simple * values with ']' characters. * * @property _VALUES * @type {RegExp} * @private */ _VALUES = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, /** * Third step in the safety evaluation. Regex used to remove all open * square brackets following a colon, comma, or at the beginning of the * string. * * @property _BRACKETS * @type {RegExp} * @private */ _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g, /** * Final step in the safety evaluation. Regex used to test the string left * after all previous replacements for invalid characters. * * @property _UNSAFE * @type {RegExp} * @private */ _UNSAFE = /[^\],:{}\s]/, /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval. * * @method escapeException * @param c {String} Unicode character * @return {String} the \unnnn escapement of the character * @private */ _escapeException = function (c) { return '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4); }, /** * Traverses nested objects, applying a reviver function to each (key,value) * from the scope if the key:value's containing object. The value returned * from the function will replace the original value in the key:value pair. * If the value returned is undefined, the key will be omitted from the * returned object. * * @method _revive * @param data {MIXED} Any JavaScript data * @param reviver {Function} filter or mutation function * @return {MIXED} The results of the filtered data * @private */ _revive = function (data, reviver) { var walk = function (o,key) { var k,v,value = o[key]; if (value && typeof value === 'object') { for (k in value) { if (value.hasOwnProperty(k)) { v = walk(value, k); if (v === undefined) { delete value[k]; } else { value[k] = v; } } } } return reviver.call(o,key,value); }; return typeof reviver === 'function' ? walk({'':data},'') : data; }, /** * Parse a JSON string, returning the native JavaScript representation. * * @param s {string} JSON string data * @param reviver {function} (optional) function(k,v) passed each key value * pair of object literals, allowing pruning or altering values * @return {MIXED} the native JavaScript representation of the JSON string * @throws SyntaxError * @method parse * @static */ // JavaScript implementation in lieu of native browser support. Based on // the json2.js library from http://json.org _parse = function (s,reviver) { // Replace certain Unicode characters that are otherwise handled // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, _escapeException); // Test for any remaining invalid characters if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']'). replace(_BRACKETS,''))) { // Eval the text into a JavaScript data structure, apply any // reviver function, and return return _revive( _eval('(' + s + ')'), reviver ); } throw new SyntaxError('JSON.parse'); }; Y.namespace('JSON').parse = function (s,reviver) { if (typeof s !== 'string') { s += ''; } return Native && Y.JSON.useNativeParse ? Native.parse(s,reviver) : _parse(s,reviver); }; function workingNative( k, v ) { return k === "ok" ? true : v; } // Double check basic functionality. This is mainly to catch early broken // implementations of the JSON API in Firefox 3.1 beta1 and beta2 if ( Native ) { try { useNative = ( Native.parse( '{"ok":false}', workingNative ) ).ok; } catch ( e ) { useNative = false; } } /** * Leverage native JSON parse if the browser has a native implementation. * In general, this is a good idea. See the Known Issues section in the * JSON user guide for caveats. The default value is true for browsers with * native JSON support. * * @property useNativeParse * @type Boolean * @default true * @static */ Y.JSON.useNativeParse = useNative; }, '@VERSION@' ); YUI.add('transition-native', function(Y) { /** * Provides the transition method for Node. * Transition has no API of its own, but adds the transition method to Node. * * @module transition * @requires node-style */ var TRANSITION = '-webkit-transition', TRANSITION_CAMEL = 'WebkitTransition', TRANSITION_PROPERTY_CAMEL = 'WebkitTransitionProperty', TRANSITION_PROPERTY = '-webkit-transition-property', TRANSITION_DURATION = '-webkit-transition-duration', TRANSITION_TIMING_FUNCTION = '-webkit-transition-timing-function', TRANSITION_DELAY = '-webkit-transition-delay', TRANSITION_END = 'webkitTransitionEnd', ON_TRANSITION_END = 'onwebkittransitionend', TRANSFORM_CAMEL = 'WebkitTransform', EMPTY_OBJ = {}, /** * A class for constructing transition instances. * Adds the "transition" method to Node. * @class Transition * @constructor */ Transition = function() { this.init.apply(this, arguments); }; Transition.fx = {}; Transition.toggles = {}; Transition._hasEnd = {}; Transition._toCamel = function(property) { property = property.replace(/-([a-z])/gi, function(m0, m1) { return m1.toUpperCase(); }); return property; }; Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ''; if (m1) { str += '-' + m1.toLowerCase(); } str += m2; if (m3) { str += '-' + m3.toLowerCase(); } return str; }); return property; }; Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; Transition.useNative = false; if (TRANSITION in Y.config.doc.documentElement.style) { Transition.useNative = true; Transition.supported = true; // TODO: remove } Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; Transition.DEFAULT_EASING = 'ease'; Transition.DEFAULT_DURATION = 0.5; Transition.DEFAULT_DELAY = 0; Transition._nodeAttrs = {}; Transition.prototype = { constructor: Transition, init: function(node, config) { var anim = this; anim._node = node; if (!anim._running && config) { anim._config = config; node._transition = anim; // cache for reuse anim._duration = ('duration' in config) ? config.duration: anim.constructor.DEFAULT_DURATION; anim._delay = ('delay' in config) ? config.delay: anim.constructor.DEFAULT_DELAY; anim._easing = config.easing || anim.constructor.DEFAULT_EASING; anim._count = 0; // track number of animated properties anim._running = false; } return anim; }, addProperty: function(prop, config) { var anim = this, node = this._node, uid = Y.stamp(node), nodeInstance = Y.one(node), attrs = Transition._nodeAttrs[uid], computed, compareVal, dur, attr, val; if (!attrs) { attrs = Transition._nodeAttrs[uid] = {}; } attr = attrs[prop]; // might just be a value if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) { val = config; config = EMPTY_OBJ; } if (typeof val === 'function') { val = val.call(nodeInstance, nodeInstance); } if (attr && attr.transition) { // take control if another transition owns this property if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition } } anim._count++; // properties per transition // make 0 async and fire events dur = ((typeof config.duration != 'undefined') ? config.duration : anim._duration) || 0.0001; attrs[prop] = { value: val, duration: dur, delay: (typeof config.delay != 'undefined') ? config.delay : anim._delay, easing: config.easing || anim._easing, transition: anim }; // native end event doesnt fire when setting to same value // supplementing with timer // val may be a string or number (height: 0, etc), but computedStyle is always string computed = Y.DOM.getComputedStyle(node, prop); compareVal = (typeof val === 'string') ? computed : parseFloat(computed); if (Transition.useNative && compareVal === val) { setTimeout(function() { anim._onNativeEnd.call(node, { propertyName: prop, elapsedTime: dur }); }, dur * 1000); } }, removeProperty: function(prop) { var anim = this, attrs = Transition._nodeAttrs[Y.stamp(anim._node)]; if (attrs && attrs[prop]) { delete attrs[prop]; anim._count--; } }, initAttrs: function(config) { var attr, node = this._node; if (config.transform && !config[TRANSFORM_CAMEL]) { config[TRANSFORM_CAMEL] = config.transform; delete config.transform; // TODO: copy } for (attr in config) { if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') { Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr)); } } } }, /** * Starts or an animation. * @method run * @chainable * @private */ run: function(callback) { var anim = this, node = anim._node, config = anim._config, data = { type: 'transition:start', config: config }; if (!anim._running) { anim._running = true; //anim._node.fire('transition:start', data); if (config.on && config.on.start) { config.on.start.call(Y.one(node), data); } anim.initAttrs(anim._config); anim._callback = callback; anim._start(); } return anim; }, _start: function() { this._runNative(); }, _prepDur: function(dur) { dur = parseFloat(dur); return dur + 's'; }, _runNative: function(time) { var anim = this, node = anim._node, uid = Y.stamp(node), style = node.style, computed = getComputedStyle(node), attrs = Transition._nodeAttrs[uid], cssText = '', cssTransition = computed[TRANSITION_PROPERTY], transitionText = TRANSITION_PROPERTY + ': ', duration = TRANSITION_DURATION + ': ', easing = TRANSITION_TIMING_FUNCTION + ': ', delay = TRANSITION_DELAY + ': ', hyphy, attr, name; // preserve existing transitions if (cssTransition !== 'all') { transitionText += cssTransition + ','; duration += computed[TRANSITION_DURATION] + ','; easing += computed[TRANSITION_TIMING_FUNCTION] + ','; delay += computed[TRANSITION_DELAY] + ','; } // run transitions mapped to this instance for (name in attrs) { hyphy = Transition._toHyphen(name); attr = attrs[name]; if (attrs.hasOwnProperty(name) && attr.transition === anim) { if (name in node.style) { // only native styles allowed duration += anim._prepDur(attr.duration) + ','; delay += anim._prepDur(attr.delay) + ','; easing += (attr.easing) + ','; transitionText += hyphy + ','; cssText += hyphy + ': ' + attr.value + '; '; } else { this.removeProperty(name); } } } transitionText = transitionText.replace(/,$/, ';'); duration = duration.replace(/,$/, ';'); easing = easing.replace(/,$/, ';'); delay = delay.replace(/,$/, ';'); // only one native end event per node if (!Transition._hasEnd[uid]) { //anim._detach = Y.on(TRANSITION_END, anim._onNativeEnd, node); //node[ON_TRANSITION_END] = anim._onNativeEnd; node.addEventListener(TRANSITION_END, anim._onNativeEnd, false); Transition._hasEnd[uid] = true; } //setTimeout(function() { // allow updates to apply (size fix, onstart, etc) style.cssText += transitionText + duration + easing + delay + cssText; //}, 1); }, _end: function(elapsed) { var anim = this, node = anim._node, callback = anim._callback, config = anim._config, data = { type: 'transition:end', config: config, elapsedTime: elapsed }, nodeInstance = Y.one(node); anim._running = false; anim._callback = null; if (node) { if (config.on && config.on.end) { setTimeout(function() { // IE: allow previous update to finish config.on.end.call(nodeInstance, data); // nested to ensure proper fire order if (callback) { callback.call(nodeInstance, data); } }, 1); } else if (callback) { setTimeout(function() { // IE: allow previous update to finish callback.call(nodeInstance, data); }, 1); } //node.fire('transition:end', data); } }, _endNative: function(name) { var node = this._node, value = node.ownerDocument.defaultView.getComputedStyle(node, '')[TRANSITION_PROPERTY]; if (typeof value === 'string') { value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ','); value = value.replace(/^,|,$/, ''); node.style[TRANSITION_CAMEL] = value; } }, _onNativeEnd: function(e) { var node = this, uid = Y.stamp(node), event = e,//e._event, name = Transition._toCamel(event.propertyName), elapsed = event.elapsedTime, attrs = Transition._nodeAttrs[uid], attr = attrs[name], anim = (attr) ? attr.transition : null, data, config; if (anim) { anim.removeProperty(name); anim._endNative(name); config = anim._config[name]; data = { type: 'propertyEnd', propertyName: name, elapsedTime: elapsed, config: config }; if (config && config.on && config.on.end) { config.on.end.call(Y.one(node), data); } //node.fire('transition:propertyEnd', data); if (anim._count <= 0) { // after propertyEnd fires anim._end(elapsed); } } }, destroy: function() { var anim = this; /* if (anim._detach) { anim._detach.detach(); } */ //anim._node[ON_TRANSITION_END] = null; node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false); anim._node = null; } }; Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove /** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({ * duration: 1, // in seconds, default is 0.5 * easing: 'ease-out', // default is 'ease' * delay: '1', // delay start for 1 second, default is 0 * * height: '10px', * width: '10px', * * opacity: { // per property * value: 0, * duration: 2, * delay: 2, * easing: 'ease-in' * } * }); * </pre> * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing. * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) { var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop; if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config; config = null; } fxConfig = Transition.fx[name]; if (config && typeof config !== 'boolean') { config = Y.clone(config); for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) { config[prop] = fxConfig[prop]; } } } } else { config = fxConfig; } } else { // name is a config, config is a callback or undefined callback = config; config = name; } if (anim && !anim._running) { anim.init(this, config); } else { anim = new Transition(this._node, config); } anim.run(callback); return this; }; Y.Node.prototype.show = function(name, config, callback) { this._show(); // show prior to transition if (name && Y.Transition) { if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default if (typeof config === 'function') { callback = config; config = name; } name = this.SHOW_TRANSITION; } this.transition(name, config, callback); } return this; }; var _wrapCallBack = function(anim, fn, callback) { return function() { if (fn) { fn.call(anim); } if (callback) { callback.apply(anim._node, arguments); } }; }; Y.Node.prototype.hide = function(name, config, callback) { if (name && Y.Transition) { if (typeof config === 'function') { callback = config; config = null; } callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default if (typeof config === 'function') { callback = config; config = name; } name = this.HIDE_TRANSITION; } this.transition(name, config, callback); } else { this._hide(); } return this; }; /** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({ * duration: 1, // in seconds, default is 0.5 * easing: 'ease-out', // default is 'ease' * delay: '1', // delay start for 1 second, default is 0 * * height: '10px', * width: '10px', * * opacity: { // per property * value: 0, * duration: 2, * delay: 2, * easing: 'ease-in' * } * }); * </pre> * @for NodeList * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing. * @param {Function} callback A function to run after the transition has completed. The callback fires * once per item in the NodeList. * @chainable */ Y.NodeList.prototype.transition = function(config, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).transition(config, callback); } return this; }; Y.Node.prototype.toggleView = function(name, on) { var callback; this._toggles = this._toggles || []; if (typeof name == 'boolean') { // no transition, just toggle on = name; } if (typeof on === 'undefined' && name in this._toggles) { on = ! this._toggles[name]; } on = (on) ? 1 : 0; if (on) { this._show(); } else { callback = _wrapCallBack(anim, this._hide); } this._toggles[name] = on; this.transition(Y.Transition.toggles[name][on], callback); }; Y.NodeList.prototype.toggleView = function(config, callback) { var nodes = this._nodes, i = 0, node; while ((node = nodes[i++])) { Y.one(node).toggleView(config, callback); } return this; }; Y.mix(Transition.fx, { fadeOut: { opacity: 0, duration: 0.5, easing: 'ease-out' }, fadeIn: { opacity: 1, duration: 0.5, easing: 'ease-in' }, sizeOut: { height: 0, width: 0, duration: 0.75, easing: 'ease-out' }, sizeIn: { height: function(node) { return node.get('scrollHeight') + 'px'; }, width: function(node) { return node.get('scrollWidth') + 'px'; }, duration: 0.5, easing: 'ease-in', on: { start: function() { var overflow = this.getStyle('overflow'); if (overflow !== 'hidden') { // enable scrollHeight/Width this.setStyle('overflow', 'hidden'); this._transitionOverflow = overflow; } }, end: function() { if (this._transitionOverflow) { // revert overridden value this.setStyle('overflow', this._transitionOverflow); } } } } }); Y.mix(Transition.toggles, { size: ['sizeIn', 'sizeOut'], fade: ['fadeOut', 'fadeIn'] }); }, '@VERSION@' ,{requires:['node-base']}); YUI.add('transition-timer', function(Y) { /* * The Transition Utility provides an API for creating advanced transitions. * @module transition */ /* * Provides the base Transition class, for animating numeric properties. * * @module transition * @submodule transition-timer */ var Transition = Y.Transition; Y.mix(Transition.prototype, { _start: function() { if (Transition.useNative) { this._runNative(); } else { this._runTimer(); } }, _runTimer: function() { var anim = this; anim._initAttrs(); Transition._running[Y.stamp(anim)] = anim; anim._startTime = new Date(); Transition._startTimer(); }, _endTimer: function() { var anim = this; delete Transition._running[Y.stamp(anim)]; anim._startTime = null; }, _runFrame: function() { var t = new Date() - this._startTime; this._runAttrs(t); }, _runAttrs: function(time) { var anim = this, node = anim._node, config = anim._config, uid = Y.stamp(node), attrs = Transition._nodeAttrs[uid], customAttr = Transition.behaviors, done = false, allDone = false, data, name, attribute, setter, elapsed, delay, d, t, i; for (name in attrs) { attribute = attrs[name]; if ((attribute && attribute.transition === anim)) { d = attribute.duration; delay = attribute.delay; elapsed = (time - delay) / 1000; t = time; data = { type: 'propertyEnd', propertyName: name, config: config, elapsedTime: elapsed }; setter = (i in customAttr && 'set' in customAttr[i]) ? customAttr[i].set : Transition.DEFAULT_SETTER; done = (t >= d); if (t > d) { t = d; } if (!delay || time >= delay) { setter(anim, name, attribute.from, attribute.to, t - delay, d - delay, attribute.easing, attribute.unit); if (done) { delete attrs[name]; anim._count--; if (config[name] && config[name].on && config[name].on.end) { config[name].on.end.call(Y.one(node), data); } //node.fire('transition:propertyEnd', data); if (!allDone && anim._count <= 0) { allDone = true; anim._end(elapsed); anim._endTimer(); } } } } } }, _initAttrs: function() { var anim = this, customAttr = Transition.behaviors, uid = Y.stamp(anim._node), attrs = Transition._nodeAttrs[uid], attribute, duration, delay, easing, val, name, mTo, mFrom, unit, begin, end; for (name in attrs) { attribute = attrs[name]; if (attrs.hasOwnProperty(name) && (attribute && attribute.transition === anim)) { duration = attribute.duration * 1000; delay = attribute.delay * 1000; easing = attribute.easing; val = attribute.value; // only allow supported properties if (name in anim._node.style || name in Y.DOM.CUSTOM_STYLES) { begin = (name in customAttr && 'get' in customAttr[name]) ? customAttr[name].get(anim, name) : Transition.DEFAULT_GETTER(anim, name); mFrom = Transition.RE_UNITS.exec(begin); mTo = Transition.RE_UNITS.exec(val); begin = mFrom ? mFrom[1] : begin; end = mTo ? mTo[1] : val; unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units if (!unit && Transition.RE_DEFAULT_UNIT.test(name)) { unit = Transition.DEFAULT_UNIT; } if (typeof easing === 'string') { if (easing.indexOf('cubic-bezier') > -1) { easing = easing.substring(13, easing.length - 1).split(','); } else if (Transition.easings[easing]) { easing = Transition.easings[easing]; } } attribute.from = Number(begin); attribute.to = Number(end); attribute.unit = unit; attribute.easing = easing; attribute.duration = duration + delay; attribute.delay = delay; } else { delete attrs[name]; anim._count--; } } } }, destroy: function() { this.detachAll(); this._node = null; } }, true); Y.mix(Y.Transition, { _runtimeAttrs: {}, /* * Regex of properties that should use the default unit. * * @property RE_DEFAULT_UNIT * @static */ RE_DEFAULT_UNIT: /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i, /* * The default unit to use with properties that pass the RE_DEFAULT_UNIT test. * * @property DEFAULT_UNIT * @static */ DEFAULT_UNIT: 'px', /* * Time in milliseconds passed to setInterval for frame processing * * @property intervalTime * @default 20 * @static */ intervalTime: 20, /* * Bucket for custom getters and setters * * @property behaviors * @static */ behaviors: { left: { get: function(anim, attr) { return Y.DOM._getAttrOffset(anim._node, attr); } } }, /* * The default setter to use when setting object properties. * * @property DEFAULT_SETTER * @static */ DEFAULT_SETTER: function(anim, att, from, to, elapsed, duration, fn, unit) { from = Number(from); to = Number(to); var node = anim._node, val = Transition.cubicBezier(fn, elapsed / duration); val = from + val[0] * (to - from); if (node) { if (att in node.style || att in Y.DOM.CUSTOM_STYLES) { unit = unit || ''; Y.DOM.setStyle(node, att, val + unit); } } else { anim._end(); } }, /* * The default getter to use when getting object properties. * * @property DEFAULT_GETTER * @static */ DEFAULT_GETTER: function(anim, att) { var node = anim._node, val = ''; if (att in node.style || att in Y.DOM.CUSTOM_STYLES) { val = Y.DOM.getComputedStyle(node, att); } return val; }, _startTimer: function() { if (!Transition._timer) { Transition._timer = setInterval(Transition._runFrame, Transition.intervalTime); } }, _stopTimer: function() { clearInterval(Transition._timer); Transition._timer = null; }, /* * Called per Interval to handle each animation frame. * @method _runFrame * @private * @static */ _runFrame: function() { var done = true, anim; for (anim in Transition._running) { if (Transition._running[anim]._runFrame) { done = false; Transition._running[anim]._runFrame(); } } if (done) { Transition._stopTimer(); } }, cubicBezier: function(p, t) { var x0 = 0, y0 = 0, x1 = p[0], y1 = p[1], x2 = p[2], y2 = p[3], x3 = 1, y3 = 0, A = x3 - 3 * x2 + 3 * x1 - x0, B = 3 * x2 - 6 * x1 + 3 * x0, C = 3 * x1 - 3 * x0, D = x0, E = y3 - 3 * y2 + 3 * y1 - y0, F = 3 * y2 - 6 * y1 + 3 * y0, G = 3 * y1 - 3 * y0, H = y0, x = (((A*t) + B)*t + C)*t + D, y = (((E*t) + F)*t + G)*t + H; return [x, y]; }, easings: { ease: [0.25, 0, 1, 0.25], linear: [0, 0, 1, 1], 'ease-in': [0.42, 0, 1, 1], 'ease-out': [0, 0, 0.58, 1], 'ease-in-out': [0.42, 0, 0.58, 1] }, _running: {}, _timer: null, RE_UNITS: /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/ }, true); Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left; Y.Transition = Transition; }, '@VERSION@' ,{requires:['transition-native', 'node-style']}); YUI.add('transition', function(Y){}, '@VERSION@' ,{use:['transition-native', 'transition-timer']}); YUI.add('selector-css3', function(Y) { /** * The selector css3 module provides support for css3 selectors. * @module dom * @submodule selector-css3 * @for Selector */ /* an+b = get every _a_th node starting at the _b_th 0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element 1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n") an+0 = get every _a_th element, "0" may be omitted */ Y.Selector._reNth = /^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/; Y.Selector._getNth = function(node, expr, tag, reverse) { Y.Selector._reNth.test(expr); var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_) n = RegExp.$2, // "n" oddeven = RegExp.$3, // "odd" or "even" b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_ result = [], siblings = Y.Selector._children(node.parentNode, tag), op; if (oddeven) { a = 2; // always every other op = '+'; n = 'n'; b = (oddeven === 'odd') ? 1 : 0; } else if ( isNaN(a) ) { a = (n) ? 1 : 0; // start from the first or no repeat } if (a === 0) { // just the first if (reverse) { b = siblings.length - b + 1; } if (siblings[b - 1] === node) { return true; } else { return false; } } else if (a < 0) { reverse = !!reverse; a = Math.abs(a); } if (!reverse) { for (var i = b - 1, len = siblings.length; i < len; i += a) { if ( i >= 0 && siblings[i] === node ) { return true; } } } else { for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) { if ( i < len && siblings[i] === node ) { return true; } } } return false; }; Y.mix(Y.Selector.pseudos, { 'root': function(node) { return node === node.ownerDocument.documentElement; }, 'nth-child': function(node, expr) { return Y.Selector._getNth(node, expr); }, 'nth-last-child': function(node, expr) { return Y.Selector._getNth(node, expr, null, true); }, 'nth-of-type': function(node, expr) { return Y.Selector._getNth(node, expr, node.tagName); }, 'nth-last-of-type': function(node, expr) { return Y.Selector._getNth(node, expr, node.tagName, true); }, 'last-child': function(node) { var children = Y.Selector._children(node.parentNode); return children[children.length - 1] === node; }, 'first-of-type': function(node) { return Y.Selector._children(node.parentNode, node.tagName)[0] === node; }, 'last-of-type': function(node) { var children = Y.Selector._children(node.parentNode, node.tagName); return children[children.length - 1] === node; }, 'only-child': function(node) { var children = Y.Selector._children(node.parentNode); return children.length === 1 && children[0] === node; }, 'only-of-type': function(node) { var children = Y.Selector._children(node.parentNode, node.tagName); return children.length === 1 && children[0] === node; }, 'empty': function(node) { return node.childNodes.length === 0; }, 'not': function(node, expr) { return !Y.Selector.test(node, expr); }, 'contains': function(node, expr) { var text = node.innerText || node.textContent || ''; return text.indexOf(expr) > -1; }, 'checked': function(node) { return (node.checked === true || node.selected === true); }, enabled: function(node) { return (node.disabled !== undefined && !node.disabled); }, disabled: function(node) { return (node.disabled); } }); Y.mix(Y.Selector.operators, { '^=': '^{val}', // Match starts with value '$=': '{val}$', // Match ends with value '*=': '{val}' // Match contains value as substring }); Y.Selector.combinators['~'] = { axis: 'previousSibling' }; }, '@VERSION@' ,{requires:['dom-base', 'selector-native', 'selector-css2']}); YUI.add('dom-style-ie', function(Y) { (function(Y) { var HAS_LAYOUT = 'hasLayout', PX = 'px', FILTER = 'filter', FILTERS = 'filters', OPACITY = 'opacity', AUTO = 'auto', BORDER_WIDTH = 'borderWidth', BORDER_TOP_WIDTH = 'borderTopWidth', BORDER_RIGHT_WIDTH = 'borderRightWidth', BORDER_BOTTOM_WIDTH = 'borderBottomWidth', BORDER_LEFT_WIDTH = 'borderLeftWidth', WIDTH = 'width', HEIGHT = 'height', TRANSPARENT = 'transparent', VISIBLE = 'visible', GET_COMPUTED_STYLE = 'getComputedStyle', UNDEFINED = undefined, documentElement = Y.config.doc.documentElement, testFeature = Y.Features.test, addFeature = Y.Features.add, // TODO: unit-less lineHeight (e.g. 1.22) re_unit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i, isIE8 = (Y.UA.ie >= 8), _getStyleObj = function(node) { return node.currentStyle || node.style; }, ComputedStyle = { CUSTOM_STYLES: {}, get: function(el, property) { var value = '', current; if (el) { current = _getStyleObj(el)[property]; if (property === OPACITY && Y.DOM.CUSTOM_STYLES[OPACITY]) { value = Y.DOM.CUSTOM_STYLES[OPACITY].get(el); } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert value = current; } else if (Y.DOM.IE.COMPUTED[property]) { // use compute function value = Y.DOM.IE.COMPUTED[property](el, property); } else if (re_unit.test(current)) { // convert to pixel value = ComputedStyle.getPixel(el, property) + PX; } else { value = current; } } return value; }, sizeOffsets: { width: ['Left', 'Right'], height: ['Top', 'Bottom'], top: ['Top'], bottom: ['Bottom'] }, getOffset: function(el, prop) { var current = _getStyleObj(el)[prop], // value of "width", "top", etc. capped = prop.charAt(0).toUpperCase() + prop.substr(1), // "Width", "Top", etc. offset = 'offset' + capped, // "offsetWidth", "offsetTop", etc. pixel = 'pixel' + capped, // "pixelWidth", "pixelTop", etc. sizeOffsets = ComputedStyle.sizeOffsets[prop], mode = el.ownerDocument.compatMode, value = ''; // IE pixelWidth incorrect for percent // manually compute by subtracting padding and border from offset size // NOTE: clientWidth/Height (size minus border) is 0 when current === AUTO so offsetHeight is used // reverting to auto from auto causes position stacking issues (old impl) if (current === AUTO || current.indexOf('%') > -1) { value = el['offset' + capped]; if (mode !== 'BackCompat') { if (sizeOffsets[0]) { value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[0]); value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[0] + 'Width', 1); } if (sizeOffsets[1]) { value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[1]); value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[1] + 'Width', 1); } } } else { // use style.pixelWidth, etc. to convert to pixels // need to map style.width to currentStyle (no currentStyle.pixelWidth) if (!el.style[pixel] && !el.style[prop]) { el.style[prop] = current; } value = el.style[pixel]; } return value + PX; }, borderMap: { thin: (isIE8) ? '1px' : '2px', medium: (isIE8) ? '3px': '4px', thick: (isIE8) ? '5px' : '6px' }, getBorderWidth: function(el, property, omitUnit) { var unit = omitUnit ? '' : PX, current = el.currentStyle[property]; if (current.indexOf(PX) < 0) { // look up keywords if a border exists if (ComputedStyle.borderMap[current] && el.currentStyle.borderStyle !== 'none') { current = ComputedStyle.borderMap[current]; } else { // otherwise no border (default is "medium") current = 0; } } return (omitUnit) ? parseFloat(current) : current; }, getPixel: function(node, att) { // use pixelRight to convert to px var val = null, style = _getStyleObj(node), styleRight = style.right, current = style[att]; node.style.right = current; val = node.style.pixelRight; node.style.right = styleRight; // revert return val; }, getMargin: function(node, att) { var val, style = _getStyleObj(node); if (style[att] == AUTO) { val = 0; } else { val = ComputedStyle.getPixel(node, att); } return val + PX; }, getVisibility: function(node, att) { var current; while ( (current = node.currentStyle) && current[att] == 'inherit') { // NOTE: assignment in test node = node.parentNode; } return (current) ? current[att] : VISIBLE; }, getColor: function(node, att) { var current = _getStyleObj(node)[att]; if (!current || current === TRANSPARENT) { Y.DOM.elementByAxis(node, 'parentNode', null, function(parent) { current = _getStyleObj(parent)[att]; if (current && current !== TRANSPARENT) { node = parent; return true; } }); } return Y.Color.toRGB(current); }, getBorderColor: function(node, att) { var current = _getStyleObj(node), val = current[att] || current.color; return Y.Color.toRGB(Y.Color.toHex(val)); } }, //fontSize: getPixelFont, IEComputed = {}; addFeature('style', 'computedStyle', { test: function() { return 'getComputedStyle' in Y.config.win; } }); addFeature('style', 'opacity', { test: function() { return 'opacity' in documentElement.style; } }); addFeature('style', 'filter', { test: function() { return 'filters' in documentElement; } }); // use alpha filter for IE opacity if (!testFeature('style', 'opacity') && testFeature('style', 'filter')) { Y.DOM.CUSTOM_STYLES[OPACITY] = { get: function(node) { var val = 100; try { // will error if no DXImageTransform val = node[FILTERS]['DXImageTransform.Microsoft.Alpha'][OPACITY]; } catch(e) { try { // make sure its in the document val = node[FILTERS]('alpha')[OPACITY]; } catch(err) { } } return val / 100; }, set: function(node, val, style) { var current, styleObj = _getStyleObj(node), currentFilter = styleObj[FILTER]; style = style || node.style; if (val === '') { // normalize inline style behavior current = (OPACITY in styleObj) ? styleObj[OPACITY] : 1; // revert to original opacity val = current; } if (typeof currentFilter == 'string') { // in case not appended style[FILTER] = currentFilter.replace(/alpha([^)]*\))/gi, '') + ((val < 1) ? 'alpha(' + OPACITY + '=' + val * 100 + ')' : ''); if (!style[FILTER]) { style.removeAttribute(FILTER); } if (!styleObj[HAS_LAYOUT]) { style.zoom = 1; // needs layout } } } }; } try { Y.config.doc.createElement('div').style.height = '-1px'; } catch(e) { // IE throws error on invalid style set; trap common cases Y.DOM.CUSTOM_STYLES.height = { set: function(node, val, style) { var floatVal = parseFloat(val); if (floatVal >= 0 || val === 'auto' || val === '') { style.height = val; } else { } } }; Y.DOM.CUSTOM_STYLES.width = { set: function(node, val, style) { var floatVal = parseFloat(val); if (floatVal >= 0 || val === 'auto' || val === '') { style.width = val; } else { } } }; } if (!testFeature('style', 'computedStyle')) { // TODO: top, right, bottom, left IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset; IEComputed.color = IEComputed.backgroundColor = ComputedStyle.getColor; IEComputed[BORDER_WIDTH] = IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] = IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] = ComputedStyle.getBorderWidth; IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom = IEComputed.marginLeft = ComputedStyle.getMargin; IEComputed.visibility = ComputedStyle.getVisibility; IEComputed.borderColor = IEComputed.borderTopColor = IEComputed.borderRightColor = IEComputed.borderBottomColor = IEComputed.borderLeftColor = ComputedStyle.getBorderColor; Y.DOM[GET_COMPUTED_STYLE] = ComputedStyle.get; Y.namespace('DOM.IE'); Y.DOM.IE.COMPUTED = IEComputed; Y.DOM.IE.ComputedStyle = ComputedStyle; } })(Y); }, '@VERSION@' ,{requires:['dom-style']}); YUI.add('simpleyui', function(Y) { // empty }, '@VERSION@' ,{use:['yui','oop','dom','event-custom-base','event-base','pluginhost','node','event-delegate','io-base','json-parse','transition','selector-css3','dom-style-ie','querystring-stringify-simple']}); var Y = YUI().use('*');
Examples/UIExplorer/ProgressViewIOSExample.js
wangziqiang/react-native
/** * The examples provided by Facebook are for non-commercial testing and * evaluation purposes only. * * Facebook reserves all rights not expressly granted. * * 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 NON INFRINGEMENT. IN NO EVENT SHALL * FACEBOOK 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. * * @flow */ 'use strict'; var React = require('react-native'); var { ProgressViewIOS, StyleSheet, View, } = React; var TimerMixin = require('react-timer-mixin'); var ProgressViewExample = React.createClass({ mixins: [TimerMixin], getInitialState() { return { progress: 0, }; }, componentDidMount() { this.updateProgress(); }, updateProgress() { var progress = this.state.progress + 0.01; this.setState({ progress }); this.requestAnimationFrame(() => this.updateProgress()); }, getProgress(offset) { var progress = this.state.progress + offset; return Math.sin(progress % Math.PI) % 1; }, render() { return ( <View style={styles.container}> <ProgressViewIOS style={styles.progressView} progress={this.getProgress(0)}/> <ProgressViewIOS style={styles.progressView} progressTintColor="purple" progress={this.getProgress(0.2)}/> <ProgressViewIOS style={styles.progressView} progressTintColor="red" progress={this.getProgress(0.4)}/> <ProgressViewIOS style={styles.progressView} progressTintColor="orange" progress={this.getProgress(0.6)}/> <ProgressViewIOS style={styles.progressView} progressTintColor="yellow" progress={this.getProgress(0.8)}/> </View> ); }, }); exports.displayName = (undefined: ?string); exports.framework = 'React'; exports.title = 'ProgressViewIOS'; exports.description = 'ProgressViewIOS'; exports.examples = [{ title: 'ProgressViewIOS', render() { return ( <ProgressViewExample/> ); } }]; var styles = StyleSheet.create({ container: { marginTop: -20, backgroundColor: 'transparent', }, progressView: { marginTop: 20, } });
src/client/assets/js/features/driver/components/Overview/Overview.js
me-box/platform-sdk
import React, { Component } from 'react'; import { Link } from 'react-router'; export default class Overview extends React.Component { render(){ return <div> <div className="panel"> <div className="cell"> <div className="description"> Is your driver a <strong> cloud </strong> or a <strong>hardware</strong> driver? A cloud driver gets its data from a cloud service (e.g. facebook, twitter, google). A hardware driver gets its data from a IoT device (e.g Phillips Hue bulbs) </div> <div className="attribute"> <div className="attribute-grid"> <div className="driverbutton">hardware</div> <div className="driverbutton">cloud</div> </div> </div> </div> </div> <div className="panel"> <div className="cell"> <div className="description"> Give your driver a <strong>name</strong> </div> <div className="attribute"> <input type="text" placeholder="driver name"/> </div> </div> </div> <div className="panel"> <div className="cell"> <div className="description"> Give your driver a <strong>description</strong> </div> <div className="attribute"> <input type="text" placeholder="driver description"/> </div> </div> </div> <div className="panel"> <div className="cell"> <div className="description"> please choose an open-source license - we recommend <strong>MIT</strong> </div> <div className="attribute"> <div className="attribute-grid"> <div className="driverbutton">MIT</div> <div className="driverbutton">GPL-3.0</div> <div className="driverbutton">LGPL-3.0</div> <div className="driverbutton">AFL-3.0</div> <div className="driverbutton">BSD-2</div> <div className="driverbutton">BSD-3</div> <div className="driverbutton">Apache-2</div> <div className="driverbutton">ISC</div> </div> </div> </div> </div> <div className="panel"> <div className="cell"> <div className="description"> Driver <strong>tags</strong> </div> <div className="attribute"> <input type="text" placeholder="comma separated list of tags"/> </div> </div> </div> </div> } }
app/routes.js
Git-Together/GitTogether
import React from 'react'; import { Route, IndexRoute } from 'react-router'; import App from './containers/App-container'; import HomePage from './containers/HomePage-container'; import authCheck from './utils/checkLogin.js' import Auth from './components/Auth/Auth-component.js' export default ( <Route path="/" component={App}> <IndexRoute component={Auth} /> <Route path="/Home" component={HomePage} /> </Route> );
ajax/libs/onsen/2.9.0/js/angular-onsenui.js
jonobr1/cdnjs
/* angular-onsenui v2.9.0 - 2018-01-25 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : (factory()); }(this, (function () { 'use strict'; /* Simple JavaScript Inheritance for ES 5.1 * based on http://ejohn.org/blog/simple-javascript-inheritance/ * (inspired by base2 and Prototype) * MIT Licensed. */ (function () { var fnTest = /xyz/.test(function () { }) ? /\b_super\b/ : /.*/; // The base Class implementation (does nothing) function BaseClass() {} // Create a new Class that inherits from this class BaseClass.extend = function (props) { var _super = this.prototype; // Set up the prototype to inherit from the base class // (but without running the init constructor) var proto = Object.create(_super); // Copy the properties over onto the new prototype for (var name in props) { // Check if we're overwriting an existing function proto[name] = typeof props[name] === "function" && typeof _super[name] == "function" && fnTest.test(props[name]) ? function (name, fn) { return function () { var tmp = this._super; // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; // The method only need to be bound temporarily, so we // remove it when we're done executing var ret = fn.apply(this, arguments); this._super = tmp; return ret; }; }(name, props[name]) : props[name]; } // The new constructor var newClass = typeof proto.init === "function" ? proto.hasOwnProperty("init") ? proto.init // All construction is actually done in the init method : function SubClass() { _super.init.apply(this, arguments); } : function EmptyClass() {}; // Populate our constructed prototype object newClass.prototype = proto; // Enforce the constructor to be what we expect proto.constructor = newClass; // And make this class extendable newClass.extend = BaseClass.extend; return newClass; }; // export window.Class = BaseClass; })(); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* Copyright 2013-2015 ASIAL CORPORATION 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. */ /** * @object ons * @description * [ja]Onsen UIで利用できるグローバルなオブジェクトです。このオブジェクトは、AngularJSのスコープから参照することができます。 [/ja] * [en]A global object that's used in Onsen UI. This object can be reached from the AngularJS scope.[/en] */ (function (ons) { var module = angular.module('onsen', []); angular.module('onsen.directives', ['onsen']); // for BC // JS Global facade for Onsen UI. initOnsenFacade(); waitOnsenUILoad(); initAngularModule(); initTemplateCache(); function waitOnsenUILoad() { var unlockOnsenUI = ons._readyLock.lock(); module.run(['$compile', '$rootScope', function ($compile, $rootScope) { // for initialization hook. if (document.readyState === 'loading' || document.readyState == 'uninitialized') { window.addEventListener('DOMContentLoaded', function () { document.body.appendChild(document.createElement('ons-dummy-for-init')); }); } else if (document.body) { document.body.appendChild(document.createElement('ons-dummy-for-init')); } else { throw new Error('Invalid initialization state.'); } $rootScope.$on('$ons-ready', unlockOnsenUI); }]); } function initAngularModule() { module.value('$onsGlobal', ons); module.run(['$compile', '$rootScope', '$onsen', '$q', function ($compile, $rootScope, $onsen, $q) { ons._onsenService = $onsen; ons._qService = $q; $rootScope.ons = window.ons; $rootScope.console = window.console; $rootScope.alert = window.alert; ons.$compile = $compile; }]); } function initTemplateCache() { module.run(['$templateCache', function ($templateCache) { var tmp = ons._internal.getTemplateHTMLAsync; ons._internal.getTemplateHTMLAsync = function (page) { var cache = $templateCache.get(page); if (cache) { return Promise.resolve(cache); } else { return tmp(page); } }; }]); } function initOnsenFacade() { ons._onsenService = null; // Object to attach component variables to when using the var="..." attribute. // Can be set to null to avoid polluting the global scope. ons.componentBase = window; /** * @method bootstrap * @signature bootstrap([moduleName, [dependencies]]) * @description * [ja]Onsen UIの初期化を行います。Angular.jsのng-app属性を利用すること無しにOnsen UIを読み込んで初期化してくれます。[/ja] * [en]Initialize Onsen UI. Can be used to load Onsen UI without using the <code>ng-app</code> attribute from AngularJS.[/en] * @param {String} [moduleName] * [en]AngularJS module name.[/en] * [ja]Angular.jsでのモジュール名[/ja] * @param {Array} [dependencies] * [en]List of AngularJS module dependencies.[/en] * [ja]依存するAngular.jsのモジュール名の配列[/ja] * @return {Object} * [en]An AngularJS module object.[/en] * [ja]AngularJSのModuleオブジェクトを表します。[/ja] */ ons.bootstrap = function (name, deps) { if (angular.isArray(name)) { deps = name; name = undefined; } if (!name) { name = 'myOnsenApp'; } deps = ['onsen'].concat(angular.isArray(deps) ? deps : []); var module = angular.module(name, deps); var doc = window.document; if (doc.readyState == 'loading' || doc.readyState == 'uninitialized' || doc.readyState == 'interactive') { doc.addEventListener('DOMContentLoaded', function () { angular.bootstrap(doc.documentElement, [name]); }, false); } else if (doc.documentElement) { angular.bootstrap(doc.documentElement, [name]); } else { throw new Error('Invalid state'); } return module; }; /** * @method findParentComponentUntil * @signature findParentComponentUntil(name, [dom]) * @param {String} name * [en]Name of component, i.e. 'ons-page'.[/en] * [ja]コンポーネント名を指定します。例えばons-pageなどを指定します。[/ja] * @param {Object/jqLite/HTMLElement} [dom] * [en]$event, jqLite or HTMLElement object.[/en] * [ja]$eventオブジェクト、jqLiteオブジェクト、HTMLElementオブジェクトのいずれかを指定できます。[/ja] * @return {Object} * [en]Component object. Will return null if no component was found.[/en] * [ja]コンポーネントのオブジェクトを返します。もしコンポーネントが見つからなかった場合にはnullを返します。[/ja] * @description * [en]Find parent component object of <code>dom</code> element.[/en] * [ja]指定されたdom引数の親要素をたどってコンポーネントを検索します。[/ja] */ ons.findParentComponentUntil = function (name, dom) { var element; if (dom instanceof HTMLElement) { element = angular.element(dom); } else if (dom instanceof angular.element) { element = dom; } else if (dom.target) { element = angular.element(dom.target); } return element.inheritedData(name); }; /** * @method findComponent * @signature findComponent(selector, [dom]) * @param {String} selector * [en]CSS selector[/en] * [ja]CSSセレクターを指定します。[/ja] * @param {HTMLElement} [dom] * [en]DOM element to search from.[/en] * [ja]検索対象とするDOM要素を指定します。[/ja] * @return {Object/null} * [en]Component object. Will return null if no component was found.[/en] * [ja]コンポーネントのオブジェクトを返します。もしコンポーネントが見つからなかった場合にはnullを返します。[/ja] * @description * [en]Find component object using CSS selector.[/en] * [ja]CSSセレクタを使ってコンポーネントのオブジェクトを検索します。[/ja] */ ons.findComponent = function (selector, dom) { var target = (dom ? dom : document).querySelector(selector); return target ? angular.element(target).data(target.nodeName.toLowerCase()) || null : null; }; /** * @method compile * @signature compile(dom) * @param {HTMLElement} dom * [en]Element to compile.[/en] * [ja]コンパイルする要素を指定します。[/ja] * @description * [en]Compile Onsen UI components.[/en] * [ja]通常のHTMLの要素をOnsen UIのコンポーネントにコンパイルします。[/ja] */ ons.compile = function (dom) { if (!ons.$compile) { throw new Error('ons.$compile() is not ready. Wait for initialization with ons.ready().'); } if (!(dom instanceof HTMLElement)) { throw new Error('First argument must be an instance of HTMLElement.'); } var scope = angular.element(dom).scope(); if (!scope) { throw new Error('AngularJS Scope is null. Argument DOM element must be attached in DOM document.'); } ons.$compile(dom)(scope); }; ons._getOnsenService = function () { if (!this._onsenService) { throw new Error('$onsen is not loaded, wait for ons.ready().'); } return this._onsenService; }; /** * @param {String} elementName * @param {Function} lastReady * @return {Function} */ ons._waitDiretiveInit = function (elementName, lastReady) { return function (element, callback) { if (angular.element(element).data(elementName)) { lastReady(element, callback); } else { var listen = function listen() { lastReady(element, callback); element.removeEventListener(elementName + ':init', listen, false); }; element.addEventListener(elementName + ':init', listen, false); } }; }; /** * @method createElement * @signature createElement(template, [options]) * @param {String} template * [en]Either an HTML file path, an `<ons-template>` id or an HTML string such as `'<div id="foo">hoge</div>'`.[/en] * [ja][/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Boolean|HTMLElement} [options.append] * [en]Whether or not the element should be automatically appended to the DOM. Defaults to `false`. If `true` value is given, `document.body` will be used as the target.[/en] * [ja][/ja] * @param {HTMLElement} [options.insertBefore] * [en]Reference node that becomes the next sibling of the new node (`options.append` element).[/en] * [ja][/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the element. Used to bind models and access scope methods from the element. Requires append option.[/en] * [ja][/ja] * @return {HTMLElement|Promise} * [en]If the provided template was an inline HTML string, it returns the new element. Otherwise, it returns a promise that resolves to the new element.[/en] * [ja][/ja] * @description * [en]Create a new element from a template. Both inline HTML and external files are supported although the return value differs. If the element is appended it will also be compiled by AngularJS (otherwise, `ons.compile` should be manually used).[/en] * [ja][/ja] */ var createElementOriginal = ons.createElement; ons.createElement = function (template) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var link = function link(element) { if (options.parentScope) { ons.$compile(angular.element(element))(options.parentScope.$new()); options.parentScope.$evalAsync(); } else { ons.compile(element); } }; var getScope = function getScope(e) { return angular.element(e).data(e.tagName.toLowerCase()) || e; }; var result = createElementOriginal(template, _extends({ append: !!options.parentScope, link: link }, options)); return result instanceof Promise ? result.then(getScope) : getScope(result); }; /** * @method createAlertDialog * @signature createAlertDialog(page, [options]) * @param {String} page * [en]Page name. Can be either an HTML file or an <ons-template> containing a <ons-alert-dialog> component.[/en] * [ja]pageのURLか、もしくはons-templateで宣言したテンプレートのid属性の値を指定できます。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the dialog. Used to bind models and access scope methods from the dialog.[/en] * [ja]ダイアログ内で利用する親スコープを指定します。ダイアログからモデルやスコープのメソッドにアクセスするのに使います。このパラメータはAngularJSバインディングでのみ利用できます。[/ja] * @return {Promise} * [en]Promise object that resolves to the alert dialog component object.[/en] * [ja]ダイアログのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja] * @description * [en]Create a alert dialog instance from a template. This method will be deprecated in favor of `ons.createElement`.[/en] * [ja]テンプレートからアラートダイアログのインスタンスを生成します。[/ja] */ /** * @method createDialog * @signature createDialog(page, [options]) * @param {String} page * [en]Page name. Can be either an HTML file or an <ons-template> containing a <ons-dialog> component.[/en] * [ja]pageのURLか、もしくはons-templateで宣言したテンプレートのid属性の値を指定できます。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the dialog. Used to bind models and access scope methods from the dialog.[/en] * [ja]ダイアログ内で利用する親スコープを指定します。ダイアログからモデルやスコープのメソッドにアクセスするのに使います。このパラメータはAngularJSバインディングでのみ利用できます。[/ja] * @return {Promise} * [en]Promise object that resolves to the dialog component object.[/en] * [ja]ダイアログのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja] * @description * [en]Create a dialog instance from a template. This method will be deprecated in favor of `ons.createElement`.[/en] * [ja]テンプレートからダイアログのインスタンスを生成します。[/ja] */ /** * @method createPopover * @signature createPopover(page, [options]) * @param {String} page * [en]Page name. Can be either an HTML file or an <ons-template> containing a <ons-dialog> component.[/en] * [ja]pageのURLか、もしくはons-templateで宣言したテンプレートのid属性の値を指定できます。[/ja] * @param {Object} [options] * [en]Parameter object.[/en] * [ja]オプションを指定するオブジェクト。[/ja] * @param {Object} [options.parentScope] * [en]Parent scope of the dialog. Used to bind models and access scope methods from the dialog.[/en] * [ja]ダイアログ内で利用する親スコープを指定します。ダイアログからモデルやスコープのメソッドにアクセスするのに使います。このパラメータはAngularJSバインディングでのみ利用できます。[/ja] * @return {Promise} * [en]Promise object that resolves to the popover component object.[/en] * [ja]ポップオーバーのコンポーネントオブジェクトを解決するPromiseオブジェクトを返します。[/ja] * @description * [en]Create a popover instance from a template. This method will be deprecated in favor of `ons.createElement`.[/en] * [ja]テンプレートからポップオーバーのインスタンスを生成します。[/ja] */ /** * @param {String} page */ var resolveLoadingPlaceHolderOriginal = ons.resolveLoadingPlaceHolder; ons.resolveLoadingPlaceholder = function (page) { return resolveLoadingPlaceholderOriginal(page, function (element, done) { ons.compile(element); angular.element(element).scope().$evalAsync(function () { return setImmediate(done); }); }); }; ons._setupLoadingPlaceHolders = function () { // Do nothing }; } })(window.ons = window.ons || {}); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('ActionSheetView', ['$onsen', function ($onsen) { var ActionSheetView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide', 'toggle']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide', 'cancel'], function (detail) { if (detail.actionSheet) { detail.actionSheet = this; } return detail; }.bind(this)); this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._scope = this._attrs = this._element = null; } }); MicroEvent.mixin(ActionSheetView); $onsen.derivePropertiesFromElement(ActionSheetView, ['disabled', 'cancelable', 'visible', 'onDeviceBackButton']); return ActionSheetView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('AlertDialogView', ['$onsen', function ($onsen) { var AlertDialogView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide', 'cancel'], function (detail) { if (detail.alertDialog) { detail.alertDialog = this; } return detail; }.bind(this)); this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._scope = this._attrs = this._element = null; } }); MicroEvent.mixin(AlertDialogView); $onsen.derivePropertiesFromElement(AlertDialogView, ['disabled', 'cancelable', 'visible', 'onDeviceBackButton']); return AlertDialogView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('CarouselView', ['$onsen', function ($onsen) { /** * @class CarouselView */ var CarouselView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['setActiveIndex', 'getActiveIndex', 'next', 'prev', 'refresh', 'first', 'last']); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['refresh', 'postchange', 'overscroll'], function (detail) { if (detail.carousel) { detail.carousel = this; } return detail; }.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(CarouselView); $onsen.derivePropertiesFromElement(CarouselView, ['centered', 'overscrollable', 'disabled', 'autoScroll', 'swipeable', 'autoScrollRatio', 'itemCount', 'onSwipe']); return CarouselView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('DialogView', ['$onsen', function ($onsen) { var DialogView = Class.extend({ init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide', 'cancel'], function (detail) { if (detail.dialog) { detail.dialog = this; } return detail; }.bind(this)); this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._scope = this._attrs = this._element = null; } }); MicroEvent.mixin(DialogView); $onsen.derivePropertiesFromElement(DialogView, ['disabled', 'cancelable', 'visible', 'onDeviceBackButton']); return DialogView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('FabView', ['$onsen', function ($onsen) { /** * @class FabView */ var FabView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['show', 'hide', 'toggle']); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); $onsen.derivePropertiesFromElement(FabView, ['disabled', 'visible']); MicroEvent.mixin(FabView); return FabView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('GenericView', ['$onsen', function ($onsen) { var GenericView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs * @param {Object} [options] * @param {Boolean} [options.directiveOnly] * @param {Function} [options.onDestroy] * @param {String} [options.modifierTemplate] */ init: function init(scope, element, attrs, options) { var self = this; options = {}; this._element = element; this._scope = scope; this._attrs = attrs; if (options.directiveOnly) { if (!options.modifierTemplate) { throw new Error('options.modifierTemplate is undefined.'); } $onsen.addModifierMethods(this, options.modifierTemplate, element); } else { $onsen.addModifierMethodsForCustomElements(this, element); } $onsen.cleaner.onDestroy(scope, function () { self._events = undefined; $onsen.removeModifierMethods(self); if (options.onDestroy) { options.onDestroy(self); } $onsen.clearComponent({ scope: scope, attrs: attrs, element: element }); self = element = self._element = self._scope = scope = self._attrs = attrs = options = null; }); } }); /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs * @param {Object} options * @param {String} options.viewKey * @param {Boolean} [options.directiveOnly] * @param {Function} [options.onDestroy] * @param {String} [options.modifierTemplate] */ GenericView.register = function (scope, element, attrs, options) { var view = new GenericView(scope, element, attrs, options); if (!options.viewKey) { throw new Error('options.viewKey is required.'); } $onsen.declareVarAttribute(attrs, view); element.data(options.viewKey, view); var destroy = options.onDestroy || angular.noop; options.onDestroy = function (view) { destroy(view); element.data(options.viewKey, null); }; return view; }; MicroEvent.mixin(GenericView); return GenericView; }]); })(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('AngularLazyRepeatDelegate', ['$compile', function ($compile) { var directiveAttributes = ['ons-lazy-repeat', 'ons:lazy:repeat', 'ons_lazy_repeat', 'data-ons-lazy-repeat', 'x-ons-lazy-repeat']; var AngularLazyRepeatDelegate = function (_ons$_internal$LazyRe) { _inherits(AngularLazyRepeatDelegate, _ons$_internal$LazyRe); /** * @param {Object} userDelegate * @param {Element} templateElement * @param {Scope} parentScope */ function AngularLazyRepeatDelegate(userDelegate, templateElement, parentScope) { _classCallCheck(this, AngularLazyRepeatDelegate); var _this = _possibleConstructorReturn(this, (AngularLazyRepeatDelegate.__proto__ || Object.getPrototypeOf(AngularLazyRepeatDelegate)).call(this, userDelegate, templateElement)); _this._parentScope = parentScope; directiveAttributes.forEach(function (attr) { return templateElement.removeAttribute(attr); }); _this._linker = $compile(templateElement ? templateElement.cloneNode(true) : null); return _this; } _createClass(AngularLazyRepeatDelegate, [{ key: 'configureItemScope', value: function configureItemScope(item, scope) { if (this._userDelegate.configureItemScope instanceof Function) { this._userDelegate.configureItemScope(item, scope); } } }, { key: 'destroyItemScope', value: function destroyItemScope(item, element) { if (this._userDelegate.destroyItemScope instanceof Function) { this._userDelegate.destroyItemScope(item, element); } } }, { key: '_usingBinding', value: function _usingBinding() { if (this._userDelegate.configureItemScope) { return true; } if (this._userDelegate.createItemContent) { return false; } throw new Error('`lazy-repeat` delegate object is vague.'); } }, { key: 'loadItemElement', value: function loadItemElement(index, done) { this._prepareItemElement(index, function (_ref) { var element = _ref.element, scope = _ref.scope; done({ element: element, scope: scope }); }); } }, { key: '_prepareItemElement', value: function _prepareItemElement(index, done) { var _this2 = this; var scope = this._parentScope.$new(); this._addSpecialProperties(index, scope); if (this._usingBinding()) { this.configureItemScope(index, scope); } this._linker(scope, function (cloned) { var element = cloned[0]; if (!_this2._usingBinding()) { element = _this2._userDelegate.createItemContent(index, element); $compile(element)(scope); } done({ element: element, scope: scope }); }); } /** * @param {Number} index * @param {Object} scope */ }, { key: '_addSpecialProperties', value: function _addSpecialProperties(i, scope) { var last = this.countItems() - 1; angular.extend(scope, { $index: i, $first: i === 0, $last: i === last, $middle: i !== 0 && i !== last, $even: i % 2 === 0, $odd: i % 2 === 1 }); } }, { key: 'updateItem', value: function updateItem(index, item) { var _this3 = this; if (this._usingBinding()) { item.scope.$evalAsync(function () { return _this3.configureItemScope(index, item.scope); }); } else { _get(AngularLazyRepeatDelegate.prototype.__proto__ || Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype), 'updateItem', this).call(this, index, item); } } /** * @param {Number} index * @param {Object} item * @param {Object} item.scope * @param {Element} item.element */ }, { key: 'destroyItem', value: function destroyItem(index, item) { if (this._usingBinding()) { this.destroyItemScope(index, item.scope); } else { _get(AngularLazyRepeatDelegate.prototype.__proto__ || Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype), 'destroyItem', this).call(this, index, item.element); } item.scope.$destroy(); } }, { key: 'destroy', value: function destroy() { _get(AngularLazyRepeatDelegate.prototype.__proto__ || Object.getPrototypeOf(AngularLazyRepeatDelegate.prototype), 'destroy', this).call(this); this._scope = null; } }]); return AngularLazyRepeatDelegate; }(ons._internal.LazyRepeatDelegate); return AngularLazyRepeatDelegate; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('LazyRepeatView', ['AngularLazyRepeatDelegate', function (AngularLazyRepeatDelegate) { var LazyRepeatView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs, linker) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this._linker = linker; var userDelegate = this._scope.$eval(this._attrs.onsLazyRepeat); var internalDelegate = new AngularLazyRepeatDelegate(userDelegate, element[0], scope || element.scope()); this._provider = new ons._internal.LazyRepeatProvider(element[0].parentNode, internalDelegate); // Expose refresh method to user. userDelegate.refresh = this._provider.refresh.bind(this._provider); element.remove(); // Render when number of items change. this._scope.$watch(internalDelegate.countItems.bind(internalDelegate), this._provider._onChange.bind(this._provider)); this._scope.$on('$destroy', function () { _this._element = _this._scope = _this._attrs = _this._linker = null; }); } }); return LazyRepeatView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('ModalView', ['$onsen', '$parse', function ($onsen, $parse) { var ModalView = Class.extend({ _element: undefined, _scope: undefined, init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide', 'toggle']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide'], function (detail) { if (detail.modal) { detail.modal = this; } return detail; }.bind(this)); }, _destroy: function _destroy() { this.emit('destroy', { page: this }); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._events = this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(ModalView); $onsen.derivePropertiesFromElement(ModalView, ['onDeviceBackButton', 'visible']); return ModalView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('NavigatorView', ['$compile', '$onsen', function ($compile, $onsen) { /** * Manages the page navigation backed by page stack. * * @class NavigatorView */ var NavigatorView = Class.extend({ /** * @member {jqLite} Object */ _element: undefined, /** * @member {Object} Object */ _attrs: undefined, /** * @member {Object} */ _scope: undefined, /** * @param {Object} scope * @param {jqLite} element jqLite Object to manage with navigator * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element || angular.element(window.document.body); this._scope = scope || this._element.scope(); this._attrs = attrs; this._previousPageScope = null; this._boundOnPrepop = this._onPrepop.bind(this); this._element.on('prepop', this._boundOnPrepop); this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['prepush', 'postpush', 'prepop', 'postpop', 'init', 'show', 'hide', 'destroy'], function (detail) { if (detail.navigator) { detail.navigator = this; } return detail; }.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['insertPage', 'removePage', 'pushPage', 'bringPageTop', 'popPage', 'replacePage', 'resetToPage', 'canPopPage']); }, _onPrepop: function _onPrepop(event) { var pages = event.detail.navigator.pages; angular.element(pages[pages.length - 2]).data('_scope').$evalAsync(); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element.off('prepop', this._boundOnPrepop); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(NavigatorView); $onsen.derivePropertiesFromElement(NavigatorView, ['pages', 'topPage', 'onSwipe', 'options', 'onDeviceBackButton', 'pageLoader']); return NavigatorView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('PageView', ['$onsen', '$parse', function ($onsen, $parse) { var PageView = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._scope = scope; this._element = element; this._attrs = attrs; this._clearListener = scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['init', 'show', 'hide', 'destroy']); Object.defineProperty(this, 'onDeviceBackButton', { get: function get() { return _this._element[0].onDeviceBackButton; }, set: function set(value) { if (!_this._userBackButtonHandler) { _this._enableBackButtonHandler(); } _this._userBackButtonHandler = value; } }); if (this._attrs.ngDeviceBackButton || this._attrs.onDeviceBackButton) { this._enableBackButtonHandler(); } if (this._attrs.ngInfiniteScroll) { this._element[0].onInfiniteScroll = function (done) { $parse(_this._attrs.ngInfiniteScroll)(_this._scope)(done); }; } }, _enableBackButtonHandler: function _enableBackButtonHandler() { this._userBackButtonHandler = angular.noop; this._element[0].onDeviceBackButton = this._onDeviceBackButton.bind(this); }, _onDeviceBackButton: function _onDeviceBackButton($event) { this._userBackButtonHandler($event); // ng-device-backbutton if (this._attrs.ngDeviceBackButton) { $parse(this._attrs.ngDeviceBackButton)(this._scope, { $event: $event }); } // on-device-backbutton /* jshint ignore:start */ if (this._attrs.onDeviceBackButton) { var lastEvent = window.$event; window.$event = $event; new Function(this._attrs.onDeviceBackButton)(); // eslint-disable-line no-new-func window.$event = lastEvent; } /* jshint ignore:end */ }, _destroy: function _destroy() { this._clearDerivingEvents(); this._element = null; this._scope = null; this._clearListener(); } }); MicroEvent.mixin(PageView); return PageView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('PopoverView', ['$onsen', function ($onsen) { var PopoverView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide'], function (detail) { if (detail.popover) { detail.popover = this; } return detail; }.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingMethods(); this._clearDerivingEvents(); this._element.remove(); this._element = this._scope = null; } }); MicroEvent.mixin(PopoverView); $onsen.derivePropertiesFromElement(PopoverView, ['cancelable', 'disabled', 'onDeviceBackButton', 'visible']); return PopoverView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('PullHookView', ['$onsen', '$parse', function ($onsen, $parse) { var PullHookView = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['changestate'], function (detail) { if (detail.pullHook) { detail.pullHook = _this; } return detail; }); this.on('changestate', function () { return _this._scope.$evalAsync(); }); this._element[0].onAction = function (done) { if (_this._attrs.ngAction) { _this._scope.$eval(_this._attrs.ngAction, { $done: done }); } else { _this.onAction ? _this.onAction(done) : done(); } }; this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(PullHookView); $onsen.derivePropertiesFromElement(PullHookView, ['state', 'onPull', 'pullDistance', 'height', 'thresholdHeight', 'disabled']); return PullHookView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('SpeedDialView', ['$onsen', function ($onsen) { /** * @class SpeedDialView */ var SpeedDialView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['show', 'hide', 'showItems', 'hideItems', 'isOpen', 'toggle', 'toggleItems']); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['open', 'close']).bind(this); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(SpeedDialView); $onsen.derivePropertiesFromElement(SpeedDialView, ['disabled', 'visible', 'inline']); return SpeedDialView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('SplitterContent', ['$onsen', '$compile', function ($onsen, $compile) { var SplitterContent = Class.extend({ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; this.load = this._element[0].load.bind(this._element[0]); scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element = this._scope = this._attrs = this.load = this._pageScope = null; } }); MicroEvent.mixin(SplitterContent); $onsen.derivePropertiesFromElement(SplitterContent, ['page']); return SplitterContent; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('SplitterSide', ['$onsen', '$compile', function ($onsen, $compile) { var SplitterSide = Class.extend({ init: function init(scope, element, attrs) { var _this = this; this._element = element; this._scope = scope; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['open', 'close', 'toggle', 'load']); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['modechange', 'preopen', 'preclose', 'postopen', 'postclose'], function (detail) { return detail.side ? angular.extend(detail, { side: _this }) : detail; }); scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingMethods(); this._clearDerivingEvents(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(SplitterSide); $onsen.derivePropertiesFromElement(SplitterSide, ['page', 'mode', 'isOpen', 'onSwipe', 'pageLoader']); return SplitterSide; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('Splitter', ['$onsen', function ($onsen) { var Splitter = Class.extend({ init: function init(scope, element, attrs) { this._element = element; this._scope = scope; this._attrs = attrs; scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(Splitter); $onsen.derivePropertiesFromElement(Splitter, ['onDeviceBackButton']); ['left', 'right', 'side', 'content', 'mask'].forEach(function (prop, i) { Object.defineProperty(Splitter.prototype, prop, { get: function get() { var tagName = 'ons-splitter-' + (i < 3 ? 'side' : prop); return angular.element(this._element[0][prop]).data(tagName); } }); }); return Splitter; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').factory('SwitchView', ['$parse', '$onsen', function ($parse, $onsen) { var SwitchView = Class.extend({ /** * @param {jqLite} element * @param {Object} scope * @param {Object} attrs */ init: function init(element, scope, attrs) { var _this = this; this._element = element; this._checkbox = angular.element(element[0].querySelector('input[type=checkbox]')); this._scope = scope; this._prepareNgModel(element, scope, attrs); this._scope.$on('$destroy', function () { _this.emit('destroy'); _this._element = _this._checkbox = _this._scope = null; }); }, _prepareNgModel: function _prepareNgModel(element, scope, attrs) { var _this2 = this; if (attrs.ngModel) { var set = $parse(attrs.ngModel).assign; scope.$parent.$watch(attrs.ngModel, function (value) { _this2.checked = !!value; }); this._element.on('change', function (e) { set(scope.$parent, _this2.checked); if (attrs.ngChange) { scope.$eval(attrs.ngChange); } scope.$parent.$evalAsync(); }); } } }); MicroEvent.mixin(SwitchView); $onsen.derivePropertiesFromElement(SwitchView, ['disabled', 'checked', 'checkbox', 'value']); return SwitchView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('TabbarView', ['$onsen', function ($onsen) { var TabbarView = Class.extend({ init: function init(scope, element, attrs) { if (element[0].nodeName.toLowerCase() !== 'ons-tabbar') { throw new Error('"element" parameter must be a "ons-tabbar" element.'); } this._scope = scope; this._element = element; this._attrs = attrs; this._scope.$on('$destroy', this._destroy.bind(this)); this._clearDerivingEvents = $onsen.deriveEvents(this, element[0], ['reactive', 'postchange', 'prechange', 'init', 'show', 'hide', 'destroy']); this._clearDerivingMethods = $onsen.deriveMethods(this, element[0], ['setActiveTab', 'show', 'hide', 'setTabbarVisibility', 'getActiveTabIndex']); }, _destroy: function _destroy() { this.emit('destroy'); this._clearDerivingEvents(); this._clearDerivingMethods(); this._element = this._scope = this._attrs = null; } }); MicroEvent.mixin(TabbarView); $onsen.derivePropertiesFromElement(TabbarView, ['visible', 'swipeable', 'onSwipe']); return TabbarView; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); module.factory('ToastView', ['$onsen', function ($onsen) { var ToastView = Class.extend({ /** * @param {Object} scope * @param {jqLite} element * @param {Object} attrs */ init: function init(scope, element, attrs) { this._scope = scope; this._element = element; this._attrs = attrs; this._clearDerivingMethods = $onsen.deriveMethods(this, this._element[0], ['show', 'hide', 'toggle']); this._clearDerivingEvents = $onsen.deriveEvents(this, this._element[0], ['preshow', 'postshow', 'prehide', 'posthide'], function (detail) { if (detail.toast) { detail.toast = this; } return detail; }.bind(this)); this._scope.$on('$destroy', this._destroy.bind(this)); }, _destroy: function _destroy() { this.emit('destroy'); this._element.remove(); this._clearDerivingMethods(); this._clearDerivingEvents(); this._scope = this._attrs = this._element = null; } }); MicroEvent.mixin(ToastView); $onsen.derivePropertiesFromElement(ToastView, ['visible', 'onDeviceBackButton']); return ToastView; }]); })(); (function () { angular.module('onsen').directive('onsActionSheetButton', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-action-sheet-button' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); /** * @element ons-action-sheet */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this action sheet.[/en] * [ja]このアクションシートを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火された際に呼び出されるコールバックを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出されるコールバックを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしlistenerパラメータが指定されなかった場合、そのイベントのリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーの関数オブジェクトを渡します。[/ja] */ (function () { angular.module('onsen').directive('onsActionSheet', ['$onsen', 'ActionSheetView', function ($onsen, ActionSheetView) { return { restrict: 'E', replace: false, scope: true, transclude: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var actionSheet = new ActionSheetView(scope, element, attrs); $onsen.declareVarAttribute(attrs, actionSheet); $onsen.registerEventHandlers(actionSheet, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(actionSheet, element); element.data('ons-action-sheet', actionSheet); scope.$on('$destroy', function () { actionSheet._events = undefined; $onsen.removeModifierMethods(actionSheet); element.data('ons-action-sheet', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /** * @element ons-alert-dialog */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this alert dialog.[/en] * [ja]このアラートダイアログを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火された際に呼び出されるコールバックを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出されるコールバックを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしlistenerパラメータが指定されなかった場合、そのイベントのリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーの関数オブジェクトを渡します。[/ja] */ (function () { angular.module('onsen').directive('onsAlertDialog', ['$onsen', 'AlertDialogView', function ($onsen, AlertDialogView) { return { restrict: 'E', replace: false, scope: true, transclude: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var alertDialog = new AlertDialogView(scope, element, attrs); $onsen.declareVarAttribute(attrs, alertDialog); $onsen.registerEventHandlers(alertDialog, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(alertDialog, element); element.data('ons-alert-dialog', alertDialog); element.data('_scope', scope); scope.$on('$destroy', function () { alertDialog._events = undefined; $onsen.removeModifierMethods(alertDialog); element.data('ons-alert-dialog', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); (function () { var module = angular.module('onsen'); module.directive('onsBackButton', ['$onsen', '$compile', 'GenericView', 'ComponentCleaner', function ($onsen, $compile, GenericView, ComponentCleaner) { return { restrict: 'E', replace: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs, controller, transclude) { var backButton = GenericView.register(scope, element, attrs, { viewKey: 'ons-back-button' }); if (attrs.ngClick) { element[0].onClick = angular.noop; } scope.$on('$destroy', function () { backButton._events = undefined; $onsen.removeModifierMethods(backButton); element = null; }); ComponentCleaner.onDestroy(scope, function () { ComponentCleaner.destroyScope(scope); ComponentCleaner.destroyAttributes(attrs); element = scope = attrs = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); (function () { angular.module('onsen').directive('onsBottomToolbar', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: { pre: function pre(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-bottomToolbar' }); }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } } }; }]); })(); /** * @element ons-button */ (function () { angular.module('onsen').directive('onsButton', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { var button = GenericView.register(scope, element, attrs, { viewKey: 'ons-button' }); Object.defineProperty(button, 'disabled', { get: function get() { return this._element[0].disabled; }, set: function set(value) { return this._element[0].disabled = value; } }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); (function () { angular.module('onsen').directive('onsCard', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-card' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); /** * @element ons-carousel * @description * [en]Carousel component.[/en] * [ja]カルーセルを表示できるコンポーネント。[/ja] * @codepen xbbzOQ * @guide UsingCarousel * [en]Learn how to use the carousel component.[/en] * [ja]carouselコンポーネントの使い方[/ja] * @example * <ons-carousel style="width: 100%; height: 200px"> * <ons-carousel-item> * ... * </ons-carousel-item> * <ons-carousel-item> * ... * </ons-carousel-item> * </ons-carousel> */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this carousel.[/en] * [ja]このカルーセルを参照するための変数名を指定します。[/ja] */ /** * @attribute ons-postchange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postchange" event is fired.[/en] * [ja]"postchange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-refresh * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "refresh" event is fired.[/en] * [ja]"refresh"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-overscroll * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "overscroll" event is fired.[/en] * [ja]"overscroll"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーが指定されなかった場合には、そのイベントに紐付いているイベントリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsCarousel', ['$onsen', 'CarouselView', function ($onsen, CarouselView) { return { restrict: 'E', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. scope: false, transclude: false, compile: function compile(element, attrs) { return function (scope, element, attrs) { var carousel = new CarouselView(scope, element, attrs); element.data('ons-carousel', carousel); $onsen.registerEventHandlers(carousel, 'postchange refresh overscroll destroy'); $onsen.declareVarAttribute(attrs, carousel); scope.$on('$destroy', function () { carousel._events = undefined; element.data('ons-carousel', undefined); element = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); module.directive('onsCarouselItem', ['$onsen', function ($onsen) { return { restrict: 'E', compile: function compile(element, attrs) { return function (scope, element, attrs) { if (scope.$last) { var carousel = $onsen.util.findParent(element[0], 'ons-carousel'); carousel._swiper.init({ swipeable: carousel.hasAttribute('swipeable'), autoRefresh: carousel.hasAttribute('auto-refresh') }); } }; } }; }]); })(); /** * @element ons-checkbox */ (function () { angular.module('onsen').directive('onsCheckbox', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var el = element[0]; var onChange = function onChange() { $parse(attrs.ngModel).assign(scope, el.checked); attrs.ngChange && scope.$eval(attrs.ngChange); scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { return el.checked = value; }); element.on('change', onChange); } scope.$on('$destroy', function () { element.off('change', onChange); scope = element = attrs = el = null; }); } }; }]); })(); /** * @element ons-dialog */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this dialog.[/en] * [ja]このダイアログを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーが指定されなかった場合には、そのイベントに紐付いているイベントリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ (function () { angular.module('onsen').directive('onsDialog', ['$onsen', 'DialogView', function ($onsen, DialogView) { return { restrict: 'E', scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var dialog = new DialogView(scope, element, attrs); $onsen.declareVarAttribute(attrs, dialog); $onsen.registerEventHandlers(dialog, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(dialog, element); element.data('ons-dialog', dialog); scope.$on('$destroy', function () { dialog._events = undefined; $onsen.removeModifierMethods(dialog); element.data('ons-dialog', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); (function () { var module = angular.module('onsen'); module.directive('onsDummyForInit', ['$rootScope', function ($rootScope) { var isReady = false; return { restrict: 'E', replace: false, link: { post: function post(scope, element) { if (!isReady) { isReady = true; $rootScope.$broadcast('$ons-ready'); } element.remove(); } } }; }]); })(); /** * @element ons-fab */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer the floating action button.[/en] * [ja]このフローティングアクションボタンを参照するための変数名をしてします。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsFab', ['$onsen', 'FabView', function ($onsen, FabView) { return { restrict: 'E', replace: false, scope: false, transclude: false, compile: function compile(element, attrs) { return function (scope, element, attrs) { var fab = new FabView(scope, element, attrs); element.data('ons-fab', fab); $onsen.declareVarAttribute(attrs, fab); scope.$on('$destroy', function () { element.data('ons-fab', undefined); element = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); (function () { var EVENTS = ('drag dragleft dragright dragup dragdown hold release swipe swipeleft swiperight ' + 'swipeup swipedown tap doubletap touch transform pinch pinchin pinchout rotate').split(/ +/); angular.module('onsen').directive('onsGestureDetector', ['$onsen', function ($onsen) { var scopeDef = EVENTS.reduce(function (dict, name) { dict['ng' + titlize(name)] = '&'; return dict; }, {}); function titlize(str) { return str.charAt(0).toUpperCase() + str.slice(1); } return { restrict: 'E', scope: scopeDef, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. replace: false, transclude: true, compile: function compile(element, attrs) { return function link(scope, element, attrs, _, transclude) { transclude(scope.$parent, function (cloned) { element.append(cloned); }); var handler = function handler(event) { var attr = 'ng' + titlize(event.type); if (attr in scopeDef) { scope[attr]({ $event: event }); } }; var gestureDetector; setImmediate(function () { gestureDetector = element[0]._gestureDetector; gestureDetector.on(EVENTS.join(' '), handler); }); $onsen.cleaner.onDestroy(scope, function () { gestureDetector.off(EVENTS.join(' '), handler); $onsen.clearComponent({ scope: scope, element: element, attrs: attrs }); gestureDetector.element = scope = element = attrs = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); /** * @element ons-icon */ (function () { angular.module('onsen').directive('onsIcon', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', compile: function compile(element, attrs) { if (attrs.icon.indexOf('{{') !== -1) { attrs.$observe('icon', function () { setImmediate(function () { return element[0]._update(); }); }); } return function (scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-icon' }); // $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); /** * @element ons-if-orientation * @category conditional * @description * [en]Conditionally display content depending on screen orientation. Valid values are portrait and landscape. Different from other components, this component is used as attribute in any element.[/en] * [ja]画面の向きに応じてコンテンツの制御を行います。portraitもしくはlandscapeを指定できます。すべての要素の属性に使用できます。[/ja] * @seealso ons-if-platform [en]ons-if-platform component[/en][ja]ons-if-platformコンポーネント[/ja] * @example * <div ons-if-orientation="portrait"> * <p>This will only be visible in portrait mode.</p> * </div> */ /** * @attribute ons-if-orientation * @initonly * @type {String} * @description * [en]Either "portrait" or "landscape".[/en] * [ja]portraitもしくはlandscapeを指定します。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsIfOrientation', ['$onsen', '$onsGlobal', function ($onsen, $onsGlobal) { return { restrict: 'A', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: false, compile: function compile(element) { element.css('display', 'none'); return function (scope, element, attrs) { attrs.$observe('onsIfOrientation', update); $onsGlobal.orientation.on('change', update); update(); $onsen.cleaner.onDestroy(scope, function () { $onsGlobal.orientation.off('change', update); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = scope = attrs = null; }); function update() { var userOrientation = ('' + attrs.onsIfOrientation).toLowerCase(); var orientation = getLandscapeOrPortrait(); if (userOrientation === 'portrait' || userOrientation === 'landscape') { if (userOrientation === orientation) { element.css('display', ''); } else { element.css('display', 'none'); } } } function getLandscapeOrPortrait() { return $onsGlobal.orientation.isPortrait() ? 'portrait' : 'landscape'; } }; } }; }]); })(); /** * @element ons-if-platform * @category conditional * @description * [en]Conditionally display content depending on the platform / browser. Valid values are "opera", "firefox", "safari", "chrome", "ie", "edge", "android", "blackberry", "ios" and "wp".[/en] * [ja]プラットフォームやブラウザーに応じてコンテンツの制御をおこないます。opera, firefox, safari, chrome, ie, edge, android, blackberry, ios, wpのいずれかの値を空白区切りで複数指定できます。[/ja] * @seealso ons-if-orientation [en]ons-if-orientation component[/en][ja]ons-if-orientationコンポーネント[/ja] * @example * <div ons-if-platform="android"> * ... * </div> */ /** * @attribute ons-if-platform * @type {String} * @initonly * @description * [en]One or multiple space separated values: "opera", "firefox", "safari", "chrome", "ie", "edge", "android", "blackberry", "ios" or "wp".[/en] * [ja]"opera", "firefox", "safari", "chrome", "ie", "edge", "android", "blackberry", "ios", "wp"のいずれか空白区切りで複数指定できます。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsIfPlatform', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: false, compile: function compile(element) { element.css('display', 'none'); var platform = getPlatformString(); return function (scope, element, attrs) { attrs.$observe('onsIfPlatform', function (userPlatform) { if (userPlatform) { update(); } }); update(); $onsen.cleaner.onDestroy(scope, function () { $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = scope = attrs = null; }); function update() { var userPlatforms = attrs.onsIfPlatform.toLowerCase().trim().split(/\s+/); if (userPlatforms.indexOf(platform.toLowerCase()) >= 0) { element.css('display', 'block'); } else { element.css('display', 'none'); } } }; function getPlatformString() { if (navigator.userAgent.match(/Android/i)) { return 'android'; } if (navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/RIM Tablet OS/i) || navigator.userAgent.match(/BB10/i)) { return 'blackberry'; } if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { return 'ios'; } if (navigator.userAgent.match(/Windows Phone|IEMobile|WPDesktop/i)) { return 'wp'; } // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; if (isOpera) { return 'opera'; } var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+ if (isFirefox) { return 'firefox'; } var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; // At least Safari 3+: "[object HTMLElementConstructor]" if (isSafari) { return 'safari'; } var isEdge = navigator.userAgent.indexOf(' Edge/') >= 0; if (isEdge) { return 'edge'; } var isChrome = !!window.chrome && !isOpera && !isEdge; // Chrome 1+ if (isChrome) { return 'chrome'; } var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6 if (isIE) { return 'ie'; } return 'unknown'; } } }; }]); })(); /** * @element ons-input */ (function () { angular.module('onsen').directive('onsInput', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var el = element[0]; var onInput = function onInput() { $parse(attrs.ngModel).assign(scope, el.type === 'number' ? Number(el.value) : el.value); attrs.ngChange && scope.$eval(attrs.ngChange); scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { if (typeof value !== 'undefined' && value !== el.value) { el.value = value; } }); element.on('input', onInput); } scope.$on('$destroy', function () { element.off('input', onInput); scope = element = attrs = el = null; }); } }; }]); })(); /** * @element ons-keyboard-active * @category form * @description * [en] * Conditionally display content depending on if the software keyboard is visible or hidden. * This component requires cordova and that the com.ionic.keyboard plugin is installed. * [/en] * [ja] * ソフトウェアキーボードが表示されているかどうかで、コンテンツを表示するかどうかを切り替えることが出来ます。 * このコンポーネントは、Cordovaやcom.ionic.keyboardプラグインを必要とします。 * [/ja] * @example * <div ons-keyboard-active> * This will only be displayed if the software keyboard is open. * </div> * <div ons-keyboard-inactive> * There is also a component that does the opposite. * </div> */ /** * @attribute ons-keyboard-active * @description * [en]The content of tags with this attribute will be visible when the software keyboard is open.[/en] * [ja]この属性がついた要素は、ソフトウェアキーボードが表示された時に初めて表示されます。[/ja] */ /** * @attribute ons-keyboard-inactive * @description * [en]The content of tags with this attribute will be visible when the software keyboard is hidden.[/en] * [ja]この属性がついた要素は、ソフトウェアキーボードが隠れている時のみ表示されます。[/ja] */ (function () { var module = angular.module('onsen'); var compileFunction = function compileFunction(show, $onsen) { return function (element) { return function (scope, element, attrs) { var dispShow = show ? 'block' : 'none', dispHide = show ? 'none' : 'block'; var onShow = function onShow() { element.css('display', dispShow); }; var onHide = function onHide() { element.css('display', dispHide); }; var onInit = function onInit(e) { if (e.visible) { onShow(); } else { onHide(); } }; ons.softwareKeyboard.on('show', onShow); ons.softwareKeyboard.on('hide', onHide); ons.softwareKeyboard.on('init', onInit); if (ons.softwareKeyboard._visible) { onShow(); } else { onHide(); } $onsen.cleaner.onDestroy(scope, function () { ons.softwareKeyboard.off('show', onShow); ons.softwareKeyboard.off('hide', onHide); ons.softwareKeyboard.off('init', onInit); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = scope = attrs = null; }); }; }; }; module.directive('onsKeyboardActive', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, transclude: false, scope: false, compile: compileFunction(true, $onsen) }; }]); module.directive('onsKeyboardInactive', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, transclude: false, scope: false, compile: compileFunction(false, $onsen) }; }]); })(); /** * @element ons-lazy-repeat * @description * [en] * Using this component a list with millions of items can be rendered without a drop in performance. * It does that by "lazily" loading elements into the DOM when they come into view and * removing items from the DOM when they are not visible. * [/en] * [ja] * このコンポーネント内で描画されるアイテムのDOM要素の読み込みは、画面に見えそうになった時まで自動的に遅延され、 * 画面から見えなくなった場合にはその要素は動的にアンロードされます。 * このコンポーネントを使うことで、パフォーマンスを劣化させること無しに巨大な数の要素を描画できます。 * [/ja] * @codepen QwrGBm * @guide UsingLazyRepeat * [en]How to use Lazy Repeat[/en] * [ja]レイジーリピートの使い方[/ja] * @example * <script> * ons.bootstrap() * * .controller('MyController', function($scope) { * $scope.MyDelegate = { * countItems: function() { * // Return number of items. * return 1000000; * }, * * calculateItemHeight: function(index) { * // Return the height of an item in pixels. * return 45; * }, * * configureItemScope: function(index, itemScope) { * // Initialize scope * itemScope.item = 'Item #' + (index + 1); * }, * * destroyItemScope: function(index, itemScope) { * // Optional method that is called when an item is unloaded. * console.log('Destroyed item with index: ' + index); * } * }; * }); * </script> * * <ons-list ng-controller="MyController"> * <ons-list-item ons-lazy-repeat="MyDelegate"> * {{ item }} * </ons-list-item> * </ons-list> */ /** * @attribute ons-lazy-repeat * @type {Expression} * @initonly * @description * [en]A delegate object, can be either an object attached to the scope (when using AngularJS) or a normal JavaScript variable.[/en] * [ja]要素のロード、アンロードなどの処理を委譲するオブジェクトを指定します。AngularJSのスコープの変数名や、通常のJavaScriptの変数名を指定します。[/ja] */ /** * @property delegate.configureItemScope * @type {Function} * @description * [en]Function which recieves an index and the scope for the item. Can be used to configure values in the item scope.[/en] * [ja][/ja] */ (function () { var module = angular.module('onsen'); /** * Lazy repeat directive. */ module.directive('onsLazyRepeat', ['$onsen', 'LazyRepeatView', function ($onsen, LazyRepeatView) { return { restrict: 'A', replace: false, priority: 1000, terminal: true, compile: function compile(element, attrs) { return function (scope, element, attrs) { var lazyRepeat = new LazyRepeatView(scope, element, attrs); scope.$on('$destroy', function () { scope = element = attrs = lazyRepeat = null; }); }; } }; }]); })(); (function () { angular.module('onsen').directive('onsListHeader', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-list-header' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); (function () { angular.module('onsen').directive('onsListItem', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-list-item' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); (function () { angular.module('onsen').directive('onsList', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-list' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); (function () { angular.module('onsen').directive('onsListTitle', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-list-title' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); /** * @element ons-loading-placeholder * @category util * @description * [en]Display a placeholder while the content is loading.[/en] * [ja]Onsen UIが読み込まれるまでに表示するプレースホルダーを表現します。[/ja] * @example * <div ons-loading-placeholder="page.html"> * Loading... * </div> */ /** * @attribute ons-loading-placeholder * @initonly * @type {String} * @description * [en]The url of the page to load.[/en] * [ja]読み込むページのURLを指定します。[/ja] */ (function () { angular.module('onsen').directive('onsLoadingPlaceholder', function () { return { restrict: 'A', link: function link(scope, element, attrs) { if (attrs.onsLoadingPlaceholder) { ons._resolveLoadingPlaceholder(element[0], attrs.onsLoadingPlaceholder, function (contentElement, done) { ons.compile(contentElement); scope.$evalAsync(function () { setImmediate(done); }); }); } } }; }); })(); /** * @element ons-modal */ /** * @attribute var * @type {String} * @initonly * @description * [en]Variable name to refer this modal.[/en] * [ja]このモーダルを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { angular.module('onsen').directive('onsModal', ['$onsen', 'ModalView', function ($onsen, ModalView) { return { restrict: 'E', replace: false, // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. scope: false, transclude: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var modal = new ModalView(scope, element, attrs); $onsen.addModifierMethodsForCustomElements(modal, element); $onsen.declareVarAttribute(attrs, modal); $onsen.registerEventHandlers(modal, 'preshow prehide postshow posthide destroy'); element.data('ons-modal', modal); scope.$on('$destroy', function () { $onsen.removeModifierMethods(modal); element.data('ons-modal', undefined); modal = element = scope = attrs = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /** * @element ons-navigator * @example * <ons-navigator animation="slide" var="app.navi"> * <ons-page> * <ons-toolbar> * <div class="center">Title</div> * </ons-toolbar> * * <p style="text-align: center"> * <ons-button modifier="light" ng-click="app.navi.pushPage('page.html');">Push</ons-button> * </p> * </ons-page> * </ons-navigator> * * <ons-template id="page.html"> * <ons-page> * <ons-toolbar> * <div class="center">Title</div> * </ons-toolbar> * * <p style="text-align: center"> * <ons-button modifier="light" ng-click="app.navi.popPage();">Pop</ons-button> * </p> * </ons-page> * </ons-template> */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this navigator.[/en] * [ja]このナビゲーターを参照するための名前を指定します。[/ja] */ /** * @attribute ons-prepush * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prepush" event is fired.[/en] * [ja]"prepush"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prepop * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prepop" event is fired.[/en] * [ja]"prepop"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postpush * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postpush" event is fired.[/en] * [ja]"postpush"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postpop * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postpop" event is fired.[/en] * [ja]"postpop"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "init" event is fired.[/en] * [ja]ページの"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "show" event is fired.[/en] * [ja]ページの"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "hide" event is fired.[/en] * [ja]ページの"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "destroy" event is fired.[/en] * [ja]ページの"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { var lastReady = window.ons.elements.Navigator.rewritables.ready; window.ons.elements.Navigator.rewritables.ready = ons._waitDiretiveInit('ons-navigator', lastReady); angular.module('onsen').directive('onsNavigator', ['NavigatorView', '$onsen', function (NavigatorView, $onsen) { return { restrict: 'E', // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: true, compile: function compile(element) { return { pre: function pre(scope, element, attrs, controller) { var view = new NavigatorView(scope, element, attrs); $onsen.declareVarAttribute(attrs, view); $onsen.registerEventHandlers(view, 'prepush prepop postpush postpop init show hide destroy'); element.data('ons-navigator', view); element[0].pageLoader = $onsen.createPageLoader(view); scope.$on('$destroy', function () { view._events = undefined; element.data('ons-navigator', undefined); scope = element = null; }); }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /** * @element ons-page */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this page.[/en] * [ja]このページを参照するための名前を指定します。[/ja] */ /** * @attribute ng-infinite-scroll * @initonly * @type {String} * @description * [en]Path of the function to be executed on infinite scrolling. The path is relative to $scope. The function receives a done callback that must be called when it's finished.[/en] * [ja][/ja] */ /** * @attribute on-device-back-button * @type {Expression} * @description * [en]Allows you to specify custom behavior when the back button is pressed.[/en] * [ja]デバイスのバックボタンが押された時の挙動を設定できます。[/ja] */ /** * @attribute ng-device-back-button * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior with an AngularJS expression when the back button is pressed.[/en] * [ja]デバイスのバックボタンが押された時の挙動を設定できます。AngularJSのexpressionを指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "init" event is fired.[/en] * [ja]"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "show" event is fired.[/en] * [ja]"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "hide" event is fired.[/en] * [ja]"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsPage', ['$onsen', 'PageView', function ($onsen, PageView) { function firePageInitEvent(element) { // TODO: remove dirty fix var i = 0, f = function f() { if (i++ < 15) { if (isAttached(element)) { $onsen.fireComponentEvent(element, 'init'); fireActualPageInitEvent(element); } else { if (i > 10) { setTimeout(f, 1000 / 60); } else { setImmediate(f); } } } else { throw new Error('Fail to fire "pageinit" event. Attach "ons-page" element to the document after initialization.'); } }; f(); } function fireActualPageInitEvent(element) { var event = document.createEvent('HTMLEvents'); event.initEvent('pageinit', true, true); element.dispatchEvent(event); } function isAttached(element) { if (document.documentElement === element) { return true; } return element.parentNode ? isAttached(element.parentNode) : false; } return { restrict: 'E', // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. transclude: false, scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var page = new PageView(scope, element, attrs); $onsen.declareVarAttribute(attrs, page); $onsen.registerEventHandlers(page, 'init show hide destroy'); element.data('ons-page', page); $onsen.addModifierMethodsForCustomElements(page, element); element.data('_scope', scope); $onsen.cleaner.onDestroy(scope, function () { page._events = undefined; $onsen.removeModifierMethods(page); element.data('ons-page', undefined); element.data('_scope', undefined); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); scope = element = attrs = null; }); }, post: function postLink(scope, element, attrs) { firePageInitEvent(element[0]); } }; } }; }]); })(); /** * @element ons-popover */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this popover.[/en] * [ja]このポップオーバーを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsPopover', ['$onsen', 'PopoverView', function ($onsen, PopoverView) { return { restrict: 'E', replace: false, scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var popover = new PopoverView(scope, element, attrs); $onsen.declareVarAttribute(attrs, popover); $onsen.registerEventHandlers(popover, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(popover, element); element.data('ons-popover', popover); scope.$on('$destroy', function () { popover._events = undefined; $onsen.removeModifierMethods(popover); element.data('ons-popover', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /** * @element ons-pull-hook * @example * <script> * ons.bootstrap() * * .controller('MyController', function($scope, $timeout) { * $scope.items = [3, 2 ,1]; * * $scope.load = function($done) { * $timeout(function() { * $scope.items.unshift($scope.items.length + 1); * $done(); * }, 1000); * }; * }); * </script> * * <ons-page ng-controller="MyController"> * <ons-pull-hook var="loader" ng-action="load($done)"> * <span ng-switch="loader.state"> * <span ng-switch-when="initial">Pull down to refresh</span> * <span ng-switch-when="preaction">Release to refresh</span> * <span ng-switch-when="action">Loading data. Please wait...</span> * </span> * </ons-pull-hook> * <ons-list> * <ons-list-item ng-repeat="item in items"> * Item #{{ item }} * </ons-list-item> * </ons-list> * </ons-page> */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this component.[/en] * [ja]このコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute ng-action * @initonly * @type {Expression} * @description * [en]Use to specify custom behavior when the page is pulled down. A <code>$done</code> function is available to tell the component that the action is completed.[/en] * [ja]pull downしたときの振る舞いを指定します。アクションが完了した時には<code>$done</code>関数を呼び出します。[/ja] */ /** * @attribute ons-changestate * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "changestate" event is fired.[/en] * [ja]"changestate"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { angular.module('onsen').directive('onsPullHook', ['$onsen', 'PullHookView', function ($onsen, PullHookView) { return { restrict: 'E', replace: false, scope: true, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var pullHook = new PullHookView(scope, element, attrs); $onsen.declareVarAttribute(attrs, pullHook); $onsen.registerEventHandlers(pullHook, 'changestate destroy'); element.data('ons-pull-hook', pullHook); scope.$on('$destroy', function () { pullHook._events = undefined; element.data('ons-pull-hook', undefined); scope = element = attrs = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /** * @element ons-radio */ (function () { angular.module('onsen').directive('onsRadio', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var el = element[0]; var onChange = function onChange() { $parse(attrs.ngModel).assign(scope, el.value); attrs.ngChange && scope.$eval(attrs.ngChange); scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { return el.checked = value === el.value; }); element.on('change', onChange); } scope.$on('$destroy', function () { element.off('change', onChange); scope = element = attrs = el = null; }); } }; }]); })(); (function () { angular.module('onsen').directive('onsRange', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var onInput = function onInput() { var set = $parse(attrs.ngModel).assign; set(scope, element[0].value); if (attrs.ngChange) { scope.$eval(attrs.ngChange); } scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { element[0].value = value; }); element.on('input', onInput); } scope.$on('$destroy', function () { element.off('input', onInput); scope = element = attrs = null; }); } }; }]); })(); (function () { angular.module('onsen').directive('onsRipple', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { GenericView.register(scope, element, attrs, { viewKey: 'ons-ripple' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); /** * @element ons-scope * @category util * @description * [en]All child elements using the "var" attribute will be attached to the scope of this element.[/en] * [ja]"var"属性を使っている全ての子要素のviewオブジェクトは、この要素のAngularJSスコープに追加されます。[/ja] * @example * <ons-list> * <ons-list-item ons-scope ng-repeat="item in items"> * <ons-carousel var="carousel"> * <ons-carousel-item ng-click="carousel.next()"> * {{ item }} * </ons-carousel-item> * </ons-carousel-item ng-click="carousel.prev()"> * ... * </ons-carousel-item> * </ons-carousel> * </ons-list-item> * </ons-list> */ (function () { var module = angular.module('onsen'); module.directive('onsScope', ['$onsen', function ($onsen) { return { restrict: 'A', replace: false, transclude: false, scope: false, link: function link(scope, element) { element.data('_scope', scope); scope.$on('$destroy', function () { element.data('_scope', undefined); }); } }; }]); })(); /** * @element ons-search-input */ (function () { angular.module('onsen').directive('onsSearchInput', ['$parse', function ($parse) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var el = element[0]; var onInput = function onInput() { $parse(attrs.ngModel).assign(scope, el.type === 'number' ? Number(el.value) : el.value); attrs.ngChange && scope.$eval(attrs.ngChange); scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { if (typeof value !== 'undefined' && value !== el.value) { el.value = value; } }); element.on('input', onInput); } scope.$on('$destroy', function () { element.off('input', onInput); scope = element = attrs = el = null; }); } }; }]); })(); /** * @element ons-segment */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this segment.[/en] * [ja]このタブバーを参照するための名前を指定します。[/ja] */ /** * @attribute ons-postchange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postchange" event is fired.[/en] * [ja]"postchange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { angular.module('onsen').directive('onsSegment', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { var view = GenericView.register(scope, element, attrs, { viewKey: 'ons-segment' }); $onsen.fireComponentEvent(element[0], 'init'); $onsen.registerEventHandlers(view, 'postchange'); } }; }]); })(); /** * @element ons-select */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { angular.module('onsen').directive('onsSelect', ['$parse', '$onsen', 'GenericView', function ($parse, $onsen, GenericView) { return { restrict: 'E', replace: false, scope: false, link: function link(scope, element, attrs) { var onInput = function onInput() { var set = $parse(attrs.ngModel).assign; set(scope, element[0].value); if (attrs.ngChange) { scope.$eval(attrs.ngChange); } scope.$parent.$evalAsync(); }; if (attrs.ngModel) { scope.$watch(attrs.ngModel, function (value) { element[0].value = value; }); element.on('input', onInput); } scope.$on('$destroy', function () { element.off('input', onInput); scope = element = attrs = null; }); GenericView.register(scope, element, attrs, { viewKey: 'ons-select' }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); /** * @element ons-speed-dial */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer the speed dial.[/en] * [ja]このスピードダイアルを参照するための変数名をしてします。[/ja] */ /** * @attribute ons-open * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "open" event is fired.[/en] * [ja]"open"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-close * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "close" event is fired.[/en] * [ja]"close"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーが指定されなかった場合には、そのイベントに紐付いているイベントリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsSpeedDial', ['$onsen', 'SpeedDialView', function ($onsen, SpeedDialView) { return { restrict: 'E', replace: false, scope: false, transclude: false, compile: function compile(element, attrs) { return function (scope, element, attrs) { var speedDial = new SpeedDialView(scope, element, attrs); element.data('ons-speed-dial', speedDial); $onsen.registerEventHandlers(speedDial, 'open close'); $onsen.declareVarAttribute(attrs, speedDial); scope.$on('$destroy', function () { speedDial._events = undefined; element.data('ons-speed-dial', undefined); element = null; }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); /** * @element ons-splitter-content */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this splitter content.[/en] * [ja]このスプリッターコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { var lastReady = window.ons.elements.SplitterContent.rewritables.ready; window.ons.elements.SplitterContent.rewritables.ready = ons._waitDiretiveInit('ons-splitter-content', lastReady); angular.module('onsen').directive('onsSplitterContent', ['$compile', 'SplitterContent', '$onsen', function ($compile, SplitterContent, $onsen) { return { restrict: 'E', compile: function compile(element, attrs) { return function (scope, element, attrs) { var view = new SplitterContent(scope, element, attrs); $onsen.declareVarAttribute(attrs, view); $onsen.registerEventHandlers(view, 'destroy'); element.data('ons-splitter-content', view); element[0].pageLoader = $onsen.createPageLoader(view); scope.$on('$destroy', function () { view._events = undefined; element.data('ons-splitter-content', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); /** * @element ons-splitter-side */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this splitter side.[/en] * [ja]このスプリッターコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-preopen * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preopen" event is fired.[/en] * [ja]"preopen"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-preclose * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preclose" event is fired.[/en] * [ja]"preclose"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postopen * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postopen" event is fired.[/en] * [ja]"postopen"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postclose * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postclose" event is fired.[/en] * [ja]"postclose"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-modechange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "modechange" event is fired.[/en] * [ja]"modechange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ (function () { var lastReady = window.ons.elements.SplitterSide.rewritables.ready; window.ons.elements.SplitterSide.rewritables.ready = ons._waitDiretiveInit('ons-splitter-side', lastReady); angular.module('onsen').directive('onsSplitterSide', ['$compile', 'SplitterSide', '$onsen', function ($compile, SplitterSide, $onsen) { return { restrict: 'E', compile: function compile(element, attrs) { return function (scope, element, attrs) { var view = new SplitterSide(scope, element, attrs); $onsen.declareVarAttribute(attrs, view); $onsen.registerEventHandlers(view, 'destroy preopen preclose postopen postclose modechange'); element.data('ons-splitter-side', view); element[0].pageLoader = $onsen.createPageLoader(view); scope.$on('$destroy', function () { view._events = undefined; element.data('ons-splitter-side', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); /** * @element ons-splitter */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this splitter.[/en] * [ja]このスプリッターコンポーネントを参照するための名前を指定します。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { angular.module('onsen').directive('onsSplitter', ['$compile', 'Splitter', '$onsen', function ($compile, Splitter, $onsen) { return { restrict: 'E', scope: true, compile: function compile(element, attrs) { return function (scope, element, attrs) { var splitter = new Splitter(scope, element, attrs); $onsen.declareVarAttribute(attrs, splitter); $onsen.registerEventHandlers(splitter, 'destroy'); element.data('ons-splitter', splitter); scope.$on('$destroy', function () { splitter._events = undefined; element.data('ons-splitter', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); }; } }; }]); })(); /** * @element ons-switch */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this switch.[/en] * [ja]JavaScriptから参照するための変数名を指定します。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { angular.module('onsen').directive('onsSwitch', ['$onsen', 'SwitchView', function ($onsen, SwitchView) { return { restrict: 'E', replace: false, scope: true, link: function link(scope, element, attrs) { if (attrs.ngController) { throw new Error('This element can\'t accept ng-controller directive.'); } var switchView = new SwitchView(element, scope, attrs); $onsen.addModifierMethodsForCustomElements(switchView, element); $onsen.declareVarAttribute(attrs, switchView); element.data('ons-switch', switchView); $onsen.cleaner.onDestroy(scope, function () { switchView._events = undefined; $onsen.removeModifierMethods(switchView); element.data('ons-switch', undefined); $onsen.clearComponent({ element: element, scope: scope, attrs: attrs }); element = attrs = scope = null; }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); /** * @element ons-tabbar */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this tab bar.[/en] * [ja]このタブバーを参照するための名前を指定します。[/ja] */ /** * @attribute ons-reactive * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "reactive" event is fired.[/en] * [ja]"reactive"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prechange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prechange" event is fired.[/en] * [ja]"prechange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postchange * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postchange" event is fired.[/en] * [ja]"postchange"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-init * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "init" event is fired.[/en] * [ja]ページの"init"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-show * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "show" event is fired.[/en] * [ja]ページの"show"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-hide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "hide" event is fired.[/en] * [ja]ページの"hide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when a page's "destroy" event is fired.[/en] * [ja]ページの"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]このイベントが発火された際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出される関数オブジェクトを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしイベントリスナーを指定しなかった場合には、そのイベントに紐づく全てのイベントリスナーが削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーを指定します。[/ja] */ (function () { var lastReady = window.ons.elements.Tabbar.rewritables.ready; window.ons.elements.Tabbar.rewritables.ready = ons._waitDiretiveInit('ons-tabbar', lastReady); angular.module('onsen').directive('onsTabbar', ['$onsen', '$compile', '$parse', 'TabbarView', function ($onsen, $compile, $parse, TabbarView) { return { restrict: 'E', replace: false, scope: true, link: function link(scope, element, attrs, controller) { var tabbarView = new TabbarView(scope, element, attrs); $onsen.addModifierMethodsForCustomElements(tabbarView, element); $onsen.registerEventHandlers(tabbarView, 'reactive prechange postchange init show hide destroy'); element.data('ons-tabbar', tabbarView); $onsen.declareVarAttribute(attrs, tabbarView); scope.$on('$destroy', function () { tabbarView._events = undefined; $onsen.removeModifierMethods(tabbarView); element.data('ons-tabbar', undefined); }); $onsen.fireComponentEvent(element[0], 'init'); } }; }]); })(); (function () { tab.$inject = ['$onsen', 'GenericView']; angular.module('onsen').directive('onsTab', tab).directive('onsTabbarItem', tab); // for BC function tab($onsen, GenericView) { return { restrict: 'E', link: function link(scope, element, attrs) { var view = GenericView.register(scope, element, attrs, { viewKey: 'ons-tab' }); element[0].pageLoader = $onsen.createPageLoader(view); $onsen.fireComponentEvent(element[0], 'init'); } }; } })(); (function () { angular.module('onsen').directive('onsTemplate', ['$templateCache', function ($templateCache) { return { restrict: 'E', terminal: true, compile: function compile(element) { var content = element[0].template || element.html(); $templateCache.put(element.attr('id'), content); } }; }]); })(); /** * @element ons-toast */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this toast dialog.[/en] * [ja]このトーストを参照するための名前を指定します。[/ja] */ /** * @attribute ons-preshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "preshow" event is fired.[/en] * [ja]"preshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-prehide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "prehide" event is fired.[/en] * [ja]"prehide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-postshow * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "postshow" event is fired.[/en] * [ja]"postshow"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-posthide * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "posthide" event is fired.[/en] * [ja]"posthide"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @attribute ons-destroy * @initonly * @type {Expression} * @description * [en]Allows you to specify custom behavior when the "destroy" event is fired.[/en] * [ja]"destroy"イベントが発火された時の挙動を独自に指定できます。[/ja] */ /** * @method on * @signature on(eventName, listener) * @description * [en]Add an event listener.[/en] * [ja]イベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火された際に呼び出されるコールバックを指定します。[/ja] */ /** * @method once * @signature once(eventName, listener) * @description * [en]Add an event listener that's only triggered once.[/en] * [ja]一度だけ呼び出されるイベントリスナーを追加します。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]イベントが発火した際に呼び出されるコールバックを指定します。[/ja] */ /** * @method off * @signature off(eventName, [listener]) * @description * [en]Remove an event listener. If the listener is not specified all listeners for the event type will be removed.[/en] * [ja]イベントリスナーを削除します。もしlistenerパラメータが指定されなかった場合、そのイベントのリスナーが全て削除されます。[/ja] * @param {String} eventName * [en]Name of the event.[/en] * [ja]イベント名を指定します。[/ja] * @param {Function} listener * [en]Function to execute when the event is triggered.[/en] * [ja]削除するイベントリスナーの関数オブジェクトを渡します。[/ja] */ (function () { angular.module('onsen').directive('onsToast', ['$onsen', 'ToastView', function ($onsen, ToastView) { return { restrict: 'E', replace: false, scope: true, transclude: false, compile: function compile(element, attrs) { return { pre: function pre(scope, element, attrs) { var toast = new ToastView(scope, element, attrs); $onsen.declareVarAttribute(attrs, toast); $onsen.registerEventHandlers(toast, 'preshow prehide postshow posthide destroy'); $onsen.addModifierMethodsForCustomElements(toast, element); element.data('ons-toast', toast); element.data('_scope', scope); scope.$on('$destroy', function () { toast._events = undefined; $onsen.removeModifierMethods(toast); element.data('ons-toast', undefined); element = null; }); }, post: function post(scope, element) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /** * @element ons-toolbar-button */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this button.[/en] * [ja]このボタンを参照するための名前を指定します。[/ja] */ (function () { var module = angular.module('onsen'); module.directive('onsToolbarButton', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', scope: false, link: { pre: function pre(scope, element, attrs) { var toolbarButton = new GenericView(scope, element, attrs); element.data('ons-toolbar-button', toolbarButton); $onsen.declareVarAttribute(attrs, toolbarButton); $onsen.addModifierMethodsForCustomElements(toolbarButton, element); $onsen.cleaner.onDestroy(scope, function () { toolbarButton._events = undefined; $onsen.removeModifierMethods(toolbarButton); element.data('ons-toolbar-button', undefined); element = null; $onsen.clearComponent({ scope: scope, attrs: attrs, element: element }); scope = element = attrs = null; }); }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } } }; }]); })(); /** * @element ons-toolbar */ /** * @attribute var * @initonly * @type {String} * @description * [en]Variable name to refer this toolbar.[/en] * [ja]このツールバーを参照するための名前を指定します。[/ja] */ (function () { angular.module('onsen').directive('onsToolbar', ['$onsen', 'GenericView', function ($onsen, GenericView) { return { restrict: 'E', // NOTE: This element must coexists with ng-controller. // Do not use isolated scope and template's ng-transclude. scope: false, transclude: false, compile: function compile(element) { return { pre: function pre(scope, element, attrs) { // TODO: Remove this dirty fix! if (element[0].nodeName === 'ons-toolbar') { GenericView.register(scope, element, attrs, { viewKey: 'ons-toolbar' }); } }, post: function post(scope, element, attrs) { $onsen.fireComponentEvent(element[0], 'init'); } }; } }; }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); /** * Internal service class for framework implementation. */ module.factory('$onsen', ['$rootScope', '$window', '$cacheFactory', '$document', '$templateCache', '$http', '$q', '$compile', '$onsGlobal', 'ComponentCleaner', function ($rootScope, $window, $cacheFactory, $document, $templateCache, $http, $q, $compile, $onsGlobal, ComponentCleaner) { var $onsen = createOnsenService(); var ModifierUtil = $onsGlobal._internal.ModifierUtil; return $onsen; function createOnsenService() { return { DIRECTIVE_TEMPLATE_URL: 'templates', cleaner: ComponentCleaner, util: $onsGlobal._util, DeviceBackButtonHandler: $onsGlobal._internal.dbbDispatcher, _defaultDeviceBackButtonHandler: $onsGlobal._defaultDeviceBackButtonHandler, /** * @return {Object} */ getDefaultDeviceBackButtonHandler: function getDefaultDeviceBackButtonHandler() { return this._defaultDeviceBackButtonHandler; }, /** * @param {Object} view * @param {Element} element * @param {Array} methodNames * @return {Function} A function that dispose all driving methods. */ deriveMethods: function deriveMethods(view, element, methodNames) { methodNames.forEach(function (methodName) { view[methodName] = function () { return element[methodName].apply(element, arguments); }; }); return function () { methodNames.forEach(function (methodName) { view[methodName] = null; }); view = element = null; }; }, /** * @param {Class} klass * @param {Array} properties */ derivePropertiesFromElement: function derivePropertiesFromElement(klass, properties) { properties.forEach(function (property) { Object.defineProperty(klass.prototype, property, { get: function get() { return this._element[0][property]; }, set: function set(value) { return this._element[0][property] = value; // eslint-disable-line no-return-assign } }); }); }, /** * @param {Object} view * @param {Element} element * @param {Array} eventNames * @param {Function} [map] * @return {Function} A function that clear all event listeners */ deriveEvents: function deriveEvents(view, element, eventNames, map) { map = map || function (detail) { return detail; }; eventNames = [].concat(eventNames); var listeners = []; eventNames.forEach(function (eventName) { var listener = function listener(event) { map(event.detail || {}); view.emit(eventName, event); }; listeners.push(listener); element.addEventListener(eventName, listener, false); }); return function () { eventNames.forEach(function (eventName, index) { element.removeEventListener(eventName, listeners[index], false); }); view = element = listeners = map = null; }; }, /** * @return {Boolean} */ isEnabledAutoStatusBarFill: function isEnabledAutoStatusBarFill() { return !!$onsGlobal._config.autoStatusBarFill; }, /** * @return {Boolean} */ shouldFillStatusBar: $onsGlobal.shouldFillStatusBar, /** * @param {Function} action */ autoStatusBarFill: $onsGlobal.autoStatusBarFill, /** * @param {Object} directive * @param {HTMLElement} pageElement * @param {Function} callback */ compileAndLink: function compileAndLink(view, pageElement, callback) { var link = $compile(pageElement); var pageScope = view._scope.$new(); /** * Overwrite page scope. */ angular.element(pageElement).data('_scope', pageScope); pageScope.$evalAsync(function () { callback(pageElement); // Attach and prepare link(pageScope); // Run the controller }); }, /** * @param {Object} view * @return {Object} pageLoader */ createPageLoader: function createPageLoader(view) { var _this = this; return new $onsGlobal.PageLoader(function (_ref, done) { var page = _ref.page, parent = _ref.parent; $onsGlobal._internal.getPageHTMLAsync(page).then(function (html) { _this.compileAndLink(view, $onsGlobal._util.createElement(html), function (element) { return done(parent.appendChild(element)); }); }); }, function (element) { element._destroy(); if (angular.element(element).data('_scope')) { angular.element(element).data('_scope').$destroy(); } }); }, /** * @param {Object} params * @param {Scope} [params.scope] * @param {jqLite} [params.element] * @param {Array} [params.elements] * @param {Attributes} [params.attrs] */ clearComponent: function clearComponent(params) { if (params.scope) { ComponentCleaner.destroyScope(params.scope); } if (params.attrs) { ComponentCleaner.destroyAttributes(params.attrs); } if (params.element) { ComponentCleaner.destroyElement(params.element); } if (params.elements) { params.elements.forEach(function (element) { ComponentCleaner.destroyElement(element); }); } }, /** * @param {jqLite} element * @param {String} name */ findElementeObject: function findElementeObject(element, name) { return element.inheritedData(name); }, /** * @param {String} page * @return {Promise} */ getPageHTMLAsync: function getPageHTMLAsync(page) { var cache = $templateCache.get(page); if (cache) { var deferred = $q.defer(); var html = typeof cache === 'string' ? cache : cache[1]; deferred.resolve(this.normalizePageHTML(html)); return deferred.promise; } else { return $http({ url: page, method: 'GET' }).then(function (response) { var html = response.data; return this.normalizePageHTML(html); }.bind(this)); } }, /** * @param {String} html * @return {String} */ normalizePageHTML: function normalizePageHTML(html) { html = ('' + html).trim(); if (!html.match(/^<ons-page/)) { html = '<ons-page _muted>' + html + '</ons-page>'; } return html; }, /** * Create modifier templater function. The modifier templater generate css classes bound modifier name. * * @param {Object} attrs * @param {Array} [modifiers] an array of appendix modifier * @return {Function} */ generateModifierTemplater: function generateModifierTemplater(attrs, modifiers) { var attrModifiers = attrs && typeof attrs.modifier === 'string' ? attrs.modifier.trim().split(/ +/) : []; modifiers = angular.isArray(modifiers) ? attrModifiers.concat(modifiers) : attrModifiers; /** * @return {String} template eg. 'ons-button--*', 'ons-button--*__item' * @return {String} */ return function (template) { return modifiers.map(function (modifier) { return template.replace('*', modifier); }).join(' '); }; }, /** * Add modifier methods to view object for custom elements. * * @param {Object} view object * @param {jqLite} element */ addModifierMethodsForCustomElements: function addModifierMethodsForCustomElements(view, element) { var methods = { hasModifier: function hasModifier(needle) { var tokens = ModifierUtil.split(element.attr('modifier')); needle = typeof needle === 'string' ? needle.trim() : ''; return ModifierUtil.split(needle).some(function (needle) { return tokens.indexOf(needle) != -1; }); }, removeModifier: function removeModifier(needle) { needle = typeof needle === 'string' ? needle.trim() : ''; var modifier = ModifierUtil.split(element.attr('modifier')).filter(function (token) { return token !== needle; }).join(' '); element.attr('modifier', modifier); }, addModifier: function addModifier(modifier) { element.attr('modifier', element.attr('modifier') + ' ' + modifier); }, setModifier: function setModifier(modifier) { element.attr('modifier', modifier); }, toggleModifier: function toggleModifier(modifier) { if (this.hasModifier(modifier)) { this.removeModifier(modifier); } else { this.addModifier(modifier); } } }; for (var method in methods) { if (methods.hasOwnProperty(method)) { view[method] = methods[method]; } } }, /** * Add modifier methods to view object. * * @param {Object} view object * @param {String} template * @param {jqLite} element */ addModifierMethods: function addModifierMethods(view, template, element) { var _tr = function _tr(modifier) { return template.replace('*', modifier); }; var fns = { hasModifier: function hasModifier(modifier) { return element.hasClass(_tr(modifier)); }, removeModifier: function removeModifier(modifier) { element.removeClass(_tr(modifier)); }, addModifier: function addModifier(modifier) { element.addClass(_tr(modifier)); }, setModifier: function setModifier(modifier) { var classes = element.attr('class').split(/\s+/), patt = template.replace('*', '.'); for (var i = 0; i < classes.length; i++) { var cls = classes[i]; if (cls.match(patt)) { element.removeClass(cls); } } element.addClass(_tr(modifier)); }, toggleModifier: function toggleModifier(modifier) { var cls = _tr(modifier); if (element.hasClass(cls)) { element.removeClass(cls); } else { element.addClass(cls); } } }; var append = function append(oldFn, newFn) { if (typeof oldFn !== 'undefined') { return function () { return oldFn.apply(null, arguments) || newFn.apply(null, arguments); }; } else { return newFn; } }; view.hasModifier = append(view.hasModifier, fns.hasModifier); view.removeModifier = append(view.removeModifier, fns.removeModifier); view.addModifier = append(view.addModifier, fns.addModifier); view.setModifier = append(view.setModifier, fns.setModifier); view.toggleModifier = append(view.toggleModifier, fns.toggleModifier); }, /** * Remove modifier methods. * * @param {Object} view object */ removeModifierMethods: function removeModifierMethods(view) { view.hasModifier = view.removeModifier = view.addModifier = view.setModifier = view.toggleModifier = undefined; }, /** * Define a variable to JavaScript global scope and AngularJS scope as 'var' attribute name. * * @param {Object} attrs * @param object */ declareVarAttribute: function declareVarAttribute(attrs, object) { if (typeof attrs.var === 'string') { var varName = attrs.var; this._defineVar(varName, object); } }, _registerEventHandler: function _registerEventHandler(component, eventName) { var capitalizedEventName = eventName.charAt(0).toUpperCase() + eventName.slice(1); component.on(eventName, function (event) { $onsen.fireComponentEvent(component._element[0], eventName, event && event.detail); var handler = component._attrs['ons' + capitalizedEventName]; if (handler) { component._scope.$eval(handler, { $event: event }); component._scope.$evalAsync(); } }); }, /** * Register event handlers for attributes. * * @param {Object} component * @param {String} eventNames */ registerEventHandlers: function registerEventHandlers(component, eventNames) { eventNames = eventNames.trim().split(/\s+/); for (var i = 0, l = eventNames.length; i < l; i++) { var eventName = eventNames[i]; this._registerEventHandler(component, eventName); } }, /** * @return {Boolean} */ isAndroid: function isAndroid() { return !!$window.navigator.userAgent.match(/android/i); }, /** * @return {Boolean} */ isIOS: function isIOS() { return !!$window.navigator.userAgent.match(/(ipad|iphone|ipod touch)/i); }, /** * @return {Boolean} */ isWebView: function isWebView() { return $onsGlobal.isWebView(); }, /** * @return {Boolean} */ isIOS7above: function () { var ua = $window.navigator.userAgent; var match = ua.match(/(iPad|iPhone|iPod touch);.*CPU.*OS (\d+)_(\d+)/i); var result = match ? parseFloat(match[2] + '.' + match[3]) >= 7 : false; return function () { return result; }; }(), /** * Fire a named event for a component. The view object, if it exists, is attached to event.component. * * @param {HTMLElement} [dom] * @param {String} event name */ fireComponentEvent: function fireComponentEvent(dom, eventName, data) { data = data || {}; var event = document.createEvent('HTMLEvents'); for (var key in data) { if (data.hasOwnProperty(key)) { event[key] = data[key]; } } event.component = dom ? angular.element(dom).data(dom.nodeName.toLowerCase()) || null : null; event.initEvent(dom.nodeName.toLowerCase() + ':' + eventName, true, true); dom.dispatchEvent(event); }, /** * Define a variable to JavaScript global scope and AngularJS scope. * * Util.defineVar('foo', 'foo-value'); * // => window.foo and $scope.foo is now 'foo-value' * * Util.defineVar('foo.bar', 'foo-bar-value'); * // => window.foo.bar and $scope.foo.bar is now 'foo-bar-value' * * @param {String} name * @param object */ _defineVar: function _defineVar(name, object) { var names = name.split(/\./); function set(container, names, object) { var name; for (var i = 0; i < names.length - 1; i++) { name = names[i]; if (container[name] === undefined || container[name] === null) { container[name] = {}; } container = container[name]; } container[names[names.length - 1]] = object; if (container[names[names.length - 1]] !== object) { throw new Error('Cannot set var="' + object._attrs.var + '" because it will overwrite a read-only variable.'); } } if (ons.componentBase) { set(ons.componentBase, names, object); } var getScope = function getScope(el) { return angular.element(el).data('_scope'); }; var element = object._element[0]; // Current element might not have data('_scope') if (element.hasAttribute('ons-scope')) { set(getScope(element) || object._scope, names, object); element = null; return; } // Ancestors while (element.parentElement) { element = element.parentElement; if (element.hasAttribute('ons-scope')) { set(getScope(element), names, object); element = null; return; } } element = null; // If no ons-scope element was found, attach to $rootScope. set($rootScope, names, object); } }; } }]); })(); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { var module = angular.module('onsen'); var ComponentCleaner = { /** * @param {jqLite} element */ decomposeNode: function decomposeNode(element) { var children = element.remove().children(); for (var i = 0; i < children.length; i++) { ComponentCleaner.decomposeNode(angular.element(children[i])); } }, /** * @param {Attributes} attrs */ destroyAttributes: function destroyAttributes(attrs) { attrs.$$element = null; attrs.$$observers = null; }, /** * @param {jqLite} element */ destroyElement: function destroyElement(element) { element.remove(); }, /** * @param {Scope} scope */ destroyScope: function destroyScope(scope) { scope.$$listeners = {}; scope.$$watchers = null; scope = null; }, /** * @param {Scope} scope * @param {Function} fn */ onDestroy: function onDestroy(scope, fn) { var clear = scope.$on('$destroy', function () { clear(); fn.apply(null, arguments); }); } }; module.factory('ComponentCleaner', function () { return ComponentCleaner; }); // override builtin ng-(eventname) directives (function () { var ngEventDirectives = {}; 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' ').forEach(function (name) { var directiveName = directiveNormalize('ng-' + name); ngEventDirectives[directiveName] = ['$parse', function ($parse) { return { compile: function compile($element, attr) { var fn = $parse(attr[directiveName]); return function (scope, element, attr) { var listener = function listener(event) { scope.$apply(function () { fn(scope, { $event: event }); }); }; element.on(name, listener); ComponentCleaner.onDestroy(scope, function () { element.off(name, listener); element = null; ComponentCleaner.destroyScope(scope); scope = null; ComponentCleaner.destroyAttributes(attr); attr = null; }); }; } }; }]; function directiveNormalize(name) { return name.replace(/-([a-z])/g, function (matches) { return matches[1].toUpperCase(); }); } }); module.config(['$provide', function ($provide) { var shift = function shift($delegate) { $delegate.shift(); return $delegate; }; Object.keys(ngEventDirectives).forEach(function (directiveName) { $provide.decorator(directiveName + 'Directive', ['$delegate', shift]); }); }]); Object.keys(ngEventDirectives).forEach(function (directiveName) { module.directive(directiveName, ngEventDirectives[directiveName]); }); })(); })(); // confirm to use jqLite if (window.jQuery && angular.element === window.jQuery) { console.warn('Onsen UI require jqLite. Load jQuery after loading AngularJS to fix this error. jQuery may break Onsen UI behavior.'); // eslint-disable-line no-console } /* Copyright 2013-2015 ASIAL CORPORATION 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. */ Object.keys(ons.notification).filter(function (name) { return !/^_/.test(name); }).forEach(function (name) { var originalNotification = ons.notification[name]; ons.notification[name] = function (message) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; typeof message === 'string' ? options.message = message : options = message; var compile = options.compile; var $element = void 0; options.compile = function (element) { $element = angular.element(compile ? compile(element) : element); return ons.$compile($element)($element.injector().get('$rootScope')); }; options.destroy = function () { $element.data('_scope').$destroy(); $element = null; }; return originalNotification(options); }; }); /* Copyright 2013-2015 ASIAL CORPORATION 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. */ (function () { angular.module('onsen').run(['$templateCache', function ($templateCache) { var templates = window.document.querySelectorAll('script[type="text/ons-template"]'); for (var i = 0; i < templates.length; i++) { var template = angular.element(templates[i]); var id = template.attr('id'); if (typeof id === 'string') { $templateCache.put(id, template.text()); } } }]); })(); }))); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci1vbnNlbnVpLmpzIiwic291cmNlcyI6WyIuLi8uLi9iaW5kaW5ncy9hbmd1bGFyMS92ZW5kb3IvY2xhc3MuanMiLCIuLi8uLi9iaW5kaW5ncy9hbmd1bGFyMS9qcy9vbnNlbi5qcyIsIi4uLy4uL2JpbmRpbmdzL2FuZ3VsYXIxL3ZpZXdzL2FjdGlvblNoZWV0LmpzIiwiLi4vLi4vYmluZGluZ3MvYW5ndWxhcjEvdmlld3MvYWxlcnREaWFsb2cuanMiLCIuLi8uLi9iaW5kaW5ncy9hbmd1bGFyMS92aWV3cy9jYXJvdXNlbC5qcyIsIi4uLy4uL2JpbmRpbmdzL2FuZ3VsYXIxL3ZpZXdzL2RpYWxvZy5qcyIsIi4uLy4uL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jgrjjgqfjgq/jg4jjgIFIVE1MRWxlbWVudOOCquODluOCuOOCp+OCr+ODiOOBruOBhOOBmuOCjOOBi+OCkuaMh+WumuOBp+OBjeOBvuOBmeOAglsvamFdXG4gICAgICogQHJldHVybiB7T2JqZWN0fVxuICAgICAqICAgW2VuXUNvbXBvbmVudCBvYmplY3QuIFdpbGwgcmV0dXJuIG51bGwgaWYgbm8gY29tcG9uZW50IHdhcyBmb3VuZC5bL2VuXVxuICAgICAqICAgW2phXeOCs+ODs+ODneODvOODjeODs+ODiOOBruOCquODluOCuOOCp+OCr+ODiOOCkui/lOOBl+OBvuOBmeOAguOCguOBl+OCs+ODs+ODneODvOODjeODs+ODiOOBjOimi+OBpOOBi+OCieOBquOBi+OBo+OBn+WgtOWQiOOBq+OBr251bGzjgpLov5TjgZfjgb7jgZnjgIJbL2phXVxuICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAqICAgW2VuXUZpbmQgcGFyZW50IGNvbXBvbmVudCBvYmplY3Qgb2YgPGNvZGU+ZG9tPC9jb2RlPiBlbGVtZW50LlsvZW5dXG4gICAgICogICBbamFd5oyH5a6a44GV44KM44GfZG9t5byV5pWw44Gu6Kaq6KaB57Sg44KS44Gf44Gp44Gj44Gm44Kz44Oz44Od44O844ON44Oz44OI44KS5qSc57Si44GX44G+44GZ44CCWy9qYV1cbiAgICAgKi9cbiAgICBvbnMuZmluZFBhcmVudENvbXBvbmVudFVudGlsID0gZnVuY3Rpb24obmFtZSwgZG9tKSB7XG4gICAgICB2YXIgZWxlbWVudDtcbiAgICAgIGlmIChkb20gaW5zdGFuY2VvZiBIVE1MRWxlbWVudCkge1xuICAgICAgICBlbGVtZW50ID0gYW5ndWxhci5lbGVtZW50KGRvbSk7XG4gICAgICB9IGVsc2UgaWYgKGRvbSBpbnN0YW5jZW9mIGFuZ3VsYXIuZWxlbWVudCkge1xuICAgICAgICBlbGVtZW50ID0gZG9tO1xuICAgICAgfSBlbHNlIGlmIChkb20udGFyZ2V0KSB7XG4gICAgICAgIGVsZW1lbnQgPSBhbmd1bGFyLmVsZW1lbnQoZG9tLnRhcmdldCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBlbGVtZW50LmluaGVyaXRlZERhdGEobmFtZSk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIEBtZXRob2QgZmluZENvbXBvbmVudFxuICAgICAqIEBzaWduYXR1cmUgZmluZENvbXBvbmVudChzZWxlY3RvciwgW2RvbV0pXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IHNlbGVjdG9yXG4gICAgICogICBbZW5dQ1NTIHNlbGVjdG9yWy9lbl1cbiAgICAgKiAgIFtqYV1DU1Pjgrvjg6zjgq/jgr/jg7zjgpLmjIflrprjgZfjgb7jgZnjgIJbL2phXVxuICAgICAqIEBwYXJhbSB7SFRNTEVsZW1lbnR9IFtkb21dXG4gICAgICogICBbZW5dRE9NIGVsZW1lbnQgdG8gc2VhcmNoIGZyb20uWy9lbl1cbiAgICAgKiAgIFtqYV3mpJzntKLlr77osaHjgajjgZnjgotET03opoHntKDjgpLmjIflrprjgZfjgb7jgZnjgIJbL2phXVxuICAgICAqIEByZXR1cm4ge09iamVjdC9udWxsfVxuICAgICAqICAgW2VuXUNvbXBvbmVudCBvYmplY3QuIFdpbGwgcmV0dXJuIG51bGwgaWYgbm8gY29tcG9uZW50IHdhcyBmb3VuZC5bL2VuXVxuICAgICAqICAgW2phXeOCs+ODs+ODneODvOODjeODs+ODiOOBruOCquODluOCuOOCp+OCr+ODiOOCkui/lOOBl+OBvuOBmeOAguOCguOBl+OCs+ODs+ODneODvOODjeODs+ODiOOBjOimi+OBpOOBi+OCieOBquOBi+OBo+OBn+WgtOWQiOOBq+OBr251bGzjgpLov5TjgZfjgb7jgZnjgIJbL2phXVxuICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAqICAgW2VuXUZpbmQgY29tcG9uZW50IG9iamVjdCB1c2luZyBDU1Mgc2VsZWN0b3IuWy9lbl1cbiAgICAgKiAg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pOODs+OCueOCv+ODs+OCueOCkueUn+aIkOOBl+OBvuOBmeOAglsvamFdXG4gICAgICovXG5cbiAgICAvKipcbiAgICAgKiBAbWV0aG9kIGNyZWF0ZURpYWxvZ1xuICAgICAqIEBzaWduYXR1cmUgY3JlYXRlRGlhbG9nKHBhZ2UsIFtvcHRpb25zXSlcbiAgICAgKiBAcGFyYW0ge1N0cmluZ30gcGFnZVxuICAgICAqICAgW2VuXVBhZ2UgbmFtZS4gQ2FuIGJlIGVpdGhlciBhbiBIVE1MIGZpbGUgb3IgYW4gPG9ucy10ZW1wbGF0ZT4gY29udGFpbmluZyBhIDxvbnMtZGlhbG9nPiBjb21wb25lbnQuWy9lbl1cbiAgICAgKiAgIFtqYV1wYWdl44GuVVJM44GL44CB44KC44GX44GP44Gvb25zLXRlbXBsYXRl44Gn5a6j6KiA44GX44Gf44OG44Oz44OX44Os44O844OI44GuaWTlsZ7mgKfjga7lgKTjgpLmjIflrprjgafjgY3jgb7jgZnjgIJbL2phXVxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBbb3B0aW9uc11cbiAgICAgKiAgIFtlbl1QYXJhbWV0ZXIgb2JqZWN0LlsvZW5dXG4gICAgICogICBbamFd44Kq44OX44K344On44Oz44KS5oyH5a6a44GZ44KL44Kq44OW44K444Kn44Kv44OI44CCWy9qYV1cbiAgICAgKiBAcGFyYW0ge09iamVjdH0gW29wdGlvbnMucGFyZW50U2NvcGVdXG4gICAgICogICBbZW5dUGFyZW50IHNjb3BlIG9mIHRoZSBkaWFsb2cuIFVzZWQgdG8gYmluZCBtb2RlbHMgYW5kIGFjY2VzcyBzY29wZSBtZXRob2RzIGZyb20gdGhlIGRpYWxvZy5bL2VuXVxuICAgICAqICAgW2phXeODgOOCpOOCouODreOCsOWGheOBp+WIqeeUqOOBmeOCi+imquOCueOCs+ODvOODl+OCkuaMh+WumuOBl+OBvuOBmeOAguODgOOCpOOCouODreOCsOOBi+OCieODouODh+ODq+OChOOCueOCs+ODvOODl+O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9wb3ZlciBjb21wb25lbnQgb2JqZWN0LlsvZW5dXG4gICAgICogICBbamFd44Od44OD44OX44Kq44O844OQ44O844Gu44Kz44Oz44Od44O844ON44Oz44OI44Kq44OW44K444Kn44Kv44OI44KS6Kej5rG644GZ44KLUHJvbWlzZeOCquODluOCuOOCp+OCr+ODiOOCkui/lOOBl+OBvuOBmeOAglsvamFdXG4gICAgICogQGRlc2NyaXB0aW9uXG4gICAgICogICBbZW5dQ3JlYXRlIGEgcG9wb3ZlciBpbnN0YW5jZSBmcm9tIGEgdGVtcGxhdGUuIFRoaXMgbWV0aG9kIHdpbGwgYmUgZGVwcmVjYXRlZCBpbiBmYXZvciBvZiBgb25zLmNyZWF0ZUVsZW1lbnRgLlsvZW5dXG4gICAgICogICBbamFd44OG44Oz44OX44Os44O844OI44GL44KJ44Od44OD44OX44Kq44O844OQ44O844Gu44Kk44Oz44K544K/44Oz44K544KS55Sf5oiQ44GX44G+44GZ44CCWy9qYV1cbiAgICAgKi9cblxuICAgIC8qKlxuICAgICAqIEBwYXJhbSB7U3RyaW5nfSBwYWdlXG4gICAgICovXG4gICAgY29uc3QgcmVzb2x2ZUxvYWRpbmdQbGFjZUhvbGRlck9yaWdpbmFsID0gb25zLnJlc29sdmVMb2FkaW5nUGxhY2VIb2xkZXI7XG4gICAgb25zLnJlc29sdmVMb2FkaW5nUGxhY2Vob2xkZXIgPSBwYWdlID0+IHtcbiAgICAgIHJldHVybiByZXNvbHZlTG9hZGluZ1BsYWNlaG9sZGVyT3JpZ2luYWwocGFnZSwgKGVsZW1lbnQsIGRvbmUpID0+IHtcbiAgICAgICAgb25zLmNvbXBpbGUoZWxlbWVudCk7XG4gICAgICAgIGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KS5zY29wZSgpLiRldmFsQXN5bmMoKCkgPT4gc2V0SW1tZWRpYXRlKGRvbmUpKTtcbiAgICAgIH0pO1xuICAgIH07XG5cbiAgICBvbnMuX3NldHVwTG9hZGluZ1BsYWNlSG9sZG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W5kZXgsIGVsZW1lbnQpO1xuICAgICAgICAgICAgJGNvbXBpbGUoZWxlbWVudCkoc2NvcGUpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGRvbmUoe2VsZW1lbnQsIHNjb3BlfSk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICAvKipcbiAgICAgICAqIEBwYXJhbSB7TnVtYmVyfSBpbmRleFxuICAgICAgICogQHBhcmFtIHtPYmplY3R9IHNjb3BlXG4gICAgICAgKi9cbiAgICAgIF9hZGRTcGVjaWFsUHJvcGVydGllcyhpLCBzY29wZSkge1xuICAgICAgICBjb25zdCBsYXN0ID0gdGhpcy5jb3VudEl0ZW1zKCkgLSAxO1xuICAgICAgICBhbmd1bGFyLmV4dGVuZChzY29wZSwge1xuICAgICAgICAgICRpbmRleDogaSxcbiAgICAgICAgICAkZmlyc3Q6IGkgPT09IDAsXG4gICAgICAgICAgJGxhc3Q6IGkgPT09IGxhc3QsXG4gICAgICAgICAgJG1pZGRsZTogaSAhPT0gMCAmJiBpICE9PSBsYXN0LFxuICAgICAgICAgICRldmVuOiBpICUgMiA9PT0gMCxcbiAgICAgICAgICAkb2RkOiBpICUgMiA9PT0gMVxuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgdXBkYXRlSXRlbShpbmRleCwgaXRlbSkge1xuICAgICAgICBpZiAodGhpcy5fdXNpbmdCaW5kaW5nKCkpIHtcbiAgICAgICAgICBpdGVtLnNjb3BlLiRldmFsQXN5bmMoKCkgPT4gdGhpcy5jb25maWd1cmVJdGVtU2NvcGUoaW5kZXgsIGl0ZW0uc2NvcGUpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzdXBlci51cGRhdGVJdGVtKGluZGV4LCBpdGVtKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvKipcbiAgICAgICAqIEBwYXJhbSB7TnVtYmVyfSBpbmRleFxuICAgICAgICogQHBhcmFtIHtPYmplY3R9IGl0ZW1cb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ICAgICAgIHRoaXMuX2VsZW1lbnRbMF0ub25JbmZpbml0ZVNjcm9sbCA9IChkb25lKSA9PiB7XG4gICAgICAgICAgICAkcGFyc2UodGhpcy5fYXR0cnMubmdJbmZpbml0ZVNjcm9sbCkodGhpcy5fc2NvcGUpKGRvbmUpO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0sXG5cbiAgICAgIF9lbmFibGVCYWNrQnV0dG9uSGFuZGxlcjogZnVuY3Rpb24oKSB7XG4gICAgICAgIHRoaXMuX3VzZXJCYWNrQnV0dG9uSGFuZGxlciA9IGFuZ3VsYXIubm9vcDtcbiAgICAgICAgdGhpcy5fZWxlbWVudFswXS5vbkRldmljZUJhY2tCdXR0b24gPSB0aGlzLl9vbkRldmljZUJhY2tCdXR0b24uYmluZCh0aGlzKTtcbiAgICAgIH0sXG5cbiAgICAgIF9vbkRldmljZUJhY2tCdXR0b246IGZ1bmN0aW9uKCRldmVudCkge1xuICAgICAgICB0aGlzLl91c2VyQmFja0J1dHRvbkhhbmRsZXIoJGV2ZW50KTtcblxuICAgICAgICAvLyBuZy1kZXZpY2UtYmFja2J1dHRvblxuICAgICAgICBpZiAodGhpcy5fYXR0cnMubmdEZXZpY2VCYWNrQnV0dG9uKSB7XG4gICAgICAgICAgJHBhcnNlKHRoaXMuX2F0dHJzLm5nRGV2aWNlQmFja0J1dHRvbikodGhpcy5fc2NvcGUsIHskZXZlbnQ6ICRldmVudH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gb24tZGV2aWNlLWJhY2tidXR0b25cbiAgICAgICAgLyoganNoaW50IGlnbm9yZTpzdGFydCAqL1xuICAgICAgICBpZiAodGhpcy5fYXR0cnMub25EZXZpY2VCYWNrQnV0dG9uKSB7XG4gICAgICAgICAgdmFyIGxhc3RFdmVudCA9IHdpbmRvdy4kZXZlbnQ7XG4gICAgICAgICAgd2luZG93LiRldmVudCA9ICRldmVudDtcbiAgICAgICAgICBuZXcgRnVuY3Rpb24odGhp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ICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChhdHRycy5uZ0NsaWNrKSB7XG4gICAgICAgICAgICAgIGVsZW1lbnRbMF0ub25DbGljayA9IGFuZ3VsYXIubm9vcDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBiYWNrQnV0dG9uLl9ldmVudHMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICRvbnNlbi5yZW1vdmVNb2RpZmllck1ldGhvZHMoYmFja0J1dHRvbik7XG4gICAgICAgICAgICAgIGVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIENvbXBvbmVudENsZWFuZXIub25EZXN0cm95KHNjb3BlLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgQ29tcG9uZW50Q2xlYW5lci5kZXN0cm95U2NvcGUoc2NvcGUpO1xuICAgICAgICAgICAgICBDb21wb25lbnRDbGVhbmVyLmRlc3Ryb3lBdHRyaWJ1dGVzKGF0dHJzKTtcbiAgICAgICAgICAgICAgZWxlbWVudCA9IHNjb3BlID0gYXR0cnMgPSBudWxsO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBwb3N0OiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCkge1xuICAgICAgICAgICAgJG9uc2VuLmZpcmVDb21wb25lbnRFdmVudChlbGVtZW50WzBdLCAnaW5pdCcpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9O1xuICB9KTtcbn0pKCk7XG4iLCIoZnVuY3Rpb24oKXtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIGFuZ3VsYXIubW9kdWxlKCdvbnNlbicpLmRpcmVjdGl2ZSgnb25zQm90dG9tVG9vbGJhcicsIGZ1bmN0aW9uKCRvbnNlbiwgR2VuZXJpY1ZpZXcp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ljdFsnbmcnICsgdGl0bGl6ZShuYW1lKV0gPSAnJic7XG4gICAgICByZXR1cm4gZGljdDtcbiAgICB9LCB7fSk7XG5cbiAgICBmdW5jdGlvbiB0aXRsaXplKHN0cikge1xuICAgICAgcmV0dXJuIHN0ci5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIHN0ci5zbGljZSgxKTtcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAgICAgIHNjb3BlOiBzY29wZURlZixcblxuICAgICAgLy8gTk9URTogVGhpcyBlbGVtZW50IG11c3QgY29leGlzdHMgd2l0aCBuZy1jb250cm9sbGVyLlxuICAgICAgLy8gRG8gbm90IHVzZSBpc29sYXRlZCBzY29wZSBhbmQgdGVtcGxhdGUncyBuZy10cmFuc2NsdWRlLlxuICAgICAgcmVwbGFjZTogZmFsc2UsXG4gICAgICB0cmFuc2NsdWRlOiB0cnVlLFxuXG4gICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtZW50LCBhdHRycykge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gbGluayhzY29wZSwgZWxlbWVudCwgYXR0cnMsIF8sIHRyYW5zY2x1ZGUpIHtcblxuICAgICAgICAgIHRyYW5zY2x1ZGUoc2NvcGUuJHBhcmVudCwgZnVuY3Rpb24oY2xvbmVkKSB7XG4gICAgICAgICAgICBlbGVtZW50LmFwcGVuZChjbG9uZWQpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgdmFyIGhhbmRsZXIgPSBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgdmFyIGF0dHIgPSAnbmcnICsgdGl0bGl6ZShldmVudC50eXBlKTtcblxuICAgICAgICAgICAgaWYgKGF0dHIgaW4gc2NvcGVEZWYpIHtcbiAgICAgICAgICAgICAgc2NvcGVbYXR0cl0oeyRldmVudDogZXZlbnR9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgdmFy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BtdXN0IGNvZXhpc3RzIHdpdGggbmctY29udHJvbGxlci5cbiAgICAgIC8vIERvIG5vdCB1c2UgaXNvbGF0ZWQgc2NvcGUgYW5kIHRlbXBsYXRlJ3MgbmctdHJhbnNjbHVkZS5cbiAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLFxuICAgICAgc2NvcGU6IGZhbHNlLFxuXG4gICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtZW50KSB7XG4gICAgICAgIGVsZW1lbnQuY3NzKCdkaXNwbGF5JywgJ25vbmUnKTtcblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7XG4gICAgICAgICAgYXR0cnMuJG9ic2VydmUoJ29uc0lmT3JpZW50YXRpb24nLCB1cGRhdGUpO1xuICAgICAgICAgICRvbnNHbG9iYWwub3JpZW50YXRpb24ub24oJ2NoYW5nZScsIHVwZGF0ZSk7XG5cbiAgICAgICAgICB1cGRhdGUoKTtcblxuICAgICAgICAgICRvbnNlbi5jbGVhbmVyLm9uRGVzdHJveShzY29wZSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAkb25zR2xvYmFsLm9yaWVudGF0aW9uLm9mZignY2hhbmdlJywgdXBkYXRlKTtcblxuICAgICAgICAgICAgJG9uc2VuLmNsZWFyQ29tcG9uZW50KHtcbiAgICAgICAgICAgICAgZWxlbWVudDogZWxlbWVudCxcbiAgICAgICAgICAgICAgc2NvcGU6IHNjb3BlLFxuICAgICAgICAgICAgICBhdHRyczogYXR0cnNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZWxlbWVudCA9IHNjb3BlID0gYXR0cnMgPSBudWxsO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgZnVuY3Rpb24gdXBkYXRlKCkge1xuICAgICAgICAgICAgdmFyIHVzZXJPcmllbnRhdGlvbiA9ICgnJyArIGF0dHJzLm9uc0lmT3JpZW50YXRpb24pLnRvTG93ZXJDYXNlKC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cbiAgICAgICAgICAkb25zZW4uY2xlYW5lci5vbkRlc3Ryb3koc2NvcGUsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgJG9uc2VuLmNsZWFyQ29tcG9uZW50KHtcbiAgICAgICAgICAgICAgZWxlbWVudDogZWxlbWVudCxcbiAgICAgICAgICAgICAgc2NvcGU6IHNjb3BlLFxuICAgICAgICAgICAgICBhdHRyczogYXR0cnNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZWxlbWVudCA9IHNjb3BlID0gYXR0cnMgPSBudWxsO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgZnVuY3Rpb24gdXBkYXRlKCkge1xuICAgICAgICAgICAgdmFyIHVzZXJQbGF0Zm9ybXMgPSBhdHRycy5vbnNJZlBsYXRmb3JtLnRvTG93ZXJDYXNlKCkudHJpbSgpLnNwbGl0KC9cXHMrLyk7XG4gICAgICAgICAgICBpZiAodXNlclBsYXRmb3Jtcy5pbmRleE9mKHBsYXRmb3JtLnRvTG93ZXJDYXNlKCkpID49IDApIHtcbiAgICAgICAgICAgICAgZWxlbWVudC5jc3MoJ2Rpc3BsYXknLCAnYmxvY2snKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGVsZW1lbnQuY3NzKCdkaXNwbGF5JywgJ25vbmUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgZnVuY3Rpb24gZ2V0UGxhdGZvcm1TdHJpbmcoKSB7XG5cbiAgICAgICAgICBpZiAobmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvQW5kcm9pZC9pKSkge1xuICAgICAgICAgICAgcmV0dXJuICdhbmRyb2lkJztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoKG5hdmlnYXRvci51c2VyQWdlbnQubWF0Y2goL0JsYWNrQmVycnkvaSkpIHx8IChuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9S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uICogQGRlc2NyaXB0aW9uXG4gKiAgIFtlbl1cbiAqICAgICBDb25kaXRpb25hbGx5IGRpc3BsYXkgY29udGVudCBkZXBlbmRpbmcgb24gaWYgdGhlIHNvZnR3YXJlIGtleWJvYXJkIGlzIHZpc2libGUgb3IgaGlkZGVuLlxuICogICAgIFRoaXMgY29tcG9uZW50IHJlcXVpcmVzIGNvcmRvdmEgYW5kIHRoYXQgdGhlIGNvbS5pb25pYy5rZXlib2FyZCBwbHVnaW4gaXMgaW5zdGFsbGVkLlxuICogICBbL2VuXVxuICogICBbamFdXG4gKiAgICAg44K944OV44OI44Km44Kn44Ki44Kt44O844Oc44O844OJ44GM6KGo56S644GV44KM44Gm44GE44KL44GL44Gp44GG44GL44Gn44CB44Kz44Oz44OG44Oz44OE44KS6KGo56S644GZ44KL44GL44Gp44GG44GL44KS5YiH44KK5pu/44GI44KL44GT44Go44GM5Ye65p2l44G+44GZ44CCXG4gKiAgICAg44GT44Gu44Kz44Oz44Od44O844ON44Oz44OI44Gv44CBQ29yZG92YeOChGNvbS5pb25pYy5rZXlib2FyZOODl+ODqeOCsOOCpOODs+OCkuW/heimgeOBqOOBl+OBvuOBmeOAglxuICogICBbL2phXVxuICogQGV4YW1wbGVcbiAqIDxkaXYgb25zLWtleWJvYXJkLWFjdGl2ZT5cbiAqICAgVGhpcyB3aWxsIG9ubHkgYmUgZGlzcGxheWVkIGlmIHRoZSBzb2Z0d2FyZSBrZXlib2FyZCBpcyBvcGVuLlxuICogPC9kaXY+XG4gKiA8ZGl2IG9ucy1rZXlib2FyZC1pbmFjdGl2ZT5cbiAqICAgVGhlcmUgaXMgYWxzbyBhIGNvbXBvbmVudCB0aGF0IGRvZXMgdGhlIG9wcG9zaXRlLlxuICogPC9kaXY+XG4gKi9cblxuLyoqXG4gKiBAYXR0cmlidXRlIG9ucy1rZXlib2FyZC1hY3RpdmVcbiAqIEBkZXNjcmlwdGlvblxuICogICBbZW5dVGhlIGNvbnRlbnQgb2YgdGFncyB3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yA6ICdibG9jayc7XG5cbiAgICAgICAgdmFyIG9uU2hvdyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGVsZW1lbnQuY3NzKCdkaXNwbGF5JywgZGlzcFNob3cpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHZhciBvbkhpZGUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICBlbGVtZW50LmNzcygnZGlzcGxheScsIGRpc3BIaWRlKTtcbiAgICAgICAgfTtcblxuICAgICAgICB2YXIgb25Jbml0ID0gZnVuY3Rpb24oZSkge1xuICAgICAgICAgIGlmIChlLnZpc2libGUpIHtcbiAgICAgICAgICAgIG9uU2hvdygpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvbkhpZGUoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgb25zLnNvZnR3YXJlS2V5Ym9hcmQub24oJ3Nob3cnLCBvblNob3cpO1xuICAgICAgICBvbnMuc29mdHdhcmVLZXlib2FyZC5vbignaGlkZScsIG9uSGlkZSk7XG4gICAgICAgIG9ucy5zb2Z0d2FyZUtleWJvYXJkLm9uKCdpbml0Jywgb25Jbml0KTtcblxuICAgICAgICBpZiAob25zLnNvZnR3YXJlS2V5Ym9hcmQuX3Zpc2libGUpIHtcbiAgICAgICAgICBvblNob3coKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBvbkhpZGUoKTtcbiAgICAgICAgfVxuXG4gICAgICAgICRvbnNlbi5jbGVhbmVyLm9uRGVzdHJveShzY29wZSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgb25zLnNvZnR3YXJlS2V5Ym9hcmQub2ZmKCdzaG93Jywgb25TaG93KTtcbiAgICAgICAgICBvbnMuc29mdHdhcmVLZXlib2FyZC5vZmYoJ2hpZGUnLCBvbkhpZGUpO1xuICAgICAgICAgIG9ucy5zb2Z0d2FyZUtleWJvYXJkLm9mZignaW5pdCcsIG9uSW5pdCk7XG5cbiAgICAgIC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4gcGVyZm9ybWFuY2UuXG4gKiAgICAgSXQgZG9lcyB0aGF0IGJ5IFwibGF6aWx5XCIgbG9hZGluZyBlbGVtZW50cyBpbnRvIHRoZSBET00gd2hlbiB0aGV5IGNvbWUgaW50byB2aWV3IGFuZFxuICogICAgIHJlbW92aW5nIGl0ZW1zIGZyb20gdGhlIERPTSB3aGVuIHRoZXkgYXJlIG5vdCB2aXNpYmxlLlxuICogICBbL2VuXVxuICogICBbamFdXG4gKiAgICAg44GT44Gu44Kz44Oz44Od44O844ON44Oz44OI5YaF44Gn5o+P55S744GV44KM44KL44Ki44Kk44OG44Og44GuRE9N6KaB57Sg44Gu6Kqt44G/6L6844G/44Gv44CB55S76Z2i44Gr6KaL44GI44Gd44GG44Gr44Gq44Gj44Gf5pmC44G+44Gn6Ieq5YuV55qE44Gr6YGF5bu244GV44KM44CBXG4gKiAgICAg55S76Z2i44GL44KJ6KaL44GI44Gq44GP44Gq44Gj44Gf5aC05ZCI44Gr44Gv44Gd44Gu6KaB57Sg44Gv5YuV55qE44Gr44Ki44Oz44Ot44O844OJ44GV44KM44G+44GZ44CCXG4gKiAgICAg44GT44Gu44Kz44Oz44Od44O844ON44Oz44OI44KS5L2/44GG44GT44Go44Gn44CB44OR44OV44Kp44O844Oe44Oz44K544KS5Yqj5YyW44GV44Gb44KL44GT44Go54Sh44GX44Gr5beo5aSn44Gq5pWw44Gu6KaB57Sg44KS5o+P55S744Gn44GN44G+44GZ44CCXG4gKiAgIFsvamFdXG4gKiBAY29kZXBlbiBRd3JHQm1cbiAqIEBndWlkZSBVc2luZ0xhenlSZXBlYXRcbiAqICAgW2VuXUhvdyB0byB1c2UgTGF6eSBSZXBlYXRbL2VuXVxuICogICBbamFd44Os44Kk44K444O844Oq44OU44O844OI44Gu5L2/44GE5pa5Wy9qYV1cbiAqIEBleGFtcGxlXG4gKiA8c2NyaXB0PlxuICogICBvbnMuYm9vdHN0cmFwKClcbiAqXG4gKiAgIC5jb250cm9sbGVyKCdNeUN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uICAgICAgICAgICAgZWxlbWVudC5kYXRhKCdvbnMtcGFnZScsIHBhZ2UpO1xuICAgICAgICAgICAgJG9uc2VuLmFkZE1vZGlmaWVyTWV0aG9kc0ZvckN1c3RvbUVsZW1lbnRzKHBhZ2UsIGVsZW1lbnQpO1xuXG4gICAgICAgICAgICBlbGVtZW50LmRhdGEoJ19zY29wZScsIHNjb3BlKTtcblxuICAgICAgICAgICAgJG9uc2VuLmNsZWFuZXIub25EZXN0cm95KHNjb3BlLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcGFnZS5fZXZlbnRzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAkb25zZW4ucmVtb3ZlTW9kaWZpZXJNZXRob2RzKHBhZ2UpO1xuICAgICAgICAgICAgICBlbGVtZW50LmRhdGEoJ29ucy1wYWdlJywgdW5kZWZpbmVkKTtcbiAgICAgICAgICAgICAgZWxlbWVudC5kYXRhKCdfc2NvcGUnLCB1bmRlZmluZWQpO1xuXG4gICAgICAgICAgICAgICRvbnNlbi5jbGVhckNvbXBvbmVudCh7XG4gICAgICAgICAgICAgICAgZWxlbWVudDogZWxlbWVudCxcbiAgICAgICAgICAgICAgICBzY29wZTogc2NvcGUsXG4gICAgICAgICAgICAgICAgYXR0cnM6IGF0dHJzXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBzY29wZSA9IGVsZW1lbnQgPSBhdHRycyA9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgcG9zdDogZnVuY3Rpb24gcG9zdExpbmsoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7XG4gICAgICAgICAgICBmaXJlUGFnZUluaXRFdmVudChlbGVtZW50WzBdKTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfTtcbiAgfSk7XG59KSgpO1xuIiwiLyoqXG4gKiBAZWxlbWVudCBvbnMtcG9wb3ZlclxuICovXG5cbi8qKl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G92ZXInLCBwb3BvdmVyKTtcblxuICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBwb3BvdmVyLl9ldmVudHMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICRvbnNlbi5yZW1vdmVNb2RpZmllck1ldGhvZHMocG9wb3Zlcik7XG4gICAgICAgICAgICAgIGVsZW1lbnQuZGF0YSgnb25zLXBvcG92ZXInLCB1bmRlZmluZWQpO1xuICAgICAgICAgICAgICBlbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICBwb3N0OiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCkge1xuICAgICAgICAgICAgJG9uc2VuLmZpcmVDb21wb25lbnRFdmVudChlbGVtZW50WzBdLCAnaW5pdCcpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9O1xuICB9KTtcbn0pKCk7XG5cbiIsIi8qKlxuICogQGVsZW1lbnQgb25zLXB1bGwtaG9va1xuICogQGV4YW1wbGVcbiAqIDxzY3JpcHQ+XG4gKiAgIG9ucy5ib290c3RyYXAoKVxuICpcbiAqICAgLmNvbnRyb2xsZXIoJ015Q29udHJvbGxlcicsIGZ1bmN0aW9uKCRzY29wZSwgJHRpbWVvdXQpIHtcbiAqICAgICAkc2NvcGUuaXRlbXMgPSBbMywgMiAsMV07XG4gKlxuICogICAgICRzY29wZS5sb2FkID0gZnVuY3Rpb24oJGRvbmUpIHtcbiAqICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkge1xuICogICAgICAgICAkc2NvcGUuaXRlbXMudW5zaGlmdCgkc2NvcGUuaXRlbXMubGVuZ3RoICsgMSk7XG4gKiAgICAgICAgICRkb25lKCk7XG4gKiAgICAgICB9LCAxMDAwKTtcbiAqICAgICB9O1xuICogICB9KTtcbiAqIDwvc2NyaXB0PlxuICpcbiAqIDx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xuICAgICAgICAgICAgICBlbC52YWx1ZSA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgZWxlbWVudC5vbignaW5wdXQnLCBvbklucHV0KVxuICAgICAgICB9XG5cbiAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsICgpID0+IHtcbiAgICAgICAgICBlbGVtZW50Lm9mZignaW5wdXQnLCBvbklucHV0KVxuICAgICAgICAgIHNjb3BlID0gZWxlbWVudCA9IGF0dHJzID0gZWwgPSBudWxsO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9O1xuICB9KTtcbn0pKCk7XG4iLCIvKipcbiAqIEBlbGVtZW50IG9ucy1zZWdtZW50XG4gKi9cblxuLyoqXG4gKiBAYXR0cmlidXRlIHZhclxuICogQGluaXRvbmx5XG4gKiBAdHlwZSB7U3RyaW5nfVxuICogQGRlc2NyaXB0aW9uXG4gKiAgIFtlbl1WYXJpYWJsZSBuYW1lIHRvIHJlZmVyIHRoaXMgc2VnbWVudC5bL2VuXVxuICogICBbamFd44GT44Gu44K/44OW44OQ44O844KS5Y+C54Wn44GZ44KL44Gf44KB44Gu5ZCN5YmN44KS5oyH5a6a44GX44G+44GZ44CCWy9qYV1cbiAqL1xuXG4vKipcbiAqIEBhdHRyaWJ1dGUgb25zLXBvc3RjaGFuZ2VcbiAqIEBpbml0b25seVxuICogQHR5cGUge0V4cHJlc3Npb259XG4gKiBAZGVzY3JpcHRpb25cbiAqICBbZW5dQWxsb3dzIHlvdSB0byBzcGVjaWZ5IGN1c3RvbSBiZWhhdmlvciB3aGVuIHRoZSBcInBvc3RjaGFuZ2VcIiBldmVudCBpcyBmaXJlZC5bL2VuXVxuICogIFtqYV1cInBvc3RjaGFuZ2VcIuOCpOODmeODs+ODiOOBjOeZuueBq+OBleOCjOOBn+aZguOBruaMmeWLleOCkueLrOiHquOBq+aMh+WumuOBp+OBjeOBvuOBmeOAglsvamFdXG4gKi9cblxuKGZ1b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luazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycykge1xuICAgICAgICBjb25zdCBvbklucHV0ID0gKCkgPT4ge1xuICAgICAgICAgIGNvbnN0IHNldCA9ICRwYXJzZShhdHRycy5uZ01vZGVsKS5hc3NpZ247XG5cbiAgICAgICAgICBzZXQoc2NvcGUsIGVsZW1lbnRbMF0udmFsdWUpO1xuICAgICAgICAgIGlmIChhdHRycy5uZ0NoYW5nZSkge1xuICAgICAgICAgICAgc2NvcGUuJGV2YWwoYXR0cnMubmdDaGFuZ2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzY29wZS4kcGFyZW50LiRldmFsQXN5bmMoKTtcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoYXR0cnMubmdNb2RlbCkge1xuICAgICAgICAgIHNjb3BlLiR3YXRjaChhdHRycy5uZ01vZGVsLCAodmFsdWUpID0+IHtcbiAgICAgICAgICAgIGVsZW1lbnRbMF0udmFsdWUgPSB2YWx1ZTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIGVsZW1lbnQub24oJ2lucHV0Jywgb25JbnB1dCk7XG4gICAgICAgIH1cblxuICAgICAgICBzY29wZS4kb24oJyRkZXN0cm95JywgKCkgPT4ge1xuICAgICAgICAgIGVsZW1lbnQub2ZmKCdpbnB1dCcsIG9uSW5wdXQpO1xuICAgICAgICAgIHNjb3BlID0gZWxlbWVudCA9IGF0dHJzID0gbnVsbDtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgR2VuZXJpY1ZpZXcucmVnaXN0ZXIoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCB7IHZpZXdLZXk6ICdvbnMtc2VsZWN0JyB9KTtcbiAgICAgICAgJG9uc2VuLmZpcmVDb21wb25lbnRFdmVudChlbGVtZW50WzBdLCAnaW5pdCcpO1xuICAgICAgfVxuICAgIH07XG4gIH0pXG59KSgpO1xuIiwiLyoqXG4gKiBAZWxlbWVudCBvbnMtc3BlZWQtZGlhbFxuICovX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hbWVdLmFwcGx5KGVsZW1lbnQsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgbWV0aG9kTmFtZXMuZm9yRWFjaChmdW5jdGlvbihtZXRob2ROYW1lKSB7XG4gICAgICAgICAgICAgIHZpZXdbbWV0aG9kTmFtZV0gPSBudWxsO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB2aWV3ID0gZWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgfTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtDbGFzc30ga2xhc3NcbiAgICAgICAgICogQHBhcmFtIHtBcnJheX0gcHJvcGVydGllc1xuICAgICAgICAgKi9cbiAgICAgICAgZGVyaXZlUHJvcGVydGllc0Zyb21FbGVtZW50OiBmdW5jdGlvbihrbGFzcywgcHJvcGVydGllcykge1xuICAgICAgICAgIHByb3BlcnRpZXMuZm9yRWFjaChmdW5jdGlvbihwcm9wZXJ0eSkge1xuICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGtsYXNzLnByb3RvdHlwZSwgcHJvcGVydHksIHtcbiAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2VsZW1lbnRbMF1bcHJvcGVydHldO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2VsZW1lbnRbMF1bcHJvcGVydHldID0gdmFsdWU7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tcmV0dXJuLWFzc2lnblxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IHZpZXdcbiAgICAgICAgICogQHBhcmFtIHtFbGVtZW50fSBlbGVtZW50XG4gICAgICAgICAqIEBwYXJhbSB7QXJyYXl9IGV2ZW50TmFtZXNcbiAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gW21hcF1cbiAgICAgICAgICogQHJldHVybiB7RnVuY3Rpb259IEEgZnVuY3Rpb24gdGhhdCBjbGVhciBhbGwgZXZlbnQgbGlzdGVuZXJzXG4gICAgICAgICAqL1xuICAgICAgICBkZXJpdmVFdmVudHM6IGZ1bmN0aW9uKHZpZXcsIGVsZW1lbnQsIGV2ZW50TmFtZXMsIG1hcCkge1xuICAgICAgICAgIG1hcCA9IG1hcCB8fCBmdW5jdGlvbihkZXRhaWwpIHsgcmV0dXJuIGRldGFpbDsgfTtcbiAgICAgICAgICBldmVudE5hbWVzID0gW10uY29uY2F0KGV2ZW50TmFtZXMpO1xuICAgICAgICAgIHZhciBsaXN0ZW5lcnMgPSBbXTtcblxuICAgICAgICAgIGV2ZW50TmFtZXMuZm9yRWFjaChmdW5jdGlvbihldmVudE5hbWUpIHtcbiAgICAgICAgICAgIHZhciBsaXN0ZW5lciA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgIG1hcChldmVudC5kZXRhaWwgfHwge30pO1xuICAgICAgICAgICAgICB2aWV3LmVtaXQoZXZlbnROYW1lLCBldmVudCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGlzdGVuZXJzLnB1c2gobGlzdGVuZXIpO1xuICAgICAgICAgICAgZWxlbWVudC5hZGRFdmVudExpc3RlbmVyKGV2ZW50TmFtZSwgbGlzdGVuZXIsIGZhbHNlKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGV2ZW50TmFtZXMuZm9yRWFjaChmdW5jdGlvbihldmVudE5hbWUsIGluZGV4KSB7XG4gICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcihldmVudE5hbWUsIGxpc3RlbmVyc1tpbmRleF0sIGZhbHNlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdmlldyA9IGVsZW1lbnQgPSBsaXN0ZW5lcnMgPSBtYXAgPSBudWxsO1xuICAgICAgICAgIH07XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAgICAgICAqL1xuICAgICAgICBpc0VuYWJsZWRBdXRvU3RhdHVzQmFyRmlsbDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuICEhJG9uc0dsb2JhbC5fY29uZmlnLmF1dG9TdGF0dXNCYXJGaWxsO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcmV0dXJuIHtCb29sZWFufVxuICAgICAgICAgKi9cbiAgICAgICAgc2hvdWxkRmlsbFN0YXR1c0JhcjogJG9uc0dsb2JhbC5zaG91bGRGaWxsU3RhdHVzQmFyLFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBhY3Rpb25cbiAgICAgICAgICovXG4gICAgICAgIGF1dG9TdGF0dXNCYXJGaWxsOiAkb25zR2xvYmFsLmF1dG9TdGF0dXNCYXJGaWxsLFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gZGlyZWN0aXZlXG4gICAgICAgICAqIEBwYXJhbSB7SFRNTEVsZW1lbnR9IHBhZ2VFbGVtZW50XG4gICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IGNhbGxiYWNrXG4gICAgICAgICAqL1xuICAgICAgICBjb21waWxlQW5kTGluazogZnVuY3Rpb24odmlldywgcGFnZUVsZW1lbnQsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgY29uc3QgbGluayA9ICRjb21wa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mUocGFyZW50LmFwcGVuZENoaWxkKGVsZW1lbnQpKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGVsZW1lbnQgPT4ge1xuICAgICAgICAgICAgICBlbGVtZW50Ll9kZXN0cm95KCk7XG4gICAgICAgICAgICAgIGlmIChhbmd1bGFyLmVsZW1lbnQoZWxlbWVudCkuZGF0YSgnX3Njb3BlJykpIHtcbiAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudCkuZGF0YSgnX3Njb3BlJykuJGRlc3Ryb3koKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBwYXJhbXNcbiAgICAgICAgICogQHBhcmFtIHtTY29wZX0gW3BhcmFtcy5zY29wZV1cbiAgICAgICAgICogQHBhcmFtIHtqcUxpdGV9IFtwYXJhbXMuZWxlbWVudF1cbiAgICAgICAgICogQHBhcmFtIHtBcnJheX0gW3BhcmFtcy5lbGVtZW50c11cbiAgICAgICAgICogQHBhcmFtIHtBdHRyaWJ1dGVzfSBbcGFyYW1zLmF0dHJzXVxuICAgICAgICAgKi9cbiAgICAgICAgY2xlYXJDb21wb25lbnQ6IGZ1bmN0aW9uKHBhcmFtcykge1xuICAgICAgICAgIGlmIChwYXJhbXMuc2NvcGUpIHtcbiAgICAgICAgICAgIENvbXBvbmVudENsZWFuZXIuZGVzdHJveVNjb3BlKHBhcmFtcy5zY29wZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHBhcmFtcy5hdHRycykge1xuICAgICAgICAgICAgQ29tcG9uZW50Q2xlYW5lci5kZXN0cm95QXR0cmlidXRlcyhwYXJhbXMuYXR0cnMpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChwYXJhbXMuZWxlbWVudCkge1xuICAgICAgICAgICAgQ29tcG9uZW50Q2xlYW5lci5kZXN0cm95RWxlbWVudChwYXJhbXMuZWxlbWVudCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHBhcmFtcy5lbGVtZW50cykge1xuICAgICAgICAgICAgcGFyYW1zLmVsZW1lbnRzLmZvckVhY2goZnVuY3Rpb24oZWxlbWVudCkge1xuICAgICAgICAgICAgICBDb21wb25lbnRDbGVhbmVyLmRlc3Ryb3lFbGVtZW50KGVsZW1lbnQpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcGFyYW0ge2pxTGl0ZX0gZWxlbWVudFxuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gbmFtZVxuICAgICAgICAgKi9cbiAgICAgICAgZmluZEVsZW1lbnRlT2JqZWN0OiBmdW5jdGlvbihlbGVtZW50LCBuYW1lKSB7XG4gICAgICAgICAgcmV0dXJuIGVsZW1lbnQuaW5oZXJpdGVkRGF0YShuYW1lKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmd9IHBhZ2VcbiAgICAgICAgICogQHJldHVybiB7UHJvbWlzZX1cbiAgICAgICAgICovXG4gICAgICAgIGdldFBhZ2VIVE1MQXN5bmM6IGZ1bmN0aW9uKHBhZ2UpIHtcbiAgICAgICAgICB2YXIgY2FjaGUgPSAkdGVtcGxhdGVDYWNoZS5nZXQocGFnZSk7XG5cbiAgICAgICAgICBpZiAoY2FjaGUpIHtcbiAgICAgICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7XG5cbiAgICAgICAgICAgIHZhciBodG1sID0gdHlwZW9mIGNhY2hlID09PSAnc3RyaW5nJyA/IGNhY2hlIDogY2FjaGVbMV07XG4gICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHRoaXMubm9ybWFsaXplU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nRzLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gdmlldyBvYmplY3RcbiAgICAgICAgICogQHBhcmFtIHtqcUxpdGV9IGVsZW1lbnRcbiAgICAgICAgICovXG4gICAgICAgIGFkZE1vZGlmaWVyTWV0aG9kc0ZvckN1c3RvbUVsZW1lbnRzOiBmdW5jdGlvbih2aWV3LCBlbGVtZW50KSB7XG4gICAgICAgICAgdmFyIG1ldGhvZHMgPSB7XG4gICAgICAgICAgICBoYXNNb2RpZmllcjogZnVuY3Rpb24obmVlZGxlKSB7XG4gICAgICAgICAgICAgIHZhciB0b2tlbnMgPSBNb2RpZmllclV0aWwuc3BsaXQoZWxlbWVudC5hdHRyKCdtb2RpZmllcicpKTtcbiAgICAgICAgICAgICAgbmVlZGxlID0gdHlwZW9mIG5lZWRsZSA9PT0gJ3N0cmluZycgPyBuZWVkbGUudHJpbSgpIDogJyc7XG5cbiAgICAgICAgICAgICAgcmV0dXJuIE1vZGlmaWVyVXRpbC5zcGxpdChuZWVkbGUpLnNvbWUoZnVuY3Rpb24obmVlZGxlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRva2Vucy5pbmRleE9mKG5lZWRsZSkgIT0gLTE7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgcmVtb3ZlTW9kaWZpZXI6IGZ1bmN0aW9uKG5lZWRsZSkge1xuICAgICAgICAgICAgICBuZWVkbGUgPSB0eXBlb2YgbmVlZGxlID09PSAnc3RyaW5nJyA/IG5lZWRsZS50cmltKCkgOiAnJztcblxuICAgICAgICAgICAgICB2YXIgbW9kaWZpZXIgPSBNb2RpZmllclV0aWwuc3BsaXQoZWxlbWVudC5hdHRyKCdtb2RpZmllcicpKS5maWx0ZXIoZnVuY3Rpb24odG9rZW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gIT09IG5lZWRsZTtcbiAgICAgICAgICAgICAgfSkuam9pbignICcpO1xuXG4gICAgICAgICAgICAgIGVsZW1lbnQuYXR0cignbW9kaWZpZXInLCBtb2RpZmllcik7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBhZGRNb2RpZmllcjogZnVuY3Rpb24obW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCdtb2RpZmllcicsIGVsZW1lbnQuYXR0cignbW9kaWZpZXInKSArICcgJyArIG1vZGlmaWVyKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIHNldE1vZGlmaWVyOiBmdW5jdGlvbihtb2RpZmllcikge1xuICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoJ21vZGlmaWVyJywgbW9kaWZpZXIpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgdG9nZ2xlTW9kaWZpZXI6IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICAgIGlmICh0aGlzLmhhc01vZGlmaWVyKG1vZGlmaWVyKSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlTW9kaWZpZXIobW9kaWZpZXIpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuYWRkTW9kaWZpZXIobW9kaWZpZXIpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIGZvciAodmFyIG1ldGhvZCBpbiBtZXRob2RzKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kcy5oYXNPd25Qcm9wZXJ0eShtZXRob2QpKSB7XG4gICAgICAgICAgICAgIHZpZXdbbWV0aG9kXSA9IG1ldGhvZHNbbWV0aG9kXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEFkZCBtb2RpZmllciBtZXRob2RzIHRvIHZpZXcgb2JqZWN0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gdmlldyBvYmplY3RcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmd9IHRlbXBsYXRlXG4gICAgICAgICAqIEBwYXJhbSB7anFMaXRlfSBlbGVtZW50XG4gICAgICAgICAqL1xuICAgICAgICBhZGRNb2RpZmllck1ldGhvZHM6IGZ1bmN0aW9uKHZpZXcsIHRlbXBsYXRlLCBlbGVtZW50KSB7XG4gICAgICAgICAgdmFyIF90ciA9IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICByZXR1cm4gdGVtcGxhdGUucmVwbGFjZSgnKicsIG1vZGlmaWVyKTtcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgdmFyIGZucyA9IHtcbiAgICAgICAgICAgIGhhc01vZGlmaWVyOiBmdW5jdGlvbihtb2RpZmllcikge1xuICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudC5oYXNDbGFzcyhfdHIobW9kaWZpZXIpKTtcbiAgICAgICAgICAgIH0sXG5cbiAgICAgICAgICAgIHJlbW92ZU1vZGlmaWVyOiBmdW5jdGlvbihtb2RpZmllcikge1xuICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKF90cihtb2RpZmllcikpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgYWRkTW9kaWZpZXI6IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoX3RyKG1vZGlmaWVyKSk7XG4gICAgICAgICAgICB9LFxuXG4gICAgICAgICAgICBzZXRNb2RpZmllcjogZnVuY3Rpb24obW9kaWZpZXIpIHtcbiAgICAgICAgICAgICAgdmFyIGNsYXNzZXMgPSBlbGVtZW50LmF0dHIoJ2NsYXNzJykuc3BsaXQoL1xccysvKSxcbiAgICAgICAgICAgICAgICAgIHBhdHQgPSB0ZW1wbGF0ZS5yZXBsYWNlKCcqJywgJy4nKTtcblxuICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNsYXNzZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY2xzID0gY2xhc3Nlc1tpXTtcblxuICAgICAgICAgICAgICAgIGlmIChjbHMubWF0Y2gocGF0dCkpIHtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoY2xzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKF90cihtb2RpZmllcikpO1xuICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgdG9nZ2xlTW9kaWZpZXI6IGZ1bmN0aW9uKG1vZGlmaWVyKSB7XG4gICAgICAgICAgICAgIHZhciBjbHMgPSBfdHIobW9kaWZpZXIpO1xuICAgICAgICAgICAgICBpZiAoZWxlbWVudC5oYXNDbGFzcyhjbHMpKSB7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhjbHMpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoY2xzKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG5cbiAgICAgICAgICB2YXIgYXBwZW5kID0gZnVuY3Rpb24ob2xkRm4sIG5ld0ZuKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG9sZEZuICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9sZEZuLmFwcGx5KG51bGwsIGFyZ3VtZW50cykgfHwgbmV3Rm4uYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBuZXdGbjtcbiAgICAgICAgICAgIH1c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BhdHRyaWJ1dGUgbmFtZS5cbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IGF0dHJzXG4gICAgICAgICAqIEBwYXJhbSBvYmplY3RcbiAgICAgICAgICovXG4gICAgICAgIGRlY2xhcmVWYXJBdHRyaWJ1dGU6IGZ1bmN0aW9uKGF0dHJzLCBvYmplY3QpIHtcbiAgICAgICAgICBpZiAodHlwZW9mIGF0dHJzLnZhciA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHZhciB2YXJOYW1lID0gYXR0cnMudmFyO1xuICAgICAgICAgICAgdGhpcy5fZGVmaW5lVmFyKHZhck5hbWUsIG9iamVjdCk7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIF9yZWdpc3RlckV2ZW50SGFuZGxlcjogZnVuY3Rpb24oY29tcG9uZW50LCBldmVudE5hbWUpIHtcbiAgICAgICAgICB2YXIgY2FwaXRhbGl6ZWRFdmVudE5hbWUgPSBldmVudE5hbWUuY2hhckF0KDApLnRvVXBwZXJDYXNlKCkgKyBldmVudE5hbWUuc2xpY2UoMSk7XG5cbiAgICAgICAgICBjb21wb25lbnQub24oZXZlbnROYW1lLCBmdW5jdGlvbihldmVudCkge1xuICAgICAgICAgICAgJG9uc2VuLmZpcmVDb21wb25lbnRFdmVudChjb21wb25lbnQuX2VsZW1lbnRbMF0sIGV2ZW50TmFtZSwgZXZlbnQgJiYgZXZlbnQuZGV0YWlsKTtcblxuICAgICAgICAgICAgdmFyIGhhbmRsZXIgPSBjb21wb25lbnQuX2F0dHJzWydvbnMnICsgY2FwaXRhbGl6ZWRFdmVudE5hbWVdO1xuICAgICAgICAgICAgaWYgKGhhbmRsZXIpIHtcbiAgICAgICAgICAgICAgY29tcG9uZW50Ll9zY29wZS4kZXZhbChoYW5kbGVyLCB7JGV2ZW50OiBldmVudH0pO1xuICAgICAgICAgICAgICBjb21wb25lbnQuX3Njb3BlLiRldmFsQXN5bmMoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogUmVnaXN0ZXIgZXZlbnQgaGFuZGxlcnMgZm9yIGF0dHJpYnV0ZXMuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBjb21wb25lbnRcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmd9IGV2ZW50TmFtZXNcbiAgICAgICAgICovXG4gICAgICAgIHJlZ2lzdGVyRXZlbnRIYW5kbGVyczogZnVuY3Rpb24oY29tcG9uZW50LCBldmVudE5hbWVzKSB7XG4gICAgICAgICAgZXZlbnROYW1lcyA9IGV2ZW50TmFtZXMudHJpbSgpLnNwbGl0KC9cXHMrLyk7XG5cbiAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbCA9IGV2ZW50TmFtZXMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgZXZlbnROYW1lID0gZXZlbnROYW1lc1tpXTtcbiAgICAgICAgICAgIHRoaXMuX3JlZ2lzdGVyRXZlbnRIYW5kbGVyKGNvbXBvbmVudCwgZXZlbnROYW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAgICAgICAqL1xuICAgICAgICBpc0FuZHJvaWQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiAhISR3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvYW5kcm9pZC9pKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICAgICAgICovXG4gICAgICAgIGlzSU9TOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gISEkd2luZG93Lm5hdmlnYXRvci51c2VyQWdlbnQubWF0Y2goLyhpcGFkfGlwaG9uZXxpcG9kIHRvdWNoKS9pKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHJldHVybiB7Qm9vbGVhbn1cbiAgICAgICAgICovXG4gICAgICAgIGlzV2ViVmlldzogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuICRvbnNHbG9iYWwuaXNXZWJWaWV3KCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEByZXR1cm4ge0Jvb2xlYW59XG4gICAgICAgICAqL1xuICAgICAgICBpc0lPUzdhYm92ZTogKGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciB1YSA9ICR3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudDtcbiAgICAgICAgICB2YXIgbWF0Y2ggPSB1YS5tYXRjaCgvKGlQYWR8aVBob25lfGlQb2QgdG91Y2gpOy4qQ1BVLipPUyAoXFxkKylfKFxcZCspL2kpO1xuXG4gICAgICAgICAgdmFyIHJlc3VsdCA9IG1hdGNoID8gcGFyc2VGbG9hdChtYXRjaFsyXSArICcuJyArIG1hdGNoWzNdKSA+PSA3IDogZmFsc2U7XG5cbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgIH07XG4gICAgICAgIH0pKCksXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEZpcmUgYSBuYW1lZCBldmVudCBmb3IgYSBjb21wb25lbnQuIFRoZSB2aWV3IG9iamVjdCwgaWYgaXQgZXhpc3RzLCBpcyBhdHRhY2hlZCB0byBldmVudC5jb21wb25lbnQuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7SFRNTEVsZW1lbnR9IFtkb21dXG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nfSBldmVudCBuYW1lXG4gICAgICAgICAqL1xuICAgICAgICBmaXJlQ29tcG9uZW50RXZlbnQ6IGZ1bmN0aW9uKGRvbSwgZXZlbnROYW1lLCBkYXRhKSB7XG4gICAgICAgICAgZGF0YSA9IGRhdGEgfHwge307XG5cbiAgICAgICAgICB2YXIgZXZlbnQgPSBkb2N1bWVudC5jcmVhdGVFdmVudCgnSFRNTEV2ZW50cycpO1xuXG4gICAgICAgICAgZm9yICh2YXIga2V5IGluIGRhdGEpIHtcbiAgICAgICAgICAgIGlmIChkYXRhLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgICAgZXZlbnRba2V5XSA9IGRhdGFba2V5XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBldmVudC5jb21wb25lbnQgPSBkb20gP1xuICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGRvbSkuZGF0YShkb20ubm9kZU5hbWUudG9Mb3dlckNhc2UoKSkgfHwgbnVsbCA6IG51bGw7XG4gICAgICAgICAgZXZlbnQuaW5pdEV2ZW50KGRvbS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpICsgJzonICsgZXZlbnROYW1lLCB0cnVlLCB0cnVlKTtcblxuICAgICAgICAgIGRvbS5kaXNwYXRjaEV2ZW50KGV2ZW50KTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogRGVmaW5lIGEgdmFyaWFibGUgdG8gSmF2YVNjcmlwdCBnbG9iYWwgc2NvcGUgYW5kIEFuZ3VsYXJKUyBzY29wZS5cbiAgICAgICAgICpcbiAgICAgICAgICogVXRpbC5kZWZpbmVWYXIoJ2ZvbycsICdmb28tdmFsdWUnKTtcbiAgICAgICAgICogLy8gPT4gd2luZG93LmZvbyBhbmQgJHNjb3BlLmZvbyBpcyBub3cgJ2Zvby12YWx1ZSdcbiAgICAgICAgICpcbiAgICAgICAgICogVXRpbC5kZWZpbmVWYXIoJ2Zvby5iYXInLCAnZm9vLWJhci12YWx1ZScpO1xuICAgICAgICAgKiAvLyA9PiB3aW5kb3cuZm9vLmJhciBhbmQgJHNjb3BlLmZvby5iYXIgaXMgbm93ICdmb28tYmFyLXZhbHVlJ1xuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge1N0cmluZ30gbmFtZVxuICAgICAgICAgKiBAcGFyYW0gb2JqZWN0XG4gICAgICAgICAqL1xuICAgICAgICBfZGVmaW5lVmFyOiBmdW5jdGlvbihuYW1lLCBvYmplY3QpIHtcbiAgICAgICAgICB2YXIgbmFtZXMgPSBuYW1lLnNwbGl0KC9cXC4vKTtcblxuICAgICAgICAgIGZ1bmN0aW9uIHNldChjb250YWluZXIsIG5hbWVzLCBvYmplY3QpIHtcbiAgICAgICAgICAgIHZhciBuYW1lO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuYW1lcy5sZW5ndGggLSAxOyBpKyspIHtcbiAgICAgICAgICAgICAgbmFtZSA9IG5hbWVzW2ldO1xuICAgICAgICAgICAgICBpZiAoY29udGFpbmVyW25hbWVdID09PSB1bmRlZmluZWQgfHwgY29udGFpbmVyW25hbWVdID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29udGFpbmVyW25hbWVdID0ge307XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgY29udGFpbmVyID0gY29udGFpbmVyW25hbWVdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb250YWluZXJbbmFtZXNbbmFtZXMubGVuZ3RoIC0gMV1dID0gb2JqZWN0O1xuXG4gICAgICAgICAgICBpZiAoY29udGFpbmVyW25hbWVzW25hbWVzLmxlbmd0aCAtIDFdXSAhPT0gb2JqZWN0KSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignQ2Fubm90IHNldCB2YXI9XCInICsgb2JqZWN0Ll9hdHRycy52YXIgKyAnXCIgYmVjYXVzZSBpdCB3aWxsIG92ZXJ3cml0ZSBhIHJlYWQtb25seSB2YXJpYWJsZS4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAob25zLmNvbXBvbmVudEJhc2UpIHtcbiAgICAgICAgICAgIHNldChvbnMuY29tcG9uZW50QmFzZSwgbmFtZXMsIG9iamVjdCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIGdldFNjb3BlID0gZnVuY3Rpb24oZWwpIHtcbiAgICAgICAgICAgIHJldHVybiBhbmd1bGFyLmVsZW1lbnQoZWwpLmRhdGEoJ19zY29wZScpO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICB2YXIgZWxlbWVudCA9IG9iamVjdC5fZWxlbWVudFswXTtcblxuICAgICAgICAgIC8vIEN1cnJlbnQgZWxlbWVudCBtaWdodCBub3QgaGF2ZSBkYXRhKCdfc2NvcGUnKVxuICAgICAgICAgIGlmIChlbGVtZW50Lmhhc0F0dHJpYnV0ZSgnb25zLXNjb3BlJykpIHtcbiAgICAgICAgICAgIHNldChnZXRTY29wZShlbGVtZW50KSB8fCBvYmplY3QuX3Njb3BlLCBuYW1lcywgb2JqZWN0KTtcbiAgICAgICAgICAgIGVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIEFuY2VzdG9yc1xuICAgICAgICAgIHdoaWxlIChlbGVtZW50LnBhcmVudEVsZW1lbnQpIHtcbiAgICAgICAgICAgIGVsZW1lbnQgPSBlbGVtZW50LnBhcmVudEVsZW1lbnQ7XG4gICAgICAgICAgICBpZiAoZWxlbWVudC5oYXNBdHRyaWJ1dGUoJ29ucy1zY29wZScpKSB7XG4gICAgICAgICAgICAgIHNldChnZXRTY29wZShlbGVtZW50KSwgbmFtZXMsIG9iamVjdCk7XG4gICAgICAgICAgICAgIGVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZWxlbWVudCA9IG51bGw7XG5cbiAgICAgICAgICAvLyBJZiBubyBvbnMtc2NvcGUgZWxlbWVudCB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4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cikge1xuICAgICAgICAgICAgICAgIHZhciBsaXN0ZW5lciA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGZuKHNjb3BlLCB7JGV2ZW50OiBldmVudH0pO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKG5hbWUsIGxpc3RlbmVyKTtcblxuICAgICAgICAgICAgICAgIENvbXBvbmVudENsZWFuZXIub25EZXN0cm95KHNjb3BlLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKG5hbWUsIGxpc3RlbmVyKTtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQgPSBudWxsO1xuXG4gICAgICAgICAgICAgICAgICBDb21wb25lbnRDbGVhbmVyLmRlc3Ryb3lTY29wZShzY29wZSk7XG4gICAgICAgICAgICAgICAgICBzY29wZSA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICAgIENvbXBvbmVudENsZWFuZXIuZGVzdHJveUF0dHJpYnV0ZXMoYXR0cik7XG4gICAgICAgICAgICAgICAgICBhdHRyID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9O1xuICAgICAgICB9XTtcblxuICAgICAgICBmdW5jdGlvbiBkaXJlY3RpdmVOb3JtYWxpemUobmFtZSkge1xuICAgICAgICAgIHJldHVybiBuYW1lLnJlcGxhY2UoLy0oW2Etel0pL2csIGZ1bmN0aW9uKG1hdGNoZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXRjaGVzWzFdLnRvVXBwZXJDYXNlKCk7XG4gICAgICAgICAgfSk7XG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EIsRUFBNEI7dUJBQ1gxRyxHQUFmLENBQW1CMEcsRUFBbkIsRUFBdUI5VyxTQUFTK1csSUFBVCxFQUF2Qjs7O0dBUE47Q0FIRjs7OzsifQ==
src/parser/rogue/assassination/modules/talents/ElaboratePlanning.js
FaideWW/WoWAnalyzer
import React from 'react'; import TalentStatisticBox from 'interface/others/TalentStatisticBox'; import STATISTIC_ORDER from 'interface/others/STATISTIC_ORDER'; import ItemDamageDone from 'interface/others/ItemDamageDone'; import SPELLS from 'common/SPELLS'; import { formatPercentage } from 'common/format'; import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer'; import Events from 'parser/core/Events'; import calculateEffectiveDamage from 'parser/core/calculateEffectiveDamage'; import { ABILITIES_AFFECTED_BY_DAMAGE_INCREASES } from '../../constants'; const DAMAGE_BONUS = 0.1; class ElaboratePlanning extends Analyzer { bonusDmg = 0; constructor(...args) { super(...args); this.active = this.selectedCombatant.hasTalent(SPELLS.ELABORATE_PLANNING_TALENT.id); if (!this.active) { return; } this.addEventListener(Events.damage.by(SELECTED_PLAYER).spell(ABILITIES_AFFECTED_BY_DAMAGE_INCREASES), this.addBonusDamageIfBuffed); } addBonusDamageIfBuffed(event) { if (!this.selectedCombatant.hasBuff(SPELLS.ELABORATE_PLANNING_BUFF.id) &&!this.selectedCombatant.hasBuff(SPELLS.VANISH_BUFF.id)) { return; } this.bonusDmg += calculateEffectiveDamage(event, DAMAGE_BONUS); } get percentUptime() { return this.selectedCombatant.getBuffUptime(SPELLS.ELABORATE_PLANNING_BUFF.id) / this.owner.fightDuration; } statistic() { return ( <TalentStatisticBox talent={SPELLS.ELABORATE_PLANNING_TALENT.id} position={STATISTIC_ORDER.OPTIONAL(1)} value={<ItemDamageDone amount={this.bonusDmg} />} tooltip={`${formatPercentage(this.percentUptime)} % uptime.`} /> ); } } export default ElaboratePlanning;
docs/src/HomePage.js
leozdgao/react-bootstrap
import React from 'react'; import NavMain from './NavMain'; import PageFooter from './PageFooter'; import Grid from '../../src/Grid'; import Alert from '../../src/Alert'; import Glyphicon from '../../src/Glyphicon'; import Label from '../../src/Label'; export default class HomePage extends React.Component{ render() { return ( <div> <NavMain activePage="home" /> <main className="bs-docs-masthead" id="content" role="main"> <div className="container"> <span className="bs-docs-booticon bs-docs-booticon-lg bs-docs-booticon-outline"></span> <p className="lead">The most popular front-end framework, rebuilt for React.</p> </div> </main> <Grid> <Alert bsStyle='warning'> <p><Glyphicon glyph='bullhorn' /> We are actively working to reach a 1.0.0 release, and we would love your help to get there.</p> <p><Glyphicon glyph='check' /> Check out the <a href="https://github.com/react-bootstrap/react-bootstrap/wiki#100-roadmap">1.0.0 Roadmap</a> and <a href="https://github.com/react-bootstrap/react-bootstrap/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> to see where you can help out.</p> <p><Glyphicon glyph='sunglasses' /> A great place to start is any <a target='_blank' href="https://github.com/react-bootstrap/react-bootstrap/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22">issues</a> with a <Label bsStyle='success'>help-wanted</Label> label.</p> <p><Glyphicon glyph='ok' /> We are open to pull requests that address bugs, improve documentation, enhance accessibility,</p> <p>add test coverage, or bring us closer to feature parity with <a target='_blank' href='http://getbootstrap.com/'>Bootstrap</a>.</p> <p><Glyphicon glyph='user' /> We actively seek to invite frequent pull request authors to join the organization. <Glyphicon glyph='thumbs-up' /></p> </Alert> <Alert bsStyle='danger'> <p><Glyphicon glyph='warning-sign' /> The project is under active development, and APIs will change. </p> <p><Glyphicon glyph='bullhorn' /> Prior to the 1.0.0 release, breaking changes should result in a Minor version bump.</p> </Alert> </Grid> <PageFooter /> </div> ); } }
files/rxjs/4.0.8/rx.lite.extras.compat.js
abishekrsrikaanth/jsdelivr
// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. ;(function (factory) { var objectTypes = { 'function': true, 'object': true }; function checkGlobal(value) { return (value && value.Object === Object) ? value : null; } var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); var freeSelf = checkGlobal(objectTypes[typeof self] && self); var freeWindow = checkGlobal(objectTypes[typeof window] && window); var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; var thisGlobal = checkGlobal(objectTypes[typeof this] && this); var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); // Because of build optimizers if (typeof define === 'function' && define.amd) { define(['./rx.lite.compat'], function (Rx, exports) { return factory(root, exports, Rx); }); } else if (typeof module === 'object' && module && module.exports === freeExports) { module.exports = factory(root, module.exports, require('rx-lite-compat')); } else { root.Rx = factory(root, {}, root.Rx); } }.call(this, function (root, exp, Rx, undefined) { // References var Observable = Rx.Observable, observableProto = Observable.prototype, observableNever = Observable.never, observableThrow = Observable['throw'], AnonymousObservable = Rx.AnonymousObservable, ObservableBase = Rx.ObservableBase, AnonymousObserver = Rx.AnonymousObserver, notificationCreateOnNext = Rx.Notification.createOnNext, notificationCreateOnError = Rx.Notification.createOnError, notificationCreateOnCompleted = Rx.Notification.createOnCompleted, Observer = Rx.Observer, observerCreate = Observer.create, AbstractObserver = Rx.internals.AbstractObserver, Subject = Rx.Subject, internals = Rx.internals, helpers = Rx.helpers, ScheduledObserver = internals.ScheduledObserver, SerialDisposable = Rx.SerialDisposable, SingleAssignmentDisposable = Rx.SingleAssignmentDisposable, CompositeDisposable = Rx.CompositeDisposable, BinaryDisposable = Rx.BinaryDisposable, RefCountDisposable = Rx.RefCountDisposable, disposableEmpty = Rx.Disposable.empty, immediateScheduler = Rx.Scheduler.immediate, defaultKeySerializer = helpers.defaultKeySerializer, addRef = Rx.internals.addRef, identity = helpers.identity, isPromise = helpers.isPromise, isFunction = helpers.isFunction, inherits = internals.inherits, bindCallback = internals.bindCallback, noop = helpers.noop, isScheduler = Rx.Scheduler.isScheduler, observableFromPromise = Observable.fromPromise, ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError; var errorObj = {e: {}}; function tryCatcherGen(tryCatchTarget) { return function tryCatcher() { try { return tryCatchTarget.apply(this, arguments); } catch (e) { errorObj.e = e; return errorObj; } }; } var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } return tryCatcherGen(fn); }; function thrower(e) { throw e; } function ScheduledDisposable(scheduler, disposable) { this.scheduler = scheduler; this.disposable = disposable; this.isDisposed = false; } function scheduleItem(s, self) { if (!self.isDisposed) { self.isDisposed = true; self.disposable.dispose(); } } ScheduledDisposable.prototype.dispose = function () { this.scheduler.schedule(this, scheduleItem); }; var CheckedObserver = (function (__super__) { inherits(CheckedObserver, __super__); function CheckedObserver(observer) { __super__.call(this); this._observer = observer; this._state = 0; // 0 - idle, 1 - busy, 2 - done } var CheckedObserverPrototype = CheckedObserver.prototype; CheckedObserverPrototype.onNext = function (value) { this.checkAccess(); var res = tryCatch(this._observer.onNext).call(this._observer, value); this._state = 0; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.onError = function (err) { this.checkAccess(); var res = tryCatch(this._observer.onError).call(this._observer, err); this._state = 2; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.onCompleted = function () { this.checkAccess(); var res = tryCatch(this._observer.onCompleted).call(this._observer); this._state = 2; res === errorObj && thrower(res.e); }; CheckedObserverPrototype.checkAccess = function () { if (this._state === 1) { throw new Error('Re-entrancy detected'); } if (this._state === 2) { throw new Error('Observer completed'); } if (this._state === 0) { this._state = 1; } }; return CheckedObserver; }(Observer)); var ObserveOnObserver = (function (__super__) { inherits(ObserveOnObserver, __super__); function ObserveOnObserver(scheduler, observer, cancel) { __super__.call(this, scheduler, observer); this._cancel = cancel; } ObserveOnObserver.prototype.next = function (value) { __super__.prototype.next.call(this, value); this.ensureActive(); }; ObserveOnObserver.prototype.error = function (e) { __super__.prototype.error.call(this, e); this.ensureActive(); }; ObserveOnObserver.prototype.completed = function () { __super__.prototype.completed.call(this); this.ensureActive(); }; ObserveOnObserver.prototype.dispose = function () { __super__.prototype.dispose.call(this); this._cancel && this._cancel.dispose(); this._cancel = null; }; return ObserveOnObserver; })(ScheduledObserver); /** * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. * If a violation is detected, an Error is thrown from the offending observer method call. * * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. */ Observer.prototype.checked = function () { return new CheckedObserver(this); }; /** * Schedules the invocation of observer methods on the given scheduler. * @param {Scheduler} scheduler Scheduler to schedule observer messages on. * @returns {Observer} Observer whose messages are scheduled on the given scheduler. */ Observer.notifyOn = function (scheduler) { return new ObserveOnObserver(scheduler, this); }; /** * Creates an observer from a notification callback. * @param {Function} handler Action that handles a notification. * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. */ Observer.fromNotifier = function (handler, thisArg) { var handlerFunc = bindCallback(handler, thisArg, 1); return new AnonymousObserver(function (x) { return handlerFunc(notificationCreateOnNext(x)); }, function (e) { return handlerFunc(notificationCreateOnError(e)); }, function () { return handlerFunc(notificationCreateOnCompleted()); }); }; /** * Creates a notification callback from an observer. * @returns The action that forwards its input notification to the underlying observer. */ Observer.prototype.toNotifier = function () { var observer = this; return function (n) { return n.accept(observer); }; }; /** * Hides the identity of an observer. * @returns An observer that hides the identity of the specified observer. */ Observer.prototype.asObserver = function () { var source = this; return new AnonymousObserver( function (x) { source.onNext(x); }, function (e) { source.onError(e); }, function () { source.onCompleted(); } ); }; var ObserveOnObservable = (function (__super__) { inherits(ObserveOnObservable, __super__); function ObserveOnObservable(source, s) { this.source = source; this._s = s; __super__.call(this); } ObserveOnObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new ObserveOnObserver(this._s, o)); }; return ObserveOnObservable; }(ObservableBase)); /** * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. * * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects * that require to be run on a scheduler, use subscribeOn. * * @param {Scheduler} scheduler Scheduler to notify observers on. * @returns {Observable} The source sequence whose observations happen on the specified scheduler. */ observableProto.observeOn = function (scheduler) { return new ObserveOnObservable(this, scheduler); }; var SubscribeOnObservable = (function (__super__) { inherits(SubscribeOnObservable, __super__); function SubscribeOnObservable(source, s) { this.source = source; this._s = s; __super__.call(this); } function scheduleMethod(scheduler, state) { var source = state[0], d = state[1], o = state[2]; d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(o))); } SubscribeOnObservable.prototype.subscribeCore = function (o) { var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); d.setDisposable(m); m.setDisposable(this._s.schedule([this.source, d, o], scheduleMethod)); return d; }; return SubscribeOnObservable; }(ObservableBase)); /** * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; * see the remarks section for more information on the distinction between subscribeOn and observeOn. * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer * callbacks on a scheduler, use observeOn. * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. */ observableProto.subscribeOn = function (scheduler) { return new SubscribeOnObservable(this, scheduler); }; var GenerateObservable = (function (__super__) { inherits(GenerateObservable, __super__); function GenerateObservable(state, cndFn, itrFn, resFn, s) { this._initialState = state; this._cndFn = cndFn; this._itrFn = itrFn; this._resFn = resFn; this._s = s; __super__.call(this); } function scheduleRecursive(state, recurse) { if (state.first) { state.first = false; } else { state.newState = tryCatch(state.self._itrFn)(state.newState); if (state.newState === errorObj) { return state.o.onError(state.newState.e); } } var hasResult = tryCatch(state.self._cndFn)(state.newState); if (hasResult === errorObj) { return state.o.onError(hasResult.e); } if (hasResult) { var result = tryCatch(state.self._resFn)(state.newState); if (result === errorObj) { return state.o.onError(result.e); } state.o.onNext(result); recurse(state); } else { state.o.onCompleted(); } } GenerateObservable.prototype.subscribeCore = function (o) { var state = { o: o, self: this, first: true, newState: this._initialState }; return this._s.scheduleRecursive(state, scheduleRecursive); }; return GenerateObservable; }(ObservableBase)); /** * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. * * @example * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); * @param {Mixed} initialState Initial state. * @param {Function} condition Condition to terminate generation (upon returning false). * @param {Function} iterate Iteration step function. * @param {Function} resultSelector Selector function for results produced in the sequence. * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. * @returns {Observable} The generated sequence. */ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { isScheduler(scheduler) || (scheduler = currentThreadScheduler); return new GenerateObservable(initialState, condition, iterate, resultSelector, scheduler); }; var UsingObservable = (function (__super__) { inherits(UsingObservable, __super__); function UsingObservable(resFn, obsFn) { this._resFn = resFn; this._obsFn = obsFn; __super__.call(this); } UsingObservable.prototype.subscribeCore = function (o) { var disposable = disposableEmpty; var resource = tryCatch(this._resFn)(); if (resource === errorObj) { return new BinaryDisposable(observableThrow(resource.e).subscribe(o), disposable); } resource && (disposable = resource); var source = tryCatch(this._obsFn)(resource); if (source === errorObj) { return new BinaryDisposable(observableThrow(source.e).subscribe(o), disposable); } return new BinaryDisposable(source.subscribe(o), disposable); }; return UsingObservable; }(ObservableBase)); /** * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. * @param {Function} resourceFactory Factory function to obtain a resource object. * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource. * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object. */ Observable.using = function (resourceFactory, observableFactory) { return new UsingObservable(resourceFactory, observableFactory); }; /** * Propagates the observable sequence or Promise that reacts first. * @param {Observable} rightSource Second observable sequence or Promise. * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first. */ observableProto.amb = function (rightSource) { var leftSource = this; return new AnonymousObservable(function (observer) { var choice, leftChoice = 'L', rightChoice = 'R', leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable(); isPromise(rightSource) && (rightSource = observableFromPromise(rightSource)); function choiceL() { if (!choice) { choice = leftChoice; rightSubscription.dispose(); } } function choiceR() { if (!choice) { choice = rightChoice; leftSubscription.dispose(); } } var leftSubscribe = observerCreate( function (left) { choiceL(); choice === leftChoice && observer.onNext(left); }, function (e) { choiceL(); choice === leftChoice && observer.onError(e); }, function () { choiceL(); choice === leftChoice && observer.onCompleted(); } ); var rightSubscribe = observerCreate( function (right) { choiceR(); choice === rightChoice && observer.onNext(right); }, function (e) { choiceR(); choice === rightChoice && observer.onError(e); }, function () { choiceR(); choice === rightChoice && observer.onCompleted(); } ); leftSubscription.setDisposable(leftSource.subscribe(leftSubscribe)); rightSubscription.setDisposable(rightSource.subscribe(rightSubscribe)); return new BinaryDisposable(leftSubscription, rightSubscription); }); }; function amb(p, c) { return p.amb(c); } /** * Propagates the observable sequence or Promise that reacts first. * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first. */ Observable.amb = function () { var acc = observableNever(), items; if (Array.isArray(arguments[0])) { items = arguments[0]; } else { var len = arguments.length; items = new Array(items); for(var i = 0; i < len; i++) { items[i] = arguments[i]; } } for (var i = 0, len = items.length; i < len; i++) { acc = amb(acc, items[i]); } return acc; }; /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. */ observableProto.onErrorResumeNext = function (second) { if (!second) { throw new Error('Second observable is required'); } return onErrorResumeNext([this, second]); }; var OnErrorResumeNextObservable = (function(__super__) { inherits(OnErrorResumeNextObservable, __super__); function OnErrorResumeNextObservable(sources) { this.sources = sources; __super__.call(this); } function scheduleMethod(state, recurse) { if (state.pos < state.sources.length) { var current = state.sources[state.pos++]; isPromise(current) && (current = observableFromPromise(current)); var d = new SingleAssignmentDisposable(); state.subscription.setDisposable(d); d.setDisposable(current.subscribe(new OnErrorResumeNextObserver(state, recurse))); } else { state.o.onCompleted(); } } OnErrorResumeNextObservable.prototype.subscribeCore = function (o) { var subscription = new SerialDisposable(), state = {pos: 0, subscription: subscription, o: o, sources: this.sources }, cancellable = immediateScheduler.scheduleRecursive(state, scheduleMethod); return new BinaryDisposable(subscription, cancellable); }; return OnErrorResumeNextObservable; }(ObservableBase)); var OnErrorResumeNextObserver = (function(__super__) { inherits(OnErrorResumeNextObserver, __super__); function OnErrorResumeNextObserver(state, recurse) { this._state = state; this._recurse = recurse; __super__.call(this); } OnErrorResumeNextObserver.prototype.next = function (x) { this._state.o.onNext(x); }; OnErrorResumeNextObserver.prototype.error = function () { this._recurse(this._state); }; OnErrorResumeNextObserver.prototype.completed = function () { this._recurse(this._state); }; return OnErrorResumeNextObserver; }(AbstractObserver)); /** * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. */ var onErrorResumeNext = Observable.onErrorResumeNext = function () { var sources = []; if (Array.isArray(arguments[0])) { sources = arguments[0]; } else { var len = arguments.length; sources = new Array(len); for(var i = 0; i < len; i++) { sources[i] = arguments[i]; } } return new OnErrorResumeNextObservable(sources); }; function toArray(x) { return x.toArray(); } function notEmpty(x) { return x.length > 0; } /** * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. * @param {Number} count Length of each buffer. * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. * @returns {Observable} An observable sequence of buffers. */ observableProto.bufferWithCount = function (count, skip) { typeof skip !== 'number' && (skip = count); return this.windowWithCount(count, skip) .flatMap(toArray) .filter(notEmpty); }; /** * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. * @param {Number} count Length of each window. * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. * @returns {Observable} An observable sequence of windows. */ observableProto.windowWithCount = function (count, skip) { var source = this; +count || (count = 0); Math.abs(count) === Infinity && (count = 0); if (count <= 0) { throw new ArgumentOutOfRangeError(); } skip == null && (skip = count); +skip || (skip = 0); Math.abs(skip) === Infinity && (skip = 0); if (skip <= 0) { throw new ArgumentOutOfRangeError(); } return new AnonymousObservable(function (observer) { var m = new SingleAssignmentDisposable(), refCountDisposable = new RefCountDisposable(m), n = 0, q = []; function createWindow () { var s = new Subject(); q.push(s); observer.onNext(addRef(s, refCountDisposable)); } createWindow(); m.setDisposable(source.subscribe( function (x) { for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } var c = n - count + 1; c >= 0 && c % skip === 0 && q.shift().onCompleted(); ++n % skip === 0 && createWindow(); }, function (e) { while (q.length > 0) { q.shift().onError(e); } observer.onError(e); }, function () { while (q.length > 0) { q.shift().onCompleted(); } observer.onCompleted(); } )); return refCountDisposable; }, source); }; var TakeLastBufferObserver = (function (__super__) { inherits(TakeLastBufferObserver, __super__); function TakeLastBufferObserver(o, c) { this._o = o; this._c = c; this._q = []; __super__.call(this); } TakeLastBufferObserver.prototype.next = function (x) { this._q.push(x); this._q.length > this._c && this._q.shift(); }; TakeLastBufferObserver.prototype.error = function (e) { this._o.onError(e); }; TakeLastBufferObserver.prototype.completed = function () { this._o.onNext(this._q); this._o.onCompleted(); }; return TakeLastBufferObserver; }(AbstractObserver)); /** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { if (count < 0) { throw new ArgumentOutOfRangeError(); } var source = this; return new AnonymousObservable(function (o) { return source.subscribe(new TakeLastBufferObserver(o, count)); }, source); }; var DefaultIfEmptyObserver = (function (__super__) { inherits(DefaultIfEmptyObserver, __super__); function DefaultIfEmptyObserver(o, d) { this._o = o; this._d = d; this._f = false; __super__.call(this); } DefaultIfEmptyObserver.prototype.next = function (x) { this._f = true; this._o.onNext(x); }; DefaultIfEmptyObserver.prototype.error = function (e) { this._o.onError(e); }; DefaultIfEmptyObserver.prototype.completed = function () { !this._f && this._o.onNext(this._d); this._o.onCompleted(); }; return DefaultIfEmptyObserver; }(AbstractObserver)); /** * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. * * var res = obs = xs.defaultIfEmpty(); * 2 - obs = xs.defaultIfEmpty(false); * * @memberOf Observable# * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. */ observableProto.defaultIfEmpty = function (defaultValue) { var source = this; defaultValue === undefined && (defaultValue = null); return new AnonymousObservable(function (o) { return source.subscribe(new DefaultIfEmptyObserver(o, defaultValue)); }, source); }; // Swap out for Array.findIndex function arrayIndexOfComparer(array, item, comparer) { for (var i = 0, len = array.length; i < len; i++) { if (comparer(array[i], item)) { return i; } } return -1; } function HashSet(comparer) { this.comparer = comparer; this.set = []; } HashSet.prototype.push = function(value) { var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; retValue && this.set.push(value); return retValue; }; var DistinctObservable = (function (__super__) { inherits(DistinctObservable, __super__); function DistinctObservable(source, keyFn, cmpFn) { this.source = source; this._keyFn = keyFn; this._cmpFn = cmpFn; __super__.call(this); } DistinctObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new DistinctObserver(o, this._keyFn, this._cmpFn)); }; return DistinctObservable; }(ObservableBase)); var DistinctObserver = (function (__super__) { inherits(DistinctObserver, __super__); function DistinctObserver(o, keyFn, cmpFn) { this._o = o; this._keyFn = keyFn; this._h = new HashSet(cmpFn); __super__.call(this); } DistinctObserver.prototype.next = function (x) { var key = x; if (isFunction(this._keyFn)) { key = tryCatch(this._keyFn)(x); if (key === errorObj) { return this._o.onError(key.e); } } this._h.push(key) && this._o.onNext(x); }; DistinctObserver.prototype.error = function (e) { this._o.onError(e); }; DistinctObserver.prototype.completed = function () { this._o.onCompleted(); }; return DistinctObserver; }(AbstractObserver)); /** * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. * * @example * var res = obs = xs.distinct(); * 2 - obs = xs.distinct(function (x) { return x.id; }); * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); * @param {Function} [keySelector] A function to compute the comparison key for each element. * @param {Function} [comparer] Used to compare items in the collection. * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. */ observableProto.distinct = function (keySelector, comparer) { comparer || (comparer = defaultComparer); return new DistinctObservable(this, keySelector, comparer); }; /** * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`) * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source. */ observableProto.singleInstance = function() { var source = this, hasObservable = false, observable; function getObservable() { if (!hasObservable) { hasObservable = true; observable = source['finally'](function() { hasObservable = false; }).publish().refCount(); } return observable; } return new AnonymousObservable(function(o) { return getObservable().subscribe(o); }); }; return Rx; }));
src/svg-icons/av/replay-5.js
lawrence-yu/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvReplay5 = (props) => ( <SvgIcon {...props}> <path d="M12 5V1L7 6l5 5V7c3.3 0 6 2.7 6 6s-2.7 6-6 6-6-2.7-6-6H4c0 4.4 3.6 8 8 8s8-3.6 8-8-3.6-8-8-8zm-1.3 8.9l.2-2.2h2.4v.7h-1.7l-.1.9s.1 0 .1-.1.1 0 .1-.1.1 0 .2 0h.2c.2 0 .4 0 .5.1s.3.2.4.3.2.3.3.5.1.4.1.6c0 .2 0 .4-.1.5s-.1.3-.3.5-.3.2-.4.3-.4.1-.6.1c-.2 0-.4 0-.5-.1s-.3-.1-.5-.2-.2-.2-.3-.4-.1-.3-.1-.5h.8c0 .2.1.3.2.4s.2.1.4.1c.1 0 .2 0 .3-.1l.2-.2s.1-.2.1-.3v-.6l-.1-.2-.2-.2s-.2-.1-.3-.1h-.2s-.1 0-.2.1-.1 0-.1.1-.1.1-.1.1h-.7z"/> </SvgIcon> ); AvReplay5 = pure(AvReplay5); AvReplay5.displayName = 'AvReplay5'; AvReplay5.muiName = 'SvgIcon'; export default AvReplay5;
src/routes/dev.js
Capgemini/mesos-ui
import _ from 'lodash'; import fs from 'fs'; import path from 'path'; import React from 'react'; import Router from 'react-router'; import routes from './react-routes'; import proxy from 'express-http-proxy'; import express from 'express'; module.exports = function(app) { var config = require('../config/config'); var router = express.Router(); // The top-level React component + HTML template for it let leader = process.env.MESOS_ENDPOINT; setRoutes(app, leader); function setRoutes(app, leader) { const templateFile = path.join(__dirname, 'master/static/index.html'); const template = _.template(fs.readFileSync(templateFile, 'utf8')); var config = require('../config/config'); app.get(config.proxyPath + '/*', proxy(leader, { forwardPath: function(req, res) { // Gets the path after 'proxy/'. let path = require('url').parse(req.url).path; return path.slice(config.mesosEndpoint.length); } })); app.get('*', function(req, res, next) { try { let data = { title: '', description: '', css: '', body: '' }; let css = []; Router.run(routes, req.url, function(Handler) { let application = (<Handler context={{ onInsertCss: value => css.push(value), onSetTitle: value => data.title = value, onSetMeta: (key, value) => data[key] = value }} /> ); data.body = React.renderToString(application); data.css = css.join(''); let html = template(data); res.send(html); }); } catch (err) { next(err); } }); } };
src/svg-icons/file/cloud-off.js
nathanmarks/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let FileCloudOff = (props) => ( <SvgIcon {...props}> <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.48 0-2.85.43-4.01 1.17l1.46 1.46C10.21 6.23 11.08 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 1.13-.64 2.11-1.56 2.62l1.45 1.45C23.16 18.16 24 16.68 24 15c0-2.64-2.05-4.78-4.65-4.96zM3 5.27l2.75 2.74C2.56 8.15 0 10.77 0 14c0 3.31 2.69 6 6 6h11.73l2 2L21 20.73 4.27 4 3 5.27zM7.73 10l8 8H6c-2.21 0-4-1.79-4-4s1.79-4 4-4h1.73z"/> </SvgIcon> ); FileCloudOff = pure(FileCloudOff); FileCloudOff.displayName = 'FileCloudOff'; FileCloudOff.muiName = 'SvgIcon'; export default FileCloudOff;
.eslintrc.js
owencm/material-ui
module.exports = { // So parent files don't get applied root: true, env: { es6: true, browser: true, node: true, }, extends: 'eslint:recommended', parser: 'babel-eslint', parserOptions: { ecmaVersion: 7, sourceType: 'module', ecmaFeatures: { jsx: true, experimentalObjectRestSpread: true, } }, plugins: [ 'babel', 'react', 'mocha', 'material-ui', ], rules: { 'array-bracket-spacing': ['error', 'never'], 'arrow-spacing': 'error', 'arrow-parens': 'error', 'block-spacing': ['error', 'always'], 'brace-style': 'error', 'comma-dangle': ['error', 'always-multiline'], 'comma-spacing': ['error', {before: false, after: true}], 'comma-style': ['error', 'last'], 'computed-property-spacing': ['error', 'never'], 'consistent-this': ['error', 'self'], 'consistent-return': 'off', // Wishlist, one day 'dot-notation': 'error', 'dot-location': ['error', 'property'], 'eqeqeq': ['error', 'smart'], 'eol-last': 'error', 'indent': ['error', 2, {SwitchCase: 1}], 'id-blacklist': ['error', 'e'], 'jsx-quotes': ['error', 'prefer-double'], 'keyword-spacing': 'error', 'key-spacing': 'error', 'max-len': ['error', 120, 4], 'new-cap': ['off', {capIsNew: true, newIsCap: true}], // Wishlist, one day 'no-unused-expressions': 'error', 'no-unused-vars': 'error', 'no-shadow': 'off', // Wishlist, one day 'no-spaced-func': 'error', 'no-multiple-empty-lines': 'error', 'no-multi-spaces': 'error', 'no-undef': 'error', 'no-empty-pattern': 'error', 'no-dupe-keys': 'error', 'no-dupe-args': 'error', 'no-duplicate-case': 'error', 'no-cond-assign': 'error', 'no-extra-semi': 'error', 'no-extra-boolean-cast': 'error', 'no-trailing-spaces': 'error', 'no-underscore-dangle': 'error', 'no-unneeded-ternary': 'error', 'no-unreachable': 'error', 'no-var': 'error', 'one-var': ['error', 'never'], 'operator-linebreak': ['error', 'after'], 'padded-blocks': ['error', 'never'], 'prefer-arrow-callback': 'off', // Wishlist, one day 'prefer-const': 'error', 'prefer-template': 'error', 'quotes': ['error', 'single', 'avoid-escape'], 'semi': ['error', 'always'], 'space-before-blocks': ['error', 'always'], 'space-before-function-paren': ['error', 'never'], 'space-infix-ops': 'error', 'space-unary-ops': ['error', { words: true, nonwords: false }], 'spaced-comment': 'error', 'yoda': 'error', 'babel/object-curly-spacing': ['error', 'never'], 'babel/generator-star-spacing': 'error', 'babel/array-bracket-spacing': 'error', 'babel/arrow-parens': 'error', 'babel/no-await-in-loop': 'error', 'babel/func-params-comma-dangle': 'error', 'babel/flow-object-type': 'error', 'react/display-name': 'error', 'react/jsx-boolean-value': ['error', 'always'], 'react/jsx-closing-bracket-location': 'error', 'react/jsx-curly-spacing': 'error', 'react/jsx-equals-spacing': 'error', 'react/jsx-filename-extension': ['error', {extensions: ['.js']}], 'react/jsx-first-prop-new-line': ['error', 'multiline'], 'react/jsx-handler-names': 'error', 'react/jsx-indent': ['error', 2], 'react/jsx-indent-props': ['error', 2], 'react/jsx-max-props-per-line': ['error', {maximum: 3}], 'react/jsx-no-duplicate-props': 'error', 'react/jsx-no-undef': 'error', 'react/jsx-pascal-case': 'error', 'react/jsx-space-before-closing': 'error', 'react/jsx-uses-react': 'error', 'react/jsx-uses-vars': 'error', 'react/no-comment-textnodes': 'error', 'react/no-danger': 'error', 'react/no-deprecated': 'error', 'react/no-did-mount-set-state': 'error', 'react/no-did-update-set-state': 'error', 'react/no-direct-mutation-state': 'error', 'react/no-multi-comp': 'off', // Wishlist, one day 'react/no-render-return-value': 'error', 'react/no-is-mounted': 'error', 'react/no-unknown-property': 'error', 'react/prefer-arrow-callback': 'off', // Wishlist, one day 'react/prefer-es6-class': 'error', 'react/prop-types': 'error', 'react/react-in-jsx-scope': 'error', 'react/require-extension': 'error', 'react/require-render-return': 'error', 'react/self-closing-comp': 'error', 'react/sort-comp': 'error', 'react/sort-prop-types': 'error', 'react/wrap-multilines': 'error', 'material-ui/docgen-ignore-before-comment': 'error', 'mocha/handle-done-callback': 'error', 'mocha/no-exclusive-tests': 'error', 'mocha/no-global-tests': 'error', 'mocha/no-pending-tests': 'error', 'mocha/no-skipped-tests': 'error', 'react/no-string-refs': 'warn', // Whishlist, one day. 'strict': 'off', 'no-case-declarations': 'off', 'react/jsx-key': 'off', 'react/jsx-no-bind': 'off', 'react/jsx-no-literals': 'off', 'react/jsx-no-target-blank': 'off', 'react/jsx-sort-props': 'off', 'react/no-set-state': 'off', 'react/forbid-prop-types': 'off', 'react/prefer-stateless-function': 'off', 'react/require-optimization': 'off', 'mocha/no-synchronous-tests': 'off', 'mocha/valid-suite-description': 'off', 'mocha/valid-test-description': 'off', 'babel/object-shorthand': 'off', 'babel/new-cap': 'off', }, };
src/svg-icons/device/battery-unknown.js
matthewoates/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let DeviceBatteryUnknown = (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 4zm-2.72 13.95h-1.9v-1.9h1.9v1.9zm1.35-5.26s-.38.42-.67.71c-.48.48-.83 1.15-.83 1.6h-1.6c0-.83.46-1.52.93-2l.93-.94c.27-.27.44-.65.44-1.06 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5H9c0-1.66 1.34-3 3-3s3 1.34 3 3c0 .66-.27 1.26-.7 1.69z"/> </SvgIcon> ); DeviceBatteryUnknown = pure(DeviceBatteryUnknown); DeviceBatteryUnknown.displayName = 'DeviceBatteryUnknown'; DeviceBatteryUnknown.muiName = 'SvgIcon'; export default DeviceBatteryUnknown;
src/ColumnComparer.js
yogesh-patel/react-data-grid
/* TODO@flow objects as a map */ var isValidElement = require('react').isValidElement; module.exports = function sameColumn(a: Column, b: Column): boolean { var k; for (k in a) { if (a.hasOwnProperty(k)) { if ((typeof a[k] === 'function' && typeof b[k] === 'function') || (isValidElement(a[k]) && isValidElement(b[k]))) { continue; } if (!b.hasOwnProperty(k) || a[k] !== b[k]) { return false; } } } for (k in b) { if (b.hasOwnProperty(k) && !a.hasOwnProperty(k)) { return false; } } return true; };
node_modules/bs-recipes/recipes/webpack.react-transform-hmr/app/js/main.js
andresd24/Heroes
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'));
packages/material-ui-icons/src/KeyboardArrowRightRounded.js
Kagami/material-ui
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path d="M9.29 15.88L13.17 12 9.29 8.12a.9959.9959 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z" /></React.Fragment> , 'KeyboardArrowRightRounded');
ajax/libs/vue/1.0.0-alpha.5/vue.js
hare1039/cdnjs
/*! * Vue.js v1.0.0-alpha.5 * (c) 2015 Evan You * Released under the MIT License. */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["Vue"] = factory(); else root["Vue"] = factory(); })(this, function() { return /******/ (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__) { var _ = __webpack_require__(1) var extend = _.extend /** * The exposed Vue constructor. * * API conventions: * - public API methods/properties are prefiexed with `$` * - internal methods/properties are prefixed with `_` * - non-prefixed properties are assumed to be proxied user * data. * * @constructor * @param {Object} [options] * @public */ function Vue (options) { this._init(options) } /** * Mixin global API */ extend(Vue, __webpack_require__(14)) /** * Vue and every constructor that extends Vue has an * associated options object, which can be accessed during * compilation steps as `this.constructor.options`. * * These can be seen as the default options of every * Vue instance. */ Vue.options = { replace: true, directives: __webpack_require__(31), elementDirectives: __webpack_require__(55), filters: __webpack_require__(45), transitions: {}, components: {}, partials: {} } /** * Build up the prototype */ var p = Vue.prototype /** * $data has a setter which does a bunch of * teardown/setup work */ Object.defineProperty(p, '$data', { get: function () { return this._data }, set: function (newData) { if (newData !== this._data) { this._setData(newData) } } }) /** * 1.0.0-alpha for 0.12 compat */ Object.defineProperty(p, '$els', { get: function () { return this.$$ } }) Object.defineProperty(p, '$refs', { get: function () { return this.$ } }) /** * Mixin internal instance methods */ extend(p, __webpack_require__(58)) extend(p, __webpack_require__(59)) extend(p, __webpack_require__(60)) extend(p, __webpack_require__(63)) extend(p, __webpack_require__(65)) /** * Mixin public API methods */ extend(p, __webpack_require__(66)) extend(p, __webpack_require__(67)) extend(p, __webpack_require__(68)) extend(p, __webpack_require__(69)) extend(p, __webpack_require__(70)) Vue.version = '1.0.0-alpha' module.exports = _.Vue = Vue /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { var lang = __webpack_require__(2) var extend = lang.extend extend(exports, lang) extend(exports, __webpack_require__(4)) extend(exports, __webpack_require__(5)) extend(exports, __webpack_require__(10)) extend(exports, __webpack_require__(11)) extend(exports, __webpack_require__(12)) /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { var Dep = __webpack_require__(3) /** * Check if a string starts with $ or _ * * @param {String} str * @return {Boolean} */ exports.isReserved = function (str) { var c = (str + '').charCodeAt(0) return c === 0x24 || c === 0x5F } /** * Guard text output, make sure undefined outputs * empty string * * @param {*} value * @return {String} */ exports.toString = function (value) { return value == null ? '' : value.toString() } /** * Check and convert possible numeric strings to numbers * before setting back to data * * @param {*} value * @return {*|Number} */ exports.toNumber = function (value) { if (typeof value !== 'string') { return value } else { var parsed = Number(value) return isNaN(parsed) ? value : parsed } } /** * Convert string boolean literals into real booleans. * * @param {*} value * @return {*|Boolean} */ exports.toBoolean = function (value) { return value === 'true' ? true : value === 'false' ? false : value } /** * Strip quotes from a string * * @param {String} str * @return {String | false} */ exports.stripQuotes = function (str) { var a = str.charCodeAt(0) var b = str.charCodeAt(str.length - 1) return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : false } /** * Camelize a hyphen-delmited string. * * @param {String} str * @return {String} */ exports.camelize = function (str) { return str.replace(/-(\w)/g, toUpper) } function toUpper (_, c) { return c ? c.toUpperCase() : '' } /** * Hyphenate a camelCase string. * * @param {String} str * @return {String} */ exports.hyphenate = function (str) { return str .replace(/([a-z\d])([A-Z])/g, '$1-$2') .toLowerCase() } /** * Converts hyphen/underscore/slash delimitered names into * camelized classNames. * * e.g. my-component => MyComponent * some_else => SomeElse * some/comp => SomeComp * * @param {String} str * @return {String} */ var classifyRE = /(?:^|[-_\/])(\w)/g exports.classify = function (str) { return str.replace(classifyRE, toUpper) } /** * Simple bind, faster than native * * @param {Function} fn * @param {Object} ctx * @return {Function} */ exports.bind = function (fn, ctx) { return function (a) { var l = arguments.length return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx) } } /** * Convert an Array-like object to a real Array. * * @param {Array-like} list * @param {Number} [start] - start index * @return {Array} */ exports.toArray = function (list, start) { start = start || 0 var i = list.length - start var ret = new Array(i) while (i--) { ret[i] = list[i + start] } return ret } /** * Mix properties into target object. * * @param {Object} to * @param {Object} from */ exports.extend = function (to, from) { for (var key in from) { to[key] = from[key] } return to } /** * Quick object check - this is primarily used to tell * Objects from primitive values when we know the value * is a JSON-compliant type. * * @param {*} obj * @return {Boolean} */ exports.isObject = function (obj) { return obj !== null && typeof obj === 'object' } /** * Strict object type check. Only returns true * for plain JavaScript objects. * * @param {*} obj * @return {Boolean} */ var toString = Object.prototype.toString var OBJECT_STRING = '[object Object]' exports.isPlainObject = function (obj) { return toString.call(obj) === OBJECT_STRING } /** * Array type check. * * @param {*} obj * @return {Boolean} */ exports.isArray = Array.isArray /** * Define a non-enumerable property * * @param {Object} obj * @param {String} key * @param {*} val * @param {Boolean} [enumerable] */ exports.define = function (obj, key, val, enumerable) { Object.defineProperty(obj, key, { value: val, enumerable: !!enumerable, writable: true, configurable: true }) } /** * Define a reactive property. * * @param {Object} obj * @param {String} key * @param {*} val */ exports.defineReactive = function (obj, key, val) { var dep = new Dep() Object.defineProperty(obj, key, { enumerable: true, get: function metaGetter () { if (Dep.target) { dep.depend() } return val }, set: function metaSetter (newVal) { if (val !== newVal) { val = newVal dep.notify() } } }) } /** * Debounce a function so it only gets called after the * input stops arriving after the given wait period. * * @param {Function} func * @param {Number} wait * @return {Function} - the debounced function */ exports.debounce = function (func, wait) { var timeout, args, context, timestamp, result var later = function () { var last = Date.now() - timestamp if (last < wait && last >= 0) { timeout = setTimeout(later, wait - last) } else { timeout = null result = func.apply(context, args) if (!timeout) context = args = null } } return function () { context = this args = arguments timestamp = Date.now() if (!timeout) { timeout = setTimeout(later, wait) } return result } } /** * Manual indexOf because it's slightly faster than * native. * * @param {Array} arr * @param {*} obj */ exports.indexOf = function (arr, obj) { var i = arr.length while (i--) { if (arr[i] === obj) return i } return -1 } /** * Make a cancellable version of an async callback. * * @param {Function} fn * @return {Function} */ exports.cancellable = function (fn) { var cb = function () { if (!cb.cancelled) { return fn.apply(this, arguments) } } cb.cancel = function () { cb.cancelled = true } return cb } /** * Check if two values are loosely equal - that is, * if they are plain objects, do they have the same shape? * * @param {*} a * @param {*} b * @return {Boolean} */ exports.looseEqual = function (a, b) { /* eslint-disable eqeqeq */ return a == b || ( exports.isObject(a) && exports.isObject(b) ? JSON.stringify(a) === JSON.stringify(b) : false ) /* eslint-enable eqeqeq */ } /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * A dep is an observable that can have multiple * directives subscribing to it. * * @constructor */ function Dep () { this.subs = [] } // the current target watcher being evaluated. // this is globally unique because there could be only one // watcher being evaluated at any time. Dep.target = null /** * Add a directive subscriber. * * @param {Directive} sub */ Dep.prototype.addSub = function (sub) { this.subs.push(sub) } /** * Remove a directive subscriber. * * @param {Directive} sub */ Dep.prototype.removeSub = function (sub) { this.subs.$remove(sub) } /** * Add self as a dependency to the target watcher. */ Dep.prototype.depend = function () { Dep.target.addDep(this) } /** * Notify all subscribers of a new value. */ Dep.prototype.notify = function () { // stablize the subscriber list first var subs = _.toArray(this.subs) for (var i = 0, l = subs.length; i < l; i++) { subs[i].update() } } module.exports = Dep /***/ }, /* 4 */ /***/ function(module, exports) { // can we use __proto__? exports.hasProto = '__proto__' in {} // Browser environment sniffing var inBrowser = exports.inBrowser = typeof window !== 'undefined' && Object.prototype.toString.call(window) !== '[object Object]' exports.isIE9 = inBrowser && navigator.userAgent.toLowerCase().indexOf('msie 9.0') > 0 exports.isAndroid = inBrowser && navigator.userAgent.toLowerCase().indexOf('android') > 0 // Transition property/event sniffing if (inBrowser && !exports.isIE9) { var isWebkitTrans = window.ontransitionend === undefined && window.onwebkittransitionend !== undefined var isWebkitAnim = window.onanimationend === undefined && window.onwebkitanimationend !== undefined exports.transitionProp = isWebkitTrans ? 'WebkitTransition' : 'transition' exports.transitionEndEvent = isWebkitTrans ? 'webkitTransitionEnd' : 'transitionend' exports.animationProp = isWebkitAnim ? 'WebkitAnimation' : 'animation' exports.animationEndEvent = isWebkitAnim ? 'webkitAnimationEnd' : 'animationend' } /** * Defer a task to execute it asynchronously. Ideally this * should be executed as a microtask, so we leverage * MutationObserver if it's available, and fallback to * setTimeout(0). * * @param {Function} cb * @param {Object} ctx */ exports.nextTick = (function () { var callbacks = [] var pending = false var timerFunc function nextTickHandler () { pending = false var copies = callbacks.slice(0) callbacks = [] for (var i = 0; i < copies.length; i++) { copies[i]() } } /* istanbul ignore if */ if (typeof MutationObserver !== 'undefined') { var counter = 1 var observer = new MutationObserver(nextTickHandler) var textNode = document.createTextNode(counter) observer.observe(textNode, { characterData: true }) timerFunc = function () { counter = (counter + 1) % 2 textNode.data = counter } } else { timerFunc = setTimeout } return function (cb, ctx) { var func = ctx ? function () { cb.call(ctx) } : cb callbacks.push(func) if (pending) return pending = true timerFunc(nextTickHandler, 0) } })() /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) /** * Query an element selector if it's not an element already. * * @param {String|Element} el * @return {Element} */ exports.query = function (el) { if (typeof el === 'string') { var selector = el el = document.querySelector(el) if (!el) { ("development") !== 'production' && _.warn( 'Cannot find element: ' + selector ) } } return el } /** * Check if a node is in the document. * Note: document.documentElement.contains should work here * but always returns false for comment nodes in phantomjs, * making unit tests difficult. This is fixed byy doing the * contains() check on the node's parentNode instead of * the node itself. * * @param {Node} node * @return {Boolean} */ exports.inDoc = function (node) { var doc = document.documentElement var parent = node && node.parentNode return doc === node || doc === parent || !!(parent && parent.nodeType === 1 && (doc.contains(parent))) } /** * Extract an attribute from a node. * * @param {Node} node * @param {String} attr * @return {String|null} */ exports.attr = function (node, attr) { attr = config.prefix + attr var val = node.getAttribute(attr) if (val !== null) { node.removeAttribute(attr) } return val } /** * Get an attribute with colon or bind- prefix. * * @param {Node} node * @param {String} name * @return {String|null} */ exports.getBindAttr = function (node, name) { var attr = ':' + name var val = node.getAttribute(attr) if (val === null) { attr = config.prefix + 'bind:' + name val = node.getAttribute(attr) } if (val !== null) { node.removeAttribute(attr) } return val } var refRE = /^v-ref:/ exports.findRef = function (node) { if (node.hasAttributes()) { var attrs = node.attributes for (var i = 0, l = attrs.length; i < l; i++) { var name = attrs[i].name if (refRE.test(name)) { node.removeAttribute(name) return _.camelize(name.replace(refRE, '')) } } } } /** * Insert el before target * * @param {Element} el * @param {Element} target */ exports.before = function (el, target) { target.parentNode.insertBefore(el, target) } /** * Insert el after target * * @param {Element} el * @param {Element} target */ exports.after = function (el, target) { if (target.nextSibling) { exports.before(el, target.nextSibling) } else { target.parentNode.appendChild(el) } } /** * Remove el from DOM * * @param {Element} el */ exports.remove = function (el) { el.parentNode.removeChild(el) } /** * Prepend el to target * * @param {Element} el * @param {Element} target */ exports.prepend = function (el, target) { if (target.firstChild) { exports.before(el, target.firstChild) } else { target.appendChild(el) } } /** * Replace target with el * * @param {Element} target * @param {Element} el */ exports.replace = function (target, el) { var parent = target.parentNode if (parent) { parent.replaceChild(el, target) } } /** * Add event listener shorthand. * * @param {Element} el * @param {String} event * @param {Function} cb */ exports.on = function (el, event, cb) { el.addEventListener(event, cb) } /** * Remove event listener shorthand. * * @param {Element} el * @param {String} event * @param {Function} cb */ exports.off = function (el, event, cb) { el.removeEventListener(event, cb) } /** * Add class with compatibility for IE & SVG * * @param {Element} el * @param {Strong} cls */ exports.addClass = function (el, cls) { if (el.classList) { el.classList.add(cls) } else { var cur = ' ' + (el.getAttribute('class') || '') + ' ' if (cur.indexOf(' ' + cls + ' ') < 0) { el.setAttribute('class', (cur + cls).trim()) } } } /** * Remove class with compatibility for IE & SVG * * @param {Element} el * @param {Strong} cls */ exports.removeClass = function (el, cls) { if (el.classList) { el.classList.remove(cls) } else { var cur = ' ' + (el.getAttribute('class') || '') + ' ' var tar = ' ' + cls + ' ' while (cur.indexOf(tar) >= 0) { cur = cur.replace(tar, ' ') } el.setAttribute('class', cur.trim()) } if (!el.className) { el.removeAttribute('class') } } /** * Extract raw content inside an element into a temporary * container div * * @param {Element} el * @param {Boolean} asFragment * @return {Element} */ exports.extractContent = function (el, asFragment) { var child var rawContent /* istanbul ignore if */ if ( exports.isTemplate(el) && el.content instanceof DocumentFragment ) { el = el.content } if (el.hasChildNodes()) { exports.trimNode(el) rawContent = asFragment ? document.createDocumentFragment() : document.createElement('div') /* eslint-disable no-cond-assign */ while (child = el.firstChild) { /* eslint-enable no-cond-assign */ rawContent.appendChild(child) } } return rawContent } /** * Trim possible empty head/tail textNodes inside a parent. * * @param {Node} node */ exports.trimNode = function (node) { trim(node, node.firstChild) trim(node, node.lastChild) } function trim (parent, node) { if (node && node.nodeType === 3 && !node.data.trim()) { parent.removeChild(node) } } /** * Check if an element is a template tag. * Note if the template appears inside an SVG its tagName * will be in lowercase. * * @param {Element} el */ exports.isTemplate = function (el) { return el.tagName && el.tagName.toLowerCase() === 'template' } /** * Create an "anchor" for performing dom insertion/removals. * This is used in a number of scenarios: * - fragment instance * - v-html * - v-if * - component * - repeat * * @param {String} content * @param {Boolean} persist - IE trashes empty textNodes on * cloneNode(true), so in certain * cases the anchor needs to be * non-empty to be persisted in * templates. * @return {Comment|Text} */ exports.createAnchor = function (content, persist) { return config.debug ? document.createComment(content) : document.createTextNode(persist ? ' ' : '') } /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { module.exports = { /** * Whether to print debug messages. * Also enables stack trace for warnings. * * @type {Boolean} */ debug: false, /** * Strict mode. * Disables asset lookup in the view parent chain. */ strict: false, /** * Whether to suppress warnings. * * @type {Boolean} */ silent: false, /** * Whether allow observer to alter data objects' * __proto__. * * @type {Boolean} */ proto: true, /** * Whether to parse mustache tags in templates. * * @type {Boolean} */ interpolate: true, /** * Whether to use async rendering. */ async: true, /** * Whether to warn against errors caught when evaluating * expressions. */ warnExpressionErrors: true, /** * Internal flag to indicate the delimiters have been * changed. * * @type {Boolean} */ _delimitersChanged: true, /** * List of asset types that a component can own. * * @type {Array} */ _assetTypes: [ 'component', 'directive', 'elementDirective', 'filter', 'transition', 'partial' ], /** * prop binding modes */ _propBindingModes: { ONE_WAY: 0, TWO_WAY: 1, ONE_TIME: 2 }, /** * Max circular updates allowed in a batcher flush cycle. */ _maxUpdateCount: 100 } /** * The prefix to look for when parsing directives. * * @type {String} */ var prefix = 'v-' Object.defineProperty(module.exports, 'prefix', { get: function () { return prefix }, set: function (val) { prefix = val if (true) { __webpack_require__(1).deprecation.PREFIX() } } }) /** * Interpolation delimiters. Changing these would trigger * the text parser to re-compile the regular expressions. * * @type {Array<String>} */ var delimiters = ['{{', '}}'] var unsafeDelimiters = ['{{{', '}}}'] var textParser = __webpack_require__(7) Object.defineProperty(module.exports, 'delimiters', { get: function () { return delimiters }, set: function (val) { delimiters = val var unsafeOpen = val[0].charAt(0) + val[0] var unsafeClose = val[1] + val[1].slice(-1) unsafeDelimiters = [unsafeOpen, unsafeClose] if (true) { __webpack_require__(1).log( 'Interpolation delimiters for unsafe HTML will ' + 'need to be configured separately as ' + 'Vue.config.unsafeDelimiters in 1.0.0.' ) } textParser.compileRegex() } }) Object.defineProperty(module.exports, 'unsafeDelimiters', { get: function () { return unsafeDelimiters }, set: function (val) { unsafeDelimiters = val textParser.compileRegex() } }) /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { var Cache = __webpack_require__(8) var config = __webpack_require__(6) var dirParser = __webpack_require__(9) var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g var cache, tagRE, htmlRE /** * Escape a string so it can be used in a RegExp * constructor. * * @param {String} str */ function escapeRegex (str) { return str.replace(regexEscapeRE, '\\$&') } exports.compileRegex = function () { var open = escapeRegex(config.delimiters[0]) var close = escapeRegex(config.delimiters[1]) var unsafeOpen = escapeRegex(config.unsafeDelimiters[0]) var unsafeClose = escapeRegex(config.unsafeDelimiters[1]) tagRE = new RegExp( unsafeOpen + '(.+?)' + unsafeClose + '|' + open + '(.+?)' + close, 'g' ) htmlRE = new RegExp( '^' + unsafeOpen + '.*' + unsafeClose + '$' ) // reset cache cache = new Cache(1000) } /** * Parse a template text string into an array of tokens. * * @param {String} text * @return {Array<Object> | null} * - {String} type * - {String} value * - {Boolean} [html] * - {Boolean} [oneTime] */ exports.parse = function (text) { if (!cache) { exports.compileRegex() } var hit = cache.get(text) if (hit) { return hit } text = text.replace(/\n/g, '') if (!tagRE.test(text)) { return null } var tokens = [] var lastIndex = tagRE.lastIndex = 0 var match, index, html, value, first, oneTime, twoWay /* eslint-disable no-cond-assign */ while (match = tagRE.exec(text)) { /* eslint-enable no-cond-assign */ index = match.index // push text token if (index > lastIndex) { tokens.push({ value: text.slice(lastIndex, index) }) } // tag token html = htmlRE.test(match[0]) value = html ? match[1] : match[2] first = value.charCodeAt(0) oneTime = first === 42 // * twoWay = first === 38 || first === 64 // & or @ value = oneTime || twoWay ? value.slice(1) : value tokens.push({ tag: true, value: value.trim(), html: html, oneTime: oneTime, twoWay: twoWay }) lastIndex = index + match[0].length } if (lastIndex < text.length) { tokens.push({ value: text.slice(lastIndex) }) } cache.put(text, tokens) return tokens } /** * Format a list of tokens into an expression. * e.g. tokens parsed from 'a {{b}} c' can be serialized * into one single expression as '"a " + b + " c"'. * * @param {Array} tokens * @param {Vue} [vm] * @return {String} */ exports.tokensToExp = function (tokens, vm) { return tokens.length > 1 ? tokens.map(function (token) { return formatToken(token, vm) }).join('+') : formatToken(tokens[0], vm, true) } /** * Format a single token. * * @param {Object} token * @param {Vue} [vm] * @param {Boolean} single * @return {String} */ function formatToken (token, vm, single) { return token.tag ? vm && token.oneTime ? '"' + vm.$eval(token.value) + '"' : inlineFilters(token.value, single) : '"' + token.value + '"' } /** * For an attribute with multiple interpolation tags, * e.g. attr="some-{{thing | filter}}", in order to combine * the whole thing into a single watchable expression, we * have to inline those filters. This function does exactly * that. This is a bit hacky but it avoids heavy changes * to directive parser and watcher mechanism. * * @param {String} exp * @param {Boolean} single * @return {String} */ var filterRE = /[^|]\|[^|]/ function inlineFilters (exp, single) { if (!filterRE.test(exp)) { return single ? exp : '(' + exp + ')' } else { var dir = dirParser.parse(exp)[0] if (!dir.filters) { return '(' + exp + ')' } else { return 'this._applyFilters(' + dir.expression + // value ',null,' + // oldValue (null for read) JSON.stringify(dir.filters) + // filter descriptors ',false)' // write? } } } /***/ }, /* 8 */ /***/ function(module, exports) { /** * A doubly linked list-based Least Recently Used (LRU) * cache. Will keep most recently used items while * discarding least recently used items when its limit is * reached. This is a bare-bone version of * Rasmus Andersson's js-lru: * * https://github.com/rsms/js-lru * * @param {Number} limit * @constructor */ function Cache (limit) { this.size = 0 this.limit = limit this.head = this.tail = undefined this._keymap = Object.create(null) } var p = Cache.prototype /** * Put <value> into the cache associated with <key>. * Returns the entry which was removed to make room for * the new entry. Otherwise undefined is returned. * (i.e. if there was enough room already). * * @param {String} key * @param {*} value * @return {Entry|undefined} */ p.put = function (key, value) { var entry = { key: key, value: value } this._keymap[key] = entry if (this.tail) { this.tail.newer = entry entry.older = this.tail } else { this.head = entry } this.tail = entry if (this.size === this.limit) { return this.shift() } else { this.size++ } } /** * Purge the least recently used (oldest) entry from the * cache. Returns the removed entry or undefined if the * cache was empty. */ p.shift = function () { var entry = this.head if (entry) { this.head = this.head.newer this.head.older = undefined entry.newer = entry.older = undefined this._keymap[entry.key] = undefined } return entry } /** * Get and register recent use of <key>. Returns the value * associated with <key> or undefined if not in cache. * * @param {String} key * @param {Boolean} returnEntry * @return {Entry|*} */ p.get = function (key, returnEntry) { var entry = this._keymap[key] if (entry === undefined) return if (entry === this.tail) { return returnEntry ? entry : entry.value } // HEAD--------------TAIL // <.older .newer> // <--- add direction -- // A B C <D> E if (entry.newer) { if (entry === this.head) { this.head = entry.newer } entry.newer.older = entry.older // C <-- E. } if (entry.older) { entry.older.newer = entry.newer // C. --> E } entry.newer = undefined // D --x entry.older = this.tail // D. --> E if (this.tail) { this.tail.newer = entry // E. <-- D } this.tail = entry return returnEntry ? entry : entry.value } module.exports = Cache /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Cache = __webpack_require__(8) var cache = new Cache(1000) var argRE = /^[^\{\?]+$|^'[^']*'$|^"[^"]*"$/ var filterTokenRE = /[^\s'"]+|'[^']*'|"[^"]*"/g var reservedArgRE = /^in$|^-?\d+/ /** * Parser state */ var str var c, i, l var inSingle var inDouble var curly var square var paren var begin var argIndex var dirs var dir var lastFilterIndex var arg /** * Push a directive object into the result Array */ function pushDir () { dir.raw = str.slice(begin, i).trim() if (dir.expression === undefined) { dir.expression = str.slice(argIndex, i).trim() } else if (lastFilterIndex !== begin) { pushFilter() } if (i === 0 || dir.expression) { dirs.push(dir) } } /** * Push a filter to the current directive object */ function pushFilter () { var exp = str.slice(lastFilterIndex, i).trim() var filter if (exp) { filter = {} var tokens = exp.match(filterTokenRE) filter.name = tokens[0] if (tokens.length > 1) { filter.args = tokens.slice(1).map(processFilterArg) } } if (filter) { (dir.filters = dir.filters || []).push(filter) } lastFilterIndex = i + 1 } /** * Check if an argument is dynamic and strip quotes. * * @param {String} arg * @return {Object} */ function processFilterArg (arg) { var stripped = reservedArgRE.test(arg) ? arg : _.stripQuotes(arg) var dynamic = stripped === false return { value: dynamic ? arg : stripped, dynamic: dynamic } } /** * Parse a directive string into an Array of AST-like * objects representing directives. * * Example: * * "click: a = a + 1 | uppercase" will yield: * { * arg: 'click', * expression: 'a = a + 1', * filters: [ * { name: 'uppercase', args: null } * ] * } * * @param {String} str * @return {Array<Object>} */ exports.parse = function (s) { var hit = cache.get(s) if (hit) { return hit } // reset parser state str = s inSingle = inDouble = false curly = square = paren = begin = argIndex = 0 lastFilterIndex = 0 dirs = [] dir = {} arg = null for (i = 0, l = str.length; i < l; i++) { c = str.charCodeAt(i) if (inSingle) { // check single quote if (c === 0x27) inSingle = !inSingle } else if (inDouble) { // check double quote if (c === 0x22) inDouble = !inDouble } else if ( c === 0x2C && // comma !paren && !curly && !square ) { // reached the end of a directive pushDir() // reset & skip the comma dir = {} begin = argIndex = lastFilterIndex = i + 1 } else if ( c === 0x3A && // colon !dir.expression && !dir.arg ) { // argument arg = str.slice(begin, i).trim() // test for valid argument here // since we may have caught stuff like first half of // an object literal or a ternary expression. if (argRE.test(arg)) { argIndex = i + 1 dir.arg = _.stripQuotes(arg) || arg if (true) { _.deprecation.DIR_ARGS(str) } } } else if ( c === 0x7C && // pipe str.charCodeAt(i + 1) !== 0x7C && str.charCodeAt(i - 1) !== 0x7C ) { if (dir.expression === undefined) { // first filter, end of expression lastFilterIndex = i + 1 dir.expression = str.slice(argIndex, i).trim() } else { // already has filter pushFilter() } } else { switch (c) { case 0x22: inDouble = true; break // " case 0x27: inSingle = true; break // ' case 0x28: paren++; break // ( case 0x29: paren--; break // ) case 0x5B: square++; break // [ case 0x5D: square--; break // ] case 0x7B: curly++; break // { case 0x7D: curly--; break // } } } } if (i === 0 || begin !== i) { pushDir() } cache.put(s, dirs) if (("development") !== 'production' && dirs.length > 1) { _.deprecation.MULTI_CLAUSES() } return dirs } /***/ }, /* 10 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var extend = _.extend /** * Option overwriting strategies are functions that handle * how to merge a parent option value and a child option * value into the final value. * * All strategy functions follow the same signature: * * @param {*} parentVal * @param {*} childVal * @param {Vue} [vm] */ var strats = config.optionMergeStrategies = Object.create(null) /** * Helper that recursively merges two data objects together. */ function mergeData (to, from) { var key, toVal, fromVal for (key in from) { toVal = to[key] fromVal = from[key] if (!to.hasOwnProperty(key)) { to.$set(key, fromVal) } else if (_.isObject(toVal) && _.isObject(fromVal)) { mergeData(toVal, fromVal) } } return to } /** * Data */ strats.data = function (parentVal, childVal, vm) { if (!vm) { // in a Vue.extend merge, both should be functions if (!childVal) { return parentVal } if (typeof childVal !== 'function') { ("development") !== 'production' && _.warn( 'The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.' ) return parentVal } if (!parentVal) { return childVal } // when parentVal & childVal are both present, // we need to return a function that returns the // merged result of both functions... no need to // check if parentVal is a function here because // it has to be a function to pass previous merges. return function mergedDataFn () { return mergeData( childVal.call(this), parentVal.call(this) ) } } else if (parentVal || childVal) { return function mergedInstanceDataFn () { // instance merge var instanceData = typeof childVal === 'function' ? childVal.call(vm) : childVal var defaultData = typeof parentVal === 'function' ? parentVal.call(vm) : undefined if (instanceData) { return mergeData(instanceData, defaultData) } else { return defaultData } } } } /** * El */ strats.el = function (parentVal, childVal, vm) { if (!vm && childVal && typeof childVal !== 'function') { ("development") !== 'production' && _.warn( 'The "el" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.' ) return } var ret = childVal || parentVal // invoke the element factory if this is instance merge return vm && typeof ret === 'function' ? ret.call(vm) : ret } /** * Hooks and param attributes are merged as arrays. */ strats.created = strats.ready = strats.attached = strats.detached = strats.beforeCompile = strats.compiled = strats.beforeDestroy = strats.destroyed = strats.props = function (parentVal, childVal) { return childVal ? parentVal ? parentVal.concat(childVal) : _.isArray(childVal) ? childVal : [childVal] : parentVal } /** * 0.11 deprecation warning */ strats.paramAttributes = function () { /* istanbul ignore next */ ("development") !== 'production' && _.warn( '"paramAttributes" option has been deprecated in 0.12. ' + 'Use "props" instead.' ) } /** * Assets * * When a vm is present (instance creation), we need to do * a three-way merge between constructor options, instance * options and parent options. */ function mergeAssets (parentVal, childVal) { var res = Object.create(parentVal) return childVal ? extend(res, guardArrayAssets(childVal)) : res } config._assetTypes.forEach(function (type) { strats[type + 's'] = mergeAssets }) /** * Events & Watchers. * * Events & watchers hashes should not overwrite one * another, so we merge them as arrays. */ strats.watch = strats.events = function (parentVal, childVal) { if (!childVal) return parentVal if (!parentVal) return childVal var ret = {} extend(ret, parentVal) for (var key in childVal) { var parent = ret[key] var child = childVal[key] if (parent && !_.isArray(parent)) { parent = [parent] } ret[key] = parent ? parent.concat(child) : [child] } return ret } /** * Other object hashes. */ strats.methods = strats.computed = function (parentVal, childVal) { if (!childVal) return parentVal if (!parentVal) return childVal var ret = Object.create(parentVal) extend(ret, childVal) return ret } /** * Default strategy. */ var defaultStrat = function (parentVal, childVal) { return childVal === undefined ? parentVal : childVal } /** * Make sure component options get converted to actual * constructors. * * @param {Object} options */ function guardComponents (options) { if (options.components) { var components = options.components = guardArrayAssets(options.components) var def var ids = Object.keys(components) for (var i = 0, l = ids.length; i < l; i++) { var key = ids[i] if (_.commonTagRE.test(key)) { ("development") !== 'production' && _.warn( 'Do not use built-in HTML elements as component ' + 'id: ' + key ) continue } def = components[key] if (_.isPlainObject(def)) { def.id = def.id || key components[key] = def._Ctor || (def._Ctor = _.Vue.extend(def)) } } } } /** * Ensure all props option syntax are normalized into the * Object-based format. * * @param {Object} options */ function guardProps (options) { var props = options.props if (_.isPlainObject(props)) { options.props = Object.keys(props).map(function (key) { var val = props[key] if (!_.isPlainObject(val)) { val = { type: val } } val.name = key return val }) } else if (_.isArray(props)) { options.props = props.map(function (prop) { return typeof prop === 'string' ? { name: prop } : prop }) } } /** * Guard an Array-format assets option and converted it * into the key-value Object format. * * @param {Object|Array} assets * @return {Object} */ function guardArrayAssets (assets) { if (_.isArray(assets)) { var res = {} var i = assets.length var asset while (i--) { asset = assets[i] var id = asset.id || (asset.options && asset.options.id) if (!id) { ("development") !== 'production' && _.warn( 'Array-syntax assets must provide an id field.' ) } else { res[id] = asset } } return res } return assets } /** * Merge two option objects into a new one. * Core utility used in both instantiation and inheritance. * * @param {Object} parent * @param {Object} child * @param {Vue} [vm] - if vm is present, indicates this is * an instantiation merge. */ exports.mergeOptions = function merge (parent, child, vm) { if (true) { if (child.inherit && !child._repeat) { _.deprecation.INHERIT() } } guardComponents(child) guardProps(child) var options = {} var key if (child.mixins) { for (var i = 0, l = child.mixins.length; i < l; i++) { parent = merge(parent, child.mixins[i], vm) } } for (key in parent) { mergeField(key) } for (key in child) { if (!(parent.hasOwnProperty(key))) { mergeField(key) } } function mergeField (key) { var strat = strats[key] || defaultStrat options[key] = strat(parent[key], child[key], vm, key) } return options } /** * Resolve an asset. * This function is used because child instances need access * to assets defined in its ancestor chain. * * @param {Object} options * @param {String} type * @param {String} id * @return {Object|Function} */ exports.resolveAsset = function resolve (options, type, id) { var camelizedId = _.camelize(id) var pascalizedId = camelizedId.charAt(0).toUpperCase() + camelizedId.slice(1) var assets = options[type] var asset = assets[id] || assets[camelizedId] || assets[pascalizedId] // for deprecation check var localAsset = asset while ( !asset && options._parent && (!config.strict || options._repeat) ) { options = (options._context || options._parent).$options assets = options[type] asset = assets[id] || assets[camelizedId] || assets[pascalizedId] } if (true) { if (asset && !localAsset && !config.strict) { _.deprecation.STRICT_MODE(type, id) } } return asset } /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * Check if an element is a component, if yes return its * component id. * * @param {Element} el * @param {Object} options * @return {String|undefined} */ exports.commonTagRE = /^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/ exports.checkComponent = function (el, options, hasAttrs) { var tag = el.tagName.toLowerCase() if (!exports.commonTagRE.test(tag) && tag !== 'component') { if (_.resolveAsset(options, 'components', tag)) { // custom element component return tag } else { var exp = hasAttrs && checkComponentAttribute(el) /* istanbul ignore if */ if (exp) return exp if (true) { if (tag.indexOf('-') > -1 || /HTMLUnknownElement/.test(Object.prototype.toString.call(el))) { _.warn( 'Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly?' ) } } } } else if (hasAttrs) { return checkComponentAttribute(el) } } /** * Check possible component denoting attributes, e.g. * is, bind-is and v-component. * * @param {Elemnent} el * @return {String|null} */ function checkComponentAttribute (el) { var exp /* eslint-disable no-cond-assign */ if (exp = _.attr(el, 'component')) { /* eslint-enable no-cond-assign */ if (true) { _.deprecation.V_COMPONENT() } return exp } // dynamic syntax exp = el.getAttribute('is') if (exp != null) { if (("development") !== 'production' && /{{.*}}/.test(exp)) { _.deprecation.BIND_IS() } el.removeAttribute('is') } else { exp = _.getBindAttr(el, 'is') if (exp != null) { // leverage literal dynamic for now. // TODO: make this cleaner exp = '{{' + exp + '}}' } } return exp } /** * Set a prop's initial value on a vm and its data object. * The vm may have inherit:true so we need to make sure * we don't accidentally overwrite parent value. * * @param {Vue} vm * @param {Object} prop * @param {*} value */ exports.initProp = function (vm, prop, value) { if (exports.assertProp(prop, value)) { var key = prop.path if (key in vm) { _.define(vm, key, value, true) } else { vm[key] = value } vm._data[key] = value } } /** * Assert whether a prop is valid. * * @param {Object} prop * @param {*} value */ exports.assertProp = function (prop, value) { // if a prop is not provided and is not required, // skip the check. if (prop.raw === null && !prop.required) { return true } var options = prop.options var type = options.type var valid = true var expectedType if (type) { if (type === String) { expectedType = 'string' valid = typeof value === expectedType } else if (type === Number) { expectedType = 'number' valid = typeof value === 'number' } else if (type === Boolean) { expectedType = 'boolean' valid = typeof value === 'boolean' } else if (type === Function) { expectedType = 'function' valid = typeof value === 'function' } else if (type === Object) { expectedType = 'object' valid = _.isPlainObject(value) } else if (type === Array) { expectedType = 'array' valid = _.isArray(value) } else { valid = value instanceof type } } if (!valid) { ("development") !== 'production' && _.warn( 'Invalid prop: type check failed for ' + prop.path + '="' + prop.raw + '".' + ' Expected ' + formatType(expectedType) + ', got ' + formatValue(value) + '.' ) return false } var validator = options.validator if (validator) { if (!validator.call(null, value)) { ("development") !== 'production' && _.warn( 'Invalid prop: custom validator check failed for ' + prop.path + '="' + prop.raw + '"' ) return false } } return true } function formatType (val) { return val ? val.charAt(0).toUpperCase() + val.slice(1) : 'custom type' } function formatValue (val) { return Object.prototype.toString.call(val).slice(8, -1) } /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { /** * Enable debug utilities. */ if (true) { var config = __webpack_require__(6) var hasConsole = typeof console !== 'undefined' /** * Load deprecation warning functions */ exports.deprecations = __webpack_require__(13) /** * Log a message. * * @param {String} msg */ exports.log = function (msg) { if (hasConsole && config.debug) { console.log('[Vue info]: ' + msg) } } /** * We've got a problem here. * * @param {String} msg */ exports.warn = function (msg, e) { if (hasConsole && (!config.silent || config.debug)) { console.warn('[Vue warn]: ' + msg) /* istanbul ignore if */ if (config.debug) { console.warn((e || new Error('Warning Stack Trace')).stack) } } } /** * Assert asset exists */ exports.assertAsset = function (val, type, id) { if (!val) { exports.warn('Failed to resolve ' + type + ': ' + id) } } } /***/ }, /* 13 */ /***/ function(module, exports, __webpack_require__) { if (true) { var _ = __webpack_require__(1) var warn = function (msg) { _.warn('{DEPRECATION} ' + msg) } var newBindingSyntaxLink = ' See https://github.com/yyx990803/vue/issues/1325 for details.' _.deprecation = { REPEAT: function () { warn( 'v-repeat will be deprecated in favor of v-for in 1.0.0. ' + 'See https://github.com/yyx990803/vue/issues/1200 for details.' ) }, ADD: function () { warn( '$add() will be deprecated in 1.0.0. Use $set() instead. ' + 'See https://github.com/yyx990803/vue/issues/1171 for details.' ) }, WAIT_FOR: function () { warn( '"wait-for" will be deprecated in 1.0.0. Use `activate` hook instead. ' + 'See https://github.com/yyx990803/vue/issues/1169 for details.' ) }, STRICT_MODE: function (type, id) { warn( 'Falling through to parent when resolving ' + type + ' with id "' + id + '". Strict mode will be the default in 1.0.0. ' + 'See https://github.com/yyx990803/vue/issues/1170 for details.' ) }, CONTENT: function () { warn( '<content> insertion points will be deprecated in in 1.0.0. in favor of <slot>. ' + 'See https://github.com/yyx990803/vue/issues/1167 for details.' ) }, DATA_AS_PROP: function () { warn( '$data will no longer be usable as a prop in 1.0.0. ' + 'See https://github.com/yyx990803/vue/issues/1198 for details.' ) }, INHERIT: function () { warn( 'The "inherit" option will be deprecated in 1.0.0. ' + 'See https://github.com/yyx990803/vue/issues/1198 for details.' ) }, DIR_ARGS: function (exp) { warn( exp + ': Directive arguments will be moved into the attribute name in 1.0.0 - ' + 'use v-dirname:arg="expression" syntax instead.' + newBindingSyntaxLink ) }, MULTI_CLAUSES: function () { warn( 'Directives will no longer support multiple clause syntax in 1.0.0.' + newBindingSyntaxLink ) }, V_TRANSITION: function () { warn( 'v-transition will no longer be a directive in 1.0.0; It will become a ' + 'special attribute without the prefix. Use "transition" instead.' ) }, V_REF: function () { warn( 'v-ref will no longer take an attribute value in 1.0.0. Use "v-ref:id" syntax ' + 'instead. Also, refs will be registered under vm.$refs instead of vm.$. ' + 'See https://github.com/yyx990803/vue/issues/1292 for more details.' ) }, V_EL: function () { warn( 'v-el will no longer take an attribute value in 1.0.0. Use "v-el:id" syntax ' + 'instead. Also, nodes will be registered under vm.$els instead of vm.$$. ' + 'See https://github.com/yyx990803/vue/issues/1292 for more details.' ) }, V_ATTR: function () { warn( 'v-attr will be renamed to v-bind in 1.0.0. Also, use v-bind:attr="expression" ' + 'syntax instead.' + newBindingSyntaxLink ) }, V_CLASS: function () { warn( 'v-class will be deprecated in 1.0.0. Use v-bind:class or just :class instead.' + newBindingSyntaxLink ) }, V_STYLE: function () { warn( 'v-style will be deprecated in 1.0.0. Use v-bind:style or just :style instead.' + newBindingSyntaxLink ) }, ATTR_INTERPOLATION: function (name, value) { warn( 'Mustache interpolations inside attributes: ' + name + '="' + value + '". ' + 'This will be deprecated in 1.0.0. ' + 'Use v-bind:attr="expression" instead.' + newBindingSyntaxLink ) }, PROPS: function (attr, value) { warn( 'Prop ' + attr + '="' + value + '": props no longer use mustache tags ' + 'to indicate a dynamic binding. Use the "v-bind:prop-name" or the colon ' + 'shorthand instead.' + newBindingSyntaxLink ) }, DATA_PROPS: function (attr, value) { warn( 'Prop ' + attr + '="' + value + '": props will no longer support the ' + '"data-" prefix in 1.0.0.' + newBindingSyntaxLink ) }, PROP_CASTING: function (attr, value) { warn( 'Prop ' + attr + '="' + value + '": literal props will no longer be ' + 'auto-casted into booleans/numbers in 1.0.0 - they will all be treated ' + 'as literal strings. Use "v-bind" or the colon shorthand for ' + 'boolean/number literals instead.' ) }, BIND_IS: function () { warn( '<component is="{{view}}"> syntax will be deprecated in 1.0.0. Use ' + '<component v-bind:is="view"> or <component :is="view"> instead.' ) }, PARTIAL_NAME: function (id) { warn( '<partial name="' + id + '">: mustache interpolations inside attributes ' + 'will be deprecated in 1.0.0. Use v-bind:name="expression" or just ' + ':name="expression" instead.' ) }, REF_IN_CHILD: function () { warn( 'v-ref can no longer be used on a component root in its own ' + 'template in 1.0.0. Use it in the parent template instead.' ) }, KEY_FILTER: function () { warn( 'The "key" filter will be deprecated in 1.0.0. Use the new ' + 'v-on:keyup.key="handler" syntax instead.' ) }, PROPAGATION: function (event) { warn( 'No need to return false in handler for event "' + event + '": events ' + 'no longer propagate beyond the first triggered handler unless the ' + 'handler explicitly returns true. See https://github.com/yyx990803/vue/issues/1175 ' + 'for more details.' ) }, MODEL_EXP: function (exp) { warn( 'Params "exp", "true-exp" and "false-exp" for v-model will be deprecated in 1.0.0. ' + 'Use "v-bind:value", "v-bind:true-value" and "v-bind:false-value" instead.' ) }, SELECT_OPTIONS: function () { warn( 'The "options" param for <select v-model> will be deprecated in 1.0.0. ' + 'Use v-for to render the options. See https://github.com/yyx990803/vue/issues/1229 ' + 'for more details.' ) }, INTERPOLATE: function () { /* istanbul ignore next */ warn( 'The global "interpolate" config will be deprecated in 1.0.0. Use "v-pre" ' + 'on elements that should be skipped by the template compiler.' ) }, LITERAL: function () { warn( 'It is no longer necessary to declare literal directives in 1.0.0. Just ' + 'add the ".literal" modifier at the end (v-dir.literal="string") to ' + 'pass a literal value.' ) }, PREFIX: function () { warn( 'The "prefix" global config will be deprecated in 1.0.0. All directives ' + 'will consistently use the v- prefix.' ) }, V_COMPONENT: function () { warn( 'v-component will be deprecated in 1.0.0. Use "is" attribute instead. ' + 'See https://github.com/yyx990803/vue/issues/1278 for more details.' ) } } // ensure warning get warned only once var warned = {} Object.keys(_.deprecation).forEach(function (key) { var fn = _.deprecation[key] _.deprecation[key] = function () { if (!warned[key]) { warned[key] = true fn.apply(null, arguments) } } }) } /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) /** * Expose useful internals */ exports.util = _ exports.config = config exports.nextTick = _.nextTick exports.compiler = __webpack_require__(15) exports.FragmentFactory = __webpack_require__(28) exports.parsers = { path: __webpack_require__(22), text: __webpack_require__(7), template: __webpack_require__(25), directive: __webpack_require__(9), expression: __webpack_require__(21) } /** * Each instance constructor, including Vue, has a unique * cid. This enables us to create wrapped "child * constructors" for prototypal inheritance and cache them. */ exports.cid = 0 var cid = 1 /** * Class inheritance * * @param {Object} extendOptions */ exports.extend = function (extendOptions) { extendOptions = extendOptions || {} var Super = this var name = extendOptions.name || Super.options.name var Sub = createClass(name || 'VueComponent') Sub.prototype = Object.create(Super.prototype) Sub.prototype.constructor = Sub Sub.cid = cid++ Sub.options = _.mergeOptions( Super.options, extendOptions ) Sub['super'] = Super // allow further extension Sub.extend = Super.extend // create asset registers, so extended classes // can have their private assets too. config._assetTypes.forEach(function (type) { Sub[type] = Super[type] }) // enable recursive self-lookup if (name) { Sub.options.components[name] = Sub } return Sub } /** * A function that returns a sub-class constructor with the * given name. This gives us much nicer output when * logging instances in the console. * * @param {String} name * @return {Function} */ function createClass (name) { return new Function( 'return function ' + _.classify(name) + ' (options) { this._init(options) }' )() } /** * Plugin system * * @param {Object} plugin */ exports.use = function (plugin) { /* istanbul ignore if */ if (plugin.installed) { return } // additional parameters var args = _.toArray(arguments, 1) args.unshift(this) if (typeof plugin.install === 'function') { plugin.install.apply(plugin, args) } else { plugin.apply(null, args) } plugin.installed = true return this } /** * Create asset registration methods with the following * signature: * * @param {String} id * @param {*} definition */ config._assetTypes.forEach(function (type) { exports[type] = function (id, definition) { if (!definition) { return this.options[type + 's'][id] } else { if ( type === 'component' && _.isPlainObject(definition) ) { definition.name = id definition = _.Vue.extend(definition) } this.options[type + 's'][id] = definition } } }) /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) _.extend(exports, __webpack_require__(16)) _.extend(exports, __webpack_require__(27)) /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var compileProps = __webpack_require__(17) var config = __webpack_require__(6) var textParser = __webpack_require__(7) var dirParser = __webpack_require__(9) var newDirParser = __webpack_require__(18) var templateParser = __webpack_require__(25) var resolveAsset = _.resolveAsset var componentDef = __webpack_require__(26) // special binding prefixes var bindRE = /^:|^v-bind:/ var onRE = /^@/ var argRE = /:(.*)$/ var literalRE = /\.literal$/ // terminal directives var terminalDirectives = [ 'repeat', 'for', 'if' ] /** * Compile a template and return a reusable composite link * function, which recursively contains more link functions * inside. This top level compile function would normally * be called on instance root nodes, but can also be used * for partial compilation if the partial argument is true. * * The returned composite link function, when called, will * return an unlink function that tearsdown all directives * created during the linking phase. * * @param {Element|DocumentFragment} el * @param {Object} options * @param {Boolean} partial * @return {Function} */ exports.compile = function (el, options, partial) { // link function for the node itself. var nodeLinkFn = partial || !options._asComponent ? compileNode(el, options) : null // link function for the childNodes var childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && el.tagName !== 'SCRIPT' && el.hasChildNodes() ? compileNodeList(el.childNodes, options) : null /** * A composite linker function to be called on a already * compiled piece of DOM, which instantiates all directive * instances. * * @param {Vue} vm * @param {Element|DocumentFragment} el * @param {Vue} [host] - host vm of transcluded content * @param {Object} [scope] - v-for scope * @param {Fragment} [frag] - link context fragment * @return {Function|undefined} */ return function compositeLinkFn (vm, el, host, scope, frag) { // cache childNodes before linking parent, fix #657 var childNodes = _.toArray(el.childNodes) // link var dirs = linkAndCapture(function compositeLinkCapturer () { if (nodeLinkFn) nodeLinkFn(vm, el, host, scope, frag) if (childLinkFn) childLinkFn(vm, childNodes, host, scope, frag) }, vm) return makeUnlinkFn(vm, dirs) } } /** * Apply a linker to a vm/element pair and capture the * directives created during the process. * * @param {Function} linker * @param {Vue} vm */ function linkAndCapture (linker, vm) { var originalDirCount = vm._directives.length linker() var dirs = vm._directives.slice(originalDirCount) dirs.sort(directiveComparator) for (var i = 0, l = dirs.length; i < l; i++) { dirs[i]._bind() } return dirs } /** * Directive priority sort comparator * * @param {Object} a * @param {Object} b */ function directiveComparator (a, b) { a = a._def.priority || 0 b = b._def.priority || 0 return a > b ? -1 : a === b ? 0 : 1 } /** * Linker functions return an unlink function that * tearsdown all directives instances generated during * the process. * * We create unlink functions with only the necessary * information to avoid retaining additional closures. * * @param {Vue} vm * @param {Array} dirs * @param {Vue} [context] * @param {Array} [contextDirs] * @return {Function} */ function makeUnlinkFn (vm, dirs, context, contextDirs) { return function unlink (destroying) { teardownDirs(vm, dirs, destroying) if (context && contextDirs) { teardownDirs(context, contextDirs) } } } /** * Teardown partial linked directives. * * @param {Vue} vm * @param {Array} dirs * @param {Boolean} destroying */ function teardownDirs (vm, dirs, destroying) { var i = dirs.length while (i--) { dirs[i]._teardown() if (!destroying) { vm._directives.$remove(dirs[i]) } } } /** * Compile link props on an instance. * * @param {Vue} vm * @param {Element} el * @param {Object} props * @param {Object} [scope] * @return {Function} */ exports.compileAndLinkProps = function (vm, el, props, scope) { var propsLinkFn = compileProps(el, props) var propDirs = linkAndCapture(function () { propsLinkFn(vm, scope) }, vm) return makeUnlinkFn(vm, propDirs) } /** * Compile the root element of an instance. * * 1. attrs on context container (context scope) * 2. attrs on the component template root node, if * replace:true (child scope) * * If this is a fragment instance, we only need to compile 1. * * @param {Vue} vm * @param {Element} el * @param {Object} options * @return {Function} */ exports.compileRoot = function (el, options) { var containerAttrs = options._containerAttrs var replacerAttrs = options._replacerAttrs var contextLinkFn, replacerLinkFn // only need to compile other attributes for // non-fragment instances if (el.nodeType !== 11) { // for components, container and replacer need to be // compiled separately and linked in different scopes. if (options._asComponent) { // 2. container attributes if (containerAttrs) { contextLinkFn = compileDirectives(containerAttrs, options) } if (replacerAttrs) { // 3. replacer attributes replacerLinkFn = compileDirectives(replacerAttrs, options) } } else { // non-component, just compile as a normal element. replacerLinkFn = compileDirectives(el.attributes, options) } } return function rootLinkFn (vm, el, scope) { // link context scope dirs var context = vm._context var contextDirs if (context && contextLinkFn) { contextDirs = linkAndCapture(function () { contextLinkFn(context, el, null, scope) }, context) } // link self var selfDirs = linkAndCapture(function () { if (replacerLinkFn) replacerLinkFn(vm, el) }, vm) // return the unlink function that tearsdown context // container directives. return makeUnlinkFn(vm, selfDirs, context, contextDirs) } } /** * Compile a node and return a nodeLinkFn based on the * node type. * * @param {Node} node * @param {Object} options * @return {Function|null} */ function compileNode (node, options) { /* istanbul ignore if */ if (("development") !== 'production' && !config.interpolate) { _.deprecation.INTERPOLATE() } var type = node.nodeType if (type === 1 && node.tagName !== 'SCRIPT') { return compileElement(node, options) } else if (type === 3 && config.interpolate && node.data.trim()) { return compileTextNode(node, options) } else { return null } } /** * Compile an element and return a nodeLinkFn. * * @param {Element} el * @param {Object} options * @return {Function|null} */ function compileElement (el, options) { // preprocess textareas. // textarea treats its text content as the initial value. // just bind it as a v-attr directive for value. if (el.tagName === 'TEXTAREA') { var tokens = textParser.parse(el.value) if (tokens) { el.setAttribute(':value', textParser.tokensToExp(tokens)) el.value = '' } } var linkFn var hasAttrs = el.hasAttributes() // check terminal directives (repeat & if) if (hasAttrs) { linkFn = checkTerminalDirectives(el, options) } // check element directives if (!linkFn) { linkFn = checkElementDirectives(el, options) } // check component if (!linkFn) { linkFn = checkComponent(el, options, hasAttrs) } // normal directives if (!linkFn && hasAttrs) { linkFn = compileDirectives(el.attributes, options) } return linkFn } /** * Compile a textNode and return a nodeLinkFn. * * @param {TextNode} node * @param {Object} options * @return {Function|null} textNodeLinkFn */ function compileTextNode (node, options) { var tokens = textParser.parse(node.data) if (!tokens) { return null } var frag = document.createDocumentFragment() var el, token for (var i = 0, l = tokens.length; i < l; i++) { token = tokens[i] el = token.tag ? processTextToken(token, options) : document.createTextNode(token.value) frag.appendChild(el) } return makeTextNodeLinkFn(tokens, frag, options) } /** * Process a single text token. * * @param {Object} token * @param {Object} options * @return {Node} */ function processTextToken (token, options) { var el if (token.oneTime) { el = document.createTextNode(token.value) } else { if (token.html) { el = document.createComment('v-html') setTokenType('html') } else { // IE will clean up empty textNodes during // frag.cloneNode(true), so we have to give it // something here... el = document.createTextNode(' ') setTokenType('text') } } function setTokenType (type) { token.type = type token.def = resolveAsset(options, 'directives', type) token.descriptor = dirParser.parse(token.value)[0] } return el } /** * Build a function that processes a textNode. * * @param {Array<Object>} tokens * @param {DocumentFragment} frag */ function makeTextNodeLinkFn (tokens, frag) { return function textNodeLinkFn (vm, el, host, scope) { var fragClone = frag.cloneNode(true) var childNodes = _.toArray(fragClone.childNodes) var token, value, node for (var i = 0, l = tokens.length; i < l; i++) { token = tokens[i] value = token.value if (token.tag) { node = childNodes[i] if (token.oneTime) { value = (scope || vm).$eval(value) if (token.html) { _.replace(node, templateParser.parse(value, true)) } else { node.data = value } } else { vm._bindDir(token.type, node, token.descriptor, token.def, host, scope) } } } _.replace(el, fragClone) } } /** * Compile a node list and return a childLinkFn. * * @param {NodeList} nodeList * @param {Object} options * @return {Function|undefined} */ function compileNodeList (nodeList, options) { var linkFns = [] var nodeLinkFn, childLinkFn, node for (var i = 0, l = nodeList.length; i < l; i++) { node = nodeList[i] nodeLinkFn = compileNode(node, options) childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && node.tagName !== 'SCRIPT' && node.hasChildNodes() ? compileNodeList(node.childNodes, options) : null linkFns.push(nodeLinkFn, childLinkFn) } return linkFns.length ? makeChildLinkFn(linkFns) : null } /** * Make a child link function for a node's childNodes. * * @param {Array<Function>} linkFns * @return {Function} childLinkFn */ function makeChildLinkFn (linkFns) { return function childLinkFn (vm, nodes, host, scope, frag) { var node, nodeLinkFn, childrenLinkFn for (var i = 0, n = 0, l = linkFns.length; i < l; n++) { node = nodes[n] nodeLinkFn = linkFns[i++] childrenLinkFn = linkFns[i++] // cache childNodes before linking parent, fix #657 var childNodes = _.toArray(node.childNodes) if (nodeLinkFn) { nodeLinkFn(vm, node, host, scope, frag) } if (childrenLinkFn) { childrenLinkFn(vm, childNodes, host, scope, frag) } } } } /** * Check for element directives (custom elements that should * be resovled as terminal directives). * * @param {Element} el * @param {Object} options */ function checkElementDirectives (el, options) { var tag = el.tagName.toLowerCase() if (_.commonTagRE.test(tag)) return var def = resolveAsset(options, 'elementDirectives', tag) if (def) { return makeTerminalNodeLinkFn(el, tag, '', options, def) } } /** * Check if an element is a component. If yes, return * a component link function. * * @param {Element} el * @param {Object} options * @param {Boolean} hasAttrs * @return {Function|undefined} */ function checkComponent (el, options, hasAttrs) { var componentId = _.checkComponent(el, options, hasAttrs) if (componentId) { var componentLinkFn = function (vm, el, host, scope, frag) { vm._bindDir('component', el, { expression: componentId }, componentDef, host, scope, frag) } componentLinkFn.terminal = true return componentLinkFn } } /** * Check an element for terminal directives in fixed order. * If it finds one, return a terminal link function. * * @param {Element} el * @param {Object} options * @return {Function} terminalLinkFn */ function checkTerminalDirectives (el, options) { if (_.attr(el, 'pre') !== null || el.hasAttribute(config.prefix + 'else')) { return skip } var value, dirName for (var i = 0, l = terminalDirectives.length; i < l; i++) { dirName = terminalDirectives[i] if ((value = _.attr(el, dirName)) !== null) { return makeTerminalNodeLinkFn(el, dirName, value, options) } } } function skip () {} skip.terminal = true /** * Build a node link function for a terminal directive. * A terminal link function terminates the current * compilation recursion and handles compilation of the * subtree in the directive. * * @param {Element} el * @param {String} dirName * @param {String} value * @param {Object} options * @param {Object} [def] * @return {Function} terminalLinkFn */ function makeTerminalNodeLinkFn (el, dirName, value, options, def) { var descriptor = dirParser.parse(value)[0] // no need to call resolveAsset since terminal directives // are always internal def = def || options.directives[dirName] var fn = function terminalNodeLinkFn (vm, el, host, scope, frag) { vm._bindDir(dirName, el, descriptor, def, host, scope, frag) } fn.terminal = true return fn } /** * Compile the directives on an element and return a linker. * * @param {Array|NamedNodeMap} attrs * @param {Object} options * @return {Function} */ function compileDirectives (attrs, options) { var i = attrs.length var dirs = [] var attr, name, value, dir, dirName, dirDef, isLiteral, arg while (i--) { attr = attrs[i] name = attr.name value = attr.value // special case for transition if ( name === 'transition' || name === ':transition' || name === (config.prefix + 'bind:transition') ) { dirs.push({ name: 'transition', arg: bindRE.test(name), descriptors: [newDirParser.parse(value)], def: options.directives.transition }) } else // event handlers if (onRE.test(name)) { dirs.push({ name: 'on', arg: name.replace(onRE, ''), descriptors: [newDirParser.parse(value)], def: options.directives.on }) } else // attribute bindings if (bindRE.test(name)) { var attributeName = name.replace(bindRE, '') if (attributeName === 'style' || attributeName === 'class') { dirName = attributeName arg = undefined } else { dirName = 'attr' arg = attributeName } dirs.push({ name: dirName, arg: arg, descriptors: [newDirParser.parse(value)], def: options.directives[dirName] }) } else // Core directive if (name.indexOf(config.prefix) === 0) { // check literal if (literalRE.test(name)) { isLiteral = true name = name.replace(literalRE, '') } else { isLiteral = false } // check argument arg = (arg = name.match(argRE)) && arg[1] // extract directive name dirName = name .slice(config.prefix.length) .replace(argRE, '') dirDef = resolveAsset(options, 'directives', dirName) if (true) { _.assertAsset(dirDef, 'directive', dirName) // deprecations if (dirName === 'transition') { _.deprecation.V_TRANSITION() } else if (dirName === 'attr') { _.deprecation.V_ATTR() } else if (dirName === 'class') { _.deprecation.V_CLASS() } else if (dirName === 'style') { _.deprecation.V_STYLE() } } if (dirDef) { dirs.push({ name: dirName, descriptors: dirParser.parse(value), def: dirDef, arg: arg, literal: isLiteral }) } } else // TODO: remove this in 1.0.0 if (config.interpolate) { dir = collectAttrDirective(name, value, options) if (dir) { dirs.push(dir) } } } // sort by priority, LOW to HIGH if (dirs.length) { return makeNodeLinkFn(dirs) } } /** * Build a link function for all directives on a single node. * * @param {Array} directives * @return {Function} directivesLinkFn */ function makeNodeLinkFn (directives) { return function nodeLinkFn (vm, el, host, scope, frag) { // reverse apply because it's sorted low to high var i = directives.length var dir, j, k while (i--) { dir = directives[i] if (dir._link) { // custom link fn dir._link(vm, el, scope) } else { // TODO: no need for loop here in 1.0.0 // also, we can just pass in the dir object to _bindDir, // which is going to be much simpler. k = dir.descriptors.length for (j = 0; j < k; j++) { vm._bindDir(dir.name, el, dir.descriptors[j], dir.def, host, scope, frag, dir.arg, dir.literal) } } } } } /** * Check an attribute for potential dynamic bindings, * and return a directive object. * * Special case: class interpolations are translated into * v-class instead v-attr, so that it can work with user * provided v-class bindings. * * @param {String} name * @param {String} value * @param {Object} options * @return {Object} */ function collectAttrDirective (name, value, options) { var tokens = textParser.parse(value) var isClass = name === 'class' if (tokens) { if (true) { _.deprecation.ATTR_INTERPOLATION(name, value) } var dirName = isClass ? 'class' : 'attr' var def = options.directives[dirName] var i = tokens.length var allOneTime = true while (i--) { var token = tokens[i] if (token.tag && !token.oneTime) { allOneTime = false } } return { def: def, _link: allOneTime ? function (vm, el, scope) { el.setAttribute(name, (scope || vm).$interpolate(value)) } : function (vm, el, scope) { var exp = textParser.tokensToExp(tokens, (scope || vm)) var desc = isClass ? dirParser.parse(exp)[0] : dirParser.parse(name + ':' + exp)[0] if (isClass) { desc._rawClass = value } vm._bindDir(dirName, el, desc, def, undefined, scope) } } } } /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var dirParser = __webpack_require__(18) var textParser = __webpack_require__(7) var propDef = __webpack_require__(19) var propBindingModes = __webpack_require__(6)._propBindingModes // regexes var identRE = __webpack_require__(22).identRE var dataAttrRE = /^data-/ var settablePathRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\[[^\[\]]+\])*$/ var literalValueRE = /^\s?(true|false|[\d\.]+|'[^']*'|"[^"]*")\s?$/ /** * Compile props on a root element and return * a props link function. * * @param {Element|DocumentFragment} el * @param {Array} propOptions * @return {Function} propsLinkFn */ // TODO: 1.0.0 we can just loop through el.attributes and // check for prop- prefixes. module.exports = function compileProps (el, propOptions) { var props = [] var i = propOptions.length var options, name, attr, value, path, prop, literal, single, parsed while (i--) { options = propOptions[i] name = options.name if (true) { if (name === '$data') { _.deprecation.DATA_AS_PROP() } } // props could contain dashes, which will be // interpreted as minus calculations by the parser // so we need to camelize the path here path = _.camelize(name.replace(dataAttrRE, '')) if (!identRE.test(path)) { ("development") !== 'production' && _.warn( 'Invalid prop key: "' + name + '". Prop keys ' + 'must be valid identifiers.' ) continue } attr = _.hyphenate(name) value = el.getAttribute(attr) if (value === null) { value = el.getAttribute('data-' + attr) if (value !== null) { attr = 'data-' + attr if (true) { _.deprecation.DATA_PROPS(attr, value) } } } // create a prop descriptor prop = { name: name, raw: value, path: path, options: options, mode: propBindingModes.ONE_WAY } if (value !== null) { // important so that this doesn't get compiled // again as a normal attribute binding el.removeAttribute(attr) var tokens = textParser.parse(value) if (tokens) { if (true) { _.deprecation.PROPS(attr, value) } prop.dynamic = true prop.parentPath = textParser.tokensToExp(tokens) // check prop binding type. single = tokens.length === 1 literal = literalValueRE.test(prop.parentPath) // one time: {{* prop}} if (literal || (single && tokens[0].oneTime)) { prop.mode = propBindingModes.ONE_TIME } else if ( !literal && (single && tokens[0].twoWay) ) { if (settablePathRE.test(prop.parentPath)) { prop.mode = propBindingModes.TWO_WAY } else { ("development") !== 'production' && _.warn( 'Cannot bind two-way prop with non-settable ' + 'parent path: ' + prop.parentPath ) } } } } else { // new syntax, check binding type if ((value = _.getBindAttr(el, attr)) === null) { if ((value = _.getBindAttr(el, attr + '.sync')) !== null) { prop.mode = propBindingModes.TWO_WAY } else if ((value = _.getBindAttr(el, attr + '.once')) !== null) { prop.mode = propBindingModes.ONE_TIME } } prop.raw = value if (value !== null) { // mark it so we know this is a bind prop.bindSyntax = true parsed = dirParser.parse(value) value = parsed.expression prop.filters = parsed.filters // check literal if (literalValueRE.test(value)) { prop.mode = propBindingModes.ONE_TIME } else { prop.dynamic = true // check non-settable path for two-way bindings if (("development") !== 'production' && prop.mode === propBindingModes.TWO_WAY && !settablePathRE.test(value)) { prop.mode = propBindingModes.ONE_WAY _.warn( 'Cannot bind two-way prop with non-settable ' + 'parent path: ' + value ) } } } prop.parentPath = value } // warn required two-way if ( ("development") !== 'production' && options.twoWay && prop.mode !== propBindingModes.TWO_WAY ) { _.warn( 'Prop "' + name + '" expects a two-way binding type.' ) } // warn missing required if (value === null && options && options.required) { ("development") !== 'production' && _.warn( 'Missing required prop: ' + name ) } // push prop props.push(prop) } return makePropsLinkFn(props) } /** * Build a function that applies props to a vm. * * @param {Array} props * @return {Function} propsLinkFn */ function makePropsLinkFn (props) { return function propsLinkFn (vm, scope) { // store resolved props info vm._props = {} var i = props.length var prop, path, options, value while (i--) { prop = props[i] path = prop.path vm._props[path] = prop options = prop.options if (prop.raw === null) { // initialize absent prop _.initProp(vm, prop, getDefault(options)) } else if (prop.dynamic) { // dynamic prop if (vm._context) { if (prop.mode === propBindingModes.ONE_TIME) { // one time binding value = (scope || vm._context).$get(prop.parentPath) _.initProp(vm, prop, value) } else { // dynamic binding vm._bindDir('prop', null, prop, propDef, null, scope) } } else { ("development") !== 'production' && _.warn( 'Cannot bind dynamic prop on a root instance' + ' with no parent: ' + prop.name + '="' + prop.raw + '"' ) } } else { // literal, cast it and just set once var raw = prop.raw if (options.type === Boolean && raw === '') { value = true } else if (raw.trim()) { value = _.toBoolean(_.toNumber(raw)) if (("development") !== 'production' && !prop.bindSyntax && value !== raw) { _.deprecation.PROP_CASTING(prop.name, prop.raw) } } else { value = raw } _.initProp(vm, prop, value) } } } } /** * Get the default value of a prop. * * @param {Object} options * @return {*} */ function getDefault (options) { // no default, return undefined if (!options.hasOwnProperty('default')) { // absent boolean value defaults to false return options.type === Boolean ? false : undefined } var def = options.default // warn against non-factory defaults for Object & Array if (_.isObject(def)) { ("development") !== 'production' && _.warn( 'Object/Array as default prop values will be shared ' + 'across multiple instances. Use a factory function ' + 'to return the default value instead.' ) } // call factory function for non-Function types return typeof def === 'function' && options.type !== Function ? def() : def } /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Cache = __webpack_require__(8) var cache = new Cache(1000) var filterTokenRE = /[^\s'"]+|'[^']*'|"[^"]*"/g var reservedArgRE = /^in$|^-?\d+/ /** * Parser state */ var str, dir var c, i, l, lastFilterIndex var inSingle, inDouble, curly, square, paren /** * Push a filter to the current directive object */ function pushFilter () { var exp = str.slice(lastFilterIndex, i).trim() var filter if (exp) { filter = {} var tokens = exp.match(filterTokenRE) filter.name = tokens[0] if (tokens.length > 1) { filter.args = tokens.slice(1).map(processFilterArg) } } if (filter) { (dir.filters = dir.filters || []).push(filter) } lastFilterIndex = i + 1 } /** * Check if an argument is dynamic and strip quotes. * * @param {String} arg * @return {Object} */ function processFilterArg (arg) { var stripped = reservedArgRE.test(arg) ? arg : _.stripQuotes(arg) var dynamic = stripped === false return { value: dynamic ? arg : stripped, dynamic: dynamic } } /** * Parse a directive value and extract the expression * and its filters into a descriptor. * * Example: * * "a + 1 | uppercase" will yield: * { * expression: 'a + 1', * filters: [ * { name: 'uppercase', args: null } * ] * } * * @param {String} str * @return {Object} */ exports.parse = function (s) { var hit = cache.get(s) if (hit) { return hit } // reset parser state str = s inSingle = inDouble = false curly = square = paren = 0 lastFilterIndex = 0 dir = {} for (i = 0, l = str.length; i < l; i++) { c = str.charCodeAt(i) if (inSingle) { // check single quote if (c === 0x27) inSingle = !inSingle } else if (inDouble) { // check double quote if (c === 0x22) inDouble = !inDouble } else if ( c === 0x7C && // pipe str.charCodeAt(i + 1) !== 0x7C && str.charCodeAt(i - 1) !== 0x7C ) { if (dir.expression == null) { // first filter, end of expression lastFilterIndex = i + 1 dir.expression = str.slice(0, i).trim() } else { // already has filter pushFilter() } } else { switch (c) { case 0x22: inDouble = true; break // " case 0x27: inSingle = true; break // ' case 0x28: paren++; break // ( case 0x29: paren--; break // ) case 0x5B: square++; break // [ case 0x5D: square--; break // ] case 0x7B: curly++; break // { case 0x7D: curly--; break // } } } } if (dir.expression == null) { dir.expression = str.slice(0, i).trim() } else if (lastFilterIndex !== 0) { pushFilter() } cache.put(s, dir) return dir } /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { // NOTE: the prop internal directive is compiled and linked // during _initScope(), before the created hook is called. // The purpose is to make the initial prop values available // inside `created` hooks and `data` functions. var _ = __webpack_require__(1) var Watcher = __webpack_require__(20) var bindingModes = __webpack_require__(6)._propBindingModes module.exports = { bind: function () { var child = this.vm var parent = child._context // passed in from compiler directly var prop = this._descriptor var childKey = prop.path var parentKey = prop.parentPath var parentWatcher = this.parentWatcher = new Watcher( parent, parentKey, function (val) { if (_.assertProp(prop, val)) { child[childKey] = val } }, { filters: prop.filters, // important: props need to be observed on the // repeat scope if present scope: this._scope } ) // set the child initial value. var value = parentWatcher.value if (childKey === '$data') { child._data = value } else { _.initProp(child, prop, value) } // setup two-way binding if (prop.mode === bindingModes.TWO_WAY) { // important: defer the child watcher creation until // the created hook (after data observation) var self = this child.$once('hook:created', function () { self.childWatcher = new Watcher( child, childKey, function (val) { parentWatcher.set(val) } ) }) } }, unbind: function () { this.parentWatcher.teardown() if (this.childWatcher) { this.childWatcher.teardown() } } } /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var Dep = __webpack_require__(3) var expParser = __webpack_require__(21) var batcher = __webpack_require__(24) var uid = 0 /** * A watcher parses an expression, collects dependencies, * and fires callback when the expression value changes. * This is used for both the $watch() api and directives. * * @param {Vue} vm * @param {String} expression * @param {Function} cb * @param {Object} options * - {Array} filters * - {Boolean} twoWay * - {Boolean} deep * - {Boolean} user * - {Boolean} sync * - {Boolean} lazy * - {Function} [preProcess] * @constructor */ function Watcher (vm, expOrFn, cb, options) { // mix in options if (options) { _.extend(this, options) } var isFn = typeof expOrFn === 'function' this.vm = vm vm._watchers.push(this) this.expression = isFn ? expOrFn.toString() : expOrFn this.cb = cb this.id = ++uid // uid for batching this.active = true this.dirty = this.lazy // for lazy watchers this.deps = [] this.newDeps = [] this.prevError = null // for async error stacks // parse expression for getter/setter if (isFn) { this.getter = expOrFn this.setter = undefined } else { var res = expParser.parse(expOrFn, this.twoWay) this.getter = res.get this.setter = res.set } this.value = this.lazy ? undefined : this.get() // state for avoiding false triggers for deep and Array // watchers during vm._digest() this.queued = this.shallow = false } /** * Add a dependency to this directive. * * @param {Dep} dep */ Watcher.prototype.addDep = function (dep) { var newDeps = this.newDeps var old = this.deps if (_.indexOf(newDeps, dep) < 0) { newDeps.push(dep) var i = _.indexOf(old, dep) if (i < 0) { dep.addSub(this) } else { old[i] = null } } } /** * Evaluate the getter, and re-collect dependencies. */ Watcher.prototype.get = function () { this.beforeGet() var scope = this.scope || this.vm var value try { value = this.getter.call(scope, scope) } catch (e) { if ( ("development") !== 'production' && config.warnExpressionErrors ) { _.warn( 'Error when evaluating expression "' + this.expression + '". ' + (config.debug ? '' : 'Turn on debug mode to see stack trace.' ), e ) } } // "touch" every property so they are all tracked as // dependencies for deep watching if (this.deep) { traverse(value) } if (this.preProcess) { value = this.preProcess(value) } if (this.filters) { value = scope._applyFilters(value, null, this.filters, false) } this.afterGet() return value } /** * Set the corresponding value with the setter. * * @param {*} value */ Watcher.prototype.set = function (value) { var scope = this.scope || this.vm if (this.filters) { value = scope._applyFilters( value, this.value, this.filters, true) } try { this.setter.call(scope, scope, value) } catch (e) { if ( ("development") !== 'production' && config.warnExpressionErrors ) { _.warn( 'Error when evaluating setter "' + this.expression + '"', e ) } } // two-way sync for v-for alias var forContext = scope.$forContext if (forContext && forContext.alias === this.expression) { if (forContext.filters) { ("development") !== 'production' && _.warn( 'It seems you are using two-way binding on ' + 'a v-for alias, and the v-for has filters. ' + 'This will not work properly. Either remove the ' + 'filters or use an array of objects and bind to ' + 'object properties instead.' ) return } if (scope.$key) { // original is an object forContext.rawValue[scope.$key] = value } else { forContext.rawValue.$set(scope.$index, value) } } } /** * Prepare for dependency collection. */ Watcher.prototype.beforeGet = function () { Dep.target = this } /** * Clean up for dependency collection. */ Watcher.prototype.afterGet = function () { Dep.target = null var oldDeps = this.deps var i = oldDeps.length while (i--) { var dep = oldDeps[i] if (dep) { dep.removeSub(this) } } this.deps = this.newDeps this.newDeps = oldDeps oldDeps.length = 0 // reuse old dep array } /** * Subscriber interface. * Will be called when a dependency changes. * * @param {Boolean} shallow */ Watcher.prototype.update = function (shallow) { if (this.lazy) { this.dirty = true } else if (this.sync || !config.async) { this.run() } else { // if queued, only overwrite shallow with non-shallow, // but not the other way around. this.shallow = this.queued ? shallow ? this.shallow : false : !!shallow this.queued = true // record before-push error stack in debug mode /* istanbul ignore if */ if (("development") !== 'production' && config.debug) { this.prevError = new Error('[vue] async stack trace') } batcher.push(this) } } /** * Batcher job interface. * Will be called by the batcher. */ Watcher.prototype.run = function () { if (this.active) { var value = this.get() if ( value !== this.value || // Deep watchers and Array watchers should fire even // when the value is the same, because the value may // have mutated; but only do so if this is a // non-shallow update (caused by a vm digest). ((_.isArray(value) || this.deep) && !this.shallow) ) { // set new value var oldValue = this.value this.value = value // in debug + async mode, when a watcher callbacks // throws, we also throw the saved before-push error // so the full cross-tick stack trace is available. var prevError = this.prevError /* istanbul ignore if */ if (("development") !== 'production' && config.debug && prevError) { this.prevError = null try { this.cb.call(this.vm, value, oldValue) } catch (e) { _.nextTick(function () { throw prevError }, 0) throw e } } else { this.cb.call(this.vm, value, oldValue) } } this.queued = this.shallow = false } } /** * Evaluate the value of the watcher. * This only gets called for lazy watchers. */ Watcher.prototype.evaluate = function () { // avoid overwriting another watcher that is being // collected. var current = Dep.target this.value = this.get() this.dirty = false Dep.target = current } /** * Depend on all deps collected by this watcher. */ Watcher.prototype.depend = function () { var i = this.deps.length while (i--) { this.deps[i].depend() } } /** * Remove self from all dependencies' subcriber list. */ Watcher.prototype.teardown = function () { if (this.active) { // remove self from vm's watcher list // we can skip this if the vm if being destroyed // which can improve teardown performance. if (!this.vm._isBeingDestroyed) { this.vm._watchers.$remove(this) } var i = this.deps.length while (i--) { this.deps[i].removeSub(this) } this.active = false this.vm = this.cb = this.value = null } } /** * Recrusively traverse an object to evoke all converted * getters, so that every nested property inside the object * is collected as a "deep" dependency. * * @param {Object} obj */ function traverse (obj) { var key, val, i for (key in obj) { val = obj[key] if (_.isArray(val)) { i = val.length while (i--) traverse(val[i]) } else if (_.isObject(val)) { traverse(val) } } } module.exports = Watcher /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Path = __webpack_require__(22) var Cache = __webpack_require__(8) var expressionCache = new Cache(1000) var allowedKeywords = 'Math,Date,this,true,false,null,undefined,Infinity,NaN,' + 'isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,' + 'encodeURIComponent,parseInt,parseFloat' var allowedKeywordsRE = new RegExp('^(' + allowedKeywords.replace(/,/g, '\\b|') + '\\b)') // keywords that don't make sense inside expressions var improperKeywords = 'break,case,class,catch,const,continue,debugger,default,' + 'delete,do,else,export,extends,finally,for,function,if,' + 'import,in,instanceof,let,return,super,switch,throw,try,' + 'var,while,with,yield,enum,await,implements,package,' + 'proctected,static,interface,private,public' var improperKeywordsRE = new RegExp('^(' + improperKeywords.replace(/,/g, '\\b|') + '\\b)') var wsRE = /\s/g var newlineRE = /\n/g var saveRE = /[\{,]\s*[\w\$_]+\s*:|('[^']*'|"[^"]*")|new |typeof |void /g var restoreRE = /"(\d+)"/g var pathTestRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/ var pathReplaceRE = /[^\w$\.]([A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\])*)/g var booleanLiteralRE = /^(true|false)$/ /** * Save / Rewrite / Restore * * When rewriting paths found in an expression, it is * possible for the same letter sequences to be found in * strings and Object literal property keys. Therefore we * remove and store these parts in a temporary array, and * restore them after the path rewrite. */ var saved = [] /** * Save replacer * * The save regex can match two possible cases: * 1. An opening object literal * 2. A string * If matched as a plain string, we need to escape its * newlines, since the string needs to be preserved when * generating the function body. * * @param {String} str * @param {String} isString - str if matched as a string * @return {String} - placeholder with index */ function save (str, isString) { var i = saved.length saved[i] = isString ? str.replace(newlineRE, '\\n') : str return '"' + i + '"' } /** * Path rewrite replacer * * @param {String} raw * @return {String} */ function rewrite (raw) { var c = raw.charAt(0) var path = raw.slice(1) if (allowedKeywordsRE.test(path)) { return raw } else { path = path.indexOf('"') > -1 ? path.replace(restoreRE, restore) : path return c + 'scope.' + path } } /** * Restore replacer * * @param {String} str * @param {String} i - matched save index * @return {String} */ function restore (str, i) { return saved[i] } /** * Rewrite an expression, prefixing all path accessors with * `scope.` and generate getter/setter functions. * * @param {String} exp * @param {Boolean} needSet * @return {Function} */ function compileExpFns (exp, needSet) { if (improperKeywordsRE.test(exp)) { ("development") !== 'production' && _.warn( 'Avoid using reserved keywords in expression: ' + exp ) } // reset state saved.length = 0 // save strings and object literal keys var body = exp .replace(saveRE, save) .replace(wsRE, '') // rewrite all paths // pad 1 space here becaue the regex matches 1 extra char body = (' ' + body) .replace(pathReplaceRE, rewrite) .replace(restoreRE, restore) var getter = makeGetter(body) if (getter) { return { get: getter, body: body, set: needSet ? makeSetter(body) : null } } } /** * Compile getter setters for a simple path. * * @param {String} exp * @return {Function} */ function compilePathFns (exp) { var getter, path if (exp.indexOf('[') < 0) { // really simple path path = exp.split('.') path.raw = exp getter = Path.compileGetter(path) } else { // do the real parsing path = Path.parse(exp) getter = path.get } return { get: getter, // always generate setter for simple paths set: function (obj, val) { Path.set(obj, path, val) } } } /** * Build a getter function. Requires eval. * * We isolate the try/catch so it doesn't affect the * optimization of the parse function when it is not called. * * @param {String} body * @return {Function|undefined} */ function makeGetter (body) { try { return new Function('scope', 'return ' + body + ';') } catch (e) { ("development") !== 'production' && _.warn( 'Invalid expression. ' + 'Generated function body: ' + body ) } } /** * Build a setter function. * * This is only needed in rare situations like "a[b]" where * a settable path requires dynamic evaluation. * * This setter function may throw error when called if the * expression body is not a valid left-hand expression in * assignment. * * @param {String} body * @return {Function|undefined} */ function makeSetter (body) { try { return new Function('scope', 'value', body + '=value;') } catch (e) { ("development") !== 'production' && _.warn( 'Invalid setter function body: ' + body ) } } /** * Check for setter existence on a cache hit. * * @param {Function} hit */ function checkSetter (hit) { if (!hit.set) { hit.set = makeSetter(hit.body) } } /** * Parse an expression into re-written getter/setters. * * @param {String} exp * @param {Boolean} needSet * @return {Function} */ exports.parse = function (exp, needSet) { exp = exp.trim() // try cache var hit = expressionCache.get(exp) if (hit) { if (needSet) { checkSetter(hit) } return hit } // we do a simple path check to optimize for them. // the check fails valid paths with unusal whitespaces, // but that's too rare and we don't care. // also skip boolean literals and paths that start with // global "Math" var res = exports.isSimplePath(exp) ? compilePathFns(exp) : compileExpFns(exp, needSet) expressionCache.put(exp, res) return res } /** * Check if an expression is a simple path. * * @param {String} exp * @return {Boolean} */ exports.isSimplePath = function (exp) { return pathTestRE.test(exp) && // don't treat true/false as paths !booleanLiteralRE.test(exp) && // Math constants e.g. Math.PI, Math.E etc. exp.slice(0, 5) !== 'Math.' } /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var add = __webpack_require__(23).add var Cache = __webpack_require__(8) var pathCache = new Cache(1000) var identRE = exports.identRE = /^[$_a-zA-Z]+[\w$]*$/ // actions var APPEND = 0 var PUSH = 1 // states var BEFORE_PATH = 0 var IN_PATH = 1 var BEFORE_IDENT = 2 var IN_IDENT = 3 var BEFORE_ELEMENT = 4 var AFTER_ZERO = 5 var IN_INDEX = 6 var IN_SINGLE_QUOTE = 7 var IN_DOUBLE_QUOTE = 8 var IN_SUB_PATH = 9 var AFTER_ELEMENT = 10 var AFTER_PATH = 11 var ERROR = 12 var pathStateMachine = [] pathStateMachine[BEFORE_PATH] = { 'ws': [BEFORE_PATH], 'ident': [IN_IDENT, APPEND], '[': [BEFORE_ELEMENT], 'eof': [AFTER_PATH] } pathStateMachine[IN_PATH] = { 'ws': [IN_PATH], '.': [BEFORE_IDENT], '[': [BEFORE_ELEMENT], 'eof': [AFTER_PATH] } pathStateMachine[BEFORE_IDENT] = { 'ws': [BEFORE_IDENT], 'ident': [IN_IDENT, APPEND] } pathStateMachine[IN_IDENT] = { 'ident': [IN_IDENT, APPEND], '0': [IN_IDENT, APPEND], 'number': [IN_IDENT, APPEND], 'ws': [IN_PATH, PUSH], '.': [BEFORE_IDENT, PUSH], '[': [BEFORE_ELEMENT, PUSH], 'eof': [AFTER_PATH, PUSH] } pathStateMachine[BEFORE_ELEMENT] = { 'ws': [BEFORE_ELEMENT], '0': [AFTER_ZERO, APPEND], 'number': [IN_INDEX, APPEND], "'": [IN_SINGLE_QUOTE, APPEND, ''], '"': [IN_DOUBLE_QUOTE, APPEND, ''], 'ident': [IN_SUB_PATH, APPEND, '*'] } pathStateMachine[AFTER_ZERO] = { 'ws': [AFTER_ELEMENT, PUSH], ']': [IN_PATH, PUSH] } pathStateMachine[IN_INDEX] = { '0': [IN_INDEX, APPEND], 'number': [IN_INDEX, APPEND], 'ws': [AFTER_ELEMENT], ']': [IN_PATH, PUSH] } pathStateMachine[IN_SINGLE_QUOTE] = { "'": [AFTER_ELEMENT], 'eof': ERROR, 'else': [IN_SINGLE_QUOTE, APPEND] } pathStateMachine[IN_DOUBLE_QUOTE] = { '"': [AFTER_ELEMENT], 'eof': ERROR, 'else': [IN_DOUBLE_QUOTE, APPEND] } pathStateMachine[IN_SUB_PATH] = { 'ident': [IN_SUB_PATH, APPEND], '0': [IN_SUB_PATH, APPEND], 'number': [IN_SUB_PATH, APPEND], 'ws': [AFTER_ELEMENT], ']': [IN_PATH, PUSH] } pathStateMachine[AFTER_ELEMENT] = { 'ws': [AFTER_ELEMENT], ']': [IN_PATH, PUSH] } /** * Determine the type of a character in a keypath. * * @param {Char} ch * @return {String} type */ function getPathCharType (ch) { if (ch === undefined) { return 'eof' } var code = ch.charCodeAt(0) switch (code) { case 0x5B: // [ case 0x5D: // ] case 0x2E: // . case 0x22: // " case 0x27: // ' case 0x30: // 0 return ch case 0x5F: // _ case 0x24: // $ return 'ident' case 0x20: // Space case 0x09: // Tab case 0x0A: // Newline case 0x0D: // Return case 0xA0: // No-break space case 0xFEFF: // Byte Order Mark case 0x2028: // Line Separator case 0x2029: // Paragraph Separator return 'ws' } // a-z, A-Z if ( (code >= 0x61 && code <= 0x7A) || (code >= 0x41 && code <= 0x5A) ) { return 'ident' } // 1-9 if (code >= 0x31 && code <= 0x39) { return 'number' } return 'else' } /** * Parse a string path into an array of segments * * @param {String} path * @return {Array|undefined} */ function parsePath (path) { var keys = [] var index = -1 var mode = BEFORE_PATH var c, newChar, key, type, transition, action, typeMap var actions = [] actions[PUSH] = function () { if (key === undefined) { return } keys.push(key) key = undefined } actions[APPEND] = function () { if (key === undefined) { key = newChar } else { key += newChar } } function maybeUnescapeQuote () { var nextChar = path[index + 1] if ((mode === IN_SINGLE_QUOTE && nextChar === "'") || (mode === IN_DOUBLE_QUOTE && nextChar === '"')) { index++ newChar = nextChar actions[APPEND]() return true } } while (mode != null) { index++ c = path[index] if (c === '\\' && maybeUnescapeQuote()) { continue } type = getPathCharType(c) typeMap = pathStateMachine[mode] transition = typeMap[type] || typeMap['else'] || ERROR if (transition === ERROR) { return // parse error } mode = transition[0] action = actions[transition[1]] if (action) { newChar = transition[2] newChar = newChar === undefined ? c : newChar === '*' ? newChar + c : newChar action() } if (mode === AFTER_PATH) { keys.raw = path return keys } } } /** * Format a accessor segment based on its type. * * @param {String} key * @return {Boolean} */ function formatAccessor (key) { if (identRE.test(key)) { // identifier return '.' + key } else if (+key === key >>> 0) { // bracket index return '[' + key + ']' } else if (key.charAt(0) === '*') { return '[o' + formatAccessor(key.slice(1)) + ']' } else { // bracket string return '["' + key.replace(/"/g, '\\"') + '"]' } } /** * Compiles a getter function with a fixed path. * The fixed path getter supresses errors. * * @param {Array} path * @return {Function} */ exports.compileGetter = function (path) { var body = 'return o' + path.map(formatAccessor).join('') return new Function('o', body) } /** * External parse that check for a cache hit first * * @param {String} path * @return {Array|undefined} */ exports.parse = function (path) { var hit = pathCache.get(path) if (!hit) { hit = parsePath(path) if (hit) { hit.get = exports.compileGetter(hit) pathCache.put(path, hit) } } return hit } /** * Get from an object from a path string * * @param {Object} obj * @param {String} path */ exports.get = function (obj, path) { path = exports.parse(path) if (path) { return path.get(obj) } } /** * Warn against setting non-existent root path on a vm. */ var warnNonExistent if (true) { warnNonExistent = function (path) { _.warn( 'You are setting a non-existent path "' + path.raw + '" ' + 'on a vm instance. Consider pre-initializing the property ' + 'with the "data" option for more reliable reactivity ' + 'and better performance.' ) } } /** * Set on an object from a path * * @param {Object} obj * @param {String | Array} path * @param {*} val */ exports.set = function (obj, path, val) { var original = obj if (typeof path === 'string') { path = exports.parse(path) } if (!path || !_.isObject(obj)) { return false } var last, key for (var i = 0, l = path.length; i < l; i++) { last = obj key = path[i] if (key.charAt(0) === '*') { key = original[key.slice(1)] } if (i < l - 1) { obj = obj[key] if (!_.isObject(obj)) { obj = {} if (("development") !== 'production' && last._isVue) { warnNonExistent(path) } add(last, key, obj) } } else { if (_.isArray(obj)) { obj.$set(key, val) } else if (key in obj) { obj[key] = val } else { if (("development") !== 'production' && obj._isVue) { warnNonExistent(path) } add(obj, key, val) } } } return true } /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var objProto = Object.prototype /** * $add deprecation warning */ _.define( objProto, '$add', function (key, val) { if (true) { _.deprecation.ADD() } add(this, key, val) } ) /** * Add a new property to an observed object * and emits corresponding event. This is internal and * no longer exposed as of 1.0. * * @param {Object} obj * @param {String} key * @param {*} val * @public */ var add = exports.add = function (obj, key, val) { if (obj.hasOwnProperty(key)) { return } if (obj._isVue) { add(obj._data, key, val) return } var ob = obj.__ob__ if (!ob || _.isReserved(key)) { obj[key] = val return } ob.convert(key, val) ob.notify() if (ob.vms) { var i = ob.vms.length while (i--) { var vm = ob.vms[i] vm._proxy(key) vm._digest() } } } /** * Set a property on an observed object, calling add to * ensure the property is observed. * * @param {String} key * @param {*} val * @public */ _.define( objProto, '$set', function $set (key, val) { add(this, key, val) this[key] = val } ) /** * Deletes a property from an observed object * and emits corresponding event * * @param {String} key * @public */ _.define( objProto, '$delete', function $delete (key) { if (!this.hasOwnProperty(key)) return delete this[key] var ob = this.__ob__ if (!ob || _.isReserved(key)) { return } ob.notify() if (ob.vms) { var i = ob.vms.length while (i--) { var vm = ob.vms[i] vm._unproxy(key) vm._digest() } } } ) /***/ }, /* 24 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) // we have two separate queues: one for directive updates // and one for user watcher registered via $watch(). // we want to guarantee directive updates to be called // before user watchers so that when user watchers are // triggered, the DOM would have already been in updated // state. var queue = [] var userQueue = [] var has = {} var circular = {} var waiting = false var internalQueueDepleted = false /** * Reset the batcher's state. */ function resetBatcherState () { queue = [] userQueue = [] has = {} circular = {} waiting = internalQueueDepleted = false } /** * Flush both queues and run the watchers. */ function flushBatcherQueue () { runBatcherQueue(queue) internalQueueDepleted = true runBatcherQueue(userQueue) resetBatcherState() } /** * Run the watchers in a single queue. * * @param {Array} queue */ function runBatcherQueue (queue) { // do not cache length because more watchers might be pushed // as we run existing watchers for (var i = 0; i < queue.length; i++) { var watcher = queue[i] var id = watcher.id has[id] = null watcher.run() // in dev build, check and stop circular updates. if (("development") !== 'production' && has[id] != null) { circular[id] = (circular[id] || 0) + 1 if (circular[id] > config._maxUpdateCount) { queue.splice(has[id], 1) _.warn( 'You may have an infinite update loop for watcher ' + 'with expression: ' + watcher.expression ) } } } } /** * Push a watcher into the watcher queue. * Jobs with duplicate IDs will be skipped unless it's * pushed when the queue is being flushed. * * @param {Watcher} watcher * properties: * - {Number} id * - {Function} run */ exports.push = function (watcher) { var id = watcher.id if (has[id] == null) { // if an internal watcher is pushed, but the internal // queue is already depleted, we run it immediately. if (internalQueueDepleted && !watcher.user) { watcher.run() return } // push watcher into appropriate queue var q = watcher.user ? userQueue : queue has[id] = q.length q.push(watcher) // queue the flush if (!waiting) { waiting = true _.nextTick(flushBatcherQueue) } } } /***/ }, /* 25 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Cache = __webpack_require__(8) var templateCache = new Cache(1000) var idSelectorCache = new Cache(1000) var map = { _default: [0, '', ''], legend: [1, '<fieldset>', '</fieldset>'], tr: [2, '<table><tbody>', '</tbody></table>'], col: [ 2, '<table><tbody></tbody><colgroup>', '</colgroup></table>' ] } map.td = map.th = [ 3, '<table><tbody><tr>', '</tr></tbody></table>' ] map.option = map.optgroup = [ 1, '<select multiple="multiple">', '</select>' ] map.thead = map.tbody = map.colgroup = map.caption = map.tfoot = [1, '<table>', '</table>'] map.g = map.defs = map.symbol = map.use = map.image = map.text = map.circle = map.ellipse = map.line = map.path = map.polygon = map.polyline = map.rect = [ 1, '<svg ' + 'xmlns="http://www.w3.org/2000/svg" ' + 'xmlns:xlink="http://www.w3.org/1999/xlink" ' + 'xmlns:ev="http://www.w3.org/2001/xml-events"' + 'version="1.1">', '</svg>' ] /** * Check if a node is a supported template node with a * DocumentFragment content. * * @param {Node} node * @return {Boolean} */ function isRealTemplate (node) { return _.isTemplate(node) && node.content instanceof DocumentFragment } var tagRE = /<([\w:]+)/ var entityRE = /&\w+;|&#\d+;|&#x[\dA-F]+;/ /** * Convert a string template to a DocumentFragment. * Determines correct wrapping by tag types. Wrapping * strategy found in jQuery & component/domify. * * @param {String} templateString * @return {DocumentFragment} */ function stringToFragment (templateString) { // try a cache hit first var hit = templateCache.get(templateString) if (hit) { return hit } var frag = document.createDocumentFragment() var tagMatch = templateString.match(tagRE) var entityMatch = entityRE.test(templateString) if (!tagMatch && !entityMatch) { // text only, return a single text node. frag.appendChild( document.createTextNode(templateString) ) } else { var tag = tagMatch && tagMatch[1] var wrap = map[tag] || map._default var depth = wrap[0] var prefix = wrap[1] var suffix = wrap[2] var node = document.createElement('div') node.innerHTML = prefix + templateString.trim() + suffix while (depth--) { node = node.lastChild } var child /* eslint-disable no-cond-assign */ while (child = node.firstChild) { /* eslint-enable no-cond-assign */ frag.appendChild(child) } } templateCache.put(templateString, frag) return frag } /** * Convert a template node to a DocumentFragment. * * @param {Node} node * @return {DocumentFragment} */ function nodeToFragment (node) { // if its a template tag and the browser supports it, // its content is already a document fragment. if (isRealTemplate(node)) { _.trimNode(node.content) return node.content } // script template if (node.tagName === 'SCRIPT') { return stringToFragment(node.textContent) } // normal node, clone it to avoid mutating the original var clone = exports.clone(node) var frag = document.createDocumentFragment() var child /* eslint-disable no-cond-assign */ while (child = clone.firstChild) { /* eslint-enable no-cond-assign */ frag.appendChild(child) } _.trimNode(frag) return frag } // Test for the presence of the Safari template cloning bug // https://bugs.webkit.org/show_bug.cgi?id=137755 var hasBrokenTemplate = _.inBrowser ? (function () { var a = document.createElement('div') a.innerHTML = '<template>1</template>' return !a.cloneNode(true).firstChild.innerHTML })() : false // Test for IE10/11 textarea placeholder clone bug var hasTextareaCloneBug = _.inBrowser ? (function () { var t = document.createElement('textarea') t.placeholder = 't' return t.cloneNode(true).value === 't' })() : false /** * 1. Deal with Safari cloning nested <template> bug by * manually cloning all template instances. * 2. Deal with IE10/11 textarea placeholder bug by setting * the correct value after cloning. * * @param {Element|DocumentFragment} node * @return {Element|DocumentFragment} */ exports.clone = function (node) { if (!node.querySelectorAll) { return node.cloneNode() } var res = node.cloneNode(true) var i, original, cloned /* istanbul ignore if */ if (hasBrokenTemplate) { var clone = res if (isRealTemplate(node)) { node = node.content clone = res.content } original = node.querySelectorAll('template') if (original.length) { cloned = clone.querySelectorAll('template') i = cloned.length while (i--) { cloned[i].parentNode.replaceChild( exports.clone(original[i]), cloned[i] ) } } } /* istanbul ignore if */ if (hasTextareaCloneBug) { if (node.tagName === 'TEXTAREA') { res.value = node.value } else { original = node.querySelectorAll('textarea') if (original.length) { cloned = res.querySelectorAll('textarea') i = cloned.length while (i--) { cloned[i].value = original[i].value } } } } return res } /** * Process the template option and normalizes it into a * a DocumentFragment that can be used as a partial or a * instance template. * * @param {*} template * Possible values include: * - DocumentFragment object * - Node object of type Template * - id selector: '#some-template-id' * - template string: '<div><span>{{msg}}</span></div>' * @param {Boolean} clone * @param {Boolean} noSelector * @return {DocumentFragment|undefined} */ exports.parse = function (template, clone, noSelector) { var node, frag // if the template is already a document fragment, // do nothing if (template instanceof DocumentFragment) { _.trimNode(template) return clone ? exports.clone(template) : template } if (typeof template === 'string') { // id selector if (!noSelector && template.charAt(0) === '#') { // id selector can be cached too frag = idSelectorCache.get(template) if (!frag) { node = document.getElementById(template.slice(1)) if (node) { frag = nodeToFragment(node) // save selector to cache idSelectorCache.put(template, frag) } } } else { // normal string template frag = stringToFragment(template) } } else if (template.nodeType) { // a direct node frag = nodeToFragment(template) } return frag && clone ? exports.clone(frag) : frag } /***/ }, /* 26 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var templateParser = __webpack_require__(25) module.exports = { isLiteral: true, priority: 1500, /** * Setup. Two possible usages: * * - static: * v-component="comp" * * - dynamic: * v-component="{{currentView}}" */ bind: function () { if (!this.el.__vue__) { // check keep-alive options. // If yes, instead of destroying the active vm when // hiding (v-if) or switching (dynamic literal) it, // we simply remove it from the DOM and save it in a // cache object, with its constructor id as the key. this.keepAlive = this.param('keep-alive') != null // wait for event before insertion this.waitForEvent = this.param('wait-for') if (true) { if (this.waitForEvent) { _.deprecation.WAIT_FOR() } } // check ref // TODO: only check ref in 1.0.0 var ref = this.param(config.prefix + 'ref') /* istanbul ignore if */ if (("development") !== 'production' && ref) { _.deprecation.V_REF() } this.ref = ref || _.findRef(this.el) var refs = (this._scope || this.vm).$ if (this.ref && !refs.hasOwnProperty(this.ref)) { _.defineReactive(refs, this.ref, null) } if (this.keepAlive) { this.cache = {} } // check inline-template if (this.param('inline-template') !== null) { // extract inline template as a DocumentFragment this.inlineTemplate = _.extractContent(this.el, true) } // component resolution related state this.pendingComponentCb = this.Component = null // transition related state this.pendingRemovals = 0 this.pendingRemovalCb = null // if static, build right now. if (!this._isDynamicLiteral) { this.resolveComponent(this.expression, _.bind(this.initStatic, this)) } else { // check dynamic component params // create a ref anchor this.anchor = _.createAnchor('v-component') _.replace(this.el, this.anchor) this.transMode = this.param('transition-mode') } } else { ("development") !== 'production' && _.warn( 'cannot mount component "' + this.expression + '" ' + 'on already mounted element: ' + this.el ) } }, /** * Initialize a static component. */ initStatic: function () { // wait-for var anchor = this.el var options var waitFor = this.waitForEvent var activateHook = this.Component.options.activate if (waitFor) { options = { created: function () { this.$once(waitFor, insert) } } } var child = this.childVM = this.build(options) if (!this.waitForEvent) { if (activateHook) { activateHook.call(child, insert) } else { child.$before(anchor) _.remove(anchor) } } function insert () { // TODO: no need to fallback to this in 1.0.0 // once wait-for is removed (child || this).$before(anchor) _.remove(anchor) } }, /** * Public update, called by the watcher in the dynamic * literal scenario, e.g. v-component="{{view}}" */ update: function (value) { this.setComponent(value) }, /** * Switch dynamic components. May resolve the component * asynchronously, and perform transition based on * specified transition mode. Accepts a few additional * arguments specifically for vue-router. * * The callback is called when the full transition is * finished. * * @param {String} value * @param {Function} [cb] */ setComponent: function (value, cb) { this.invalidatePending() if (!value) { // just remove current this.unbuild(true) this.remove(this.childVM, cb) this.childVM = null } else { this.resolveComponent(value, _.bind(function () { this.unbuild(true) var options var self = this var waitFor = this.waitForEvent var activateHook = this.Component.options.activate if (waitFor) { options = { created: function () { this.$once(waitFor, insert) } } } var cached = this.getCached() var newComponent = this.build(options) if ((!waitFor && !activateHook) || cached) { this.transition(newComponent, cb) } else { this.waitingFor = newComponent if (activateHook) { activateHook.call(newComponent, insert) } } function insert () { self.waitingFor = null // TODO: no need to fallback to this in 1.0.0 // once wait-for is removed self.transition((newComponent || this), cb) } }, this)) } }, /** * Resolve the component constructor to use when creating * the child vm. */ resolveComponent: function (id, cb) { var self = this this.pendingComponentCb = _.cancellable(function (Component) { self.Component = Component cb() }) this.vm._resolveComponent(id, this.pendingComponentCb) }, /** * When the component changes or unbinds before an async * constructor is resolved, we need to invalidate its * pending callback. */ invalidatePending: function () { if (this.pendingComponentCb) { this.pendingComponentCb.cancel() this.pendingComponentCb = null } }, /** * Instantiate/insert a new child vm. * If keep alive and has cached instance, insert that * instance; otherwise build a new one and cache it. * * @param {Object} [extraOptions] * @return {Vue} - the created instance */ build: function (extraOptions) { var cached = this.getCached() if (cached) { return cached } if (this.Component) { // default options var options = { el: templateParser.clone(this.el), template: this.inlineTemplate, // if no inline-template, then the compiled // linker can be cached for better performance. _linkerCachable: !this.inlineTemplate, _ref: this.ref, _asComponent: true, _isRouterView: this._isRouterView, // if this is a transcluded component, context // will be the common parent vm of this instance // and its host. _context: this.vm, // if this is inside an inline v-repeat, the scope // will be the intermediate scope created for this // repeat fragment. this is used for linking props // and container directives. _scope: this._scope, // pass in the owner fragment of this component. // this is necessary so that the fragment can keep // track of its contained components in order to // call attach/detach hooks for them. _frag: this._frag } // extra options if (extraOptions) { _.extend(options, extraOptions) } var parent = this._host || this.vm var child = parent.$addChild(options, this.Component) if (this.keepAlive) { this.cache[this.Component.cid] = child } /* istanbul ignore if */ if (("development") !== 'production' && this.el.hasAttribute('transition') && child._isFragment) { _.warn( 'Transitions will not work on a fragment instance. ' + 'Template: ' + child.$options.template ) } return child } }, /** * Try to get a cached instance of the current component. * * @return {Vue|undefined} */ getCached: function () { return this.keepAlive && this.cache[this.Component.cid] }, /** * Teardown the current child, but defers cleanup so * that we can separate the destroy and removal steps. * * @param {Boolean} defer */ unbuild: function (defer) { if (this.waitingFor) { this.waitingFor.$destroy() this.waitingFor = null } var child = this.childVM if (!child || this.keepAlive) { return } // the sole purpose of `deferCleanup` is so that we can // "deactivate" the vm right now and perform DOM removal // later. child.$destroy(false, defer) }, /** * Remove current destroyed child and manually do * the cleanup after removal. * * @param {Function} cb */ remove: function (child, cb) { var keepAlive = this.keepAlive if (child) { // we may have a component switch when a previous // component is still being transitioned out. // we want to trigger only one lastest insertion cb // when the existing transition finishes. (#1119) this.pendingRemovals++ this.pendingRemovalCb = cb var self = this child.$remove(function () { self.pendingRemovals-- if (!keepAlive) child._cleanup() if (!self.pendingRemovals && self.pendingRemovalCb) { self.pendingRemovalCb() self.pendingRemovalCb = null } }) } else if (cb) { cb() } }, /** * Actually swap the components, depending on the * transition mode. Defaults to simultaneous. * * @param {Vue} target * @param {Function} [cb] */ transition: function (target, cb) { var self = this var current = this.childVM this.childVM = target switch (self.transMode) { case 'in-out': target.$before(self.anchor, function () { self.remove(current, cb) }) break case 'out-in': self.remove(current, function () { target.$before(self.anchor, cb) }) break default: self.remove(current) target.$before(self.anchor, cb) } }, /** * Unbind. */ unbind: function () { this.invalidatePending() // Do not defer cleanup when unbinding this.unbuild() // destroy all keep-alive cached instances if (this.cache) { for (var key in this.cache) { this.cache[key].$destroy() } this.cache = null } } } /***/ }, /* 27 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var templateParser = __webpack_require__(25) var specialCharRE = /[#@\*\$\.]/ /** * Process an element or a DocumentFragment based on a * instance option object. This allows us to transclude * a template node/fragment before the instance is created, * so the processed fragment can then be cloned and reused * in v-repeat. * * @param {Element} el * @param {Object} options * @return {Element|DocumentFragment} */ exports.transclude = function (el, options) { // extract container attributes to pass them down // to compiler, because they need to be compiled in // parent scope. we are mutating the options object here // assuming the same object will be used for compile // right after this. if (options) { options._containerAttrs = extractAttrs(el) } // for template tags, what we want is its content as // a documentFragment (for fragment instances) if (_.isTemplate(el)) { el = templateParser.parse(el) } if (options) { if (options._asComponent && !options.template) { options.template = '<slot></slot>' } if (options.template) { options._content = _.extractContent(el) el = transcludeTemplate(el, options) } } if (el instanceof DocumentFragment) { // anchors for fragment instance // passing in `persist: true` to avoid them being // discarded by IE during template cloning _.prepend(_.createAnchor('v-start', true), el) el.appendChild(_.createAnchor('v-end', true)) } return el } /** * Process the template option. * If the replace option is true this will swap the $el. * * @param {Element} el * @param {Object} options * @return {Element|DocumentFragment} */ function transcludeTemplate (el, options) { var template = options.template var frag = templateParser.parse(template, true) if (frag) { var replacer = frag.firstChild var tag = replacer.tagName && replacer.tagName.toLowerCase() if (options.replace) { /* istanbul ignore if */ if (el === document.body) { ("development") !== 'production' && _.warn( 'You are mounting an instance with a template to ' + '<body>. This will replace <body> entirely. You ' + 'should probably use `replace: false` here.' ) } // there are many cases where the instance must // become a fragment instance: basically anything that // can create more than 1 root nodes. if ( // multi-children template frag.childNodes.length > 1 || // non-element template replacer.nodeType !== 1 || // single nested component _.resolveAsset(options, 'components', tag) || // element directive _.resolveAsset(options, 'elementDirectives', tag) || // attribue based fragment cases isFragment(replacer) ) { return frag } else { options._replacerAttrs = extractAttrs(replacer) mergeAttrs(el, replacer) return replacer } } else { el.appendChild(frag) return el } } else { ("development") !== 'production' && _.warn( 'Invalid template option: ' + template ) } } /** * Helper to extract a component container's attributes * into a plain object array. * * @param {Element} el * @return {Array} */ function extractAttrs (el) { if (el.nodeType === 1 && el.hasAttributes()) { return _.toArray(el.attributes) } } /** * Merge the attributes of two elements, and make sure * the class names are merged properly. * * @param {Element} from * @param {Element} to */ function mergeAttrs (from, to) { var attrs = from.attributes var i = attrs.length var name, value while (i--) { name = attrs[i].name value = attrs[i].value if (!to.hasAttribute(name) && !specialCharRE.test(name)) { to.setAttribute(name, value) } else if (name === 'class') { value = to.getAttribute(name) + ' ' + value to.setAttribute(name, value) } } } /** * Check if a replacer element needs to force the instance * into fragment mode. * * @param {Element} el * @return {Boolean} */ function isFragment (el) { return el.hasAttributes() && ( // alternative component syntax el.hasAttribute('is') || el.hasAttribute(':is') || el.hasAttribute(config.prefix + 'bind:is') || el.hasAttribute(config.prefix + 'component') || // repeat block el.hasAttribute(config.prefix + 'repeat') || // for block el.hasAttribute(config.prefix + 'for') || // if block el.hasAttribute(config.prefix + 'if') ) } /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var compiler = __webpack_require__(15) var templateParser = __webpack_require__(25) var Fragment = __webpack_require__(29) var Cache = __webpack_require__(8) var linkerCache = new Cache(5000) /** * A factory that can be used to create instances of a * fragment. Caches the compiled linker if possible. * * @param {Vue} vm * @param {Element|String} el */ function FragmentFactory (vm, el) { this.vm = vm var template var isString = typeof el === 'string' if (isString || _.isTemplate(el)) { template = templateParser.parse(el, true) } else { template = document.createDocumentFragment() template.appendChild(el) } this.template = template // linker can be cached, but only for components var linker var cid = vm.constructor.cid if (cid > 0) { var cacheId = cid + (isString ? el : el.outerHTML) linker = linkerCache.get(cacheId) if (!linker) { linker = compiler.compile(template, vm.$options, true) linkerCache.put(cacheId, linker) } } else { linker = compiler.compile(template, vm.$options, true) } this.linker = linker } /** * Create a fragment instance with given host and scope. * * @param {Vue} host * @param {Object} scope * @param {Fragment} parentFrag */ FragmentFactory.prototype.create = function (host, scope, parentFrag) { var frag = templateParser.clone(this.template) return new Fragment(this.linker, this.vm, frag, host, scope, parentFrag) } module.exports = FragmentFactory /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var transition = __webpack_require__(30) /** * Abstraction for a partially-compiled fragment. * Can optionally compile content with a child scope. * * @param {Function} linker * @param {Vue} vm * @param {DocumentFragment} frag * @param {Vue} [host] * @param {Object} [scope] */ function Fragment (linker, vm, frag, host, scope, parentFrag) { this.children = [] this.childFrags = [] this.vm = vm this.scope = scope this.inserted = false this.parentFrag = parentFrag if (parentFrag) { parentFrag.childFrags.push(this) } this.unlink = linker(vm, frag, host, scope, this) var single = this.single = frag.childNodes.length === 1 if (single) { this.node = frag.childNodes[0] this.before = singleBefore this.remove = singleRemove } else { this.node = _.createAnchor('fragment-start') this.end = _.createAnchor('fragment-end') this.nodes = _.toArray(frag.childNodes) this.before = multiBefore this.remove = multiRemove } this.node.__vfrag__ = this } /** * Call attach/detach for all components contained within * this fragment. Also do so recursively for all child * fragments. * * @param {Function} hook */ Fragment.prototype.callHook = function (hook) { var i, l for (i = 0, l = this.children.length; i < l; i++) { hook(this.children[i]) } for (i = 0, l = this.childFrags.length; i < l; i++) { this.childFrags[i].callHook(hook) } } Fragment.prototype.destroy = function () { if (this.parentFrag) { this.parentFrag.childFrags.$remove(this) } this.unlink() } /** * Insert fragment before target, single node version * * @param {Node} target * @param {Boolean} trans */ function singleBefore (target, trans) { var method = trans !== false ? transition.before : _.before method(this.node, target, this.vm) this.inserted = true if (_.inDoc(this.node)) { this.callHook(attach) } } /** * Remove fragment, single node version */ function singleRemove () { var shouldCallRemove = _.inDoc(this.node) transition.remove(this.node, this.vm) this.inserted = false if (shouldCallRemove) { this.callHook(detach) } } /** * Insert fragment before target, multi-nodes version * * @param {Node} target * @param {Boolean} trans */ function multiBefore (target, trans) { _.before(this.node, target) var nodes = this.nodes var vm = this.vm var method = trans !== false ? transition.before : _.before for (var i = 0, l = nodes.length; i < l; i++) { method(nodes[i], target, vm) } _.before(this.end, target) this.inserted = true if (_.inDoc(this.node)) { this.callHook(attach) } } /** * Remove fragment, multi-nodes version */ function multiRemove () { var shouldCallRemove = _.inDoc(this.node) var parent = this.node.parentNode var node = this.node.nextSibling var nodes = this.nodes = [] var vm = this.vm var next while (node !== this.end) { nodes.push(node) next = node.nextSibling transition.remove(node, vm) node = next } parent.removeChild(this.node) parent.removeChild(this.end) this.inserted = false if (shouldCallRemove) { this.callHook(detach) } } /** * Call attach hook for a Vue instance. * * @param {Vue} child */ function attach (child) { if (!child._isAttached) { child._callHook('attached') } } /** * Call detach hook for a Vue instance. * * @param {Vue} child */ function detach (child) { if (child._isAttached) { child._callHook('detached') } } module.exports = Fragment /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * Append with transition. * * @param {Element} el * @param {Element} target * @param {Vue} vm * @param {Function} [cb] */ exports.append = function (el, target, vm, cb) { apply(el, 1, function () { target.appendChild(el) }, vm, cb) } /** * InsertBefore with transition. * * @param {Element} el * @param {Element} target * @param {Vue} vm * @param {Function} [cb] */ exports.before = function (el, target, vm, cb) { apply(el, 1, function () { _.before(el, target) }, vm, cb) } /** * Remove with transition. * * @param {Element} el * @param {Vue} vm * @param {Function} [cb] */ exports.remove = function (el, vm, cb) { apply(el, -1, function () { _.remove(el) }, vm, cb) } /** * Remove by appending to another parent with transition. * This is only used in block operations. * * @param {Element} el * @param {Element} target * @param {Vue} vm * @param {Function} [cb] */ exports.removeThenAppend = function (el, target, vm, cb) { apply(el, -1, function () { target.appendChild(el) }, vm, cb) } /** * Apply transitions with an operation callback. * * @param {Element} el * @param {Number} direction * 1: enter * -1: leave * @param {Function} op - the actual DOM operation * @param {Vue} vm * @param {Function} [cb] */ var apply = exports.apply = function (el, direction, op, vm, cb) { var transition = el.__v_trans if ( !transition || // skip if there are no js hooks and CSS transition is // not supported (!transition.hooks && !_.transitionEndEvent) || // skip transitions for initial compile !vm._isCompiled || // if the vm is being manipulated by a parent directive // during the parent's compilation phase, skip the // animation. (vm.$parent && !vm.$parent._isCompiled) ) { op() if (cb) cb() return } var action = direction > 0 ? 'enter' : 'leave' transition[action](op, cb) } /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { // TODO: only expose core in 1.0.0 // manipulation directives exports.text = __webpack_require__(32) exports.html = __webpack_require__(33) exports.attr = __webpack_require__(34) exports.show = __webpack_require__(35) exports['class'] = __webpack_require__(36) exports.el = __webpack_require__(37) exports.ref = __webpack_require__(38) exports.cloak = __webpack_require__(39) exports.style = __webpack_require__(40) exports.transition = __webpack_require__(41) // event listener directives exports.on = __webpack_require__(44) exports.model = __webpack_require__(47) // logic control directives exports.repeat = __webpack_require__(52) exports['for'] = __webpack_require__(53) exports['if'] = __webpack_require__(54) // internal directives that should not be used directly // but we still want to expose them for advanced usage. exports._component = __webpack_require__(26) exports._prop = __webpack_require__(19) // 1.0.0 compat exports.bind = exports.attr /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) module.exports = { bind: function () { this.attr = this.el.nodeType === 3 ? 'data' : 'textContent' }, update: function (value) { this.el[this.attr] = _.toString(value) } } /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var templateParser = __webpack_require__(25) module.exports = { bind: function () { // a comment node means this is a binding for // {{{ inline unescaped html }}} if (this.el.nodeType === 8) { // hold nodes this.nodes = [] // replace the placeholder with proper anchor this.anchor = _.createAnchor('v-html') _.replace(this.el, this.anchor) } }, update: function (value) { value = _.toString(value) if (this.nodes) { this.swap(value) } else { this.el.innerHTML = value } }, swap: function (value) { // remove old nodes var i = this.nodes.length while (i--) { _.remove(this.nodes[i]) } // convert new value to a fragment // do not attempt to retrieve from id selector var frag = templateParser.parse(value, true, true) // save a reference to these nodes so we can remove later this.nodes = _.toArray(frag.childNodes) _.before(frag, this.anchor) } } /***/ }, /* 34 */ /***/ function(module, exports) { // xlink var xlinkNS = 'http://www.w3.org/1999/xlink' var xlinkRE = /^xlink:/ // these input element attributes should also set their // corresponding properties var inputProps = { value: 1, checked: 1, selected: 1 } // these attributes should set a hidden property for // binding v-model to object values var modelProps = { value: '_value', 'true-value': '_trueValue', 'false-value': '_falseValue' } module.exports = { priority: 850, update: function (value) { if (this.arg) { this.setAttr(this.arg, value) } else if (typeof value === 'object') { // TODO no longer need to support object in 1.0.0 this.objectHandler(value) } }, objectHandler: function (value) { // cache object attrs so that only changed attrs // are actually updated. var cache = this.cache || (this.cache = {}) var attr, val for (attr in cache) { if (!(attr in value)) { this.setAttr(attr, null) delete cache[attr] } } for (attr in value) { val = value[attr] if (val !== cache[attr]) { cache[attr] = val this.setAttr(attr, val) } } }, setAttr: function (attr, value) { if (inputProps[attr] && attr in this.el) { if (!this.valueRemoved) { this.el.removeAttribute(attr) this.valueRemoved = true } this.el[attr] = value } else if (value != null && value !== false) { if (xlinkRE.test(attr)) { this.el.setAttributeNS(xlinkNS, attr, value) } else { this.el.setAttribute(attr, value) } } else { this.el.removeAttribute(attr) } // set model props var modelProp = modelProps[attr] if (modelProp) { this.el[modelProp] = value } } } /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { var transition = __webpack_require__(30) module.exports = function (value) { var el = this.el transition.apply(el, value ? 1 : -1, function () { el.style.display = value ? '' : 'none' }, this.vm) } /***/ }, /* 36 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var addClass = _.addClass var removeClass = _.removeClass module.exports = { // TODO: remove unnecessary logic in 1.0.0 bind: function () { // interpolations like class="{{abc}}" are converted // to v-class, and we need to remove the raw, // uninterpolated className at binding time. var raw = this._descriptor._rawClass if (raw) { this.prevKeys = raw.trim().split(/\s+/) } }, update: function (value) { if (this.arg) { // single toggle if (value) { addClass(this.el, this.arg) } else { removeClass(this.el, this.arg) } } else { if (value && typeof value === 'string') { this.handleObject(stringToObject(value)) } else if (_.isPlainObject(value)) { this.handleObject(value) } else if (_.isArray(value)) { this.handleArray(value) } else { this.cleanup() } } }, handleObject: function (value) { this.cleanup(value) var keys = this.prevKeys = Object.keys(value) for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i] if (value[key]) { addClass(this.el, key) } else { removeClass(this.el, key) } } }, handleArray: function (value) { this.cleanup(value) for (var i = 0, l = value.length; i < l; i++) { addClass(this.el, value[i]) } this.prevKeys = value }, cleanup: function (value) { if (this.prevKeys) { var i = this.prevKeys.length while (i--) { var key = this.prevKeys[i] if (!value || !contains(value, key)) { removeClass(this.el, key) } } } } } function stringToObject (value) { var res = {} var keys = value.trim().split(/\s+/) var i = keys.length while (i--) { res[keys[i]] = true } return res } function contains (value, key) { return _.isArray(value) ? value.indexOf(key) > -1 : value.hasOwnProperty(key) } /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) module.exports = { isLiteral: true, priority: 1500, bind: function () { var id = this.arg ? _.camelize(this.arg) : this.expression if (("development") !== 'production' && !this.arg && id) { _.deprecation.V_EL() } if (!this._isDynamicLiteral) { this.update(id) } }, update: function (id) { if (this.id) { this.unbind() } this.id = id var refs = (this._scope || this.vm).$$ if (refs.hasOwnProperty(id)) { refs[id] = this.el } else { _.defineReactive(refs, id, this.el) } }, unbind: function () { var refs = (this._scope || this.vm).$$ if (refs[this.id] === this.el) { refs[this.id] = null } } } /***/ }, /* 38 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) module.exports = { isLiteral: true, bind: function () { var vm = this.el.__vue__ if (!vm) { ("development") !== 'production' && _.warn( 'v-ref should only be used on a component root element.' ) return } // If we get here, it means this is a `v-ref` on a // child, because parent scope `v-ref` is stripped in // `v-component` already. var ref = this.arg || this.expression var context = this.vm._scope || this.vm._context context.$[ref] = this.vm if (true) { _.deprecation.REF_IN_CHILD() } }, unbind: function () { var ref = this.expression var context = this.vm._scope || this.vm._context if (context.$[ref] === this.vm) { context.$[ref] = null } } } /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { var config = __webpack_require__(6) module.exports = { bind: function () { var el = this.el this.vm.$once('hook:compiled', function () { el.removeAttribute(config.prefix + 'cloak') }) } } /***/ }, /* 40 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var prefixes = ['-webkit-', '-moz-', '-ms-'] var camelPrefixes = ['Webkit', 'Moz', 'ms'] var importantRE = /!important;?$/ var camelRE = /([a-z])([A-Z])/g var testEl = null var propCache = {} module.exports = { deep: true, update: function (value) { if (this.arg) { this.setProp(this.arg, value) } else { if (typeof value === 'string') { this.el.style.cssText = value } else if (_.isArray(value)) { this.objectHandler(value.reduce(_.extend, {})) } else { this.objectHandler(value) } } }, objectHandler: function (value) { // cache object styles so that only changed props // are actually updated. var cache = this.cache || (this.cache = {}) var prop, val for (prop in cache) { if (!(prop in value)) { this.setProp(prop, null) delete cache[prop] } } for (prop in value) { val = value[prop] if (val !== cache[prop]) { cache[prop] = val this.setProp(prop, val) } } }, setProp: function (prop, value) { prop = normalize(prop) if (!prop) return // unsupported prop // cast possible numbers/booleans into strings if (value != null) value += '' if (value) { var isImportant = importantRE.test(value) ? 'important' : '' if (isImportant) { value = value.replace(importantRE, '').trim() } this.el.style.setProperty(prop, value, isImportant) } else { this.el.style.removeProperty(prop) } } } /** * Normalize a CSS property name. * - cache result * - auto prefix * - camelCase -> dash-case * * @param {String} prop * @return {String} */ function normalize (prop) { if (propCache[prop]) { return propCache[prop] } var res = prefix(prop) propCache[prop] = propCache[res] = res return res } /** * Auto detect the appropriate prefix for a CSS property. * https://gist.github.com/paulirish/523692 * * @param {String} prop * @return {String} */ function prefix (prop) { prop = prop.replace(camelRE, '$1-$2').toLowerCase() var camel = _.camelize(prop) var upper = camel.charAt(0).toUpperCase() + camel.slice(1) if (!testEl) { testEl = document.createElement('div') } if (camel in testEl.style) { return prop } var i = prefixes.length var prefixed while (i--) { prefixed = camelPrefixes[i] + upper if (prefixed in testEl.style) { return prefixes[i] + prop } } } /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { // TODO: remove in 1.0.0 var _ = __webpack_require__(1) var Transition = __webpack_require__(42) module.exports = { priority: 1000, isLiteral: true, bind: function () { if (!this._isDynamicLiteral && !this.arg) { this.update(this.expression) } else if (this.arg) { this._isDynamicLiteral = true } }, update: function (id, oldId) { var el = this.el // resolve on owner vm var hooks = _.resolveAsset(this.vm.$options, 'transitions', id) id = id || 'v' // apply on closest vm el.__v_trans = new Transition(el, id, hooks, this.el.__vue__ || this.vm) if (oldId) { _.removeClass(el, oldId + '-transition') } _.addClass(el, id + '-transition') } } /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var queue = __webpack_require__(43) var addClass = _.addClass var removeClass = _.removeClass var transitionEndEvent = _.transitionEndEvent var animationEndEvent = _.animationEndEvent var transDurationProp = _.transitionProp + 'Duration' var animDurationProp = _.animationProp + 'Duration' var TYPE_TRANSITION = 1 var TYPE_ANIMATION = 2 /** * A Transition object that encapsulates the state and logic * of the transition. * * @param {Element} el * @param {String} id * @param {Object} hooks * @param {Vue} vm */ function Transition (el, id, hooks, vm) { this.id = id this.el = el this.enterClass = id + '-enter' this.leaveClass = id + '-leave' this.hooks = hooks this.vm = vm // async state this.pendingCssEvent = this.pendingCssCb = this.cancel = this.pendingJsCb = this.op = this.cb = null this.justEntered = false this.entered = this.left = false this.typeCache = {} // bind var self = this ;['enterNextTick', 'enterDone', 'leaveNextTick', 'leaveDone'] .forEach(function (m) { self[m] = _.bind(self[m], self) }) } var p = Transition.prototype /** * Start an entering transition. * * 1. enter transition triggered * 2. call beforeEnter hook * 3. add enter class * 4. insert/show element * 5. call enter hook (with possible explicit js callback) * 6. reflow * 7. based on transition type: * - transition: * remove class now, wait for transitionend, * then done if there's no explicit js callback. * - animation: * wait for animationend, remove class, * then done if there's no explicit js callback. * - no css transition: * done now if there's no explicit js callback. * 8. wait for either done or js callback, then call * afterEnter hook. * * @param {Function} op - insert/show the element * @param {Function} [cb] */ p.enter = function (op, cb) { this.cancelPending() this.callHook('beforeEnter') this.cb = cb addClass(this.el, this.enterClass) op() this.entered = false this.callHookWithCb('enter') if (this.entered) { return // user called done synchronously. } this.cancel = this.hooks && this.hooks.enterCancelled queue.push(this.enterNextTick) } /** * The "nextTick" phase of an entering transition, which is * to be pushed into a queue and executed after a reflow so * that removing the class can trigger a CSS transition. */ p.enterNextTick = function () { this.justEntered = true _.nextTick(function () { this.justEntered = false }, this) var enterDone = this.enterDone var type = this.getCssTransitionType(this.enterClass) if (!this.pendingJsCb) { if (type === TYPE_TRANSITION) { // trigger transition by removing enter class now removeClass(this.el, this.enterClass) this.setupCssCb(transitionEndEvent, enterDone) } else if (type === TYPE_ANIMATION) { this.setupCssCb(animationEndEvent, enterDone) } else { enterDone() } } else if (type === TYPE_TRANSITION) { removeClass(this.el, this.enterClass) } } /** * The "cleanup" phase of an entering transition. */ p.enterDone = function () { this.entered = true this.cancel = this.pendingJsCb = null removeClass(this.el, this.enterClass) this.callHook('afterEnter') if (this.cb) this.cb() } /** * Start a leaving transition. * * 1. leave transition triggered. * 2. call beforeLeave hook * 3. add leave class (trigger css transition) * 4. call leave hook (with possible explicit js callback) * 5. reflow if no explicit js callback is provided * 6. based on transition type: * - transition or animation: * wait for end event, remove class, then done if * there's no explicit js callback. * - no css transition: * done if there's no explicit js callback. * 7. wait for either done or js callback, then call * afterLeave hook. * * @param {Function} op - remove/hide the element * @param {Function} [cb] */ p.leave = function (op, cb) { this.cancelPending() this.callHook('beforeLeave') this.op = op this.cb = cb addClass(this.el, this.leaveClass) this.left = false this.callHookWithCb('leave') if (this.left) { return // user called done synchronously. } this.cancel = this.hooks && this.hooks.leaveCancelled // only need to handle leaveDone if // 1. the transition is already done (synchronously called // by the user, which causes this.op set to null) // 2. there's no explicit js callback if (this.op && !this.pendingJsCb) { // if a CSS transition leaves immediately after enter, // the transitionend event never fires. therefore we // detect such cases and end the leave immediately. if (this.justEntered) { this.leaveDone() } else { queue.push(this.leaveNextTick) } } } /** * The "nextTick" phase of a leaving transition. */ p.leaveNextTick = function () { var type = this.getCssTransitionType(this.leaveClass) if (type) { var event = type === TYPE_TRANSITION ? transitionEndEvent : animationEndEvent this.setupCssCb(event, this.leaveDone) } else { this.leaveDone() } } /** * The "cleanup" phase of a leaving transition. */ p.leaveDone = function () { this.left = true this.cancel = this.pendingJsCb = null this.op() removeClass(this.el, this.leaveClass) this.callHook('afterLeave') if (this.cb) this.cb() this.op = null } /** * Cancel any pending callbacks from a previously running * but not finished transition. */ p.cancelPending = function () { this.op = this.cb = null var hasPending = false if (this.pendingCssCb) { hasPending = true _.off(this.el, this.pendingCssEvent, this.pendingCssCb) this.pendingCssEvent = this.pendingCssCb = null } if (this.pendingJsCb) { hasPending = true this.pendingJsCb.cancel() this.pendingJsCb = null } if (hasPending) { removeClass(this.el, this.enterClass) removeClass(this.el, this.leaveClass) } if (this.cancel) { this.cancel.call(this.vm, this.el) this.cancel = null } } /** * Call a user-provided synchronous hook function. * * @param {String} type */ p.callHook = function (type) { if (this.hooks && this.hooks[type]) { this.hooks[type].call(this.vm, this.el) } } /** * Call a user-provided, potentially-async hook function. * We check for the length of arguments to see if the hook * expects a `done` callback. If true, the transition's end * will be determined by when the user calls that callback; * otherwise, the end is determined by the CSS transition or * animation. * * @param {String} type */ p.callHookWithCb = function (type) { var hook = this.hooks && this.hooks[type] if (hook) { if (hook.length > 1) { this.pendingJsCb = _.cancellable(this[type + 'Done']) } hook.call(this.vm, this.el, this.pendingJsCb) } } /** * Get an element's transition type based on the * calculated styles. * * @param {String} className * @return {Number} */ p.getCssTransitionType = function (className) { /* istanbul ignore if */ if ( !transitionEndEvent || // skip CSS transitions if page is not visible - // this solves the issue of transitionend events not // firing until the page is visible again. // pageVisibility API is supported in IE10+, same as // CSS transitions. document.hidden || // explicit js-only transition (this.hooks && this.hooks.css === false) || // element is hidden isHidden(this.el) ) { return } var type = this.typeCache[className] if (type) return type var inlineStyles = this.el.style var computedStyles = window.getComputedStyle(this.el) var transDuration = inlineStyles[transDurationProp] || computedStyles[transDurationProp] if (transDuration && transDuration !== '0s') { type = TYPE_TRANSITION } else { var animDuration = inlineStyles[animDurationProp] || computedStyles[animDurationProp] if (animDuration && animDuration !== '0s') { type = TYPE_ANIMATION } } if (type) { this.typeCache[className] = type } return type } /** * Setup a CSS transitionend/animationend callback. * * @param {String} event * @param {Function} cb */ p.setupCssCb = function (event, cb) { this.pendingCssEvent = event var self = this var el = this.el var onEnd = this.pendingCssCb = function (e) { if (e.target === el) { _.off(el, event, onEnd) self.pendingCssEvent = self.pendingCssCb = null if (!self.pendingJsCb && cb) { cb() } } } _.on(el, event, onEnd) } /** * Check if an element is hidden - in that case we can just * skip the transition alltogether. * * @param {Element} el * @return {Boolean} */ function isHidden (el) { return el.style.display === 'none' || el.style.visibility === 'hidden' || el.hidden } module.exports = Transition /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var queue = [] var queued = false /** * Push a job into the queue. * * @param {Function} job */ exports.push = function (job) { queue.push(job) if (!queued) { queued = true _.nextTick(flush) } } /** * Flush the queue, and do one forced reflow before * triggering transitions. */ function flush () { // Force layout var f = document.documentElement.offsetHeight for (var i = 0; i < queue.length; i++) { queue[i]() } queue = [] queued = false // dummy return, so js linters don't complain about // unused variable f return f } /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var keyFilter = __webpack_require__(45).key module.exports = { acceptStatement: true, priority: 700, bind: function () { // 1.0.0 key filter var rawArg = this.arg var keyIndex = rawArg.indexOf('.') if (keyIndex > -1) { this.arg = rawArg.slice(0, keyIndex) this.key = rawArg.slice(keyIndex + 1) } // warn old usage if (true) { if (this.filters) { var hasKeyFilter = this.filters.some(function (f) { return f.name === 'key' }) if (hasKeyFilter) { _.deprecation.KEY_FILTER() } } } // deal with iframes if ( this.el.tagName === 'IFRAME' && this.arg !== 'load' ) { var self = this this.iframeBind = function () { _.on(self.el.contentWindow, self.arg, self.handler) } this.on('load', this.iframeBind) } }, update: function (handler) { if (typeof handler !== 'function') { ("development") !== 'production' && _.warn( 'Directive v-on="' + this.arg + ': ' + this.expression + '" expects a function value, ' + 'got ' + handler ) return } if (this.key) { handler = keyFilter(handler, this.key) } this.reset() var scope = this._scope || this.vm this.handler = function (e) { scope.$event = e var res = handler(e) scope.$event = null return res } if (this.iframeBind) { this.iframeBind() } else { _.on(this.el, this.arg, this.handler) } }, reset: function () { var el = this.iframeBind ? this.el.contentWindow : this.el if (this.handler) { _.off(el, this.arg, this.handler) } }, unbind: function () { this.reset() } } /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * Stringify value. * * @param {Number} indent */ exports.json = { read: function (value, indent) { return typeof value === 'string' ? value : JSON.stringify(value, null, Number(indent) || 2) }, write: function (value) { try { return JSON.parse(value) } catch (e) { return value } } } /** * 'abc' => 'Abc' */ exports.capitalize = function (value) { if (!value && value !== 0) return '' value = value.toString() return value.charAt(0).toUpperCase() + value.slice(1) } /** * 'abc' => 'ABC' */ exports.uppercase = function (value) { return (value || value === 0) ? value.toString().toUpperCase() : '' } /** * 'AbC' => 'abc' */ exports.lowercase = function (value) { return (value || value === 0) ? value.toString().toLowerCase() : '' } /** * 12345 => $12,345.00 * * @param {String} sign */ var digitsRE = /(\d{3})(?=\d)/g exports.currency = function (value, currency) { value = parseFloat(value) if (!isFinite(value) || (!value && value !== 0)) return '' currency = currency != null ? currency : '$' var stringified = Math.abs(value).toFixed(2) var _int = stringified.slice(0, -3) var i = _int.length % 3 var head = i > 0 ? (_int.slice(0, i) + (_int.length > 3 ? ',' : '')) : '' var _float = stringified.slice(-3) var sign = value < 0 ? '-' : '' return currency + sign + head + _int.slice(i).replace(digitsRE, '$1,') + _float } /** * 'item' => 'items' * * @params * an array of strings corresponding to * the single, double, triple ... forms of the word to * be pluralized. When the number to be pluralized * exceeds the length of the args, it will use the last * entry in the array. * * e.g. ['single', 'double', 'triple', 'multiple'] */ exports.pluralize = function (value) { var args = _.toArray(arguments, 1) return args.length > 1 ? (args[value % 10 - 1] || args[args.length - 1]) : (args[0] + (value === 1 ? '' : 's')) } /** * A special filter that takes a handler function, * wraps it so it only gets triggered on specific * keypresses. v-on only. * * @param {String} key */ var keyCodes = { esc: 27, tab: 9, enter: 13, space: 32, 'delete': 46, up: 38, left: 37, right: 39, down: 40 } exports.key = function (handler, key) { if (!handler) return var code = keyCodes[key] if (!code) { code = parseInt(key, 10) } return function (e) { if (e.keyCode === code) { return handler.call(this, e) } } } // expose keycode hash exports.key.keyCodes = keyCodes exports.debounce = function (handler, delay) { if (!handler) return if (!delay) { delay = 300 } return _.debounce(handler, delay) } /** * Install special array filters */ _.extend(exports, __webpack_require__(46)) /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Path = __webpack_require__(22) /** * Filter filter for v-repeat * * @param {String} searchKey * @param {String} [delimiter] * @param {String} dataKey */ exports.filterBy = function (arr, search, delimiter /* ...dataKeys */) { if (search == null) { return arr } if (typeof search === 'function') { return arr.filter(search) } // cast to lowercase string search = ('' + search).toLowerCase() // allow optional `in` delimiter // because why not var n = delimiter === 'in' ? 3 : 2 // extract and flatten keys var keys = _.toArray(arguments, n).reduce(function (prev, cur) { return prev.concat(cur) }, []) return arr.filter(function (item) { return keys.length ? keys.some(function (key) { return contains(Path.get(item, key), search) }) : contains(item, search) }) } /** * Filter filter for v-repeat * * @param {String} sortKey * @param {String} reverse */ exports.orderBy = function (arr, sortKey, reverse) { if (!sortKey) { return arr } var order = 1 if (arguments.length > 2) { if (reverse === '-1') { order = -1 } else { order = reverse ? -1 : 1 } } // sort on a copy to avoid mutating original array return arr.slice().sort(function (a, b) { if (sortKey !== '$key') { if (_.isObject(a) && '$value' in a) a = a.$value if (_.isObject(b) && '$value' in b) b = b.$value } a = _.isObject(a) ? Path.get(a, sortKey) : a b = _.isObject(b) ? Path.get(b, sortKey) : b return a === b ? 0 : a > b ? order : -order }) } /** * String contain helper * * @param {*} val * @param {String} search */ function contains (val, search) { if (_.isPlainObject(val)) { for (var key in val) { if (contains(val[key], search)) { return true } } } else if (_.isArray(val)) { var i = val.length while (i--) { if (contains(val[i], search)) { return true } } } else if (val != null) { return val.toString().toLowerCase().indexOf(search) > -1 } } /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var handlers = { text: __webpack_require__(48), radio: __webpack_require__(49), select: __webpack_require__(50), checkbox: __webpack_require__(51) } module.exports = { priority: 800, twoWay: true, handlers: handlers, /** * Possible elements: * <select> * <textarea> * <input type="*"> * - text * - checkbox * - radio * - number * - TODO: more types may be supplied as a plugin */ bind: function () { // friendly warning... this.checkFilters() if (this.hasRead && !this.hasWrite) { ("development") !== 'production' && _.warn( 'It seems you are using a read-only filter with ' + 'v-model. You might want to use a two-way filter ' + 'to ensure correct behavior.' ) } var el = this.el var tag = el.tagName var handler if (tag === 'INPUT') { handler = handlers[el.type] || handlers.text } else if (tag === 'SELECT') { handler = handlers.select } else if (tag === 'TEXTAREA') { handler = handlers.text } else { ("development") !== 'production' && _.warn( 'v-model does not support element type: ' + tag ) return } el.__v_model = this handler.bind.call(this) this.update = handler.update this._unbind = handler.unbind }, /** * Check read/write filter stats. */ checkFilters: function () { var filters = this.filters if (!filters) return var i = filters.length while (i--) { var filter = _.resolveAsset(this.vm.$options, 'filters', filters[i].name) if (typeof filter === 'function' || filter.read) { this.hasRead = true } if (filter.write) { this.hasWrite = true } } }, unbind: function () { this.el.__v_model = null this._unbind && this._unbind() } } /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) module.exports = { bind: function () { var self = this var el = this.el var isRange = el.type === 'range' // check params // - lazy: update model on "change" instead of "input" var lazy = this.param('lazy') != null // - number: cast value into number when updating model. var number = this.param('number') != null // - debounce: debounce the input listener var debounce = parseInt(this.param('debounce'), 10) // handle composition events. // http://blog.evanyou.me/2014/01/03/composition-event/ // skip this for Android because it handles composition // events quite differently. Android doesn't trigger // composition events for language input methods e.g. // Chinese, but instead triggers them for spelling // suggestions... (see Discussion/#162) var composing = false if (!_.isAndroid && !isRange) { this.on('compositionstart', function () { composing = true }) this.on('compositionend', function () { composing = false // in IE11 the "compositionend" event fires AFTER // the "input" event, so the input handler is blocked // at the end... have to call it here. // // #1327: in lazy mode this is unecessary. if (!lazy) { self.listener() } }) } // prevent messing with the input when user is typing, // and force update on blur. this.focused = false if (!isRange) { this.on('focus', function () { self.focused = true }) this.on('blur', function () { self.focused = false self.listener() }) } // Now attach the main listener this.listener = function () { if (composing) return var val = number || isRange ? _.toNumber(el.value) : el.value self.set(val) // force update on next tick to avoid lock & same value // also only update when user is not typing _.nextTick(function () { if (self._bound && !self.focused) { self.update(self._watcher.value) } }) } if (debounce) { this.listener = _.debounce(this.listener, debounce) } // Support jQuery events, since jQuery.trigger() doesn't // trigger native events in some cases and some plugins // rely on $.trigger() // // We want to make sure if a listener is attached using // jQuery, it is also removed with jQuery, that's why // we do the check for each directive instance and // store that check result on itself. This also allows // easier test coverage control by unsetting the global // jQuery variable in tests. this.hasjQuery = typeof jQuery === 'function' if (this.hasjQuery) { jQuery(el).on('change', this.listener) if (!lazy) { jQuery(el).on('input', this.listener) } } else { this.on('change', this.listener) if (!lazy) { this.on('input', this.listener) } } // IE9 doesn't fire input event on backspace/del/cut if (!lazy && _.isIE9) { this.on('cut', function () { _.nextTick(self.listener) }) this.on('keyup', function (e) { if (e.keyCode === 46 || e.keyCode === 8) { self.listener() } }) } // set initial value if present if ( el.hasAttribute('value') || (el.tagName === 'TEXTAREA' && el.value.trim()) ) { this._initValue = number ? _.toNumber(el.value) : el.value } }, update: function (value) { this.el.value = _.toString(value) }, unbind: function () { var el = this.el if (this.hasjQuery) { jQuery(el).off('change', this.listener) jQuery(el).off('input', this.listener) } } } /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) module.exports = { bind: function () { var self = this var el = this.el var number = this.param('number') != null var expression = this.param('exp') var scope = this._scope || this.vm if (("development") !== 'production' && expression) { _.deprecation.MODEL_EXP(this.expression) } this.getValue = function () { // value overwrite via bind-value if (el.hasOwnProperty('_value')) { return el._value } var val = el.value if (number) { val = _.toNumber(val) } else if (expression !== null) { val = scope.$eval(expression) } return val } this.on('change', function () { self.set(self.getValue()) }) if (el.checked) { this._initValue = this.getValue() } }, update: function (value) { this.el.checked = _.looseEqual(value, this.getValue()) } } /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Watcher = __webpack_require__(20) var dirParser = __webpack_require__(9) module.exports = { bind: function () { var self = this var el = this.el // method to force update DOM using latest value. this.forceUpdate = function () { if (self._watcher) { self.update(self._watcher.get()) } } // check options param var optionsParam = this.param('options') if (optionsParam) { initOptions.call(this, optionsParam) if (true) { _.deprecation.SELECT_OPTIONS() } } this.number = this.param('number') != null this.multiple = el.hasAttribute('multiple') // attach listener this.on('change', function () { var value = getValue(el, self.multiple) value = self.number ? _.isArray(value) ? value.map(_.toNumber) : _.toNumber(value) : value self.set(value) }) // check initial value (inline selected attribute) checkInitialValue.call(this) // All major browsers except Firefox resets // selectedIndex with value -1 to 0 when the element // is appended to a new parent, therefore we have to // force a DOM update whenever that happens... this.vm.$on('hook:attached', this.forceUpdate) }, update: function (value) { var el = this.el el.selectedIndex = -1 if (value == null) { if (this.defaultOption) { this.defaultOption.selected = true } return } var multi = this.multiple && _.isArray(value) var options = el.options var i = options.length var op, val while (i--) { op = options[i] val = op.hasOwnProperty('_value') ? op._value : op.value /* eslint-disable eqeqeq */ op.selected = multi ? indexOf(value, val) > -1 : _.looseEqual(value, val) /* eslint-enable eqeqeq */ } }, unbind: function () { this.vm.$off('hook:attached', this.forceUpdate) if (this.optionWatcher) { this.optionWatcher.teardown() } } } /** * Initialize the option list from the param. * * @param {String} expression */ function initOptions (expression) { var self = this var el = self.el var defaultOption = self.defaultOption = self.el.options[0] var descriptor = dirParser.parse(expression)[0] function optionUpdateWatcher (value) { if (_.isArray(value)) { // clear old options. // cannot reset innerHTML here because IE family get // confused during compilation. var i = el.options.length while (i--) { var option = el.options[i] if (option !== defaultOption) { var parentNode = option.parentNode if (parentNode === el) { parentNode.removeChild(option) } else { el.removeChild(parentNode) i = el.options.length } } } buildOptions(el, value) self.forceUpdate() } else { ("development") !== 'production' && _.warn( 'Invalid options value for v-model: ' + value ) } } this.optionWatcher = new Watcher( this.vm, descriptor.expression, optionUpdateWatcher, { deep: true, filters: descriptor.filters } ) // update with initial value optionUpdateWatcher(this.optionWatcher.value) } /** * Build up option elements. IE9 doesn't create options * when setting innerHTML on <select> elements, so we have * to use DOM API here. * * @param {Element} parent - a <select> or an <optgroup> * @param {Array} options */ function buildOptions (parent, options) { var op, el for (var i = 0, l = options.length; i < l; i++) { op = options[i] if (!op.options) { el = document.createElement('option') if (typeof op === 'string' || typeof op === 'number') { el.text = el.value = op } else { if (op.value != null && !_.isObject(op.value)) { el.value = op.value } // object values gets serialized when set as value, // so we store the raw value as a different property el._value = op.value el.text = op.text || '' if (op.disabled) { el.disabled = true } } } else { el = document.createElement('optgroup') el.label = op.label buildOptions(el, op.options) } parent.appendChild(el) } } /** * Check the initial value for selected options. */ function checkInitialValue () { var initValue var options = this.el.options for (var i = 0, l = options.length; i < l; i++) { if (options[i].hasAttribute('selected')) { if (this.multiple) { (initValue || (initValue = [])) .push(options[i].value) } else { initValue = options[i].value } } } if (typeof initValue !== 'undefined') { this._initValue = this.number ? _.toNumber(initValue) : initValue } } /** * Get select value * * @param {SelectElement} el * @param {Boolean} multi * @return {Array|*} */ function getValue (el, multi) { var res = multi ? [] : null var op, val for (var i = 0, l = el.options.length; i < l; i++) { op = el.options[i] if (op.selected) { val = op.hasOwnProperty('_value') ? op._value : op.value if (multi) { res.push(val) } else { return val } } } return res } /** * Native Array.indexOf uses strict equal, but in this * case we need to match string/numbers with custom equal. * * @param {Array} arr * @param {*} val */ function indexOf (arr, val) { var i = arr.length while (i--) { if (_.looseEqual(arr[i], val)) { return i } } return -1 } /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) module.exports = { bind: function () { var self = this var el = this.el var trueExp = this.param('true-exp') var falseExp = this.param('false-exp') var scope = this._scope || this.vm if (("development") !== 'production' && (trueExp || falseExp)) { _.deprecation.MODEL_EXP(this.expression) } this._matchValue = function (value) { if (el.hasOwnProperty('_trueValue')) { return _.looseEqual(value, el._trueValue) } else if (trueExp !== null) { return _.looseEqual(value, scope.$eval(trueExp)) } else { return !!value } } function getValue () { var val = el.checked if (val && el.hasOwnProperty('_trueValue')) { return el._trueValue } if (!val && el.hasOwnProperty('_falseValue')) { return el._falseValue } if (val && trueExp !== null) { val = scope.$eval(trueExp) } if (!val && falseExp !== null) { val = scope.$eval(falseExp) } return val } this.on('change', function () { self.set(getValue()) }) if (el.checked) { this._initValue = getValue() } }, update: function (value) { this.el.checked = this._matchValue(value) } } /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var isObject = _.isObject var isPlainObject = _.isPlainObject var textParser = __webpack_require__(7) var expParser = __webpack_require__(21) var templateParser = __webpack_require__(25) var compiler = __webpack_require__(15) var uid = 0 // async component resolution states var UNRESOLVED = 0 var PENDING = 1 var RESOLVED = 2 var ABORTED = 3 module.exports = { /** * Setup. */ bind: function () { // some helpful tips... /* istanbul ignore if */ if ( ("development") !== 'production' && this.el.tagName === 'OPTION' && this.el.parentNode && this.el.parentNode.__v_model ) { _.warn( 'Don\'t use v-repeat for v-model options; ' + 'use the `options` param instead: ' + 'http://vuejs.org/guide/forms.html#Dynamic_Select_Options' ) } if (true) { _.deprecation.REPEAT() } // support for item in array syntax var inMatch = this.expression.match(/(.*) in (.*)/) if (inMatch) { this.arg = inMatch[1] this._watcherExp = inMatch[2] } // uid as a cache identifier this.id = '__v_repeat_' + (++uid) // setup anchor nodes this.start = _.createAnchor('v-repeat-start') this.end = _.createAnchor('v-repeat-end') _.replace(this.el, this.end) _.before(this.start, this.end) // check if this is a block repeat this.template = _.isTemplate(this.el) ? templateParser.parse(this.el, true) : this.el // check for trackby param this.idKey = this.param('track-by') // check for transition stagger var stagger = +this.param('stagger') this.enterStagger = +this.param('enter-stagger') || stagger this.leaveStagger = +this.param('leave-stagger') || stagger // check for v-ref/v-el this.refId = this.param(config.prefix + 'ref') this.elID = this.param(config.prefix + 'el') if (true) { if (this.refId) _.deprecation.V_REF() if (this.elID) _.deprecation.V_EL() } this.refId = this.refId || _.findRef(this.el) // check other directives that need to be handled // at v-repeat level this.checkIf() this.checkComponent() // create cache object this.cache = Object.create(null) }, /** * Warn against v-if usage. */ checkIf: function () { if (_.attr(this.el, 'if') !== null) { ("development") !== 'production' && _.warn( 'Don\'t use v-if with v-repeat. ' + 'Use v-show or the "filterBy" filter instead.' ) } }, /** * Check the component constructor to use for repeated * instances. If static we resolve it now, otherwise it * needs to be resolved at build time with actual data. */ checkComponent: function () { this.componentState = UNRESOLVED var options = this.vm.$options var id = _.checkComponent(this.el, options, this.el.hasAttributes()) if (!id) { // default constructor this.Component = _.Vue // inline repeats should inherit this.inline = true // important: transclude with no options, just // to ensure block start and block end this.template = compiler.transclude(this.template) var copy = _.extend({}, options) copy._asComponent = false this._linkFn = compiler.compile(this.template, copy) } else { this.Component = null this.asComponent = true // check inline-template if (this.param('inline-template') !== null) { // extract inline template as a DocumentFragment this.inlineTemplate = _.extractContent(this.el, true) } var tokens = textParser.parse(id) if (tokens) { // dynamic component to be resolved later var componentExp = textParser.tokensToExp(tokens) this.componentGetter = expParser.parse(componentExp).get } else { // static this.componentId = id this.pendingData = null } } }, resolveComponent: function () { this.componentState = PENDING this.vm._resolveComponent(this.componentId, _.bind(function (Component) { if (this.componentState === ABORTED) { return } this.Component = Component this.componentState = RESOLVED this.realUpdate(this.pendingData) this.pendingData = null }, this)) }, /** * Resolve a dynamic component to use for an instance. * The tricky part here is that there could be dynamic * components depending on instance data. * * @param {Object} data * @param {Object} meta * @return {Function} */ resolveDynamicComponent: function (data, meta) { // create a temporary context object and copy data // and meta properties onto it. // use _.define to avoid accidentally overwriting scope // properties. var context = Object.create(this.vm) var key for (key in data) { _.define(context, key, data[key]) } for (key in meta) { _.define(context, key, meta[key]) } var id = this.componentGetter.call(context, context) var Component = _.resolveAsset(this.vm.$options, 'components', id) if (true) { _.assertAsset(Component, 'component', id) } if (!Component.options) { ("development") !== 'production' && _.warn( 'Async resolution is not supported for v-repeat ' + '+ dynamic component. (component: ' + id + ')' ) return _.Vue } return Component }, /** * Update. * This is called whenever the Array mutates. If we have * a component, we might need to wait for it to resolve * asynchronously. * * @param {Array|Number|String} data */ update: function (data) { if (("development") !== 'production' && !_.isArray(data)) { _.warn( 'v-repeat pre-converts Objects into Arrays, and ' + 'v-repeat filters should always return Arrays.' ) } if (this.componentId) { var state = this.componentState if (state === UNRESOLVED) { this.pendingData = data // once resolved, it will call realUpdate this.resolveComponent() } else if (state === PENDING) { this.pendingData = data } else if (state === RESOLVED) { this.realUpdate(data) } } else { this.realUpdate(data) } }, /** * The real update that actually modifies the DOM. * * @param {Array|Number|String} data */ realUpdate: function (data) { this.vms = this.diff(data, this.vms) // update v-ref if (this.refId) { this.vm.$[this.refId] = this.converted ? toRefObject(this.vms) : this.vms } if (this.elID) { this.vm.$$[this.elID] = this.vms.map(function (vm) { return vm.$el }) } }, /** * Diff, based on new data and old data, determine the * minimum amount of DOM manipulations needed to make the * DOM reflect the new data Array. * * The algorithm diffs the new data Array by storing a * hidden reference to an owner vm instance on previously * seen data. This allows us to achieve O(n) which is * better than a levenshtein distance based algorithm, * which is O(m * n). * * @param {Array} data * @param {Array} oldVms * @return {Array} */ diff: function (data, oldVms) { var idKey = this.idKey var converted = this.converted var start = this.start var end = this.end var inDoc = _.inDoc(start) var alias = this.arg var init = !oldVms var vms = new Array(data.length) var obj, raw, vm, i, l, primitive // First pass, go through the new Array and fill up // the new vms array. If a piece of data has a cached // instance for it, we reuse it. Otherwise build a new // instance. for (i = 0, l = data.length; i < l; i++) { obj = data[i] raw = converted ? obj.$value : obj primitive = !isObject(raw) vm = !init && this.getVm(raw, i, converted ? obj.$key : null) if (vm) { // reusable instance if (("development") !== 'production' && vm._reused) { _.warn( 'Duplicate objects found in v-repeat="' + this.expression + '": ' + JSON.stringify(raw) ) } vm._reused = true vm.$index = i // update $index // update data for track-by or object repeat, // since in these two cases the data is replaced // rather than mutated. if (idKey || converted || primitive) { if (alias) { vm[alias] = raw } else if (_.isPlainObject(raw)) { vm.$data = raw } else { vm.$value = raw } } } else { // new instance vm = this.build(obj, i, true) vm._reused = false } vms[i] = vm // insert if this is first run if (init) { vm.$before(end) } } // if this is the first run, we're done. if (init) { return vms } // Second pass, go through the old vm instances and // destroy those who are not reused (and remove them // from cache) var removalIndex = 0 var totalRemoved = oldVms.length - vms.length for (i = 0, l = oldVms.length; i < l; i++) { vm = oldVms[i] if (!vm._reused) { this.uncacheVm(vm) vm.$destroy(false, true) // defer cleanup until removal this.remove(vm, removalIndex++, totalRemoved, inDoc) } } // final pass, move/insert new instances into the // right place. var targetPrev, prevEl, currentPrev var insertionIndex = 0 for (i = 0, l = vms.length; i < l; i++) { vm = vms[i] // this is the vm that we should be after targetPrev = vms[i - 1] prevEl = targetPrev ? targetPrev._staggerCb ? targetPrev._staggerAnchor : targetPrev._fragmentEnd || targetPrev.$el : start if (vm._reused && !vm._staggerCb) { currentPrev = findPrevVm(vm, start, this.id) if (currentPrev !== targetPrev) { this.move(vm, prevEl) } } else { // new instance, or still in stagger. // insert with updated stagger index. this.insert(vm, insertionIndex++, prevEl, inDoc) } vm._reused = false } return vms }, /** * Build a new instance and cache it. * * @param {Object} data * @param {Number} index * @param {Boolean} needCache */ build: function (data, index, needCache) { var meta = { $index: index } if (this.converted) { meta.$key = data.$key } var raw = this.converted ? data.$value : data var alias = this.arg if (alias) { data = {} data[alias] = raw } else if (!isPlainObject(raw)) { // non-object values data = {} meta.$value = raw } else { // default data = raw } // resolve constructor var Component = this.Component || this.resolveDynamicComponent(data, meta) var parent = this._host || this.vm var vm = parent.$addChild({ el: templateParser.clone(this.template), data: data, inherit: this.inline, template: this.inlineTemplate, // repeater meta, e.g. $index, $key _meta: meta, // mark this as an inline-repeat instance _repeat: this.inline, // is this a component? _asComponent: this.asComponent, // linker cachable if no inline-template _linkerCachable: !this.inlineTemplate && Component !== _.Vue, // pre-compiled linker for simple repeats _linkFn: this._linkFn, // identifier, shows that this vm belongs to this collection _repeatId: this.id, // transclusion content owner _context: this.vm, // cotnext fragment _frag: this._frag }, Component) // cache instance if (needCache) { this.cacheVm(raw, vm, index, this.converted ? meta.$key : null) } // sync back changes for two-way bindings of primitive values var dir = this if (this.rawType === 'object' && isPrimitive(raw)) { vm.$watch(alias || '$value', function (val) { if (dir.filters) { ("development") !== 'production' && _.warn( 'You seem to be mutating the $value reference of ' + 'a v-repeat instance (likely through v-model) ' + 'and filtering the v-repeat at the same time. ' + 'This will not work properly with an Array of ' + 'primitive values. Please use an Array of ' + 'Objects instead.' ) } dir._withLock(function () { if (dir.converted) { dir.rawValue[vm.$key] = val } else { dir.rawValue.$set(vm.$index, val) } }) }) } return vm }, /** * Unbind, teardown everything */ unbind: function () { this.componentState = ABORTED if (this.refId) { this.vm.$[this.refId] = null } if (this.vms) { var i = this.vms.length var vm while (i--) { vm = this.vms[i] this.uncacheVm(vm) vm.$destroy() } } }, /** * Cache a vm instance based on its data. * * If the data is an object, we save the vm's reference on * the data object as a hidden property. Otherwise we * cache them in an object and for each primitive value * there is an array in case there are duplicates. * * @param {Object} data * @param {Vue} vm * @param {Number} index * @param {String} [key] */ cacheVm: function (data, vm, index, key) { var idKey = this.idKey var cache = this.cache var primitive = !isObject(data) var id if (key || idKey || primitive) { id = idKey ? idKey === '$index' ? index : data[idKey] : (key || index) if (!cache[id]) { cache[id] = vm } else if (!primitive && idKey !== '$index') { ("development") !== 'production' && _.warn( 'Duplicate objects with the same track-by key in v-repeat: ' + id ) } } else { id = this.id if (data.hasOwnProperty(id)) { if (data[id] === null) { data[id] = vm } else { ("development") !== 'production' && _.warn( 'Duplicate objects found in v-repeat="' + this.expression + '": ' + JSON.stringify(data) ) } } else { _.define(data, id, vm) } } vm._raw = data }, /** * Try to get a cached instance from a piece of data. * * @param {Object} data * @param {Number} index * @param {String} [key] * @return {Vue|undefined} */ getVm: function (data, index, key) { var idKey = this.idKey var primitive = !isObject(data) if (key || idKey || primitive) { var id = idKey ? idKey === '$index' ? index : data[idKey] : (key || index) return this.cache[id] } else { return data[this.id] } }, /** * Delete a cached vm instance. * * @param {Vue} vm */ uncacheVm: function (vm) { var data = vm._raw var idKey = this.idKey var index = vm.$index // fix #948: avoid accidentally fall through to // a parent repeater which happens to have $key. var key = vm.hasOwnProperty('$key') && vm.$key var primitive = !isObject(data) if (idKey || key || primitive) { var id = idKey ? idKey === '$index' ? index : data[idKey] : (key || index) this.cache[id] = null } else { data[this.id] = null vm._raw = null } }, /** * Insert an instance. * * @param {Vue} vm * @param {Number} index * @param {Node} prevEl * @param {Boolean} inDoc */ insert: function (vm, index, prevEl, inDoc) { if (vm._staggerCb) { vm._staggerCb.cancel() vm._staggerCb = null } var staggerAmount = this.getStagger(vm, index, null, 'enter') if (inDoc && staggerAmount) { // create an anchor and insert it synchronously, // so that we can resolve the correct order without // worrying about some elements not inserted yet var anchor = vm._staggerAnchor if (!anchor) { anchor = vm._staggerAnchor = _.createAnchor('stagger-anchor') anchor.__vue__ = vm } _.after(anchor, prevEl) var op = vm._staggerCb = _.cancellable(function () { vm._staggerCb = null vm.$before(anchor) _.remove(anchor) }) setTimeout(op, staggerAmount) } else { vm.$after(prevEl) } }, /** * Move an already inserted instance. * * @param {Vue} vm * @param {Node} prevEl */ move: function (vm, prevEl) { vm.$after(prevEl, null, false) }, /** * Remove an instance. * * @param {Vue} vm * @param {Number} index * @param {Boolean} inDoc */ remove: function (vm, index, total, inDoc) { if (vm._staggerCb) { vm._staggerCb.cancel() vm._staggerCb = null // it's not possible for the same vm to be removed // twice, so if we have a pending stagger callback, // it means this vm is queued for enter but removed // before its transition started. Since it is already // destroyed, we can just leave it in detached state. return } var staggerAmount = this.getStagger(vm, index, total, 'leave') if (inDoc && staggerAmount) { var op = vm._staggerCb = _.cancellable(function () { vm._staggerCb = null remove() }) setTimeout(op, staggerAmount) } else { remove() } function remove () { vm.$remove(function () { vm._cleanup() }) } }, /** * Get the stagger amount for an insertion/removal. * * @param {Vue} vm * @param {Number} index * @param {String} type * @param {Number} total */ getStagger: function (vm, index, total, type) { type = type + 'Stagger' var trans = vm.$el.__v_trans var hooks = trans && trans.hooks var hook = hooks && (hooks[type] || hooks.stagger) return hook ? hook.call(vm, index, total) : index * this[type] }, /** * Pre-process the value before piping it through the * filters, and convert non-Array objects to arrays. * * This function will be bound to this directive instance * and passed into the watcher. * * @param {*} value * @return {Array} * @private */ _preProcess: function (value) { // regardless of type, store the un-filtered raw value. this.rawValue = value var type = this.rawType = typeof value if (!isPlainObject(value)) { this.converted = false if (type === 'number') { value = range(value) } else if (type === 'string') { value = _.toArray(value) } return value || [] } else { // convert plain object to array. var keys = Object.keys(value) var i = keys.length var res = new Array(i) var key while (i--) { key = keys[i] res[i] = { $key: key, $value: value[key] } } this.converted = true return res } } } /** * Helper to find the previous element that is an instance * root node. This is necessary because a destroyed vm's * element could still be lingering in the DOM before its * leaving transition finishes, but its __vue__ reference * should have been removed so we can skip them. * * If this is a block repeat, we want to make sure we only * return vm that is bound to this v-repeat. (see #929) * * @param {Vue} vm * @param {Comment|Text} anchor * @return {Vue} */ function findPrevVm (vm, anchor, id) { var el = vm.$el.previousSibling /* istanbul ignore if */ if (!el) return while ( (!el.__vue__ || el.__vue__.$options._repeatId !== id) && el !== anchor ) { el = el.previousSibling } return el.__vue__ } /** * Create a range array from given number. * * @param {Number} n * @return {Array} */ function range (n) { var i = -1 var ret = new Array(n) while (++i < n) { ret[i] = i } return ret } /** * Convert a vms array to an object ref for v-ref on an * Object value. * * @param {Array} vms * @return {Object} */ function toRefObject (vms) { var ref = {} for (var i = 0, l = vms.length; i < l; i++) { ref[vms[i].$key] = vms[i] } return ref } /** * Check if a value is a primitive one: * String, Number, Boolean, null or undefined. * * @param {*} value * @return {Boolean} */ function isPrimitive (value) { var type = typeof value return value == null || type === 'string' || type === 'number' || type === 'boolean' } /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var FragmentFactory = __webpack_require__(28) var isObject = _.isObject var uid = 0 module.exports = { priority: 2000, bind: function () { // determine alias this.alias = this.arg // support "item in items" syntax var inMatch = this.expression.match(/(.*) in (.*)/) if (inMatch) { this.alias = inMatch[1] this._watcherExp = inMatch[2] } if (!this.alias) { ("development") !== 'production' && _.warn( 'Alias is required in v-for.' ) return } // uid as a cache identifier this.id = '__v-for__' + (++uid) // check if this is an option list, // so that we know if we need to update the <select>'s // v-model when the option list has changed. // because v-model has a lower priority than v-for, // the v-model is not bound here yet, so we have to // retrive it in the actual updateModel() function. var tag = this.el.tagName this.isOption = (tag === 'OPTION' || tag === 'OPTGROUP') && this.el.parentNode.tagName === 'SELECT' // setup anchor nodes this.start = _.createAnchor('v-for-start') this.end = _.createAnchor('v-for-end') _.replace(this.el, this.end) _.before(this.start, this.end) // check for trackby param this.idKey = this.param('track-by') // TODO: only check ref in 1.0.0 // check v-ref var ref = this.param(config.prefix + 'ref') /* istanbul ignore if */ if (("development") !== 'production' && ref) { _.deprecation.V_REF() } this.ref = ref || _.findRef(this.el) // check for transition stagger var stagger = +this.param('stagger') this.enterStagger = +this.param('enter-stagger') || stagger this.leaveStagger = +this.param('leave-stagger') || stagger // cache this.cache = Object.create(null) // fragment factory this.factory = new FragmentFactory(this.vm, this.el) }, update: function (data) { if (("development") !== 'production' && !_.isArray(data)) { _.warn( 'v-for pre-converts Objects into Arrays, and ' + 'v-for filters should always return Arrays.' ) } this.diff(data) this.updateRef() this.updateModel() }, /** * Diff, based on new data and old data, determine the * minimum amount of DOM manipulations needed to make the * DOM reflect the new data Array. * * The algorithm diffs the new data Array by storing a * hidden reference to an owner vm instance on previously * seen data. This allows us to achieve O(n) which is * better than a levenshtein distance based algorithm, * which is O(m * n). * * @param {Array} data */ diff: function (data) { var idKey = this.idKey var converted = this.converted var oldFrags = this.frags var frags = this.frags = new Array(data.length) var alias = this.alias var start = this.start var end = this.end var inDoc = _.inDoc(start) var init = !oldFrags var i, l, frag, item, key, value, primitive // First pass, go through the new Array and fill up // the new frags array. If a piece of data has a cached // instance for it, we reuse it. Otherwise build a new // instance. for (i = 0, l = data.length; i < l; i++) { item = data[i] key = converted ? item.$key : null value = converted ? item.$value : item primitive = !isObject(value) frag = !init && this.getCachedFrag(value, i, key) if (frag) { // reusable fragment if (("development") !== 'production' && frag.reused) { _.warn( 'Duplicate objects found in v-for="' + this.expression + '": ' + JSON.stringify(value) ) } frag.reused = true // update $index frag.scope.$index = i // update $key if (key) { frag.scope.$key = key } // update data for track-by, object repeat & // primitive values. if (idKey || converted || primitive) { frag.scope[alias] = value } } else { // new isntance frag = this.create(value, alias, i, key) } frags[i] = frag if (init) { frag.before(end) } } // we're done for the initial render. if (init) { return } // Second pass, go through the old fragments and // destroy those who are not reused (and remove them // from cache) var removalIndex = 0 var totalRemoved = oldFrags.length - frags.length for (i = 0, l = oldFrags.length; i < l; i++) { frag = oldFrags[i] if (!frag.reused) { this.deleteCachedFrag(frag) frag.destroy() this.remove(frag, removalIndex++, totalRemoved, inDoc) } } // Final pass, move/insert new fragments into the // right place. var targetPrev, prevEl, currentPrev var insertionIndex = 0 for (i = 0, l = frags.length; i < l; i++) { frag = frags[i] // this is the frag that we should be after targetPrev = frags[i - 1] prevEl = targetPrev ? targetPrev.staggerCb ? targetPrev.staggerAnchor : targetPrev.end || targetPrev.node : start if (frag.reused && !frag.staggerCb) { currentPrev = findPrevFrag(frag, start, this.id) if (currentPrev !== targetPrev) { this.move(frag, prevEl) } } else { // new instance, or still in stagger. // insert with updated stagger index. this.insert(frag, insertionIndex++, prevEl, inDoc) } frag.reused = false } }, /** * Create a new fragment instance. * * @param {*} value * @param {String} alias * @param {Number} index * @param {String} [key] * @return {Fragment} */ create: function (value, alias, index, key) { var host = this._host // create iteration scope var parentScope = this._scope || this.vm var scope = Object.create(parentScope) // ref holder for the scope scope.$ = {} // make sure point $parent to parent scope scope.$parent = parentScope // for two-way binding on alias scope.$forContext = this // define scope properties _.defineReactive(scope, alias, value) _.defineReactive(scope, '$index', index) if (key) { _.defineReactive(scope, '$key', key) } else if (scope.$key) { // avoid accidental fallback _.define(scope, '$key', null) } var frag = this.factory.create(host, scope, this._frag) frag.forId = this.id this.cacheFrag(value, frag, index, key) return frag }, /** * Update the v-ref on owner vm. */ updateRef: function () { var ref = this.ref if (!ref) return var hash = (this._scope || this.vm).$ var refs if (!this.converted) { refs = this.frags.map(findVmFromFrag) } else { refs = {} this.frags.forEach(function (frag) { refs[frag.scope.$key] = findVmFromFrag(frag) }) } if (!hash.hasOwnProperty(ref)) { _.defineReactive(hash, ref, refs) } else { hash[ref] = refs } }, /** * For option lists, update the containing v-model on * parent <select>. */ updateModel: function () { if (this.isOption) { var parent = this.start.parentNode var model = parent && parent.__v_model if (model) { model.forceUpdate() } } }, /** * Insert a fragment. Handles staggering. * * @param {Fragment} frag * @param {Number} index * @param {Node} prevEl * @param {Boolean} inDoc */ insert: function (frag, index, prevEl, inDoc) { if (frag.staggerCb) { frag.staggerCb.cancel() frag.staggerCb = null } var staggerAmount = this.getStagger(frag, index, null, 'enter') if (inDoc && staggerAmount) { // create an anchor and insert it synchronously, // so that we can resolve the correct order without // worrying about some elements not inserted yet var anchor = frag.staggerAnchor if (!anchor) { anchor = frag.staggerAnchor = _.createAnchor('stagger-anchor') anchor.__vfrag__ = frag } _.after(anchor, prevEl) var op = frag.staggerCb = _.cancellable(function () { frag.staggerCb = null frag.before(anchor) _.remove(anchor) }) setTimeout(op, staggerAmount) } else { frag.before(prevEl.nextSibling) } }, /** * Remove a fragment. Handles staggering. * * @param {Fragment} frag * @param {Number} index * @param {Number} total * @param {Boolean} inDoc */ remove: function (frag, index, total, inDoc) { if (frag.staggerCb) { frag.staggerCb.cancel() frag.staggerCb = null // it's not possible for the same frag to be removed // twice, so if we have a pending stagger callback, // it means this frag is queued for enter but removed // before its transition started. Since it is already // destroyed, we can just leave it in detached state. return } var staggerAmount = this.getStagger(frag, index, total, 'leave') if (inDoc && staggerAmount) { var op = frag.staggerCb = _.cancellable(function () { frag.staggerCb = null frag.remove() }) setTimeout(op, staggerAmount) } else { frag.remove() } }, /** * Move a fragment to a new position. * Force no transition. * * @param {Fragment} frag * @param {Node} prevEl */ move: function (frag, prevEl) { frag.before(prevEl.nextSibling, false) }, /** * Cache a fragment using track-by or the object key. * * @param {*} value * @param {Fragment} frag * @param {Number} index * @param {String} [key] */ cacheFrag: function (value, frag, index, key) { var idKey = this.idKey var cache = this.cache var primitive = !isObject(value) var id if (key || idKey || primitive) { id = idKey ? idKey === '$index' ? index : value[idKey] : (key || index) if (!cache[id]) { cache[id] = frag } else if (!primitive && idKey !== '$index') { ("development") !== 'production' && _.warn( 'Duplicate objects with the same track-by key in v-for: ' + id ) } } else { id = this.id if (value.hasOwnProperty(id)) { if (value[id] === null) { value[id] = frag } else { ("development") !== 'production' && _.warn( 'Duplicate objects found in v-for="' + this.expression + '": ' + JSON.stringify(value) ) } } else { _.define(value, id, frag) } } frag.raw = value }, /** * Get a cached fragment from the value/index/key * * @param {*} value * @param {Number} index * @param {String} key * @return {Fragment} */ getCachedFrag: function (value, index, key) { var idKey = this.idKey var primitive = !isObject(value) if (key || idKey || primitive) { var id = idKey ? idKey === '$index' ? index : value[idKey] : (key || index) return this.cache[id] } else { return value[this.id] } }, /** * Delete a fragment from cache. * * @param {Fragment} frag */ deleteCachedFrag: function (frag) { var value = frag.raw var idKey = this.idKey var scope = frag.scope var index = scope.$index // fix #948: avoid accidentally fall through to // a parent repeater which happens to have $key. var key = scope.hasOwnProperty('$key') && scope.$key var primitive = !isObject(value) if (idKey || key || primitive) { var id = idKey ? idKey === '$index' ? index : value[idKey] : (key || index) this.cache[id] = null } else { value[this.id] = null frag.raw = null } }, /** * Get the stagger amount for an insertion/removal. * * @param {Fragment} frag * @param {Number} index * @param {Number} total * @param {String} type */ getStagger: function (frag, index, total, type) { type = type + 'Stagger' var trans = frag.node.__v_trans var hooks = trans && trans.hooks var hook = hooks && (hooks[type] || hooks.stagger) return hook ? hook.call(frag, index, total) : index * this[type] }, /** * Pre-process the value before piping it through the * filters, and convert non-Array objects to arrays. * * This function will be bound to this directive instance * and passed into the watcher. * * @param {*} value * @return {Array} * @private */ _preProcess: function (value) { // regardless of type, store the un-filtered raw value. this.rawValue = value var type = this.rawType = typeof value if (!_.isPlainObject(value)) { this.converted = false if (type === 'number') { value = range(value) } else if (type === 'string') { value = _.toArray(value) } return value || [] } else { // convert plain object to array. var keys = Object.keys(value) var i = keys.length var res = new Array(i) var key while (i--) { key = keys[i] res[i] = { $key: key, $value: value[key] } } this.converted = true return res } }, unbind: function () { if (this.ref) { (this._scope || this.vm).$[this.ref] = null } if (this.frags) { var i = this.frags.length var frag while (i--) { frag = this.frags[i] this.deleteCachedFrag(frag) frag.destroy() } } } } /** * Helper to find the previous element that is a fragment * anchor. This is necessary because a destroyed frag's * element could still be lingering in the DOM before its * leaving transition finishes, but its inserted flag * should have been set to false so we can skip them. * * If this is a block repeat, we want to make sure we only * return frag that is bound to this v-for. (see #929) * * @param {Fragment} frag * @param {Comment|Text} anchor * @param {String} id * @return {Fragment} */ function findPrevFrag (frag, anchor, id) { var el = frag.node.previousSibling /* istanbul ignore if */ if (!el) return frag = el.__vfrag__ while ( (!frag || frag.forId !== id || !frag.inserted) && el !== anchor ) { el = el.previousSibling /* istanbul ignore if */ if (!el) return frag = el.__vfrag__ } return frag } /** * Find a vm from a fragment. * * @param {Fragment} frag * @return {Vue|undefined} */ function findVmFromFrag (frag) { return frag.node.__vue__ || frag.node.nextSibling.__vue__ } /** * Create a range array from given number. * * @param {Number} n * @return {Array} */ function range (n) { var i = -1 var ret = new Array(n) while (++i < n) { ret[i] = i } return ret } /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var FragmentFactory = __webpack_require__(28) module.exports = { priority: 2000, bind: function () { var el = this.el if (!el.__vue__) { // check else block var next = el.nextElementSibling if (next && _.attr(next, 'else') !== null) { _.remove(next) this.elseFactory = new FragmentFactory(this.vm, next) } // check main block this.anchor = _.createAnchor('v-if') _.replace(el, this.anchor) this.factory = new FragmentFactory(this.vm, el) } else { ("development") !== 'production' && _.warn( 'v-if="' + this.expression + '" cannot be ' + 'used on an instance root element.' ) this.invalid = true } }, update: function (value) { if (this.invalid) return if (value) { if (!this.frag) { this.insert() } } else { this.remove() } }, insert: function () { if (this.elseFrag) { this.elseFrag.remove() this.elseFrag.destroy() this.elseFrag = null } this.frag = this.factory.create(this._host, this._scope, this._frag) this.frag.before(this.anchor) }, remove: function () { if (this.frag) { this.frag.remove() this.frag.destroy() this.frag = null } if (this.elseFactory) { this.elseFrag = this.elseFactory.create(this._host, this._scope, this._frag) this.elseFrag.before(this.anchor) } }, unbind: function () { if (this.frag) { this.frag.destroy() } } } /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { exports.slot = exports.content = __webpack_require__(56) exports.partial = __webpack_require__(57) /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var templateParser = __webpack_require__(25) // This is the elementDirective that handles <content> // transclusions. It relies on the raw content of an // instance being stored as `$options._content` during // the transclude phase. module.exports = { priority: 1750, bind: function () { this.isSlot = this.el.tagName === 'SLOT' if (("development") !== 'production' && !this.isSlot) { _.deprecation.CONTENT() } var vm = this.vm var host = vm // we need find the content context, which is the // closest non-inline-repeater instance. while (host.$options._repeat) { host = host.$parent } var raw = host.$options._content var content if (!raw) { this.fallback() return } var context = host._context var selector = this.isSlot ? this.param('name') : this.param('select') if (!selector) { // Default content var self = this var compileDefaultContent = function () { self.compile( extractFragment(raw.childNodes, raw, true), context, vm ) } if (!host._isCompiled) { // defer until the end of instance compilation, // because the default outlet must wait until all // other possible outlets with selectors have picked // out their contents. host.$once('hook:compiled', compileDefaultContent) } else { compileDefaultContent() } } else { // select content if (this.isSlot) { selector = '[slot="' + selector + '"]' } var nodes = raw.querySelectorAll(selector) if (nodes.length) { content = extractFragment(nodes, raw) if (content.hasChildNodes()) { this.compile(content, context, vm) } else { this.fallback() } } else { this.fallback() } } }, fallback: function () { this.compile(_.extractContent(this.el, true), this.vm) }, compile: function (content, context, host) { if (content && context) { var scope = host ? host._scope : this._scope this.unlink = context.$compile( content, host, scope, this._frag ) } if (content) { _.replace(this.el, content) } else { _.remove(this.el) } }, unbind: function () { if (this.unlink) { this.unlink() } } } /** * Extract qualified content nodes from a node list. * * @param {NodeList} nodes * @param {Element} parent * @param {Boolean} main * @return {DocumentFragment} */ function extractFragment (nodes, parent, main) { var frag = document.createDocumentFragment() for (var i = 0, l = nodes.length; i < l; i++) { var node = nodes[i] // if this is the main outlet, we want to skip all // previously selected nodes; // otherwise, we want to mark the node as selected. // clone the node so the original raw content remains // intact. this ensures proper re-compilation in cases // where the outlet is inside a conditional block if (main && !node.__v_selected) { append(node) } else if (!main && node.parentNode === parent) { node.__v_selected = true append(node) } } return frag function append (node) { if (_.isTemplate(node) && !hasDirecitve(node, 'if') && !hasDirecitve(node, 'for') && !hasDirecitve(node, 'repeat')) { node = templateParser.parse(node) } node = templateParser.clone(node) frag.appendChild(node) } } /** * Check if there is a flow control directive on a template * element that is a slot. * * @param {Node} node * @param {String} dir */ function hasDirecitve (node, dir) { return node.hasAttribute(config.prefix + dir) } /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var textParser = __webpack_require__(7) var FragmentFactory = __webpack_require__(28) var vIf = __webpack_require__(54) module.exports = { priority: 1750, bind: function () { var el = this.el this.anchor = _.createAnchor('v-partial') _.replace(el, this.anchor) var id = el.getAttribute('name') if (id != null) { var tokens = textParser.parse(id) if (tokens) { // dynamic partial this.setupDynamic(textParser.tokensToExp(tokens)) if (true) { _.deprecation.PARTIAL_NAME(id) } } else { // static partial this.insert(id) } } else { id = el.getAttribute('bind-name') || el.getAttribute(':name') if (id) { this.setupDynamic(id) } } }, setupDynamic: function (exp) { var self = this this.unwatch = this.vm.$watch(exp, function (value) { vIf.remove.call(self) self.insert(value) }, { immediate: true, user: false, scope: this._scope }) }, insert: function (id) { var partial = _.resolveAsset(this.vm.$options, 'partials', id) if (true) { _.assertAsset(partial, 'partial', id) } if (partial) { this.factory = new FragmentFactory(this.vm, partial) vIf.insert.call(this) } }, unbind: function () { if (this.frag) this.frag.destroy() if (this.unwatch) this.unwatch() } } /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { var mergeOptions = __webpack_require__(1).mergeOptions /** * The main init sequence. This is called for every * instance, including ones that are created from extended * constructors. * * @param {Object} options - this options object should be * the result of merging class * options and the options passed * in to the constructor. */ exports._init = function (options) { options = options || {} this.$el = null this.$parent = options._parent this.$root = options._root || this this.$children = [] this.$ = {} // child vm references this.$$ = {} // element references this._watchers = [] // all watchers as an array this._directives = [] // all directives this._childCtors = {} // inherit:true constructors // a flag to avoid this being observed this._isVue = true // events bookkeeping this._events = {} // registered callbacks this._eventsCount = {} // for $broadcast optimization this._shouldPropagate = false // for event propagation // fragment instance properties this._isFragment = false this._fragmentStart = // @type {CommentNode} this._fragmentEnd = null // @type {CommentNode} // lifecycle state this._isCompiled = this._isDestroyed = this._isReady = this._isAttached = this._isBeingDestroyed = false this._unlinkFn = null // context: // if this is a transcluded component, context // will be the common parent vm of this instance // and its host. this._context = options._context || options._parent // scope: // if this is inside an inline v-repeat, the scope // will be the intermediate scope created for this // repeat fragment. this is used for linking props // and container directives. this._scope = options._scope // set ref if (options._ref) { (this._scope || this._context).$[options._ref] = this } // fragment: // if this instance is compiled inside a Fragment, it // needs to reigster itself as a child of that fragment // for attach/detach to work properly. this._frag = options._frag if (this._frag) { this._frag.children.push(this) } // push self into parent / transclusion host if (this.$parent) { this.$parent.$children.push(this) } // props used in v-repeat diffing this._reused = false this._staggerOp = null // merge options. options = this.$options = mergeOptions( this.constructor.options, options, this ) // initialize data as empty object. // it will be filled up in _initScope(). this._data = {} // initialize data observation and scope inheritance. this._initState() // setup event system and option events. this._initEvents() // call created hook this._callHook('created') // if `el` option is passed, start compilation. if (options.el) { this.$mount(options.el) } } /***/ }, /* 59 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var inDoc = _.inDoc var eventRE = /^v-on:|^@/ /** * Setup the instance's option events & watchers. * If the value is a string, we pull it from the * instance's methods by name. */ exports._initEvents = function () { var options = this.$options if (options._asComponent) { registerComponentEvents(this, options.el) } registerCallbacks(this, '$on', options.events) registerCallbacks(this, '$watch', options.watch) } /** * Register v-on events on a child component * * @param {Vue} vm * @param {Element} el */ function registerComponentEvents (vm, el) { var attrs = el.attributes var name, handler for (var i = 0, l = attrs.length; i < l; i++) { name = attrs[i].name if (eventRE.test(name)) { name = name.replace(eventRE, '') handler = (vm._scope || vm._context).$eval(attrs[i].value, true) vm.$on(name.replace(eventRE), handler) } } } /** * Register callbacks for option events and watchers. * * @param {Vue} vm * @param {String} action * @param {Object} hash */ function registerCallbacks (vm, action, hash) { if (!hash) return var handlers, key, i, j for (key in hash) { handlers = hash[key] if (_.isArray(handlers)) { for (i = 0, j = handlers.length; i < j; i++) { register(vm, action, key, handlers[i]) } } else { register(vm, action, key, handlers) } } } /** * Helper to register an event/watch callback. * * @param {Vue} vm * @param {String} action * @param {String} key * @param {Function|String|Object} handler * @param {Object} [options] */ function register (vm, action, key, handler, options) { var type = typeof handler if (type === 'function') { vm[action](key, handler, options) } else if (type === 'string') { var methods = vm.$options.methods var method = methods && methods[handler] if (method) { vm[action](key, method, options) } else { ("development") !== 'production' && _.warn( 'Unknown method: "' + handler + '" when ' + 'registering callback for ' + action + ': "' + key + '".' ) } } else if (handler && type === 'object') { register(vm, action, key, handler.handler, handler) } } /** * Setup recursive attached/detached calls */ exports._initDOMHooks = function () { this.$on('hook:attached', onAttached) this.$on('hook:detached', onDetached) } /** * Callback to recursively call attached hook on children */ function onAttached () { if (!this._isAttached) { this._isAttached = true this.$children.forEach(callAttach) } } /** * Iterator to call attached hook * * @param {Vue} child */ function callAttach (child) { if (!child._isAttached && inDoc(child.$el)) { child._callHook('attached') } } /** * Callback to recursively call detached hook on children */ function onDetached () { if (this._isAttached) { this._isAttached = false this.$children.forEach(callDetach) } } /** * Iterator to call detached hook * * @param {Vue} child */ function callDetach (child) { if (child._isAttached && !inDoc(child.$el)) { child._callHook('detached') } } /** * Trigger all handlers for a hook * * @param {String} hook */ exports._callHook = function (hook) { var handlers = this.$options[hook] if (handlers) { for (var i = 0, j = handlers.length; i < j; i++) { handlers[i].call(this) } } this.$emit('hook:' + hook) } /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var compiler = __webpack_require__(15) var Observer = __webpack_require__(61) var Dep = __webpack_require__(3) var Watcher = __webpack_require__(20) /** * Setup the scope of an instance, which contains: * - observed data * - computed properties * - user methods * - meta properties */ exports._initState = function () { this._initProps() this._initMeta() this._initMethods() this._initData() this._initComputed() } /** * Initialize props. */ exports._initProps = function () { var options = this.$options var el = options.el var props = options.props if (props && !el) { ("development") !== 'production' && _.warn( 'Props will not be compiled if no `el` option is ' + 'provided at instantiation.' ) } // make sure to convert string selectors into element now el = options.el = _.query(el) this._propsUnlinkFn = el && el.nodeType === 1 && props // props must be linked in proper scope if inside v-repeat ? compiler.compileAndLinkProps(this, el, props, this._scope) : null } /** * Initialize the data. */ exports._initData = function () { var propsData = this._data var optionsDataFn = this.$options.data var optionsData = optionsDataFn && optionsDataFn() if (optionsData) { this._data = optionsData for (var prop in propsData) { if (("development") !== 'production' && optionsData.hasOwnProperty(prop)) { _.warn( 'Data field "' + prop + '" is already defined ' + 'as a prop. Use prop default value instead.' ) } if (this._props[prop].raw !== null || !optionsData.hasOwnProperty(prop)) { optionsData.$set(prop, propsData[prop]) } } } var data = this._data // proxy data on instance var keys = Object.keys(data) var i, key i = keys.length while (i--) { key = keys[i] if (!_.isReserved(key)) { this._proxy(key) } } // observe data Observer.create(data, this) } /** * Swap the isntance's $data. Called in $data's setter. * * @param {Object} newData */ exports._setData = function (newData) { newData = newData || {} var oldData = this._data this._data = newData var keys, key, i // copy props. // this should only happen during a v-repeat of component // that also happens to have compiled props. var props = this.$options.props if (props) { i = props.length while (i--) { key = props[i].name if (key !== '$data' && !newData.hasOwnProperty(key)) { newData.$set(key, oldData[key]) } } } // unproxy keys not present in new data keys = Object.keys(oldData) i = keys.length while (i--) { key = keys[i] if (!_.isReserved(key) && !(key in newData)) { this._unproxy(key) } } // proxy keys not already proxied, // and trigger change for changed values keys = Object.keys(newData) i = keys.length while (i--) { key = keys[i] if (!this.hasOwnProperty(key) && !_.isReserved(key)) { // new property this._proxy(key) } } oldData.__ob__.removeVm(this) Observer.create(newData, this) this._digest() } /** * Proxy a property, so that * vm.prop === vm._data.prop * * @param {String} key */ exports._proxy = function (key) { // need to store ref to self here // because these getter/setters might // be called by child instances! var self = this Object.defineProperty(self, key, { configurable: true, enumerable: true, get: function proxyGetter () { return self._data[key] }, set: function proxySetter (val) { self._data[key] = val } }) } /** * Unproxy a property. * * @param {String} key */ exports._unproxy = function (key) { delete this[key] } /** * Force update on every watcher in scope. */ exports._digest = function () { var i = this._watchers.length while (i--) { this._watchers[i].update(true) // shallow updates } var children = this.$children i = children.length while (i--) { var child = children[i] if (child.$options.inherit) { child._digest() } } } /** * Setup computed properties. They are essentially * special getter/setters */ function noop () {} exports._initComputed = function () { var computed = this.$options.computed if (computed) { for (var key in computed) { var userDef = computed[key] var def = { enumerable: true, configurable: true } if (typeof userDef === 'function') { def.get = makeComputedGetter(userDef, this) def.set = noop } else { def.get = userDef.get ? userDef.cache !== false ? makeComputedGetter(userDef.get, this) : _.bind(userDef.get, this) : noop def.set = userDef.set ? _.bind(userDef.set, this) : noop } Object.defineProperty(this, key, def) } } } function makeComputedGetter (getter, owner) { var watcher = new Watcher(owner, getter, null, { lazy: true }) return function computedGetter () { if (watcher.dirty) { watcher.evaluate() } if (Dep.target) { watcher.depend() } return watcher.value } } /** * Setup instance methods. Methods must be bound to the * instance since they might be called by children * inheriting them. */ exports._initMethods = function () { var methods = this.$options.methods if (methods) { for (var key in methods) { this[key] = _.bind(methods[key], this) } } } /** * Initialize meta information like $index, $key & $value. */ exports._initMeta = function () { var metas = this.$options._meta if (metas) { for (var key in metas) { _.defineReactive(this, key, metas[key]) } } } /***/ }, /* 61 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var Dep = __webpack_require__(3) var arrayMethods = __webpack_require__(62) var arrayKeys = Object.getOwnPropertyNames(arrayMethods) __webpack_require__(23) /** * Observer class that are attached to each observed * object. Once attached, the observer converts target * object's property keys into getter/setters that * collect dependencies and dispatches updates. * * @param {Array|Object} value * @constructor */ function Observer (value) { this.value = value this.dep = new Dep() _.define(value, '__ob__', this) if (_.isArray(value)) { var augment = config.proto && _.hasProto ? protoAugment : copyAugment augment(value, arrayMethods, arrayKeys) this.observeArray(value) } else { this.walk(value) } } // Static methods /** * Attempt to create an observer instance for a value, * returns the new observer if successfully observed, * or the existing observer if the value already has one. * * @param {*} value * @param {Vue} [vm] * @return {Observer|undefined} * @static */ Observer.create = function (value, vm) { var ob if ( value && value.hasOwnProperty('__ob__') && value.__ob__ instanceof Observer ) { ob = value.__ob__ } else if ( (_.isArray(value) || _.isPlainObject(value)) && !Object.isFrozen(value) && !value._isVue ) { ob = new Observer(value) } if (ob && vm) { ob.addVm(vm) } return ob } // Instance methods /** * Walk through each property and convert them into * getter/setters. This method should only be called when * value type is Object. * * @param {Object} obj */ Observer.prototype.walk = function (obj) { var keys = Object.keys(obj) var i = keys.length while (i--) { this.convert(keys[i], obj[keys[i]]) } } /** * Try to carete an observer for a child value, * and if value is array, link dep to the array. * * @param {*} val * @return {Dep|undefined} */ Observer.prototype.observe = function (val) { return Observer.create(val) } /** * Observe a list of Array items. * * @param {Array} items */ Observer.prototype.observeArray = function (items) { var i = items.length while (i--) { var ob = this.observe(items[i]) if (ob) { (ob.parents || (ob.parents = [])).push(this) } } } /** * Remove self from the parent list of removed objects. * * @param {Array} items */ Observer.prototype.unobserveArray = function (items) { var i = items.length while (i--) { var ob = items[i] && items[i].__ob__ if (ob) { ob.parents.$remove(this) } } } /** * Notify self dependency, and also parent Array dependency * if any. */ Observer.prototype.notify = function () { this.dep.notify() var parents = this.parents if (parents) { var i = parents.length while (i--) { parents[i].notify() } } } /** * Convert a property into getter/setter so we can emit * the events when the property is accessed/changed. * * @param {String} key * @param {*} val */ Observer.prototype.convert = function (key, val) { var ob = this var childOb = ob.observe(val) var dep = new Dep() Object.defineProperty(ob.value, key, { enumerable: true, configurable: true, get: function () { if (Dep.target) { dep.depend() if (childOb) { childOb.dep.depend() } } return val }, set: function (newVal) { if (newVal === val) return val = newVal childOb = ob.observe(newVal) dep.notify() } }) } /** * Add an owner vm, so that when $add/$delete mutations * happen we can notify owner vms to proxy the keys and * digest the watchers. This is only called when the object * is observed as an instance's root $data. * * @param {Vue} vm */ Observer.prototype.addVm = function (vm) { (this.vms || (this.vms = [])).push(vm) } /** * Remove an owner vm. This is called when the object is * swapped out as an instance's $data object. * * @param {Vue} vm */ Observer.prototype.removeVm = function (vm) { this.vms.$remove(vm) } // helpers /** * Augment an target Object or Array by intercepting * the prototype chain using __proto__ * * @param {Object|Array} target * @param {Object} proto */ function protoAugment (target, src) { target.__proto__ = src } /** * Augment an target Object or Array by defining * hidden properties. * * @param {Object|Array} target * @param {Object} proto */ function copyAugment (target, src, keys) { var i = keys.length var key while (i--) { key = keys[i] _.define(target, key, src[key]) } } module.exports = Observer /***/ }, /* 62 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var arrayProto = Array.prototype var arrayMethods = Object.create(arrayProto) /** * Intercept mutating methods and emit events */ ;[ 'push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse' ] .forEach(function (method) { // cache original method var original = arrayProto[method] _.define(arrayMethods, method, function mutator () { // avoid leaking arguments: // http://jsperf.com/closure-with-arguments var i = arguments.length var args = new Array(i) while (i--) { args[i] = arguments[i] } var result = original.apply(this, args) var ob = this.__ob__ var inserted, removed switch (method) { case 'push': inserted = args break case 'unshift': inserted = args break case 'splice': inserted = args.slice(2) removed = result break case 'pop': case 'shift': removed = [result] break } if (inserted) ob.observeArray(inserted) if (removed) ob.unobserveArray(removed) // notify change ob.notify() return result }) }) /** * Swap the element at the given index with a new value * and emits corresponding event. * * @param {Number} index * @param {*} val * @return {*} - replaced element */ _.define( arrayProto, '$set', function $set (index, val) { if (index >= this.length) { this.length = index + 1 } return this.splice(index, 1, val)[0] } ) /** * Convenience method to remove the element at given index. * * @param {Number} index * @param {*} val */ _.define( arrayProto, '$remove', function $remove (index) { /* istanbul ignore if */ if (!this.length) return if (typeof index !== 'number') { index = _.indexOf(this, index) } if (index > -1) { return this.splice(index, 1) } } ) module.exports = arrayMethods /***/ }, /* 63 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var Directive = __webpack_require__(64) var compiler = __webpack_require__(15) /** * Transclude, compile and link element. * * If a pre-compiled linker is available, that means the * passed in element will be pre-transcluded and compiled * as well - all we need to do is to call the linker. * * Otherwise we need to call transclude/compile/link here. * * @param {Element} el * @return {Element} */ exports._compile = function (el) { var options = this.$options if (options._linkFn) { // pre-transcluded with linker, just use it this._initElement(el) this._unlinkFn = options._linkFn(this, el) } else { // transclude and init element // transclude can potentially replace original // so we need to keep reference; this step also injects // the template and caches the original attributes // on the container node and replacer node. var original = el el = compiler.transclude(el, options) this._initElement(el) // root is always compiled per-instance, because // container attrs and props can be different every time. var rootLinker = compiler.compileRoot(el, options) // compile and link the rest var contentLinkFn var ctor = this.constructor // component compilation can be cached // as long as it's not using inline-template if (options._linkerCachable) { contentLinkFn = ctor.linker if (!contentLinkFn) { contentLinkFn = ctor.linker = compiler.compile(el, options) } } // link phase // make sure to link root with prop scope! var rootUnlinkFn = rootLinker(this, el, this._scope) var contentUnlinkFn = contentLinkFn ? contentLinkFn(this, el) : compiler.compile(el, options)(this, el) // register composite unlink function // to be called during instance destruction this._unlinkFn = function () { rootUnlinkFn() // passing destroying: true to avoid searching and // splicing the directives contentUnlinkFn(true) } // finally replace original if (options.replace) { _.replace(original, el) } } return el } /** * Initialize instance element. Called in the public * $mount() method. * * @param {Element} el */ exports._initElement = function (el) { if (el instanceof DocumentFragment) { this._isFragment = true this.$el = this._fragmentStart = el.firstChild this._fragmentEnd = el.lastChild // set persisted text anchors to empty if (this._fragmentStart.nodeType === 3) { this._fragmentStart.data = this._fragmentEnd.data = '' } this._blockFragment = el } else { this.$el = el } this.$el.__vue__ = this this._callHook('beforeCompile') } /** * Create and bind a directive to an element. * * @param {String} name - directive name * @param {Node} node - target node * @param {Object} desc - parsed directive descriptor * @param {Object} def - directive definition object * @param {Vue} [host] - transclusion host component * @param {Object} [scope] - v-for scope * @param {Fragment} [frag] - owner fragment */ exports._bindDir = function (name, node, desc, def, host, scope, frag, arg, literal) { this._directives.push( new Directive(name, node, this, desc, def, host, scope, frag, arg, literal) ) } /** * Teardown an instance, unobserves the data, unbind all the * directives, turn off all the event listeners, etc. * * @param {Boolean} remove - whether to remove the DOM node. * @param {Boolean} deferCleanup - if true, defer cleanup to * be called later */ exports._destroy = function (remove, deferCleanup) { if (this._isBeingDestroyed) { return } this._callHook('beforeDestroy') this._isBeingDestroyed = true var i // remove self from parent. only necessary // if parent is not being destroyed as well. var parent = this.$parent if (parent && !parent._isBeingDestroyed) { parent.$children.$remove(this) } // remove self from owner fragment if (this._frag) { this._frag.children.$remove(this) } // destroy all children. i = this.$children.length while (i--) { this.$children[i].$destroy() } // teardown props if (this._propsUnlinkFn) { this._propsUnlinkFn() } // teardown all directives. this also tearsdown all // directive-owned watchers. if (this._unlinkFn) { this._unlinkFn() } i = this._watchers.length while (i--) { this._watchers[i].teardown() } // unregister ref var ref = this.$options._ref if (ref) { var scope = this._scope || this._context if (scope.$[ref] === this) { scope.$[ref] = null } } // remove reference to self on $el if (this.$el) { this.$el.__vue__ = null } // remove DOM element var self = this if (remove && this.$el) { this.$remove(function () { self._cleanup() }) } else if (!deferCleanup) { this._cleanup() } } /** * Clean up to ensure garbage collection. * This is called after the leave transition if there * is any. */ exports._cleanup = function () { // remove reference from data ob // frozen object may not have observer. if (this._data.__ob__) { this._data.__ob__.removeVm(this) } // Clean up references to private properties and other // instances. preserve reference to _data so that proxy // accessors still work. The only potential side effect // here is that mutating the instance after it's destroyed // may affect the state of other components that are still // observing the same object, but that seems to be a // reasonable responsibility for the user rather than // always throwing an error on them. this.$el = this.$parent = this.$root = this.$children = this._watchers = this._context = this._scope = this._directives = null // call the last hook... this._isDestroyed = true this._callHook('destroyed') // turn off all instance listeners. this.$off() } /***/ }, /* 64 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var config = __webpack_require__(6) var Watcher = __webpack_require__(20) var textParser = __webpack_require__(7) var expParser = __webpack_require__(21) /** * A directive links a DOM element with a piece of data, * which is the result of evaluating an expression. * It registers a watcher with the expression and calls * the DOM update function when a change is triggered. * * @param {String} name * @param {Node} el * @param {Vue} vm * @param {Object} descriptor * - {String} expression * - {String} [arg] * - {Array<Object>} [filters] * @param {Object} def - directive definition object * @param {Vue} [host] - transclusion host component * @param {Object} [scope] - v-for scope * @param {Fragment} [frag] - owner fragment * @constructor */ // TODO: 1.0.0 cleanup the arguments function Directive (name, el, vm, descriptor, def, host, scope, frag, arg, literal) { // public this.name = name this.el = el this.vm = vm // copy descriptor props this.expression = descriptor.expression this.arg = arg || descriptor.arg this.filters = descriptor.filters // private this._def = def this._descriptor = descriptor this._locked = false this._bound = false this._listeners = null // link context this._host = host this._scope = scope this._frag = frag // literal this._literal = literal } /** * Initialize the directive, mixin definition properties, * setup the watcher, call definition bind() and update() * if present. * * @param {Object} def */ Directive.prototype._bind = function () { var def = this._def var name = this.name if ( (name !== 'cloak' || this.vm._isCompiled) && this.el && this.el.removeAttribute ) { this.el.removeAttribute(config.prefix + this.name) // 1.0.0: remove bind/on // TODO simplify this if (name === 'attr') { removeBindAttr(this.el, this.arg) } else if (name === 'class' || name === 'style') { removeBindAttr(this.el, name) } else if (name === 'on') { this.el.removeAttribute('on-' + this.arg) } else if (name === 'transition') { if (this.arg) { removeBindAttr(this.el, name) } else { this.el.removeAttribute(name) } } else if (name === 'el') { this.el.removeAttribute('$$.' + this.expression) } } if (typeof def === 'function') { this.update = def } else { _.extend(this, def) } this._watcherExp = this.expression this._checkDynamicLiteral() if (this.bind) { this.bind() } if (this._literal) { this.update && this.update(this.expression) } else if ( this._watcherExp && (this.update || this.twoWay) && (!this.isLiteral || this._isDynamicLiteral) && !this._checkStatement() ) { // wrapped updater for context var dir = this var update = this._update = this.update ? function (val, oldVal) { if (!dir._locked) { dir.update(val, oldVal) } } : function () {} // noop if no update is provided // pre-process hook called before the value is piped // through the filters. used in v-repeat. var preProcess = this._preProcess ? _.bind(this._preProcess, this) : null var watcher = this._watcher = new Watcher( this.vm, this._watcherExp, update, // callback { filters: this.filters, twoWay: this.twoWay, deep: this.deep, preProcess: preProcess, scope: this._scope } ) if (this._initValue != null) { watcher.set(this._initValue) } else if (this.update) { this.update(watcher.value) } } this._bound = true } /** * check if this is a dynamic literal binding. * * e.g. v-component="{{currentView}}" */ // TODO: we shouldn't need this in 1.0.0. Directive.prototype._checkDynamicLiteral = function () { var expression = this.expression if (expression && this.isLiteral) { if (true) { if (this.name !== 'el' && this.name !== 'ref' && this.name !== 'transition' && this.name !== 'component') { _.deprecation.LITERAL() } } var tokens = textParser.parse(expression) if (tokens) { var exp = textParser.tokensToExp(tokens) this.expression = this.vm.$get(exp) this._watcherExp = exp this._isDynamicLiteral = true } } } /** * Check if the directive is a function caller * and if the expression is a callable one. If both true, * we wrap up the expression and use it as the event * handler. * * e.g. v-on="click: a++" * * @return {Boolean} */ Directive.prototype._checkStatement = function () { var expression = this.expression if ( expression && this.acceptStatement && !expParser.isSimplePath(expression) ) { var fn = expParser.parse(expression).get var scope = this._scope || this.vm var handler = function () { fn.call(scope, scope) } if (this.filters) { handler = this.vm._applyFilters(handler, null, this.filters) } this.update(handler) return true } } /** * Check for an attribute directive param, e.g. lazy * * @param {String} name * @return {String} */ Directive.prototype.param = function (name) { var param = this.el.getAttribute(name) if (param != null) { this.el.removeAttribute(name) param = (this._scope || this.vm).$interpolate(param) } return param } /** * Set the corresponding value with the setter. * This should only be used in two-way directives * e.g. v-model. * * @param {*} value * @public */ Directive.prototype.set = function (value) { /* istanbul ignore else */ if (this.twoWay) { this._withLock(function () { this._watcher.set(value) }) } else if (true) { _.warn( 'Directive.set() can only be used inside twoWay' + 'directives.' ) } } /** * Execute a function while preventing that function from * triggering updates on this directive instance. * * @param {Function} fn */ Directive.prototype._withLock = function (fn) { var self = this self._locked = true fn.call(self) _.nextTick(function () { self._locked = false }) } /** * Convenience method that attaches a DOM event listener * to the directive element and autometically tears it down * during unbind. * * @param {String} event * @param {Function} handler */ Directive.prototype.on = function (event, handler) { _.on(this.el, event, handler) ;(this._listeners || (this._listeners = [])) .push([event, handler]) } /** * Teardown the watcher and call unbind. */ Directive.prototype._teardown = function () { if (this._bound) { this._bound = false if (this.unbind) { this.unbind() } if (this._watcher) { this._watcher.teardown() } var listeners = this._listeners if (listeners) { for (var i = 0; i < listeners.length; i++) { _.off(this.el, listeners[i][0], listeners[i][1]) } } this.vm = this.el = this._watcher = this._listeners = null } } /** * Check if the colon prefixed form exists before attempting * to remove it. This is necessary because IE will remove * the unprefixed attribute if the prefixed version is not * present. * * @param {Element} el * @param {String} name */ function removeBindAttr (el, name) { var attr = ':' + name if (el.hasAttribute(attr)) { el.removeAttribute(attr) } attr = config.prefix + 'bind:' + name if (el.hasAttribute(attr)) { el.removeAttribute(attr) } } module.exports = Directive /***/ }, /* 65 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * Apply a list of filter (descriptors) to a value. * Using plain for loops here because this will be called in * the getter of any watcher with filters so it is very * performance sensitive. * * @param {*} value * @param {*} [oldValue] * @param {Array} filters * @param {Boolean} write * @return {*} */ exports._applyFilters = function (value, oldValue, filters, write) { var filter, fn, args, arg, offset, i, l, j, k for (i = 0, l = filters.length; i < l; i++) { filter = filters[i] fn = _.resolveAsset(this.$options, 'filters', filter.name) if (true) { _.assertAsset(fn, 'filter', filter.name) } if (!fn) continue fn = write ? fn.write : (fn.read || fn) if (typeof fn !== 'function') continue args = write ? [value, oldValue] : [value] offset = write ? 2 : 1 if (filter.args) { for (j = 0, k = filter.args.length; j < k; j++) { arg = filter.args[j] args[j + offset] = arg.dynamic ? this.$get(arg.value) : arg.value } } value = fn.apply(this, args) } return value } /** * Resolve a component, depending on whether the component * is defined normally or using an async factory function. * Resolves synchronously if already resolved, otherwise * resolves asynchronously and caches the resolved * constructor on the factory. * * @param {String} id * @param {Function} cb */ exports._resolveComponent = function (id, cb) { var factory = _.resolveAsset(this.$options, 'components', id) if (true) { _.assertAsset(factory, 'component', id) } if (!factory) { return } // async component factory if (!factory.options) { if (factory.resolved) { // cached cb(factory.resolved) } else if (factory.requested) { // pool callbacks factory.pendingCallbacks.push(cb) } else { factory.requested = true var cbs = factory.pendingCallbacks = [cb] factory(function resolve (res) { if (_.isPlainObject(res)) { res = _.Vue.extend(res) } // cache resolved factory.resolved = res // invoke callbacks for (var i = 0, l = cbs.length; i < l; i++) { cbs[i](res) } }, function reject (reason) { ("development") !== 'production' && _.warn( 'Failed to resolve async component: ' + id + '. ' + (reason ? '\nReason: ' + reason : '') ) }) } } else { // normal component cb(factory) } } /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { var Watcher = __webpack_require__(20) var Path = __webpack_require__(22) var textParser = __webpack_require__(7) var dirParser = __webpack_require__(9) var expParser = __webpack_require__(21) var filterRE = /[^|]\|[^|]/ /** * Get the value from an expression on this vm. * * @param {String} exp * @param {Boolean} [asStatement] * @return {*} */ exports.$get = function (exp, asStatement) { var res = expParser.parse(exp) if (res) { if (asStatement && !expParser.isSimplePath(exp)) { var self = this return function statementHandler () { res.get.call(self, self) } } else { try { return res.get.call(this, this) } catch (e) {} } } } /** * Set the value from an expression on this vm. * The expression must be a valid left-hand * expression in an assignment. * * @param {String} exp * @param {*} val */ exports.$set = function (exp, val) { var res = expParser.parse(exp, true) if (res && res.set) { res.set.call(this, this, val) } } /** * Add a property on the VM (deorecated) * * @param {String} key * @param {*} val */ exports.$add = function (key, val) { this._data.$set(key, val) if (true) { __webpack_require__(1).deprecation.ADD() } } /** * Delete a property on the VM * * @param {String} key */ exports.$delete = function (key) { this._data.$delete(key) } /** * Watch an expression, trigger callback when its * value changes. * * @param {String} exp * @param {Function} cb * @param {Object} [options] * - {Boolean} deep * - {Boolean} immediate * - {Boolean} user * @return {Function} - unwatchFn */ exports.$watch = function (exp, cb, options) { var vm = this var watcher = new Watcher(vm, exp, cb, { deep: options && options.deep, user: !options || options.user !== false }) if (options && options.immediate) { cb.call(vm, watcher.value) } return function unwatchFn () { watcher.teardown() } } /** * Evaluate a text directive, including filters. * * @param {String} text * @param {Boolean} [asStatement] * @return {String} */ exports.$eval = function (text, asStatement) { // check for filters. if (filterRE.test(text)) { var dir = dirParser.parse(text)[0] // the filter regex check might give false positive // for pipes inside strings, so it's possible that // we don't get any filters here var val = this.$get(dir.expression, asStatement) return dir.filters ? this._applyFilters(val, null, dir.filters) : val } else { // no filter return this.$get(text, asStatement) } } /** * Interpolate a piece of template text. * * @param {String} text * @return {String} */ exports.$interpolate = function (text) { var tokens = textParser.parse(text) var vm = this if (tokens) { return tokens.length === 1 ? vm.$eval(tokens[0].value) : tokens.map(function (token) { return token.tag ? vm.$eval(token.value) : token.value }).join('') } else { return text } } /** * Log instance data as a plain JS object * so that it is easier to inspect in console. * This method assumes console is available. * * @param {String} [path] */ exports.$log = function (path) { var data = path ? Path.get(this._data, path) : this._data if (data) { data = clean(data) } // include computed fields if (!path) { for (var key in this.$options.computed) { data[key] = clean(this[key]) } } console.log(data) } /** * "clean" a getter/setter converted object into a plain * object copy. * * @param {Object} - obj * @return {Object} */ function clean (obj) { return JSON.parse(JSON.stringify(obj)) } /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var transition = __webpack_require__(30) /** * Convenience on-instance nextTick. The callback is * auto-bound to the instance, and this avoids component * modules having to rely on the global Vue. * * @param {Function} fn */ exports.$nextTick = function (fn) { _.nextTick(fn, this) } /** * Append instance to target * * @param {Node} target * @param {Function} [cb] * @param {Boolean} [withTransition] - defaults to true */ exports.$appendTo = function (target, cb, withTransition) { return insert( this, target, cb, withTransition, append, transition.append ) } /** * Prepend instance to target * * @param {Node} target * @param {Function} [cb] * @param {Boolean} [withTransition] - defaults to true */ exports.$prependTo = function (target, cb, withTransition) { target = query(target) if (target.hasChildNodes()) { this.$before(target.firstChild, cb, withTransition) } else { this.$appendTo(target, cb, withTransition) } return this } /** * Insert instance before target * * @param {Node} target * @param {Function} [cb] * @param {Boolean} [withTransition] - defaults to true */ exports.$before = function (target, cb, withTransition) { return insert( this, target, cb, withTransition, before, transition.before ) } /** * Insert instance after target * * @param {Node} target * @param {Function} [cb] * @param {Boolean} [withTransition] - defaults to true */ exports.$after = function (target, cb, withTransition) { target = query(target) if (target.nextSibling) { this.$before(target.nextSibling, cb, withTransition) } else { this.$appendTo(target.parentNode, cb, withTransition) } return this } /** * Remove instance from DOM * * @param {Function} [cb] * @param {Boolean} [withTransition] - defaults to true */ exports.$remove = function (cb, withTransition) { if (!this.$el.parentNode) { return cb && cb() } var inDoc = this._isAttached && _.inDoc(this.$el) // if we are not in document, no need to check // for transitions if (!inDoc) withTransition = false var op var self = this var realCb = function () { if (inDoc) self._callHook('detached') if (cb) cb() } if ( this._isFragment && !this._blockFragment.hasChildNodes() ) { op = withTransition === false ? append : transition.removeThenAppend blockOp(this, this._blockFragment, op, realCb) } else { op = withTransition === false ? remove : transition.remove op(this.$el, this, realCb) } return this } /** * Shared DOM insertion function. * * @param {Vue} vm * @param {Element} target * @param {Function} [cb] * @param {Boolean} [withTransition] * @param {Function} op1 - op for non-transition insert * @param {Function} op2 - op for transition insert * @return vm */ function insert (vm, target, cb, withTransition, op1, op2) { target = query(target) var targetIsDetached = !_.inDoc(target) var op = withTransition === false || targetIsDetached ? op1 : op2 var shouldCallHook = !targetIsDetached && !vm._isAttached && !_.inDoc(vm.$el) if (vm._isFragment) { blockOp(vm, target, op, cb) } else { op(vm.$el, target, vm, cb) } if (shouldCallHook) { vm._callHook('attached') } return vm } /** * Execute a transition operation on a fragment instance, * iterating through all its block nodes. * * @param {Vue} vm * @param {Node} target * @param {Function} op * @param {Function} cb */ function blockOp (vm, target, op, cb) { var current = vm._fragmentStart var end = vm._fragmentEnd var next while (next !== end) { next = current.nextSibling op(current, target, vm) current = next } op(end, target, vm, cb) } /** * Check for selectors * * @param {String|Element} el */ function query (el) { return typeof el === 'string' ? document.querySelector(el) : el } /** * Append operation that takes a callback. * * @param {Node} el * @param {Node} target * @param {Vue} vm - unused * @param {Function} [cb] */ function append (el, target, vm, cb) { target.appendChild(el) if (cb) cb() } /** * InsertBefore operation that takes a callback. * * @param {Node} el * @param {Node} target * @param {Vue} vm - unused * @param {Function} [cb] */ function before (el, target, vm, cb) { _.before(el, target) if (cb) cb() } /** * Remove operation that takes a callback. * * @param {Node} el * @param {Vue} vm - unused * @param {Function} [cb] */ function remove (el, vm, cb) { _.remove(el) if (cb) cb() } /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * Listen on the given `event` with `fn`. * * @param {String} event * @param {Function} fn */ exports.$on = function (event, fn) { (this._events[event] || (this._events[event] = [])) .push(fn) modifyListenerCount(this, event, 1) return this } /** * Adds an `event` listener that will be invoked a single * time then automatically removed. * * @param {String} event * @param {Function} fn */ exports.$once = function (event, fn) { var self = this function on () { self.$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 */ exports.$off = function (event, fn) { var cbs // all if (!arguments.length) { if (this.$parent) { for (event in this._events) { cbs = this._events[event] if (cbs) { modifyListenerCount(this, event, -cbs.length) } } } this._events = {} return this } // specific event cbs = this._events[event] if (!cbs) { return this } if (arguments.length === 1) { modifyListenerCount(this, event, -cbs.length) this._events[event] = null return this } // specific handler var cb var i = cbs.length while (i--) { cb = cbs[i] if (cb === fn || cb.fn === fn) { modifyListenerCount(this, event, -1) cbs.splice(i, 1) break } } return this } /** * Trigger an event on self. * * @param {String} event */ exports.$emit = function (event) { this._shouldPropagate = false var cbs = this._events[event] if (cbs) { cbs = cbs.length > 1 ? _.toArray(cbs) : cbs var args = _.toArray(arguments, 1) for (var i = 0, l = cbs.length; i < l; i++) { var res = cbs[i].apply(this, args) if (res === true) { this._shouldPropagate = true } if (("development") !== 'production' && res === false) { _.deprecation.PROPAGATION(event) } } } return this } /** * Recursively broadcast an event to all children instances. * * @param {String} event * @param {...*} additional arguments */ exports.$broadcast = function (event) { // if no child has registered for this event, // then there's no need to broadcast. if (!this._eventsCount[event]) return var children = this.$children for (var i = 0, l = children.length; i < l; i++) { var child = children[i] child.$emit.apply(child, arguments) if (child._shouldPropagate) { child.$broadcast.apply(child, arguments) } } return this } /** * Recursively propagate an event up the parent chain. * * @param {String} event * @param {...*} additional arguments */ exports.$dispatch = function () { var parent = this.$parent while (parent) { parent.$emit.apply(parent, arguments) parent = parent._shouldPropagate ? parent.$parent : null } return this } /** * Modify the listener counts on all parents. * This bookkeeping allows $broadcast to return early when * no child has listened to a certain event. * * @param {Vue} vm * @param {String} event * @param {Number} count */ var hookRE = /^hook:/ function modifyListenerCount (vm, event, count) { var parent = vm.$parent // hooks do not get broadcasted so no need // to do bookkeeping for them if (!parent || !count || hookRE.test(event)) return while (parent) { parent._eventsCount[event] = (parent._eventsCount[event] || 0) + count parent = parent.$parent } } /***/ }, /* 69 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) /** * Create a child instance that prototypally inherits * data on parent. To achieve that we create an intermediate * constructor with its prototype pointing to parent. * * @param {Object} opts * @param {Function} [BaseCtor] * @return {Vue} * @public */ exports.$addChild = function (opts, BaseCtor) { BaseCtor = BaseCtor || _.Vue opts = opts || {} var ChildVue var parent = this // transclusion context var context = opts._context || parent var inherit = opts.inherit !== undefined ? opts.inherit : BaseCtor.options.inherit if (inherit) { var ctors = context._childCtors ChildVue = ctors[BaseCtor.cid] if (!ChildVue) { var optionName = BaseCtor.options.name var className = optionName ? _.classify(optionName) : 'VueComponent' ChildVue = new Function( 'return function ' + className + ' (options) {' + 'this.constructor = ' + className + ';' + 'this._init(options) }' )() ChildVue.options = BaseCtor.options ChildVue.linker = BaseCtor.linker ChildVue.prototype = context ctors[BaseCtor.cid] = ChildVue } } else { ChildVue = BaseCtor } opts._parent = parent opts._root = parent.$root var child = new ChildVue(opts) return child } /***/ }, /* 70 */ /***/ function(module, exports, __webpack_require__) { var _ = __webpack_require__(1) var compiler = __webpack_require__(15) /** * Set instance target element and kick off the compilation * process. The passed in `el` can be a selector string, an * existing Element, or a DocumentFragment (for block * instances). * * @param {Element|DocumentFragment|string} el * @public */ exports.$mount = function (el) { if (this._isCompiled) { ("development") !== 'production' && _.warn( '$mount() should be called only once.' ) return } el = _.query(el) if (!el) { el = document.createElement('div') } this._compile(el) this._isCompiled = true this._callHook('compiled') this._initDOMHooks() if (_.inDoc(this.$el)) { this._callHook('attached') ready.call(this) } else { this.$once('hook:attached', ready) } return this } /** * Mark an instance as ready. */ function ready () { this._isAttached = true this._isReady = true this._callHook('ready') } /** * Teardown the instance, simply delegate to the internal * _destroy. */ exports.$destroy = function (remove, deferCleanup) { this._destroy(remove, deferCleanup) } /** * Partially compile a piece of DOM and return a * decompile function. * * @param {Element|DocumentFragment} el * @param {Vue} [host] * @return {Function} */ exports.$compile = function (el, host, scope, frag) { return compiler.compile(el, this.$options, true)( this, el, host, scope, frag ) } /***/ } /******/ ]) }); ;
packages/reactive-dict/reactive-dict.js
AnjirHossain/meteor
// XXX come up with a serialization method which canonicalizes object key // order, which would allow us to use objects as values for equals. var stringify = function (value) { if (value === undefined) return 'undefined'; return EJSON.stringify(value); }; var parse = function (serialized) { if (serialized === undefined || serialized === 'undefined') return undefined; return EJSON.parse(serialized); }; var changed = function (v) { v && v.changed(); }; // XXX COMPAT WITH 0.9.1 : accept migrationData instead of dictName ReactiveDict = function (dictName) { // this.keys: key -> value if (dictName) { if (typeof dictName === 'string') { // the normal case, argument is a string name. // _registerDictForMigrate will throw an error on duplicate name. ReactiveDict._registerDictForMigrate(dictName, this); this.keys = ReactiveDict._loadMigratedDict(dictName) || {}; this.name = dictName; } else if (typeof dictName === 'object') { // back-compat case: dictName is actually migrationData this.keys = dictName; } else { throw new Error("Invalid ReactiveDict argument: " + dictName); } } else { // no name given; no migration will be performed this.keys = {}; } this.allDeps = new Tracker.Dependency; this.keyDeps = {}; // key -> Dependency this.keyValueDeps = {}; // key -> Dependency }; _.extend(ReactiveDict.prototype, { // set() began as a key/value method, but we are now overloading it // to take an object of key/value pairs, similar to backbone // http://backbonejs.org/#Model-set set: function (keyOrObject, value) { var self = this; if ((typeof keyOrObject === 'object') && (value === undefined)) { self._setObject(keyOrObject); return; } // the input isn't an object, so it must be a key // and we resume with the rest of the function var key = keyOrObject; value = stringify(value); var oldSerializedValue = 'undefined'; if (_.has(self.keys, key)) oldSerializedValue = self.keys[key]; if (value === oldSerializedValue) return; self.keys[key] = value; self.allDeps.changed(); changed(self.keyDeps[key]); if (self.keyValueDeps[key]) { changed(self.keyValueDeps[key][oldSerializedValue]); changed(self.keyValueDeps[key][value]); } }, setDefault: function (key, value) { var self = this; // for now, explicitly check for undefined, since there is no // ReactiveDict.clear(). Later we might have a ReactiveDict.clear(), in which case // we should check if it has the key. if (self.keys[key] === undefined) { self.set(key, value); } }, get: function (key) { var self = this; self._ensureKey(key); self.keyDeps[key].depend(); return parse(self.keys[key]); }, equals: function (key, value) { var self = this; // Mongo.ObjectID is in the 'mongo' package var ObjectID = null; if (typeof Mongo !== 'undefined') { ObjectID = Mongo.ObjectID; } // We don't allow objects (or arrays that might include objects) for // .equals, because JSON.stringify doesn't canonicalize object key // order. (We can make equals have the right return value by parsing the // current value and using EJSON.equals, but we won't have a canonical // element of keyValueDeps[key] to store the dependency.) You can still use // "EJSON.equals(reactiveDict.get(key), value)". // // XXX we could allow arrays as long as we recursively check that there // are no objects if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean' && typeof value !== 'undefined' && !(value instanceof Date) && !(ObjectID && value instanceof ObjectID) && value !== null) throw new Error("ReactiveDict.equals: value must be scalar"); var serializedValue = stringify(value); if (Tracker.active) { self._ensureKey(key); if (! _.has(self.keyValueDeps[key], serializedValue)) self.keyValueDeps[key][serializedValue] = new Tracker.Dependency; var isNew = self.keyValueDeps[key][serializedValue].depend(); if (isNew) { Tracker.onInvalidate(function () { // clean up [key][serializedValue] if it's now empty, so we don't // use O(n) memory for n = values seen ever if (! self.keyValueDeps[key][serializedValue].hasDependents()) delete self.keyValueDeps[key][serializedValue]; }); } } var oldValue = undefined; if (_.has(self.keys, key)) oldValue = parse(self.keys[key]); return EJSON.equals(oldValue, value); }, all: function() { this.allDeps.depend(); var ret = {}; _.each(this.keys, function(value, key) { ret[key] = parse(value); }); return ret; }, clear: function() { var self = this; var oldKeys = self.keys; self.keys = {}; self.allDeps.changed(); _.each(oldKeys, function(value, key) { changed(self.keyDeps[key]); changed(self.keyValueDeps[key][value]); changed(self.keyValueDeps[key]['undefined']); }); }, _setObject: function (object) { var self = this; _.each(object, function (value, key){ self.set(key, value); }); }, _ensureKey: function (key) { var self = this; if (!(key in self.keyDeps)) { self.keyDeps[key] = new Tracker.Dependency; self.keyValueDeps[key] = {}; } }, // Get a JSON value that can be passed to the constructor to // create a new ReactiveDict with the same contents as this one _getMigrationData: function () { // XXX sanitize and make sure it's JSONible? return this.keys; } });
src/utils/index.js
rendact/rendact
import React from 'react'; import request from 'request'; import Config from '../rendact.config.json'; import AdminConfig from '../admin/AdminConfig'; import Query from '../admin/query'; import _ from 'lodash'; import { default as swal } from 'sweetalert2'; import {connect} from 'react-redux' import {saveConfig} from './saveConfig' export const swalert = function(type, title, body, callback, rgba){ var background = '#fff'; var buttonColor = '#357ca5'; var showCancelButton = true; var confirmButtonText = ""; var text = body; if (type==="warning") { background = "rgba(239,203,4,.75)"; buttonColor = '#db8b0b'; text = title; confirmButtonText = "Yes" } if (type==="info") { background = "rgba(0,0,128,.75)"; buttonColor = '#00a7d0'; showCancelButton = false; confirmButtonText = "OK"; } if (type==="error"){ background = "rgba(239,4,16,.75)"; buttonColor = '#d33724'; showCancelButton = false; confirmButtonText = "OK"; } if (!callback) { callback = function(){} } swal({ /*title: title,*/ text: text, showCancelButton: showCancelButton, background: background, confirmButtonText: confirmButtonText, cancelButtonText: 'Cancel', confirmButtonColor: buttonColor, cancelButtonColor: 'grey', confirmButtonClass: 'btn swal-btn-success', cancelButtonClass: 'btn swal-btn-danger', buttonsStyling: true, customClass: 'swal' }).then(callback) } export const riques = function(query, callback, isadmin){ var token = localStorage.getItem("token"); if (isadmin || Config.adminMode){ token = Config.adminToken } request({ url: Config.graphqlApiUrl, method: "POST", json: true, headers: { "content-type": "application/json", "Authorization": "Bearer " + token }, body: query }, callback); } export const setValue = function(element, value) { if (document.getElementById(element)) document.getElementById(element).value = value; } export const getValue = function(element) { if (document.getElementById(element)) return document.getElementById(element).value; else return null; } export const getValueName = function(element){ return document.getElementsByName(element); } export const getMaxRole = function(){ var p = JSON.parse(localStorage.getItem("profile")); var roleValueList = _.map(p.roles, function(item){ return AdminConfig.roleValue[item] }); var maxRole = _.max(roleValueList); if (!maxRole) maxRole=1; if (Config.adminMode) return 1000; return maxRole; } export const getConfig = function(name){ var config = JSON.parse(localStorage.getItem('config')); if (config && config[name]) return config[name] else return null; } export const hasRole = function(roleId){ if (roleId==="all") return true; var p = JSON.parse(localStorage.getItem("profile")); var roleIdList = []; var permissionConfig = JSON.parse(getConfig("permissionConfig")); _.forEach(p.roles, function(item){ roleIdList = _.concat(roleIdList, permissionConfig[item]) }) if (Config.adminMode) return true; return (_.indexOf(roleIdList, roleId)>-1) } export const errorCallback = function(msg1, msg2, module){ var moduleTxt = "" if (module) { moduleTxt = " ("+module+")"; } if (msg1) swalert('error','Failed!', msg1+moduleTxt) else if (msg2) swalert('error','Failed!', msg2+moduleTxt) else swalert('error','Failed!', 'Unknown error'+moduleTxt) } export const sendMail = function(to, title, message, callback){ request({ url: getConfig('mailUrl'), method: "POST", json: true, headers: { "Authorization": "Basic "+btoa("api:"+getConfig('mailApiKey')) }, form: { "from": getConfig('mailDefaultSender'), "to": to, "subject": title, "text": message } }, function(error, response, body){ if (error){ console.log(error) } else { console.log(response) if (callback) callback.call(); } }); } export const getFormData = function(className, output){ var _objData; if (!output) output = "list"; if (output==="list") { _objData = []; _.forEach(document.getElementsByClassName(className), function(item){ var _obj = { value: item.value, item: item.name } if (item.id) _obj['id'] = item.id _objData.push(_obj); }); return _objData; } if (output==="object") { _objData = {}; _.forEach(document.getElementsByClassName(className), function(item){ _objData[item.id] = item.value; }); return _objData; } } export const disableBySelector = (state, selectors) => { /* * utils to disable all items that match with selectors * selectors = array with css selector inside * state = disabled state, true or false */ // select all items with selector // each selector, add disabled property === state _.forEach(selectors, (selector, index) => { _.forEach(document.querySelectorAll(selector), (element, index) => { element.disabled = state; }); }); } export const disableForm = function(state, notif, excludeClass){ //var me = this; _.forEach(document.getElementsByTagName('input'), function(el){ if (_.indexOf(excludeClass, el.getAttribute("class"))<0) el.disabled = state;}); _.forEach(document.getElementsByTagName('button'), function(el){ if (_.indexOf(excludeClass, el.getAttribute("class"))<0) el.disabled = state;}); _.forEach(document.getElementsByTagName('select'), function(el){ if (_.indexOf(excludeClass, el.getAttribute("class"))<0) el.disabled = state;}); /* if (notif) { if (state) notif.addNotification({ uid: 'saving', message: 'Processing...', level: 'warning', position: 'tr', dismissible: false, autoDismiss: 0 }); else { notif.addNotification({ message: 'Done!', level: 'success', position: 'tr', autoDismiss: 1 }); notif.removeNotification('saving'); } } */ } export const disableFormContentType = function(state, notif, excludeClass){ _.forEach(document.getElementsByTagName('input'), function(el){ if (_.indexOf(excludeClass, el.getAttribute("class"))<0) el.disabled = state;}); _.forEach(document.getElementsByTagName('select'), function(el){ if (_.indexOf(excludeClass, el.getAttribute("class"))<0) el.disabled = state;}); } export const loadConfig = function(callback){ var qry = Query.getContentListQry("active"); riques(qry, function(error, response, body) { if (!error && !body.errors && response.statusCode === 200) { var _dataArr = []; _.forEach(body.data.viewer.allContents.edges, function(item){ var dt = new Date(item.node.createdAt); var fields = item.node.fields; if (item.node.customFields) fields = _.concat(item.node.fields, item.node.customFields) _dataArr.push({ "postId": item.node.id, "name": item.node.name, "fields": fields, "customFields": item.node.customFields, "slug": item.node.slug?item.node.slug:"", "status": item.node.status?item.node.status:"", "createdAt": dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/" + dt.getDate() }); }); saveConfig("contentList", _dataArr); } else { errorCallback(error); } } ); qry = Query.loadSettingsQry; riques(qry, function(error, response, body) { if (!error && !body.errors && response.statusCode === 200) { _.forEach(body.data.viewer.allOptions.edges, function(item){ saveConfig(item.node.item, item.node.value); }); if (callback) callback.call(); } else { errorCallback(error); } } ); } export const defaultHalogenStyle = { display: '-webkit-flex', WebkitFlex: '0 1 auto', flex: '0 1 auto', WebkitFlexDirection: 'column', flexDirection: 'column', WebkitFlexGrow: 1, flexGrow: 1, WebkitFlexShrink: 0, flexShrink: 0, WebkitFlexBasis: '25%', flexBasis: '25%', maxWidth: '25%', height: '200px', top: '50%', left: '50%', position: 'absolute', WebkitAlignItems: 'center', alignItems: 'center', WebkitJustifyContent: 'center', justifyContent: 'center', zIndex: 100 }; export const removeTags = function(txt){ var rex = /(<([^>]+)>)/ig; return txt.replace(rex , ""); } export const toHTMLObject = function(text){ var parser=new DOMParser(); var htmlDoc=parser.parseFromString(text, "text/html"); return htmlDoc; } export const objectToDataset = (obj) => { // source https://github.com/holidayextras/react-data-attributes-mixin return _.mapKeys(obj, (value, key) => ('data-' + _.kebabCase(key))) } export const getActiveWidgetArea = function(){ var activeWidgetArea = localStorage.getItem("activeWidgetArea")||""; activeWidgetArea = activeWidgetArea.split(","); return _.map(activeWidgetArea, function(item){ return { id: item, widgets: [] } }); } export const toWidgetAreaStructure = (widgets, value) => { /* * value: value from database */ let _widgetAreas = []; _.forIn(value, (val, key) => { _widgetAreas.push({ id: key, widgets: _.map(val, v => ({ id: v.id, widget: _.find(widgets, e => e.node.item === v.widget).node })) }) }); return _widgetAreas } export const validateUrl = (value) => { /* * console.log(validateUrl("eeehttp://google.com")) * console.log(validateUrl("https://google.com")) * console.log(validateUrl("https:///google.com")) * console.log(validateUrl("http:/google.com")) * console.log(validateUrl("http//google.com")) * console.log(validateUrl("http:google.com")) * console.log(validateUrl("google.com")) * * output: * http://google.com * https://google.com * https://google.com * http://google.com * http://google.com * http://google.com * http://google.com */ if (value.search(/https?:\/{3,}/) >= 0) { return value.replace(/(https?:\/\/)\/{0,}(\w*)/, '$1$2') } else if (value.search(/https?:\/{2,2}/) >= 0){ return value.replace(/.*(https?:\/\/)(\w*)/, '$1$2') } else if (value.search(/https?:?\/{0,2}?/) >= 0){ return value.replace(/(https?):?\/{0,2}(\w*)/, '$1://$2') } else { return "http://" + value } } export const modifyApolloCache = (queryParam, client, modifier) => { let data = client.readQuery(queryParam) let modified = _.partial(modifier, data)() client.writeQuery({...queryParam, data: modified}) } export function connectWithStore(store, WrappedComponent, ...args) { var ConnectedWrappedComponent = connect(...args)(WrappedComponent) return function (props) { return <ConnectedWrappedComponent {...props} store={store} /> } } export const setProfile = (p) => { var meta = {} var metaList = AdminConfig.userMetaList; var metaIdList = {}; _.forEach(metaList, function(item){ meta[item] = _.find(p.meta.edges, {"node": {"item": item}}); metaIdList[item] = meta[item]?meta[item].node.id:null; }) var roleList = []; _.forEach(p.roles.edges, function(item){ roleList.push(item.node.name) }) var profile = { name: p.fullName?p.fullName:p.username, username: p.username, email: p.email, gender: p.gender, image: p.image, lastLogin: p.lastLogin, createdAt: p.createdAt, biography: meta["bio"]?meta["bio"].node.value:"", dateOfBirth: p.dateOfBirth?p.dateOfBirth:"", phone: meta["phone"]?meta["phone"].node.value:"", country: p.country?p.country:"", timezone: meta["timezone"]?meta["timezone"].node.value:"", website: meta["website"]?meta["website"].node.value:"", facebook: meta["facebook"]?meta["facebook"].node.value:"", twitter: meta["twitter"]?meta["twitter"].node.value:"", linkedin: meta["linkedin"]?meta["linkedin"].node.value:"", userPrefConfig: meta["userPrefConfig"]?meta["userPrefConfig"].node.value:"", roles: roleList } localStorage.setItem("userId", p.id); localStorage.setItem('profile', JSON.stringify(profile)); localStorage.setItem('metaIdList', JSON.stringify(metaIdList)); if (meta["userPrefConfig"]){ _.forEach(JSON.parse(meta["userPrefConfig"].node.value), function(value, key){ localStorage.setItem(key, value); }); } }
src/components/Sigmet/SigmetEditMode.spec.js
KNMI/GeoWeb-FrontEnd
import React from 'react'; import SigmetEditMode from './SigmetEditMode'; import { mount, shallow } from 'enzyme'; import { Button } from 'reactstrap'; describe('(Component) SigmetEditMode', () => { it('mount renders a SigmetEditMode', () => { const sigmet = { phenomenon: 'TEST', levelinfo: { levels: [{ unit: 'FL', value: 4 }, { unit: 'M', value: 4 }] }, va_extra_fields: { volcano: {} } }; const abilities = { isClearable: true, isDiscardable: true, isPastable: true, isSavable: true }; const actions = { verifySigmetAction: () => {} }; const dispatch = () => {}; const _component = mount(<SigmetEditMode availablePhenomena={[]} availableFirs={[]} sigmet={sigmet} abilities={abilities} actions={actions} dispatch={dispatch} />); expect(_component.type()).to.eql(SigmetEditMode); }); it('shallow renders a ReactStrap Button', () => { const sigmet = { phenomenon: 'TEST', levelinfo: { levels: [{ unit: 'FL', value: 4 }, { unit: 'M', value: 4 }] }, va_extra_fields: { volcano: {} } }; const abilities = { isClearable: true, isDiscardable: true, isPastable: true, isSavable: true }; const actions = { verifySigmetAction: () => {} }; const dispatch = () => {}; const _component = shallow(<SigmetEditMode availablePhenomena={[]} availableFirs={[]} sigmet={sigmet} abilities={abilities} actions={actions} dispatch={dispatch} />); expect(_component.type()).to.eql(Button); }); });
ajax/libs/material-ui/5.0.0-beta.1/node/StepConnector/StepConnector.js
cdnjs/cdnjs
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var React = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _clsx = _interopRequireDefault(require("clsx")); var _unstyled = require("@material-ui/unstyled"); var _capitalize = _interopRequireDefault(require("../utils/capitalize")); var _styled = _interopRequireDefault(require("../styles/styled")); var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps")); var _StepperContext = _interopRequireDefault(require("../Stepper/StepperContext")); var _StepContext = _interopRequireDefault(require("../Step/StepContext")); var _stepConnectorClasses = require("./stepConnectorClasses"); var _jsxRuntime = require("react/jsx-runtime"); const _excluded = ["className"]; function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } const useUtilityClasses = styleProps => { const { classes, orientation, alternativeLabel, active, completed, disabled } = styleProps; const slots = { root: ['root', orientation, alternativeLabel && 'alternativeLabel', active && 'active', completed && 'completed', disabled && 'disabled'], line: ['line', `line${(0, _capitalize.default)(orientation)}`] }; return (0, _unstyled.unstable_composeClasses)(slots, _stepConnectorClasses.getStepConnectorUtilityClass, classes); }; const StepConnectorRoot = (0, _styled.default)('div', { name: 'MuiStepConnector', slot: 'Root', overridesResolver: (props, styles) => { const { styleProps } = props; return [styles.root, styles[styleProps.orientation], styleProps.alternativeLabel && styles.alternativeLabel, styleProps.completed && styles.completed]; } })(({ styleProps }) => (0, _extends2.default)({ /* Styles applied to the root element. */ flex: '1 1 auto' }, styleProps.orientation === 'vertical' && { marginLeft: 12 // half icon }, styleProps.alternativeLabel && { position: 'absolute', top: 8 + 4, left: 'calc(-50% + 20px)', right: 'calc(50% + 20px)' })); const StepConnectorLine = (0, _styled.default)('span', { name: 'MuiStepConnector', slot: 'Line', overridesResolver: (props, styles) => { const { styleProps } = props; return [styles.line, styles[`line${(0, _capitalize.default)(styleProps.orientation)}`]]; } })(({ styleProps, theme }) => (0, _extends2.default)({ /* Styles applied to the line element. */ display: 'block', borderColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600] }, styleProps.orientation === 'horizontal' && { borderTopStyle: 'solid', borderTopWidth: 1 }, styleProps.orientation === 'vertical' && { borderLeftStyle: 'solid', borderLeftWidth: 1, minHeight: 24 })); const StepConnector = /*#__PURE__*/React.forwardRef(function StepConnector(inProps, ref) { const props = (0, _useThemeProps.default)({ props: inProps, name: 'MuiStepConnector' }); const { className } = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded); const { alternativeLabel, orientation = 'horizontal' } = React.useContext(_StepperContext.default); const { active, disabled, completed } = React.useContext(_StepContext.default); const styleProps = (0, _extends2.default)({}, props, { alternativeLabel, orientation, active, completed, disabled }); const classes = useUtilityClasses(styleProps); return /*#__PURE__*/(0, _jsxRuntime.jsx)(StepConnectorRoot, (0, _extends2.default)({ className: (0, _clsx.default)(classes.root, className), ref: ref, styleProps: styleProps }, other, { children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StepConnectorLine, { className: classes.line, styleProps: styleProps }) })); }); process.env.NODE_ENV !== "production" ? StepConnector.propTypes /* remove-proptypes */ = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * Override or extend the styles applied to the component. */ classes: _propTypes.default.object, /** * @ignore */ className: _propTypes.default.string, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: _propTypes.default.object } : void 0; var _default = StepConnector; exports.default = _default;
packages/material-ui-icons/src/PhonelinkTwoTone.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="M18 10h4v7h-4z" opacity=".3" /><path d="M4 6h18V4H4c-1.1 0-2 .9-2 2v11H0v3h14v-3H4V6z" /><path d="M23 8h-6c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1zm-1 9h-4v-7h4v7z" /></g></React.Fragment> , 'PhonelinkTwoTone');
examples/simple/src/index.js
one-market/appson
import * as R from 'ramda' import React from 'react' import { Routes, Route, Link, addState, addEffects } from '@onemarket/appson' import { AppContainer } from 'react-hot-loader' import main from './states/main' import logAction from './effects/log-action' import Home from './modules/Home' import Cart from './modules/Cart' import Products from './modules/Products' import NoMatch from './modules/NoMatch' const Simple = () => ( <AppContainer warnings={false}> <div> <h1>Simple</h1> <ul> <li> <Link to="/">Home</Link> </li> <li> <Link to="/products">Products</Link> </li> <li> <Link to="/cart">Cart</Link> </li> </ul> <Routes> <Route exact path="/" component={Home} /> <Route path="/products" component={Products} /> <Route path="/cart" component={Cart} /> <Route component={NoMatch} /> </Routes> </div> </AppContainer> ) const enhance = R.compose(addState(main), addEffects({ logAction })) export default enhance(Simple)
src/main/webapp/js/lib/createjs/jquery-1.8.3.min.js
it2l/it2l-platform
/*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<9 // For `typeof node.method` instead of `node.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) document = window.document, location = window.location, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.9.1", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // 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: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return 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 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 core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_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() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // 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 plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // 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 jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, 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 || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 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 || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; 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 retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( list && ( !fired || stack ) ) { if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function() { var support, all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Support tests won't run in some limited or non-browser environments all = div.getElementsByTagName("*"); a = div.getElementsByTagName("a")[ 0 ]; if ( !all || !a || !all.length ) { return {}; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; support = { // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) getSetAttribute: div.className !== "t", // 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 instead) style: /top/.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.5/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) checkOn: !!input.value, // 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: opt.selected, // Tests for enctype support on a form (#6743) enctype: !!document.createElement("form").enctype, // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode boxModel: document.compatMode === "CSS1Compat", // Will be defined later deleteExpando: true, noCloneEvent: true, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableMarginRight: true, boxSizingReliable: true, pixelPosition: false }; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior div.innerHTML = ""; div.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%;"; support.boxSizing = ( div.offsetWidth === 4 ); support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })(); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, ret, internalKey = jQuery.expando, getByName = typeof name === "string", // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { cache[ id ] = {}; // Avoids exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify if ( !isNode ) { cache[ id ].toJSON = jQuery.noop; } } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( getByName ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var i, l, thisCache, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } for ( i = 0, l = name.length; i < l; i++ ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) } else if ( jQuery.support.deleteExpando || cache != cache.window ) { delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, elem = this[0], i = 0, data = null; // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( !name.indexOf( "data-" ) ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return jQuery.access( this, function( value ) { if ( value === undefined ) { // Try to fetch any internally stored data first return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; } this.each(function() { jQuery.data( this, key, value ); }); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } hooks.cur = fn; if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // 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( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val, self = jQuery(this); if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, self.val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific 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; }, set: function( elem, value ) { var values = jQuery.makeArray( value ); jQuery(elem).find("option").each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, notxml, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); // All attributes are lowercase // Grab necessary hook if one is defined if ( notxml ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { // In IE9+, Flash objects don't have .getAttribute (#12945) // Support: IE9+ if ( typeof elem.getAttribute !== core_strundefined ) { ret = elem.getAttribute( name ); } // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( rboolean.test( name ) ) { // Set corresponding property to false for boolean attributes // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8 if ( !getSetAttribute && ruseDefault.test( name ) ) { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } else { elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, 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( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { return ( elem[ name ] = value ); } } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { return elem[ name ]; } } }, propHooks: { tabIndex: { get: function( elem ) { // 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/ var attributeNode = elem.getAttributeNode("tabindex"); return attributeNode && attributeNode.specified ? parseInt( attributeNode.value, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } } } }); // Hook for boolean attributes boolHook = { get: function( elem, name ) { var // Use .prop to determine if this attribute is understood as boolean prop = jQuery.prop( elem, name ), // Fetch it accordingly attr = typeof prop === "boolean" && elem.getAttribute( name ), detail = typeof prop === "boolean" ? getSetInput && getSetAttribute ? attr != null : // oldIE fabricates an empty string for missing boolean attributes // and conflates checked/selected into attroperties ruseDefault.test( name ) ? elem[ jQuery.camelCase( "default-" + name ) ] : !!attr : // fetch an attribute node for properties not recognized as boolean elem.getAttributeNode( name ); return detail && detail.value !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; // fix oldIE value attroperty if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return jQuery.nodeName( elem, "input" ) ? // Ignore the value *property* by using defaultValue elem.defaultValue : ret && ret.specified ? ret.value : undefined; }, set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ? ret.value : undefined; }, set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { get: nodeHook.get, set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }); }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { get: function( elem ) { var ret = elem.getAttribute( name, 2 ); return ret == null ? undefined : ret; } }); }); // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }); } // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter if ( !jQuery.support.checkOn ) { jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { get: function( elem ) { // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; } }; }); } jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }); }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/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 to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); event.isTrigger = true; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { for ( ; cur != this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } } }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== document.activeElement && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === document.activeElement && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ (function( window, undefined ) { var i, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, // Local document vars setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches, contains, sortOrder, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, support = {}, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Array methods arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors operators = "([*^$|!~]?=)", attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rsibling = /[\x20\t\r\n\f]*[+~]/, rnative = /^[^{]+\{\s*\[native code/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, funescape = function( _, escaped ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint return high !== high ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Use a stripped-down slice if we can't use a native one try { slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; } catch ( e ) { slice = function( i ) { var elem, results = []; while ( (elem = this[i++]) ) { results.push( elem ); } return results; }; } /** * For feature detection * @param {Function} fn The function to test for native support */ function isNative( fn ) { return rnative.test( fn + "" ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var cache, keys = []; return (cache = function( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); }); } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return fn( div ); } catch (e) { return false; } finally { // release memory in IE div = null; } } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( !documentIsXML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) { push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); return results; } } // QSA path if ( support.qsa && !rbuggyQSA.test(selector) ) { old = true; nid = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, slice.call( newContext.querySelectorAll( newSelector ), 0 ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsXML = isXML( doc ); // Check if getElementsByTagName("*") returns only elements support.tagNameNoComments = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if attributes should be retrieved by attribute nodes support.attributes = assert(function( div ) { div.innerHTML = "<select></select>"; var type = typeof div.lastChild.getAttribute("multiple"); // IE8 returns a string for some attributes even when not present return type !== "boolean" && type !== "string"; }); // Check if getElementsByClassName can be trusted support.getByClassName = assert(function( div ) { // Opera can't find a second classname (in 9.6) div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { return false; } // Safari 3.2 caches class attributes and doesn't catch changes div.lastChild.className = "e"; return div.getElementsByClassName("e").length === 2; }); // Check if getElementById returns elements by name // Check if getElementsByName privileges form controls or returns elements by ID support.getByName = assert(function( div ) { // Inject content div.id = expando + 0; div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; docElem.insertBefore( div, docElem.firstChild ); // Test var pass = doc.getElementsByName && // buggy browsers will return fewer than the correct 2 doc.getElementsByName( expando ).length === 2 + // buggy browsers will return more than the correct 0 doc.getElementsByName( expando + 0 ).length; support.getIdNotName = !doc.getElementById( expando ); // Cleanup docElem.removeChild( div ); return pass; }); // IE6/7 return modified attributes Expr.attrHandle = assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && div.firstChild.getAttribute("href") === "#"; }) ? {} : { "href": function( elem ) { return elem.getAttribute( "href", 2 ); }, "type": function( elem ) { return elem.getAttribute("type"); } }; // ID find and filter if ( support.getIdNotName ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && !documentIsXML ) { var m = context.getElementById( id ); return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? [m] : undefined : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.tagNameNoComments ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Name Expr.find["NAME"] = support.getByName && function( tag, context ) { if ( typeof context.getElementsByName !== strundefined ) { return context.getElementsByName( name ); } }; // Class Expr.find["CLASS"] = support.getByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) { return context.getElementsByClassName( className ); } }; // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21), // no need to also add to buggyMatches since matches checks buggyQSA // A support test would require too much code (would include document ready) rbuggyQSA = [ ":focus" ]; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explictly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // IE8 - Some boolean attributes are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Opera 10-12/IE8 - ^= $= *= and empty values // Should not select anything div.innerHTML = "<input type='hidden' i=''/>"; if ( div.querySelectorAll("[i^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = new RegExp( rbuggyMatches.join("|") ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { var compare; if ( a === b ) { hasDuplicate = true; return 0; } if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) { if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) { if ( a === doc || contains( preferredDoc, a ) ) { return -1; } if ( b === doc || contains( preferredDoc, b ) ) { return 1; } return 0; } return compare & 4 ? -1 : 1; } return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; // Always assume the presence of duplicates if sort doesn't // pass them to our comparison function (as in Google Chrome). hasDuplicate = false; [0, 0].sort( sortOrder ); support.detectDuplicates = hasDuplicate; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); // rbuggyQSA always contains :focus, so no need for an existence check if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { var val; // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } if ( !documentIsXML ) { name = name.toLowerCase(); } if ( (val = Expr.attrHandle[ name ]) ) { return val( elem ); } if ( documentIsXML || support.attributes ) { return elem.getAttribute( name ); } return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? name : val && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; // Document sorting and removing duplicates Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], i = 1, j = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; results.sort( sortOrder ); if ( hasDuplicate ) { for ( ; (elem = results[i]); i++ ) { if ( elem === results[ i - 1 ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; function siblingCheck( a, b ) { var cur = b && a, diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } // Returns a function to use in pseudos for input types function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } // Returns a function to use in pseudos for buttons function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } // Returns a function to use in pseudos for positionals function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[4] ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeName ) { if ( nodeName === "*" ) { return function() { return true; }; } nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); return function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifider if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsXML ? elem.getAttribute("xml:lang") || elem.getAttribute("lang") : elem.lang) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push( { value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push( { value: matched, type: type, matches: match } ); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && !documentIsXML && Expr.relative[ tokens[1].type ] ) { context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, slice.call( seed, 0 ) ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, documentIsXML, results, rsibling.test( selector ) ); return results; } // Deprecated Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Easy API for creating new setFilters function setFilters() {} Expr.filters = setFilters.prototype = Expr.pseudos; Expr.setFilters = new setFilters(); // Initialize with the default document setDocument(); // Override sizzle attribute retrieval Sizzle.attr = jQuery.attr; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); var runtil = /Until$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, isSimple = /^.[^:#\[\.,]*$/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret, self, len = this.length; if ( typeof selector !== "string" ) { self = this; return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } ret = []; for ( i = 0; i < len; i++ ) { jQuery.find( selector, this[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true) ); }, is: function( selector ) { return !!selector && ( typeof selector === "string" ? // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". rneedsContext.test( selector ) ? jQuery( selector, this.context ).index( this[0] ) >= 0 : jQuery.filter( selector, this ).length > 0 : this.filter( selector ).length > 0 ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { cur = this[i]; while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } cur = cur.parentNode; } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // 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 ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); jQuery.fn.andSelf = jQuery.fn.addBack; function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], 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 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; if ( this.length > 1 && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : 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; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { // Can't pass null or undefined to indexOf in Firefox 4 // Set to 0 to skip string check qualifier = qualifier || 0; if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem ) { 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 ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { 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>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, 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 ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : 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.nodeType === 11 || this.nodeType === 9 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, false, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function( value ) { var isFunc = jQuery.isFunction( value ); // 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 ( !isFunc && typeof value !== "string" ) { value = jQuery( value ).not( this ).detach(); } return this.domManip( [ value ], true, function( elem ) { var next = this.nextSibling, parent = this.parentNode; if ( parent ) { jQuery( this ).remove(); parent.insertBefore( elem, next ); } }); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, table ? self.html() : undefined ); } self.domManip( args, table, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( table && jQuery.nodeName( this[i], "table" ) ? findOrAppend( this[i], "tbody" ) : this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery.ajax({ url: node.src, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); function findOrAppend( elem, tag ) { return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { var attr = elem.getAttributeNode("type"); elem.type = ( attr && attr.specified ) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { var bool = typeof state === "boolean"; return this.each(function() { if ( bool ? state : isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Exclude the following css properties to add px cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // 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 // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // 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 ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } 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 contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.hover = function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }; var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, 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" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": window.String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) != ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // If successful, handle type chaining if ( status >= 200 && status < 300 || status === 304 ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 ) { isSuccess = true; statusText = "nocontent"; // if not modified } else if ( status === 304 ) { isSuccess = true; statusText = "notmodified"; // If we have data, let's convert it } else { isSuccess = ajaxConvert( s, response ); statusText = isSuccess.state; success = isSuccess.data; error = isSuccess.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); } }); /* Handles responses to an ajax request: * - sets all responseXXX fields accordingly * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields; // Fill responseXXX fields for ( type in responseFields ) { if ( type in responses ) { jqXHR[ responseFields[type] ] = responses[ type ]; } } // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } // Chain conversions given the request and the original response function ajaxConvert( s, response ) { var conv2, current, conv, tmp, converters = {}, i = 0, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(), prev = dataTypes[ 0 ]; // Apply the dataFilter if provided if ( s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } // Convert to each sequential dataType, tolerating list modification for ( ; (current = dataTypes[++i]); ) { // There's only work to do if current dataType is non-auto if ( current !== "*" ) { // Convert response if prev dataType is non-auto and differs from current if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split(" "); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.splice( i--, 0, current ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s["throws"] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } // Update prev for next iteration prev = current; } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var end, unit, tween = this.createTween( prop, value ), parts = rfxnum.exec( value ), target = tween.cur(), start = +target || 0, scale = 1, maxIterations = 20; if ( parts ) { end = +parts[2]; unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" && start ) { // Iteratively approximate from a nonzero starting point // Prefer the current property, because this process will be trivial if it uses the same units // Fallback to end or a simple constant start = jQuery.css( tween.elem, prop, true ) || end || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } tween.unit = unit; tween.start = start; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTweens( animation, props ) { jQuery.each( props, function( prop, value ) { var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( collection[ index ].call( animation, prop, value ) ) { // we're done with this property return; } } }); } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } createTweens( animation, props ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var value, name, index, easing, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /*jshint validthis:true */ var prop, index, length, value, dataShow, toggle, tween, hooks, oldfire, anim = this, style = elem.style, orig = {}, handled = [], hidden = elem.nodeType && isHidden( elem ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( index in props ) { value = props[ index ]; if ( rfxtypes.exec( value ) ) { delete props[ index ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } handled.push( index ); } } length = handled.length; if ( length ) { dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( index = 0 ; index < length ; index++ ) { prop = handled[ index ]; tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Remove in 2.0 - this supports IE8's panic based approach // to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); doAnimation.finish = function() { anim.stop( true ); }; // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.cur && hooks.cur.finish ) { hooks.cur.finish.call( this ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, 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 : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.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; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and 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 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.documentElement; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || document.documentElement; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // })(); // Expose jQuery to the global object window.jQuery = window.$ = jQuery; // Expose jQuery as an AMD module, but only for AMD loaders that // understand the issues with loading multiple versions of jQuery // in a page that all might call define(). The loader will indicate // they have special allowances for multiple jQuery versions by // specifying define.amd.jQuery = true. Register as a named module, // since jQuery can be concatenated with other files that may use define, // but not use a proper concatenation script that understands anonymous // AMD modules. A named AMD is safest and most robust way to register. // Lowercase jquery is used because AMD module names are derived from // file names, and jQuery is normally delivered in a lowercase file name. // Do this after creating the global so that if an AMD module wants to call // noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd && define.amd.jQuery ) { define( "jquery", [], function () { return jQuery; } ); } })( window );
app/components/App.js
rfarine/ArtistRanking
import React from 'react'; import {RouteHandler} from 'react-router'; import Footer from './Footer'; import Navbar from './Navbar'; class App extends React.Component { render() { return ( <div> <Navbar /> <RouteHandler /> <Footer /> </div> ); } } export default App;
ajax/libs/forerunnerdb/1.3.711/fdb-core+views.min.js
dc-js/cdnjs
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("./core");a("../lib/View");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/View":33,"./core":2}],2:[function(a,b,c){var d=a("../lib/Core");a("../lib/Shim.IE8");"undefined"!=typeof window&&(window.ForerunnerDB=d),b.exports=d},{"../lib/Core":8,"../lib/Shim.IE8":32}],3:[function(a,b,c){"use strict";var d,e=a("./Shared"),f=a("./Path"),g=function(a){this._primaryKey="_id",this._keyArr=[],this._data=[],this._objLookup={},this._count=0,this._keyArr=d.parse(a,!0)};e.addModule("ActiveBucket",g),e.mixin(g.prototype,"Mixin.Sorting"),d=new f,e.synthesize(g.prototype,"primaryKey"),g.prototype.qs=function(a,b,c,d){if(!b.length)return 0;for(var e,f,g,h=-1,i=0,j=b.length-1;j>=i&&(e=Math.floor((i+j)/2),h!==e);)f=b[e],void 0!==f&&(g=d(this,a,c,f),g>0&&(i=e+1),0>g&&(j=e-1)),h=e;return g>0?e+1:e},g.prototype._sortFunc=function(a,b,c,e){var f,g,h,i=c.split(".:."),j=e.split(".:."),k=a._keyArr,l=k.length;for(f=0;l>f;f++)if(g=k[f],h=typeof d.get(b,g.path),"number"===h&&(i[f]=Number(i[f]),j[f]=Number(j[f])),i[f]!==j[f]){if(1===g.value)return a.sortAsc(i[f],j[f]);if(-1===g.value)return a.sortDesc(i[f],j[f])}},g.prototype.insert=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c?(c=this.qs(a,this._data,b,this._sortFunc),this._data.splice(c,0,b)):this._data.splice(c,0,b),this._objLookup[a[this._primaryKey]]=b,this._count++,c},g.prototype.remove=function(a){var b,c;return b=this._objLookup[a[this._primaryKey]],b?(c=this._data.indexOf(b),c>-1?(this._data.splice(c,1),delete this._objLookup[a[this._primaryKey]],this._count--,!0):!1):!1},g.prototype.index=function(a){var b,c;return b=this.documentKey(a),c=this._data.indexOf(b),-1===c&&(c=this.qs(a,this._data,b,this._sortFunc)),c},g.prototype.documentKey=function(a){var b,c,e="",f=this._keyArr,g=f.length;for(b=0;g>b;b++)c=f[b],e&&(e+=".:."),e+=d.get(a,c.path);return e+=".:."+a[this._primaryKey]},g.prototype.count=function(){return this._count},e.finishModule("ActiveBucket"),b.exports=g},{"./Path":28,"./Shared":31}],4:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=new e,g=function(a,b,c){this.init.apply(this,arguments)};g.prototype.init=function(a,b,c,d,e){this._store=[],this._keys=[],void 0!==c&&this.primaryKey(c),void 0!==b&&this.index(b),void 0!==d&&this.compareFunc(d),void 0!==e&&this.hashFunc(e),void 0!==a&&this.data(a)},d.addModule("BinaryTree",g),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Sorting"),d.mixin(g.prototype,"Mixin.Common"),d.synthesize(g.prototype,"compareFunc"),d.synthesize(g.prototype,"hashFunc"),d.synthesize(g.prototype,"indexDir"),d.synthesize(g.prototype,"primaryKey"),d.synthesize(g.prototype,"keys"),d.synthesize(g.prototype,"index",function(a){return void 0!==a&&(this.debug()&&console.log("Setting index",a,f.parse(a,!0)),this.keys(f.parse(a,!0))),this.$super.call(this,a)}),g.prototype.clear=function(){delete this._data,delete this._left,delete this._right,this._store=[]},g.prototype.data=function(a){return void 0!==a?(this._data=a,this._hashFunc&&(this._hash=this._hashFunc(a)),this):this._data},g.prototype.push=function(a){return void 0!==a?(this._store.push(a),this):!1},g.prototype.pull=function(a){if(void 0!==a){var b=this._store.indexOf(a);if(b>-1)return this._store.splice(b,1),this}return!1},g.prototype._compareFunc=function(a,b){var c,d,e=0;for(c=0;c<this._keys.length;c++)if(d=this._keys[c],1===d.value?e=this.sortAsc(f.get(a,d.path),f.get(b,d.path)):-1===d.value&&(e=this.sortDesc(f.get(a,d.path),f.get(b,d.path))),this.debug()&&console.log("Compared %s with %s order %d in path %s and result was %d",f.get(a,d.path),f.get(b,d.path),d.value,d.path,e),0!==e)return this.debug()&&console.log("Retuning result %d",e),e;return this.debug()&&console.log("Retuning result %d",e),e},g.prototype._hashFunc=function(a){return a[this._keys[0].path]},g.prototype.removeChildNode=function(a){this._left===a?delete this._left:this._right===a&&delete this._right},g.prototype.nodeBranch=function(a){return this._left===a?"left":this._right===a?"right":void 0},g.prototype.insert=function(a){var b,c,d,e;if(a instanceof Array){for(c=[],d=[],e=0;e<a.length;e++)this.insert(a[e])?c.push(a[e]):d.push(a[e]);return{inserted:c,failed:d}}return this.debug()&&console.log("Inserting",a),this._data?(b=this._compareFunc(this._data,a),0===b?(this.debug()&&console.log("Data is equal (currrent, new)",this._data,a),this._left?this._left.insert(a):(this._left=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._left._parent=this),!0):-1===b?(this.debug()&&console.log("Data is greater (currrent, new)",this._data,a),this._right?this._right.insert(a):(this._right=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._right._parent=this),!0):1===b?(this.debug()&&console.log("Data is less (currrent, new)",this._data,a),this._left?this._left.insert(a):(this._left=new g(a,this._index,this._binaryTree,this._compareFunc,this._hashFunc),this._left._parent=this),!0):!1):(this.debug()&&console.log("Node has no data, setting data",a),this.data(a),!0)},g.prototype.remove=function(a){var b,c,d,e=this.primaryKey();if(a instanceof Array){for(c=[],d=0;d<a.length;d++)this.remove(a[d])&&c.push(a[d]);return c}return this.debug()&&console.log("Removing",a),this._data[e]===a[e]?this._remove(this):(b=this._compareFunc(this._data,a),-1===b&&this._right?this._right.remove(a):1===b&&this._left?this._left.remove(a):!1)},g.prototype._remove=function(a){var b,c;return this._left?(b=this._left,c=this._right,this._left=b._left,this._right=b._right,this._data=b._data,this._store=b._store,c&&(b.rightMost()._right=c)):this._right?(c=this._right,this._left=c._left,this._right=c._right,this._data=c._data,this._store=c._store):this.clear(),!0},g.prototype.leftMost=function(){return this._left?this._left.leftMost():this},g.prototype.rightMost=function(){return this._right?this._right.rightMost():this},g.prototype.lookup=function(a,b,c){var d=this._compareFunc(this._data,a);return c=c||[],0===d&&(this._left&&this._left.lookup(a,b,c),c.push(this._data),this._right&&this._right.lookup(a,b,c)),-1===d&&this._right&&this._right.lookup(a,b,c),1===d&&this._left&&this._left.lookup(a,b,c),c},g.prototype.inOrder=function(a,b){switch(b=b||[],this._left&&this._left.inOrder(a,b),a){case"hash":b.push(this._hash);break;case"data":b.push(this._data);break;default:b.push({key:this._data,arr:this._store})}return this._right&&this._right.inOrder(a,b),b},g.prototype.startsWith=function(a,b,c,d){var e,g,h=f.get(this._data,a),i=h.substr(0,b.length);return c=c||new RegExp("^"+b),d=d||[],void 0===d._visited&&(d._visited=0),d._visited++,g=this.sortAsc(h,b),e=i===b,0===g&&(this._left&&this._left.startsWith(a,b,c,d),e&&d.push(this._data),this._right&&this._right.startsWith(a,b,c,d)),-1===g&&(e&&d.push(this._data),this._right&&this._right.startsWith(a,b,c,d)),1===g&&(this._left&&this._left.startsWith(a,b,c,d),e&&d.push(this._data)),d},g.prototype.findRange=function(a,b,c,d,f,g){f=f||[],g=g||new e(b),this._left&&this._left.findRange(a,b,c,d,f,g);var h=g.value(this._data),i=this.sortAsc(h,c),j=this.sortAsc(h,d);if(!(0!==i&&1!==i||0!==j&&-1!==j))switch(a){case"hash":f.push(this._hash);break;case"data":f.push(this._data);break;default:f.push({key:this._data,arr:this._store})}return this._right&&this._right.findRange(a,b,c,d,f,g),f},g.prototype.match=function(a,b,c){var d,e,g,h=[],i=0;for(d=f.parseArr(this._index,{verbose:!0}),e=f.parseArr(a,c&&c.pathOptions?c.pathOptions:{ignore:/\$/,verbose:!0}),g=0;g<d.length;g++)e[g]===d[g]&&(i++,h.push(e[g]));return{matchedKeys:h,totalKeyCount:e.length,score:i}},d.finishModule("BinaryTree"),b.exports=g},{"./Path":28,"./Shared":31}],5:[function(a,b,c){"use strict";var d,e;d=function(){var a,b,c,d=[];for(b=0;256>b;b++){for(a=b,c=0;8>c;c++)a=1&a?3988292384^a>>>1:a>>>1;d[b]=a}return d}(),e=function(a){var b,c=-1;for(b=0;b<a.length;b++)c=c>>>8^d[255&(c^a.charCodeAt(b))];return(-1^c)>>>0},b.exports=e},{}],6:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n;d=a("./Shared");var o=function(a,b){this.init.apply(this,arguments)};o.prototype.init=function(a,b){this.sharedPathSolver=n,this._primaryKey="_id",this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._name=a,this._data=[],this._metrics=new f,this._options=b||{changeTimestamp:!1},this._options.db&&this.db(this._options.db),this._metaData={},this._deferQueue={insert:[],update:[],remove:[],upsert:[],async:[]},this._deferThreshold={insert:100,update:100,remove:100,upsert:100},this._deferTime={insert:1,update:1,remove:1,upsert:1},this._deferredCalls=!0,this.subsetOf(this)},d.addModule("Collection",o),d.mixin(o.prototype,"Mixin.Common"),d.mixin(o.prototype,"Mixin.Events"),d.mixin(o.prototype,"Mixin.ChainReactor"),d.mixin(o.prototype,"Mixin.CRUD"),d.mixin(o.prototype,"Mixin.Constants"),d.mixin(o.prototype,"Mixin.Triggers"),d.mixin(o.prototype,"Mixin.Sorting"),d.mixin(o.prototype,"Mixin.Matching"),d.mixin(o.prototype,"Mixin.Updating"),d.mixin(o.prototype,"Mixin.Tags"),f=a("./Metrics"),g=a("./KeyValueStore"),h=a("./Path"),i=a("./IndexHashMap"),j=a("./IndexBinaryTree"),k=a("./Index2d"),e=d.modules.Db,l=a("./Overload"),m=a("./ReactorIO"),n=new h,d.synthesize(o.prototype,"deferredCalls"),d.synthesize(o.prototype,"state"),d.synthesize(o.prototype,"name"),d.synthesize(o.prototype,"metaData"),d.synthesize(o.prototype,"capped"),d.synthesize(o.prototype,"cappedSize"),o.prototype._asyncPending=function(a){this._deferQueue.async.push(a)},o.prototype._asyncComplete=function(a){for(var b=this._deferQueue.async.indexOf(a);b>-1;)this._deferQueue.async.splice(b,1),b=this._deferQueue.async.indexOf(a);0===this._deferQueue.async.length&&this.deferEmit("ready")},o.prototype.data=function(){return this._data},o.prototype.drop=function(a){var b;if(this.isDropped())return a&&a.call(this,!1,!0),!0;if(this._db&&this._db._collection&&this._name){if(this.debug()&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this.emit("drop",this),delete this._db._collection[this._name],this._collate)for(b in this._collate)this._collate.hasOwnProperty(b)&&this.collateRemove(b);return delete this._primaryKey,delete this._primaryIndex,delete this._primaryCrc,delete this._crcLookup,delete this._data,delete this._metrics,delete this._listeners,a&&a.call(this,!1,!0),!0}return a&&a.call(this,!1,!0),!1},o.prototype.primaryKey=function(a){if(void 0!==a){if(this._primaryKey!==a){var b=this._primaryKey;this._primaryKey=a,this._primaryIndex.primaryKey(a),this.rebuildPrimaryKeyIndex(),this.chainSend("primaryKey",{keyName:a,oldData:b})}return this}return this._primaryKey},o.prototype._onInsert=function(a,b){this.emit("insert",a,b)},o.prototype._onUpdate=function(a){this.emit("update",a)},o.prototype._onRemove=function(a){this.emit("remove",a)},o.prototype._onChange=function(){this._options.changeTimestamp&&(this._metaData.lastChange=this.serialiser.convert(new Date))},d.synthesize(o.prototype,"db",function(a){return a&&"_id"===this.primaryKey()&&(this.primaryKey(a.primaryKey()),this.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(o.prototype,"mongoEmulation"),o.prototype.setData=new l("Collection.prototype.setData",{"*":function(a){return this.$main.call(this,a,{})},"*, object":function(a,b){return this.$main.call(this,a,b)},"*, function":function(a,b){return this.$main.call(this,a,{},b)},"*, *, function":function(a,b,c){return this.$main.call(this,a,b,c)},"*, *, *":function(a,b,c){return this.$main.call(this,a,b,c)},$main:function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var d=this.deferredCalls(),e=[].concat(this._data);this.deferredCalls(!1),b=this.options(b),b.$decouple&&(a=this.decouple(a)),a instanceof Array||(a=[a]),this.remove({}),this.insert(a),this.deferredCalls(d),this._onChange(),this.emit("setData",this._data,e)}return c&&c.call(this),this}}),o.prototype.rebuildPrimaryKeyIndex=function(a){a=a||{$ensureKeys:void 0,$violationCheck:void 0};var b,c,d,e,f=a&&void 0!==a.$ensureKeys?a.$ensureKeys:!0,g=a&&void 0!==a.$violationCheck?a.$violationCheck:!0,h=this._primaryIndex,i=this._primaryCrc,j=this._crcLookup,k=this._primaryKey;for(h.truncate(),i.truncate(),j.truncate(),b=this._data,c=b.length;c--;){if(d=b[c],f&&this.ensurePrimaryKey(d),g){if(!h.uniqueSet(d[k],d))throw this.logIdentifier()+" Call to setData on collection failed because your data violates the primary key unique constraint. One or more documents are using the same primary key: "+d[this._primaryKey]}else h.set(d[k],d);e=this.hash(d),i.set(d[k],e),j.set(e,d)}},o.prototype.ensurePrimaryKey=function(a){void 0===a[this._primaryKey]&&(a[this._primaryKey]=this.objectId())},o.prototype.truncate=function(){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.emit("truncate",this._data),this._data.length=0,this._primaryIndex=new g("primary"),this._primaryCrc=new g("primaryCrc"),this._crcLookup=new g("crcLookup"),this._onChange(),this.emit("immediateChange",{type:"truncate"}),this.deferEmit("change",{type:"truncate"}),this},o.prototype.upsert=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";if(a){var c,d,e=this._deferQueue.upsert,f=this._deferThreshold.upsert,g={};if(a instanceof Array){if(this._deferredCalls&&a.length>f)return this._deferQueue.upsert=e.concat(a),this._asyncPending("upsert"),this.processQueue("upsert",b),{};for(g=[],d=0;d<a.length;d++)g.push(this.upsert(a[d]));return b&&b.call(this),g}switch(a[this._primaryKey]?(c={},c[this._primaryKey]=a[this._primaryKey],this._primaryIndex.lookup(c)[0]?g.op="update":g.op="insert"):g.op="insert",g.op){case"insert":g.result=this.insert(a,b);break;case"update":g.result=this.update(c,a,{},b)}return g}return b&&b.call(this),{}},o.prototype.filter=function(a,b,c){return this.find(a,c).filter(b)},o.prototype.filterUpdate=function(a,b,c){var d,e,f,g,h=this.find(a,c),i=[],j=this.primaryKey();for(g=0;g<h.length;g++)d=h[g],f=b(d),f&&(e={},e[j]=d[j],i.push(this.update(e,f)));return i},o.prototype.update=function(a,b,c,d){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return this.mongoEmulation()?(this.convertToFdb(a),this.convertToFdb(b)):b=this.decouple(b),b=this.transformIn(b),this._handleUpdate(a,b,c,d)},o.prototype._handleUpdate=function(a,b,c,d){var e,f,g=this,h=this._metrics.create("update"),i=function(d){var e,f,i,j=g.decouple(d);return g.willTrigger(g.TYPE_UPDATE,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_UPDATE,g.PHASE_AFTER)?(e=g.decouple(d),f={type:"update",query:g.decouple(a),update:g.decouple(b),options:g.decouple(c),op:h},i=g.updateObject(e,f.update,f.query,f.options,""),g.processTrigger(f,g.TYPE_UPDATE,g.PHASE_BEFORE,d,e)!==!1?(i=g.updateObject(d,e,f.query,f.options,""),g.processTrigger(f,g.TYPE_UPDATE,g.PHASE_AFTER,j,e)):i=!1):i=g.updateObject(d,b,a,c,""),g._updateIndexes(j,d),i};return h.start(),h.time("Retrieve documents to update"),e=this.find(a,{$decouple:!1}),h.time("Retrieve documents to update"),e.length&&(h.time("Update documents"),f=e.filter(i),h.time("Update documents"),f.length&&(this.debug()&&console.log(this.logIdentifier()+" Updated some data"),h.time("Resolve chains"),this.chainWillSend()&&this.chainSend("update",{query:a,update:b,dataSet:this.decouple(f)},c),h.time("Resolve chains"),this._onUpdate(f),this._onChange(),d&&d.call(this),this.emit("immediateChange",{type:"update",data:f}),this.deferEmit("change",{type:"update",data:f}))),h.stop(),f||[]},o.prototype._replaceObj=function(a,b){var c;this._removeFromIndexes(a);for(c in a)a.hasOwnProperty(c)&&delete a[c];for(c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);if(!this._insertIntoIndexes(a))throw this.logIdentifier()+" Primary key violation in update! Key violated: "+a[this._primaryKey];return this},o.prototype.updateById=function(a,b){var c={};return c[this._primaryKey]=a,this.update(c,b)[0]},o.prototype.updateObject=function(a,b,c,d,e,f){b=this.decouple(b),e=e||"","."===e.substr(0,1)&&(e=e.substr(1,e.length-1));var g,i,j,k,l,m,n,o,p,q,r,s,t=!1,u=!1;for(s in b)if(b.hasOwnProperty(s)){if(g=!1,"$"===s.substr(0,1))switch(s){case"$key":case"$index":case"$data":case"$min":case"$max":g=!0;break;case"$each":for(g=!0,k=b.$each.length,j=0;k>j;j++)u=this.updateObject(a,b.$each[j],c,d,e),u&&(t=!0);t=t||u;break;case"$replace":g=!0,n=b.$replace,o=this.primaryKey();for(m in a)a.hasOwnProperty(m)&&m!==o&&void 0===n[m]&&(this._updateUnset(a,m),t=!0);for(m in n)n.hasOwnProperty(m)&&m!==o&&(this._updateOverwrite(a,m,n[m]),t=!0);break;default:g=!0,u=this.updateObject(a,b[s],c,d,e,s),t=t||u}if(this._isPositionalKey(s)&&(g=!0,s=s.substr(0,s.length-2),p=new h(e+"."+s),a[s]&&a[s]instanceof Array&&a[s].length)){for(i=[],j=0;j<a[s].length;j++)this._match(a[s][j],p.value(c)[0],d,"",{})&&i.push(j);for(j=0;j<i.length;j++)u=this.updateObject(a[s][i[j]],b[s+".$"],c,d,e+"."+s,f),t=t||u}if(!g)if(f||"object"!=typeof b[s])switch(f){case"$inc":var v=!0;b[s]>0?b.$max&&a[s]>=b.$max&&(v=!1):b[s]<0&&b.$min&&a[s]<=b.$min&&(v=!1),v&&(this._updateIncrement(a,s,b[s]),t=!0);break;case"$cast":switch(b[s]){case"array":a[s]instanceof Array||(this._updateProperty(a,s,b.$data||[]),t=!0);break;case"object":(!(a[s]instanceof Object)||a[s]instanceof Array)&&(this._updateProperty(a,s,b.$data||{}),t=!0);break;case"number":"number"!=typeof a[s]&&(this._updateProperty(a,s,Number(a[s])),t=!0);break;case"string":"string"!=typeof a[s]&&(this._updateProperty(a,s,String(a[s])),t=!0);break;default:throw this.logIdentifier()+" Cannot update cast to unknown type: "+b[s]}break;case"$push":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot push to a key that is not an array! ("+s+")";if(void 0!==b[s].$position&&b[s].$each instanceof Array)for(l=b[s].$position,k=b[s].$each.length,j=0;k>j;j++)this._updateSplicePush(a[s],l+j,b[s].$each[j]);else if(b[s].$each instanceof Array)for(k=b[s].$each.length,j=0;k>j;j++)this._updatePush(a[s],b[s].$each[j]);else this._updatePush(a[s],b[s]);t=!0;break;case"$pull":if(a[s]instanceof Array){for(i=[],j=0;j<a[s].length;j++)this._match(a[s][j],b[s],d,"",{})&&i.push(j);for(k=i.length;k--;)this._updatePull(a[s],i[k]),t=!0}break;case"$pullAll":if(a[s]instanceof Array){if(!(b[s]instanceof Array))throw this.logIdentifier()+" Cannot pullAll without being given an array of values to pull! ("+s+")";if(i=a[s],k=i.length,k>0)for(;k--;){for(l=0;l<b[s].length;l++)i[k]===b[s][l]&&(this._updatePull(a[s],k),k--,t=!0);if(0>k)break}}break;case"$addToSet":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot addToSet on a key that is not an array! ("+s+")";var w,x,y,z,A=a[s],B=A.length,C=!0,D=d&&d.$addToSet;for(b[s].$key?(y=!1,z=new h(b[s].$key),x=z.value(b[s])[0],delete b[s].$key):D&&D.key?(y=!1,z=new h(D.key),x=z.value(b[s])[0]):(x=this.jStringify(b[s]),y=!0),w=0;B>w;w++)if(y){if(this.jStringify(A[w])===x){C=!1;break}}else if(x===z.value(A[w])[0]){C=!1;break}C&&(this._updatePush(a[s],b[s]),t=!0);break;case"$splicePush":if(void 0===a[s]&&this._updateProperty(a,s,[]),!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot splicePush with a key that is not an array! ("+s+")";if(l=b.$index,void 0===l)throw this.logIdentifier()+" Cannot splicePush without a $index integer value!";delete b.$index,l>a[s].length&&(l=a[s].length),this._updateSplicePush(a[s],l,b[s]),t=!0;break;case"$move":if(!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot move on a key that is not an array! ("+s+")";for(j=0;j<a[s].length;j++)if(this._match(a[s][j],b[s],d,"",{})){var E=b.$index;if(void 0===E)throw this.logIdentifier()+" Cannot move without a $index integer value!";delete b.$index,this._updateSpliceMove(a[s],j,E),t=!0;break}break;case"$mul":this._updateMultiply(a,s,b[s]),t=!0;break;case"$rename":this._updateRename(a,s,b[s]),t=!0;break;case"$overwrite":this._updateOverwrite(a,s,b[s]),t=!0;break;case"$unset":this._updateUnset(a,s),t=!0;break;case"$clear":this._updateClear(a,s),t=!0;break;case"$pop":if(!(a[s]instanceof Array))throw this.logIdentifier()+" Cannot pop from a key that is not an array! ("+s+")";this._updatePop(a[s],b[s])&&(t=!0);break;case"$toggle":this._updateProperty(a,s,!a[s]),t=!0;break;default:a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0)}else if(null!==a[s]&&"object"==typeof a[s])if(q=a[s]instanceof Array,r=b[s]instanceof Array,q||r)if(!r&&q)for(j=0;j<a[s].length;j++)u=this.updateObject(a[s][j],b[s],c,d,e+"."+s,f),t=t||u;else a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0);else u=this.updateObject(a[s],b[s],c,d,e+"."+s,f),t=t||u;else a[s]!==b[s]&&(this._updateProperty(a,s,b[s]),t=!0)}return t},o.prototype._isPositionalKey=function(a){return".$"===a.substr(a.length-2,2)},o.prototype.remove=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f,g,h,i,j,k,l=this;if("function"==typeof b&&(c=b,b={}),this.mongoEmulation()&&this.convertToFdb(a),a instanceof Array){for(g=[],f=0;f<a.length;f++)g.push(this.remove(a[f],{noEmit:!0}));return(!b||b&&!b.noEmit)&&this._onRemove(g),c&&c.call(this,!1,g),g}if(g=[],d=this.find(a,{$decouple:!1}),d.length){h=function(a){l._removeFromIndexes(a),e=l._data.indexOf(a),l._dataRemoveAtIndex(e),g.push(a)};for(var m=0;m<d.length;m++)j=d[m],l.willTrigger(l.TYPE_REMOVE,l.PHASE_BEFORE)||l.willTrigger(l.TYPE_REMOVE,l.PHASE_AFTER)?(i={type:"remove"},k=l.decouple(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_BEFORE,k,k)!==!1&&(h(j),l.processTrigger(i,l.TYPE_REMOVE,l.PHASE_AFTER,k,k))):h(j);g.length&&(l.chainSend("remove",{query:a,dataSet:g},b),(!b||b&&!b.noEmit)&&this._onRemove(g),this._onChange(),this.emit("immediateChange",{type:"remove",data:g}),this.deferEmit("change",{type:"remove",data:g}))}return c&&c.call(this,!1,g),g},o.prototype.removeById=function(a){var b={};return b[this._primaryKey]=a,this.remove(b)[0]},o.prototype.processQueue=function(a,b,c){var d,e,f=this,g=this._deferQueue[a],h=this._deferThreshold[a],i=this._deferTime[a];if(c=c||{deferred:!0},g.length){switch(d=g.length>h?g.splice(0,h):g.splice(0,g.length),e=f[a](d),a){case"insert":c.inserted=c.inserted||[],c.failed=c.failed||[],c.inserted=c.inserted.concat(e.inserted),c.failed=c.failed.concat(e.failed)}setTimeout(function(){f.processQueue.call(f,a,b,c)},i)}else b&&b.call(this,c),this._asyncComplete(a);this.isProcessingQueue()||this.deferEmit("queuesComplete")},o.prototype.isProcessingQueue=function(){var a;for(a in this._deferQueue)if(this._deferQueue.hasOwnProperty(a)&&this._deferQueue[a].length)return!0;return!1},o.prototype.insert=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";return"function"==typeof b?(c=b,b=this._data.length):void 0===b&&(b=this._data.length),a=this.transformIn(a),this._insertHandle(a,b,c)},o.prototype._insertHandle=function(a,b,c){var d,e,f,g=this._deferQueue.insert,h=this._deferThreshold.insert,i=[],j=[];if(a instanceof Array){if(this._deferredCalls&&a.length>h)return this._deferQueue.insert=g.concat(a),this._asyncPending("insert"),void this.processQueue("insert",c);for(f=0;f<a.length;f++)d=this._insert(a[f],b+f),d===!0?i.push(a[f]):j.push({doc:a[f],reason:d})}else d=this._insert(a,b),d===!0?i.push(a):j.push({doc:a,reason:d});return e={deferred:!1,inserted:i,failed:j},this._onInsert(i,j),c&&c.call(this,e),this._onChange(),this.emit("immediateChange",{type:"insert",data:i}),this.deferEmit("change",{type:"insert",data:i}),e},o.prototype._insert=function(a,b){if(a){var c,d,e,f,g=this,h=this.capped(),i=this.cappedSize();if(this.ensurePrimaryKey(a),c=this.insertIndexViolation(a),e=function(a){g._insertIntoIndexes(a),b>g._data.length&&(b=g._data.length),g._dataInsertAtIndex(b,a),h&&g._data.length>i&&g.removeById(g._data[0][g._primaryKey]),g.chainWillSend()&&g.chainSend("insert",{dataSet:g.decouple([a])},{index:b})},c)return"Index violation in index: "+c;if(g.willTrigger(g.TYPE_INSERT,g.PHASE_BEFORE)||g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)){if(d={type:"insert"},g.processTrigger(d,g.TYPE_INSERT,g.PHASE_BEFORE,{},a)===!1)return"Trigger cancelled operation";e(a),g.willTrigger(g.TYPE_INSERT,g.PHASE_AFTER)&&(f=g.decouple(a),g.processTrigger(d,g.TYPE_INSERT,g.PHASE_AFTER,{},f))}else e(a);return!0}return"No document passed to insert"},o.prototype._dataInsertAtIndex=function(a,b){this._data.splice(a,0,b)},o.prototype._dataRemoveAtIndex=function(a){this._data.splice(a,1)},o.prototype._dataReplace=function(a){for(;this._data.length;)this._data.pop();this._data=this._data.concat(a)},o.prototype._insertIntoIndexes=function(a){var b,c,d=this._indexByName,e=this.hash(a),f=this._primaryKey;c=this._primaryIndex.uniqueSet(a[f],a),this._primaryCrc.uniqueSet(a[f],e),this._crcLookup.uniqueSet(e,a);for(b in d)d.hasOwnProperty(b)&&d[b].insert(a);return c},o.prototype._removeFromIndexes=function(a){var b,c=this._indexByName,d=this.hash(a),e=this._primaryKey;this._primaryIndex.unSet(a[e]),this._primaryCrc.unSet(a[e]),this._crcLookup.unSet(d);for(b in c)c.hasOwnProperty(b)&&c[b].remove(a)},o.prototype._updateIndexes=function(a,b){this._removeFromIndexes(a),this._insertIntoIndexes(b)},o.prototype._rebuildIndexes=function(){var a,b=this._indexByName;for(a in b)b.hasOwnProperty(a)&&b[a].rebuild()},o.prototype.subset=function(a,b){var c,d=this.find(a,b);return c=new o,c.db(this._db),c.subsetOf(this).primaryKey(this._primaryKey).setData(d),c},d.synthesize(o.prototype,"subsetOf"),o.prototype.isSubsetOf=function(a){return this._subsetOf===a},o.prototype.distinct=function(a,b,c){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";var d,e,f=this.find(b,c),g=new h(a),i={},j=[];for(e=0;e<f.length;e++)d=g.value(f[e])[0],d&&!i[d]&&(i[d]=!0,j.push(d));return j},o.prototype.findById=function(a,b){var c={};return c[this._primaryKey]=a,this.find(c,b)[0]},o.prototype.peek=function(a,b){var c,d,e=this._data,f=e.length,g=new o,h=typeof a;if("string"===h){for(c=0;f>c;c++)d=this.jStringify(e[c]),d.indexOf(a)>-1&&g.insert(e[c]);return g.find({},b)}return this.find(a,b)},o.prototype.explain=function(a,b){var c=this.find(a,b);return c.__fdbOp._data},o.prototype.options=function(a){return a=a||{},a.$decouple=void 0!==a.$decouple?a.$decouple:!0,a.$explain=void 0!==a.$explain?a.$explain:!1,a},o.prototype.find=function(a,b,c){return this.mongoEmulation()&&this.convertToFdb(a),c?(c.call(this,"Callbacks for the find() operation are not yet implemented!",[]),[]):this._find.call(this,a,b,c)},o.prototype._find=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";a=a||{};var c,d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this._metrics.create("find"),y=this.primaryKey(),z=this,A=!0,B={},C=[],D=[],E=[],F={},G={};if(b instanceof Array||(b=this.options(b)),w=function(c){return z._match(c,a,b,"and",F)},x.start(),a){if(a instanceof Array){for(v=this,n=0;n<a.length;n++)v=v.subset(a[n],b&&b[n]?b[n]:{});return v.find()}if(a.$findSub){if(!a.$findSub.$path)throw"$findSub missing $path property!";return this.findSub(a.$findSub.$query,a.$findSub.$path,a.$findSub.$subQuery,a.$findSub.$subOptions)}if(a.$findSubOne){if(!a.$findSubOne.$path)throw"$findSubOne missing $path property!";return this.findSubOne(a.$findSubOne.$query,a.$findSubOne.$path,a.$findSubOne.$subQuery,a.$findSubOne.$subOptions)}if(x.time("analyseQuery"),c=this._analyseQuery(z.decouple(a),b,x),x.time("analyseQuery"),x.data("analysis",c),c.hasJoin&&c.queriesJoin){for(x.time("joinReferences"),f=0;f<c.joinsOn.length;f++)m=c.joinsOn[f],j=m.key,k=m.type,l=m.id,i=new h(c.joinQueries[j]),g=i.value(a)[0],B[l]=this._db[k](j).subset(g),delete a[c.joinQueries[j]];x.time("joinReferences")}if(c.indexMatch.length&&(!b||b&&!b.$skipIndex)?(x.data("index.potential",c.indexMatch),x.data("index.used",c.indexMatch[0].index),x.time("indexLookup"),e=c.indexMatch[0].lookup||[],x.time("indexLookup"),c.indexMatch[0].keyData.totalKeyCount===c.indexMatch[0].keyData.score&&(A=!1)):x.flag("usedIndex",!1),A&&(e&&e.length?(d=e.length,x.time("tableScan: "+d),e=e.filter(w)):(d=this._data.length,x.time("tableScan: "+d),e=this._data.filter(w)),x.time("tableScan: "+d)),b.$orderBy&&(x.time("sort"),e=this.sort(b.$orderBy,e),x.time("sort")),void 0!==b.$page&&void 0!==b.$limit&&(G.page=b.$page,G.pages=Math.ceil(e.length/b.$limit),G.records=e.length,b.$page&&b.$limit>0&&(x.data("cursor",G),e.splice(0,b.$page*b.$limit))),b.$skip&&(G.skip=b.$skip,e.splice(0,b.$skip),x.data("skip",b.$skip)),b.$limit&&e&&e.length>b.$limit&&(G.limit=b.$limit,e.length=b.$limit,x.data("limit",b.$limit)),b.$decouple&&(x.time("decouple"),e=this.decouple(e),x.time("decouple"),x.data("flag.decouple",!0)),b.$join&&(C=C.concat(this.applyJoin(e,b.$join,B)),x.data("flag.join",!0)),C.length&&(x.time("removalQueue"),this.spliceArrayByIndexList(e,C),x.time("removalQueue")),b.$transform){for(x.time("transform"),n=0;n<e.length;n++)e.splice(n,1,b.$transform(e[n]));x.time("transform"),x.data("flag.transform",!0)}this._transformEnabled&&this._transformOut&&(x.time("transformOut"),e=this.transformOut(e),x.time("transformOut")),x.data("results",e.length)}else e=[];if(!b.$aggregate){x.time("scanFields");for(n in b)b.hasOwnProperty(n)&&0!==n.indexOf("$")&&(1===b[n]?D.push(n):0===b[n]&&E.push(n));if(x.time("scanFields"),D.length||E.length){for(x.data("flag.limitFields",!0),x.data("limitFields.on",D),x.data("limitFields.off",E),x.time("limitFields"),n=0;n<e.length;n++){t=e[n];for(o in t)t.hasOwnProperty(o)&&(D.length&&o!==y&&-1===D.indexOf(o)&&delete t[o],E.length&&E.indexOf(o)>-1&&delete t[o])}x.time("limitFields")}if(b.$elemMatch){x.data("flag.elemMatch",!0),x.time("projection-elemMatch");for(n in b.$elemMatch)if(b.$elemMatch.hasOwnProperty(n))for(q=new h(n),o=0;o<e.length;o++)if(r=q.value(e[o])[0],r&&r.length)for(p=0;p<r.length;p++)if(z._match(r[p],b.$elemMatch[n],b,"",{})){q.set(e[o],n,[r[p]]);break}x.time("projection-elemMatch")}if(b.$elemsMatch){x.data("flag.elemsMatch",!0),x.time("projection-elemsMatch");for(n in b.$elemsMatch)if(b.$elemsMatch.hasOwnProperty(n))for(q=new h(n),o=0;o<e.length;o++)if(r=q.value(e[o])[0],r&&r.length){for(s=[],p=0;p<r.length;p++)z._match(r[p],b.$elemsMatch[n],b,"",{})&&s.push(r[p]);q.set(e[o],n,s)}x.time("projection-elemsMatch")}}return b.$aggregate&&(x.data("flag.aggregate",!0),x.time("aggregate"),u=new h(b.$aggregate),e=u.value(e),x.time("aggregate")),x.stop(),e.__fdbOp=x,e.$cursor=G,e},o.prototype.findOne=function(){return this.find.apply(this,arguments)[0]},o.prototype.indexOf=function(a,b){var c,d=this.find(a,{$decouple:!1})[0];return d?!b||b&&!b.$orderBy?this._data.indexOf(d):(b.$decouple=!1,c=this.find(a,b),c.indexOf(d)):-1},o.prototype.indexOfDocById=function(a,b){var c,d;return c="object"!=typeof a?this._primaryIndex.get(a):this._primaryIndex.get(a[this._primaryKey]),c?!b||b&&!b.$orderBy?this._data.indexOf(c):(b.$decouple=!1,d=this.find({},b),d.indexOf(c)):-1},o.prototype.removeByIndex=function(a){var b,c;return b=this._data[a],void 0!==b?(b=this.decouple(b),c=b[this.primaryKey()],this.removeById(c)):!1},o.prototype.transform=function(a){return void 0!==a?("object"==typeof a?(void 0!==a.enabled&&(this._transformEnabled=a.enabled),void 0!==a.dataIn&&(this._transformIn=a.dataIn),void 0!==a.dataOut&&(this._transformOut=a.dataOut)):this._transformEnabled=a!==!1,this):{enabled:this._transformEnabled,dataIn:this._transformIn,dataOut:this._transformOut}},o.prototype.transformIn=function(a){if(this._transformEnabled&&this._transformIn){if(a instanceof Array){var b,c,d=[];for(c=0;c<a.length;c++)b=this._transformIn(a[c]), b instanceof Array?d=d.concat(b):d.push(b);return d}return this._transformIn(a)}return a},o.prototype.transformOut=function(a){if(this._transformEnabled&&this._transformOut){if(a instanceof Array){var b,c,d=[];for(c=0;c<a.length;c++)b=this._transformOut(a[c]),b instanceof Array?d=d.concat(b):d.push(b);return d}return this._transformOut(a)}return a},o.prototype.sort=function(a,b){var c=this,d=n.parse(a,!0);return d.length&&b.sort(function(a,b){var e,f,g=0;for(e=0;e<d.length;e++)if(f=d[e],1===f.value?g=c.sortAsc(n.get(a,f.path),n.get(b,f.path)):-1===f.value&&(g=c.sortDesc(n.get(a,f.path),n.get(b,f.path))),0!==g)return g;return g}),b},o.prototype._sort=function(a,b){var c,d=this,e=new h,f=e.parse(a,!0)[0];if(e.path(f.path),1===f.value)c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortAsc(c,f)};else{if(-1!==f.value)throw this.logIdentifier()+" $orderBy clause has invalid direction: "+f.value+", accepted values are 1 or -1 for ascending or descending!";c=function(a,b){var c=e.value(a)[0],f=e.value(b)[0];return d.sortDesc(c,f)}}return b.sort(c)},o.prototype._analyseQuery=function(a,b,c){var d,e,f,g,i,j,k,l,m,n,o,p,q,r,s,t,u={queriesOn:[{id:"$collection."+this._name,type:"colletion",key:this._name}],indexMatch:[],hasJoin:!1,queriesJoin:!1,joinQueries:{},query:a,options:b},v=[],w=[];if(c.time("checkIndexes"),p=new h,q=p.parseArr(a,{ignore:/\$/,verbose:!0}).length){void 0!==a[this._primaryKey]&&(r=typeof a[this._primaryKey],("string"===r||"number"===r||a[this._primaryKey]instanceof Array)&&(c.time("checkIndexMatch: Primary Key"),s=this._primaryIndex.lookup(a,b),u.indexMatch.push({lookup:s,keyData:{matchedKeys:[this._primaryKey],totalKeyCount:q,score:1},index:this._primaryIndex}),c.time("checkIndexMatch: Primary Key")));for(t in this._indexById)if(this._indexById.hasOwnProperty(t)&&(m=this._indexById[t],n=m.name(),c.time("checkIndexMatch: "+n),l=m.match(a,b),l.score>0&&(o=m.lookup(a,b),u.indexMatch.push({lookup:o,keyData:l,index:m})),c.time("checkIndexMatch: "+n),l.score===q))break;c.time("checkIndexes"),u.indexMatch.length>1&&(c.time("findOptimalIndex"),u.indexMatch.sort(function(a,b){return a.keyData.score>b.keyData.score?-1:a.keyData.score<b.keyData.score?1:a.keyData.score===b.keyData.score?a.lookup.length-b.lookup.length:void 0}),c.time("findOptimalIndex"))}if(b.$join){for(u.hasJoin=!0,d=0;d<b.$join.length;d++)for(e in b.$join[d])b.$join[d].hasOwnProperty(e)&&(i=b.$join[d][e],f=i.$sourceType||"collection",g="$"+f+"."+e,v.push({id:g,type:f,key:e}),void 0!==b.$join[d][e].$as?w.push(b.$join[d][e].$as):w.push(e));for(k=0;k<w.length;k++)j=this._queryReferencesSource(a,w[k],""),j&&(u.joinQueries[v[k].key]=j,u.queriesJoin=!0);u.joinsOn=v,u.queriesOn=u.queriesOn.concat(v)}return u},o.prototype._queryReferencesSource=function(a,b,c){var d;for(d in a)if(a.hasOwnProperty(d)){if(d===b)return c&&(c+="."),c+d;if("object"==typeof a[d])return c&&(c+="."),c+=d,this._queryReferencesSource(a[d],b,c)}return!1},o.prototype.count=function(a,b){return a?this.find(a,b).length:this._data.length},o.prototype.findSub=function(a,b,c,d){return this._findSub(this.find(a),b,c,d)},o.prototype._findSub=function(a,b,c,d){var e,f,g,i=new h(b),j=a.length,k=new o("__FDB_temp_"+this.objectId()).db(this._db),l={parents:j,subDocTotal:0,subDocs:[],pathFound:!1,err:""};for(d=d||{},e=0;j>e;e++)if(f=i.value(a[e])[0]){if(k.setData(f),g=k.find(c,d),d.returnFirst&&g.length)return g[0];d.$split?l.subDocs.push(g):l.subDocs=l.subDocs.concat(g),l.subDocTotal+=g.length,l.pathFound=!0}return k.drop(),l.pathFound||(l.err="No objects found in the parent documents with a matching path of: "+b),d.$stats?l:l.subDocs},o.prototype.findSubOne=function(a,b,c,d){return this.findSub(a,b,c,d)[0]},o.prototype.insertIndexViolation=function(a){var b,c,d,e=this._indexByName;if(this._primaryIndex.get(a[this._primaryKey]))b=this._primaryIndex;else for(c in e)if(e.hasOwnProperty(c)&&(d=e[c],d.unique()&&d.violation(a))){b=d;break}return b?b.name():!1},o.prototype.ensureIndex=function(a,b){if(this.isDropped())throw this.logIdentifier()+" Cannot operate in a dropped state!";this._indexByName=this._indexByName||{},this._indexById=this._indexById||{};var c,e={start:(new Date).getTime()};if(b)if(b.type){if(!d.index[b.type])throw this.logIdentifier()+' Cannot create index of type "'+b.type+'", type not found in the index type register (Shared.index)';c=new d.index[b.type](a,b,this)}else c=new i(a,b,this);else c=new i(a,b,this);return this._indexByName[c.name()]?{err:"Index with that name already exists"}:(c.rebuild(),this._indexByName[c.name()]=c,this._indexById[c.id()]=c,e.end=(new Date).getTime(),e.total=e.end-e.start,this._lastOp={type:"ensureIndex",stats:{time:e}},{index:c,id:c.id(),name:c.name(),state:c.state()})},o.prototype.index=function(a){return this._indexByName?this._indexByName[a]:void 0},o.prototype.lastOp=function(){return this._metrics.list()},o.prototype.diff=function(a){var b,c,d,e,f={insert:[],update:[],remove:[]},g=this.primaryKey();if(g!==a.primaryKey())throw this.logIdentifier()+" Diffing requires that both collections have the same primary key!";for(b=a._data;b&&!(b instanceof Array);)a=b,b=a._data;for(e=b.length,c=0;e>c;c++)d=b[c],this._primaryIndex.get(d[g])?this._primaryCrc.get(d[g])!==a._primaryCrc.get(d[g])&&f.update.push(d):f.insert.push(d);for(b=this._data,e=b.length,c=0;e>c;c++)d=b[c],a._primaryIndex.get(d[g])||f.remove.push(d);return f},o.prototype.collateAdd=new l("Collection.prototype.collateAdd",{"object, string":function(a,b){var c=this;c.collateAdd(a,function(d){var e,f;switch(d.type){case"insert":b?(e={$push:{}},e.$push[b]=c.decouple(d.data.dataSet),c.update({},e)):c.insert(d.data.dataSet);break;case"update":b?(e={},f={},e[b]=d.data.query,f[b+".$"]=d.data.update,c.update(e,f)):c.update(d.data.query,d.data.update);break;case"remove":b?(e={$pull:{}},e.$pull[b]={},e.$pull[b][c.primaryKey()]=d.data.dataSet[0][a.primaryKey()],c.update({},e)):c.remove(d.data.dataSet)}})},"object, function":function(a,b){if("string"==typeof a&&(a=this._db.collection(a,{autoCreate:!1,throwError:!1})),a)return this._collate=this._collate||{},this._collate[a.name()]=new m(a,this,b),this;throw"Cannot collate from a non-existent collection!"}}),o.prototype.collateRemove=function(a){if("object"==typeof a&&(a=a.name()),a)return this._collate[a].drop(),delete this._collate[a],this;throw"No collection name passed to collateRemove() or collection not found!"},e.prototype.collection=new l("Db.prototype.collection",{"":function(){return this.$main.call(this,{name:this.objectId()})},object:function(a){return a instanceof o?"droppped"!==a.state()?a:this.$main.call(this,{name:a.name()}):this.$main.call(this,a)},string:function(a){return this.$main.call(this,{name:a})},"string, string":function(a,b){return this.$main.call(this,{name:a,primaryKey:b})},"string, object":function(a,b){return b.name=a,this.$main.call(this,b)},"string, string, object":function(a,b,c){return c.name=a,c.primaryKey=b,this.$main.call(this,c)},$main:function(a){var b=this,c=a.name;if(c){if(this._collection[c])return this._collection[c];if(a&&a.autoCreate===!1){if(a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection "+c+" because it does not exist and auto-create has been disabled!";return}if(this.debug()&&console.log(this.logIdentifier()+" Creating collection "+c),this._collection[c]=this._collection[c]||new o(c,a).db(this),this._collection[c].mongoEmulation(this.mongoEmulation()),void 0!==a.primaryKey&&this._collection[c].primaryKey(a.primaryKey),void 0!==a.capped){if(void 0===a.size)throw this.logIdentifier()+" Cannot create a capped collection without specifying a size!";this._collection[c].capped(a.capped),this._collection[c].cappedSize(a.size)}return b._collection[c].on("change",function(){b.emit("change",b._collection[c],"collection",c)}),b.emit("create",b._collection[c],"collection",c),this._collection[c]}if(!a||a&&a.throwError!==!1)throw this.logIdentifier()+" Cannot get collection with undefined name!"}}),e.prototype.collectionExists=function(a){return Boolean(this._collection[a])},e.prototype.collections=function(a){var b,c,d=[],e=this._collection;a&&(a instanceof RegExp||(a=new RegExp(a)));for(c in e)e.hasOwnProperty(c)&&(b=e[c],a?a.exec(c)&&d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}):d.push({name:c,count:b.count(),linked:void 0!==b.isLinked?b.isLinked():!1}));return d.sort(function(a,b){return a.name.localeCompare(b.name)}),d},d.finishModule("Collection"),b.exports=o},{"./Index2d":11,"./IndexBinaryTree":12,"./IndexHashMap":13,"./KeyValueStore":14,"./Metrics":15,"./Overload":27,"./Path":28,"./ReactorIO":29,"./Shared":31}],7:[function(a,b,c){"use strict";var d,e,f,g;d=a("./Shared");var h=function(){this.init.apply(this,arguments)};h.prototype.init=function(a){var b=this;b._name=a,b._data=new g("__FDB__cg_data_"+b._name),b._collections=[],b._view=[]},d.addModule("CollectionGroup",h),d.mixin(h.prototype,"Mixin.Common"),d.mixin(h.prototype,"Mixin.ChainReactor"),d.mixin(h.prototype,"Mixin.Constants"),d.mixin(h.prototype,"Mixin.Triggers"),d.mixin(h.prototype,"Mixin.Tags"),d.mixin(h.prototype,"Mixin.Events"),g=a("./Collection"),e=d.modules.Db,f=d.modules.Db.prototype.init,h.prototype.on=function(){this._data.on.apply(this._data,arguments)},h.prototype.off=function(){this._data.off.apply(this._data,arguments)},h.prototype.emit=function(){this._data.emit.apply(this._data,arguments)},h.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},d.synthesize(h.prototype,"state"),d.synthesize(h.prototype,"db"),d.synthesize(h.prototype,"name"),h.prototype.addCollection=function(a){if(a&&-1===this._collections.indexOf(a)){if(this._collections.length){if(this._primaryKey!==a.primaryKey())throw this.logIdentifier()+" All collections in a collection group must have the same primary key!"}else this.primaryKey(a.primaryKey());this._collections.push(a),a._groups=a._groups||[],a._groups.push(this),a.chain(this),a.on("drop",function(){if(a._groups&&a._groups.length){var b,c=[];for(b=0;b<a._groups.length;b++)c.push(a._groups[b]);for(b=0;b<c.length;b++)a._groups[b].removeCollection(a)}delete a._groups}),this._data.insert(a.find())}return this},h.prototype.removeCollection=function(a){if(a){var b,c=this._collections.indexOf(a);-1!==c&&(a.unChain(this),this._collections.splice(c,1),a._groups=a._groups||[],b=a._groups.indexOf(this),-1!==b&&a._groups.splice(b,1),a.off("drop")),0===this._collections.length&&delete this._primaryKey}return this},h.prototype._chainHandler=function(a){switch(a.type){case"setData":a.data.dataSet=this.decouple(a.data.dataSet),this._data.remove(a.data.oldData),this._data.insert(a.data.dataSet);break;case"insert":a.data.dataSet=this.decouple(a.data.dataSet),this._data.insert(a.data.dataSet);break;case"update":this._data.update(a.data.query,a.data.update,a.options);break;case"remove":this._data.remove(a.data.query,a.options)}},h.prototype.insert=function(){this._collectionsRun("insert",arguments)},h.prototype.update=function(){this._collectionsRun("update",arguments)},h.prototype.updateById=function(){this._collectionsRun("updateById",arguments)},h.prototype.remove=function(){this._collectionsRun("remove",arguments)},h.prototype._collectionsRun=function(a,b){for(var c=0;c<this._collections.length;c++)this._collections[c][a].apply(this._collections[c],b)},h.prototype.find=function(a,b){return this._data.find(a,b)},h.prototype.removeById=function(a){for(var b=0;b<this._collections.length;b++)this._collections[b].removeById(a)},h.prototype.subset=function(a,b){var c=this.find(a,b);return(new g).subsetOf(this).primaryKey(this._primaryKey).setData(c)},h.prototype.drop=function(a){if(!this.isDropped()){var b,c,d;if(this._debug&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._collections&&this._collections.length)for(c=[].concat(this._collections),b=0;b<c.length;b++)this.removeCollection(c[b]);if(this._view&&this._view.length)for(d=[].concat(this._view),b=0;b<d.length;b++)this._removeView(d[b]);this.emit("drop",this),delete this._listeners,a&&a(!1,!0)}return!0},e.prototype.init=function(){this._collectionGroup={},f.apply(this,arguments)},e.prototype.collectionGroup=function(a){var b=this;return a?a instanceof h?a:this._collectionGroup&&this._collectionGroup[a]?this._collectionGroup[a]:(this._collectionGroup[a]=new h(a).db(this),b.emit("create",b._collectionGroup[a],"collectionGroup",a),this._collectionGroup[a]):this._collectionGroup},e.prototype.collectionGroups=function(){var a,b=[];for(a in this._collectionGroup)this._collectionGroup.hasOwnProperty(a)&&b.push({name:a});return b},b.exports=h},{"./Collection":6,"./Shared":31}],8:[function(a,b,c){"use strict";var d,e,f,g,h=[];d=a("./Shared"),g=a("./Overload");var i=function(a){this.init.apply(this,arguments)};i.prototype.init=function(a){this._db={},this._debug={},this._name=a||"ForerunnerDB",h.push(this)},i.prototype.instantiatedCount=function(){return h.length},i.prototype.instances=function(a){return void 0!==a?h[a]:h},i.prototype.namedInstances=function(a){var b,c;{if(void 0===a){for(c=[],b=0;b<h.length;b++)c.push(h[b].name);return c}for(b=0;b<h.length;b++)if(h[b].name===a)return h[b]}},i.prototype.moduleLoaded=new g({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b&&b()}},"array, function":function(a,b){var c,e;for(e=0;e<a.length;e++)if(c=a[e],void 0!==c){c=c.replace(/ /g,"");var f,g=c.split(",");for(f=0;f<g.length;f++)if(!d.modules[g[f]])return!1}b&&b()},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),i.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},i.moduleLoaded=i.prototype.moduleLoaded,i.version=i.prototype.version,i.instances=i.prototype.instances,i.instantiatedCount=i.prototype.instantiatedCount,i.shared=d,i.prototype.shared=d,d.addModule("Core",i),d.mixin(i.prototype,"Mixin.Common"),d.mixin(i.prototype,"Mixin.Constants"),e=a("./Db.js"),f=a("./Metrics.js"),d.synthesize(i.prototype,"name"),d.synthesize(i.prototype,"mongoEmulation"),i.prototype._isServer=!1,i.prototype.isClient=function(){return!this._isServer},i.prototype.isServer=function(){return this._isServer},i.prototype.collection=function(){throw"ForerunnerDB's instantiation has changed since version 1.3.36 to support multiple database instances. Please see the readme.md file for the minor change you have to make to get your project back up and running, or see the issue related to this change at https://github.com/Irrelon/ForerunnerDB/issues/44"},b.exports=i},{"./Db.js":9,"./Metrics.js":15,"./Overload":27,"./Shared":31}],9:[function(a,b,c){"use strict";var d,e,f,g,h,i;d=a("./Shared"),i=a("./Overload");var j=function(a,b){this.init.apply(this,arguments)};j.prototype.init=function(a,b){this.core(b),this._primaryKey="_id",this._name=a,this._collection={},this._debug={}},d.addModule("Db",j),j.prototype.moduleLoaded=new i({string:function(a){if(void 0!==a){a=a.replace(/ /g,"");var b,c=a.split(",");for(b=0;b<c.length;b++)if(!d.modules[c[b]])return!1;return!0}return!1},"string, function":function(a,b){if(void 0!==a){a=a.replace(/ /g,"");var c,e=a.split(",");for(c=0;c<e.length;c++)if(!d.modules[e[c]])return!1;b&&b()}},"string, function, function":function(a,b,c){if(void 0!==a){a=a.replace(/ /g,"");var e,f=a.split(",");for(e=0;e<f.length;e++)if(!d.modules[f[e]])return c(),!1;b()}}}),j.prototype.version=function(a,b){return void 0!==a?0===d.version.indexOf(a)?(b&&b(),!0):!1:d.version},j.moduleLoaded=j.prototype.moduleLoaded,j.version=j.prototype.version,j.shared=d,j.prototype.shared=d,d.addModule("Db",j),d.mixin(j.prototype,"Mixin.Common"),d.mixin(j.prototype,"Mixin.ChainReactor"),d.mixin(j.prototype,"Mixin.Constants"),d.mixin(j.prototype,"Mixin.Tags"),e=d.modules.Core,f=a("./Collection.js"),g=a("./Metrics.js"),h=a("./Checksum.js"),j.prototype._isServer=!1,d.synthesize(j.prototype,"core"),d.synthesize(j.prototype,"primaryKey"),d.synthesize(j.prototype,"state"),d.synthesize(j.prototype,"name"),d.synthesize(j.prototype,"mongoEmulation"),j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.Checksum=h,j.prototype.isClient=function(){return!this._isServer},j.prototype.isServer=function(){return this._isServer},j.prototype.arrayToCollection=function(a){return(new f).setData(a)},j.prototype.on=function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||[],this._listeners[a].push(b),this},j.prototype.off=function(a,b){if(a in this._listeners){var c=this._listeners[a],d=c.indexOf(b);d>-1&&c.splice(d,1)}return this},j.prototype.emit=function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d=this._listeners[a],e=d.length;for(c=0;e>c;c++)d[c].apply(this,Array.prototype.slice.call(arguments,1))}return this},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peek=function(a){var b,c,d=[],e=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],d="string"===e?d.concat(c.peek(a)):d.concat(c.find(a)));return d},j.prototype.peekCat=function(a){var b,c,d,e={},f=typeof a;for(b in this._collection)this._collection.hasOwnProperty(b)&&(c=this._collection[b],"string"===f?(d=c.peek(a),d&&d.length&&(e[c.name()]=d)):(d=c.find(a),d&&d.length&&(e[c.name()]=d)));return e},j.prototype.drop=new i({"":function(){if(!this.isDropped()){var a,b=this.collections(),c=b.length;for(this._state="dropped",a=0;c>a;a++)this.collection(b[a].name).drop(),delete this._collection[b[a].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"function":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length,e=0,f=function(){e++,e===d&&a&&a()};for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(f),delete this._collection[c[b].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"boolean":function(a){if(!this.isDropped()){var b,c=this.collections(),d=c.length;for(this._state="dropped",b=0;d>b;b++)this.collection(c[b].name).drop(a),delete this._collection[c[b].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0},"boolean, function":function(a,b){if(!this.isDropped()){var c,d=this.collections(),e=d.length,f=0,g=function(){f++,f===e&&b&&b()};for(this._state="dropped",c=0;e>c;c++)this.collection(d[c].name).drop(a,g),delete this._collection[d[c].name];this.emit("drop",this),delete this._listeners,delete this._core._db[this._name]}return!0}}),e.prototype.db=function(a){return a instanceof j?a:(a||(a=this.objectId()),this._db[a]=this._db[a]||new j(a,this),this._db[a].mongoEmulation(this.mongoEmulation()),this._db[a])},e.prototype.databases=function(a){var b,c,d,e=[];a&&(a instanceof RegExp||(a=new RegExp(a)));for(d in this._db)this._db.hasOwnProperty(d)&&(c=!0,a&&(a.exec(d)||(c=!1)),c&&(b={name:d,children:[]},this.shared.moduleExists("Collection")&&b.children.push({module:"collection",moduleName:"Collections",count:this._db[d].collections().length}),this.shared.moduleExists("CollectionGroup")&&b.children.push({module:"collectionGroup",moduleName:"Collection Groups",count:this._db[d].collectionGroups().length}),this.shared.moduleExists("Document")&&b.children.push({module:"document",moduleName:"Documents",count:this._db[d].documents().length}),this.shared.moduleExists("Grid")&&b.children.push({module:"grid",moduleName:"Grids",count:this._db[d].grids().length}),this.shared.moduleExists("Overview")&&b.children.push({module:"overview",moduleName:"Overviews",count:this._db[d].overviews().length}),this.shared.moduleExists("View")&&b.children.push({module:"view",moduleName:"Views",count:this._db[d].views().length}),e.push(b)));return e.sort(function(a,b){return a.name.localeCompare(b.name)}),e},d.finishModule("Db"),b.exports=j},{"./Checksum.js":5,"./Collection.js":6,"./Metrics.js":15,"./Overload":27,"./Shared":31}],10:[function(a,b,c){"use strict";var d,e,f,g;d=[16,8,4,2,1],e="0123456789bcdefghjkmnpqrstuvwxyz",f={right:{even:"bc01fg45238967deuvhjyznpkmstqrwx"},left:{even:"238967debc01fg45kmstqrwxuvhjyznp"},top:{even:"p0r21436x8zb9dcf5h7kjnmqesgutwvy"},bottom:{even:"14365h7k9dcfesgujnmqp0r2twvyx8zb"}},g={right:{even:"bcfguvyz"},left:{even:"0145hjnp"},top:{even:"prxz"},bottom:{even:"028b"}},f.bottom.odd=f.left.even,f.top.odd=f.right.even,f.left.odd=f.bottom.even,f.right.odd=f.top.even,g.bottom.odd=g.left.even,g.top.odd=g.right.even,g.left.odd=g.bottom.even,g.right.odd=g.top.even;var h=function(){};h.prototype.refineInterval=function(a,b,c){b&c?a[0]=(a[0]+a[1])/2:a[1]=(a[0]+a[1])/2},h.prototype.calculateNeighbours=function(a,b){var c;return b&&"object"!==b.type?(c=[],c[4]=a,c[3]=this.calculateAdjacent(a,"left"),c[5]=this.calculateAdjacent(a,"right"),c[1]=this.calculateAdjacent(a,"top"),c[7]=this.calculateAdjacent(a,"bottom"),c[0]=this.calculateAdjacent(c[3],"top"),c[2]=this.calculateAdjacent(c[5],"top"),c[6]=this.calculateAdjacent(c[3],"bottom"),c[8]=this.calculateAdjacent(c[5],"bottom")):(c={center:a,left:this.calculateAdjacent(a,"left"),right:this.calculateAdjacent(a,"right"),top:this.calculateAdjacent(a,"top"),bottom:this.calculateAdjacent(a,"bottom")},c.topLeft=this.calculateAdjacent(c.left,"top"),c.topRight=this.calculateAdjacent(c.right,"top"),c.bottomLeft=this.calculateAdjacent(c.left,"bottom"),c.bottomRight=this.calculateAdjacent(c.right,"bottom")),c},h.prototype.calculateAdjacent=function(a,b){a=a.toLowerCase();var c=a.charAt(a.length-1),d=a.length%2?"odd":"even",h=a.substring(0,a.length-1);return-1!==g[b][d].indexOf(c)&&(h=this.calculateAdjacent(h,b)),h+e[f[b][d].indexOf(c)]},h.prototype.decode=function(a){var b,c,f,g,h,i,j,k=1,l=[],m=[];for(l[0]=-90,l[1]=90,m[0]=-180,m[1]=180,i=90,j=180,b=0;b<a.length;b++)for(c=a[b],f=e.indexOf(c),g=0;5>g;g++)h=d[g],k?(j/=2,this.refineInterval(m,f,h)):(i/=2,this.refineInterval(l,f,h)),k=!k;return l[2]=(l[0]+l[1])/2,m[2]=(m[0]+m[1])/2,{latitude:l,longitude:m}},h.prototype.encode=function(a,b,c){var f,g=1,h=[],i=[],j=0,k=0,l="";for(c||(c=12),h[0]=-90,h[1]=90,i[0]=-180,i[1]=180;l.length<c;)g?(f=(i[0]+i[1])/2,b>f?(k|=d[j],i[0]=f):i[1]=f):(f=(h[0]+h[1])/2,a>f?(k|=d[j],h[0]=f):h[1]=f),g=!g,4>j?j++:(l+=e[k],j=0,k=0);return l},b.exports=h},{}],11:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=a("./GeoHash"),h=new e,i=new g,j=[5e3,1250,156,39.1,4.89,1.22,.153,.0382,.00477,.00119,149e-6,372e-7],k=function(){this.init.apply(this,arguments)};k.prototype.init=function(a,b,c){this._btree=new f,this._btree.index(a),this._size=0,this._id=this._itemKeyHash(a,a),this._debug=b&&b.debug?b.debug:!1,this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&(this.collection(c),this._btree.primaryKey(c.primaryKey())),this.name(b&&b.name?b.name:this._id),this._btree.debug(this._debug)},d.addModule("Index2d",k),d.mixin(k.prototype,"Mixin.Common"),d.mixin(k.prototype,"Mixin.ChainReactor"),d.mixin(k.prototype,"Mixin.Sorting"),k.prototype.id=function(){return this._id},k.prototype.state=function(){return this._state},k.prototype.size=function(){return this._size},d.synthesize(k.prototype,"data"),d.synthesize(k.prototype,"name"),d.synthesize(k.prototype,"collection"),d.synthesize(k.prototype,"type"),d.synthesize(k.prototype,"unique"),k.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=h.parse(this._keys).length,this):this._keys},k.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree.clear(),this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},k.prototype.insert=function(a,b){var c,d=this._unique;a=this.decouple(a),d&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a);var e,f,g,j,k,l=this._btree.keys();for(k=0;k<l.length;k++)e=h.get(a,l[k].path),e instanceof Array&&(g=e[0],j=e[1],f=i.encode(g,j),h.set(a,l[k].path,f));return this._btree.insert(a)?(this._size++,!0):!1},k.prototype.remove=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),this._btree.remove(a)?(this._size--,!0):!1},k.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},k.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},k.prototype.lookup=function(a,b){var c,d,e,f,g=this._btree.keys();for(f=0;f<g.length;f++)if(c=g[f].path,d=h.get(a,c),"object"==typeof d)return d.$near&&(e=[],e=e.concat(this.near(c,d.$near,b))),d.$geoWithin&&(e=[],e=e.concat(this.geoWithin(c,d.$geoWithin,b))),e;return this._btree.lookup(a,b)},k.prototype.near=function(a,b,c){var d,e,f,g,k,l,m,n,o,p,q,r=this,s=[],t=this._collection.primaryKey();if("km"===b.$distanceUnits){for(m=b.$maxDistance,q=0;q<j.length;q++)if(m>j[q]){l=q;break}0===l&&(l=1)}else if("miles"===b.$distanceUnits){for(m=1.60934*b.$maxDistance,q=0;q<j.length;q++)if(m>j[q]){l=q;break}0===l&&(l=1)}for(d=i.encode(b.$point[0],b.$point[1],l),e=i.calculateNeighbours(d,{type:"array"}),k=[],f=0,q=0;9>q;q++)g=this._btree.startsWith(a,e[q]),f+=g._visited,k=k.concat(g);if(k=this._collection._primaryIndex.lookup(k),k.length){for(n={},q=0;q<k.length;q++)p=h.get(k[q],a),o=n[k[q][t]]=this.distanceBetweenPoints(b.$point[0],b.$point[1],p[0],p[1]),m>=o&&s.push(k[q]);s.sort(function(a,b){return r.sortAsc(n[a[t]],n[b[t]])})}return s},k.prototype.geoWithin=function(a,b,c){return[]},k.prototype.distanceBetweenPoints=function(a,b,c,d){var e=6371,f=this.toRadians(a),g=this.toRadians(c),h=this.toRadians(c-a),i=this.toRadians(d-b),j=Math.sin(h/2)*Math.sin(h/2)+Math.cos(f)*Math.cos(g)*Math.sin(i/2)*Math.sin(i/2),k=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));return e*k},k.prototype.toRadians=function(a){return.01747722222222*a},k.prototype.match=function(a,b){return this._btree.match(a,b)},k.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},k.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},k.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index["2d"]=k,d.finishModule("Index2d"),b.exports=k},{"./BinaryTree":4,"./GeoHash":10,"./Path":28,"./Shared":31}],12:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=a("./BinaryTree"),g=function(){this.init.apply(this,arguments)};g.prototype.init=function(a,b,c){this._btree=new f,this._btree.index(a),this._size=0,this._id=this._itemKeyHash(a,a),this._debug=b&&b.debug?b.debug:!1,this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&(this.collection(c),this._btree.primaryKey(c.primaryKey())),this.name(b&&b.name?b.name:this._id),this._btree.debug(this._debug)},d.addModule("IndexBinaryTree",g),d.mixin(g.prototype,"Mixin.ChainReactor"),d.mixin(g.prototype,"Mixin.Sorting"),g.prototype.id=function(){return this._id},g.prototype.state=function(){return this._state},g.prototype.size=function(){return this._size},d.synthesize(g.prototype,"data"),d.synthesize(g.prototype,"name"),d.synthesize(g.prototype,"collection"),d.synthesize(g.prototype,"type"),d.synthesize(g.prototype,"unique"),g.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},g.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._btree.clear(),this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},g.prototype.insert=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),this._btree.insert(a)?(this._size++,!0):!1},g.prototype.remove=function(a,b){var c,d=this._unique;return d&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),this._btree.remove(a)?(this._size--,!0):!1},g.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},g.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},g.prototype.lookup=function(a,b){return this._btree.lookup(a,b)},g.prototype.match=function(a,b){return this._btree.match(a,b)},g.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},g.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},g.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index.btree=g,d.finishModule("IndexBinaryTree"),b.exports=g},{"./BinaryTree":4,"./Path":28,"./Shared":31}],13:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(a,b,c){this._crossRef={},this._size=0,this._id=this._itemKeyHash(a,a),this.data({}),this.unique(b&&b.unique?b.unique:!1),void 0!==a&&this.keys(a),void 0!==c&&this.collection(c),this.name(b&&b.name?b.name:this._id)},d.addModule("IndexHashMap",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.id=function(){return this._id},f.prototype.state=function(){return this._state},f.prototype.size=function(){return this._size},d.synthesize(f.prototype,"data"),d.synthesize(f.prototype,"name"),d.synthesize(f.prototype,"collection"),d.synthesize(f.prototype,"type"),d.synthesize(f.prototype,"unique"),f.prototype.keys=function(a){return void 0!==a?(this._keys=a,this._keyCount=(new e).parse(this._keys).length,this):this._keys},f.prototype.rebuild=function(){if(this._collection){var a,b=this._collection.subset({},{$decouple:!1,$orderBy:this._keys}),c=b.find(),d=c.length;for(this._data={},this._size=0,this._unique&&(this._uniqueLookup={}),a=0;d>a;a++)this.insert(c[a])}this._state={name:this._name,keys:this._keys,indexSize:this._size,built:new Date,updated:new Date,ok:!0}},f.prototype.insert=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),this._uniqueLookup[c]=a),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pushToPathValue(d[e],a)},f.prototype.update=function(a,b){},f.prototype.remove=function(a,b){var c,d,e,f=this._unique;for(f&&(c=this._itemHash(a,this._keys),delete this._uniqueLookup[c]),d=this._itemHashArr(a,this._keys),e=0;e<d.length;e++)this.pullFromPathValue(d[e],a)},f.prototype.violation=function(a){var b=this._itemHash(a,this._keys);return Boolean(this._uniqueLookup[b])},f.prototype.hashViolation=function(a){return Boolean(this._uniqueLookup[a])},f.prototype.pushToPathValue=function(a,b){var c=this._data[a]=this._data[a]||[];-1===c.indexOf(b)&&(c.push(b),this._size++,this.pushToCrossRef(b,c))},f.prototype.pullFromPathValue=function(a,b){var c,d=this._data[a];c=d.indexOf(b),c>-1&&(d.splice(c,1),this._size--,this.pullFromCrossRef(b,d)),d.length||delete this._data[a]},f.prototype.pull=function(a){var b,c,d=a[this._collection.primaryKey()],e=this._crossRef[d],f=e.length; for(b=0;f>b;b++)c=e[b],this._pullFromArray(c,a);this._size--,delete this._crossRef[d]},f.prototype._pullFromArray=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1)},f.prototype.pushToCrossRef=function(a,b){var c,d=a[this._collection.primaryKey()];this._crossRef[d]=this._crossRef[d]||[],c=this._crossRef[d],-1===c.indexOf(b)&&c.push(b)},f.prototype.pullFromCrossRef=function(a,b){var c=a[this._collection.primaryKey()];delete this._crossRef[c]},f.prototype.lookup=function(a){return this._data[this._itemHash(a,this._keys)]||[]},f.prototype.match=function(a,b){var c,d=new e,f=d.parseArr(this._keys),g=d.parseArr(a),h=[],i=0;for(c=0;c<f.length;c++){if(g[c]!==f[c])return{matchedKeys:[],totalKeyCount:g.length,score:0};i++,h.push(g[c])}return{matchedKeys:h,totalKeyCount:g.length,score:i}},f.prototype._itemHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.value(a,c[d].path).join(":");return g},f.prototype._itemKeyHash=function(a,b){var c,d,f=new e,g="";for(c=f.parse(b),d=0;d<c.length;d++)g&&(g+="_"),g+=f.keyValue(a,c[d].path);return g},f.prototype._itemHashArr=function(a,b){var c,d,f,g,h,i=new e,j=[];for(c=i.parse(b),g=0;g<c.length;g++)for(d=i.value(a,c[g].path),f=0;f<d.length;f++)if(0===g)j.push(d[f]);else for(h=0;h<j.length;h++)j[h]=j[h]+"_"+d[f];return j},d.index.hashed=f,d.finishModule("IndexHashMap"),b.exports=f},{"./Path":28,"./Shared":31}],14:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){this._name=a,this._data={},this._primaryKey="_id"},d.addModule("KeyValueStore",e),d.mixin(e.prototype,"Mixin.ChainReactor"),d.synthesize(e.prototype,"name"),e.prototype.primaryKey=function(a){return void 0!==a?(this._primaryKey=a,this):this._primaryKey},e.prototype.truncate=function(){return this._data={},this},e.prototype.set=function(a,b){return this._data[a]=b?b:!0,this},e.prototype.get=function(a){return this._data[a]},e.prototype.lookup=function(a){var b,c,d,e=this._primaryKey,f=typeof a,g=[];if("string"===f||"number"===f)return d=this.get(a),void 0!==d?[d]:[];if("object"===f){if(a instanceof Array){for(c=a.length,g=[],b=0;c>b;b++)d=this.lookup(a[b]),d&&(d instanceof Array?g=g.concat(d):g.push(d));return g}if(a[e])return this.lookup(a[e])}},e.prototype.unSet=function(a){return delete this._data[a],this},e.prototype.uniqueSet=function(a,b){return void 0===this._data[a]?(this._data[a]=b,!0):!1},d.finishModule("KeyValueStore"),b.exports=e},{"./Shared":31}],15:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Operation"),f=function(){this.init.apply(this,arguments)};f.prototype.init=function(){this._data=[]},d.addModule("Metrics",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.create=function(a){var b=new e(a);return this._enabled&&this._data.push(b),b},f.prototype.start=function(){return this._enabled=!0,this},f.prototype.stop=function(){return this._enabled=!1,this},f.prototype.clear=function(){return this._data=[],this},f.prototype.list=function(){return this._data},d.finishModule("Metrics"),b.exports=f},{"./Operation":26,"./Shared":31}],16:[function(a,b,c){"use strict";var d={preSetData:function(){},postSetData:function(){}};b.exports=d},{}],17:[function(a,b,c){"use strict";var d={chain:function(a){this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Adding target "'+a._reactorOut.instanceIdentifier()+'" to the chain reactor target list'):console.log(this.logIdentifier()+' Adding target "'+a.instanceIdentifier()+'" to the chain reactor target list')),this._chain=this._chain||[];var b=this._chain.indexOf(a);-1===b&&this._chain.push(a)},unChain:function(a){if(this.debug&&this.debug()&&(a._reactorIn&&a._reactorOut?console.log(a._reactorIn.logIdentifier()+' Removing target "'+a._reactorOut.instanceIdentifier()+'" from the chain reactor target list'):console.log(this.logIdentifier()+' Removing target "'+a.instanceIdentifier()+'" from the chain reactor target list')),this._chain){var b=this._chain.indexOf(a);b>-1&&this._chain.splice(b,1)}},chainWillSend:function(){return Boolean(this._chain)},chainSend:function(a,b,c){if(this._chain){var d,e,f=this._chain,g=f.length,h=this.decouple(b,g);for(e=0;g>e;e++){if(d=f[e],d._state&&(!d._state||d.isDropped()))throw console.log("Reactor Data:",a,b,c),console.log("Reactor Node:",d),"Chain reactor attempting to send data to target reactor node that is in a dropped state!";this.debug&&this.debug()&&(d._reactorIn&&d._reactorOut?console.log(d._reactorIn.logIdentifier()+' Sending data down the chain reactor pipe to "'+d._reactorOut.instanceIdentifier()+'"'):console.log(this.logIdentifier()+' Sending data down the chain reactor pipe to "'+d.instanceIdentifier()+'"')),d.chainReceive&&d.chainReceive(this,a,h[e],c)}}},chainReceive:function(a,b,c,d){var e={sender:a,type:b,data:c,options:d},f=!1;this.debug&&this.debug()&&console.log(this.logIdentifier()+" Received data from parent reactor node"),this._chainHandler&&(f=this._chainHandler(e)),f||this.chainSend(e.type,e.data,e.options)}};b.exports=d},{}],18:[function(a,b,c){"use strict";var d,e=0,f=a("./Overload"),g=a("./Serialiser"),h=new g;d={serialiser:h,make:function(a){return h.convert(a)},store:function(a,b){if(void 0!==a){if(void 0!==b)return this._store=this._store||{},this._store[a]=b,this;if(this._store)return this._store[a]}},unStore:function(a){return void 0!==a&&delete this._store[a],this},decouple:function(a,b){if(void 0!==a&&""!==a){if(b){var c,d=this.jStringify(a),e=[];for(c=0;b>c;c++)e.push(this.jParse(d));return e}return this.jParse(this.jStringify(a))}},jParse:function(a){return JSON.parse(a,h.reviver())},jStringify:function(a){return JSON.stringify(a)},objectId:function(a){var b,c=Math.pow(10,17);if(a){var d,f=0,g=a.length;for(d=0;g>d;d++)f+=a.charCodeAt(d)*c;b=f.toString(16)}else e++,b=(e+(Math.random()*c+Math.random()*c+Math.random()*c+Math.random()*c)).toString(16);return b},hash:function(a){return JSON.stringify(a)},debug:new f([function(){return this._debug&&this._debug.all},function(a){return void 0!==a?"boolean"==typeof a?(this._debug=this._debug||{},this._debug.all=a,this.chainSend("debug",this._debug),this):this._debug&&this._debug[a]||this._db&&this._db._debug&&this._db._debug[a]||this._debug&&this._debug.all:this._debug&&this._debug.all},function(a,b){return void 0!==a?void 0!==b?(this._debug=this._debug||{},this._debug[a]=b,this.chainSend("debug",this._debug),this):this._debug&&this._debug[b]||this._db&&this._db._debug&&this._db._debug[a]:this._debug&&this._debug.all}]),classIdentifier:function(){return"ForerunnerDB."+this.className},instanceIdentifier:function(){return"["+this.className+"]"+this.name()},logIdentifier:function(){return"ForerunnerDB "+this.instanceIdentifier()},convertToFdb:function(a){var b,c,d,e;for(e in a)if(a.hasOwnProperty(e)&&(d=a,e.indexOf(".")>-1)){for(e=e.replace(".$","[|$|]"),c=e.split(".");b=c.shift();)b=b.replace("[|$|]",".$"),c.length?d[b]={}:d[b]=a[e],d=d[b];delete a[e]}},isDropped:function(){return"dropped"===this._state},debounce:function(a,b,c){var d,e=this;e._debounce=e._debounce||{},e._debounce[a]&&clearTimeout(e._debounce[a].timeout),d={callback:b,timeout:setTimeout(function(){delete e._debounce[a],b()},c)},e._debounce[a]=d}},b.exports=d},{"./Overload":27,"./Serialiser":30}],19:[function(a,b,c){"use strict";var d={TYPE_INSERT:0,TYPE_UPDATE:1,TYPE_REMOVE:2,PHASE_BEFORE:0,PHASE_AFTER:1};b.exports=d},{}],20:[function(a,b,c){"use strict";var d=a("./Overload"),e={on:new d({"string, function":function(a,b){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a]["*"]=this._listeners[a]["*"]||[],this._listeners[a]["*"].push(b),this},"string, *, function":function(a,b,c){return this._listeners=this._listeners||{},this._listeners[a]=this._listeners[a]||{},this._listeners[a][b]=this._listeners[a][b]||[],this._listeners[a][b].push(c),this}}),once:new d({"string, function":function(a,b){var c=this,d=function(){c.off(a,d),b.apply(c,arguments)};return this.on(a,d)},"string, *, function":function(a,b,c){var d=this,e=function(){d.off(a,b,e),c.apply(d,arguments)};return this.on(a,b,e)}}),off:new d({string:function(a){return this._listeners&&this._listeners[a]&&a in this._listeners&&delete this._listeners[a],this},"string, function":function(a,b){var c,d;return"string"==typeof b?this._listeners&&this._listeners[a]&&this._listeners[a][b]&&delete this._listeners[a][b]:this._listeners&&a in this._listeners&&(c=this._listeners[a]["*"],d=c.indexOf(b),d>-1&&c.splice(d,1)),this},"string, *, function":function(a,b,c){if(this._listeners&&a in this._listeners&&b in this.listeners[a]){var d=this._listeners[a][b],e=d.indexOf(c);e>-1&&d.splice(e,1)}},"string, *":function(a,b){this._listeners&&a in this._listeners&&b in this._listeners[a]&&delete this._listeners[a][b]}}),emit:function(a,b){if(this._listeners=this._listeners||{},a in this._listeners){var c,d,e,f,g,h,i;if(this._listeners[a]["*"])for(f=this._listeners[a]["*"],d=f.length,c=0;d>c;c++)e=f[c],"function"==typeof e&&e.apply(this,Array.prototype.slice.call(arguments,1));if(b instanceof Array&&b[0]&&b[0][this._primaryKey])for(g=this._listeners[a],d=b.length,c=0;d>c;c++)if(g[b[c][this._primaryKey]])for(h=g[b[c][this._primaryKey]].length,i=0;h>i;i++)e=g[b[c][this._primaryKey]][i],"function"==typeof e&&g[b[c][this._primaryKey]][i].apply(this,Array.prototype.slice.call(arguments,1))}return this},deferEmit:function(a,b){var c,d=this;return this._noEmitDefer||this._db&&(!this._db||this._db._noEmitDefer)?this.emit.apply(this,arguments):(c=arguments,this._deferTimeout=this._deferTimeout||{},this._deferTimeout[a]&&clearTimeout(this._deferTimeout[a]),this._deferTimeout[a]=setTimeout(function(){d.debug()&&console.log(d.logIdentifier()+" Emitting "+c[0]),d.emit.apply(d,c)},1)),this}};b.exports=e},{"./Overload":27}],21:[function(a,b,c){"use strict";var d={_match:function(a,b,c,d,e){var f,g,h,i,j,k,l=d,m=typeof a,n=typeof b,o=!0;if(e=e||{},c=c||{},e.$rootQuery||(e.$rootQuery=b),e.$rootSource||(e.$rootSource=a),e.$currentQuery=b,e.$rootData=e.$rootData||{},"string"!==m&&"number"!==m||"string"!==n&&"number"!==n){if(("string"===m||"number"===m)&&"object"===n&&b instanceof RegExp)b.test(a)||(o=!1);else for(k in b)if(b.hasOwnProperty(k)){if(e.$previousQuery=e.$parent,e.$parent={query:b[k],key:k,parent:e.$previousQuery},f=!1,j=k.substr(0,2),"//"===j)continue;if(0===j.indexOf("$")&&(i=this._matchOp(k,a,b[k],c,e),i>-1)){if(i){if("or"===d)return!0}else o=i;f=!0}if(!f&&b[k]instanceof RegExp)if(f=!0,"object"===m&&void 0!==a[k]&&b[k].test(a[k])){if("or"===d)return!0}else o=!1;if(!f)if("object"==typeof b[k])if(void 0!==a[k])if(a[k]instanceof Array&&!(b[k]instanceof Array)){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if(!(a[k]instanceof Array)&&b[k]instanceof Array){for(g=!1,h=0;h<b[k].length&&!(g=this._match(a[k],b[k][h],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else if("object"==typeof a)if(g=this._match(a[k],b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else if(b[k]&&void 0!==b[k].$exists)if(g=this._match(void 0,b[k],c,l,e)){if("or"===d)return!0}else o=!1;else o=!1;else if(a&&a[k]===b[k]){if("or"===d)return!0}else if(a&&a[k]&&a[k]instanceof Array&&b[k]&&"object"!=typeof b[k]){for(g=!1,h=0;h<a[k].length&&!(g=this._match(a[k][h],b[k],c,l,e));h++);if(g){if("or"===d)return!0}else o=!1}else o=!1;if("and"===d&&!o)return!1}}else"number"===m?a!==b&&(o=!1):a.localeCompare(b)&&(o=!1);return o},_matchOp:function(a,b,c,d,e){switch(a){case"$gt":return b>c;case"$gte":return b>=c;case"$lt":return c>b;case"$lte":return c>=b;case"$exists":return void 0===b!==c;case"$eq":return b==c;case"$eeq":return b===c;case"$ne":return b!=c;case"$nee":return b!==c;case"$or":for(var f=0;f<c.length;f++)if(this._match(b,c[f],d,"and",e))return!0;return!1;case"$and":for(var g=0;g<c.length;g++)if(!this._match(b,c[g],d,"and",e))return!1;return!0;case"$in":if(c instanceof Array){var h,i=c,j=i.length;for(h=0;j>h;h++)if(this._match(b,i[h],d,"and",e))return!0;return!1}return"object"==typeof c?this._match(b,c,d,"and",e):(console.log(this.logIdentifier()+" Cannot use an $in operator on a non-array key: "+a,e.$rootQuery),!1);case"$nin":if(c instanceof Array){var k,l=c,m=l.length;for(k=0;m>k;k++)if(this._match(b,l[k],d,"and",e))return!1;return!0}return"object"==typeof c?this._match(b,c,d,"and",e):(console.log(this.logIdentifier()+" Cannot use a $nin operator on a non-array key: "+a,e.$rootQuery),!1);case"$distinct":e.$rootData["//distinctLookup"]=e.$rootData["//distinctLookup"]||{};for(var n in c)if(c.hasOwnProperty(n))return e.$rootData["//distinctLookup"][n]=e.$rootData["//distinctLookup"][n]||{},e.$rootData["//distinctLookup"][n][b[n]]?!1:(e.$rootData["//distinctLookup"][n][b[n]]=!0,!0);break;case"$count":var o,p,q;for(o in c)if(c.hasOwnProperty(o)&&(p=b[o],q="object"==typeof p&&p instanceof Array?p.length:0,!this._match(q,c[o],d,"and",e)))return!1;return!0;case"$find":case"$findOne":case"$findSub":var r,s,t,u,v,w,x="collection",y={};if(!c.$from)throw a+" missing $from property!";if(c.$fromType&&(x=c.$fromType,!this.db()[x]||"function"!=typeof this.db()[x]))throw a+' cannot operate against $fromType "'+x+'" because the database does not recognise this type of object!';if(r=c.$query||{},s=c.$options||{},"$findSub"===a){if(!c.$path)throw a+" missing $path property!";if(v=c.$path,t=c.$subQuery||{},u=c.$subOptions||{},!(e.$parent&&e.$parent.parent&&e.$parent.parent.key))return this._match(b,r,{},"and",e)&&(w=this._findSub([b],v,t,u)),w&&w.length>0;w=this.db()[x](c.$from).findSub(r,v,t,u)}else w=this.db()[x](c.$from)[a.substr(1)](r,s);return y[e.$parent.parent.key]=w,this._match(b,y,d,"and",e)}return-1},applyJoin:function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this,y=[];for(a instanceof Array||(a=[a]),e=0;e<b.length;e++)for(f in b[e])if(b[e].hasOwnProperty(f))for(g=b[e][f],h=g.$sourceType||"collection",i="$"+h+"."+f,j=f,c[i]?k=c[i]:this._db[h]&&"function"==typeof this._db[h]&&(k=this._db[h](f)),l=0;l<a.length;l++){m={},n=!1,o=!1,p="";for(q in g)if(g.hasOwnProperty(q))if(r=g[q],"$"===q.substr(0,1))switch(q){case"$where":if(!r.$query&&!r.$options)throw'$join $where clause requires "$query" and / or "$options" keys to work!';r.$query&&(m=x.resolveDynamicQuery(r.$query,a[l])),r.$options&&(s=r.$options);break;case"$as":j=r;break;case"$multi":n=r;break;case"$require":o=r;break;case"$prefix":p=r}else m[q]=x.resolveDynamicQuery(r,a[l]);if(t=k.find(m,s),!o||o&&t[0])if("$root"===j){if(n!==!1)throw this.logIdentifier()+' Cannot combine [$as: "$root"] with [$multi: true] in $join clause!';u=t[0],v=a[l];for(w in u)u.hasOwnProperty(w)&&void 0===v[p+w]&&(v[p+w]=u[w])}else a[l][j]=n===!1?t[0]:t;else y.push(l)}return y},resolveDynamicQuery:function(a,b){var c,d,e,f,g,h=this;if("string"==typeof a)return f="$$."===a.substr(0,3)?this.sharedPathSolver.value(b,a.substr(3,a.length-3)):this.sharedPathSolver.value(b,a),f.length>1?{$in:f}:f[0];c={};for(g in a)if(a.hasOwnProperty(g))switch(d=typeof a[g],e=a[g],d){case"string":"$$."===e.substr(0,3)?c[g]=this.sharedPathSolver.value(b,e.substr(3,e.length-3))[0]:c[g]=e;break;case"object":c[g]=h.resolveDynamicQuery(e,b);break;default:c[g]=e}return c},spliceArrayByIndexList:function(a,b){var c;for(c=b.length-1;c>=0;c--)a.splice(b[c],1)}};b.exports=d},{}],22:[function(a,b,c){"use strict";var d={sortAsc:function(a,b){return"string"==typeof a&&"string"==typeof b?a.localeCompare(b):a>b?1:b>a?-1:0},sortDesc:function(a,b){return"string"==typeof a&&"string"==typeof b?b.localeCompare(a):a>b?-1:b>a?1:0}};b.exports=d},{}],23:[function(a,b,c){"use strict";var d,e={};d={tagAdd:function(a){var b,c=this,d=e[a]=e[a]||[];for(b=0;b<d.length;b++)if(d[b]===c)return!0;return d.push(c),c.on&&c.on("drop",function(){c.tagRemove(a)}),!0},tagRemove:function(a){var b,c=e[a];if(c)for(b=0;b<c.length;b++)if(c[b]===this)return c.splice(b,1),!0;return!1},tagLookup:function(a){return e[a]||[]},tagDrop:function(a,b){var c,d,e,f=this.tagLookup(a);if(c=function(){d--,b&&0===d&&b(!1)},f.length)for(d=f.length,e=f.length-1;e>=0;e--)f[e].drop(c);return!0}},b.exports=d},{}],24:[function(a,b,c){"use strict";var d=a("./Overload"),e={addTrigger:function(a,b,c,d){var e,f=this;return e=f._triggerIndexOf(a,b,c),-1===e?(f._trigger=f._trigger||{},f._trigger[b]=f._trigger[b]||{},f._trigger[b][c]=f._trigger[b][c]||[],f._trigger[b][c].push({id:a,method:d,enabled:!0}),!0):!1},removeTrigger:function(a,b,c){var d,e=this;return d=e._triggerIndexOf(a,b,c),d>-1&&e._trigger[b][c].splice(d,1),!1},enableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!0,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!0,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!0,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!0,!0):!1}}),disableTrigger:new d({string:function(a){var b,c,d,e,f,g=this,h=g._trigger,i=!1;if(h)for(f in h)if(h.hasOwnProperty(f)&&(b=h[f]))for(d in b)if(b.hasOwnProperty(d))for(c=b[d],e=0;e<c.length;e++)c[e].id===a&&(c[e].enabled=!1,i=!0);return i},number:function(a){var b,c,d,e=this,f=e._trigger[a],g=!1;if(f)for(c in f)if(f.hasOwnProperty(c))for(b=f[c],d=0;d<b.length;d++)b[d].enabled=!1,g=!0;return g},"number, number":function(a,b){var c,d,e=this,f=e._trigger[a],g=!1;if(f&&(c=f[b]))for(d=0;d<c.length;d++)c[d].enabled=!1,g=!0;return g},"string, number, number":function(a,b,c){var d=this,e=d._triggerIndexOf(a,b,c);return e>-1?(d._trigger[b][c][e].enabled=!1,!0):!1}}),willTrigger:function(a,b){if(this._trigger&&this._trigger[a]&&this._trigger[a][b]&&this._trigger[a][b].length){var c,d=this._trigger[a][b];for(c=0;c<d.length;c++)if(d[c].enabled)return!0}return!1},processTrigger:function(a,b,c,d,e){var f,g,h,i,j,k=this;if(k._trigger&&k._trigger[b]&&k._trigger[b][c]){for(f=k._trigger[b][c],h=f.length,g=0;h>g;g++)if(i=f[g],i.enabled){if(this.debug()){var l,m;switch(b){case this.TYPE_INSERT:l="insert";break;case this.TYPE_UPDATE:l="update";break;case this.TYPE_REMOVE:l="remove";break;default:l=""}switch(c){case this.PHASE_BEFORE:m="before";break;case this.PHASE_AFTER:m="after";break;default:m=""}}if(j=i.method.call(k,a,d,e),j===!1)return!1;if(void 0!==j&&j!==!0&&j!==!1)throw"ForerunnerDB.Mixin.Triggers: Trigger error: "+j}return!0}},_triggerIndexOf:function(a,b,c){var d,e,f,g=this;if(g._trigger&&g._trigger[b]&&g._trigger[b][c])for(d=g._trigger[b][c],e=d.length,f=0;e>f;f++)if(d[f].id===a)return f;return-1}};b.exports=e},{"./Overload":27}],25:[function(a,b,c){"use strict";var d={_updateProperty:function(a,b,c){a[b]=c,this.debug()&&console.log(this.logIdentifier()+' Setting non-data-bound document property "'+b+'" to val "'+c+'"')},_updateIncrement:function(a,b,c){a[b]+=c},_updateSpliceMove:function(a,b,c){a.splice(c,0,a.splice(b,1)[0]),this.debug()&&console.log(this.logIdentifier()+' Moving non-data-bound document array index from "'+b+'" to "'+c+'"')},_updateSplicePush:function(a,b,c){a.length>b?a.splice(b,0,c):a.push(c)},_updatePush:function(a,b){a.push(b)},_updatePull:function(a,b){a.splice(b,1)},_updateMultiply:function(a,b,c){a[b]*=c},_updateRename:function(a,b,c){a[c]=a[b],delete a[b]},_updateOverwrite:function(a,b,c){a[b]=c},_updateUnset:function(a,b){delete a[b]},_updateClear:function(a,b){var c,d=a[b];if(d&&"object"==typeof d)for(c in d)d.hasOwnProperty(c)&&this._updateUnset(d,c)},_updatePop:function(a,b){var c,d=!1;if(a.length>0)if(b>0){for(c=0;b>c;c++)a.pop();d=!0}else if(0>b){for(c=0;c>b;c--)a.shift();d=!0}return d}};b.exports=d},{}],26:[function(a,b,c){"use strict";var d=a("./Shared"),e=a("./Path"),f=function(a){this.pathSolver=new e,this.counter=0,this.init.apply(this,arguments)};f.prototype.init=function(a){this._data={operation:a,index:{potential:[],used:!1},steps:[],time:{startMs:0,stopMs:0,totalMs:0,process:{}},flag:{},log:[]}},d.addModule("Operation",f),d.mixin(f.prototype,"Mixin.ChainReactor"),f.prototype.start=function(){this._data.time.startMs=(new Date).getTime()},f.prototype.log=function(a){if(a){var b=this._log.length>0?this._data.log[this._data.log.length-1].time:0,c={event:a,time:(new Date).getTime(),delta:0};return this._data.log.push(c),b&&(c.delta=c.time-b),this}return this._data.log},f.prototype.time=function(a){if(void 0!==a){var b=this._data.time.process,c=b[a]=b[a]||{};return c.startMs?(c.stopMs=(new Date).getTime(),c.totalMs=c.stopMs-c.startMs,c.stepObj.totalMs=c.totalMs,delete c.stepObj):(c.startMs=(new Date).getTime(),c.stepObj={name:a},this._data.steps.push(c.stepObj)),this}return this._data.time},f.prototype.flag=function(a,b){return void 0===a||void 0===b?void 0!==a?this._data.flag[a]:this._data.flag:void(this._data.flag[a]=b)},f.prototype.data=function(a,b,c){return void 0!==b?(this.pathSolver.set(this._data,a,b),this):this.pathSolver.get(this._data,a)},f.prototype.pushData=function(a,b,c){this.pathSolver.push(this._data,a,b)},f.prototype.stop=function(){this._data.time.stopMs=(new Date).getTime(),this._data.time.totalMs=this._data.time.stopMs-this._data.time.startMs},d.finishModule("Operation"),b.exports=f},{"./Path":28,"./Shared":31}],27:[function(a,b,c){"use strict";var d=function(a,b){if(b||(b=a,a=void 0),b){var c,d,e,f,g,h,i=this;if(!(b instanceof Array)){e={};for(c in b)if(b.hasOwnProperty(c))if(f=c.replace(/ /g,""),-1===f.indexOf("*"))e[f]=b[c];else for(h=this.generateSignaturePermutations(f),g=0;g<h.length;g++)e[h[g]]||(e[h[g]]=b[c]);b=e}return function(){var e,f,g,h=[];if(b instanceof Array){for(d=b.length,c=0;d>c;c++)if(b[c].length===arguments.length)return i.callExtend(this,"$main",b,b[c],arguments)}else{for(c=0;c<arguments.length&&(f=typeof arguments[c],"object"===f&&arguments[c]instanceof Array&&(f="array"),1!==arguments.length||"undefined"!==f);c++)h.push(f);if(e=h.join(","),b[e])return i.callExtend(this,"$main",b,b[e],arguments);for(c=h.length;c>=0;c--)if(e=h.slice(0,c).join(","),b[e+",..."])return i.callExtend(this,"$main",b,b[e+",..."],arguments)}throw g=void 0!==a?a:"function"==typeof this.name?this.name():"Unknown",console.log("Overload Definition:",b),'ForerunnerDB.Overload "'+g+'": Overloaded method does not have a matching signature "'+e+'" for the passed arguments: '+this.jStringify(h)}}return function(){}};d.prototype.generateSignaturePermutations=function(a){var b,c,d=[],e=["array","string","object","number","function","undefined"];if(a.indexOf("*")>-1)for(c=0;c<e.length;c++)b=a.replace("*",e[c]),d=d.concat(this.generateSignaturePermutations(b));else d.push(a);return d},d.prototype.callExtend=function(a,b,c,d,e){var f,g;return a&&c[b]?(f=a[b],a[b]=c[b],g=d.apply(a,e),a[b]=f,g):d.apply(a,e)},b.exports=d},{}],28:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a){this.init.apply(this,arguments)};e.prototype.init=function(a){a&&this.path(a)},d.addModule("Path",e),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),e.prototype.path=function(a){return void 0!==a?(this._path=this.clean(a),this._pathParts=this._path.split("."),this):this._path},e.prototype.hasObjectPaths=function(a,b){var c,d=!0;for(c in a)if(a.hasOwnProperty(c)){if(void 0===b[c])return!1;if("object"==typeof a[c]&&(d=this.hasObjectPaths(a[c],b[c]),!d))return!1}return d},e.prototype.countKeys=function(a){var b,c=0;for(b in a)a.hasOwnProperty(b)&&void 0!==a[b]&&("object"!=typeof a[b]?c++:c+=this.countKeys(a[b]));return c},e.prototype.countObjectPaths=function(a,b){var c,d,e={},f=0,g=0;for(d in b)b.hasOwnProperty(d)&&("object"==typeof b[d]?(c=this.countObjectPaths(a[d],b[d]),e[d]=c.matchedKeys,g+=c.totalKeyCount,f+=c.matchedKeyCount):(g++,a&&a[d]&&"object"!=typeof a[d]?(e[d]=!0,f++):e[d]=!1));return{matchedKeys:e,matchedKeyCount:f,totalKeyCount:g}},e.prototype.parse=function(a,b){var c,d,e,f=[],g="";for(d in a)if(a.hasOwnProperty(d))if(g=d,"object"==typeof a[d])if(b)for(c=this.parse(a[d],b),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path,value:c[e].value});else for(c=this.parse(a[d]),e=0;e<c.length;e++)f.push({path:g+"."+c[e].path});else b?f.push({path:g,value:a[d]}):f.push({path:g});return f},e.prototype.parseArr=function(a,b){return b=b||{},this._parseArr(a,"",[],b)},e.prototype._parseArr=function(a,b,c,d){var e,f="";b=b||"",c=c||[];for(e in a)a.hasOwnProperty(e)&&(!d.ignore||d.ignore&&!d.ignore.test(e))&&(f=b?b+"."+e:e,"object"==typeof a[e]?(d.verbose&&c.push(f),this._parseArr(a[e],f,c,d)):c.push(f));return c},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.get=function(a,b){return this.value(a,b)[0]},e.prototype.value=function(a,b,c){var d,e,f,g,h,i,j,k,l;if(b&&-1===b.indexOf("."))return[a[b]];if(void 0!==a&&"object"==typeof a){if((!c||c&&!c.skipArrCheck)&&a instanceof Array){for(j=[],k=0;k<a.length;k++)j.push(this.get(a[k],b));return j}for(i=[],void 0!==b&&(b=this.clean(b),d=b.split(".")),e=d||this._pathParts,f=e.length,g=a,k=0;f>k;k++){if(g=g[e[k]],h instanceof Array){for(l=0;l<h.length;l++)i=i.concat(this.value(h,l+"."+e[k],{skipArrCheck:!0}));return i}if(!g||"object"!=typeof g)break;h=g}return[g]}return[]},e.prototype.push=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;if(b=this.clean(b),d=b.split("."),e=d.shift(),d.length)a[e]=a[e]||{},this.set(a[e],d.join("."),c);else{if(a[e]=a[e]||[],!(a[e]instanceof Array))throw"ForerunnerDB.Path: Cannot push to a path whose endpoint is not an array!";a[e].push(c)}}return a},e.prototype.keyValue=function(a,b){var c,d,e,f,g,h,i;for(void 0!==b&&(b=this.clean(b),c=b.split(".")),d=c||this._pathParts,e=d.length,f=a,i=0;e>i;i++){if(f=f[d[i]],!f||"object"!=typeof f){h=d[i]+":"+f;break}g=f}return h},e.prototype.set=function(a,b,c){if(void 0!==a&&void 0!==b){var d,e;b=this.clean(b),d=b.split("."),e=d.shift(),d.length?(a[e]=a[e]||{},this.set(a[e],d.join("."),c)):a[e]=c}return a},e.prototype.clean=function(a){return"."===a.substr(0,1)&&(a=a.substr(1,a.length-1)),a},d.finishModule("Path"),b.exports=e},{"./Shared":31}],29:[function(a,b,c){"use strict";var d=a("./Shared"),e=function(a,b,c){if(!(a&&b&&c))throw"ForerunnerDB.ReactorIO: ReactorIO requires in, out and process arguments to instantiate!";if(this._reactorIn=a,this._reactorOut=b,this._chainHandler=c,!a.chain)throw"ForerunnerDB.ReactorIO: ReactorIO requires passed in and out objects to implement the ChainReactor mixin!";a.chain(this),this.chain(b)};d.addModule("ReactorIO",e),e.prototype.drop=function(){return this.isDropped()||(this._state="dropped",this._reactorIn&&this._reactorIn.unChain(this),this._reactorOut&&this.unChain(this._reactorOut),delete this._reactorIn,delete this._reactorOut,delete this._chainHandler,this.emit("drop",this),delete this._listeners),!0},d.synthesize(e.prototype,"state"),d.mixin(e.prototype,"Mixin.Common"),d.mixin(e.prototype,"Mixin.ChainReactor"),d.mixin(e.prototype,"Mixin.Events"),d.finishModule("ReactorIO"),b.exports=e},{"./Shared":31}],30:[function(a,b,c){"use strict";var d=function(){this.init.apply(this,arguments)};d.prototype.init=function(){var a=this;this._encoder=[],this._decoder=[],this.registerHandler("$date",function(a){return a instanceof Date?(a.toJSON=function(){return"$date:"+this.toISOString()},!0):!1},function(b){return"string"==typeof b&&0===b.indexOf("$date:")?a.convert(new Date(b.substr(6))):void 0}),this.registerHandler("$regexp",function(a){return a instanceof RegExp?(a.toJSON=function(){return"$regexp:"+this.source.length+":"+this.source+":"+(this.global?"g":"")+(this.ignoreCase?"i":"")},!0):!1},function(b){if("string"==typeof b&&0===b.indexOf("$regexp:")){var c=b.substr(8),d=c.indexOf(":"),e=Number(c.substr(0,d)),f=c.substr(d+1,e),g=c.substr(d+e+2);return a.convert(new RegExp(f,g))}})},d.prototype.registerHandler=function(a,b,c){void 0!==a&&(this._encoder.push(b),this._decoder.push(c))},d.prototype.convert=function(a){var b,c=this._encoder;for(b=0;b<c.length;b++)if(c[b](a))return a;return a},d.prototype.reviver=function(){var a=this._decoder;return function(b,c){var d,e;for(e=0;e<a.length;e++)if(d=a[e](c),void 0!==d)return d;return c}},b.exports=d},{}],31:[function(a,b,c){"use strict";var d=a("./Overload"),e={version:"1.3.711",modules:{},plugins:{},index:{},_synth:{},addModule:function(a,b){this.modules[a]=b,this.emit("moduleLoad",[a,b])},finishModule:function(a){if(!this.modules[a])throw"ForerunnerDB.Shared: finishModule called on a module that has not been registered with addModule(): "+a;this.modules[a]._fdbFinished=!0,this.modules[a].prototype?this.modules[a].prototype.className=a:this.modules[a].className=a,this.emit("moduleFinished",[a,this.modules[a]])},moduleFinished:function(a,b){this.modules[a]&&this.modules[a]._fdbFinished?b&&b(a,this.modules[a]):this.on("moduleFinished",b)},moduleExists:function(a){return Boolean(this.modules[a])},mixin:new d({"object, string":function(a,b){var c;if("string"==typeof b&&(c=this.mixins[b],!c))throw"ForerunnerDB.Shared: Cannot find mixin named: "+b;return this.$main.call(this,a,c)},"object, *":function(a,b){return this.$main.call(this,a,b)},$main:function(a,b){if(b&&"object"==typeof b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}}),synthesize:function(a,b,c){if(this._synth[b]=this._synth[b]||function(a){return void 0!==a?(this["_"+b]=a,this):this["_"+b]},c){var d=this;a[b]=function(){var a,e=this.$super;return this.$super=d._synth[b],a=c.apply(this,arguments),this.$super=e,a}}else a[b]=this._synth[b]},overload:d,mixins:{"Mixin.Common":a("./Mixin.Common"),"Mixin.Events":a("./Mixin.Events"),"Mixin.ChainReactor":a("./Mixin.ChainReactor"),"Mixin.CRUD":a("./Mixin.CRUD"),"Mixin.Constants":a("./Mixin.Constants"),"Mixin.Triggers":a("./Mixin.Triggers"),"Mixin.Sorting":a("./Mixin.Sorting"),"Mixin.Matching":a("./Mixin.Matching"),"Mixin.Updating":a("./Mixin.Updating"),"Mixin.Tags":a("./Mixin.Tags")}};e.mixin(e,"Mixin.Events"),b.exports=e},{"./Mixin.CRUD":16,"./Mixin.ChainReactor":17,"./Mixin.Common":18,"./Mixin.Constants":19,"./Mixin.Events":20,"./Mixin.Matching":21,"./Mixin.Sorting":22,"./Mixin.Tags":23,"./Mixin.Triggers":24,"./Mixin.Updating":25,"./Overload":27}],32:[function(a,b,c){Array.prototype.filter||(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),"function"!=typeof Object.create&&(Object.create=function(){var a=function(){};return function(b){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof b)throw TypeError("Argument must be an object");a.prototype=b;var c=new a;return a.prototype=null,c}}()),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null===this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=+b||0;if(Math.abs(f)===1/0&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1}),b.exports={}},{}],33:[function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n=a("./Overload");d=a("./Shared");var o=function(a,b,c){this.init.apply(this,arguments)};d.addModule("View",o),d.mixin(o.prototype,"Mixin.Common"),d.mixin(o.prototype,"Mixin.Matching"),d.mixin(o.prototype,"Mixin.ChainReactor"),d.mixin(o.prototype,"Mixin.Constants"),d.mixin(o.prototype,"Mixin.Triggers"),d.mixin(o.prototype,"Mixin.Tags"),f=a("./Collection"),g=a("./CollectionGroup"),k=a("./ActiveBucket"),j=a("./ReactorIO"),h=f.prototype.init,e=d.modules.Db,i=e.prototype.init, l=d.modules.Path,m=new l,o.prototype.init=function(a,b,c){var d=this;this.sharedPathSolver=m,this._name=a,this._listeners={},this._querySettings={},this._debug={},this.query(b,c,!1),this._collectionDroppedWrap=function(){d._collectionDropped.apply(d,arguments)},this._data=new f(this.name()+"_internal")},o.prototype._handleChainIO=function(a,b){var c,d,e,f,g=a.type;return"setData"!==g&&"insert"!==g&&"update"!==g&&"remove"!==g?!1:(c=Boolean(b._querySettings.options&&b._querySettings.options.$join),d=Boolean(b._querySettings.query),e=void 0!==b._data._transformIn,c||d||e?(f={dataArr:[],removeArr:[]},"insert"===a.type?a.data.dataSet instanceof Array?f.dataArr=a.data.dataSet:f.dataArr=[a.data.dataSet]:"update"===a.type?f.dataArr=a.data.dataSet:"remove"===a.type&&(a.data.dataSet instanceof Array?f.removeArr=a.data.dataSet:f.removeArr=[a.data.dataSet]),f.dataArr instanceof Array||(console.warn("WARNING: dataArr being processed by chain reactor in View class is inconsistent!"),f.dataArr=[]),f.removeArr instanceof Array||(console.warn("WARNING: removeArr being processed by chain reactor in View class is inconsistent!"),f.removeArr=[]),c&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_ActiveJoin"),b._handleChainIO_ActiveJoin(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_ActiveJoin")),d&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_ActiveQuery"),b._handleChainIO_ActiveQuery(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_ActiveQuery")),e&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_TransformIn"),b._handleChainIO_TransformIn(a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_TransformIn")),f.dataArr.length||f.removeArr.length?(f.pk=b._data.primaryKey(),f.removeArr.length&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_RemovePackets"),b._handleChainIO_RemovePackets(this,a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_RemovePackets")),f.dataArr.length&&(this.debug()&&console.time(this.logIdentifier()+" :: _handleChainIO_UpsertPackets"),b._handleChainIO_UpsertPackets(this,a,f),this.debug()&&console.timeEnd(this.logIdentifier()+" :: _handleChainIO_UpsertPackets")),!0):!0):!1)},o.prototype._handleChainIO_ActiveJoin=function(a,b){var c,d=b.dataArr;c=this.applyJoin(d,this._querySettings.options.$join,{},{}),this.spliceArrayByIndexList(d,c),b.removeArr=b.removeArr.concat(c)},o.prototype._handleChainIO_ActiveQuery=function(a,b){var c,d=this,e=b.dataArr;for(c=e.length-1;c>=0;c--)d._match(e[c],d._querySettings.query,d._querySettings.options,"and",{})||(b.removeArr.push(e[c]),e.splice(c,1))},o.prototype._handleChainIO_TransformIn=function(a,b){var c,d=this,e=b.dataArr,f=b.removeArr,g=d._data._transformIn;for(c=0;c<e.length;c++)e[c]=g(e[c]);for(c=0;c<f.length;c++)f[c]=g(f[c])},o.prototype._handleChainIO_RemovePackets=function(a,b,c){var d,e,f=[],g=c.pk,h=c.removeArr,i={dataSet:h,query:{$or:f}};for(e=0;e<h.length;e++)d={},d[g]=h[e][g],f.push(d);a.chainSend("remove",i)},o.prototype._handleChainIO_UpsertPackets=function(a,b,c){var d,e,f,g=this._data,h=g._primaryIndex,i=g._primaryCrc,j=c.pk,k=c.dataArr,l=[],m=[];for(f=0;f<k.length;f++)d=k[f],h.get(d[j])?i.get(d[j])!==this.hash(d[j])&&m.push(d):l.push(d);if(l.length&&a.chainSend("insert",{dataSet:l}),m.length)for(f=0;f<m.length;f++)d=m[f],e={},e[j]=d[j],a.chainSend("update",{query:e,update:d,dataSet:[d]})},o.prototype.insert=function(){this._from.insert.apply(this._from,arguments)},o.prototype.update=function(){this._from.update.apply(this._from,arguments)},o.prototype.updateById=function(){this._from.updateById.apply(this._from,arguments)},o.prototype.remove=function(){this._from.remove.apply(this._from,arguments)},o.prototype.find=function(a,b){return this._data.find(a,b)},o.prototype.findOne=function(a,b){return this._data.findOne(a,b)},o.prototype.findById=function(a,b){return this._data.findById(a,b)},o.prototype.findSub=function(a,b,c,d){return this._data.findSub(a,b,c,d)},o.prototype.findSubOne=function(a,b,c,d){return this._data.findSubOne(a,b,c,d)},o.prototype.data=function(){return this._data},o.prototype.from=function(a,b){var c=this;if(void 0!==a){this._from&&(this._from.off("drop",this._collectionDroppedWrap),delete this._from),this._io&&(this._io.drop(),delete this._io),"string"==typeof a&&(a=this._db.collection(a)),"View"===a.className&&(a=a._data,this.debug()&&console.log(this.logIdentifier()+' Using internal data "'+a.instanceIdentifier()+'" for IO graph linking')),this._from=a,this._from.on("drop",this._collectionDroppedWrap),this._io=new j(this._from,this,function(a){return c._handleChainIO.call(this,a,c)}),this._data.primaryKey(a.primaryKey());var d=a.find(this._querySettings.query,this._querySettings.options);return this._data.setData(d,{},b),this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this}return this._from},o.prototype._chainHandler=function(a){var b,c,d,e,f,g,h,i;switch(this.debug()&&console.log(this.logIdentifier()+" Received chain reactor data: "+a.type),a.type){case"setData":this.debug()&&console.log(this.logIdentifier()+' Setting data in underlying (internal) view collection "'+this._data.name()+'"');var j=this._from.find(this._querySettings.query,this._querySettings.options);this._data.setData(j),this.rebuildActiveBucket(this._querySettings.options);break;case"insert":if(this.debug()&&console.log(this.logIdentifier()+' Inserting some data into underlying (internal) view collection "'+this._data.name()+'"'),a.data.dataSet=this.decouple(a.data.dataSet),a.data.dataSet instanceof Array||(a.data.dataSet=[a.data.dataSet]),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data.dataSet,c=b.length,d=0;c>d;d++)e=this._activeBucket.insert(b[d]),this._data._insertHandle(b[d],e);else e=this._data._data.length,this._data._insertHandle(a.data.dataSet,e);break;case"update":if(this.debug()&&console.log(this.logIdentifier()+' Updating some data in underlying (internal) view collection "'+this._data.name()+'"'),g=this._data.primaryKey(),f=this._data._handleUpdate(a.data.query,a.data.update,a.data.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(c=f.length,d=0;c>d;d++)h=f[d],this._activeBucket.remove(h),i=this._data._data.indexOf(h),e=this._activeBucket.insert(h),i!==e&&this._data._updateSpliceMove(this._data._data,i,e);break;case"remove":if(this.debug()&&console.log(this.logIdentifier()+' Removing some data from underlying (internal) view collection "'+this._data.name()+'"'),this._data.remove(a.data.query,a.options),this._querySettings.options&&this._querySettings.options.$orderBy)for(b=a.data.dataSet,c=b.length,d=0;c>d;d++)this._activeBucket.remove(b[d])}},o.prototype._collectionDropped=function(a){a&&delete this._from},o.prototype.ensureIndex=function(){return this._data.ensureIndex.apply(this._data,arguments)},o.prototype.on=function(){return this._data.on.apply(this._data,arguments)},o.prototype.off=function(){return this._data.off.apply(this._data,arguments)},o.prototype.emit=function(){return this._data.emit.apply(this._data,arguments)},o.prototype.deferEmit=function(){return this._data.deferEmit.apply(this._data,arguments)},o.prototype.distinct=function(a,b,c){return this._data.distinct(a,b,c)},o.prototype.primaryKey=function(){return this._data.primaryKey()},o.prototype.drop=function(a){return this.isDropped()?!1:(this._from&&(this._from.off("drop",this._collectionDroppedWrap),this._from._removeView(this)),(this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Dropping"),this._state="dropped",this._io&&this._io.drop(),this._data&&this._data.drop(),this._db&&this._name&&delete this._db._view[this._name],this.emit("drop",this),a&&a(!1,!0),delete this._chain,delete this._from,delete this._data,delete this._io,delete this._listeners,delete this._querySettings,delete this._db,!0)},o.prototype.queryData=function(a,b,c){return void 0!==a&&(this._querySettings.query=a,a.$findSub&&!a.$findSub.$from&&(a.$findSub.$from=this._data.name()),a.$findSubOne&&!a.$findSubOne.$from&&(a.$findSubOne.$from=this._data.name())),void 0!==b&&(this._querySettings.options=b),(void 0!==a||void 0!==b)&&(void 0===c||c===!0)&&this.refresh(),void 0!==a&&this.emit("queryChange",a),void 0!==b&&this.emit("queryOptionsChange",b),void 0!==a||void 0!==b?this:this._querySettings},o.prototype.queryAdd=function(a,b,c){this._querySettings.query=this._querySettings.query||{};var d,e=this._querySettings.query;if(void 0!==a)for(d in a)a.hasOwnProperty(d)&&(void 0===e[d]||void 0!==e[d]&&b!==!1)&&(e[d]=a[d]);(void 0===c||c===!0)&&this.refresh(),void 0!==e&&this.emit("queryChange",e)},o.prototype.queryRemove=function(a,b){var c,d=this._querySettings.query;if(d){if(void 0!==a)for(c in a)a.hasOwnProperty(c)&&delete d[c];(void 0===b||b===!0)&&this.refresh(),void 0!==d&&this.emit("queryChange",d)}},o.prototype.query=new n({"":function(){return this._querySettings.query},object:function(a){return this.$main.call(this,a,void 0,!0)},"*, boolean":function(a,b){return this.$main.call(this,a,void 0,b)},"object, object":function(a,b){return this.$main.call(this,a,b,!0)},"*, *, boolean":function(a,b,c){return this.$main.call(this,a,b,c)},$main:function(a,b,c){return void 0!==a&&(this._querySettings.query=a,a.$findSub&&!a.$findSub.$from&&(a.$findSub.$from=this._data.name()),a.$findSubOne&&!a.$findSubOne.$from&&(a.$findSubOne.$from=this._data.name())),void 0!==b&&(this._querySettings.options=b),(void 0!==a||void 0!==b)&&(void 0===c||c===!0)&&this.refresh(),void 0!==a&&this.emit("queryChange",a),void 0!==b&&this.emit("queryOptionsChange",b),void 0!==a||void 0!==b?this:this._querySettings}}),o.prototype.orderBy=function(a){if(void 0!==a){var b=this.queryOptions()||{};return b.$orderBy=a,this.queryOptions(b),this}return(this.queryOptions()||{}).$orderBy},o.prototype.page=function(a){if(void 0!==a){var b=this.queryOptions()||{};return a!==b.$page&&(b.$page=a,this.queryOptions(b)),this}return(this.queryOptions()||{}).$page},o.prototype.pageFirst=function(){return this.page(0)},o.prototype.pageLast=function(){var a=this.cursor().pages,b=void 0!==a?a:0;return this.page(b-1)},o.prototype.pageScan=function(a){if(void 0!==a){var b=this.cursor().pages,c=this.queryOptions()||{},d=void 0!==c.$page?c.$page:0;return d+=a,0>d&&(d=0),d>=b&&(d=b-1),this.page(d)}},o.prototype.queryOptions=function(a,b){return void 0!==a?(this._querySettings.options=a,void 0===a.$decouple&&(a.$decouple=!0),void 0===b||b===!0?this.refresh():this.rebuildActiveBucket(a.$orderBy),void 0!==a&&this.emit("queryOptionsChange",a),this):this._querySettings.options},o.prototype.rebuildActiveBucket=function(a){if(a){var b=this._data._data,c=b.length;this._activeBucket=new k(a),this._activeBucket.primaryKey(this._data.primaryKey());for(var d=0;c>d;d++)this._activeBucket.insert(b[d])}else delete this._activeBucket},o.prototype.refresh=function(){var a,b,c,d,e=this;if(this._from&&(this._data.remove(),a=this._from.find(this._querySettings.query,this._querySettings.options),this.cursor(a.$cursor),this._data.insert(a),this._data._data.$cursor=a.$cursor,this._data._data.$cursor=a.$cursor),this._querySettings&&this._querySettings.options&&this._querySettings.options.$join&&this._querySettings.options.$join.length){if(e.__joinChange=e.__joinChange||function(){e._joinChange()},this._joinCollections&&this._joinCollections.length)for(c=0;c<this._joinCollections.length;c++)this._db.collection(this._joinCollections[c]).off("immediateChange",e.__joinChange);for(b=this._querySettings.options.$join,this._joinCollections=[],c=0;c<b.length;c++)for(d in b[c])b[c].hasOwnProperty(d)&&this._joinCollections.push(d);if(this._joinCollections.length)for(c=0;c<this._joinCollections.length;c++)this._db.collection(this._joinCollections[c]).on("immediateChange",e.__joinChange)}return this._querySettings.options&&this._querySettings.options.$orderBy?this.rebuildActiveBucket(this._querySettings.options.$orderBy):this.rebuildActiveBucket(),this},o.prototype._joinChange=function(a,b){this.emit("joinChange"),this.refresh()},o.prototype.count=function(){return this._data.count.apply(this._data,arguments)},o.prototype.subset=function(){return this._data.subset.apply(this._data,arguments)},o.prototype.transform=function(a){var b,c;return b=this._data.transform(),this._data.transform(a),c=this._data.transform(),c.enabled&&c.dataIn&&(b.enabled!==c.enabled||b.dataIn!==c.dataIn)&&this.refresh(),c},o.prototype.filter=function(a,b,c){return this._data.filter(a,b,c)},o.prototype.data=function(){return this._data},o.prototype.indexOf=function(){return this._data.indexOf.apply(this._data,arguments)},d.synthesize(o.prototype,"db",function(a){return a&&(this._data.db(a),this.debug(a.debug()),this._data.debug(a.debug())),this.$super.apply(this,arguments)}),d.synthesize(o.prototype,"state"),d.synthesize(o.prototype,"name"),d.synthesize(o.prototype,"cursor",function(a){return void 0===a?this._cursor||{}:void this.$super.apply(this,arguments)}),f.prototype.init=function(){this._view=[],h.apply(this,arguments)},f.prototype.view=function(a,b,c){if(this._db&&this._db._view){if(this._db._view[a])throw this.logIdentifier()+" Cannot create a view using this collection because a view with this name already exists: "+a;var d=new o(a,b,c).db(this._db).from(this);return this._view=this._view||[],this._view.push(d),d}},f.prototype._addView=g.prototype._addView=function(a){return void 0!==a&&this._view.push(a),this},f.prototype._removeView=g.prototype._removeView=function(a){if(void 0!==a){var b=this._view.indexOf(a);b>-1&&this._view.splice(b,1)}return this},e.prototype.init=function(){this._view={},i.apply(this,arguments)},e.prototype.view=function(a){var b=this;return a instanceof o?a:this._view[a]?this._view[a]:((this.debug()||this._db&&this._db.debug())&&console.log(this.logIdentifier()+" Creating view "+a),this._view[a]=new o(a).db(this),b.emit("create",b._view[a],"view",a),this._view[a])},e.prototype.viewExists=function(a){return Boolean(this._view[a])},e.prototype.views=function(){var a,b,c=[];for(b in this._view)this._view.hasOwnProperty(b)&&(a=this._view[b],c.push({name:b,count:a.count(),linked:void 0!==a.isLinked?a.isLinked():!1}));return c},d.finishModule("View"),b.exports=o},{"./ActiveBucket":3,"./Collection":6,"./CollectionGroup":7,"./Overload":27,"./ReactorIO":29,"./Shared":31}]},{},[1]);
node_modules/react-icons/ti/edit.js
bengimbel/Solstice-React-Contacts-Project
import React from 'react' import Icon from 'react-icon-base' const TiEdit = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m35.9 8.9l-4.8-4.8c-0.5-0.5-1.1-0.8-1.7-0.8-0.7 0-1.3 0.3-1.8 0.8l-5.9 5.9h-15c-1 0-1.7 0.7-1.7 1.7v21.6c0 1 0.8 1.7 1.7 1.7h21.6c1 0 1.7-0.7 1.7-1.7v-15l5.9-5.9c0.5-0.5 0.8-1.1 0.8-1.8s-0.3-1.2-0.8-1.7z m-16.7 15.6l-3.7-3.7 10.5-10.5 3.7 3.7-10.5 10.5z m-4.3-2.3l2.9 2.9-2.8-0.1-0.1-2.8z m11.8 9.5h-18.4v-18.4h10l-5.3 5.3c-0.5 0.5-0.8 1.4-1 2.2-0.3 0.8-0.3 1.7-0.3 2.4v5.1h5.1c0.7 0 1.8-0.1 2.6-0.4 0.8-0.4 1.5-0.6 2-1.1l5.3-5.1v10z m4.1-18.9l-3.6-3.6 2.2-2.2 3.6 3.6-2.2 2.2z"/></g> </Icon> ) export default TiEdit
src/components/FormItem/FormItem-test.js
joshblack/carbon-components-react
/** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import { shallow } from 'enzyme'; import FormItem from '../FormItem'; describe('FormItem', () => { it('should render', () => { const wrapper = shallow(<FormItem />); expect(wrapper).toMatchSnapshot(); }); });
examples/custom-server-express/pages/index.js
dizlexik/next.js
import React from 'react' import Link from 'next/link' export default () => ( <ul> <li><Link href='/b' as='/a'><a>a</a></Link></li> <li><Link href='/a' as='/b'><a>b</a></Link></li> </ul> )