@volley/vwr-loader 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/intersection-observer-DAXvjMTZ.js +2 -0
- package/dist/assets/intersection-observer-DAXvjMTZ.js.map +1 -0
- package/dist/assets/resize-observer-DqyxKk7V.js +2 -0
- package/dist/assets/resize-observer-DqyxKk7V.js.map +1 -0
- package/dist/exitHandler.d.ts +32 -0
- package/dist/exitHandler.d.ts.map +1 -0
- package/dist/exitHandler.js +113 -0
- package/dist/exitHandler.js.map +1 -0
- package/dist/main.js +11 -9
- package/dist/main.js.map +1 -1
- package/dist/polyfills.d.ts +29 -0
- package/dist/polyfills.d.ts.map +1 -0
- package/dist/polyfills.js +32 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/exitHandler.test.ts +179 -0
- package/src/exitHandler.ts +125 -0
- package/src/main.ts +20 -0
- package/src/polyfills.ts +32 -0
- package/src/types.ts +4 -0
- package/src/vite-env.d.ts +13 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}function p(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(e){return null}}var f=function(t){for(var e=t,i=p(e);i;)e=i.ownerDocument,i=p(e);return e}(window.document),g=[],v=null,c=null;function b(t){this.time=t.time,this.target=t.target,this.rootBounds=_(t.rootBounds),this.boundingClientRect=_(t.boundingClientRect),this.intersectionRect=_(t.intersectionRect||m()),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,i=e.width*e.height,n=this.intersectionRect,r=n.width*n.height;i?this.intersectionRatio=Number((r/i).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function o(t,e){var i=e||{};if(typeof t!="function")throw new Error("callback must be a function");if(i.root&&i.root.nodeType!=1&&i.root.nodeType!=9)throw new Error("root must be a Document or Element");this._checkForIntersections=x(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map(function(n){return n.value+n.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.USE_MUTATION_OBSERVER=!0,o._setupCrossOriginUpdater=function(){return v||(v=function(t,e){!t||!e?c=m():c=I(t,e),g.forEach(function(i){i._checkForIntersections()})}),v},o._resetCrossOriginUpdater=function(){v=null,c=null},o.prototype.observe=function(t){var e=this._observationTargets.some(function(i){return i.element==t});if(!e){if(!(t&&t.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},o.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._unmonitorIntersections(t.ownerDocument),this._observationTargets.length==0&&this._unregisterInstance()},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},o.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(i,n,r){if(typeof i!="number"||isNaN(i)||i<0||i>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return i!==r[n-1]})},o.prototype._parseRootMargin=function(t){var e=t||"0px",i=e.split(/\s+/).map(function(n){var r=/^(-?\d*\.?\d+)(px|%)$/.exec(n);if(!r)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(r[1]),unit:r[2]}});return i[1]=i[1]||i[0],i[2]=i[2]||i[0],i[3]=i[3]||i[1],i},o.prototype._monitorIntersections=function(t){var e=t.defaultView;if(e&&this._monitoringDocuments.indexOf(t)==-1){var i=this._checkForIntersections,n=null,r=null;this.POLL_INTERVAL?n=e.setInterval(i,this.POLL_INTERVAL):(y(e,"resize",i,!0),y(t,"scroll",i,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in e&&(r=new e.MutationObserver(i),r.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(t),this._monitoringUnsubscribes.push(function(){var h=t.defaultView;h&&(n&&h.clearInterval(n),E(h,"resize",i,!0)),E(t,"scroll",i,!0),r&&r.disconnect()});var u=this.root&&(this.root.ownerDocument||this.root)||f;if(t!=u){var s=p(t);s&&this._monitorIntersections(s.ownerDocument)}}},o.prototype._unmonitorIntersections=function(t){var e=this._monitoringDocuments.indexOf(t);if(e!=-1){var i=this.root&&(this.root.ownerDocument||this.root)||f,n=this._observationTargets.some(function(s){var h=s.element.ownerDocument;if(h==t)return!0;for(;h&&h!=i;){var a=p(h);if(h=a&&a.ownerDocument,h==t)return!0}return!1});if(!n){var r=this._monitoringUnsubscribes[e];if(this._monitoringDocuments.splice(e,1),this._monitoringUnsubscribes.splice(e,1),r(),t!=i){var u=p(t);u&&this._unmonitorIntersections(u.ownerDocument)}}}},o.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e<t.length;e++)t[e]()},o.prototype._checkForIntersections=function(){if(!(!this.root&&v&&!c)){var t=this._rootIsInDom(),e=t?this._getRootRect():m();this._observationTargets.forEach(function(i){var n=i.element,r=d(n),u=this._rootContainsTarget(n),s=i.entry,h=t&&u&&this._computeTargetAndRootIntersection(n,r,e),a=null;this._rootContainsTarget(n)?(!v||this.root)&&(a=e):a=m();var l=i.entry=new b({time:M(),target:n,boundingClientRect:r,rootBounds:a,intersectionRect:h});s?t&&u?this._hasCrossedThreshold(s,l)&&this._queuedEntries.push(l):s&&s.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},o.prototype._computeTargetAndRootIntersection=function(t,e,i){if(window.getComputedStyle(t).display!="none"){for(var n=e,r=w(t),u=!1;!u&&r;){var s=null,h=r.nodeType==1?window.getComputedStyle(r):{};if(h.display=="none")return null;if(r==this.root||r.nodeType==9)if(u=!0,r==this.root||r==f)v&&!this.root?!c||c.width==0&&c.height==0?(r=null,s=null,n=null):s=c:s=i;else{var a=w(r),l=a&&d(a),O=a&&this._computeTargetAndRootIntersection(a,l,i);l&&O?(r=a,s=I(l,O)):(r=null,n=null)}else{var D=r.ownerDocument;r!=D.body&&r!=D.documentElement&&h.overflow!="visible"&&(s=d(r))}if(s&&(n=L(s,n)),!n)break;r=r&&w(r)}return n}},o.prototype._getRootRect=function(){var t;if(this.root&&!R(this.root))t=d(this.root);else{var e=R(this.root)?this.root:f,i=e.documentElement,n=e.body;t={top:0,left:0,right:i.clientWidth||n.clientWidth,width:i.clientWidth||n.clientWidth,bottom:i.clientHeight||n.clientHeight,height:i.clientHeight||n.clientHeight}}return this._expandRectByRootMargin(t)},o.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(n,r){return n.unit=="px"?n.value:n.value*(r%2?t.width:t.height)/100}),i={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return i.width=i.right-i.left,i.height=i.bottom-i.top,i},o.prototype._hasCrossedThreshold=function(t,e){var i=t&&t.isIntersecting?t.intersectionRatio||0:-1,n=e.isIntersecting?e.intersectionRatio||0:-1;if(i!==n)for(var r=0;r<this.thresholds.length;r++){var u=this.thresholds[r];if(u==i||u==n||u<i!=u<n)return!0}},o.prototype._rootIsInDom=function(){return!this.root||T(f,this.root)},o.prototype._rootContainsTarget=function(t){var e=this.root&&(this.root.ownerDocument||this.root)||f;return T(e,t)&&(!this.root||e==t.ownerDocument)},o.prototype._registerInstance=function(){g.indexOf(this)<0&&g.push(this)},o.prototype._unregisterInstance=function(){var t=g.indexOf(this);t!=-1&&g.splice(t,1)};function M(){return window.performance&&performance.now&&performance.now()}function x(t,e){var i=null;return function(){i||(i=setTimeout(function(){t(),i=null},e))}}function y(t,e,i,n){typeof t.addEventListener=="function"?t.addEventListener(e,i,n):typeof t.attachEvent=="function"&&t.attachEvent("on"+e,i)}function E(t,e,i,n){typeof t.removeEventListener=="function"?t.removeEventListener(e,i,n):typeof t.detachEvent=="function"&&t.detachEvent("on"+e,i)}function L(t,e){var i=Math.max(t.top,e.top),n=Math.min(t.bottom,e.bottom),r=Math.max(t.left,e.left),u=Math.min(t.right,e.right),s=u-r,h=n-i;return s>=0&&h>=0&&{top:i,bottom:n,left:r,right:u,width:s,height:h}||null}function d(t){var e;try{e=t.getBoundingClientRect()}catch(i){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):m()}function m(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function _(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function I(t,e){var i=e.top-t.top,n=e.left-t.left;return{top:i,left:n,height:e.height,width:e.width,bottom:i+e.height,right:n+e.width}}function T(t,e){for(var i=e;i;){if(i==t)return!0;i=w(i)}return!1}function w(t){var e=t.parentNode;return t.nodeType==9&&t!=f?p(t):(e&&e.assignedSlot&&(e=e.assignedSlot.parentNode),e&&e.nodeType==11&&e.host?e.host:e)}function R(t){return t&&t.nodeType===9}window.IntersectionObserver=o,window.IntersectionObserverEntry=b})();
|
|
2
|
+
//# sourceMappingURL=intersection-observer-DAXvjMTZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection-observer-DAXvjMTZ.js","sources":["../../../../node_modules/.pnpm/intersection-observer@0.12.2/node_modules/intersection-observer/intersection-observer.js"],"sourcesContent":["/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.\n *\n * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n *\n */\n(function() {\n'use strict';\n\n// Exit early if we're not running in a browser.\nif (typeof window !== 'object') {\n return;\n}\n\n// Exit early if all IntersectionObserver and IntersectionObserverEntry\n// features are natively supported.\nif ('IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n\n // Minimal polyfill for Edge 15's lack of `isIntersecting`\n // See: https://github.com/w3c/IntersectionObserver/issues/211\n if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n Object.defineProperty(window.IntersectionObserverEntry.prototype,\n 'isIntersecting', {\n get: function () {\n return this.intersectionRatio > 0;\n }\n });\n }\n return;\n}\n\n/**\n * Returns the embedding frame element, if any.\n * @param {!Document} doc\n * @return {!Element}\n */\nfunction getFrameElement(doc) {\n try {\n return doc.defaultView && doc.defaultView.frameElement || null;\n } catch (e) {\n // Ignore the error.\n return null;\n }\n}\n\n/**\n * A local reference to the root document.\n */\nvar document = (function(startDoc) {\n var doc = startDoc;\n var frame = getFrameElement(doc);\n while (frame) {\n doc = frame.ownerDocument;\n frame = getFrameElement(doc);\n }\n return doc;\n})(window.document);\n\n/**\n * An IntersectionObserver registry. This registry exists to hold a strong\n * reference to IntersectionObserver instances currently observing a target\n * element. Without this registry, instances without another reference may be\n * garbage collected.\n */\nvar registry = [];\n\n/**\n * The signal updater for cross-origin intersection. When not null, it means\n * that the polyfill is configured to work in a cross-origin mode.\n * @type {function(DOMRect|ClientRect, DOMRect|ClientRect)}\n */\nvar crossOriginUpdater = null;\n\n/**\n * The current cross-origin intersection. Only used in the cross-origin mode.\n * @type {DOMRect|ClientRect}\n */\nvar crossOriginRect = null;\n\n\n/**\n * Creates the global IntersectionObserverEntry constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry\n * @param {Object} entry A dictionary of instance properties.\n * @constructor\n */\nfunction IntersectionObserverEntry(entry) {\n this.time = entry.time;\n this.target = entry.target;\n this.rootBounds = ensureDOMRect(entry.rootBounds);\n this.boundingClientRect = ensureDOMRect(entry.boundingClientRect);\n this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect());\n this.isIntersecting = !!entry.intersectionRect;\n\n // Calculates the intersection ratio.\n var targetRect = this.boundingClientRect;\n var targetArea = targetRect.width * targetRect.height;\n var intersectionRect = this.intersectionRect;\n var intersectionArea = intersectionRect.width * intersectionRect.height;\n\n // Sets intersection ratio.\n if (targetArea) {\n // Round the intersection ratio to avoid floating point math issues:\n // https://github.com/w3c/IntersectionObserver/issues/324\n this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));\n } else {\n // If area is zero and is intersecting, sets to 1, otherwise to 0\n this.intersectionRatio = this.isIntersecting ? 1 : 0;\n }\n}\n\n\n/**\n * Creates the global IntersectionObserver constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface\n * @param {Function} callback The function to be invoked after intersection\n * changes have queued. The function is not invoked if the queue has\n * been emptied by calling the `takeRecords` method.\n * @param {Object=} opt_options Optional configuration options.\n * @constructor\n */\nfunction IntersectionObserver(callback, opt_options) {\n\n var options = opt_options || {};\n\n if (typeof callback != 'function') {\n throw new Error('callback must be a function');\n }\n\n if (\n options.root &&\n options.root.nodeType != 1 &&\n options.root.nodeType != 9\n ) {\n throw new Error('root must be a Document or Element');\n }\n\n // Binds and throttles `this._checkForIntersections`.\n this._checkForIntersections = throttle(\n this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);\n\n // Private properties.\n this._callback = callback;\n this._observationTargets = [];\n this._queuedEntries = [];\n this._rootMarginValues = this._parseRootMargin(options.rootMargin);\n\n // Public properties.\n this.thresholds = this._initThresholds(options.threshold);\n this.root = options.root || null;\n this.rootMargin = this._rootMarginValues.map(function(margin) {\n return margin.value + margin.unit;\n }).join(' ');\n\n /** @private @const {!Array<!Document>} */\n this._monitoringDocuments = [];\n /** @private @const {!Array<function()>} */\n this._monitoringUnsubscribes = [];\n}\n\n\n/**\n * The minimum interval within which the document will be checked for\n * intersection changes.\n */\nIntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;\n\n\n/**\n * The frequency in which the polyfill polls for intersection changes.\n * this can be updated on a per instance basis and must be set prior to\n * calling `observe` on the first target.\n */\nIntersectionObserver.prototype.POLL_INTERVAL = null;\n\n/**\n * Use a mutation observer on the root element\n * to detect intersection changes.\n */\nIntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;\n\n\n/**\n * Sets up the polyfill in the cross-origin mode. The result is the\n * updater function that accepts two arguments: `boundingClientRect` and\n * `intersectionRect` - just as these fields would be available to the\n * parent via `IntersectionObserverEntry`. This function should be called\n * each time the iframe receives intersection information from the parent\n * window, e.g. via messaging.\n * @return {function(DOMRect|ClientRect, DOMRect|ClientRect)}\n */\nIntersectionObserver._setupCrossOriginUpdater = function() {\n if (!crossOriginUpdater) {\n /**\n * @param {DOMRect|ClientRect} boundingClientRect\n * @param {DOMRect|ClientRect} intersectionRect\n */\n crossOriginUpdater = function(boundingClientRect, intersectionRect) {\n if (!boundingClientRect || !intersectionRect) {\n crossOriginRect = getEmptyRect();\n } else {\n crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect);\n }\n registry.forEach(function(observer) {\n observer._checkForIntersections();\n });\n };\n }\n return crossOriginUpdater;\n};\n\n\n/**\n * Resets the cross-origin mode.\n */\nIntersectionObserver._resetCrossOriginUpdater = function() {\n crossOriginUpdater = null;\n crossOriginRect = null;\n};\n\n\n/**\n * Starts observing a target element for intersection changes based on\n * the thresholds values.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.observe = function(target) {\n var isTargetAlreadyObserved = this._observationTargets.some(function(item) {\n return item.element == target;\n });\n\n if (isTargetAlreadyObserved) {\n return;\n }\n\n if (!(target && target.nodeType == 1)) {\n throw new Error('target must be an Element');\n }\n\n this._registerInstance();\n this._observationTargets.push({element: target, entry: null});\n this._monitorIntersections(target.ownerDocument);\n this._checkForIntersections();\n};\n\n\n/**\n * Stops observing a target element for intersection changes.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.unobserve = function(target) {\n this._observationTargets =\n this._observationTargets.filter(function(item) {\n return item.element != target;\n });\n this._unmonitorIntersections(target.ownerDocument);\n if (this._observationTargets.length == 0) {\n this._unregisterInstance();\n }\n};\n\n\n/**\n * Stops observing all target elements for intersection changes.\n */\nIntersectionObserver.prototype.disconnect = function() {\n this._observationTargets = [];\n this._unmonitorAllIntersections();\n this._unregisterInstance();\n};\n\n\n/**\n * Returns any queue entries that have not yet been reported to the\n * callback and clears the queue. This can be used in conjunction with the\n * callback to obtain the absolute most up-to-date intersection information.\n * @return {Array} The currently queued entries.\n */\nIntersectionObserver.prototype.takeRecords = function() {\n var records = this._queuedEntries.slice();\n this._queuedEntries = [];\n return records;\n};\n\n\n/**\n * Accepts the threshold value from the user configuration object and\n * returns a sorted array of unique threshold values. If a value is not\n * between 0 and 1 and error is thrown.\n * @private\n * @param {Array|number=} opt_threshold An optional threshold value or\n * a list of threshold values, defaulting to [0].\n * @return {Array} A sorted list of unique and valid threshold values.\n */\nIntersectionObserver.prototype._initThresholds = function(opt_threshold) {\n var threshold = opt_threshold || [0];\n if (!Array.isArray(threshold)) threshold = [threshold];\n\n return threshold.sort().filter(function(t, i, a) {\n if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {\n throw new Error('threshold must be a number between 0 and 1 inclusively');\n }\n return t !== a[i - 1];\n });\n};\n\n\n/**\n * Accepts the rootMargin value from the user configuration object\n * and returns an array of the four margin values as an object containing\n * the value and unit properties. If any of the values are not properly\n * formatted or use a unit other than px or %, and error is thrown.\n * @private\n * @param {string=} opt_rootMargin An optional rootMargin value,\n * defaulting to '0px'.\n * @return {Array<Object>} An array of margin objects with the keys\n * value and unit.\n */\nIntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) {\n var marginString = opt_rootMargin || '0px';\n var margins = marginString.split(/\\s+/).map(function(margin) {\n var parts = /^(-?\\d*\\.?\\d+)(px|%)$/.exec(margin);\n if (!parts) {\n throw new Error('rootMargin must be specified in pixels or percent');\n }\n return {value: parseFloat(parts[1]), unit: parts[2]};\n });\n\n // Handles shorthand.\n margins[1] = margins[1] || margins[0];\n margins[2] = margins[2] || margins[0];\n margins[3] = margins[3] || margins[1];\n\n return margins;\n};\n\n\n/**\n * Starts polling for intersection changes if the polling is not already\n * happening, and if the page's visibility state is visible.\n * @param {!Document} doc\n * @private\n */\nIntersectionObserver.prototype._monitorIntersections = function(doc) {\n var win = doc.defaultView;\n if (!win) {\n // Already destroyed.\n return;\n }\n if (this._monitoringDocuments.indexOf(doc) != -1) {\n // Already monitoring.\n return;\n }\n\n // Private state for monitoring.\n var callback = this._checkForIntersections;\n var monitoringInterval = null;\n var domObserver = null;\n\n // If a poll interval is set, use polling instead of listening to\n // resize and scroll events or DOM mutations.\n if (this.POLL_INTERVAL) {\n monitoringInterval = win.setInterval(callback, this.POLL_INTERVAL);\n } else {\n addEvent(win, 'resize', callback, true);\n addEvent(doc, 'scroll', callback, true);\n if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in win) {\n domObserver = new win.MutationObserver(callback);\n domObserver.observe(doc, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n }\n }\n\n this._monitoringDocuments.push(doc);\n this._monitoringUnsubscribes.push(function() {\n // Get the window object again. When a friendly iframe is destroyed, it\n // will be null.\n var win = doc.defaultView;\n\n if (win) {\n if (monitoringInterval) {\n win.clearInterval(monitoringInterval);\n }\n removeEvent(win, 'resize', callback, true);\n }\n\n removeEvent(doc, 'scroll', callback, true);\n if (domObserver) {\n domObserver.disconnect();\n }\n });\n\n // Also monitor the parent.\n var rootDoc =\n (this.root && (this.root.ownerDocument || this.root)) || document;\n if (doc != rootDoc) {\n var frame = getFrameElement(doc);\n if (frame) {\n this._monitorIntersections(frame.ownerDocument);\n }\n }\n};\n\n\n/**\n * Stops polling for intersection changes.\n * @param {!Document} doc\n * @private\n */\nIntersectionObserver.prototype._unmonitorIntersections = function(doc) {\n var index = this._monitoringDocuments.indexOf(doc);\n if (index == -1) {\n return;\n }\n\n var rootDoc =\n (this.root && (this.root.ownerDocument || this.root)) || document;\n\n // Check if any dependent targets are still remaining.\n var hasDependentTargets =\n this._observationTargets.some(function(item) {\n var itemDoc = item.element.ownerDocument;\n // Target is in this context.\n if (itemDoc == doc) {\n return true;\n }\n // Target is nested in this context.\n while (itemDoc && itemDoc != rootDoc) {\n var frame = getFrameElement(itemDoc);\n itemDoc = frame && frame.ownerDocument;\n if (itemDoc == doc) {\n return true;\n }\n }\n return false;\n });\n if (hasDependentTargets) {\n return;\n }\n\n // Unsubscribe.\n var unsubscribe = this._monitoringUnsubscribes[index];\n this._monitoringDocuments.splice(index, 1);\n this._monitoringUnsubscribes.splice(index, 1);\n unsubscribe();\n\n // Also unmonitor the parent.\n if (doc != rootDoc) {\n var frame = getFrameElement(doc);\n if (frame) {\n this._unmonitorIntersections(frame.ownerDocument);\n }\n }\n};\n\n\n/**\n * Stops polling for intersection changes.\n * @param {!Document} doc\n * @private\n */\nIntersectionObserver.prototype._unmonitorAllIntersections = function() {\n var unsubscribes = this._monitoringUnsubscribes.slice(0);\n this._monitoringDocuments.length = 0;\n this._monitoringUnsubscribes.length = 0;\n for (var i = 0; i < unsubscribes.length; i++) {\n unsubscribes[i]();\n }\n};\n\n\n/**\n * Scans each observation target for intersection changes and adds them\n * to the internal entries queue. If new entries are found, it\n * schedules the callback to be invoked.\n * @private\n */\nIntersectionObserver.prototype._checkForIntersections = function() {\n if (!this.root && crossOriginUpdater && !crossOriginRect) {\n // Cross origin monitoring, but no initial data available yet.\n return;\n }\n\n var rootIsInDom = this._rootIsInDom();\n var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();\n\n this._observationTargets.forEach(function(item) {\n var target = item.element;\n var targetRect = getBoundingClientRect(target);\n var rootContainsTarget = this._rootContainsTarget(target);\n var oldEntry = item.entry;\n var intersectionRect = rootIsInDom && rootContainsTarget &&\n this._computeTargetAndRootIntersection(target, targetRect, rootRect);\n\n var rootBounds = null;\n if (!this._rootContainsTarget(target)) {\n rootBounds = getEmptyRect();\n } else if (!crossOriginUpdater || this.root) {\n rootBounds = rootRect;\n }\n\n var newEntry = item.entry = new IntersectionObserverEntry({\n time: now(),\n target: target,\n boundingClientRect: targetRect,\n rootBounds: rootBounds,\n intersectionRect: intersectionRect\n });\n\n if (!oldEntry) {\n this._queuedEntries.push(newEntry);\n } else if (rootIsInDom && rootContainsTarget) {\n // If the new entry intersection ratio has crossed any of the\n // thresholds, add a new entry.\n if (this._hasCrossedThreshold(oldEntry, newEntry)) {\n this._queuedEntries.push(newEntry);\n }\n } else {\n // If the root is not in the DOM or target is not contained within\n // root but the previous entry for this target had an intersection,\n // add a new record indicating removal.\n if (oldEntry && oldEntry.isIntersecting) {\n this._queuedEntries.push(newEntry);\n }\n }\n }, this);\n\n if (this._queuedEntries.length) {\n this._callback(this.takeRecords(), this);\n }\n};\n\n\n/**\n * Accepts a target and root rect computes the intersection between then\n * following the algorithm in the spec.\n * TODO(philipwalton): at this time clip-path is not considered.\n * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo\n * @param {Element} target The target DOM element\n * @param {Object} targetRect The bounding rect of the target.\n * @param {Object} rootRect The bounding rect of the root after being\n * expanded by the rootMargin value.\n * @return {?Object} The final intersection rect object or undefined if no\n * intersection is found.\n * @private\n */\nIntersectionObserver.prototype._computeTargetAndRootIntersection =\n function(target, targetRect, rootRect) {\n // If the element isn't displayed, an intersection can't happen.\n if (window.getComputedStyle(target).display == 'none') return;\n\n var intersectionRect = targetRect;\n var parent = getParentNode(target);\n var atRoot = false;\n\n while (!atRoot && parent) {\n var parentRect = null;\n var parentComputedStyle = parent.nodeType == 1 ?\n window.getComputedStyle(parent) : {};\n\n // If the parent isn't displayed, an intersection can't happen.\n if (parentComputedStyle.display == 'none') return null;\n\n if (parent == this.root || parent.nodeType == /* DOCUMENT */ 9) {\n atRoot = true;\n if (parent == this.root || parent == document) {\n if (crossOriginUpdater && !this.root) {\n if (!crossOriginRect ||\n crossOriginRect.width == 0 && crossOriginRect.height == 0) {\n // A 0-size cross-origin intersection means no-intersection.\n parent = null;\n parentRect = null;\n intersectionRect = null;\n } else {\n parentRect = crossOriginRect;\n }\n } else {\n parentRect = rootRect;\n }\n } else {\n // Check if there's a frame that can be navigated to.\n var frame = getParentNode(parent);\n var frameRect = frame && getBoundingClientRect(frame);\n var frameIntersect =\n frame &&\n this._computeTargetAndRootIntersection(frame, frameRect, rootRect);\n if (frameRect && frameIntersect) {\n parent = frame;\n parentRect = convertFromParentRect(frameRect, frameIntersect);\n } else {\n parent = null;\n intersectionRect = null;\n }\n }\n } else {\n // If the element has a non-visible overflow, and it's not the <body>\n // or <html> element, update the intersection rect.\n // Note: <body> and <html> cannot be clipped to a rect that's not also\n // the document rect, so no need to compute a new intersection.\n var doc = parent.ownerDocument;\n if (parent != doc.body &&\n parent != doc.documentElement &&\n parentComputedStyle.overflow != 'visible') {\n parentRect = getBoundingClientRect(parent);\n }\n }\n\n // If either of the above conditionals set a new parentRect,\n // calculate new intersection data.\n if (parentRect) {\n intersectionRect = computeRectIntersection(parentRect, intersectionRect);\n }\n if (!intersectionRect) break;\n parent = parent && getParentNode(parent);\n }\n return intersectionRect;\n};\n\n\n/**\n * Returns the root rect after being expanded by the rootMargin value.\n * @return {ClientRect} The expanded root rect.\n * @private\n */\nIntersectionObserver.prototype._getRootRect = function() {\n var rootRect;\n if (this.root && !isDoc(this.root)) {\n rootRect = getBoundingClientRect(this.root);\n } else {\n // Use <html>/<body> instead of window since scroll bars affect size.\n var doc = isDoc(this.root) ? this.root : document;\n var html = doc.documentElement;\n var body = doc.body;\n rootRect = {\n top: 0,\n left: 0,\n right: html.clientWidth || body.clientWidth,\n width: html.clientWidth || body.clientWidth,\n bottom: html.clientHeight || body.clientHeight,\n height: html.clientHeight || body.clientHeight\n };\n }\n return this._expandRectByRootMargin(rootRect);\n};\n\n\n/**\n * Accepts a rect and expands it by the rootMargin value.\n * @param {DOMRect|ClientRect} rect The rect object to expand.\n * @return {ClientRect} The expanded rect.\n * @private\n */\nIntersectionObserver.prototype._expandRectByRootMargin = function(rect) {\n var margins = this._rootMarginValues.map(function(margin, i) {\n return margin.unit == 'px' ? margin.value :\n margin.value * (i % 2 ? rect.width : rect.height) / 100;\n });\n var newRect = {\n top: rect.top - margins[0],\n right: rect.right + margins[1],\n bottom: rect.bottom + margins[2],\n left: rect.left - margins[3]\n };\n newRect.width = newRect.right - newRect.left;\n newRect.height = newRect.bottom - newRect.top;\n\n return newRect;\n};\n\n\n/**\n * Accepts an old and new entry and returns true if at least one of the\n * threshold values has been crossed.\n * @param {?IntersectionObserverEntry} oldEntry The previous entry for a\n * particular target element or null if no previous entry exists.\n * @param {IntersectionObserverEntry} newEntry The current entry for a\n * particular target element.\n * @return {boolean} Returns true if a any threshold has been crossed.\n * @private\n */\nIntersectionObserver.prototype._hasCrossedThreshold =\n function(oldEntry, newEntry) {\n\n // To make comparing easier, an entry that has a ratio of 0\n // but does not actually intersect is given a value of -1\n var oldRatio = oldEntry && oldEntry.isIntersecting ?\n oldEntry.intersectionRatio || 0 : -1;\n var newRatio = newEntry.isIntersecting ?\n newEntry.intersectionRatio || 0 : -1;\n\n // Ignore unchanged ratios\n if (oldRatio === newRatio) return;\n\n for (var i = 0; i < this.thresholds.length; i++) {\n var threshold = this.thresholds[i];\n\n // Return true if an entry matches a threshold or if the new ratio\n // and the old ratio are on the opposite sides of a threshold.\n if (threshold == oldRatio || threshold == newRatio ||\n threshold < oldRatio !== threshold < newRatio) {\n return true;\n }\n }\n};\n\n\n/**\n * Returns whether or not the root element is an element and is in the DOM.\n * @return {boolean} True if the root element is an element and is in the DOM.\n * @private\n */\nIntersectionObserver.prototype._rootIsInDom = function() {\n return !this.root || containsDeep(document, this.root);\n};\n\n\n/**\n * Returns whether or not the target element is a child of root.\n * @param {Element} target The target element to check.\n * @return {boolean} True if the target element is a child of root.\n * @private\n */\nIntersectionObserver.prototype._rootContainsTarget = function(target) {\n var rootDoc =\n (this.root && (this.root.ownerDocument || this.root)) || document;\n return (\n containsDeep(rootDoc, target) &&\n (!this.root || rootDoc == target.ownerDocument)\n );\n};\n\n\n/**\n * Adds the instance to the global IntersectionObserver registry if it isn't\n * already present.\n * @private\n */\nIntersectionObserver.prototype._registerInstance = function() {\n if (registry.indexOf(this) < 0) {\n registry.push(this);\n }\n};\n\n\n/**\n * Removes the instance from the global IntersectionObserver registry.\n * @private\n */\nIntersectionObserver.prototype._unregisterInstance = function() {\n var index = registry.indexOf(this);\n if (index != -1) registry.splice(index, 1);\n};\n\n\n/**\n * Returns the result of the performance.now() method or null in browsers\n * that don't support the API.\n * @return {number} The elapsed time since the page was requested.\n */\nfunction now() {\n return window.performance && performance.now && performance.now();\n}\n\n\n/**\n * Throttles a function and delays its execution, so it's only called at most\n * once within a given time period.\n * @param {Function} fn The function to throttle.\n * @param {number} timeout The amount of time that must pass before the\n * function can be called again.\n * @return {Function} The throttled function.\n */\nfunction throttle(fn, timeout) {\n var timer = null;\n return function () {\n if (!timer) {\n timer = setTimeout(function() {\n fn();\n timer = null;\n }, timeout);\n }\n };\n}\n\n\n/**\n * Adds an event handler to a DOM node ensuring cross-browser compatibility.\n * @param {Node} node The DOM node to add the event handler to.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to add.\n * @param {boolean} opt_useCapture Optionally adds the even to the capture\n * phase. Note: this only works in modern browsers.\n */\nfunction addEvent(node, event, fn, opt_useCapture) {\n if (typeof node.addEventListener == 'function') {\n node.addEventListener(event, fn, opt_useCapture || false);\n }\n else if (typeof node.attachEvent == 'function') {\n node.attachEvent('on' + event, fn);\n }\n}\n\n\n/**\n * Removes a previously added event handler from a DOM node.\n * @param {Node} node The DOM node to remove the event handler from.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to remove.\n * @param {boolean} opt_useCapture If the event handler was added with this\n * flag set to true, it should be set to true here in order to remove it.\n */\nfunction removeEvent(node, event, fn, opt_useCapture) {\n if (typeof node.removeEventListener == 'function') {\n node.removeEventListener(event, fn, opt_useCapture || false);\n }\n else if (typeof node.detachEvent == 'function') {\n node.detachEvent('on' + event, fn);\n }\n}\n\n\n/**\n * Returns the intersection between two rect objects.\n * @param {Object} rect1 The first rect.\n * @param {Object} rect2 The second rect.\n * @return {?Object|?ClientRect} The intersection rect or undefined if no\n * intersection is found.\n */\nfunction computeRectIntersection(rect1, rect2) {\n var top = Math.max(rect1.top, rect2.top);\n var bottom = Math.min(rect1.bottom, rect2.bottom);\n var left = Math.max(rect1.left, rect2.left);\n var right = Math.min(rect1.right, rect2.right);\n var width = right - left;\n var height = bottom - top;\n\n return (width >= 0 && height >= 0) && {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n width: width,\n height: height\n } || null;\n}\n\n\n/**\n * Shims the native getBoundingClientRect for compatibility with older IE.\n * @param {Element} el The element whose bounding rect to get.\n * @return {DOMRect|ClientRect} The (possibly shimmed) rect of the element.\n */\nfunction getBoundingClientRect(el) {\n var rect;\n\n try {\n rect = el.getBoundingClientRect();\n } catch (err) {\n // Ignore Windows 7 IE11 \"Unspecified error\"\n // https://github.com/w3c/IntersectionObserver/pull/205\n }\n\n if (!rect) return getEmptyRect();\n\n // Older IE\n if (!(rect.width && rect.height)) {\n rect = {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n }\n return rect;\n}\n\n\n/**\n * Returns an empty rect object. An empty rect is returned when an element\n * is not in the DOM.\n * @return {ClientRect} The empty rect.\n */\nfunction getEmptyRect() {\n return {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: 0,\n height: 0\n };\n}\n\n\n/**\n * Ensure that the result has all of the necessary fields of the DOMRect.\n * Specifically this ensures that `x` and `y` fields are set.\n *\n * @param {?DOMRect|?ClientRect} rect\n * @return {?DOMRect}\n */\nfunction ensureDOMRect(rect) {\n // A `DOMRect` object has `x` and `y` fields.\n if (!rect || 'x' in rect) {\n return rect;\n }\n // A IE's `ClientRect` type does not have `x` and `y`. The same is the case\n // for internally calculated Rect objects. For the purposes of\n // `IntersectionObserver`, it's sufficient to simply mirror `left` and `top`\n // for these fields.\n return {\n top: rect.top,\n y: rect.top,\n bottom: rect.bottom,\n left: rect.left,\n x: rect.left,\n right: rect.right,\n width: rect.width,\n height: rect.height\n };\n}\n\n\n/**\n * Inverts the intersection and bounding rect from the parent (frame) BCR to\n * the local BCR space.\n * @param {DOMRect|ClientRect} parentBoundingRect The parent's bound client rect.\n * @param {DOMRect|ClientRect} parentIntersectionRect The parent's own intersection rect.\n * @return {ClientRect} The local root bounding rect for the parent's children.\n */\nfunction convertFromParentRect(parentBoundingRect, parentIntersectionRect) {\n var top = parentIntersectionRect.top - parentBoundingRect.top;\n var left = parentIntersectionRect.left - parentBoundingRect.left;\n return {\n top: top,\n left: left,\n height: parentIntersectionRect.height,\n width: parentIntersectionRect.width,\n bottom: top + parentIntersectionRect.height,\n right: left + parentIntersectionRect.width\n };\n}\n\n\n/**\n * Checks to see if a parent element contains a child element (including inside\n * shadow DOM).\n * @param {Node} parent The parent element.\n * @param {Node} child The child element.\n * @return {boolean} True if the parent node contains the child node.\n */\nfunction containsDeep(parent, child) {\n var node = child;\n while (node) {\n if (node == parent) return true;\n\n node = getParentNode(node);\n }\n return false;\n}\n\n\n/**\n * Gets the parent node of an element or its host element if the parent node\n * is a shadow root.\n * @param {Node} node The node whose parent to get.\n * @return {Node|null} The parent node or null if no parent exists.\n */\nfunction getParentNode(node) {\n var parent = node.parentNode;\n\n if (node.nodeType == /* DOCUMENT */ 9 && node != document) {\n // If this node is a document node, look for the embedding frame.\n return getFrameElement(node);\n }\n\n // If the parent has element that is assigned through shadow root slot\n if (parent && parent.assignedSlot) {\n parent = parent.assignedSlot.parentNode\n }\n\n if (parent && parent.nodeType == 11 && parent.host) {\n // If the parent is a shadow root, return the host element.\n return parent.host;\n }\n\n return parent;\n}\n\n/**\n * Returns true if `node` is a Document.\n * @param {!Node} node\n * @returns {boolean}\n */\nfunction isDoc(node) {\n return node && node.nodeType === 9;\n}\n\n\n// Exposes the constructors globally.\nwindow.IntersectionObserver = IntersectionObserver;\nwindow.IntersectionObserverEntry = IntersectionObserverEntry;\n\n}());\n"],"names":["getFrameElement","doc","document","startDoc","frame","registry","crossOriginUpdater","crossOriginRect","IntersectionObserverEntry","entry","ensureDOMRect","getEmptyRect","targetRect","targetArea","intersectionRect","intersectionArea","IntersectionObserver","callback","opt_options","options","throttle","margin","boundingClientRect","convertFromParentRect","observer","target","isTargetAlreadyObserved","item","records","opt_threshold","threshold","t","i","a","opt_rootMargin","marginString","margins","parts","win","monitoringInterval","domObserver","addEvent","removeEvent","rootDoc","index","hasDependentTargets","itemDoc","unsubscribe","unsubscribes","rootIsInDom","rootRect","getBoundingClientRect","rootContainsTarget","oldEntry","rootBounds","newEntry","now","parent","getParentNode","atRoot","parentRect","parentComputedStyle","frameRect","frameIntersect","computeRectIntersection","isDoc","html","body","rect","newRect","oldRatio","newRatio","containsDeep","fn","timeout","timer","node","event","opt_useCapture","rect1","rect2","top","bottom","left","right","width","height","el","err","parentBoundingRect","parentIntersectionRect","child"],"mappings":"CAQC,UAAW,CAIZ,GAAI,OAAO,QAAW,SACpB,OAKF,GAAI,yBAA0B,QAC1B,8BAA+B,QAC/B,sBAAuB,OAAO,0BAA0B,UAAW,CAI/D,mBAAoB,OAAO,0BAA0B,WACzD,OAAO,eAAe,OAAO,0BAA0B,UACrD,iBAAkB,CAClB,IAAK,UAAY,CACf,OAAO,KAAK,kBAAoB,CAClC,CACN,CAAK,EAEH,MACF,CAOA,SAASA,EAAgBC,EAAK,CAC5B,GAAI,CACF,OA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,EAAwB,CACzE,IAAIT,EAAMS,EAAuB,IAAMD,EAAmB,IACtDN,EAAOO,EAAuB,KAAOD,EAAmB,KAC5D,MAAO,CACL,IAAKR,EACL,KAAME,EACN,OAAQO,EAAuB,OAC/B,MAAOA,EAAuB,MAC9B,OAAQT,EAAMS,EAAuB,OACrC,MAAOP,EAAOO,EAAuB,KACzC,CACA,CAUA,SAASlB,EAAaf,EAAQkC,EAAO,CAEnC,QADIf,EAAOe,EACJf,GAAM,CACX,GAAIA,GAAQnB,EAAQ,MAAO,GAE3BmB,EAAOlB,EAAckB,CAAI,CAC3B,CACA,MAAO,EACT,CASA,SAASlB,EAAckB,EAAM,CAC3B,IAAInB,EAASmB,EAAK,WAElB,OAAIA,EAAK,UAA2B,GAAKA,GAAQ1E,EAExCF,EAAgB4E,CAAI,GAIzBnB,GAAUA,EAAO,eACnBA,EAASA,EAAO,aAAa,YAG3BA,GAAUA,EAAO,UAAY,IAAMA,EAAO,KAErCA,EAAO,KAGTA,EACT,CAOA,SAASQ,EAAMW,EAAM,CACnB,OAAOA,GAAQA,EAAK,WAAa,CACnC,CAIA,OAAO,qBAAuB5D,EAC9B,OAAO,0BAA4BR,CAEnC,GAAC","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c=[],ne=function(){return c.some(function(e){return e.activeTargets.length>0})},oe=function(){return c.some(function(e){return e.skippedTargets.length>0})},P="ResizeObserver loop completed with undelivered notifications.",se=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:P}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=P),window.dispatchEvent(e)},b;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(b||(b={}));var u=function(e){return Object.freeze(e)},ae=function(){function e(t,r){this.inlineSize=t,this.blockSize=r,u(this)}return e}(),q=function(){function e(t,r,i,n){return this.x=t,this.y=r,this.width=i,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,u(this)}return e.prototype.toJSON=function(){var t=this,r=t.x,i=t.y,n=t.top,s=t.right,o=t.bottom,h=t.left,d=t.width,v=t.height;return{x:r,y:i,top:n,right:s,bottom:o,left:h,width:d,height:v}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),C=function(e){return e instanceof SVGElement&&"getBBox"in e},G=function(e){if(C(e)){var t=e.getBBox(),r=t.width,i=t.height;return!r&&!i}var n=e,s=n.offsetWidth,o=n.offsetHeight;return!(s||o||e.getClientRects().length)},I=function(e){var t;if(e instanceof Element)return!0;var r=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},ve=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},p=typeof window!="undefined"?window:{},z=new WeakMap,_=/auto|scroll/,ce=/^tb|vertical/,ue=/msie|trident/i.test(p.navigator&&p.navigator.userAgent),a=function(e){return parseFloat(e||"0")},f=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=!1),new ae((r?t:e)||0,(r?e:t)||0)},W=u({devicePixelContentBoxSize:f(),borderBoxSize:f(),contentBoxSize:f(),contentRect:new q(0,0,0,0)}),J=function(e,t){if(t===void 0&&(t=!1),z.has(e)&&!t)return z.get(e);if(G(e))return z.set(e,W),W;var r=getComputedStyle(e),i=C(e)&&e.ownerSVGElement&&e.getBBox(),n=!ue&&r.boxSizing==="border-box",s=ce.test(r.writingMode||""),o=!i&&_.test(r.overflowY||""),h=!i&&_.test(r.overflowX||""),d=i?0:a(r.paddingTop),v=i?0:a(r.paddingRight),R=i?0:a(r.paddingBottom),l=i?0:a(r.paddingLeft),Q=i?0:a(r.borderTopWidth),Z=i?0:a(r.borderRightWidth),$=i?0:a(r.borderBottomWidth),j=i?0:a(r.borderLeftWidth),D=l+v,k=d+R,y=j+Z,T=Q+$,N=h?e.offsetHeight-T-e.clientHeight:0,A=o?e.offsetWidth-y-e.clientWidth:0,ee=n?D+y:0,te=n?k+T:0,g=i?i.width:a(r.width)-ee-A,x=i?i.height:a(r.height)-te-N,re=g+D+A+y,ie=x+k+N+T,M=u({devicePixelContentBoxSize:f(Math.round(g*devicePixelRatio),Math.round(x*devicePixelRatio),s),borderBoxSize:f(re,ie,s),contentBoxSize:f(g,x,s),contentRect:new q(l,d,g,x)});return z.set(e,M),M},U=function(e,t,r){var i=J(e,r),n=i.borderBoxSize,s=i.contentBoxSize,o=i.devicePixelContentBoxSize;switch(t){case b.DEVICE_PIXEL_CONTENT_BOX:return o;case b.BORDER_BOX:return n;default:return s}},he=function(){function e(t){var r=J(t);this.target=t,this.contentRect=r.contentRect,this.borderBoxSize=u([r.borderBoxSize]),this.contentBoxSize=u([r.contentBoxSize]),this.devicePixelContentBoxSize=u([r.devicePixelContentBoxSize])}return e}(),Y=function(e){if(G(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},de=function(){var e=1/0,t=[];c.forEach(function(o){if(o.activeTargets.length!==0){var h=[];o.activeTargets.forEach(function(v){var R=new he(v.target),l=Y(v.target);h.push(R),v.lastReportedSize=U(v.target,v.observedBox),l<e&&(e=l)}),t.push(function(){o.callback.call(o.observer,h,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var r=0,i=t;r<i.length;r++){var n=i[r];n()}return e},L=function(e){c.forEach(function(r){r.activeTargets.splice(0,r.activeTargets.length),r.skippedTargets.splice(0,r.skippedTargets.length),r.observationTargets.forEach(function(n){n.isActive()&&(Y(n.target)>e?r.activeTargets.push(n):r.skippedTargets.push(n))})})},fe=function(){var e=0;for(L(e);ne();)e=de(),L(e);return oe()&&se(),e>0},m,K=[],le=function(){return K.splice(0).forEach(function(e){return e()})},pe=function(e){if(!m){var t=0,r=document.createTextNode(""),i={characterData:!0};new MutationObserver(function(){return le()}).observe(r,i),m=function(){r.textContent="".concat(t?t--:t++)}}K.push(e),m()},be=function(e){pe(function(){requestAnimationFrame(e)})},w=0,ge=function(){return!!w},xe=250,ze={attributes:!0,characterData:!0,childList:!0,subtree:!0},F=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],H=function(e){return e===void 0&&(e=0),Date.now()+e},B=!1,Ee=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var r=this;if(t===void 0&&(t=xe),!B){B=!0;var i=H(t);be(function(){var n=!1;try{n=fe()}finally{if(B=!1,t=i-H(),!ge())return;n?r.run(1e3):t>0?r.run(t):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,r=function(){return t.observer&&t.observer.observe(document.body,ze)};document.body?r():p.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),F.forEach(function(r){return p.addEventListener(r,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),F.forEach(function(r){return p.removeEventListener(r,t.listener,!0)}),this.stopped=!0)},e}(),S=new Ee,V=function(e){!w&&e>0&&S.start(),w+=e,!w&&S.stop()},Oe=function(e){return!C(e)&&!ve(e)&&getComputedStyle(e).display==="inline"},we=function(){function e(t,r){this.target=t,this.observedBox=r||b.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=U(this.target,this.observedBox,!0);return Oe(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Re=function(){function e(t,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=r}return e}(),E=new WeakMap,X=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},O=function(){function e(){}return e.connect=function(t,r){var i=new Re(t,r);E.set(t,i)},e.observe=function(t,r,i){var n=E.get(t),s=n.observationTargets.length===0;X(n.observationTargets,r)<0&&(s&&c.push(n),n.observationTargets.push(new we(r,i&&i.box)),V(1),S.schedule())},e.unobserve=function(t,r){var i=E.get(t),n=X(i.observationTargets,r),s=i.observationTargets.length===1;n>=0&&(s&&c.splice(c.indexOf(i),1),i.observationTargets.splice(n,1),V(-1))},e.disconnect=function(t){var r=this,i=E.get(t);i.observationTargets.slice().forEach(function(n){return r.unobserve(t,n.target)}),i.activeTargets.splice(0,i.activeTargets.length)},e}(),ye=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");O.connect(this,t)}return e.prototype.observe=function(t,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!I(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");O.observe(this,t,r)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!I(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");O.unobserve(this,t)},e.prototype.disconnect=function(){O.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();export{ye as ResizeObserver,he as ResizeObserverEntry,ae as ResizeObserverSize};
|
|
2
|
+
//# sourceMappingURL=resize-observer-DqyxKk7V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-observer-DqyxKk7V.js","sources":["../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/resizeObservers.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/hasActiveObservations.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/hasSkippedObservations.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/deliverResizeLoopError.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObserverBoxOptions.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/freeze.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObserverSize.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/DOMRectReadOnly.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/element.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/global.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/calculateBoxSize.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObserverEntry.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/calculateDepthForNode.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/broadcastActiveObservations.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/algorithms/gatherActiveObservationsAtDepth.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/process.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/queueMicroTask.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/queueResizeObserver.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/utils/scheduler.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObservation.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObserverDetail.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObserverController.js","../../../../node_modules/.pnpm/@juggle+resize-observer@3.4.0/node_modules/@juggle/resize-observer/lib/ResizeObserver.js"],"sourcesContent":["var resizeObservers = [];\nexport { resizeObservers };\n","import { resizeObservers } from '../utils/resizeObservers';\nvar hasActiveObservations = function () {\n return resizeObservers.some(function (ro) { return ro.activeTargets.length > 0; });\n};\nexport { hasActiveObservations };\n","import { resizeObservers } from '../utils/resizeObservers';\nvar hasSkippedObservations = function () {\n return resizeObservers.some(function (ro) { return ro.skippedTargets.length > 0; });\n};\nexport { hasSkippedObservations };\n","var msg = 'ResizeObserver loop completed with undelivered notifications.';\nvar deliverResizeLoopError = function () {\n var event;\n if (typeof ErrorEvent === 'function') {\n event = new ErrorEvent('error', {\n message: msg\n });\n }\n else {\n event = document.createEvent('Event');\n event.initEvent('error', false, false);\n event.message = msg;\n }\n window.dispatchEvent(event);\n};\nexport { deliverResizeLoopError };\n","var ResizeObserverBoxOptions;\n(function (ResizeObserverBoxOptions) {\n ResizeObserverBoxOptions[\"BORDER_BOX\"] = \"border-box\";\n ResizeObserverBoxOptions[\"CONTENT_BOX\"] = \"content-box\";\n ResizeObserverBoxOptions[\"DEVICE_PIXEL_CONTENT_BOX\"] = \"device-pixel-content-box\";\n})(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));\nexport { ResizeObserverBoxOptions };\n","export var freeze = function (obj) { return Object.freeze(obj); };\n","import { freeze } from './utils/freeze';\nvar ResizeObserverSize = (function () {\n function ResizeObserverSize(inlineSize, blockSize) {\n this.inlineSize = inlineSize;\n this.blockSize = blockSize;\n freeze(this);\n }\n return ResizeObserverSize;\n}());\nexport { ResizeObserverSize };\n","import { freeze } from './utils/freeze';\nvar DOMRectReadOnly = (function () {\n function DOMRectReadOnly(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.top = this.y;\n this.left = this.x;\n this.bottom = this.top + this.height;\n this.right = this.left + this.width;\n return freeze(this);\n }\n DOMRectReadOnly.prototype.toJSON = function () {\n var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;\n return { x: x, y: y, top: top, right: right, bottom: bottom, left: left, width: width, height: height };\n };\n DOMRectReadOnly.fromRect = function (rectangle) {\n return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);\n };\n return DOMRectReadOnly;\n}());\nexport { DOMRectReadOnly };\n","var isSVG = function (target) { return target instanceof SVGElement && 'getBBox' in target; };\nvar isHidden = function (target) {\n if (isSVG(target)) {\n var _a = target.getBBox(), width = _a.width, height = _a.height;\n return !width && !height;\n }\n var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;\n return !(offsetWidth || offsetHeight || target.getClientRects().length);\n};\nvar isElement = function (obj) {\n var _a;\n if (obj instanceof Element) {\n return true;\n }\n var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;\n return !!(scope && obj instanceof scope.Element);\n};\nvar isReplacedElement = function (target) {\n switch (target.tagName) {\n case 'INPUT':\n if (target.type !== 'image') {\n break;\n }\n case 'VIDEO':\n case 'AUDIO':\n case 'EMBED':\n case 'OBJECT':\n case 'CANVAS':\n case 'IFRAME':\n case 'IMG':\n return true;\n }\n return false;\n};\nexport { isSVG, isHidden, isElement, isReplacedElement };\n","export var global = typeof window !== 'undefined' ? window : {};\n","import { ResizeObserverBoxOptions } from '../ResizeObserverBoxOptions';\nimport { ResizeObserverSize } from '../ResizeObserverSize';\nimport { DOMRectReadOnly } from '../DOMRectReadOnly';\nimport { isSVG, isHidden } from '../utils/element';\nimport { freeze } from '../utils/freeze';\nimport { global } from '../utils/global';\nvar cache = new WeakMap();\nvar scrollRegexp = /auto|scroll/;\nvar verticalRegexp = /^tb|vertical/;\nvar IE = (/msie|trident/i).test(global.navigator && global.navigator.userAgent);\nvar parseDimension = function (pixel) { return parseFloat(pixel || '0'); };\nvar size = function (inlineSize, blockSize, switchSizes) {\n if (inlineSize === void 0) { inlineSize = 0; }\n if (blockSize === void 0) { blockSize = 0; }\n if (switchSizes === void 0) { switchSizes = false; }\n return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);\n};\nvar zeroBoxes = freeze({\n devicePixelContentBoxSize: size(),\n borderBoxSize: size(),\n contentBoxSize: size(),\n contentRect: new DOMRectReadOnly(0, 0, 0, 0)\n});\nvar calculateBoxSizes = function (target, forceRecalculation) {\n if (forceRecalculation === void 0) { forceRecalculation = false; }\n if (cache.has(target) && !forceRecalculation) {\n return cache.get(target);\n }\n if (isHidden(target)) {\n cache.set(target, zeroBoxes);\n return zeroBoxes;\n }\n var cs = getComputedStyle(target);\n var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();\n var removePadding = !IE && cs.boxSizing === 'border-box';\n var switchSizes = verticalRegexp.test(cs.writingMode || '');\n var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || '');\n var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || '');\n var paddingTop = svg ? 0 : parseDimension(cs.paddingTop);\n var paddingRight = svg ? 0 : parseDimension(cs.paddingRight);\n var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom);\n var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft);\n var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth);\n var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth);\n var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth);\n var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth);\n var horizontalPadding = paddingLeft + paddingRight;\n var verticalPadding = paddingTop + paddingBottom;\n var horizontalBorderArea = borderLeft + borderRight;\n var verticalBorderArea = borderTop + borderBottom;\n var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;\n var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;\n var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;\n var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;\n var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;\n var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;\n var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;\n var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;\n var boxes = freeze({\n devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),\n borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes),\n contentBoxSize: size(contentWidth, contentHeight, switchSizes),\n contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)\n });\n cache.set(target, boxes);\n return boxes;\n};\nvar calculateBoxSize = function (target, observedBox, forceRecalculation) {\n var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize;\n switch (observedBox) {\n case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:\n return devicePixelContentBoxSize;\n case ResizeObserverBoxOptions.BORDER_BOX:\n return borderBoxSize;\n default:\n return contentBoxSize;\n }\n};\nexport { calculateBoxSize, calculateBoxSizes };\n","import { calculateBoxSizes } from './algorithms/calculateBoxSize';\nimport { freeze } from './utils/freeze';\nvar ResizeObserverEntry = (function () {\n function ResizeObserverEntry(target) {\n var boxes = calculateBoxSizes(target);\n this.target = target;\n this.contentRect = boxes.contentRect;\n this.borderBoxSize = freeze([boxes.borderBoxSize]);\n this.contentBoxSize = freeze([boxes.contentBoxSize]);\n this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);\n }\n return ResizeObserverEntry;\n}());\nexport { ResizeObserverEntry };\n","import { isHidden } from '../utils/element';\nvar calculateDepthForNode = function (node) {\n if (isHidden(node)) {\n return Infinity;\n }\n var depth = 0;\n var parent = node.parentNode;\n while (parent) {\n depth += 1;\n parent = parent.parentNode;\n }\n return depth;\n};\nexport { calculateDepthForNode };\n","import { resizeObservers } from '../utils/resizeObservers';\nimport { ResizeObserverEntry } from '../ResizeObserverEntry';\nimport { calculateDepthForNode } from './calculateDepthForNode';\nimport { calculateBoxSize } from './calculateBoxSize';\nvar broadcastActiveObservations = function () {\n var shallowestDepth = Infinity;\n var callbacks = [];\n resizeObservers.forEach(function processObserver(ro) {\n if (ro.activeTargets.length === 0) {\n return;\n }\n var entries = [];\n ro.activeTargets.forEach(function processTarget(ot) {\n var entry = new ResizeObserverEntry(ot.target);\n var targetDepth = calculateDepthForNode(ot.target);\n entries.push(entry);\n ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);\n if (targetDepth < shallowestDepth) {\n shallowestDepth = targetDepth;\n }\n });\n callbacks.push(function resizeObserverCallback() {\n ro.callback.call(ro.observer, entries, ro.observer);\n });\n ro.activeTargets.splice(0, ro.activeTargets.length);\n });\n for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {\n var callback = callbacks_1[_i];\n callback();\n }\n return shallowestDepth;\n};\nexport { broadcastActiveObservations };\n","import { resizeObservers } from '../utils/resizeObservers';\nimport { calculateDepthForNode } from './calculateDepthForNode';\nvar gatherActiveObservationsAtDepth = function (depth) {\n resizeObservers.forEach(function processObserver(ro) {\n ro.activeTargets.splice(0, ro.activeTargets.length);\n ro.skippedTargets.splice(0, ro.skippedTargets.length);\n ro.observationTargets.forEach(function processTarget(ot) {\n if (ot.isActive()) {\n if (calculateDepthForNode(ot.target) > depth) {\n ro.activeTargets.push(ot);\n }\n else {\n ro.skippedTargets.push(ot);\n }\n }\n });\n });\n};\nexport { gatherActiveObservationsAtDepth };\n","import { hasActiveObservations } from '../algorithms/hasActiveObservations';\nimport { hasSkippedObservations } from '../algorithms/hasSkippedObservations';\nimport { deliverResizeLoopError } from '../algorithms/deliverResizeLoopError';\nimport { broadcastActiveObservations } from '../algorithms/broadcastActiveObservations';\nimport { gatherActiveObservationsAtDepth } from '../algorithms/gatherActiveObservationsAtDepth';\nvar process = function () {\n var depth = 0;\n gatherActiveObservationsAtDepth(depth);\n while (hasActiveObservations()) {\n depth = broadcastActiveObservations();\n gatherActiveObservationsAtDepth(depth);\n }\n if (hasSkippedObservations()) {\n deliverResizeLoopError();\n }\n return depth > 0;\n};\nexport { process };\n","var trigger;\nvar callbacks = [];\nvar notify = function () { return callbacks.splice(0).forEach(function (cb) { return cb(); }); };\nvar queueMicroTask = function (callback) {\n if (!trigger) {\n var toggle_1 = 0;\n var el_1 = document.createTextNode('');\n var config = { characterData: true };\n new MutationObserver(function () { return notify(); }).observe(el_1, config);\n trigger = function () { el_1.textContent = \"\".concat(toggle_1 ? toggle_1-- : toggle_1++); };\n }\n callbacks.push(callback);\n trigger();\n};\nexport { queueMicroTask };\n","import { queueMicroTask } from './queueMicroTask';\nvar queueResizeObserver = function (cb) {\n queueMicroTask(function ResizeObserver() {\n requestAnimationFrame(cb);\n });\n};\nexport { queueResizeObserver };\n","import { process } from './process';\nimport { global } from './global';\nimport { queueResizeObserver } from './queueResizeObserver';\nvar watching = 0;\nvar isWatching = function () { return !!watching; };\nvar CATCH_PERIOD = 250;\nvar observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };\nvar events = [\n 'resize',\n 'load',\n 'transitionend',\n 'animationend',\n 'animationstart',\n 'animationiteration',\n 'keyup',\n 'keydown',\n 'mouseup',\n 'mousedown',\n 'mouseover',\n 'mouseout',\n 'blur',\n 'focus'\n];\nvar time = function (timeout) {\n if (timeout === void 0) { timeout = 0; }\n return Date.now() + timeout;\n};\nvar scheduled = false;\nvar Scheduler = (function () {\n function Scheduler() {\n var _this = this;\n this.stopped = true;\n this.listener = function () { return _this.schedule(); };\n }\n Scheduler.prototype.run = function (timeout) {\n var _this = this;\n if (timeout === void 0) { timeout = CATCH_PERIOD; }\n if (scheduled) {\n return;\n }\n scheduled = true;\n var until = time(timeout);\n queueResizeObserver(function () {\n var elementsHaveResized = false;\n try {\n elementsHaveResized = process();\n }\n finally {\n scheduled = false;\n timeout = until - time();\n if (!isWatching()) {\n return;\n }\n if (elementsHaveResized) {\n _this.run(1000);\n }\n else if (timeout > 0) {\n _this.run(timeout);\n }\n else {\n _this.start();\n }\n }\n });\n };\n Scheduler.prototype.schedule = function () {\n this.stop();\n this.run();\n };\n Scheduler.prototype.observe = function () {\n var _this = this;\n var cb = function () { return _this.observer && _this.observer.observe(document.body, observerConfig); };\n document.body ? cb() : global.addEventListener('DOMContentLoaded', cb);\n };\n Scheduler.prototype.start = function () {\n var _this = this;\n if (this.stopped) {\n this.stopped = false;\n this.observer = new MutationObserver(this.listener);\n this.observe();\n events.forEach(function (name) { return global.addEventListener(name, _this.listener, true); });\n }\n };\n Scheduler.prototype.stop = function () {\n var _this = this;\n if (!this.stopped) {\n this.observer && this.observer.disconnect();\n events.forEach(function (name) { return global.removeEventListener(name, _this.listener, true); });\n this.stopped = true;\n }\n };\n return Scheduler;\n}());\nvar scheduler = new Scheduler();\nvar updateCount = function (n) {\n !watching && n > 0 && scheduler.start();\n watching += n;\n !watching && scheduler.stop();\n};\nexport { scheduler, updateCount };\n","import { ResizeObserverBoxOptions } from './ResizeObserverBoxOptions';\nimport { calculateBoxSize } from './algorithms/calculateBoxSize';\nimport { isSVG, isReplacedElement } from './utils/element';\nvar skipNotifyOnElement = function (target) {\n return !isSVG(target)\n && !isReplacedElement(target)\n && getComputedStyle(target).display === 'inline';\n};\nvar ResizeObservation = (function () {\n function ResizeObservation(target, observedBox) {\n this.target = target;\n this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;\n this.lastReportedSize = {\n inlineSize: 0,\n blockSize: 0\n };\n }\n ResizeObservation.prototype.isActive = function () {\n var size = calculateBoxSize(this.target, this.observedBox, true);\n if (skipNotifyOnElement(this.target)) {\n this.lastReportedSize = size;\n }\n if (this.lastReportedSize.inlineSize !== size.inlineSize\n || this.lastReportedSize.blockSize !== size.blockSize) {\n return true;\n }\n return false;\n };\n return ResizeObservation;\n}());\nexport { ResizeObservation };\n","var ResizeObserverDetail = (function () {\n function ResizeObserverDetail(resizeObserver, callback) {\n this.activeTargets = [];\n this.skippedTargets = [];\n this.observationTargets = [];\n this.observer = resizeObserver;\n this.callback = callback;\n }\n return ResizeObserverDetail;\n}());\nexport { ResizeObserverDetail };\n","import { scheduler, updateCount } from './utils/scheduler';\nimport { ResizeObservation } from './ResizeObservation';\nimport { ResizeObserverDetail } from './ResizeObserverDetail';\nimport { resizeObservers } from './utils/resizeObservers';\nvar observerMap = new WeakMap();\nvar getObservationIndex = function (observationTargets, target) {\n for (var i = 0; i < observationTargets.length; i += 1) {\n if (observationTargets[i].target === target) {\n return i;\n }\n }\n return -1;\n};\nvar ResizeObserverController = (function () {\n function ResizeObserverController() {\n }\n ResizeObserverController.connect = function (resizeObserver, callback) {\n var detail = new ResizeObserverDetail(resizeObserver, callback);\n observerMap.set(resizeObserver, detail);\n };\n ResizeObserverController.observe = function (resizeObserver, target, options) {\n var detail = observerMap.get(resizeObserver);\n var firstObservation = detail.observationTargets.length === 0;\n if (getObservationIndex(detail.observationTargets, target) < 0) {\n firstObservation && resizeObservers.push(detail);\n detail.observationTargets.push(new ResizeObservation(target, options && options.box));\n updateCount(1);\n scheduler.schedule();\n }\n };\n ResizeObserverController.unobserve = function (resizeObserver, target) {\n var detail = observerMap.get(resizeObserver);\n var index = getObservationIndex(detail.observationTargets, target);\n var lastObservation = detail.observationTargets.length === 1;\n if (index >= 0) {\n lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);\n detail.observationTargets.splice(index, 1);\n updateCount(-1);\n }\n };\n ResizeObserverController.disconnect = function (resizeObserver) {\n var _this = this;\n var detail = observerMap.get(resizeObserver);\n detail.observationTargets.slice().forEach(function (ot) { return _this.unobserve(resizeObserver, ot.target); });\n detail.activeTargets.splice(0, detail.activeTargets.length);\n };\n return ResizeObserverController;\n}());\nexport { ResizeObserverController };\n","import { ResizeObserverController } from './ResizeObserverController';\nimport { isElement } from './utils/element';\nvar ResizeObserver = (function () {\n function ResizeObserver(callback) {\n if (arguments.length === 0) {\n throw new TypeError(\"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.\");\n }\n if (typeof callback !== 'function') {\n throw new TypeError(\"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.\");\n }\n ResizeObserverController.connect(this, callback);\n }\n ResizeObserver.prototype.observe = function (target, options) {\n if (arguments.length === 0) {\n throw new TypeError(\"Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.\");\n }\n if (!isElement(target)) {\n throw new TypeError(\"Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element\");\n }\n ResizeObserverController.observe(this, target, options);\n };\n ResizeObserver.prototype.unobserve = function (target) {\n if (arguments.length === 0) {\n throw new TypeError(\"Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.\");\n }\n if (!isElement(target)) {\n throw new TypeError(\"Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element\");\n }\n ResizeObserverController.unobserve(this, target);\n };\n ResizeObserver.prototype.disconnect = function () {\n ResizeObserverController.disconnect(this);\n };\n ResizeObserver.toString = function () {\n return 'function ResizeObserver () { [polyfill code] }';\n };\n return ResizeObserver;\n}());\nexport { ResizeObserver };\n"],"names":["resizeObservers","hasActiveObservations","ro","hasSkippedObservations","msg","deliverResizeLoopError","event","ResizeObserverBoxOptions","freeze","obj","ResizeObserverSize","inlineSize","blockSize","DOMRectReadOnly","x","y","width","height","_a","top","right","bottom","left","rectangle","isSVG","target","isHidden","_b","offsetWidth","offsetHeight","isElement","scope","isReplacedElement","global","cache","scrollRegexp","verticalRegexp","IE","parseDimension","pixel","size","switchSizes","zeroBoxes","calculateBoxSizes","forceRecalculation","cs","svg","removePadding","canScrollVertically","canScrollHorizontally","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTop","borderRight","borderBottom","borderLeft","horizontalPadding","verticalPadding","horizontalBorderArea","verticalBorderArea","horizontalScrollbarThickness","verticalScrollbarThickness","widthReduction","heightReduction","contentWidth","contentHeight","borderBoxWidth","borderBoxHeight","boxes","calculateBoxSize","observedBox","borderBoxSize","contentBoxSize","devicePixelContentBoxSize","ResizeObserverEntry","calculateDepthForNode","node","depth","parent","broadcastActiveObservations","shallowestDepth","callbacks","entries","ot","entry","targetDepth","_i","callbacks_1","callback","gatherActiveObservationsAtDepth","process","trigger","notify","cb","queueMicroTask","toggle_1","el_1","config","queueResizeObserver","watching","isWatching","CATCH_PERIOD","observerConfig","events","time","timeout","scheduled","Scheduler","_this","until","elementsHaveResized","name","scheduler","updateCount","n","skipNotifyOnElement","ResizeObservation","ResizeObserverDetail","resizeObserver","observerMap","getObservationIndex","observationTargets","i","ResizeObserverController","detail","options","firstObservation","index","lastObservation","ResizeObserver"],"mappings":"AAAA,IAAIA,EAAkB,CAAA,ECClBC,GAAwB,UAAY,CACpC,OAAOD,EAAgB,KAAK,SAAUE,EAAI,CAAE,OAAOA,EAAG,cAAc,OAAS,CAAG,CAAC,CACrF,ECFIC,GAAyB,UAAY,CACrC,OAAOH,EAAgB,KAAK,SAAUE,EAAI,CAAE,OAAOA,EAAG,eAAe,OAAS,CAAG,CAAC,CACtF,ECHIE,EAAM,gEACNC,GAAyB,UAAY,CACrC,IAAIC,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AOA,GAAa,WACpB,MAAM,IAAI,UAAU,+FAA+F,EAEvHmC,EAAyB,QAAQ,KAAMnC,CAAQ,CACnD,CACA,OAAAyC,EAAe,UAAU,QAAU,SAAU1G,EAAQsG,EAAS,CAC1D,GAAI,UAAU,SAAW,EACrB,MAAM,IAAI,UAAU,2FAA2F,EAEnH,GAAI,CAACjG,EAAUL,CAAM,EACjB,MAAM,IAAI,UAAU,sFAAsF,EAE9GoG,EAAyB,QAAQ,KAAMpG,EAAQsG,CAAO,CAC1D,EACAI,EAAe,UAAU,UAAY,SAAU1G,EAAQ,CACnD,GAAI,UAAU,SAAW,EACrB,MAAM,IAAI,UAAU,6FAA6F,EAErH,GAAI,CAACK,EAAUL,CAAM,EACjB,MAAM,IAAI,UAAU,wFAAwF,EAEhHoG,EAAyB,UAAU,KAAMpG,CAAM,CACnD,EACA0G,EAAe,UAAU,WAAa,UAAY,CAC9CN,EAAyB,WAAW,IAAI,CAC5C,EACAM,EAAe,SAAW,UAAY,CAClC,MAAO,gDACX,EACOA,CACX,EAAC","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Back button / exit handling for vwr-loader.
|
|
3
|
+
*
|
|
4
|
+
* This is a safety net for when VWR fails to load and user presses back.
|
|
5
|
+
* When VWR loads successfully, it handles exit behavior itself.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Exit the app if the page was loaded via back/forward navigation.
|
|
9
|
+
*
|
|
10
|
+
* This is a safety net for Samsung/LG TVs: if VWR failed to load and user
|
|
11
|
+
* pressed back, they'd land on the loader again. This detects that and exits.
|
|
12
|
+
*
|
|
13
|
+
* Note: On LG TV with disableBackHistoryAPI: true, this won't trigger
|
|
14
|
+
* because the platform doesn't automatically navigate back. Use
|
|
15
|
+
* setupLGBackButtonHandler() for LG back button support.
|
|
16
|
+
*/
|
|
17
|
+
export declare function exitIfBackNavigation(platform: Platform): void;
|
|
18
|
+
/**
|
|
19
|
+
* Set up LG back button (keycode 461) handler.
|
|
20
|
+
*
|
|
21
|
+
* On LG TV with disableBackHistoryAPI: true in appinfo.json, the platform
|
|
22
|
+
* doesn't automatically handle the back button. This sets up a keydown
|
|
23
|
+
* listener to call webOS.platformBack() which shows the system exit popup
|
|
24
|
+
* on webOS 6.0+ or launches Home on older versions.
|
|
25
|
+
*
|
|
26
|
+
* Once VWR loads successfully, call the returned cleanup function - VWR/PSDK
|
|
27
|
+
* will take over back button handling with its own custom modal.
|
|
28
|
+
*
|
|
29
|
+
* @returns Cleanup function to remove the listener
|
|
30
|
+
*/
|
|
31
|
+
export declare function setupLGBackButtonHandler(): () => void;
|
|
32
|
+
//# sourceMappingURL=exitHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitHandler.d.ts","sourceRoot":"","sources":["../src/exitHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAkB7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,IAAI,CAyBrD"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Back button / exit handling for vwr-loader.
|
|
3
|
+
*
|
|
4
|
+
* This is a safety net for when VWR fails to load and user presses back.
|
|
5
|
+
* When VWR loads successfully, it handles exit behavior itself.
|
|
6
|
+
*/
|
|
7
|
+
import { logger } from "./logger";
|
|
8
|
+
/** LG webOS back button keycode */
|
|
9
|
+
const LG_BACK_KEYCODE = 461;
|
|
10
|
+
/**
|
|
11
|
+
* Exit the app if the page was loaded via back/forward navigation.
|
|
12
|
+
*
|
|
13
|
+
* This is a safety net for Samsung/LG TVs: if VWR failed to load and user
|
|
14
|
+
* pressed back, they'd land on the loader again. This detects that and exits.
|
|
15
|
+
*
|
|
16
|
+
* Note: On LG TV with disableBackHistoryAPI: true, this won't trigger
|
|
17
|
+
* because the platform doesn't automatically navigate back. Use
|
|
18
|
+
* setupLGBackButtonHandler() for LG back button support.
|
|
19
|
+
*/
|
|
20
|
+
export function exitIfBackNavigation(platform) {
|
|
21
|
+
try {
|
|
22
|
+
const navEntries = performance.getEntriesByType("navigation");
|
|
23
|
+
const navEntry = navEntries[0];
|
|
24
|
+
if ((navEntry === null || navEntry === void 0 ? void 0 : navEntry.type) === "back_forward") {
|
|
25
|
+
logger.info({ platform, navigationType: navEntry.type }, "[Shell] Back navigation detected, exiting app");
|
|
26
|
+
exitApp(platform);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
// Performance API may not be available on all platforms
|
|
31
|
+
logger.warn({ error }, "[Shell] Could not check navigation type");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Set up LG back button (keycode 461) handler.
|
|
36
|
+
*
|
|
37
|
+
* On LG TV with disableBackHistoryAPI: true in appinfo.json, the platform
|
|
38
|
+
* doesn't automatically handle the back button. This sets up a keydown
|
|
39
|
+
* listener to call webOS.platformBack() which shows the system exit popup
|
|
40
|
+
* on webOS 6.0+ or launches Home on older versions.
|
|
41
|
+
*
|
|
42
|
+
* Once VWR loads successfully, call the returned cleanup function - VWR/PSDK
|
|
43
|
+
* will take over back button handling with its own custom modal.
|
|
44
|
+
*
|
|
45
|
+
* @returns Cleanup function to remove the listener
|
|
46
|
+
*/
|
|
47
|
+
export function setupLGBackButtonHandler() {
|
|
48
|
+
const handleKeyDown = (event) => {
|
|
49
|
+
var _a;
|
|
50
|
+
if (event.keyCode === LG_BACK_KEYCODE) {
|
|
51
|
+
logger.info("[Shell] LG back button pressed, triggering platform exit");
|
|
52
|
+
if ((_a = window.webOS) === null || _a === void 0 ? void 0 : _a.platformBack) {
|
|
53
|
+
window.webOS.platformBack();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
logger.warn("[Shell] webOS.platformBack not available, using window.close");
|
|
57
|
+
window.close();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
62
|
+
logger.info("[Shell] LG back button handler registered");
|
|
63
|
+
return () => {
|
|
64
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
65
|
+
logger.info("[Shell] LG back button handler removed");
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Exit the app using platform-specific methods.
|
|
70
|
+
*
|
|
71
|
+
* @param platform - Platform identifier
|
|
72
|
+
*/
|
|
73
|
+
function exitApp(platform) {
|
|
74
|
+
switch (platform) {
|
|
75
|
+
case "SAMSUNG_TV":
|
|
76
|
+
exitSamsungApp();
|
|
77
|
+
break;
|
|
78
|
+
case "LG_TV":
|
|
79
|
+
exitLGAppViaBackNavigation();
|
|
80
|
+
break;
|
|
81
|
+
// Fire TV and mobile apps handle exit at the native layer
|
|
82
|
+
// Web doesn't have a meaningful "exit" concept
|
|
83
|
+
default:
|
|
84
|
+
logger.info({ platform }, "[Shell] No platform-specific exit");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function exitSamsungApp() {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
try {
|
|
90
|
+
if ((_b = (_a = window.tizen) === null || _a === void 0 ? void 0 : _a.application) === null || _b === void 0 ? void 0 : _b.getCurrentApplication) {
|
|
91
|
+
window.tizen.application.getCurrentApplication().exit();
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
logger.warn("[Shell] Tizen exit API not available");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
logger.error({ error }, "[Shell] Failed to exit Samsung app");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Exit LG app when back navigation is detected.
|
|
103
|
+
* Uses window.close() for immediate exit since user already navigated back.
|
|
104
|
+
*/
|
|
105
|
+
function exitLGAppViaBackNavigation() {
|
|
106
|
+
try {
|
|
107
|
+
window.close();
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
logger.error({ error }, "[Shell] Failed to exit LG app");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=exitHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exitHandler.js","sourceRoot":"","sources":["../src/exitHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,mCAAmC;AACnC,MAAM,eAAe,GAAG,GAAG,CAAA;AAE3B;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAkB;IACnD,IAAI,CAAC;QACD,MAAM,UAAU,GAAG,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAA;QAC7D,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAEd,CAAA;QAEf,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,MAAK,cAAc,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CACP,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC,IAAI,EAAE,EAC3C,+CAA+C,CAClD,CAAA;YACD,OAAO,CAAC,QAAQ,CAAC,CAAA;QACrB,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,wDAAwD;QACxD,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,yCAAyC,CAAC,CAAA;IACrE,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB;IACpC,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAQ,EAAE;;QACjD,IAAI,KAAK,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;YACpC,MAAM,CAAC,I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