2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[5],{5324:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;!function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}n.default=t,e&&e.set(t,n)}(n(0));var i=n(66);function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}var o={root:null,rootMargin:"0px",threshold:.5},s=function(){function t(t){var e=this;void 0===t&&(t=o),this._nodes=new WeakMap,this._components=new WeakMap,this._visibleComponents=new WeakSet,this._handleEntries=function(t){t.forEach((function(t){var n;if(null!=t.isIntersecting)n=t.isIntersecting;else{var i=e._options.threshold;n=null==i?t.intersectionRatio>0:Array.isArray(i)?i.some((function(e){return t.intersectionRatio>e})):t.intersectionRatio>i}var r=e._nodes.get(t.target);if(null!=r){var o=!1;n?e._visibleComponents.has(r)||(e._visibleComponents.add(r),o=!0):e._visibleComponents.has(r)&&(e._visibleComponents.delete(r),o=!0),o&&r.forceUpdate()}}))},this._options=t,null!=window.IntersectionObserver&&(this._observer=new window.IntersectionObserver(this._handleEntries,t))}var e=t.prototype;return e.isVisible=function(t){return null==this._observer||this._visibleComponents.has(t)},e.observe=function(t){var e=this._observer;if(null!=e){this.unobserve(t);var n=(0,i.findDOMNode)(t);n instanceof HTMLElement&&(this._nodes.set(n,t),this._components.set(t,n),e.observe(n))}},e.unobserve=function(t){var e=this._observer;if(null!=e){var n=this._components.get(t);null!=n&&(this._nodes.delete(n),this._components.delete(t),this._visibleComponents.delete(t),e.unobserve(n))}},t}();e.default=s},5434:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"VisibilityObserver",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"VisibilitySensor",{enumerable:!0,get:function(){return r.default}}),n(5622);var i=o(n(5324)),r=o(n(5623));function o(t){return t&&t.__esModule?t:{default:t}}},5622:function(t,e){!function(t,e){"use strict";if("IntersectionObserver"in t&&"IntersectionObserverEntry"in t&&"intersectionRatio"in t.IntersectionObserverEntry.prototype)"isIntersecting"in t.IntersectionObserverEntry.prototype||Object.defineProperty(t.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var n=[];r.prototype.THROTTLE_TIMEOUT=100,r.prototype.POLL_INTERVAL=null,r.prototype.USE_MUTATION_OBSERVER=!0,r.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},r.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},r.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},r.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},r.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},r.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},r.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(o(t,"resize",this._checkForIntersections,!0),o(e,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in t&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},r.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(t,"resize",this._checkForIntersections,!0),s(e,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},r.prototype._checkForIntersections=function(){var e=this._rootIsInDom(),n=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,s=h(o),c=this._rootContainsTarget(o),u=r.entry,a=e&&c&&this._computeTargetAndRootIntersection(o,n),l=r.entry=new i({time:t.performance&&performance.now&&performance.now(),target:o,boundingClientRect:s,rootBounds:n,intersectionRect:a});u?e&&c?this._hasCrossedThreshold(u,l)&&this._queuedEntries.push(l):u&&u.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},r.prototype._computeTargetAndRootIntersection=function(n,i){if("none"!=t.getComputedStyle(n).display){for(var r,o,s,c,a,l,p,f,d=h(n),v=u(n),b=!1;!b;){var _=null,g=1==v.nodeType?t.getComputedStyle(v):{};if("none"==g.display)return;if(v==this.root||v==e?(b=!0,_=i):v!=e.body&&v!=e.documentElement&&"visible"!=g.overflow&&(_=h(v)),_&&(r=_,o=d,s=void 0,c=void 0,a=void 0,l=void 0,p=void 0,f=void 0,s=Math.max(r.top,o.top),c=Math.min(r.bottom,o.bottom),a=Math.max(r.left,o.left),l=Math.min(r.right,o.right),f=c-s,!(d=(p=l-a)>=0&&f>=0&&{top:s,bottom:c,left:a,right:l,width:p,height:f})))break;v=u(v)}return d}},r.prototype._getRootRect=function(){var t;if(this.root)t=h(this.root);else{var n=e.documentElement,i=e.body;t={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(t)},r.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},r.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,i=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==i)for(var r=0;r<this.thresholds.length;r++){var o=this.thresholds[r];if(o==n||o==i||o<n!=o<i)return!0}},r.prototype._rootIsInDom=function(){return!this.root||c(e,this.root)},r.prototype._rootContainsTarget=function(t){return c(this.root||e,t)},r.prototype._registerInstance=function(){n.indexOf(this)<0&&n.push(this)},r.prototype._unregisterInstance=function(){var t=n.indexOf(this);-1!=t&&n.splice(t,1)},t.IntersectionObserver=r,t.IntersectionObserverEntry=i}function i(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0},this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,i=this.intersectionRect,r=i.width*i.height;this.intersectionRatio=n?r/n:this.isIntersecting?1:0}function r(t,e){var n,i,r,o=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(o.root&&1!=o.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),i=this.THROTTLE_TIMEOUT,r=null,function(){r||(r=setTimeout((function(){n(),r=null}),i))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(o.rootMargin),this.thresholds=this._initThresholds(o.threshold),this.root=o.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" ")}function o(t,e,n,i){"function"==typeof t.addEventListener?t.addEventListener(e,n,i||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function s(t,e,n,i){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,i||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function h(t){var e;try{e=t.getBoundingClientRect()}catch(t){}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):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function c(t,e){for(var n=e;n;){if(n==t)return!0;n=u(n)}return!1}function u(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e}}(window,document)},5623:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=h();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var o=i?Object.getOwnPropertyDescriptor(t,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=t[r]}n.default=t,e&&e.set(t,n);return n}(n(0)),r=s(n(101)),o=s(n(5324));function s(t){return t&&t.__esModule?t:{default:t}}function h(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return h=function(){return t},t}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=r.default.v4(),a=new Map,l=new Map,p=function(t){var e,n;function s(e){var n;(n=t.call(this,e)||this).isVisible=!1;var i=e.root,s=e.rootMargin,h=e.threshold;i?a.has(i)?n.elementId=a.get(i)||"":a.set(i,r.default.v4()):n.elementId=u;var c=n.getVisibilityObserverId();return l.has(c)||l.set(c,new o.default({root:i,rootMargin:s,threshold:h})),n}n=t,(e=s).prototype=Object.create(n.prototype),e.prototype.constructor=e,c(e,n);var h=s.prototype;return h.componentDidMount=function(){if(this.props.active){var t=this.getVisibilityObserver();t.observe(this),this.isVisible=t.isVisible(this)}},h.componentDidUpdate=function(t){var e=this.getVisibilityObserver(),n=e.isVisible(this);this.props.active&&n!==this.isVisible&&this.props.onChange(n),!t.active&&this.props.active?e.observe(this):t.active&&!this.props.active&&e.unobserve(this),this.isVisible=n},h.componentWillUnmount=function(){this.getVisibilityObserver().unobserve(this)},h.getVisibilityObserverId=function(){var t=this.props,e=t.rootMargin,n=t.threshold;return this.elementId+" "+e+" "+n},h.getVisibilityObserver=function(){var t=this.getVisibilityObserverId(),e=l.get(t);if(!e)throw new Error("Visibility sensor with id "+t+" not found.");return e},h.render=function(){return i.Children.only(this.props.children)},s}(i.Component);p.displayName="VisibilitySensor",p.defaultProps={active:!0,children:i.createElement("span"),root:null,rootMargin:"0px 0px 0px 0px",threshold:[0,Number.MIN_VALUE]};var f=p;e.default=f}}]);
|
|
//# sourceMappingURL=bc128cc19b6c37a83f53.js.map
|