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