/* WEBPACK VAR INJECTION */

/* eslint-disable require-jsdoc, valid-jsdoc */

/* harmony default export */

/**
             * @returns {boolean}
             */

/**
         * @param {*} key
         * @param {*} value
         * @returns {void}
         */

/**
         * @param {*} key
         * @returns {*}
         */

/**
         * @param {*} key
         * @returns {void}
         */

/**
         * @param {Function} callback
         * @param {*} [ctx=null]
         * @returns {void}
         */

/**
         * @returns {void}
         */

/**
         * A list of connected observers.
         *
         * @private {Array<ResizeObserverSPI>}
         */

/**
         * Broadcasted height of content rectangle.
         *
         * @type {number}
         */

/**
         * Broadcasted width of content rectangle.
         *
         * @type {number}
         */

/**
         * Collection of resize observations that have detected changes in dimensions
         * of elements.
         *
         * @private {Array<ResizeObservation>}
         */

/**
         * Indicates whether DOM listeners have been added.
         *
         * @private {boolean}
         */

/**
         * Keeps reference to the instance of MutationObserver.
         *
         * @private {MutationObserver}
         */

/**
         * Reference to the last observed content rectangle.
         *
         * @private {DOMRectInit}
         */

/**
         * Registry of the ResizeObservation instances.
         *
         * @private {Map<Element, ResizeObservation>}
         */

/**
         * Tells that controller has subscribed for Mutation Events.
         *
         * @private {boolean}
         */

/**
     * "Transitionend" event handler.
     *
     * @private
     * @param {TransitionEvent} event
     * @returns {void}
     */

/**
     * Adds observer to observers list.
     *
     * @param {ResizeObserverSPI} observer - Observer to be added.
     * @returns {void}
     */

/**
     * Callback invoked after the specified delay. It will further postpone
     * invocation of the original function delegating it to the
     * requestAnimationFrame.
     *
     * @returns {void}
     */

/**
     * Clears the collection of active observations.
     *
     * @returns {void}
     */

/**
     * Collects observation instances the associated element of which has changed
     * it's content rectangle.
     *
     * @returns {void}
     */

/**
     * Creates a new instance of ResizeObserver.
     *
     * @param {ResizeObserverCallback} callback - Callback function that is invoked
     *      when one of the observed elements changes it's content dimensions.
     * @param {ResizeObserverController} controller - Controller instance which
     *      is responsible for the updates of observer.
     * @param {ResizeObserver} callbackCtx - Reference to the public
     *      ResizeObserver instance which will be passed to callback function.
     */

/**
     * Creates a new instance of ResizeObserver.
     *
     * @param {ResizeObserverCallback} callback - Callback that is invoked when
     *      dimensions of the observed elements change.
     */

/**
     * Creates a new instance of ResizeObserverController.
     *
     * @private
     */

/**
     * Creates an instance of ResizeObservation.
     *
     * @param {Element} target - Element to be observed.
     */

/**
     * Creates an instance of ResizeObserverEntry.
     *
     * @param {Element} target - Element that is being observed.
     * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
     */

/**
     * Holds reference to the controller's instance.
     *
     * @private {ResizeObserverController}
     */

/**
     * Initializes DOM listeners.
     *
     * @private
     * @returns {void}
     */

/**
     * Invokes initial callback function with a list of ResizeObserverEntry
     * instances collected from active resize observations.
     *
     * @returns {void}
     */

/**
     * Invokes the original callback function and schedules new invocation if
     * the "proxy" was called during current request.
     *
     * @returns {void}
     */

/**
     * Invokes the update of observers. It will continue running updates insofar
     * it detects changes.
     *
     * @returns {void}
     */

/**
     * Removes DOM listeners.
     *
     * @private
     * @returns {void}
     */

/**
     * Removes observer from observers list.
     *
     * @param {ResizeObserverSPI} observer - Observer to be removed.
     * @returns {void}
     */

/**
     * Returns index in provided array that matches the specified key.
     *
     * @param {Array<Array>} arr
     * @param {*} key
     * @returns {number}
     */

/**
     * Returns instance of the ResizeObserverController.
     *
     * @returns {ResizeObserverController}
     */

/**
     * Schedules invocation of the original function.
     *
     * @returns {void}
     */

/**
     * Starts observing provided element.
     *
     * @param {Element} target - Element to be observed.
     * @returns {void}
     */

/**
     * Stops observing all elements.
     *
     * @returns {void}
     */

/**
     * Stops observing provided element.
     *
     * @param {Element} target - Element to stop observing.
     * @returns {void}
     */

/**
     * Tells whether observer has active observations.
     *
     * @returns {boolean}
     */

/**
     * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
     * from the corresponding properties of the last observed content rectangle.
     *
     * @returns {DOMRectInit} Last observed content rectangle.
     */

/**
     * Updates content rectangle and tells whether it's width or height properties
     * have changed since the last broadcast.
     *
     * @returns {boolean}
     */

/**
     * Updates every observer from observers list and notifies them of queued
     * entries.
     *
     * @private
     * @returns {boolean} Returns "true" if any observer has detected changes in
     *      dimensions of it's elements.
     */

/**
 * A collection of shims that provide minimal functionality of the ES6 collections.
 *
 * These implementations are not meant to be used outside of the ResizeObserver
 * modules as they cover only a limited range of use cases.
 */

/**
 * Calculates an appropriate content rectangle for provided html or svg element.
 *
 * @param {Element} target - Element content rectangle of which needs to be calculated.
 * @returns {DOMRectInit}
 */

/**
 * Calculates content rectangle of provided HTMLElement.
 *
 * @param {HTMLElement} target - Element for which to calculate the content rectangle.
 * @returns {DOMRectInit}
 */

/**
 * Calculates content rectangle of provided SVG element.
 *
 * @param {SVGGraphicsElement} target - Element content rectangle of which needs
 *      to be calculated.
 * @returns {DOMRectInit}
 */

/**
 * Checks whether provided element is a document element (<html>).
 *
 * @param {Element} target - Element to be checked.
 * @returns {boolean}
 */

/**
 * Checks whether provided element is an instance of the SVGGraphicsElement.
 *
 * @param {Element} target - Element to be checked.
 * @returns {boolean}
 */

/**
 * Class that is responsible for computations of the content rectangle of
 * provided DOM element and for keeping track of it's changes.
 */

/**
 * Converts provided string to a number.
 *
 * @param {number|string} value
 * @returns {number}
 */

/**
 * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
 * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
 *
 * @param {number} x - X coordinate.
 * @param {number} y - Y coordinate.
 * @param {number} width - Rectangle's width.
 * @param {number} height - Rectangle's height.
 * @returns {DOMRectInit}
 */

/**
 * Creates a wrapper function which ensures that provided callback will be
 * invoked only once during the specified delay period.
 *
 * @param {Function} callback - Function to be invoked after the delay period.
 * @param {number} delay - Delay after which to invoke callback.
 * @returns {Function}
 */

/**
 * Creates rectangle with an interface of the DOMRectReadOnly.
 * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
 *
 * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
 * @returns {DOMRectReadOnly}
 */

/**
 * Detects whether window and document objects are available in current environment.
 */

/**
 * Extracts borders size from provided styles.
 *
 * @param {CSSStyleDeclaration} styles
 * @param {...string} positions - Borders positions (top, right, ...)
 * @returns {number}
 */

/**
 * Extracts paddings sizes from provided styles.
 *
 * @param {CSSStyleDeclaration} styles
 * @returns {Object} Paddings box.
 */

/** @class */

/***/

//

// 314px. And it doesn't happen all the time. So just ignore this delta

// A list of substrings of CSS properties used to find transition events that

// According to the specification following properties are not writable

// Add listeners if they haven't been added yet.

// Besides, it's as well not necessary as the <html> itself neither has

// By this condition we can catch all non-replaced inline, hidden and

// Chrome has a rather weird rounding of "client" properties.

// Client width & height properties can't be

// Collect observers that have active observations.

// Continue running updates if changes have been detected as there might

// Create ResizeObserverEntry instance for every active observation.

// Deliver notifications in a separate cycle in order to avoid any

// Detect whether transition may affect dimensions of an element.

// Do nothing if current environment doesn't have the Element interface.

// Do nothing if element is already being observed.

// Do nothing if element is not being observed.

// Do nothing if observer doesn't have active observations.

// Do nothing if running in a non-browser environment or if listeners

// E.g. for an element with content width of 314.2px it sometimes gives

// Export existing implementation if available.

// Expose public methods of ResizeObserver.

// Following conditions are required to handle Internet Explorer which

// Following steps can't be applied to the document's root element as its

// Force the update of observations.

// In some browsers (only in Firefox, actually) CSS width & height

// Minimum delay before invoking the update of observers.

// Property accessors are not being used as they'd require to define a

// Rectangle's properties are not writable and non-enumerable.

// Reject immediately following calls.

// Remove listeners if controller has no connected observers.

// Remove observer if it's present in registry.

// ResizeObserver are tracking the same element and the callback of one

// Return the local global object if it's not possible extract one from

// Schedule new call to be in invoked when the pending one is resolved.

// Some browsers, namely IE and Edge, don't have the SVGGraphicsElement

// Subscription to the "Transitionend" event is used as a workaround for

// This is important for "transitions" which never actually start

// We can say that if CSS dimensions + paddings are equal to the "client"

// Width & height include paddings and borders when the 'border-box' box

// Without it we would need to implement separate methods for each of

// and "client" properties, though that is not always true in Chrome.

// and are also not enumerable in the native implementation.

// anything, or an element merely doesn't have paddings/borders styles.

// as a non-relevant.

// bars are the only difference between rounded dimensions + paddings

// be future ones caused by CSS transitions.

// client[Width/Height] properties represent viewport area of the window.

// collisions between observers, e.g. when multiple instances of

// delayed transitions. This way it's possible to capture at least the

// detached elements. Though elements with width & height properties less

// doesn't include paddings and borders to computed CSS dimensions.

// don't support this type of collections.

// effective test for hidden elements. E.g. even jQuery's ':visible' filter

// final state of an element.

// gives wrong results for elements with width & height less than 0.5.

// happens amids the pending invocation.

// have been already added.

// have been already removed.

// immediately so there is a chance that we might miss one if change

// include scroll bars size which can be removed at this step as scroll

// interface.

// might affect dimensions of observed elements.

// model is applied (except for IE).

// of them changes content dimensions of the observed target. Sometimes

// private WeakMap storage which may cause memory leaks in browsers that

// properties then it's either IE, and thus we don't need to subtract

// provided element.

// rendered scroll bars nor it can be clipped.

// than 0.5 will be discarded as well.

// the client width of 315px and for the width of 314.7px it may give

// this may result in notifications being blocked for the rest of observers.

// those cases and it's not possible to perform a precise and performance

// used exclusively as they provide rounded values.
