forked from AkkomaGang/akkoma
2 lines
No EOL
12 KiB
JavaScript
2 lines
No EOL
12 KiB
JavaScript
webpackJsonp([1],{801:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(933),r=(n.n(i),n(934)),o=(n.n(r),n(935));n.n(o)()()},933:function(t,e){!function(t,e){"use strict";function n(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||l(),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 i(t,e){var n=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(n.root&&1!=n.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=o(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(n.rootMargin),this.thresholds=this._initThresholds(n.threshold),this.root=n.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function r(){return t.performance&&performance.now&&performance.now()}function o(t,e){var n=null;return function(){n||(n=setTimeout(function(){t(),n=null},e))}}function s(t,e,n,i){"function"==typeof t.addEventListener?t.addEventListener(e,n,i||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function c(t,e,n,i){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,i||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function u(t,e){var n=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom),r=Math.max(t.left,e.left),o=Math.min(t.right,e.right),s=o-r,c=i-n;return s>=0&&c>=0&&{top:n,bottom:i,left:r,right:o,width:s,height:c}}function a(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):l()}function l(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function h(t,e){for(var n=e;n;){if(n==t)return!0;n=f(n)}return!1}function f(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e}if("IntersectionObserver"in t&&"IntersectionObserverEntry"in t&&"intersectionRatio"in t.IntersectionObserverEntry.prototype)return void("isIntersecting"in t.IntersectionObserverEntry.prototype||Object.defineProperty(t.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var d=[];i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.USE_MUTATION_OBSERVER=!0,i.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()}},i.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},i.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]})},i.prototype._parseRootMargin=function(t){var e=t||"0px",n=e.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 n[1]=n[1]||n[0],n[2]=n[2]||n[0],n[3]=n[3]||n[1],n},i.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(s(t,"resize",this._checkForIntersections,!0),s(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}))))},i.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,c(t,"resize",this._checkForIntersections,!0),c(e,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},i.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),e=t?this._getRootRect():l();this._observationTargets.forEach(function(i){var o=i.element,s=a(o),c=this._rootContainsTarget(o),u=i.entry,l=t&&c&&this._computeTargetAndRootIntersection(o,e),h=i.entry=new n({time:r(),target:o,boundingClientRect:s,rootBounds:e,intersectionRect:l});u?t&&c?this._hasCrossedThreshold(u,h)&&this._queuedEntries.push(h):u&&u.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},i.prototype._computeTargetAndRootIntersection=function(n,i){if("none"!=t.getComputedStyle(n).display){for(var r=a(n),o=r,s=f(n),c=!1;!c;){var l=null,h=1==s.nodeType?t.getComputedStyle(s):{};if("none"==h.display)return;if(s==this.root||s==e?(c=!0,l=i):s!=e.body&&s!=e.documentElement&&"visible"!=h.overflow&&(l=a(s)),l&&!(o=u(l,o)))break;s=f(s)}return o}},i.prototype._getRootRect=function(){var t;if(this.root)t=a(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)},i.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},i.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}},i.prototype._rootIsInDom=function(){return!this.root||h(e,this.root)},i.prototype._rootContainsTarget=function(t){return h(this.root||e,t)},i.prototype._registerInstance=function(){d.indexOf(this)<0&&d.push(this)},i.prototype._unregisterInstance=function(){var t=d.indexOf(this);-1!=t&&d.splice(t,1)},t.IntersectionObserver=i,t.IntersectionObserverEntry=n}(window,document)},934:function(t,e,n){(function(n){var i,r,o;!function(n){r=[],i=n,void 0!==(o="function"==typeof i?i.apply(e,r):i)&&(t.exports=o)}(function(){"use strict";function t(){v&&(f&&p(f),h&&clearTimeout(h),v=!1)}function e(){125!=I&&(y=7,I=125,_=35,v&&(t(),o())),k()}function i(){f=null,h=setTimeout(s,0)}function r(){h=null,g(i)}function o(){v||(l=I-(Date.now()-E),a=Date.now(),v=!0,_&&l<_&&(l=_),l>9?h=setTimeout(r,l):(l=0,r()))}function s(){var t,e,n,i=y>9?9:1;if(E=Date.now(),v=!1,h=null,b>2||E-l-50<a)for(e=0,n=m.length;e<n&&R.timeRemaining()>i;e++)t=m.shift(),T++,t&&t(R);m.length?o():b=0}function c(t){return w++,m.push(t),o(),w}function u(t){var e=t-1-T;m[e]&&(m[e]=null)}var a,l,h,f,d="undefined"!=typeof window?window:void 0!=typeof n?n:this||{},g=d.cancelRequestAnimationFrame&&d.requestAnimationFrame||setTimeout,p=d.cancelRequestAnimationFrame||clearTimeout,m=[],b=0,v=!1,y=7,_=35,I=125,w=0,E=0,T=0,R={get didTimeout(){return!1},timeRemaining:function(){var t=y-(Date.now()-E);return t<0?0:t}},k=function(t){var e,n,i=function(){var r=Date.now()-n;r<99?e=setTimeout(i,99-r):(e=null,t())};return function(){n=Date.now(),e||(e=setTimeout(i,99))}}(function(){y=22,I=66,_=0});if(d.requestIdleCallback&&d.cancelIdleCallback)try{d.requestIdleCallback(function(){},{timeout:0})}catch(t){!function(t){var e,n;if(d.requestIdleCallback=function(e,n){return n&&"number"==typeof n.timeout?t(e,n.timeout):t(e)},d.IdleCallbackDeadline&&(e=IdleCallbackDeadline.prototype)){if(!(n=Object.getOwnPropertyDescriptor(e,"timeRemaining"))||!n.configurable||!n.get)return;Object.defineProperty(e,"timeRemaining",{value:function(){return n.get.call(this)},enumerable:!0,configurable:!0})}}(d.requestIdleCallback)}else d.requestIdleCallback=c,d.cancelIdleCallback=u,d.document&&document.addEventListener&&(d.addEventListener("scroll",e,!0),d.addEventListener("resize",e),document.addEventListener("focus",e,!0),document.addEventListener("mouseover",e,!0),["click","keypress","touchstart","mousedown"].forEach(function(t){document.addEventListener(t,e,{capture:!0,passive:!0})}),d.MutationObserver&&new MutationObserver(e).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));return{request:c,cancel:u}})}).call(e,n(45))},935:function(t,e,n){"use strict";function i(t,e){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+t+"' height='"+e+"'%3E%3C/svg%3E"}function r(t){if(t.srcset&&!b&&window.picturefill){var e=window.picturefill._;t[e.ns]&&t[e.ns].evaled||e.fillImg(t,{reselect:!0}),t[e.ns].curSrc||(t[e.ns].supported=!1,e.fillImg(t,{reselect:!0})),t.currentSrc=t[e.ns].curSrc||t.src}}function o(t){for(var e,n=getComputedStyle(t).fontFamily,i={};null!==(e=f.exec(n));)i[e[1]]=e[2];return i}function s(t,e,n){var r=i(e||1,n||0);v.call(t,"src")!==r&&y.call(t,"src",r)}function c(t,e){t.naturalWidth?e(t):setTimeout(c,100,t,e)}function u(t){var e=o(t),n=t[h];if(e["object-fit"]=e["object-fit"]||"fill",!n.img){if("fill"===e["object-fit"])return;if(!n.skipTest&&g&&!e["object-position"])return}if(!n.img){n.img=new Image(t.width,t.height),n.img.srcset=v.call(t,"data-ofi-srcset")||t.srcset,n.img.src=v.call(t,"data-ofi-src")||t.src,y.call(t,"data-ofi-src",t.src),t.srcset&&y.call(t,"data-ofi-srcset",t.srcset),s(t,t.naturalWidth||t.width,t.naturalHeight||t.height),t.srcset&&(t.srcset="");try{a(t)}catch(t){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}r(n.img),t.style.backgroundImage='url("'+(n.img.currentSrc||n.img.src).replace(/"/g,'\\"')+'")',t.style.backgroundPosition=e["object-position"]||"center",t.style.backgroundRepeat="no-repeat",t.style.backgroundOrigin="content-box",/scale-down/.test(e["object-fit"])?c(n.img,function(){n.img.naturalWidth>t.width||n.img.naturalHeight>t.height?t.style.backgroundSize="contain":t.style.backgroundSize="auto"}):t.style.backgroundSize=e["object-fit"].replace("none","auto").replace("fill","100% 100%"),c(n.img,function(e){s(t,e.naturalWidth,e.naturalHeight)})}function a(t){var e={get:function(e){return t[h].img[e||"src"]},set:function(e,n){return t[h].img[n||"src"]=e,y.call(t,"data-ofi-"+n,e),u(t),e}};Object.defineProperty(t,"src",e),Object.defineProperty(t,"currentSrc",{get:function(){return e.get("currentSrc")}}),Object.defineProperty(t,"srcset",{get:function(){return e.get("srcset")},set:function(t){return e.set(t,"srcset")}})}function l(t,e){var n=!_&&!t;if(e=e||{},t=t||"img",p&&!e.skipTest||!m)return!1;"img"===t?t=document.getElementsByTagName("img"):"string"==typeof t?t=document.querySelectorAll(t):"length"in t||(t=[t]);for(var i=0;i<t.length;i++)t[i][h]=t[i][h]||{skipTest:e.skipTest},u(t[i]);n&&(document.body.addEventListener("load",function(t){"IMG"===t.target.tagName&&l(t.target,{skipTest:e.skipTest})},!0),_=!0,t="img"),e.watchMQ&&window.addEventListener("resize",l.bind(null,t,{skipTest:e.skipTest}))}var h="bfred-it:object-fit-images",f=/(object-fit|object-position)\s*:\s*([-\w\s%]+)/g,d="undefined"==typeof Image?{style:{"object-position":1}}:new Image,g="object-fit"in d.style,p="object-position"in d.style,m="background-size"in d.style,b="string"==typeof d.currentSrc,v=d.getAttribute,y=d.setAttribute,_=!1;l.supportsObjectFit=g,l.supportsObjectPosition=p,function(){function t(t,e){return t[h]&&t[h].img&&("src"===e||"srcset"===e)?t[h].img:t}p||(HTMLImageElement.prototype.getAttribute=function(e){return v.call(t(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,n){return y.call(t(this,e),e,String(n))})}(),t.exports=l}});
|
|
//# sourceMappingURL=extra_polyfills.js.map
|