From f901ffa8553b8f9b75a3b342b51ede682efc5edb Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Mon, 4 Sep 2017 21:24:31 +0100 Subject: [PATCH] Committed public compiled assets --- public/css/blue-twilight.css | 17 +- public/css/blue-twilight.min.css | 2 +- public/js/blue-twilight.js | 1172 ++++++++++++++++++------------ public/js/blue-twilight.min.js | 11 +- 4 files changed, 717 insertions(+), 485 deletions(-) diff --git a/public/css/blue-twilight.css b/public/css/blue-twilight.css index de81224..a804ca7 100644 --- a/public/css/blue-twilight.css +++ b/public/css/blue-twilight.css @@ -7,11 +7,6 @@ margin-top: 5px; } -.card-header.card-danger { - color: #fff; - font-weight: bold; -} - .photo .loading { background-color: #ffffff; display: none; @@ -28,6 +23,18 @@ .photo .loading img { margin-top: 40px; } +.album-slideshow-container #image-preview { + height: 600px; + max-width: 100%; + width: 800px; +} + +.album-slideshow-container .thumbnails { + overflow-x: scroll; + overflow-y: hidden; + white-space: nowrap; + width: auto; +} html { font-size: 14px !important; } diff --git a/public/css/blue-twilight.min.css b/public/css/blue-twilight.min.css index 16aa57a..85724dc 100644 --- a/public/css/blue-twilight.min.css +++ b/public/css/blue-twilight.min.css @@ -1,4 +1,4 @@ -.admin-sidebar-card{margin-bottom:15px}.album-expand-handle{cursor:pointer;margin-top:5px}.card-header.card-danger{color:#fff;font-weight:bold}.photo .loading{background-color:#fff;display:none;height:100%;left:0;opacity:.8;position:absolute;text-align:center;top:0;width:100%;z-index:1000}.photo .loading img{margin-top:40px}html{font-size:14px !important}button,input,optgroup,select,textarea{cursor:pointer;font-family:inherit !important}.album-photo-cards .card{margin-bottom:15px}.container,.container-fluid{margin-top:20px}.hidden{display:none}.tab-content{border:solid 1px #ddd;border-top:0;padding:20px}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,0.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.tt-hint{color:#999}.tt-menu{width:422px;margin-top:4px;padding:4px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.tt-suggestion{padding:3px 20px;line-height:24px}.tt-suggestion.tt-cursor,.tt-suggestion:hover{color:#fff;background-color:#0097cf}.tt-suggestion p{margin:0}/*! +.admin-sidebar-card{margin-bottom:15px}.album-expand-handle{cursor:pointer;margin-top:5px}.photo .loading{background-color:#fff;display:none;height:100%;left:0;opacity:.8;position:absolute;text-align:center;top:0;width:100%;z-index:1000}.photo .loading img{margin-top:40px}.album-slideshow-container #image-preview{height:600px;max-width:100%;width:800px}.album-slideshow-container .thumbnails{overflow-x:scroll;overflow-y:hidden;white-space:nowrap;width:auto}html{font-size:14px !important}button,input,optgroup,select,textarea{cursor:pointer;font-family:inherit !important}.album-photo-cards .card{margin-bottom:15px}.container,.container-fluid{margin-top:20px}.hidden{display:none}.tab-content{border:solid 1px #ddd;border-top:0;padding:20px}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tether-element.tether-theme-basic{max-width:100%;max-height:100%}.tether-element.tether-theme-basic .tether-content{border-radius:5px;box-shadow:0 2px 8px rgba(0,0,0,0.2);font-family:inherit;background:#fff;color:inherit;padding:1em;font-size:1.1em;line-height:1.5em}.tether-element,.tether-element:after,.tether-element:before,.tether-element *,.tether-element *:after,.tether-element *:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}.tt-query{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.tt-hint{color:#999}.tt-menu{width:422px;margin-top:4px;padding:4px 0;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.tt-suggestion{padding:3px 20px;line-height:24px}.tt-suggestion.tt-cursor,.tt-suggestion:hover{color:#fff;background-color:#0097cf}.tt-suggestion p{margin:0}/*! * Bootstrap v4.0.0-beta (https://getbootstrap.com) * Copyright 2011-2017 The Bootstrap Authors * Copyright 2011-2017 Twitter, Inc. diff --git a/public/js/blue-twilight.js b/public/js/blue-twilight.js index 59f4ea3..ec1ee13 100644 --- a/public/js/blue-twilight.js +++ b/public/js/blue-twilight.js @@ -10283,7 +10283,7 @@ return jQuery; "", header: "", footer: "", @@ -10866,7 +10866,7 @@ return jQuery; var closeButton = $(templates.closeButton); if (options.title) { - dialog.find(".modal-header").prepend(closeButton); + dialog.find(".modal-header").append(closeButton); } else { closeButton.css("margin-top", "-10px").prependTo(body); } @@ -22656,9 +22656,6 @@ function EditPhotosViewModel(album_id, language, urls) { // Save the photo ID this.photoIDs = []; this.photoIDs.push(photo_id); - - // Hide the dropdown - $(link_item).dropdown('toggle'); }, switchToUploadTab: function (e) { $('.nav-tabs a[href="#upload-tab"]').tab('show'); @@ -25363,7 +25360,13 @@ function StorageLocationViewModel() * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -const nativeHints = ['native code', '[object MutationObserverConstructor]']; +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.Popper = factory()); +}(this, (function () { 'use strict'; + +var nativeHints = ['native code', '[object MutationObserverConstructor]']; /** * Determine if a function is implemented natively (as opposed to a polyfill). @@ -25372,12 +25375,16 @@ const nativeHints = ['native code', '[object MutationObserverConstructor]']; * @argument {Function | undefined} fn the function to check * @returns {Boolean} */ -var isNative = (fn => nativeHints.some(hint => (fn || '').toString().indexOf(hint) > -1)); +var isNative = (function (fn) { + return nativeHints.some(function (hint) { + return (fn || '').toString().indexOf(hint) > -1; + }); +}); -const isBrowser = typeof window !== 'undefined'; -const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; -let timeoutDuration = 0; -for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) { +var isBrowser = typeof window !== 'undefined'; +var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; +var timeoutDuration = 0; +for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { timeoutDuration = 1; break; @@ -25385,21 +25392,21 @@ for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) { } function microtaskDebounce(fn) { - let scheduled = false; - let i = 0; - const elem = document.createElement('span'); + var scheduled = false; + var i = 0; + var elem = document.createElement('span'); // MutationObserver provides a mechanism for scheduling microtasks, which // are scheduled *before* the next task. This gives us a way to debounce // a function but ensure it's called *before* the next paint. - const observer = new MutationObserver(() => { + var observer = new MutationObserver(function () { fn(); scheduled = false; }); observer.observe(elem, { attributes: true }); - return () => { + return function () { if (!scheduled) { scheduled = true; elem.setAttribute('x-index', i); @@ -25409,11 +25416,11 @@ function microtaskDebounce(fn) { } function taskDebounce(fn) { - let scheduled = false; - return () => { + var scheduled = false; + return function () { if (!scheduled) { scheduled = true; - setTimeout(() => { + setTimeout(function () { scheduled = false; fn(); }, timeoutDuration); @@ -25425,7 +25432,7 @@ function taskDebounce(fn) { // these rely on Mutation Events which only occur when an element is connected // to the DOM. The algorithm used in this module does not use a connected element, // and so we must ensure that a *native* MutationObserver is available. -const supportsNativeMutationObserver = isBrowser && isNative(window.MutationObserver); +var supportsNativeMutationObserver = isBrowser && isNative(window.MutationObserver); /** * Create a debounced version of a method, that's asynchronously deferred @@ -25446,7 +25453,7 @@ var debounce = supportsNativeMutationObserver ? microtaskDebounce : taskDebounce * @returns {Boolean} answer to: is a function? */ function isFunction(functionToCheck) { - const getType = {}; + var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; } @@ -25462,7 +25469,7 @@ function getStyleComputedProperty(element, property) { return []; } // NOTE: 1 DOM access here - const css = window.getComputedStyle(element, null); + var css = window.getComputedStyle(element, null); return property ? css[property] : css; } @@ -25494,7 +25501,12 @@ function getScrollParent(element) { } // Firefox want us to check `-x` and `-y` variations as well - const { overflow, overflowX, overflowY } = getStyleComputedProperty(element); + + var _getStyleComputedProp = getStyleComputedProperty(element), + overflow = _getStyleComputedProp.overflow, + overflowX = _getStyleComputedProp.overflowX, + overflowY = _getStyleComputedProp.overflowY; + if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) { return element; } @@ -25511,8 +25523,8 @@ function getScrollParent(element) { */ function getOffsetParent(element) { // NOTE: 1 DOM access here - const offsetParent = element && element.offsetParent; - const nodeName = offsetParent && offsetParent.nodeName; + var offsetParent = element && element.offsetParent; + var nodeName = offsetParent && offsetParent.nodeName; if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { return window.document.documentElement; @@ -25528,7 +25540,8 @@ function getOffsetParent(element) { } function isOffsetContainer(element) { - const { nodeName } = element; + var nodeName = element.nodeName; + if (nodeName === 'BODY') { return false; } @@ -25565,17 +25578,18 @@ function findCommonOffsetParent(element1, element2) { } // Here we make sure to give as "start" the element that comes first in the DOM - const order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; - const start = order ? element1 : element2; - const end = order ? element2 : element1; + var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; + var start = order ? element1 : element2; + var end = order ? element2 : element1; // Get common ancestor container - const range = document.createRange(); + var range = document.createRange(); range.setStart(start, 0); range.setEnd(end, 0); - const { commonAncestorContainer } = range; + var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document + if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { if (isOffsetContainer(commonAncestorContainer)) { return commonAncestorContainer; @@ -25585,7 +25599,7 @@ function findCommonOffsetParent(element1, element2) { } // one of the nodes is inside shadowDOM, find which one - const element1root = getRoot(element1); + var element1root = getRoot(element1); if (element1root.host) { return findCommonOffsetParent(element1root.host, element2); } else { @@ -25601,13 +25615,15 @@ function findCommonOffsetParent(element1, element2) { * @argument {String} side `top` or `left` * @returns {number} amount of scrolled pixels */ -function getScroll(element, side = 'top') { - const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; - const nodeName = element.nodeName; +function getScroll(element) { + var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; + + var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; + var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { - const html = window.document.documentElement; - const scrollingElement = window.document.scrollingElement || html; + var html = window.document.documentElement; + var scrollingElement = window.document.scrollingElement || html; return scrollingElement[upperSide]; } @@ -25623,10 +25639,12 @@ function getScroll(element, side = 'top') { * @param {Boolean} subtract - set to true if you want to subtract the scroll values * @return {Object} rect - The modifier rect object */ -function includeScroll(rect, element, subtract = false) { - const scrollTop = getScroll(element, 'top'); - const scrollLeft = getScroll(element, 'left'); - const modifier = subtract ? -1 : 1; +function includeScroll(rect, element) { + var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + var modifier = subtract ? -1 : 1; rect.top += scrollTop * modifier; rect.bottom += scrollTop * modifier; rect.left += scrollLeft * modifier; @@ -25645,10 +25663,10 @@ function includeScroll(rect, element, subtract = false) { */ function getBordersSize(styles, axis) { - const sideA = axis === 'x' ? 'Left' : 'Top'; - const sideB = sideA === 'Left' ? 'Right' : 'Bottom'; + var sideA = axis === 'x' ? 'Left' : 'Top'; + var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; - return +styles[`border${sideA}Width`].split('px')[0] + +styles[`border${sideB}Width`].split('px')[0]; + return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0]; } /** @@ -25657,7 +25675,7 @@ function getBordersSize(styles, axis) { * @memberof Popper.Utils * @returns {Boolean} isIE10 */ -let isIE10 = undefined; +var isIE10 = undefined; var isIE10$1 = function () { if (isIE10 === undefined) { @@ -25667,13 +25685,13 @@ var isIE10$1 = function () { }; function getSize(axis, body, html, computedStyle) { - return Math.max(body[`offset${axis}`], body[`scroll${axis}`], html[`client${axis}`], html[`offset${axis}`], html[`scroll${axis}`], isIE10$1() ? html[`offset${axis}`] + computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`] + computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`] : 0); + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); } function getWindowSizes() { - const body = window.document.body; - const html = window.document.documentElement; - const computedStyle = isIE10$1() && window.getComputedStyle(html); + var body = window.document.body; + var html = window.document.documentElement; + var computedStyle = isIE10$1() && window.getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), @@ -25681,6 +25699,49 @@ function getWindowSizes() { }; } +var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + + + + + +var defineProperty = function (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 _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; @@ -25717,7 +25778,7 @@ function getClientRect(offsets) { * @return {Object} client rect */ function getBoundingClientRect(element) { - let rect = {}; + var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't // considered in DOM in some circumstances... @@ -25725,8 +25786,8 @@ function getBoundingClientRect(element) { if (isIE10$1()) { try { rect = element.getBoundingClientRect(); - const scrollTop = getScroll(element, 'top'); - const scrollLeft = getScroll(element, 'left'); + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); rect.top += scrollTop; rect.left += scrollLeft; rect.bottom += scrollTop; @@ -25736,7 +25797,7 @@ function getBoundingClientRect(element) { rect = element.getBoundingClientRect(); } - const result = { + var result = { left: rect.left, top: rect.top, width: rect.right - rect.left, @@ -25744,17 +25805,17 @@ function getBoundingClientRect(element) { }; // subtract scrollbar size from sizes - const sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; - const width = sizes.width || element.clientWidth || result.right - result.left; - const height = sizes.height || element.clientHeight || result.bottom - result.top; + var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; + var width = sizes.width || element.clientWidth || result.right - result.left; + var height = sizes.height || element.clientHeight || result.bottom - result.top; - let horizScrollbar = element.offsetWidth - width; - let vertScrollbar = element.offsetHeight - height; + var horizScrollbar = element.offsetWidth - width; + var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border` // we make this check conditional for performance reasons if (horizScrollbar || vertScrollbar) { - const styles = getStyleComputedProperty(element); + var styles = getStyleComputedProperty(element); horizScrollbar -= getBordersSize(styles, 'x'); vertScrollbar -= getBordersSize(styles, 'y'); @@ -25766,17 +25827,17 @@ function getBoundingClientRect(element) { } function getOffsetRectRelativeToArbitraryNode(children, parent) { - const isIE10 = isIE10$1(); - const isHTML = parent.nodeName === 'HTML'; - const childrenRect = getBoundingClientRect(children); - const parentRect = getBoundingClientRect(parent); - const scrollParent = getScrollParent(children); + var isIE10 = isIE10$1(); + var isHTML = parent.nodeName === 'HTML'; + var childrenRect = getBoundingClientRect(children); + var parentRect = getBoundingClientRect(parent); + var scrollParent = getScrollParent(children); - const styles = getStyleComputedProperty(parent); - const borderTopWidth = +styles.borderTopWidth.split('px')[0]; - const borderLeftWidth = +styles.borderLeftWidth.split('px')[0]; + var styles = getStyleComputedProperty(parent); + var borderTopWidth = +styles.borderTopWidth.split('px')[0]; + var borderLeftWidth = +styles.borderLeftWidth.split('px')[0]; - let offsets = getClientRect({ + var offsets = getClientRect({ top: childrenRect.top - parentRect.top - borderTopWidth, left: childrenRect.left - parentRect.left - borderLeftWidth, width: childrenRect.width, @@ -25790,8 +25851,8 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { // differently when margins are applied to it. The margins are included in // the box of the documentElement, in the other cases not. if (!isIE10 && isHTML) { - const marginTop = +styles.marginTop.split('px')[0]; - const marginLeft = +styles.marginLeft.split('px')[0]; + var marginTop = +styles.marginTop.split('px')[0]; + var marginLeft = +styles.marginLeft.split('px')[0]; offsets.top -= borderTopWidth - marginTop; offsets.bottom -= borderTopWidth - marginTop; @@ -25811,19 +25872,19 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { } function getViewportOffsetRectRelativeToArtbitraryNode(element) { - const html = window.document.documentElement; - const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); - const width = Math.max(html.clientWidth, window.innerWidth || 0); - const height = Math.max(html.clientHeight, window.innerHeight || 0); + var html = window.document.documentElement; + var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); + var width = Math.max(html.clientWidth, window.innerWidth || 0); + var height = Math.max(html.clientHeight, window.innerHeight || 0); - const scrollTop = getScroll(html); - const scrollLeft = getScroll(html, 'left'); + var scrollTop = getScroll(html); + var scrollLeft = getScroll(html, 'left'); - const offset = { + var offset = { top: scrollTop - relativeOffset.top + relativeOffset.marginTop, left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, - width, - height + width: width, + height: height }; return getClientRect(offset); @@ -25838,7 +25899,7 @@ function getViewportOffsetRectRelativeToArtbitraryNode(element) { * @returns {Boolean} answer to "isFixed?" */ function isFixed(element) { - const nodeName = element.nodeName; + var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { return false; } @@ -25860,15 +25921,15 @@ function isFixed(element) { */ function getBoundaries(popper, reference, padding, boundariesElement) { // NOTE: 1 DOM access here - let boundaries = { top: 0, left: 0 }; - const offsetParent = findCommonOffsetParent(popper, reference); + var boundaries = { top: 0, left: 0 }; + var offsetParent = findCommonOffsetParent(popper, reference); // Handle viewport case if (boundariesElement === 'viewport') { boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent); } else { // Handle other cases based on DOM element used as boundaries - let boundariesNode; + var boundariesNode = void 0; if (boundariesElement === 'scrollParent') { boundariesNode = getScrollParent(getParentNode(popper)); if (boundariesNode.nodeName === 'BODY') { @@ -25880,11 +25941,14 @@ function getBoundaries(popper, reference, padding, boundariesElement) { boundariesNode = boundariesElement; } - const offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent); + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent); // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { - const { height, width } = getWindowSizes(); + var _getWindowSizes = getWindowSizes(), + height = _getWindowSizes.height, + width = _getWindowSizes.width; + boundaries.top += offsets.top - offsets.marginTop; boundaries.bottom = height + offsets.top; boundaries.left += offsets.left - offsets.marginLeft; @@ -25904,7 +25968,10 @@ function getBoundaries(popper, reference, padding, boundariesElement) { return boundaries; } -function getArea({ width, height }) { +function getArea(_ref) { + var width = _ref.width, + height = _ref.height; + return width * height; } @@ -25917,14 +25984,16 @@ function getArea({ width, height }) { * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ -function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement, padding = 0) { +function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { + var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + if (placement.indexOf('auto') === -1) { return placement; } - const boundaries = getBoundaries(popper, reference, padding, boundariesElement); + var boundaries = getBoundaries(popper, reference, padding, boundariesElement); - const rects = { + var rects = { top: { width: boundaries.width, height: refRect.top - boundaries.top @@ -25943,19 +26012,27 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE } }; - const sortedAreas = Object.keys(rects).map(key => _extends({ - key - }, rects[key], { - area: getArea(rects[key]) - })).sort((a, b) => b.area - a.area); + var sortedAreas = Object.keys(rects).map(function (key) { + return _extends({ + key: key + }, rects[key], { + area: getArea(rects[key]) + }); + }).sort(function (a, b) { + return b.area - a.area; + }); - const filteredAreas = sortedAreas.filter(({ width, height }) => width >= popper.clientWidth && height >= popper.clientHeight); + var filteredAreas = sortedAreas.filter(function (_ref2) { + var width = _ref2.width, + height = _ref2.height; + return width >= popper.clientWidth && height >= popper.clientHeight; + }); - const computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; + var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; - const variation = placement.split('-')[1]; + var variation = placement.split('-')[1]; - return computedPlacement + (variation ? `-${variation}` : ''); + return computedPlacement + (variation ? '-' + variation : ''); } /** @@ -25968,7 +26045,7 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE * @returns {Object} An object containing the offsets which will be applied to the popper */ function getReferenceOffsets(state, popper, reference) { - const commonOffsetParent = findCommonOffsetParent(popper, reference); + var commonOffsetParent = findCommonOffsetParent(popper, reference); return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent); } @@ -25980,10 +26057,10 @@ function getReferenceOffsets(state, popper, reference) { * @returns {Object} object containing width and height properties */ function getOuterSizes(element) { - const styles = window.getComputedStyle(element); - const x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); - const y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); - const result = { + var styles = window.getComputedStyle(element); + var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); + var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); + var result = { width: element.offsetWidth + y, height: element.offsetHeight + x }; @@ -25998,8 +26075,10 @@ function getOuterSizes(element) { * @returns {String} flipped placement */ function getOppositePlacement(placement) { - const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; - return placement.replace(/left|right|bottom|top/g, matched => hash[matched]); + var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); } /** @@ -26016,20 +26095,20 @@ function getPopperOffsets(popper, referenceOffsets, placement) { placement = placement.split('-')[0]; // Get popper node sizes - const popperRect = getOuterSizes(popper); + var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object - const popperOffsets = { + var popperOffsets = { width: popperRect.width, height: popperRect.height }; // depending by the popper placement we have to compute its offsets slightly differently - const isHoriz = ['right', 'left'].indexOf(placement) !== -1; - const mainSide = isHoriz ? 'top' : 'left'; - const secondarySide = isHoriz ? 'left' : 'top'; - const measurement = isHoriz ? 'height' : 'width'; - const secondaryMeasurement = !isHoriz ? 'height' : 'width'; + var isHoriz = ['right', 'left'].indexOf(placement) !== -1; + var mainSide = isHoriz ? 'top' : 'left'; + var secondarySide = isHoriz ? 'left' : 'top'; + var measurement = isHoriz ? 'height' : 'width'; + var secondaryMeasurement = !isHoriz ? 'height' : 'width'; popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; if (placement === secondarySide) { @@ -26072,11 +26151,15 @@ function find(arr, check) { function findIndex(arr, prop, value) { // use native findIndex if supported if (Array.prototype.findIndex) { - return arr.findIndex(cur => cur[prop] === value); + return arr.findIndex(function (cur) { + return cur[prop] === value; + }); } // use `find` + `indexOf` if `findIndex` isn't supported - const match = find(arr, obj => obj[prop] === value); + var match = find(arr, function (obj) { + return obj[prop] === value; + }); return arr.indexOf(match); } @@ -26091,13 +26174,13 @@ function findIndex(arr, prop, value) { * @returns {dataObject} */ function runModifiers(modifiers, data, ends) { - const modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); + var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); - modifiersToRun.forEach(modifier => { + modifiersToRun.forEach(function (modifier) { if (modifier.function) { console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); } - const fn = modifier.function || modifier.fn; + var fn = modifier.function || modifier.fn; if (modifier.enabled && isFunction(fn)) { // Add properties to offsets to make them a complete clientRect object // we do this before each modifier to make sure the previous one doesn't @@ -26125,7 +26208,7 @@ function update() { return; } - let data = { + var data = { instance: this, styles: {}, arrowStyles: {}, @@ -26169,7 +26252,11 @@ function update() { * @returns {Boolean} */ function isModifierEnabled(modifiers, modifierName) { - return modifiers.some(({ name, enabled }) => enabled && name === modifierName); + return modifiers.some(function (_ref) { + var name = _ref.name, + enabled = _ref.enabled; + return enabled && name === modifierName; + }); } /** @@ -26180,12 +26267,12 @@ function isModifierEnabled(modifiers, modifierName) { * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) */ function getSupportedPropertyName(property) { - const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; - const upperProp = property.charAt(0).toUpperCase() + property.slice(1); + var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; + var upperProp = property.charAt(0).toUpperCase() + property.slice(1); - for (let i = 0; i < prefixes.length - 1; i++) { - const prefix = prefixes[i]; - const toCheck = prefix ? `${prefix}${upperProp}` : property; + for (var i = 0; i < prefixes.length - 1; i++) { + var prefix = prefixes[i]; + var toCheck = prefix ? '' + prefix + upperProp : property; if (typeof window.document.body.style[toCheck] !== 'undefined') { return toCheck; } @@ -26221,8 +26308,8 @@ function destroy() { } function attachToScrollParents(scrollParent, event, callback, scrollParents) { - const isBody = scrollParent.nodeName === 'BODY'; - const target = isBody ? window : scrollParent; + var isBody = scrollParent.nodeName === 'BODY'; + var target = isBody ? window : scrollParent; target.addEventListener(event, callback, { passive: true }); if (!isBody) { @@ -26243,7 +26330,7 @@ function setupEventListeners(reference, options, state, updateBound) { window.addEventListener('resize', state.updateBound, { passive: true }); // Scroll event listener on scroll parents - const scrollElement = getScrollParent(reference); + var scrollElement = getScrollParent(reference); attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); state.scrollElement = scrollElement; state.eventsEnabled = true; @@ -26274,7 +26361,7 @@ function removeEventListeners(reference, state) { window.removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents - state.scrollParents.forEach(target => { + state.scrollParents.forEach(function (target) { target.removeEventListener('scroll', state.updateBound); }); @@ -26320,8 +26407,8 @@ function isNumeric(n) { * Object with a list of properties and values which will be applied to the element */ function setStyles(element, styles) { - Object.keys(styles).forEach(prop => { - let unit = ''; + Object.keys(styles).forEach(function (prop) { + var unit = ''; // add unit if the value is numeric and is one of the following if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { unit = 'px'; @@ -26340,7 +26427,7 @@ function setStyles(element, styles) { */ function setAttributes(element, attributes) { Object.keys(attributes).forEach(function (prop) { - const value = attributes[prop]; + var value = attributes[prop]; if (value !== false) { element.setAttribute(prop, attributes[prop]); } else { @@ -26389,12 +26476,12 @@ function applyStyle(data) { */ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { // compute reference element offsets - const referenceOffsets = getReferenceOffsets(state, popper, reference); + var referenceOffsets = getReferenceOffsets(state, popper, reference); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalPlacement to know the original value - const placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); + var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); popper.setAttribute('x-placement', placement); @@ -26413,39 +26500,43 @@ function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { * @returns {Object} The data object, properly modified */ function computeStyle(data, options) { - const { x, y } = options; - const { popper } = data.offsets; + var x = options.x, + y = options.y; + var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2 - const legacyGpuAccelerationOption = find(data.instance.modifiers, modifier => modifier.name === 'applyStyle').gpuAcceleration; + + var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'applyStyle'; + }).gpuAcceleration; if (legacyGpuAccelerationOption !== undefined) { console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); } - const gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; + var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; - const offsetParent = getOffsetParent(data.instance.popper); - const offsetParentRect = getBoundingClientRect(offsetParent); + var offsetParent = getOffsetParent(data.instance.popper); + var offsetParentRect = getBoundingClientRect(offsetParent); // Styles - const styles = { + var styles = { position: popper.position }; // floor sides to avoid blurry text - const offsets = { + var offsets = { left: Math.floor(popper.left), top: Math.floor(popper.top), bottom: Math.floor(popper.bottom), right: Math.floor(popper.right) }; - const sideA = x === 'bottom' ? 'top' : 'bottom'; - const sideB = y === 'right' ? 'left' : 'right'; + var sideA = x === 'bottom' ? 'top' : 'bottom'; + var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported, // we use `translate3d` to apply the position to the popper we // automatically use the supported prefixed version if needed - const prefixedProperty = getSupportedPropertyName('transform'); + var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?) // If the content of the popper grows once it's been positioned, it @@ -26456,7 +26547,8 @@ function computeStyle(data, options) { // If we position a popper on top of a reference element, we can set // `x` to `top` to make the popper grow towards its top instead of // its bottom. - let left, top; + var left = void 0, + top = void 0; if (sideA === 'bottom') { top = -offsetParentRect.height + offsets.bottom; } else { @@ -26468,21 +26560,21 @@ function computeStyle(data, options) { left = offsets.left; } if (gpuAcceleration && prefixedProperty) { - styles[prefixedProperty] = `translate3d(${left}px, ${top}px, 0)`; + styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; styles[sideA] = 0; styles[sideB] = 0; styles.willChange = 'transform'; } else { // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties - const invertTop = sideA === 'bottom' ? -1 : 1; - const invertLeft = sideB === 'right' ? -1 : 1; + var invertTop = sideA === 'bottom' ? -1 : 1; + var invertLeft = sideB === 'right' ? -1 : 1; styles[sideA] = top * invertTop; styles[sideB] = left * invertLeft; - styles.willChange = `${sideA}, ${sideB}`; + styles.willChange = sideA + ', ' + sideB; } // Attributes - const attributes = { + var attributes = { 'x-placement': data.placement }; @@ -26505,16 +26597,19 @@ function computeStyle(data, options) { * @returns {Boolean} */ function isModifierRequired(modifiers, requestingName, requestedName) { - const requesting = find(modifiers, ({ name }) => name === requestingName); + var requesting = find(modifiers, function (_ref) { + var name = _ref.name; + return name === requestingName; + }); - const isRequired = !!requesting && modifiers.some(modifier => { + var isRequired = !!requesting && modifiers.some(function (modifier) { return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; }); if (!isRequired) { - const requesting = `\`${requestingName}\``; - const requested = `\`${requestedName}\``; - console.warn(`${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`); + var _requesting = '`' + requestingName + '`'; + var requested = '`' + requestedName + '`'; + console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); } return isRequired; } @@ -26532,7 +26627,7 @@ function arrow(data, options) { return data; } - let arrowElement = options.element; + var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector if (typeof arrowElement === 'string') { @@ -26551,16 +26646,19 @@ function arrow(data, options) { } } - const placement = data.placement.split('-')[0]; - const { popper, reference } = data.offsets; - const isVertical = ['left', 'right'].indexOf(placement) !== -1; + var placement = data.placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; - const len = isVertical ? 'height' : 'width'; - const sideCapitalized = isVertical ? 'Top' : 'Left'; - const side = sideCapitalized.toLowerCase(); - const altSide = isVertical ? 'left' : 'top'; - const opSide = isVertical ? 'bottom' : 'right'; - const arrowElementSize = getOuterSizes(arrowElement)[len]; + var isVertical = ['left', 'right'].indexOf(placement) !== -1; + + var len = isVertical ? 'height' : 'width'; + var sideCapitalized = isVertical ? 'Top' : 'Left'; + var side = sideCapitalized.toLowerCase(); + var altSide = isVertical ? 'left' : 'top'; + var opSide = isVertical ? 'bottom' : 'right'; + var arrowElementSize = getOuterSizes(arrowElement)[len]; // // extends keepTogether behavior making sure the popper and its @@ -26577,12 +26675,12 @@ function arrow(data, options) { } // compute center of the popper - const center = reference[side] + reference[len] / 2 - arrowElementSize / 2; + var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets // take popper margin in account because we don't have this info available - const popperMarginSide = getStyleComputedProperty(data.instance.popper, `margin${sideCapitalized}`).replace('px', ''); - let sideValue = center - getClientRect(data.offsets.popper)[side] - popperMarginSide; + var popperMarginSide = getStyleComputedProperty(data.instance.popper, 'margin' + sideCapitalized).replace('px', ''); + var sideValue = center - getClientRect(data.offsets.popper)[side] - popperMarginSide; // prevent arrowElement from being placed not contiguously to its popper sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); @@ -26645,7 +26743,7 @@ function getOppositeVariation(variation) { var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; // Get rid of `auto` `auto-start` and `auto-end` -const validPlacements = placements.slice(3); +var validPlacements = placements.slice(3); /** * Given an initial placement, returns all the subsequent placements @@ -26657,13 +26755,15 @@ const validPlacements = placements.slice(3); * @argument {Boolean} counter - Set to true to walk the placements counterclockwise * @returns {Array} placements including their variations */ -function clockwise(placement, counter = false) { - const index = validPlacements.indexOf(placement); - const arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); +function clockwise(placement) { + var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var index = validPlacements.indexOf(placement); + var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); return counter ? arr.reverse() : arr; } -const BEHAVIORS = { +var BEHAVIORS = { FLIP: 'flip', CLOCKWISE: 'clockwise', COUNTERCLOCKWISE: 'counterclockwise' @@ -26687,13 +26787,13 @@ function flip(data, options) { return data; } - const boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement); + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement); - let placement = data.placement.split('-')[0]; - let placementOpposite = getOppositePlacement(placement); - let variation = data.placement.split('-')[1] || ''; + var placement = data.placement.split('-')[0]; + var placementOpposite = getOppositePlacement(placement); + var variation = data.placement.split('-')[1] || ''; - let flipOrder = []; + var flipOrder = []; switch (options.behavior) { case BEHAVIORS.FLIP: @@ -26709,7 +26809,7 @@ function flip(data, options) { flipOrder = options.behavior; } - flipOrder.forEach((step, index) => { + flipOrder.forEach(function (step, index) { if (placement !== step || flipOrder.length === index + 1) { return data; } @@ -26717,23 +26817,23 @@ function flip(data, options) { placement = data.placement.split('-')[0]; placementOpposite = getOppositePlacement(placement); - const popperOffsets = data.offsets.popper; - const refOffsets = data.offsets.reference; + var popperOffsets = data.offsets.popper; + var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here - const floor = Math.floor; - const overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); + var floor = Math.floor; + var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); - const overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); - const overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); - const overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); - const overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); + var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); + var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); + var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); + var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); - const overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; + var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required - const isVertical = ['top', 'bottom'].indexOf(placement) !== -1; - const flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); if (overlapsRef || overflowsBoundaries || flippedVariation) { // this boolean to detect any flip loop @@ -26767,13 +26867,16 @@ function flip(data, options) { * @returns {Object} The data object, properly modified */ function keepTogether(data) { - const { popper, reference } = data.offsets; - const placement = data.placement.split('-')[0]; - const floor = Math.floor; - const isVertical = ['top', 'bottom'].indexOf(placement) !== -1; - const side = isVertical ? 'right' : 'bottom'; - const opSide = isVertical ? 'left' : 'top'; - const measurement = isVertical ? 'width' : 'height'; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; + + var placement = data.placement.split('-')[0]; + var floor = Math.floor; + var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; + var side = isVertical ? 'right' : 'bottom'; + var opSide = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; if (popper[side] < floor(reference[opSide])) { data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; @@ -26799,9 +26902,9 @@ function keepTogether(data) { */ function toValue(str, measurement, popperOffsets, referenceOffsets) { // separate value from unit - const split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); - const value = +split[1]; - const unit = split[2]; + var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); + var value = +split[1]; + var unit = split[2]; // If it's not a number it's an operator, I guess if (!value) { @@ -26809,7 +26912,7 @@ function toValue(str, measurement, popperOffsets, referenceOffsets) { } if (unit.indexOf('%') === 0) { - let element; + var element = void 0; switch (unit) { case '%p': element = popperOffsets; @@ -26820,11 +26923,11 @@ function toValue(str, measurement, popperOffsets, referenceOffsets) { element = referenceOffsets; } - const rect = getClientRect(element); + var rect = getClientRect(element); return rect[measurement] / 100 * value; } else if (unit === 'vh' || unit === 'vw') { // if is a vh or vw, we calculate the size based on the viewport - let size; + var size = void 0; if (unit === 'vh') { size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); } else { @@ -26850,20 +26953,24 @@ function toValue(str, measurement, popperOffsets, referenceOffsets) { * @returns {Array} a two cells array with x and y offsets in numbers */ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { - const offsets = [0, 0]; + var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width // in this way the first offset will use an axis and the second one // will use the other one - const useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; + var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands // The regex addresses values with the plus or minus sign in front (+10, -20, etc) - const fragments = offset.split(/(\+|\-)/).map(frag => frag.trim()); + var fragments = offset.split(/(\+|\-)/).map(function (frag) { + return frag.trim(); + }); // Detect if the offset string contains a pair of values or a single one // they could be separated by comma or space - const divider = fragments.indexOf(find(fragments, frag => frag.search(/,|\s/) !== -1)); + var divider = fragments.indexOf(find(fragments, function (frag) { + return frag.search(/,|\s/) !== -1; + })); if (fragments[divider] && fragments[divider].indexOf(',') === -1) { console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); @@ -26871,18 +26978,18 @@ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { // If divider is found, we divide the list of values and operands to divide // them by ofset X and Y. - const splitRegex = /\s*,\s*|\s+/; - let ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; + var splitRegex = /\s*,\s*|\s+/; + var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; // Convert the values with units to absolute pixels to allow our computations - ops = ops.map((op, index) => { + ops = ops.map(function (op, index) { // Most of the units rely on the orientation of the popper - const measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; - let mergeWithPrevious = false; + var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; + var mergeWithPrevious = false; return op // This aggregates any `+` or `-` sign that aren't considered operators // e.g.: 10 + +5 => [10, +, +5] - .reduce((a, b) => { + .reduce(function (a, b) { if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { a[a.length - 1] = b; mergeWithPrevious = true; @@ -26896,12 +27003,14 @@ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { } }, []) // Here we convert the string values into number values (in px) - .map(str => toValue(str, measurement, popperOffsets, referenceOffsets)); + .map(function (str) { + return toValue(str, measurement, popperOffsets, referenceOffsets); + }); }); // Loop trough the offsets arrays and execute the operations - ops.forEach((op, index) => { - op.forEach((frag, index2) => { + ops.forEach(function (op, index) { + op.forEach(function (frag, index2) { if (isNumeric(frag)) { offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); } @@ -26919,11 +27028,16 @@ function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { * The offset value as described in the modifier description * @returns {Object} The data object, properly modified */ -function offset(data, { offset }) { - const { placement, offsets: { popper, reference } } = data; - const basePlacement = placement.split('-')[0]; +function offset(data, _ref) { + var offset = _ref.offset; + var placement = data.placement, + _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; - let offsets; + var basePlacement = placement.split('-')[0]; + + var offsets = void 0; if (isNumeric(+offset)) { offsets = [+offset, 0]; } else { @@ -26956,7 +27070,7 @@ function offset(data, { offset }) { * @returns {Object} The data object, properly modified */ function preventOverflow(data, options) { - let boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); + var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to // go one step up and use the next offsetParent as reference to @@ -26965,32 +27079,32 @@ function preventOverflow(data, options) { boundariesElement = getOffsetParent(boundariesElement); } - const boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement); + var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement); options.boundaries = boundaries; - const order = options.priority; - let popper = data.offsets.popper; + var order = options.priority; + var popper = data.offsets.popper; - const check = { - primary(placement) { - let value = popper[placement]; + var check = { + primary: function primary(placement) { + var value = popper[placement]; if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { value = Math.max(popper[placement], boundaries[placement]); } - return { [placement]: value }; + return defineProperty({}, placement, value); }, - secondary(placement) { - const mainSide = placement === 'right' ? 'left' : 'top'; - let value = popper[mainSide]; + secondary: function secondary(placement) { + var mainSide = placement === 'right' ? 'left' : 'top'; + var value = popper[mainSide]; if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); } - return { [mainSide]: value }; + return defineProperty({}, mainSide, value); } }; - order.forEach(placement => { - const side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; + order.forEach(function (placement) { + var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; popper = _extends({}, popper, check[side](placement)); }); @@ -27007,22 +27121,23 @@ function preventOverflow(data, options) { * @returns {Object} The data object, properly modified */ function shift(data) { - const placement = data.placement; - const basePlacement = placement.split('-')[0]; - const shiftvariation = placement.split('-')[1]; + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier if (shiftvariation) { - const { reference, popper } = data.offsets; - const isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; - const side = isVertical ? 'left' : 'top'; - const measurement = isVertical ? 'width' : 'height'; + var _data$offsets = data.offsets, + reference = _data$offsets.reference, + popper = _data$offsets.popper; - const shiftOffsets = { - start: { [side]: reference[side] }, - end: { - [side]: reference[side] + reference[measurement] - popper[measurement] - } + var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; + var side = isVertical ? 'left' : 'top'; + var measurement = isVertical ? 'width' : 'height'; + + var shiftOffsets = { + start: defineProperty({}, side, reference[side]), + end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) }; data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); @@ -27043,8 +27158,10 @@ function hide(data) { return data; } - const refRect = data.offsets.reference; - const bound = find(data.instance.modifiers, modifier => modifier.name === 'preventOverflow').boundaries; + var refRect = data.offsets.reference; + var bound = find(data.instance.modifiers, function (modifier) { + return modifier.name === 'preventOverflow'; + }).boundaries; if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { // Avoid unnecessary DOM access if visibility hasn't changed @@ -27075,12 +27192,15 @@ function hide(data) { * @returns {Object} The data object, properly modified */ function inner(data) { - const placement = data.placement; - const basePlacement = placement.split('-')[0]; - const { popper, reference } = data.offsets; - const isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; + var placement = data.placement; + var basePlacement = placement.split('-')[0]; + var _data$offsets = data.offsets, + popper = _data$offsets.popper, + reference = _data$offsets.reference; - const subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; + var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; + + var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); @@ -27475,7 +27595,7 @@ var Defaults = { * Access Popper.js instance with `data.instance`. * @prop {onCreate} */ - onCreate: () => {}, + onCreate: function onCreate() {}, /** * Callback called when the popper is updated, this callback is not called @@ -27485,14 +27605,14 @@ var Defaults = { * Access Popper.js instance with `data.instance`. * @prop {onUpdate} */ - onUpdate: () => {}, + onUpdate: function onUpdate() {}, /** * List of modifiers used to modify the offsets before they are applied to the popper. * They provide most of the functionalities of Popper.js * @prop {modifiers} */ - modifiers + modifiers: modifiers }; /** @@ -27507,7 +27627,7 @@ var Defaults = { // Utils // Methods -class Popper { +var Popper = function () { /** * Create a new Popper.js instance * @class Popper @@ -27516,8 +27636,15 @@ class Popper { * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) * @return {Object} instance - The generated Popper.js instance */ - constructor(reference, popper, options = {}) { - this.scheduleUpdate = () => requestAnimationFrame(this.update); + function Popper(reference, popper) { + var _this = this; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + classCallCheck(this, Popper); + + this.scheduleUpdate = function () { + return requestAnimationFrame(_this.update); + }; // make update() debounced, so that it only runs at most once-per-tick this.update = debounce(this.update.bind(this)); @@ -27538,31 +27665,35 @@ class Popper { // Deep merge modifiers options this.options.modifiers = {}; - Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(name => { - this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); + Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { + _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); }); // Refactoring modifiers' list (Object => Array) - this.modifiers = Object.keys(this.options.modifiers).map(name => _extends({ - name - }, this.options.modifiers[name])) + this.modifiers = Object.keys(this.options.modifiers).map(function (name) { + return _extends({ + name: name + }, _this.options.modifiers[name]); + }) // sort the modifiers by order - .sort((a, b) => a.order - b.order); + .sort(function (a, b) { + return a.order - b.order; + }); // modifiers have the ability to execute arbitrary code when Popper.js get inited // such code is executed in the same order of its modifier // they could add new properties to their options configuration // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! - this.modifiers.forEach(modifierOptions => { + this.modifiers.forEach(function (modifierOptions) { if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { - modifierOptions.onLoad(this.reference, this.popper, this.options, modifierOptions, this.state); + modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); } }); // fire the first update to position the popper in the right place this.update(); - const eventsEnabled = this.options.eventsEnabled; + var eventsEnabled = this.options.eventsEnabled; if (eventsEnabled) { // setup event listeners, they will take care of update the position in specific situations this.enableEventListeners(); @@ -27573,43 +27704,56 @@ class Popper { // We can't use class properties because they don't get listed in the // class prototype and break stuff like Sinon stubs - update() { - return update.call(this); - } - destroy() { - return destroy.call(this); - } - enableEventListeners() { - return enableEventListeners.call(this); - } - disableEventListeners() { - return disableEventListeners.call(this); - } - - /** - * Schedule an update, it will run on the next UI update available - * @method scheduleUpdate - * @memberof Popper - */ - /** - * Collection of utilities useful when writing custom modifiers. - * Starting from version 1.7, this method is available only if you - * include `popper-utils.js` before `popper.js`. - * - * **DEPRECATION**: This way to access PopperUtils is deprecated - * and will be removed in v2! Use the PopperUtils module directly instead. - * Due to the high instability of the methods contained in Utils, we can't - * guarantee them to follow semver. Use them at your own risk! - * @static - * @private - * @type {Object} - * @deprecated since version 1.8 - * @member Utils - * @memberof Popper - */ -} + createClass(Popper, [{ + key: 'update', + value: function update$$1() { + return update.call(this); + } + }, { + key: 'destroy', + value: function destroy$$1() { + return destroy.call(this); + } + }, { + key: 'enableEventListeners', + value: function enableEventListeners$$1() { + return enableEventListeners.call(this); + } + }, { + key: 'disableEventListeners', + value: function disableEventListeners$$1() { + return disableEventListeners.call(this); + } + + /** + * Schedule an update, it will run on the next UI update available + * @method scheduleUpdate + * @memberof Popper + */ + + + /** + * Collection of utilities useful when writing custom modifiers. + * Starting from version 1.7, this method is available only if you + * include `popper-utils.js` before `popper.js`. + * + * **DEPRECATION**: This way to access PopperUtils is deprecated + * and will be removed in v2! Use the PopperUtils module directly instead. + * Due to the high instability of the methods contained in Utils, we can't + * guarantee them to follow semver. Use them at your own risk! + * @static + * @private + * @type {Object} + * @deprecated since version 1.8 + * @member Utils + * @memberof Popper + */ + + }]); + return Popper; +}(); /** * The `referenceObject` is an object that provides an interface compatible with Popper.js @@ -27631,11 +27775,14 @@ class Popper { * An ES6 getter that will return the height of the virtual reference element. */ + Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; Popper.placements = placements; Popper.Defaults = Defaults; -export default Popper; +return Popper; + +}))); //# sourceMappingURL=popper.js.map /**! @@ -27662,6 +27809,12 @@ export default Popper; * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.PopperUtils = global.PopperUtils || {}))); +}(this, (function (exports) { 'use strict'; + /** * Get CSS computed property of the given element * @method @@ -27674,7 +27827,7 @@ function getStyleComputedProperty(element, property) { return []; } // NOTE: 1 DOM access here - const css = window.getComputedStyle(element, null); + var css = window.getComputedStyle(element, null); return property ? css[property] : css; } @@ -27706,7 +27859,12 @@ function getScrollParent(element) { } // Firefox want us to check `-x` and `-y` variations as well - const { overflow, overflowX, overflowY } = getStyleComputedProperty(element); + + var _getStyleComputedProp = getStyleComputedProperty(element), + overflow = _getStyleComputedProp.overflow, + overflowX = _getStyleComputedProp.overflowX, + overflowY = _getStyleComputedProp.overflowY; + if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) { return element; } @@ -27723,8 +27881,8 @@ function getScrollParent(element) { */ function getOffsetParent(element) { // NOTE: 1 DOM access here - const offsetParent = element && element.offsetParent; - const nodeName = offsetParent && offsetParent.nodeName; + var offsetParent = element && element.offsetParent; + var nodeName = offsetParent && offsetParent.nodeName; if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { return window.document.documentElement; @@ -27740,7 +27898,8 @@ function getOffsetParent(element) { } function isOffsetContainer(element) { - const { nodeName } = element; + var nodeName = element.nodeName; + if (nodeName === 'BODY') { return false; } @@ -27777,17 +27936,18 @@ function findCommonOffsetParent(element1, element2) { } // Here we make sure to give as "start" the element that comes first in the DOM - const order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; - const start = order ? element1 : element2; - const end = order ? element2 : element1; + var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; + var start = order ? element1 : element2; + var end = order ? element2 : element1; // Get common ancestor container - const range = document.createRange(); + var range = document.createRange(); range.setStart(start, 0); range.setEnd(end, 0); - const { commonAncestorContainer } = range; + var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document + if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { if (isOffsetContainer(commonAncestorContainer)) { return commonAncestorContainer; @@ -27797,7 +27957,7 @@ function findCommonOffsetParent(element1, element2) { } // one of the nodes is inside shadowDOM, find which one - const element1root = getRoot(element1); + var element1root = getRoot(element1); if (element1root.host) { return findCommonOffsetParent(element1root.host, element2); } else { @@ -27813,13 +27973,15 @@ function findCommonOffsetParent(element1, element2) { * @argument {String} side `top` or `left` * @returns {number} amount of scrolled pixels */ -function getScroll(element, side = 'top') { - const upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; - const nodeName = element.nodeName; +function getScroll(element) { + var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; + + var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; + var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { - const html = window.document.documentElement; - const scrollingElement = window.document.scrollingElement || html; + var html = window.document.documentElement; + var scrollingElement = window.document.scrollingElement || html; return scrollingElement[upperSide]; } @@ -27835,10 +27997,12 @@ function getScroll(element, side = 'top') { * @param {Boolean} subtract - set to true if you want to subtract the scroll values * @return {Object} rect - The modifier rect object */ -function includeScroll(rect, element, subtract = false) { - const scrollTop = getScroll(element, 'top'); - const scrollLeft = getScroll(element, 'left'); - const modifier = subtract ? -1 : 1; +function includeScroll(rect, element) { + var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); + var modifier = subtract ? -1 : 1; rect.top += scrollTop * modifier; rect.bottom += scrollTop * modifier; rect.left += scrollLeft * modifier; @@ -27857,10 +28021,10 @@ function includeScroll(rect, element, subtract = false) { */ function getBordersSize(styles, axis) { - const sideA = axis === 'x' ? 'Left' : 'Top'; - const sideB = sideA === 'Left' ? 'Right' : 'Bottom'; + var sideA = axis === 'x' ? 'Left' : 'Top'; + var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; - return +styles[`border${sideA}Width`].split('px')[0] + +styles[`border${sideB}Width`].split('px')[0]; + return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0]; } /** @@ -27869,7 +28033,7 @@ function getBordersSize(styles, axis) { * @memberof Popper.Utils * @returns {Boolean} isIE10 */ -let isIE10 = undefined; +var isIE10 = undefined; var isIE10$1 = function () { if (isIE10 === undefined) { @@ -27879,13 +28043,13 @@ var isIE10$1 = function () { }; function getSize(axis, body, html, computedStyle) { - return Math.max(body[`offset${axis}`], body[`scroll${axis}`], html[`client${axis}`], html[`offset${axis}`], html[`scroll${axis}`], isIE10$1() ? html[`offset${axis}`] + computedStyle[`margin${axis === 'Height' ? 'Top' : 'Left'}`] + computedStyle[`margin${axis === 'Height' ? 'Bottom' : 'Right'}`] : 0); + return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); } function getWindowSizes() { - const body = window.document.body; - const html = window.document.documentElement; - const computedStyle = isIE10$1() && window.getComputedStyle(html); + var body = window.document.body; + var html = window.document.documentElement; + var computedStyle = isIE10$1() && window.getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), @@ -27929,7 +28093,7 @@ function getClientRect(offsets) { * @return {Object} client rect */ function getBoundingClientRect(element) { - let rect = {}; + var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't // considered in DOM in some circumstances... @@ -27937,8 +28101,8 @@ function getBoundingClientRect(element) { if (isIE10$1()) { try { rect = element.getBoundingClientRect(); - const scrollTop = getScroll(element, 'top'); - const scrollLeft = getScroll(element, 'left'); + var scrollTop = getScroll(element, 'top'); + var scrollLeft = getScroll(element, 'left'); rect.top += scrollTop; rect.left += scrollLeft; rect.bottom += scrollTop; @@ -27948,7 +28112,7 @@ function getBoundingClientRect(element) { rect = element.getBoundingClientRect(); } - const result = { + var result = { left: rect.left, top: rect.top, width: rect.right - rect.left, @@ -27956,17 +28120,17 @@ function getBoundingClientRect(element) { }; // subtract scrollbar size from sizes - const sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; - const width = sizes.width || element.clientWidth || result.right - result.left; - const height = sizes.height || element.clientHeight || result.bottom - result.top; + var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; + var width = sizes.width || element.clientWidth || result.right - result.left; + var height = sizes.height || element.clientHeight || result.bottom - result.top; - let horizScrollbar = element.offsetWidth - width; - let vertScrollbar = element.offsetHeight - height; + var horizScrollbar = element.offsetWidth - width; + var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border` // we make this check conditional for performance reasons if (horizScrollbar || vertScrollbar) { - const styles = getStyleComputedProperty(element); + var styles = getStyleComputedProperty(element); horizScrollbar -= getBordersSize(styles, 'x'); vertScrollbar -= getBordersSize(styles, 'y'); @@ -27978,17 +28142,17 @@ function getBoundingClientRect(element) { } function getOffsetRectRelativeToArbitraryNode(children, parent) { - const isIE10 = isIE10$1(); - const isHTML = parent.nodeName === 'HTML'; - const childrenRect = getBoundingClientRect(children); - const parentRect = getBoundingClientRect(parent); - const scrollParent = getScrollParent(children); + var isIE10 = isIE10$1(); + var isHTML = parent.nodeName === 'HTML'; + var childrenRect = getBoundingClientRect(children); + var parentRect = getBoundingClientRect(parent); + var scrollParent = getScrollParent(children); - const styles = getStyleComputedProperty(parent); - const borderTopWidth = +styles.borderTopWidth.split('px')[0]; - const borderLeftWidth = +styles.borderLeftWidth.split('px')[0]; + var styles = getStyleComputedProperty(parent); + var borderTopWidth = +styles.borderTopWidth.split('px')[0]; + var borderLeftWidth = +styles.borderLeftWidth.split('px')[0]; - let offsets = getClientRect({ + var offsets = getClientRect({ top: childrenRect.top - parentRect.top - borderTopWidth, left: childrenRect.left - parentRect.left - borderLeftWidth, width: childrenRect.width, @@ -28002,8 +28166,8 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { // differently when margins are applied to it. The margins are included in // the box of the documentElement, in the other cases not. if (!isIE10 && isHTML) { - const marginTop = +styles.marginTop.split('px')[0]; - const marginLeft = +styles.marginLeft.split('px')[0]; + var marginTop = +styles.marginTop.split('px')[0]; + var marginLeft = +styles.marginLeft.split('px')[0]; offsets.top -= borderTopWidth - marginTop; offsets.bottom -= borderTopWidth - marginTop; @@ -28023,19 +28187,19 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { } function getViewportOffsetRectRelativeToArtbitraryNode(element) { - const html = window.document.documentElement; - const relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); - const width = Math.max(html.clientWidth, window.innerWidth || 0); - const height = Math.max(html.clientHeight, window.innerHeight || 0); + var html = window.document.documentElement; + var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); + var width = Math.max(html.clientWidth, window.innerWidth || 0); + var height = Math.max(html.clientHeight, window.innerHeight || 0); - const scrollTop = getScroll(html); - const scrollLeft = getScroll(html, 'left'); + var scrollTop = getScroll(html); + var scrollLeft = getScroll(html, 'left'); - const offset = { + var offset = { top: scrollTop - relativeOffset.top + relativeOffset.marginTop, left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, - width, - height + width: width, + height: height }; return getClientRect(offset); @@ -28050,7 +28214,7 @@ function getViewportOffsetRectRelativeToArtbitraryNode(element) { * @returns {Boolean} answer to "isFixed?" */ function isFixed(element) { - const nodeName = element.nodeName; + var nodeName = element.nodeName; if (nodeName === 'BODY' || nodeName === 'HTML') { return false; } @@ -28072,15 +28236,15 @@ function isFixed(element) { */ function getBoundaries(popper, reference, padding, boundariesElement) { // NOTE: 1 DOM access here - let boundaries = { top: 0, left: 0 }; - const offsetParent = findCommonOffsetParent(popper, reference); + var boundaries = { top: 0, left: 0 }; + var offsetParent = findCommonOffsetParent(popper, reference); // Handle viewport case if (boundariesElement === 'viewport') { boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent); } else { // Handle other cases based on DOM element used as boundaries - let boundariesNode; + var boundariesNode = void 0; if (boundariesElement === 'scrollParent') { boundariesNode = getScrollParent(getParentNode(popper)); if (boundariesNode.nodeName === 'BODY') { @@ -28092,11 +28256,14 @@ function getBoundaries(popper, reference, padding, boundariesElement) { boundariesNode = boundariesElement; } - const offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent); + var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent); // In case of HTML, we need a different computation if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { - const { height, width } = getWindowSizes(); + var _getWindowSizes = getWindowSizes(), + height = _getWindowSizes.height, + width = _getWindowSizes.width; + boundaries.top += offsets.top - offsets.marginTop; boundaries.bottom = height + offsets.top; boundaries.left += offsets.left - offsets.marginLeft; @@ -28116,7 +28283,10 @@ function getBoundaries(popper, reference, padding, boundariesElement) { return boundaries; } -function getArea({ width, height }) { +function getArea(_ref) { + var width = _ref.width, + height = _ref.height; + return width * height; } @@ -28129,14 +28299,16 @@ function getArea({ width, height }) { * @argument {Object} options - Modifiers configuration and options * @returns {Object} The data object, properly modified */ -function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement, padding = 0) { +function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { + var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + if (placement.indexOf('auto') === -1) { return placement; } - const boundaries = getBoundaries(popper, reference, padding, boundariesElement); + var boundaries = getBoundaries(popper, reference, padding, boundariesElement); - const rects = { + var rects = { top: { width: boundaries.width, height: refRect.top - boundaries.top @@ -28155,22 +28327,30 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE } }; - const sortedAreas = Object.keys(rects).map(key => _extends({ - key - }, rects[key], { - area: getArea(rects[key]) - })).sort((a, b) => b.area - a.area); + var sortedAreas = Object.keys(rects).map(function (key) { + return _extends({ + key: key + }, rects[key], { + area: getArea(rects[key]) + }); + }).sort(function (a, b) { + return b.area - a.area; + }); - const filteredAreas = sortedAreas.filter(({ width, height }) => width >= popper.clientWidth && height >= popper.clientHeight); + var filteredAreas = sortedAreas.filter(function (_ref2) { + var width = _ref2.width, + height = _ref2.height; + return width >= popper.clientWidth && height >= popper.clientHeight; + }); - const computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; + var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; - const variation = placement.split('-')[1]; + var variation = placement.split('-')[1]; - return computedPlacement + (variation ? `-${variation}` : ''); + return computedPlacement + (variation ? '-' + variation : ''); } -const nativeHints = ['native code', '[object MutationObserverConstructor]']; +var nativeHints = ['native code', '[object MutationObserverConstructor]']; /** * Determine if a function is implemented natively (as opposed to a polyfill). @@ -28179,12 +28359,16 @@ const nativeHints = ['native code', '[object MutationObserverConstructor]']; * @argument {Function | undefined} fn the function to check * @returns {Boolean} */ -var isNative = (fn => nativeHints.some(hint => (fn || '').toString().indexOf(hint) > -1)); +var isNative = (function (fn) { + return nativeHints.some(function (hint) { + return (fn || '').toString().indexOf(hint) > -1; + }); +}); -const isBrowser = typeof window !== 'undefined'; -const longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; -let timeoutDuration = 0; -for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) { +var isBrowser = typeof window !== 'undefined'; +var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; +var timeoutDuration = 0; +for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { timeoutDuration = 1; break; @@ -28192,21 +28376,21 @@ for (let i = 0; i < longerTimeoutBrowsers.length; i += 1) { } function microtaskDebounce(fn) { - let scheduled = false; - let i = 0; - const elem = document.createElement('span'); + var scheduled = false; + var i = 0; + var elem = document.createElement('span'); // MutationObserver provides a mechanism for scheduling microtasks, which // are scheduled *before* the next task. This gives us a way to debounce // a function but ensure it's called *before* the next paint. - const observer = new MutationObserver(() => { + var observer = new MutationObserver(function () { fn(); scheduled = false; }); observer.observe(elem, { attributes: true }); - return () => { + return function () { if (!scheduled) { scheduled = true; elem.setAttribute('x-index', i); @@ -28216,11 +28400,11 @@ function microtaskDebounce(fn) { } function taskDebounce(fn) { - let scheduled = false; - return () => { + var scheduled = false; + return function () { if (!scheduled) { scheduled = true; - setTimeout(() => { + setTimeout(function () { scheduled = false; fn(); }, timeoutDuration); @@ -28232,7 +28416,7 @@ function taskDebounce(fn) { // these rely on Mutation Events which only occur when an element is connected // to the DOM. The algorithm used in this module does not use a connected element, // and so we must ensure that a *native* MutationObserver is available. -const supportsNativeMutationObserver = isBrowser && isNative(window.MutationObserver); +var supportsNativeMutationObserver = isBrowser && isNative(window.MutationObserver); /** * Create a debounced version of a method, that's asynchronously deferred @@ -28276,11 +28460,15 @@ function find(arr, check) { function findIndex(arr, prop, value) { // use native findIndex if supported if (Array.prototype.findIndex) { - return arr.findIndex(cur => cur[prop] === value); + return arr.findIndex(function (cur) { + return cur[prop] === value; + }); } // use `find` + `indexOf` if `findIndex` isn't supported - const match = find(arr, obj => obj[prop] === value); + var match = find(arr, function (obj) { + return obj[prop] === value; + }); return arr.indexOf(match); } @@ -28292,12 +28480,15 @@ function findIndex(arr, prop, value) { * @return {Object} position - Coordinates of the element and its `scrollTop` */ function getOffsetRect(element) { - let elementRect; + var elementRect = void 0; if (element.nodeName === 'HTML') { - const { width, height } = getWindowSizes(); + var _getWindowSizes = getWindowSizes(), + width = _getWindowSizes.width, + height = _getWindowSizes.height; + elementRect = { - width, - height, + width: width, + height: height, left: 0, top: 0 }; @@ -28322,10 +28513,10 @@ function getOffsetRect(element) { * @returns {Object} object containing width and height properties */ function getOuterSizes(element) { - const styles = window.getComputedStyle(element); - const x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); - const y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); - const result = { + var styles = window.getComputedStyle(element); + var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); + var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); + var result = { width: element.offsetWidth + y, height: element.offsetHeight + x }; @@ -28340,8 +28531,10 @@ function getOuterSizes(element) { * @returns {String} flipped placement */ function getOppositePlacement(placement) { - const hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; - return placement.replace(/left|right|bottom|top/g, matched => hash[matched]); + var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; + return placement.replace(/left|right|bottom|top/g, function (matched) { + return hash[matched]; + }); } /** @@ -28358,20 +28551,20 @@ function getPopperOffsets(popper, referenceOffsets, placement) { placement = placement.split('-')[0]; // Get popper node sizes - const popperRect = getOuterSizes(popper); + var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object - const popperOffsets = { + var popperOffsets = { width: popperRect.width, height: popperRect.height }; // depending by the popper placement we have to compute its offsets slightly differently - const isHoriz = ['right', 'left'].indexOf(placement) !== -1; - const mainSide = isHoriz ? 'top' : 'left'; - const secondarySide = isHoriz ? 'left' : 'top'; - const measurement = isHoriz ? 'height' : 'width'; - const secondaryMeasurement = !isHoriz ? 'height' : 'width'; + var isHoriz = ['right', 'left'].indexOf(placement) !== -1; + var mainSide = isHoriz ? 'top' : 'left'; + var secondarySide = isHoriz ? 'left' : 'top'; + var measurement = isHoriz ? 'height' : 'width'; + var secondaryMeasurement = !isHoriz ? 'height' : 'width'; popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; if (placement === secondarySide) { @@ -28393,7 +28586,7 @@ function getPopperOffsets(popper, referenceOffsets, placement) { * @returns {Object} An object containing the offsets which will be applied to the popper */ function getReferenceOffsets(state, popper, reference) { - const commonOffsetParent = findCommonOffsetParent(popper, reference); + var commonOffsetParent = findCommonOffsetParent(popper, reference); return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent); } @@ -28405,12 +28598,12 @@ function getReferenceOffsets(state, popper, reference) { * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) */ function getSupportedPropertyName(property) { - const prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; - const upperProp = property.charAt(0).toUpperCase() + property.slice(1); + var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; + var upperProp = property.charAt(0).toUpperCase() + property.slice(1); - for (let i = 0; i < prefixes.length - 1; i++) { - const prefix = prefixes[i]; - const toCheck = prefix ? `${prefix}${upperProp}` : property; + for (var i = 0; i < prefixes.length - 1; i++) { + var prefix = prefixes[i]; + var toCheck = prefix ? '' + prefix + upperProp : property; if (typeof window.document.body.style[toCheck] !== 'undefined') { return toCheck; } @@ -28426,7 +28619,7 @@ function getSupportedPropertyName(property) { * @returns {Boolean} answer to: is a function? */ function isFunction(functionToCheck) { - const getType = {}; + var getType = {}; return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; } @@ -28437,7 +28630,11 @@ function isFunction(functionToCheck) { * @returns {Boolean} */ function isModifierEnabled(modifiers, modifierName) { - return modifiers.some(({ name, enabled }) => enabled && name === modifierName); + return modifiers.some(function (_ref) { + var name = _ref.name, + enabled = _ref.enabled; + return enabled && name === modifierName; + }); } /** @@ -28451,16 +28648,19 @@ function isModifierEnabled(modifiers, modifierName) { * @returns {Boolean} */ function isModifierRequired(modifiers, requestingName, requestedName) { - const requesting = find(modifiers, ({ name }) => name === requestingName); + var requesting = find(modifiers, function (_ref) { + var name = _ref.name; + return name === requestingName; + }); - const isRequired = !!requesting && modifiers.some(modifier => { + var isRequired = !!requesting && modifiers.some(function (modifier) { return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; }); if (!isRequired) { - const requesting = `\`${requestingName}\``; - const requested = `\`${requestedName}\``; - console.warn(`${requested} modifier is required by ${requesting} modifier in order to work, be sure to include it before ${requesting}!`); + var _requesting = '`' + requestingName + '`'; + var requested = '`' + requestedName + '`'; + console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); } return isRequired; } @@ -28487,7 +28687,7 @@ function removeEventListeners(reference, state) { window.removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents - state.scrollParents.forEach(target => { + state.scrollParents.forEach(function (target) { target.removeEventListener('scroll', state.updateBound); }); @@ -28510,13 +28710,13 @@ function removeEventListeners(reference, state) { * @returns {dataObject} */ function runModifiers(modifiers, data, ends) { - const modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); + var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); - modifiersToRun.forEach(modifier => { + modifiersToRun.forEach(function (modifier) { if (modifier.function) { console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); } - const fn = modifier.function || modifier.fn; + var fn = modifier.function || modifier.fn; if (modifier.enabled && isFunction(fn)) { // Add properties to offsets to make them a complete clientRect object // we do this before each modifier to make sure the previous one doesn't @@ -28541,7 +28741,7 @@ function runModifiers(modifiers, data, ends) { */ function setAttributes(element, attributes) { Object.keys(attributes).forEach(function (prop) { - const value = attributes[prop]; + var value = attributes[prop]; if (value !== false) { element.setAttribute(prop, attributes[prop]); } else { @@ -28559,8 +28759,8 @@ function setAttributes(element, attributes) { * Object with a list of properties and values which will be applied to the element */ function setStyles(element, styles) { - Object.keys(styles).forEach(prop => { - let unit = ''; + Object.keys(styles).forEach(function (prop) { + var unit = ''; // add unit if the value is numeric and is one of the following if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { unit = 'px'; @@ -28570,8 +28770,8 @@ function setStyles(element, styles) { } function attachToScrollParents(scrollParent, event, callback, scrollParents) { - const isBody = scrollParent.nodeName === 'BODY'; - const target = isBody ? window : scrollParent; + var isBody = scrollParent.nodeName === 'BODY'; + var target = isBody ? window : scrollParent; target.addEventListener(event, callback, { passive: true }); if (!isBody) { @@ -28592,7 +28792,7 @@ function setupEventListeners(reference, options, state, updateBound) { window.addEventListener('resize', state.updateBound, { passive: true }); // Scroll event listener on scroll parents - const scrollElement = getScrollParent(reference); + var scrollElement = getScrollParent(reference); attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); state.scrollElement = scrollElement; state.eventsEnabled = true; @@ -28607,39 +28807,73 @@ function setupEventListeners(reference, options, state, updateBound) { // ``` // The default export will be removed in the next major version. var index = { - computeAutoPlacement, - debounce, - findIndex, - getBordersSize, - getBoundaries, - getBoundingClientRect, - getClientRect, - getOffsetParent, - getOffsetRect, - getOffsetRectRelativeToArbitraryNode, - getOuterSizes, - getParentNode, - getPopperOffsets, - getReferenceOffsets, - getScroll, - getScrollParent, - getStyleComputedProperty, - getSupportedPropertyName, - getWindowSizes, - isFixed, - isFunction, - isModifierEnabled, - isModifierRequired, - isNative, - isNumeric, - removeEventListeners, - runModifiers, - setAttributes, - setStyles, - setupEventListeners + computeAutoPlacement: computeAutoPlacement, + debounce: debounce, + findIndex: findIndex, + getBordersSize: getBordersSize, + getBoundaries: getBoundaries, + getBoundingClientRect: getBoundingClientRect, + getClientRect: getClientRect, + getOffsetParent: getOffsetParent, + getOffsetRect: getOffsetRect, + getOffsetRectRelativeToArbitraryNode: getOffsetRectRelativeToArbitraryNode, + getOuterSizes: getOuterSizes, + getParentNode: getParentNode, + getPopperOffsets: getPopperOffsets, + getReferenceOffsets: getReferenceOffsets, + getScroll: getScroll, + getScrollParent: getScrollParent, + getStyleComputedProperty: getStyleComputedProperty, + getSupportedPropertyName: getSupportedPropertyName, + getWindowSizes: getWindowSizes, + isFixed: isFixed, + isFunction: isFunction, + isModifierEnabled: isModifierEnabled, + isModifierRequired: isModifierRequired, + isNative: isNative, + isNumeric: isNumeric, + removeEventListeners: removeEventListeners, + runModifiers: runModifiers, + setAttributes: setAttributes, + setStyles: setStyles, + setupEventListeners: setupEventListeners }; -export { computeAutoPlacement, debounce, findIndex, getBordersSize, getBoundaries, getBoundingClientRect, getClientRect, getOffsetParent, getOffsetRect, getOffsetRectRelativeToArbitraryNode, getOuterSizes, getParentNode, getPopperOffsets, getReferenceOffsets, getScroll, getScrollParent, getStyleComputedProperty, getSupportedPropertyName, getWindowSizes, isFixed, isFunction, isModifierEnabled, isModifierRequired, isNative, isNumeric, removeEventListeners, runModifiers, setAttributes, setStyles, setupEventListeners };export default index; +exports.computeAutoPlacement = computeAutoPlacement; +exports.debounce = debounce; +exports.findIndex = findIndex; +exports.getBordersSize = getBordersSize; +exports.getBoundaries = getBoundaries; +exports.getBoundingClientRect = getBoundingClientRect; +exports.getClientRect = getClientRect; +exports.getOffsetParent = getOffsetParent; +exports.getOffsetRect = getOffsetRect; +exports.getOffsetRectRelativeToArbitraryNode = getOffsetRectRelativeToArbitraryNode; +exports.getOuterSizes = getOuterSizes; +exports.getParentNode = getParentNode; +exports.getPopperOffsets = getPopperOffsets; +exports.getReferenceOffsets = getReferenceOffsets; +exports.getScroll = getScroll; +exports.getScrollParent = getScrollParent; +exports.getStyleComputedProperty = getStyleComputedProperty; +exports.getSupportedPropertyName = getSupportedPropertyName; +exports.getWindowSizes = getWindowSizes; +exports.isFixed = isFixed; +exports.isFunction = isFunction; +exports.isModifierEnabled = isModifierEnabled; +exports.isModifierRequired = isModifierRequired; +exports.isNative = isNative; +exports.isNumeric = isNumeric; +exports.removeEventListeners = removeEventListeners; +exports.runModifiers = runModifiers; +exports.setAttributes = setAttributes; +exports.setStyles = setStyles; +exports.setupEventListeners = setupEventListeners; +exports['default'] = index; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); //# sourceMappingURL=popper-utils.js.map /*! diff --git a/public/js/blue-twilight.min.js b/public/js/blue-twilight.min.js index ea81e8e..ecd7492 100644 --- a/public/js/blue-twilight.min.js +++ b/public/js/blue-twilight.min.js @@ -1,10 +1 @@ -function AnalyseAlbumViewModel(){this.el="#analyse-album",this.data={imagesFailed:[],imagesToAnalyse:[],imagesInProgress:[],imagesRecentlyCompleted:[],numberSuccessful:0,numberFailed:0},this.computed={failedPercentage:function(){var t=0;return this.numberTotal>0&&(t=this.numberFailed/this.numberTotal*100),t.toFixed(2)+"%"},isCompleted:function(){return this.numberTotal>0&&this.numberSuccessful+this.numberFailed>=this.numberTotal},latestCompletedImages:function(){var t=this.imagesRecentlyCompleted.length-3<0?0:this.imagesRecentlyCompleted.length-3,e=t+3;return this.imagesRecentlyCompleted.slice(t,e)},numberTotal:function(){return this.imagesToAnalyse.length},successfulPercentage:function(){var t=0;return this.numberTotal>0&&(t=this.numberSuccessful/this.numberTotal*100),t.toFixed(2)+"%"}},this.methods={analyseImage:function(t){var e=this;this.imagesToAnalyse.push(t),$.ajax(t.url,{beforeSend:function(){e.imagesInProgress.push(t)},dataType:"json",error:function(n,i,r){e.numberFailed++,e.imagesFailed.push({name:t.name,reason:i}),t.isSuccessful=!1,t.isPending=!1},method:"POST",success:function(n){if(n.is_successful){e.numberSuccessful++,t.isSuccessful=!0,t.isPending=!1,e.imagesRecentlyCompleted.push(t);var i=e.imagesInProgress.indexOf(t);i>-1&&e.imagesInProgress.splice(i,1)}else e.numberFailed++,e.imagesFailed.push({name:t.name,reason:n.message}),t.isSuccessful=!1,t.isPending=!1}})}}}function AnalyseImageViewModel(t){this.isPending=!0,this.isSuccessful=!1,this.name=t.name,this.photoID=t.photo_id,this.url=t.url}function EditPhotosViewModel(t,e,n){this.el="#photos-tab",this.data={albums:[],bulkModifyMethod:"",isSubmitting:!1,photoIDs:[],photoIDsAvailable:[],selectAllInAlbum:0},this.methods={bulkModifySelected:function(t){if(this.isSubmitting)return!0;var n=this,i=$(t.target).closest("form");return"change_album"===this.bulkModifyMethod?(this.promptForNewAlbum(function(t){var e=$("select",t).val();$('input[name="new-album-id"]',i).val(e),n.isSubmitting=!0,$('button[name="bulk-apply"]',i).click(),_bt_showLoadingModal()}),t.preventDefault(),!1):"delete"!==this.bulkModifyMethod||(bootbox.dialog({message:e.delete_bulk_confirm_message,title:e.delete_bulk_confirm_title,buttons:{cancel:{label:e.action_cancel,className:"btn-secondary"},confirm:{label:e.action_delete,className:"btn-danger",callback:function(){n.isSubmitting=!0,$('button[name="bulk-apply"]',i).click(),_bt_showLoadingModal()}}}}),t.preventDefault(),!1)},changeAlbum:function(t){this.selectPhotoSingle(t.target);var e=this.photoIDs[0];return this.photoIDs=[],this.promptForNewAlbum(function(t){var i=$("select",t).val();$.post(n.move_photo.replace(/\/0$/,"/"+e),{new_album_id:i},function(){window.location.reload()})}),t.preventDefault(),!1},deletePhoto:function(t){var i=this;this.selectPhotoSingle(t.target);var r=i.photoIDs[0];return this.photoIDs=[],bootbox.dialog({message:e.delete_confirm_message,title:e.delete_confirm_title,buttons:{cancel:{label:e.action_cancel,className:"btn-secondary"},confirm:{label:e.action_delete,className:"btn-danger",callback:function(){var t=n.delete_photo;t=t.replace(/\/0$/,"/"+r),$(".loading",parent).show(),$.post(t,{_method:"DELETE"},function(t){window.location.reload()})}}}}),t.preventDefault(),!1},flip:function(t,e,i){var r=n.flip_photo;r=r.replace("/0/","/"+this.photoIDs[0]+"/"),r=t?r.replace(/\/-1\//,"/1/"):r.replace(/\/-1\//,"/0/"),r=e?r.replace(/\/-2$/,"/1"):r.replace(/\/-2$/,"/0"),$(".loading",i).show(),$.post(r,function(){var t=$("img.photo-thumbnail",i),e=t.data("original-src");t.attr("src",e+"&_="+(new Date).getTime()),$(".loading",i).hide()}),this.photoIDs=[]},flipBoth:function(t){return this.selectPhotoSingle(t.target),this.flip(!0,!0,$(t.target).closest(".photo")),t.preventDefault(),!1},flipHorizontal:function(t){return this.selectPhotoSingle(t.target),this.flip(!0,!1,$(t.target).closest(".photo")),t.preventDefault(),!1},flipVertical:function(t){return this.selectPhotoSingle(t.target),this.flip(!1,!0,$(t.target).closest(".photo")),t.preventDefault(),!1},isPhotoSelected:function(t){return this.photoIDs.indexOf(t)>-1?"checked":""},promptForNewAlbum:function(n){for(var i=this.albums,r=$("",t.querySelectorAll("[msallowcapture^='']").length&&$.push("[*^$]="+tt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||$.push("\\["+tt+"*(?:value|"+Z+")"),t.querySelectorAll("[id~="+F+"-]").length||$.push("~="),t.querySelectorAll(":checked").length||$.push(":checked"),t.querySelectorAll("a#"+F+"+*").length||$.push(".#.+[+~]")}),r(function(t){t.innerHTML="";var e=D.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&$.push("name"+tt+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&$.push(":enabled",":disabled"),N.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&$.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),$.push(",.*:")})),(_.matchesSelector=pt.test(P=N.matches||N.webkitMatchesSelector||N.mozMatchesSelector||N.oMatchesSelector||N.msMatchesSelector))&&r(function(t){_.disconnectedMatch=P.call(t,"*"),P.call(t,"[s!='']:x"),j.push("!=",it)}),$=$.length&&new RegExp($.join("|")),j=j.length&&new RegExp(j.join("|")),e=pt.test(N.compareDocumentPosition),R=e||pt.test(N.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},V=e?function(t,e){if(t===e)return k=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!_.sortDetached&&e.compareDocumentPosition(t)===n?t===D||t.ownerDocument===M&&R(M,t)?-1:e===D||e.ownerDocument===M&&R(M,e)?1:O?J(O,t)-J(O,e):0:4&n?-1:1)}:function(t,e){if(t===e)return k=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],l=[e];if(!r||!o)return t===D?-1:e===D?1:r?-1:o?1:O?J(O,t)-J(O,e):0;if(r===o)return s(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;a[i]===l[i];)i++;return i?s(a[i],l[i]):a[i]===M?-1:l[i]===M?1:0},D):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&I(t),n=n.replace(lt,"='$1']"),_.matchesSelector&&L&&!U[n+" "]&&(!j||!j.test(n))&&(!$||!$.test(n)))try{var i=P.call(t,n);if(i||_.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return e(n,D,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==D&&I(t),R(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==D&&I(t);var n=w.attrHandle[e.toLowerCase()],i=n&&K.call(w.attrHandle,e.toLowerCase())?n(t,e,!L):void 0;return void 0!==i?i:_.attributes||!L?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.escape=function(t){return(t+"").replace(bt,_t)},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,r=0;if(k=!_.detectDuplicates,O=!_.sortStable&&t.slice(0),t.sort(V),k){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return O=null,t},C=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=C(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=C(e);return n},w=e.selectors={cacheLength:50,createPseudo:i,match:ft,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(vt,yt),t[3]=(t[3]||t[4]||t[5]||"").replace(vt,yt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ft.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&ut.test(n)&&(e=E(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(vt,yt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=q[t+" "];return e||(e=new RegExp("(^|"+tt+")"+t+"("+tt+"|$)"))&&q(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(r){var o=e.attr(r,t);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&o.indexOf(i)>-1:"$="===n?i&&o.slice(-i.length)===i:"~="===n?(" "+o.replace(rt," ")+" ").indexOf(i)>-1:"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var u,c,f,d,h,p,g=o!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(m){if(o){for(;g;){for(d=e;d=d[g];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?m.firstChild:m.lastChild],s&&y){for(d=m,f=d[F]||(d[F]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),u=c[t]||[],h=u[0]===H&&u[1],b=h&&u[2],d=h&&m.childNodes[h];d=++h&&d&&d[g]||(b=h=0)||p.pop();)if(1===d.nodeType&&++b&&d===e){c[t]=[H,h,b];break}}else if(y&&(d=e,f=d[F]||(d[F]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),u=c[t]||[],h=u[0]===H&&u[1],b=h),!1===b)for(;(d=++h&&d&&d[g]||(b=h=0)||p.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(y&&(f=d[F]||(d[F]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[t]=[H,b]),d!==e)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,n){var r,o=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(n):o.length>1?(r=[t,t,"",n],w.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,e){for(var i,r=o(t,n),s=r.length;s--;)i=J(t,r[s]),t[i]=!(e[i]=r[s])}):function(t){return o(t,0,r)}):o}},pseudos:{not:i(function(t){var e=[],n=[],r=x(t.replace(ot,"$1"));return r[F]?i(function(t,e,n,i){for(var o,s=r(t,null,i,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:i(function(t){return function(n){return e(t,n).length>0}}),contains:i(function(t){return t=t.replace(vt,yt),function(e){return(e.textContent||e.innerText||C(e)).indexOf(t)>-1}}),lang:i(function(t){return ct.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(vt,yt).toLowerCase(),function(e){var n;do{if(n=L?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===N},focus:function(t){return t===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:a(!1),disabled:a(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!w.pseudos.empty(t)},header:function(t){return ht.test(t.nodeName)},input:function(t){return dt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[n<0?n+e:n]}),even:l(function(t,e){for(var n=0;n=0;)t.push(i);return t}),gt:l(function(t,e,n){for(var i=n<0?n+e:n;++i2&&"ID"===(s=o[0]).type&&9===e.nodeType&&L&&w.relative[o[1].type]){if(!(e=(w.find.ID(s.matches[0].replace(vt,yt),e)||[])[0]))return n;c&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=ft.needsContext.test(t)?0:o.length;r--&&(s=o[r],!w.relative[a=s.type]);)if((l=w.find[a])&&(i=l(s.matches[0].replace(vt,yt),mt.test(o[0].type)&&u(e.parentNode)||e))){if(o.splice(r,1),!(t=i.length&&f(o)))return Y.apply(n,i),n;break}}return(c||x(t,d))(i,e,!L,n,!e||mt.test(t)&&u(e.parentNode)||e),n},_.sortStable=F.split("").sort(V).join("")===F,_.detectDuplicates=!!k,I(),_.sortDetached=r(function(t){return 1&t.compareDocumentPosition(D.createElement("fieldset"))}),r(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),_.attributes&&r(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(Z,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),e}(t);pt.find=bt,pt.expr=bt.selectors,pt.expr[":"]=pt.expr.pseudos,pt.uniqueSort=pt.unique=bt.uniqueSort,pt.text=bt.getText,pt.isXMLDoc=bt.isXML,pt.contains=bt.contains,pt.escapeSelector=bt.escape;var _t=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&pt(t).is(n))break;i.push(t)}return i},wt=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},Ct=pt.expr.match.needsContext,Tt=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Et=/^.[^:#\[\.,]*$/;pt.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?pt.find.matchesSelector(i,t)?[i]:[]:pt.find.matches(t,pt.grep(e,function(t){return 1===t.nodeType}))},pt.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(pt(t).filter(function(){for(e=0;e1?pt.uniqueSort(n):n},filter:function(t){return this.pushStack(o(this,t||[],!1))},not:function(t){return this.pushStack(o(this,t||[],!0))},is:function(t){return!!o(this,"string"==typeof t&&Ct.test(t)?pt(t):t||[],!1).length}});var xt,At=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(pt.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||xt,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:At.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof pt?e[0]:e,pt.merge(this,pt.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:nt,!0)),Tt.test(i[1])&&pt.isPlainObject(e))for(i in e)pt.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return r=nt.getElementById(i[2]),r&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):pt.isFunction(t)?void 0!==n.ready?n.ready(t):t(pt):pt.makeArray(t,this)}).prototype=pt.fn,xt=pt(nt);var St=/^(?:parents|prev(?:Until|All))/,Ot={children:!0,contents:!0,next:!0,prev:!0};pt.fn.extend({has:function(t){var e=pt(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&pt.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?pt.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?at.call(pt(t),this[0]):at.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(pt.uniqueSort(pt.merge(this.get(),pt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),pt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return _t(t,"parentNode")},parentsUntil:function(t,e,n){return _t(t,"parentNode",n)},next:function(t){return s(t,"nextSibling")},prev:function(t){return s(t,"previousSibling")},nextAll:function(t){return _t(t,"nextSibling")},prevAll:function(t){return _t(t,"previousSibling")},nextUntil:function(t,e,n){return _t(t,"nextSibling",n)},prevUntil:function(t,e,n){return _t(t,"previousSibling",n)},siblings:function(t){return wt((t.parentNode||{}).firstChild,t)},children:function(t){return wt(t.firstChild)},contents:function(t){return r(t,"iframe")?t.contentDocument:(r(t,"template")&&(t=t.content||t),pt.merge([],t.childNodes))}},function(t,e){pt.fn[t]=function(n,i){var r=pt.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=pt.filter(i,r)),this.length>1&&(Ot[t]||pt.uniqueSort(r),St.test(t)&&r.reverse()),this.pushStack(r)}});var kt=/[^\x20\t\r\n\f]+/g;pt.Callbacks=function(t){t="string"==typeof t?a(t):pt.extend({},t);var e,n,i,r,o=[],s=[],l=-1,u=function(){for(r=r||t.once,i=e=!0;s.length;l=-1)for(n=s.shift();++l-1;)o.splice(n,1),n<=l&&l--}),this},has:function(t){return t?pt.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=n||[],n=[t,n.slice?n.slice():n],s.push(n),e||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},pt.extend({Deferred:function(e){var n=[["notify","progress",pt.Callbacks("memory"),pt.Callbacks("memory"),2],["resolve","done",pt.Callbacks("once memory"),pt.Callbacks("once memory"),0,"resolved"],["reject","fail",pt.Callbacks("once memory"),pt.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return pt.Deferred(function(e){pt.each(n,function(n,i){var r=pt.isFunction(t[i[4]])&&t[i[4]];o[i[1]](function(){var t=r&&r.apply(this,arguments);t&&pt.isFunction(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(e,i,r){function o(e,n,i,r){return function(){var a=this,c=arguments,f=function(){var t,f;if(!(e=s&&(i!==u&&(a=void 0,c=[t]),n.rejectWith(a,c))}};e?d():(pt.Deferred.getStackHook&&(d.stackTrace=pt.Deferred.getStackHook()),t.setTimeout(d))}}var s=0;return pt.Deferred(function(t){n[0][3].add(o(0,t,pt.isFunction(r)?r:l,t.notifyWith)),n[1][3].add(o(0,t,pt.isFunction(e)?e:l)),n[2][3].add(o(0,t,pt.isFunction(i)?i:u))}).promise()},promise:function(t){return null!=t?pt.extend(t,r):r}},o={};return pt.each(n,function(t,e){var s=e[2],a=e[5];r[e[1]]=s.add,a&&s.add(function(){i=a},n[3-t][2].disable,n[0][2].lock),s.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=s.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=rt.call(arguments),o=pt.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?rt.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(c(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||pt.isFunction(r[n]&&r[n].then)))return o.then();for(;n--;)c(r[n],s(n),o.reject);return o.promise()}});var It=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;pt.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&It.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},pt.readyException=function(e){t.setTimeout(function(){throw e})};var Dt=pt.Deferred();pt.fn.ready=function(t){return Dt.then(t).catch(function(t){pt.readyException(t)}),this},pt.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--pt.readyWait:pt.isReady)||(pt.isReady=!0,!0!==t&&--pt.readyWait>0||Dt.resolveWith(nt,[pt]))}}),pt.ready.then=Dt.then,"complete"===nt.readyState||"loading"!==nt.readyState&&!nt.documentElement.doScroll?t.setTimeout(pt.ready):(nt.addEventListener("DOMContentLoaded",f),t.addEventListener("load",f));var Nt=function(t,e,n,i,r,o,s){var a=0,l=t.length,u=null==n;if("object"===pt.type(n)){r=!0;for(a in n)Nt(t,e,a,n[a],!0,o,s)}else if(void 0!==i&&(r=!0,pt.isFunction(i)||(s=!0),u&&(s?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(pt(t),n)})),e))for(;a1,null,!0)},removeData:function(t){return this.each(function(){jt.remove(this,t)})}}),pt.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=$t.get(t,e),n&&(!i||Array.isArray(n)?i=$t.access(t,e,pt.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=pt.queue(t,e),i=n.length,r=n.shift(),o=pt._queueHooks(t,e),s=function(){pt.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return $t.get(t,n)||$t.access(t,n,{empty:pt.Callbacks("once memory").add(function(){$t.remove(t,[e+"queue",n])})})}}),pt.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Kt=/^$|\/(?:java|ecma)script/i,zt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};zt.optgroup=zt.option,zt.tbody=zt.tfoot=zt.colgroup=zt.caption=zt.thead,zt.th=zt.td;var Qt=/<|&#?\w+;/;!function(){var t=nt.createDocumentFragment(),e=t.appendChild(nt.createElement("div")),n=nt.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),ht.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",ht.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Gt=nt.documentElement,Yt=/^key/,Xt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Jt=/^([^.]*)(?:\.(.+)|)/;pt.event={global:{},add:function(t,e,n,i,r){var o,s,a,l,u,c,f,d,h,p,g,m=$t.get(t);if(m)for(n.handler&&(o=n,n=o.handler,r=o.selector),r&&pt.find.matchesSelector(Gt,r),n.guid||(n.guid=pt.guid++),(l=m.events)||(l=m.events={}),(s=m.handle)||(s=m.handle=function(e){return void 0!==pt&&pt.event.triggered!==e.type?pt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(kt)||[""],u=e.length;u--;)a=Jt.exec(e[u])||[],h=g=a[1],p=(a[2]||"").split(".").sort(),h&&(f=pt.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,f=pt.event.special[h]||{},c=pt.extend({type:h,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&pt.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[h])||(d=l[h]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(t,i,p,s)||t.addEventListener&&t.addEventListener(h,s)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),pt.event.global[h]=!0)},remove:function(t,e,n,i,r){var o,s,a,l,u,c,f,d,h,p,g,m=$t.hasData(t)&&$t.get(t);if(m&&(l=m.events)){for(e=(e||"").match(kt)||[""],u=e.length;u--;)if(a=Jt.exec(e[u])||[],h=g=a[1],p=(a[2]||"").split(".").sort(),h){for(f=pt.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,d=l[h]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(t,c));s&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,p,m.handle)||pt.removeEvent(t,h,m.handle),delete l[h])}else for(h in l)pt.event.remove(t,h+e[u],n,i,!0);pt.isEmptyObject(l)&&$t.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=pt.event.fix(t),l=new Array(arguments.length),u=($t.get(this,"events")||{})[a.type]||[],c=pt.event.special[a.type]||{};for(l[0]=a,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n-1:pt.find(r,this,null,[u]).length),s[r]&&o.push(i);o.length&&a.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,te=/\s*$/g;pt.extend({htmlPrefilter:function(t){return t.replace(Zt,"<$1>")},clone:function(t,e,n){var i,r,o,s,a=t.cloneNode(!0),l=pt.contains(t.ownerDocument,t);if(!(ht.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||pt.isXMLDoc(t)))for(s=y(a),o=y(t),i=0,r=o.length;i0&&b(s,!l&&y(t,"script")),a},cleanData:function(t){for(var e,n,i,r=pt.event.special,o=0;void 0!==(n=t[o]);o++)if(Lt(n)){if(e=n[$t.expando]){if(e.events)for(i in e.events)r[i]?pt.event.remove(n,i):pt.removeEvent(n,i,e.handle);n[$t.expando]=void 0}n[jt.expando]&&(n[jt.expando]=void 0)}}}),pt.fn.extend({detach:function(t){return D(this,t,!0)},remove:function(t){return D(this,t)},text:function(t){return Nt(this,function(t){return void 0===t?pt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return I(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){x(this,t).appendChild(t)}})},prepend:function(){return I(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=x(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return I(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return I(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(pt.cleanData(y(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return pt.clone(this,t,e)})},html:function(t){return Nt(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!te.test(t)&&!zt[(Vt.exec(t)||["",""])[1].toLowerCase()]){t=pt.htmlPrefilter(t);try{for(;n1)}}),pt.Tween=M,M.prototype={constructor:M,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||pt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(pt.cssNumber[n]?"":"px")},cur:function(){var t=M.propHooks[this.prop];return t&&t.get?t.get(this):M.propHooks._default.get(this)},run:function(t){var e,n=M.propHooks[this.prop];return this.options.duration?this.pos=e=pt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=pt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){pt.fx.step[t.prop]?pt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[pt.cssProps[t.prop]]&&!pt.cssHooks[t.prop]?t.elem[t.prop]=t.now:pt.style(t.elem,t.prop,t.now+t.unit)}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},pt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},pt.fx=M.prototype.init,pt.fx.step={};var he,pe,ge=/^(?:toggle|show|hide)$/,me=/queueHooks$/;pt.Animation=pt.extend(K,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return g(n.elem,t,Mt.exec(e),n),n}]},tweener:function(t,e){pt.isFunction(t)?(e=t,t=["*"]):t=t.match(kt);for(var n,i=0,r=t.length;i1)},removeAttr:function(t){return this.each(function(){pt.removeAttr(this,t)})}}),pt.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?pt.prop(t,e,n):(1===o&&pt.isXMLDoc(t)||(r=pt.attrHooks[e.toLowerCase()]||(pt.expr.match.bool.test(e)?ve:void 0)),void 0!==n?null===n?void pt.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=pt.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!ht.radioValue&&"radio"===e&&r(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(kt);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),ve={set:function(t,e,n){return!1===e?pt.removeAttr(t,n):t.setAttribute(n,n),n}},pt.each(pt.expr.match.bool.source.match(/\w+/g),function(t,e){var n=ye[e]||pt.find.attr;ye[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=ye[s],ye[s]=r,r=null!=n(t,e,i)?s:null,ye[s]=o),r}});var be=/^(?:input|select|textarea|button)$/i,_e=/^(?:a|area)$/i;pt.fn.extend({prop:function(t,e){return Nt(this,pt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[pt.propFix[t]||t]})}}),pt.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pt.isXMLDoc(t)||(e=pt.propFix[e]||e,r=pt.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=pt.find.attr(t,"tabindex");return e?parseInt(e,10):be.test(t.nodeName)||_e.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ht.optSelected||(pt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),pt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pt.propFix[this.toLowerCase()]=this}),pt.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,l=0;if(pt.isFunction(t))return this.each(function(e){pt(this).addClass(t.call(this,e,Q(this)))});if("string"==typeof t&&t)for(e=t.match(kt)||[];n=this[l++];)if(r=Q(n),i=1===n.nodeType&&" "+z(r)+" "){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");a=z(i),r!==a&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,l=0;if(pt.isFunction(t))return this.each(function(e){pt(this).removeClass(t.call(this,e,Q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(kt)||[];n=this[l++];)if(r=Q(n),i=1===n.nodeType&&" "+z(r)+" "){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");a=z(i),r!==a&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):pt.isFunction(t)?this.each(function(n){pt(this).toggleClass(t.call(this,n,Q(this),e),e)}):this.each(function(){var e,i,r,o;if("string"===n)for(i=0,r=pt(this),o=t.match(kt)||[];e=o[i++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||(e=Q(this),e&&$t.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":$t.get(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+z(Q(n))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;pt.fn.extend({val:function(t){var e,n,i,r=this[0];{if(arguments.length)return i=pt.isFunction(t),this.each(function(n){var r;1===this.nodeType&&(r=i?t.call(this,n,pt(this).val()):t,null==r?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=pt.map(r,function(t){return null==t?"":t+""})),(e=pt.valHooks[this.type]||pt.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))});if(r)return(e=pt.valHooks[r.type]||pt.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:(n=r.value,"string"==typeof n?n.replace(we,""):null==n?"":n)}}}),pt.extend({valHooks:{option:{get:function(t){var e=pt.find.attr(t,"value");return null!=e?e:z(pt.text(t))}},select:{get:function(t){var e,n,i,o=t.options,s=t.selectedIndex,a="select-one"===t.type,l=a?null:[],u=a?s+1:o.length;for(i=s<0?u:a?s:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),pt.each(["radio","checkbox"],function(){pt.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=pt.inArray(pt(t).val(),e)>-1}},ht.checkOn||(pt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Ce=/^(?:focusinfocus|focusoutblur)$/;pt.extend(pt.event,{trigger:function(e,n,i,r){var o,s,a,l,u,c,f,d=[i||nt],h=ct.call(e,"type")?e.type:e,p=ct.call(e,"namespace")?e.namespace.split("."):[];if(s=a=i=i||nt,3!==i.nodeType&&8!==i.nodeType&&!Ce.test(h+pt.event.triggered)&&(h.indexOf(".")>-1&&(p=h.split("."),h=p.shift(),p.sort()),u=h.indexOf(":")<0&&"on"+h,e=e[pt.expando]?e:new pt.Event(h,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:pt.makeArray(n,[e]),f=pt.event.special[h]||{},r||!f.trigger||!1!==f.trigger.apply(i,n))){if(!r&&!f.noBubble&&!pt.isWindow(i)){for(l=f.delegateType||h,Ce.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(i.ownerDocument||nt)&&d.push(a.defaultView||a.parentWindow||t)}for(o=0;(s=d[o++])&&!e.isPropagationStopped();)e.type=o>1?l:f.bindType||h,c=($t.get(s,"events")||{})[e.type]&&$t.get(s,"handle"),c&&c.apply(s,n),(c=u&&s[u])&&c.apply&&Lt(s)&&(e.result=c.apply(s,n),!1===e.result&&e.preventDefault());return e.type=h,r||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(d.pop(),n)||!Lt(i)||u&&pt.isFunction(i[h])&&!pt.isWindow(i)&&(a=i[u],a&&(i[u]=null),pt.event.triggered=h,i[h](),pt.event.triggered=void 0,a&&(i[u]=a)),e.result}},simulate:function(t,e,n){var i=pt.extend(new pt.Event,n,{type:t,isSimulated:!0});pt.event.trigger(i,null,e)}}),pt.fn.extend({trigger:function(t,e){return this.each(function(){pt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return pt.event.trigger(t,e,n,!0)}}),pt.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){pt.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),pt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),ht.focusin="onfocusin"in t,ht.focusin||pt.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){pt.event.simulate(e,t.target,pt.event.fix(t))};pt.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=$t.access(i,e);r||i.addEventListener(t,n,!0),$t.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=$t.access(i,e)-1;r?$t.access(i,e,r):(i.removeEventListener(t,n,!0),$t.remove(i,e))}}});var Te=t.location,Ee=pt.now(),xe=/\?/;pt.parseXML=function(e){var n;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||pt.error("Invalid XML: "+e),n};var Ae=/\[\]$/,Se=/\r?\n/g,Oe=/^(?:submit|button|image|reset|file)$/i,ke=/^(?:input|select|textarea|keygen)/i;pt.param=function(t,e){var n,i=[],r=function(t,e){var n=pt.isFunction(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(t)||t.jquery&&!pt.isPlainObject(t))pt.each(t,function(){r(this.name,this.value)});else for(n in t)G(n,t[n],e,r);return i.join("&")},pt.fn.extend({serialize:function(){return pt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=pt.prop(this,"elements");return t?pt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!pt(this).is(":disabled")&&ke.test(this.nodeName)&&!Oe.test(t)&&(this.checked||!Ut.test(t))}).map(function(t,e){var n=pt(this).val();return null==n?null:Array.isArray(n)?pt.map(n,function(t){return{name:e.name,value:t.replace(Se,"\r\n")}}):{name:e.name,value:n.replace(Se,"\r\n")}}).get()}});var Ie=/%20/g,De=/#.*$/,Ne=/([?&])_=[^&]*/,Le=/^(.*?):[ \t]*([^\r\n]*)$/gm,$e=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,je=/^(?:GET|HEAD)$/,Pe=/^\/\//,Re={},Fe={},Me="*/".concat("*"),He=nt.createElement("a");He.href=Te.href,pt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Te.href,type:"GET",isLocal:$e.test(Te.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Me,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":pt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?J(J(t,pt.ajaxSettings),e):J(pt.ajaxSettings,t)},ajaxPrefilter:Y(Re),ajaxTransport:Y(Fe),ajax:function(e,n){function i(e,n,i,a){var u,d,h,_,w,C=n;c||(c=!0,l&&t.clearTimeout(l),r=void 0,s=a||"",T.readyState=e>0?4:0,u=e>=200&&e<300||304===e,i&&(_=Z(p,T,i)),_=tt(p,_,T,u),u?(p.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(pt.lastModified[o]=w),(w=T.getResponseHeader("etag"))&&(pt.etag[o]=w)),204===e||"HEAD"===p.type?C="nocontent":304===e?C="notmodified":(C=_.state,d=_.data,h=_.error,u=!h)):(h=C,!e&&C||(C="error",e<0&&(e=0))),T.status=e,T.statusText=(n||C)+"",u?v.resolveWith(g,[d,C,T]):v.rejectWith(g,[T,C,h]),T.statusCode(b),b=void 0,f&&m.trigger(u?"ajaxSuccess":"ajaxError",[T,p,u?d:h]),y.fireWith(g,[T,C]),f&&(m.trigger("ajaxComplete",[T,p]),--pt.active||pt.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,o,s,a,l,u,c,f,d,h,p=pt.ajaxSetup({},n),g=p.context||p,m=p.context&&(g.nodeType||g.jquery)?pt(g):pt.event,v=pt.Deferred(),y=pt.Callbacks("once memory"),b=p.statusCode||{},_={},w={},C="canceled",T={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Le.exec(s);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,_[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)T.always(t[T.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),i(0,e),this}};if(v.promise(T),p.url=((e||p.url||Te.href)+"").replace(Pe,Te.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(kt)||[""],null==p.crossDomain){u=nt.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=He.protocol+"//"+He.host!=u.protocol+"//"+u.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=pt.param(p.data,p.traditional)),X(Re,p,n,T),c)return T;f=pt.event&&p.global,f&&0==pt.active++&&pt.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!je.test(p.type),o=p.url.replace(De,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ie,"+")):(h=p.url.slice(o.length),p.data&&(o+=(xe.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(o=o.replace(Ne,"$1"),h=(xe.test(o)?"&":"?")+"_="+Ee+++h),p.url=o+h),p.ifModified&&(pt.lastModified[o]&&T.setRequestHeader("If-Modified-Since",pt.lastModified[o]),pt.etag[o]&&T.setRequestHeader("If-None-Match",pt.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Me+"; q=0.01":""):p.accepts["*"]);for(d in p.headers)T.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(g,T,p)||c))return T.abort();if(C="abort",y.add(p.complete),T.done(p.success),T.fail(p.error),r=X(Fe,p,n,T)){if(T.readyState=1,f&&m.trigger("ajaxSend",[T,p]),c)return T;p.async&&p.timeout>0&&(l=t.setTimeout(function(){T.abort("timeout")},p.timeout));try{c=!1,r.send(_,i)}catch(t){if(c)throw t;i(-1,t)}}else i(-1,"No Transport");return T},getJSON:function(t,e,n){return pt.get(t,e,n,"json")},getScript:function(t,e){return pt.get(t,void 0,e,"script")}}),pt.each(["get","post"],function(t,e){pt[e]=function(t,n,i,r){return pt.isFunction(n)&&(r=r||i,i=n,n=void 0),pt.ajax(pt.extend({url:t,type:e,dataType:r,data:n,success:i},pt.isPlainObject(t)&&t))}}),pt._evalUrl=function(t){return pt.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},pt.fn.extend({wrapAll:function(t){var e;return this[0]&&(pt.isFunction(t)&&(t=t.call(this[0])),e=pt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return pt.isFunction(t)?this.each(function(e){pt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=pt(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=pt.isFunction(t);return this.each(function(n){pt(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){pt(this).replaceWith(this.childNodes)}),this}}),pt.expr.pseudos.hidden=function(t){return!pt.expr.pseudos.visible(t)},pt.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},pt.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var We={0:200,1223:204},qe=pt.ajaxSettings.xhr();ht.cors=!!qe&&"withCredentials"in qe,ht.ajax=qe=!!qe,pt.ajaxTransport(function(e){var n,i;if(ht.cors||qe&&!e.crossDomain)return{send:function(r,o){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(s in r)a.setRequestHeader(s,r[s]);n=function(t){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(We[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout(function(){n&&i()})},n=n("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}}),pt.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),pt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return pt.globalEval(t),t}}}),pt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),pt.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(i,r){e=pt("