1!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(e="undefined"!=typeof globalThis?globalThis:e||self).Ukiyo=i()}(this,(function(){"use strict";var t=function(e,i){var s=this;if(void 0===i&&(i={}),e&&(r="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]"),n=Element.prototype.closest,r&&n&&"IntersectionObserver"in window)){var r,n;this.element=e,this.wrapper=document.createElement("div"),this.isIMGtag="img"===e.tagName.toLowerCase(),this.overflow=null,this.timer=null,this.resizeEvent=this.resize.bind(this),this.observer=null,this.requestId=null,this.isInit=!1,this.options=Object.assign({},{scale:1.5,speed:1.5,wrapperClass:null,willChange:!1},i);var o,l=e.getAttribute("data-u-scale"),a=e.getAttribute("data-u-speed"),h=e.getAttribute("data-u-willchange");if(null!==l&&(this.options.scale=l),null!==a&&(this.options.speed=a),null!==h&&(this.options.willChange=!0),this.isIMGtag){var p=this.element.getAttribute("src");(o=p,new Promise((function(e,i){var s=new Image;s.onload=function(){return e(s)},s.onerror=function(e){return i(e)},s.src=o}))).then((function(){s._init()}))}else this._init()}};return t.prototype._init=function(){this.isInit||(this._setupElements(),this._observer(),this._addEvent(),this.isInit=!0)},t.prototype._setupElements=function(){this._setStyles(!0);var e=this.element.getAttribute("data-u-wrapper-class"),i=this.element.closest("picture");if(this.options.wrapperClass||e){var s=e||this.options.wrapperClass;this.wrapper.classList.add(s)}null!==i?(i.parentNode.insertBefore(this.wrapper,i),this.wrapper.appendChild(i)):(this.element.parentNode.insertBefore(this.wrapper,this.element),this.wrapper.appendChild(this.element))},t.prototype._setStyles=function(e){var i=this.element.clientHeight,s=this.element.clientWidth,r=document.defaultView.getComputedStyle(this.element),n="absolute"===r.position;this.overflow=i-i*this.options.scale,"absolute"===r.position&&"0px"!==r.marginRight&&"0px"!==r.marginLeft&&r.marginLeft===r.marginRight&&(this.wrapper.style.margin="auto"),"0px"===r.marginTop&&"0px"===r.marginBottom||(this.wrapper.style.marginTop=r.marginTop,this.wrapper.style.marginBottom=r.marginBottom,this.element.style.marginTop="0",this.element.style.marginBottom="0"),"auto"!==r.inset&&(this.wrapper.style.top=r.top,this.wrapper.style.right=r.right,this.wrapper.style.bottom=r.bottom,this.wrapper.style.left=r.left,this.element.style.top="0",this.element.style.right="0",this.element.style.bottom="0",this.element.style.left="0"),"none"!==r.transform&&(this.wrapper.style.transform=r.transform),"auto"!==r.zIndex&&(this.wrapper.style.zIndex=r.zIndex),this.wrapper.style.position=n?"absolute":"relative","auto"!==r.gridArea&&"auto / auto / auto / auto"!==r.gridArea&&(this.wrapper.style.gridArea=r.gridArea,this.element.style.gridArea="auto"),e&&(this.wrapper.style.width="100%",this.wrapper.style.overflow="hidden",this.element.style.display="block",this.element.style.overflow="hidden",this.element.style.backfaceVisibility="hidden","0px"!==r.padding&&(this.element.style.padding="0"),this.isIMGtag?this.element.style.objectFit="cover":this.element.style.backgroundPosition="center"),n&&(this.wrapper.style.width=s+"px",this.element.style.width="100%"),"none"!==r.maxHeight&&(this.wrapper.style.maxHeight=r.maxHeight,this.element.style.maxHeight="none"),"0px"!==r.minHeight&&(this.wrapper.style.minHeight=r.minHeight,this.element.style.minHeight="none"),this.wrapper.style.height=i+"px",this.element.style.height=i*this.options.scale+"px"},t.prototype._observer=function(){this.observer=new IntersectionObserver(this._observerCallback.bind(this),{root:null,rootMargin:"0px",threshold:0}),this.observer.observe(this.wrapper)},t.prototype._observerCallback=function(e){var i=this;e.forEach((function(e){e.isIntersecting?(i.isVisible=!0,i._update()):(i.isVisible=!1,i._cancel())}))},t.prototype._update=function(){this._setPosition(),this.requestId=window.requestAnimationFrame(this._update.bind(this))},t.prototype._setPosition=function(){this.options.willChange&&"transform"!==this.element.style.willChange&&(this.element.style.willChange="transform"),this.element.style.transform="translate3d(0 , "+this._getTranslate()+"px , 0)"},t.prototype._getTranslate=function(){var e=Math.abs(this.overflow),i=this._getProgress()/100,s=this.overflow+e*i*this.options.speed;return Math.round(s)},t.prototype._getProgress=function(){var e=window.innerHeight,i=this.wrapper.offsetHeight,s=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,r=(s+e-(this.wrapper.getBoundingClientRect().top+s))/((e+i)/100);return Math.min(100,Math.max(0,r))},t.prototype._cancel=function(){this.requestId&&(this.options.willChange&&(this.element.style.willChange="auto"),window.cancelAnimationFrame(this.requestId))},t.prototype._addEvent=function(){navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/)?window.addEventListener("orientationchange",this.resizeEvent):window.addEventListener("resize",this.resizeEvent)},t.prototype.resize=function(){clearTimeout(this.timer),this.timer=setTimeout(this.reset.bind(this),450)},t.prototype.reset=function(){this.wrapper.style.width="",this.wrapper.style.position="",this.element.style.width="",this.isIMGtag&&"absolute"===this.wrapper.style.position?this.wrapper.style.height="100%":this.wrapper.style.height="",""===this.wrapper.style.gridArea?this.element.style.height="":this.element.style.height="100%","0px"!==this.wrapper.style.margin&&(this.wrapper.style.margin="",this.element.style.margin=""),"auto"!==this.wrapper.style.inset&&(this.wrapper.style.top="",this.wrapper.style.right="",this.wrapper.style.bottom="",this.wrapper.style.left="",this.element.style.top="",this.element.style.right="",this.element.style.bottom="",this.element.style.left=""),"none"!==this.wrapper.style.transform&&(this.wrapper.style.transform="",this.element.style.transform=""),"auto"!==this.wrapper.style.zIndex&&(this.wrapper.style.zIndex=""),this._setStyles(),this._setPosition()},t.prototype.destroy=function(){var e;this._cancel(),this.observer.disconnect(),this.wrapper.removeAttribute("style"),this.element.removeAttribute("style"),(e=this.wrapper).replaceWith.apply(e,this.wrapper.childNodes),window.removeEventListener("resize",this.resizeEvent),window.removeEventListener("orientationchange",this.resizeEvent),this.isInit=!1},t}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.