import{n as O}from"./@vue-8853d279.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3180cd38-8435-47bc-a836-6dddfeaa4ab8",e._sentryDebugIdIdentifier="sentry-dbid-3180cd38-8435-47bc-a836-6dddfeaa4ab8")}catch{}})();function y(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(t){return typeof t}:y=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(e)}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _(e,t,r){return t&&d(e.prototype,t),r&&d(e,r),e}function h(e){return w(e)||I(e)||k(e)||A()}function w(e){if(Array.isArray(e))return v(e)}function I(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function k(e,t){if(!!e){if(typeof e=="string")return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}}function v(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function V(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,i,a,l=function(o){for(var u=arguments.length,f=new Array(u>1?u-1:0),c=1;c<u;c++)f[c-1]=arguments[c];if(a=f,!(n&&o===i)){var b=r.leading;typeof b=="function"&&(b=b(o,i)),(!n||o!==i)&&b&&e.apply(void 0,[o].concat(h(a))),i=o,clearTimeout(n),n=setTimeout(function(){e.apply(void 0,[o].concat(h(a))),n=0},t)}};return l._clear=function(){clearTimeout(n),n=null},l}function p(e,t){if(e===t)return!0;if(y(e)==="object"){for(var r in e)if(!p(e[r],t[r]))return!1;return!0}return!1}var C=function(){function e(t,r,n){S(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(r,n)}return _(e,[{key:"createObserver",value:function(r,n){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=T(r),this.callback=function(s,o){i.options.callback(s,o),s&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var a=this.options.throttleOptions||{},l=a.leading;this.callback=V(this.callback,this.options.throttle,{leading:function(o){return l==="both"||l==="visible"&&o||l==="hidden"&&!o}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(s){var o=s[0];if(s.length>1){var u=s.find(function(c){return c.isIntersecting});u&&(o=u)}if(i.callback){var f=o.isIntersecting&&o.intersectionRatio>=i.threshold;if(f===i.oldResult)return;i.oldResult=f,i.callback(f,o)}},this.options.intersection),O(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function m(e,t,r){var n=t.value;if(!!n)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new C(e,n,r);e._vue_visibilityState=i}}function D(e,t,r){var n=t.value,i=t.oldValue;if(!p(n,i)){var a=e._vue_visibilityState;if(!n){g(e);return}a?a.createObserver(n,r):m(e,{value:n},r)}}function g(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var j={beforeMount:m,updated:D,unmounted:g};export{j as O};
