1
0
mirror of https://github.com/StarGazer114/stargazer114.github.io.git synced 2025-01-08 14:28:17 +08:00
stargazer114.github.io/pluginsSrc/@egjs/infinitegrid/dist/infinitegrid.min.js

11 lines
96 KiB
JavaScript

/*
Copyright (c) NAVER Corp.
name: @egjs/infinitegrid
license: MIT
author: NAVER Corp.
repository: https://github.com/naver/egjs-infinitegrid
version: 4.12.0
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).InfiniteGrid=t()}(this,function(){"use strict";var G=function(e,t){return(G=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}G(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var I=function(){return(I=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function k(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function n(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(o<3?r(s):3<o?r(t,n,s):r(t,n))||s);return 3<o&&s&&Object.defineProperty(t,n,s),s}function f(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||((i=i||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function A(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}(arguments[t]));return e}function a(e){return void 0===e}var K=function(){function e(e,t){var n,i;if(this._canceled=!1,t)try{for(var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(t)),o=r.next();!o.done;o=r.next()){var s=o.value;this[s]=t[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=e}var t=e.prototype;return t.stop=function(){this._canceled=!0},t.isCanceled=function(){return this._canceled},e}(),i=function(){function e(){this._eventHandler={}}var t=e.prototype;return t.trigger=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var i=t instanceof K?t.eventType:t,i=A(this._eventHandler[i]||[]);return i.length<=0||(t instanceof K?(t.currentTarget=this,i.forEach(function(e){e(t)})):i.forEach(function(e){e.apply(void 0,A(n))})),this},t.once=function(n,i){var r,o=this;if("object"==typeof n&&a(i)){var e,t=n;for(e in t)this.once(e,t[e])}else"string"==typeof n&&"function"==typeof i&&(r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.apply(void 0,A(e)),o.off(n,r)},this.on(n,r));return this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&a(t)){var n,i=e;for(n in i)this.on(n,i[n])}else{var r;"string"==typeof e&&"function"==typeof t&&(r=this._eventHandler[e],a(r)&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t))}return this},t.off=function(e,t){if(a(e))this._eventHandler={};else if(a(t))if("string"==typeof e)delete this._eventHandler[e];else{var n,i=e;for(n in i)this.off(n,i[n])}else{var r=this._eventHandler[e];if(r)for(var o=r.length,s=0;s<o;++s)if(r[s]===t){r.splice(s,1),o<=1&&delete this._eventHandler[e];break}}return this},e.VERSION="3.0.5",e}(),C=K,V=function(){function e(){this.keys=[],this.values=[]}var t=e.prototype;return t.get=function(e){return this.values[this.keys.indexOf(e)]},t.set=function(e,t){var n=this.keys,i=this.values,r=n.indexOf(e),r=-1===r?n.length:r;n[r]=e,i[r]=t},e}(),U=function(){function e(){this.object={}}var t=e.prototype;return t.get=function(e){return this.object[e]},t.set=function(e,t){this.object[e]=t},e}(),j="function"==typeof Map,F=function(){function e(){}var t=e.prototype;return t.connect=function(e,t){this.prev=e,this.next=t,e&&(e.next=this),t&&(t.prev=this)},t.disconnect=function(){var e=this.prev,t=this.next;e&&(e.next=t),t&&(t.prev=e)},t.getIndex=function(){for(var e=this,t=-1;e;)e=e.prev,++t;return t},e}();var q=function(){function e(e,t,n,i,r,o,s,a){this.prevList=e,this.list=t,this.added=n,this.removed=i,this.changed=r,this.maintained=o,this.changedBeforeAdded=s,this.fixed=a}var t=e.prototype;return Object.defineProperty(t,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(t,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),t.caculateOrdered=function(){e=this.changedBeforeAdded,n=this.fixed,r=[],o=[],e.forEach(function(e){var t=e[0],e=e[1],n=new F;o[e]=r[t]=n}),r.forEach(function(e,t){e.connect(r[t-1])});var n,r,o,e=e.filter(function(e,t){return!n[t]}).map(function(e,t){var n,i=e[0],e=e[1];return i===e?[0,0]:(e=o[e-1],n=(i=r[i]).getIndex(),i.disconnect(),e?i.connect(e,e.next):i.connect(void 0,r[0]),[n,i.getIndex()])}),s=this.changed,a=[];this.cacheOrdered=e.filter(function(e,t){var n=e[0],e=e[1],t=s[t],i=t[0],t=t[1];if(n!==e)return a.push([i,t]),!0}),this.cachePureChanged=a},e}();function Y(e,t,n){var i=j?Map:n?U:V,n=n||function(e){return e},r=[],o=[],s=[],a=e.map(n),n=t.map(n),u=new i,c=new i,h=[],l=[],f={},d=[],p=0,g=0;return a.forEach(function(e,t){u.set(e,t)}),n.forEach(function(e,t){c.set(e,t)}),a.forEach(function(e,t){e=c.get(e);void 0===e?(++g,o.push(t)):f[e]=g}),n.forEach(function(e,t){e=u.get(e);void 0===e?(r.push(t),++p):(s.push([e,t]),g=f[t]||0,h.push([e-g,t-p]),l.push(t===e),e!==t&&d.push([e,t]))}),o.reverse(),new q(e,t,r,o,d,s,h,l)}var B,W="function"==typeof Map?void 0:(B=0,function(e){return e.__DIFF_KEY__||(e.__DIFF_KEY__=++B)});function H(e,t){return Y(e,t,W)}var Z=function(e,t){return(Z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};var e="undefined"!=typeof window,t=e?window.navigator.userAgent:"",X=e&&!!("getComputedStyle"in window),Q=/MSIE|Trident|Windows Phone|Edge/.test(t),J=e&&!!("addEventListener"in document),$="width",c="height";function ee(e,t){return e.getAttribute(t)||""}function te(e){return[].slice.call(e)}function ne(e,t){return void 0===t&&(t="data-"),"loading"in e&&"lazy"===e.getAttribute("loading")||!!e.getAttribute(t+"lazy")}function ie(e,t,n){J?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function re(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function oe(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||(n=e,((X?window.getComputedStyle(n):n.currentStyle)||{})[t.toLowerCase()]))||0}function se(e,t,n){var i=te(e.querySelectorAll(function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}(["["+n+"skip] ["+n+"width]"],t.map(function(e){return["["+n+"skip] "+e,e+"["+n+"skip]","["+n+"width] "+e].join(", ")})).join(", ")));return te(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter(function(e){return-1===i.indexOf(e)})}var h=[];function ae(e,t){h.length||ie(window,"resize",ce),e.__PREFIX__=t,h.push(e),ue(e)}function ue(e,t){void 0===t&&(t="data-");var n,t=e.__PREFIX__||t,i=parseInt(ee(e,""+t+$),10)||0,r=parseInt(ee(e,""+t+c),10)||0;ee(e,t+"fixed")===c?(n=oe(e,"Height")||r,e.style[$]=i/r*n+"px"):(n=oe(e,"Width")||i,e.style[c]=r/i*n+"px")}function ce(){h.forEach(function(e){ue(e)})}var t=function(r){function e(e,t){void 0===t&&(t={});var n,i=r.call(this)||this,t=(i.isReady=!1,i.isPreReady=!1,i.hasDataSize=!1,i.hasLoading=!1,i.isSkip=!1,i.onCheck=function(e){i.clear(),e&&"error"===e.type&&i.onError(i.element),i.hasLoading&&i.checkElement()||(e=!i.hasDataSize&&!i.hasLoading,i.onReady(e))},i.options=u({prefix:"data-"},t),i.element=e,i.options.prefix);return i.hasDataSize=(n=t,!!e.getAttribute((n=void 0===t?"data-":n)+"width")),i.isSkip=(n=t,!!e.getAttribute((n=void 0===t?"data-":n)+"skip")),i.hasLoading=ne(e,t),i}s(e,r);var t=e.prototype;return t.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&ae(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},t.addEvents=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){ie(n,e,t.onCheck)})},t.clear=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){re(n,e,t.onCheck)}),this.removeAutoSizer()},t.destroy=function(){this.clear(),this.off()},t.removeAutoSizer=function(){var e,t,n;this.hasDataSize&&(t=this.options.prefix,e=this.element,t=t,(n=h.indexOf(e))<0||(t=ee(e,t+"fixed"),delete e.__PREFIX__,e.style[t===c?$:c]="",h.splice(n,1),h.length)||re(window,"resize",ce))},t.onError=function(e){this.trigger("error",{element:this.element,target:e})},t.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onReady=function(e){this.isReady||((e=!this.isPreReady&&e)&&(this.isPreReady=!0),this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:e,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onAlreadyError=function(e){var t=this;setTimeout(function(){t.onError(e)})},t.onAlreadyPreReady=function(){var e=this;setTimeout(function(){e.onPreReady()})},t.onAlreadyReady=function(e){var t=this;setTimeout(function(){t.onReady(e)})},e.EVENTS=[],e}(i),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}s(t,e);var n=t.prototype;return n.setHasLoading=function(e){this.hasLoading=e},n.check=function(){return this.isSkip?(this.onAlreadyReady(!0),!1):(this.hasDataSize?(ae(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},n.checkElement=function(){return!0},n.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},n.onAlreadyPreReady=function(){e.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},t.EVENTS=[],t}(t),e=function(n){function e(e){void 0===e&&(e={});var t=n.call(this)||this;return t.readyCount=0,t.preReadyCount=0,t.totalCount=0,t.totalErrorCount=0,t.isPreReadyOver=!0,t.elementInfos=[],t.options=u({loaders:{},prefix:"data-"},e),t}s(e,n);var t=e.prototype;return t.check=function(e){var o=this,n=this.options.prefix,e=(this.clear(),this.elementInfos=te(e).map(function(e,r){var t=o.getLoader(e,{prefix:n});return t.check(),t.on("error",function(e){o.onError(r,e.target)}).on("preReady",function(e){var t=o.elementInfos[r],t=(t.hasLoading=e.hasLoading,t.isSkip=e.isSkip,o.checkPreReady(r));o.onPreReadyElement(r),t&&o.onPreReady()}).on("ready",function(e){var t=e.withPreReady,n=e.hasLoading,e=e.isSkip,i=o.elementInfos[r],n=(i.hasLoading=n,i.isSkip=e,t&&o.checkPreReady(r)),i=o.checkReady(r);t&&o.onPreReadyElement(r),o.onReadyElement(r),n&&o.onPreReady(),i&&o.onReady()}),{loader:t,element:e,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}}),this.elementInfos.length);return(this.totalCount=e)||setTimeout(function(){o.onPreReady(),o.onReady()}),this},t.getTotalCount=function(){return this.totalCount},t.isPreReady=function(){return this.elementInfos.every(function(e){return e.isPreReady})},t.isReady=function(){return this.elementInfos.every(function(e){return e.isReady})},t.hasError=function(){return 0<this.totalErrorCount},t.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(e){e.loader&&e.loader.destroy()}),this.elementInfos=[]},t.destroy=function(){this.clear(),this.off()},t.getLoader=function(t,e){var n,i,r,o,s=this,a=t.tagName.toLowerCase(),u=this.options.loaders,c=e.prefix,h=Object.keys(u);return u[a]?new u[a](t,e):(n=new he(t,e),i=te(t.querySelectorAll(h.join(", "))),n.setHasLoading(i.some(function(e){return ne(e,c)})),r=!1,o=this.clone().on("error",function(e){n.onError(e.target)}).on("ready",function(){n.onReady(r)}),n.on("requestChildren",function(){var e=se(t,h,s.options.prefix);o.check(e).on("preReady",function(e){(r=e.isReady)||n.onPreReady()})}).on("reqeustReadyChildren",function(){o.check(i)}).on("requestDestroy",function(){o.destroy()}),n)},t.clone=function(){return new e(u({},this.options))},t.checkPreReady=function(e){return this.elementInfos[e].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},t.checkReady=function(e){return this.elementInfos[e].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},t.onError=function(e,t){var n=this.elementInfos[e];n.hasError=!0,this.trigger(new C("error",{element:n.element,index:e,target:t,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount}))},t.onPreReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new C("preReadyElement",{element:t.element,index:e,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isSkip:t.isSkip}))},t.onPreReady=function(){this.isPreReadyOver=!0,this.trigger(new C("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()}))},t.onReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new C("readyElement",{index:e,element:t.element,hasError:t.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:t.isSkip}))},t.onReady=function(){this.trigger(new C("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount}))},t.getErrorCount=function(){return this.elementInfos.filter(function(e){return e.hasError}).length},t.hasLoading=function(){return this.elementInfos.some(function(e){return e.hasLoading})},e}(i),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.checkElement=function(){var e=this.element,t=e.getAttribute("src");if(e.complete){if(t)return e.naturalWidth||this.onAlreadyError(e),!1;this.onAlreadyPreReady()}return this.addEvents(),Q&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(t),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.checkElement=function(){var e=this.element;return!(1<=e.readyState||(e.error?(this.onAlreadyError(e),1):(this.addEvents(),0)))},t.EVENTS=["loadedmetadata","error"],t}(t),de=function(t){function e(e){return t.call(this,u({loaders:{img:le,video:fe}},e=void 0===e?{}:e))||this}return s(e,t),e}(e),pe=function(e,t){return(pe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var p=function(){return(p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function l(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(o<3?r(s):3<o?r(t,n,s):r(t,n))||s);return 3<o&&s&&Object.defineProperty(t,n,s),s}function m(e,t){for(var n=0,i=t.length,r=e.length;n<i;n++,r++)e[r]=t[n];return e}var d,O,g,y={horizontal:!1,useTransform:!1,percentage:!1,isEqualSize:!1,isConstantSize:!1,gap:0,attributePrefix:"data-grid-",resizeDebounce:100,maxResizeDebounce:0,autoResize:!0,preserveUIOnDestroy:!1,defaultDirection:"end",externalContainerManager:null,externalItemRenderer:null,renderOnPropertyChange:!0,useFit:!0,outlineLength:0,outlineSize:0,useRoundedSize:!0,useResizeObserver:!1,observeChildren:!1},ge=((t=d=d||{})[t.PROPERTY=1]="PROPERTY",t[t.RENDER_PROPERTY=2]="RENDER_PROPERTY",(e=O=O||{})[e.UNCHECKED=1]="UNCHECKED",e[e.UNMOUNTED=2]="UNMOUNTED",e[e.MOUNTED=3]="MOUNTED",(t=g=g||{})[t.NEED_UPDATE=1]="NEED_UPDATE",t[t.WAIT_LOADING=2]="WAIT_LOADING",t[t.UPDATED=3]="UPDATED",{gap:d.RENDER_PROPERTY,defaultDirection:d.PROPERTY,renderOnPropertyChange:d.PROPERTY,preserveUIOnDestroy:d.PROPERTY,useFit:d.PROPERTY,outlineSize:d.RENDER_PROPERTY,outlineLength:d.RENDER_PROPERTY}),R={horizontal:{inlinePos:"top",contentPos:"left",inlineSize:"height",contentSize:"width"},vertical:{inlinePos:"left",contentPos:"top",inlineSize:"width",contentSize:"height"}};function me(n,i){var e=ye(n);return H(i.map(function(e){return e.target}),e.map(function(e){return e.element})).maintained.filter(function(e){var t=e[0],e=e[1],t=i[t].size,e=n[e];return!e.inlineSize||!e.contentSize||t.inlineSize!==e.computedInlineSize||t.blockSize!==e.computedContentSize}).map(function(e){e=e[1];return n[e]})}function ye(e){return e.filter(function(e){return e.element})}function Re(e){return ye(e).map(function(e){return e.element})}function ve(e){return"string"==typeof e}function Se(e){return"object"==typeof e}function ze(e){return"number"==typeof e}function v(e){return e.reduce(function(e,t){return e+t},0)}function S(e){var t,r=e.prototype,o=e.propertyTypes;for(t in o)!function(n){var i=o[n]===d.RENDER_PROPERTY,e=Object.getOwnPropertyDescriptor(r,n)||{},t=e.get||function(){return this.options[n]},e=e.set||function(e){var t=this.options;t[n]!==e&&(t[n]=e,i)&&t.renderOnPropertyChange&&this.scheduleRender()};Object.defineProperty(r,n,{enumerable:!0,configurable:!0,get:t,set:e})}(t)}function N(e){for(var t=[],n=0;n<e;++n)t.push(n);return t}function Ee(e,t){return Math.max(e-t[1],t[0]-e,0)+1}function _e(e,t,n){return Math.min(n,Math.max(e,t))}function Ie(e,t){var n;return t?(n=1/t,Math.round(e/t)/n):e}var Ce=function(){function e(e,t){var u=this;void 0===t&&(t={}),this._resizeTimer=0,this._maxResizeDebounceTimer=0,this.rect={width:0,height:0},this._updatedEntries=[],this._onWindowResize=function(){u._scheduleResize([{target:u.container}])},this._onObserve=function(e){var t=u._options,i=u.container,r=t.rectBox,o=t.childrenRectBox;u._scheduleResize(e.map(function(e){var t,n="border-box"===(e.target===i?r:o)?e.borderBoxSize:e.contentBoxSize;return{size:(n=n?n:[{inlineSize:(t=e.contentRect).width,blockSize:t.height}])[0]||n,target:e.target}}))},this._scheduleResize=function(e){var t=u._options,n=t.resizeDebounce,t=t.maxResizeDebounce,i=u._updatedEntries;i.push.apply(i,e),u._updatedEntries=i.filter(function(e,t){return i.lastIndexOf(e)===t}),!u._maxResizeDebounceTimer&&n<=t&&(u._maxResizeDebounceTimer=window.setTimeout(u._onResize,t)),u._resizeTimer&&(clearTimeout(u._resizeTimer),u._resizeTimer=0),u._resizeTimer=window.setTimeout(u._onResize,n)},this._onResize=function(){clearTimeout(u._resizeTimer),clearTimeout(u._maxResizeDebounceTimer),u._maxResizeDebounceTimer=0,u._resizeTimer=0;var t,e,n,i,r=u._updatedEntries,o=u.container,r=r.filter(function(e){return e.target!==o||(t=e,!1)}),s=0<r.length,a=!!t;a&&(e=u._options.watchDirection,n=u.rect,(i=t.size)?u.setRect({width:i.inlineSize,height:i.blockSize}):u.resize(),i=u.rect,a=!e||("box"===e||"width"===e)&&n.width!==i.width||("box"===e||"height"===e)&&n.height!==i.height),u._updatedEntries=[],(a||s)&&u._emitter.trigger("resize",{isResizeContainer:a,childEntries:r})},this._options=p({resizeDebounce:100,maxResizeDebounce:0,useResizeObserver:!1,useWindowResize:!0,watchDirection:!1,rectBox:"content-box",childrenRectBox:"border-box"},t),this.container=ve(e)?document.querySelector(e):e,this._init()}var t=e.prototype;return t.getRect=function(){return this.rect},t.setRect=function(e){this.rect=p({},e)},t.isObserverEnabled=function(){return!!this._observer},t.resize=function(){var e=this.container;this.setRect("border-box"===this._options.rectBox?{width:e.offsetWidth,height:e.offsetHeight}:{width:e.clientWidth,height:e.clientHeight})},t.observeChildren=function(e){var t,n=this._observer;n&&(t=this._options.childrenRectBox,e.forEach(function(e){e&&n.observe(e,{box:t})}))},t.unobserveChildren=function(e){var t=this._observer;t&&e.forEach(function(e){e&&t.unobserve(e)})},t.listen=function(e){return this._emitter.on("resize",e),this},t.destroy=function(){var e;null!=(e=this._observer)&&e.disconnect(),this._options.useWindowResize&&window.removeEventListener("resize",this._onWindowResize)},t._init=function(){var e=this.container,t=this._options;this._emitter=new i,t.useResizeObserver&&window.ResizeObserver&&(this._observer=new window.ResizeObserver(this._onObserve),this._observer.observe(e,{box:t.rectBox})),t.useWindowResize&&window.addEventListener("resize",this._onWindowResize),this.resize()},e}(),Oe=function(i){function e(e,t){var n=i.call(this)||this;return n.container=e,n._onResize=function(e){n.trigger("resize",e)},n.options=p({horizontal:y.horizontal,autoResize:y.autoResize,resizeDebounce:y.resizeDebounce,maxResizeDebounce:y.maxResizeDebounce,useResizeObserver:y.useResizeObserver},t),n._init(),n}r(e,i);var t=e.prototype;return t.resize=function(){var e=this.container;this.setRect({width:e.clientWidth,height:e.clientHeight})},t.isObserverEnabled=function(){return this._watcher.isObserverEnabled()},t.getRect=function(){return this._watcher.getRect()},t.observeChildren=function(e){this._watcher.observeChildren(e)},t.unobserveChildren=function(e){this._watcher.unobserveChildren(e)},t.setRect=function(e){this._watcher.setRect(e)},t.getInlineSize=function(){return this.getRect()[this._names.inlineSize]},t.getContentSize=function(){return this.getRect()[this._names.contentSize]},t.getStatus=function(){return{rect:this._watcher.getRect()}},t.setStatus=function(e){this.setRect(e.rect),this.setContentSize(this.getContentSize())},t.setContentSize=function(e){var t,n=this.options.horizontal?"width":"height";this.setRect(p(p({},this.getRect()),((t={})[n]=e,t))),this.container.style[n]=e+"px"},t.destroy=function(e){void 0===e&&(e={}),this._watcher.destroy(),e.preserveUI||(this.container.style.cssText=this.orgCSSText)},t._init=function(){var e=this.container,t=window.getComputedStyle(e),t=(this.orgCSSText=e.style.cssText,"static"===t.position&&(e.style.position="relative"),this.options);this._watcher=new Ce(e,{useWindowResize:t.autoResize,useResizeObserver:t.useResizeObserver,resizeDebounce:t.resizeDebounce,maxResizeDebounce:t.maxResizeDebounce,watchDirection:!!t.useResizeObserver&&this._names.inlineSize}).listen(this._onResize)},Object.defineProperty(t,"_names",{get:function(){return R[this.options.horizontal?"horizontal":"vertical"]},enumerable:!1,configurable:!0}),e}(i),Pe=function(){function e(e){this.initialRects={},this.sizePercetage=!1,this.posPercetage=!1,this.options=p({attributePrefix:y.attributePrefix,useTransform:y.useTransform,horizontal:y.horizontal,percentage:y.percentage,isEqualSize:y.isEqualSize,isConstantSize:y.isConstantSize,useRoundedSize:y.useRoundedSize},e),this._init()}var t=e.prototype;return t.resize=function(){this.initialRects={}},t.renderItems=function(e){var t=this;e.forEach(function(e){t._renderItem(e)})},t.getInlineSize=function(){return this.containerRect[this.options.horizontal?"height":"width"]},t.setContainerRect=function(e){this.containerRect=e},t.updateEqualSizeItems=function(t,e){var n=this,i=(this.updateItems(t),t.some(function(e){return e.attributes.sizeGroup}));(this.options.isEqualSize||i)&&t.some(function(e){return e.updateState===g.UPDATED})&&e.forEach(function(e){-1===t.indexOf(e)&&n.updateItem(e,!0)})},t.updateItems=function(e){var t=this;e.forEach(function(e){t.updateItem(e)})},t.getStatus=function(){return{initialRects:this.initialRects}},t.setStatus=function(e){this.initialRects=e.initialRects},t._init=function(){var e=this.options.percentage,t=!1,n=!1;!0===e?n=t=!0:e&&(-1<e.indexOf("position")&&(n=!0),-1<e.indexOf("size"))&&(t=!0),this.posPercetage=n,this.sizePercetage=t},t.updateItem=function(e,t){var n=this.options,i=n.isEqualSize,r=n.isConstantSize,n=n.useRoundedSize,o=this.initialRects,s=e.orgRect,a=e.element,u=e.updateState===g.WAIT_LOADING,c=s&&s.width&&s.height,h=a?function(e,t){for(var n={},i=e.attributes,r=i.length,o=0;o<r;++o){var s=i[o],a=s.name,s=s.value;-1!==a.indexOf(t)&&(n[a.replace(t,"").replace(/[\s-_]([a-z])/g,function(e,t){return t.toUpperCase()})]=s)}return n}(a,this.options.attributePrefix):e.attributes,l=null!=(l=h.sizeGroup)?l:"",f=h.notEqualSize;if(""!==l&&o[l])d=o[l];else if(i&&!f&&!l&&o[""])d=o[""];else if(r&&c&&!u)d=s;else{if(t||!a)return;var d={left:a.offsetLeft,top:a.offsetTop,width:0,height:0};n?(d.width=a.offsetWidth,d.height=a.offsetHeight):(i=a.getBoundingClientRect(),d.width=i.width,d.height=i.height)}return e.attributes=h,e.shouldReupdate=!1,e.isFirstUpdate&&c||(e.orgRect=p({},d)),e.rect=p({},d),t||(e.element&&(e.mountState=O.MOUNTED),e.updateState===g.NEED_UPDATE&&(e.updateState=g.UPDATED,e.isFirstUpdate=!0),u)||f||o[l]||(o[l]=p({},d)),d},t._renderItem=function(e){var n,i,t,r,o,s,a,u,c=e.element,h=e.cssRect;c&&h&&(a=(e=this.options).horizontal,e=e.useTransform,n=this.posPercetage,i=this.sizePercetage,t=["position: absolute;"],r=(a=R[a?"horizontal":"vertical"]).inlineSize,o=a.inlinePos,s=this.getInlineSize(),u=0<(a=Object.keys(h)).length,e&&(a=a.filter(function(e){return"top"!==e&&"left"!==e}),t.push("transform: translate("+(h.left||0)+"px, "+(h.top||0)+"px);")),t.push.apply(t,a.map(function(e){var t=h[e];return e===r&&i||e===o&&n?e+": "+t/s*100+"%;":e+": "+t+"px;"})),u)&&(c.style.cssText+=t.join(""))},e}(),be=function(){function e(e,t){void 0===t&&(t={}),this.horizontal=e,this.isUpdating=!1,this.shouldReupdate=!1,this.hasTransition=!1,this.transitionDuration="",this.isRestoreOrgCSSText=!0;var n,e=t.element,i=p({key:"",index:0,orgRect:{left:0,top:0,width:0,height:0},rect:{left:0,top:0,width:0,height:0},cssRect:{},attributes:{},data:{},isFirstUpdate:!1,mountState:O.UNCHECKED,updateState:g.NEED_UPDATE,element:e||null,orgCSSText:null!=(e=null==e?void 0:e.style.cssText)?e:"",gridData:{}},t);for(n in i)this[n]=i[n]}var t=e.prototype;return Object.defineProperty(t,"orgInlineSize",{get:function(){var e=this._names.inlineSize;return this.orgRect[e]||this.rect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"orgContentSize",{get:function(){var e=this._names.contentSize;return this.orgRect[e]||this.rect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"inlineSize",{get:function(){return this.rect[this._names.inlineSize]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"contentSize",{get:function(){return this.rect[this._names.contentSize]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssInlineSize",{get:function(){return this.cssRect[this._names.inlineSize]},set:function(e){this.cssRect[this._names.inlineSize]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssContentSize",{get:function(){return this.cssRect[this._names.contentSize]},set:function(e){this.cssRect[this._names.contentSize]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssInlinePos",{get:function(){return this.cssRect[this._names.inlinePos]},set:function(e){this.cssRect[this._names.inlinePos]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssContentPos",{get:function(){return this.cssRect[this._names.contentPos]},set:function(e){this.cssRect[this._names.contentPos]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedInlineSize",{get:function(){var e=this._names.inlineSize;return this.cssRect[e]||this.rect[e]||this.orgRect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedContentSize",{get:function(){var e=this._names.contentSize;return this.cssRect[e]||this.rect[e]||this.orgRect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedInlinePos",{get:function(){var e,t=this._names.inlinePos;return null!=(e=this.cssRect[t])?e:this.rect[t]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedContentPos",{get:function(){var e,t=this._names.contentPos;return null!=(e=this.cssRect[t])?e:this.rect[t]},enumerable:!1,configurable:!0}),t.setCSSGridRect=function(e){var t,n=R[this.horizontal?"horizontal":"vertical"],i={};for(t in e)i[n[t]]=e[t];this.cssRect=i},t.getStatus=function(){return{index:this.index,mountState:this.mountState,updateState:this.updateState,attributes:this.attributes,orgCSSText:this.orgCSSText,isFirstUpdate:this.isFirstUpdate,element:null,key:this.key,orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,gridData:this.gridData,data:this.data}},t.getMinimizedStatus=function(){var e={orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,attributes:this.attributes,gridData:this.gridData},t=this,n=t.key,i=t.mountState,r=t.updateState,o=t.isFirstUpdate,t=t.orgCSSText;return void 0!==n&&(e.key=n),i!==O.UNCHECKED&&(e.mountState=i),r!==g.NEED_UPDATE&&(e.updateState=r),o&&(e.isFirstUpdate=!0),t&&(e.orgCSSText=t),e},Object.defineProperty(t,"_names",{get:function(){return this.horizontal?R.horizontal:R.vertical},enumerable:!1,configurable:!0}),e}(),z=function(d){function e(e,t){void 0===t&&(t={});var n=d.call(this)||this,t=(n.items=[],n.outlines={start:[],end:[]},n._renderTimer=0,n._onResize=function(e){e.isResizeContainer?n._renderItems({useResize:!0},!0):0<(e=me(n.items,e.childEntries)).length&&n.updateItems(e)},n.options=p(p({},n.constructor.defaultOptions),t),n.containerElement=ve(e)?document.querySelector(e):e,n.options),e=t.isEqualSize,i=t.isConstantSize,r=t.useTransform,o=t.horizontal,s=t.percentage,a=t.externalContainerManager,u=t.externalItemRenderer,c=t.resizeDebounce,h=t.maxResizeDebounce,l=t.autoResize,f=t.useRoundedSize,t=t.useResizeObserver;return n.containerManager=a||new Oe(n.containerElement,{horizontal:o,resizeDebounce:c,maxResizeDebounce:h,autoResize:l,useResizeObserver:t}).on("resize",n._onResize),n.itemRenderer=u||new Pe({useTransform:r,isEqualSize:e,isConstantSize:i,percentage:s,useRoundedSize:f}),n._init(),n}r(e,d);var t=e.prototype;return t.getContainerElement=function(){return this.containerElement},t.getItems=function(){return this.items},t.getChildren=function(){return[].slice.call(this.containerElement.children)},t.setItems=function(e){e.forEach(function(e,t){e.index=t});var t=this.options;return t.useResizeObserver&&t.observeChildren&&((t=this.containerManager).unobserveChildren(Re(this.items)),t.observeChildren(Re(e))),this.items=e,this},t.getContainerInlineSize=function(){return this.containerManager.getInlineSize()},t.getOutlines=function(){return this.outlines},t.setOutlines=function(e){return this.outlines=e,this},t.syncElements=function(e){void 0===e&&(e={});var n=this.items,t=this.options.horizontal,i=this.getChildren(),r=H(this.items.map(function(e){return e.element}),i),o=r.added,s=r.maintained,a=r.changed,r=r.removed,u=[];return s.forEach(function(e){var t=e[0],e=e[1];u[e]=n[t]}),o.forEach(function(e){u[e]=new be(t,{element:i[e]})}),this.setItems(u),(o.length||r.length||a.length)&&this.renderItems(e),this},t.updateItems=function(e,t){void 0===e&&(e=this.items);var n=(t=void 0===t?{}:t).useOrgResize;return e.forEach(function(e){var t;n&&((t=e.orgRect).width=0,t.height=0),e.updateState=g.NEED_UPDATE}),this.checkReady(t),this},t.renderItems=function(e){return this._renderItems(e=void 0===e?{}:e),this},t.getStatus=function(t){return{outlines:this.outlines,items:this.items.map(function(e){return t?e.getMinimizedStatus():e.getStatus()}),containerManager:this.containerManager.getStatus(),itemRenderer:this.itemRenderer.getStatus()}},t.setStatus=function(e){var t=this,n=this.options.horizontal,i=this.containerManager,r=i.getInlineSize(),o=this.getChildren();return this.itemRenderer.setStatus(e.itemRenderer),i.setStatus(e.containerManager),this.outlines=e.outlines,this.items=e.items.map(function(e,t){return new be(n,p(p({},e),{element:o[t]}))}),this.itemRenderer.renderItems(this.items),r!==i.getInlineSize()?this.renderItems({useResize:!0}):window.setTimeout(function(){t._renderComplete({direction:t.defaultDirection,mounted:t.items,updated:[],isResize:!1})}),this},t.getComputedOutlineSize=function(e){return void 0===e&&(e=this.items),this.options.outlineSize||this.getContainerInlineSize()},t.getComputedOutlineLength=function(e){return void 0===e&&(e=this.items),this.options.outlineLength||1},t.destroy=function(e){var e=(e=void 0===e?{}:e).preserveUI,e=void 0===e?this.options.preserveUIOnDestroy:e;this.containerManager.destroy({preserveUI:e}),e||this.items.forEach(function(e){var t=e.element,e=e.orgCSSText;t&&(t.style.cssText=e)}),null!=(e=this._im)&&e.destroy()},t.getInlineGap=function(){return this._getDirectionalGap("inline")},t.getContentGap=function(){return this._getDirectionalGap("content")},t.checkReady=function(n){var i=this,e=(void 0===n&&(n={}),this.items),r=e.filter(function(e){var t;return(null==(t=e.element)?void 0:t.parentNode)&&e.updateState!==g.UPDATED}),t=e.filter(function(e){var t;return(null==(t=e.element)?void 0:t.parentNode)&&e.mountState!==O.MOUNTED}),o=[];t.filter(function(e){var t;return!!e.hasTransition||(t=e.element,0<parseFloat(getComputedStyle(t).transitionDuration)&&(e.hasTransition=!0,e.transitionDuration=t.style.transitionDuration,!0))}).forEach(function(e){e.element.style.transitionDuration="0s"}),null!=(e=this._im)&&e.destroy(),this._im=new de({prefix:this.options.attributePrefix}).on("preReadyElement",function(e){r[e.index].updateState=g.WAIT_LOADING}).on("preReady",function(){r.forEach(function(e){var t=e.orgRect.width&&e.orgRect.height,n=e.cssRect.width||e.cssRect.height;!t&&n&&(e.element.style.cssText=e.orgCSSText)}),i._updateItems(r),i.readyItems(t,r,n)}).on("readyElement",function(e){var t=r[e.index];t.updateState=g.NEED_UPDATE,e.isPreReadyOver&&(t.isRestoreOrgCSSText&&(t.element.style.cssText=t.orgCSSText),i._updateItems([t]),i.readyItems([],[t],n))}).on("error",function(e){var t=r[e.index];i.trigger("contentError",{element:e.element,target:e.target,item:t,update:function(){o.push(t)}})}).on("ready",function(){o.length&&i.updateItems(o)}).check(r.map(function(e){return e.element}))},t.scheduleRender=function(){var e=this;this._clearRenderTimer(),this._renderTimer=window.setTimeout(function(){e.renderItems()})},t.fitOutlines=function(e){void 0===e&&(e=this.useFit);var t=this.outlines,n=t.start,i=t.end,r=n.length?Math.min.apply(Math,n):0;!e&&0<r||(t.start=n.map(function(e){return e-r}),t.end=i.map(function(e){return e-r}),this.items.forEach(function(e){var t=e.cssContentPos;ze(t)&&(e.cssContentPos=t-r)}))},t.readyItems=function(e,t,n){var i=this.outlines,r=n.direction||this.options.defaultDirection,i=n.outline||i["end"===r?"start":"end"],o=this.items,s={start:m([],i),end:m([],i)},o=(e.forEach(function(e){e.mountState=O.MOUNTED}),t.forEach(function(e){e.isUpdating=!0}),o.length&&(s=this.applyGrid(this.items,r,i)),t.forEach(function(e){e.isUpdating=!1}),this.setOutlines(s),this.fitOutlines(),this.itemRenderer.renderItems(this.items),this._refreshContainerContentSize(),e.filter(function(e){return e.hasTransition})),i=(o.length&&(this.containerManager.resize(),o.forEach(function(e){e.element.style.transitionDuration=e.transitionDuration})),this._renderComplete({direction:r,mounted:e,updated:t,isResize:!!n.useResize}),t.filter(function(e){return e.shouldReupdate}));i.length&&this.updateItems(i)},t._isObserverEnabled=function(){return this.containerManager.isObserverEnabled()},t._updateItems=function(e){this.itemRenderer.updateEqualSizeItems(e,this.getItems())},t._getDirectionalGap=function(e){var t=this.options.horizontal,n=this.options.gap;return"number"==typeof n?n:null!=(t=t&&"inline"===e||!t&&"content"===e?n.vertical:n.horizontal)?t:y.gap},t._renderComplete=function(e){this.trigger("renderComplete",e)},t._clearRenderTimer=function(){clearTimeout(this._renderTimer),this._renderTimer=0},t._refreshContainerContentSize=function(){var e=this.outlines,t=e.start,e=e.end,n=this.getContentGap(),e=e.length?Math.max.apply(Math,e):0,t=t.length?Math.max.apply(Math,t):0,t=Math.max(t,e-n);this.containerManager.setContentSize(t)},t._resizeContainer=function(){this.containerManager.resize(),this.itemRenderer.setContainerRect(this.containerManager.getRect())},t._init=function(){this._resizeContainer()},t._renderItems=function(e,t){void 0===e&&(e={}),this._clearRenderTimer();var n=e.useResize||e.useOrgResize;n&&!t&&(this._resizeContainer(),this.itemRenderer.resize()),!this.getItems().length&&this.getChildren().length?this.syncElements(e):n?this.updateItems(this.items,e):this.checkReady(e)},e.defaultOptions=y,e.propertyTypes=ge,l([S],e)}(i);function Te(e,t,n,i){return Math[i].apply(Math,e.slice(t,t+n))}var Me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(y,e,t){y.forEach(function(e){e.isRestoreOrgCSSText=!1});for(var n,R=this.getComputedOutlineSize(y),v=this.getComputedOutlineLength(y),i=this.options,r=i.align,S=i.observeChildren,z=i.columnSizeRatio,i=i.contentAlign,E=this.getContentGap(),_=this.getContentGap(),o=t.length,I=y.length,C=this._getAlignPoses(v,R),O="end"===e,P=O?"min":"max",b=O?"max":"min",e=[0],T=(e=o===v?t.slice():(n=o?Math[b].apply(Math,t):0,N(v).map(function(){return n}))).slice(),M=1<v?C[1]-C[0]:0,x="stretch"===r,w=O&&"start"===i,D=O?-1/0:1/0,s=(w&&(D=Math.min.apply(Math,T)),function(e){var t,n,i,r,o,s,e=y[O?e:I-1-e],a=parseInt(e.attributes.column||"1",10),u=parseInt(e.attributes.maxColumn||"1",10),c=e.contentSize,h=Math.min(v,a||Math.max(1,Math.ceil((e.inlineSize+E)/M))),l=Math.min(v,Math.max(h,u)),f=(n=h,u=P,i=D,r=(t=T).length-n+1,o="max"===u?"min":"max",s="max"===u?"lastIndexOf":"indexOf",(r=N(r).map(function(e){e=Te(t,e,n,o);return Math[o](i,e)}))[s](Math[u].apply(Math,r))),d=Te(T,f,h,b);for(w&&D!==d&&(D=Math.max.apply(Math,T),T=T.map(function(){return D}),d=D,f=0);h<l;){var p=f+h,g=f-1;if(O&&(v<=p||T[p]>d))break;if(!O&&(g<0||T[g]<d))break;O||--f,++h}f=Math.max(0,f),h=Math.min(v-f,h),(0<a&&1<h||x)&&(s=(h-1)*M+R,L._isObserverEnabled()&&S||e.cssInlineSize===s||(e.shouldReupdate=!0),e.cssInlineSize=s),0<z&&(c=e.computedInlineSize/z,e.cssContentSize=c);var u=C[f],d=O?d:d-_-c,m=(e.cssInlinePos=u,e.cssContentPos=d,O?d+c+_:d);N(h).forEach(function(e){T[f+e]=m})}),L=this,a=0;a<I;++a)s(a);return w&&D!==Math.min.apply(Math,T)&&(D=Math.max.apply(Math,T),T=T.map(function(){return D})),{start:O?e:T,end:O?T:e}},n.getComputedOutlineSize=function(e){void 0===e&&(e=this.items);var t=this.options.align,n=this.getInlineGap(),i=this.getContainerInlineSize(),r=this.columnSize||this.outlineSize,o=this.column||this.outlineLength,s=o||1,a=0;if("stretch"===t)o||(t=this.maxStretchColumnSize||1/0,s=Math.max(1,Math.ceil((i+n)/(t+n)))),a=(i+n)/(s||1)-n;else if(r)a=r;else if(e.length){for(var u=e[0],c=0,h=e;c<h.length;c++){var l=h[c],f=l.attributes,d=parseInt(f.column||"1",10),f=parseInt(f.maxColumn||"1",10);if(l.updateState===g.UPDATED&&l.inlineSize&&1===d&&1===f){u=l;break}}a=u.inlineSize||0}else a=i;return a||0},n.getComputedOutlineLength=function(e){void 0===e&&(e=this.items);var t=this.getInlineGap(),n=this.column||this.outlineLength,i=this.columnCalculationThreshold;return n||(n=this.getComputedOutlineSize(e),Math.min(e.length,Math.max(1,Math.floor((this.getContainerInlineSize()+t)/(n-i+t)))))},n._getAlignPoses=function(e,t){var n,i=this.options.align,r=this.getInlineGap(),o=this.getContainerInlineSize(),s=N(e),a=0,u=0;return"justify"===i||"stretch"===i?(u=(n=e-1)?Math.max((o-t)/n,t+r):0,a=Math.min(0,o/2-(n*u+t)/2)):(n=(e-1)*(u=t+r)+t,"center"===i?a=(o-n)/2:"end"===i&&(a=o-n)),s.map(function(e){return a+e*u})},t.propertyTypes=p(p({},z.propertyTypes),{column:d.RENDER_PROPERTY,columnSize:d.RENDER_PROPERTY,columnSizeRatio:d.RENDER_PROPERTY,align:d.RENDER_PROPERTY,columnCalculationThreshold:d.RENDER_PROPERTY,maxStretchColumnSize:d.RENDER_PROPERTY,contentAlign:d.RENDER_PROPERTY}),t.defaultOptions=p(p({},z.defaultOptions),{align:"justify",column:0,columnSize:0,columnSizeRatio:0,columnCalculationThreshold:.5,maxStretchColumnSize:1/0,contentAlign:"masonry"}),l([S],t)}(z);function xe(e,t,n){for(var i=function(e,t,n){var i,r,o,s,a,u,c={},h={},l=(h[t]=0,new we(function(e){return e.cost}));for(l.push({value:t,cost:0});l.size();)for(var f in r=(i=l.pop()).value,o=i.cost,s=e(r)||{})a=o+s[f],(void 0===(u=h[f])||a<u)&&(l.push({value:f,cost:h[f]=a}),c[f]=r);if(void 0===h[n])throw t=["Could not find a path from ",t," to ",n,"."].join(""),new Error(t);return c}(e,t,n),r=[],o=n;o;)r.push(o),o=i[o];return r.reverse(),r}var we=function(){function e(e){this.content=[],this.scoreFunction=e}var t=e.prototype;return t.push=function(e){this.content.push(e),this.bubbleUp(this.content.length-1)},t.pop=function(){var e=this.content[0],t=this.content.pop();return 0<this.content.length&&(this.content[0]=t,this.sinkDown(0)),e},t.size=function(){return this.content.length},t.bubbleUp=function(e){for(var t=e,n=this.content[t];0<t;){var i=Math.floor((t+1)/2)-1,r=this.content[i];if(!(this.scoreFunction(n)<this.scoreFunction(r)))break;this.content[i]=n,this.content[t]=r,t=i}},t.sinkDown=function(e){for(var t=this.content.length,n=this.content[e],i=this.scoreFunction(n);;){var r,o=2*(e+1),s=o-1,a=null;if(s<t&&(r=this.content[s],(r=this.scoreFunction(r))<i)&&(a=s),null===(a=o<t&&(s=this.content[o],this.scoreFunction(s)<(null==a?i:r))?o:a))break;this.content[e]=this.content[a],this.content[a]=n,e=a}},e}();function De(e,t){var n,i;return ze(t)?t:(n="+"===(n=t.charAt(0))?1:"-"===n?-1:0,i=parseFloat(t),t.match(/%$/g)&&(i*=e/100),n?e+i:i)}function Le(e,t){var n=e.orgInlineSize,i=e.orgContentSize,r=e.gridData.inlineOffset||0,e=e.gridData.contentOffset||0;return n&&i?(i<=e?1:(n-r)/(i-e))*(t-e)+r:t}var Ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var s=this,i=this.options,a=i.attributePrefix,u=i.horizontal,i=(e.forEach(function(e){var t,n,i,r,o;e.isUpdating&&(r=e.element,i=e.attributes,t=e.gridData,n=parseFloat(i.inlineOffset),o=parseFloat(i.contentOffset),isNaN(n)&&(n=s.inlineOffset||t.inlineOffset||0),isNaN(o)&&(o=s.contentOffset||0|t.contentOffset),!r||"inlineOffset"in i||"contentOffset"in i||e.mountState!==O.MOUNTED||(i=r.querySelector("["+a+"maintained-target]"))&&(e=r.offsetWidth-r.clientWidth+r.scrollWidth-i.clientWidth,r=r.offsetHeight-r.clientHeight+r.scrollHeight-i.clientHeight,o=u?(n=r,e):(n=e,r)),t.inlineOffset=n,t.contentOffset=o)}),this.options.rowRange),r=[],o="end"===t;return e.length&&(r=i?this._getRowPath(e,o):this._getPath(e,o)),this._setStyle(e,r,n,"end"===t)},n._getRowPath=function(e,t){var n=this._getColumnRange(),i=this._getRowRange(),e=this._getRowLink(e,{path:[0],cost:0,length:0,currentNode:0},n,i,t);return null!=(n=null==e?void 0:e.path.map(function(e){return""+e}))?n:[]},n._getRowLink=function(e,t,n,i,r){var o=n[0],s=i[0],a=i[1],u=e.length,c=t.path,h=t.length,l=t.cost,f=t.currentNode;return f<u&&(a<=h||u<f+o)?(o=Ee(u-f,n)*Math.abs(this._getCost(e,f,u,r)),p(p({},t),{length:h+1,path:m(m([],c),[u]),currentNode:u,cost:l+o,isOver:!0})):u<=f?p(p({},t),{currentNode:u,isOver:h<s||a<h}):this._searchRowLink(e,t,u,n,i,r)},n._searchRowLink=function(e,t,n,i,r,o){for(var s,a=i[0],u=i[1],c=t.currentNode,h=t.path,l=t.length,f=t.cost,d=Math.min(n,c+u),p=[],g=c+a;g<=d;++g)g!==c&&(s=Math.abs(this._getCost(e,c,g,o)),s=this._getRowLink(e,{path:m(m([],h),[g]),length:l+1,cost:f+s,currentNode:g},i,r,o))&&p.push(s);return p.sort(function(e,t){var n=e.isOver;return n!==t.isOver?n?1:-1:Ee(e.length,r)-Ee(t.length,r)||e.cost-t.cost}),p[0]},n._getExpectedRowSize=function(i,e){var t=this.getContainerInlineSize()-this.getInlineGap()*(i.length-1),r=t,o=0,s=0;if(i.forEach(function(e){var t,n=e.orgInlineSize,i=e.orgContentSize;n&&i?(t=e.gridData.inlineOffset||0,e=e.gridData.contentOffset||0,o+=n=i<=e?1:(n-t)/(i-e),s+=e*n,r-=t):o+=1}),o){var n=(r+s)/o;if(this.stretch){var a=this._getSizeRange(),u=_e(n,a[0],a[1]);if(e)return u;var c=this.stretchRange,a=i.map(function(e){return Le(e,u)}),e=a.reduce(function(e,t,n){return e+De(t,i[n].attributes.minStretch||c[0])},0),a=a.reduce(function(e,t,n){return e+De(t,i[n].attributes.maxStretch||c[1])},0);if(e<=t&&t<=a)return u}return n}return 0},n._getExpectedInlineSizes=function(e,o){var t=this.options,s=t.stretch,a=t.stretchRange;return e.map(function(e){var t=s?De(e.orgInlineSize,e.attributes.minStretch||a[0]):-1/0,n=s?De(e.orgInlineSize,e.attributes.maxStretch||a[1]):1/0,e=Le(e,o),i=!1,r=!1;return n<=e?i=!0:e<=t&&(r=!0),{minSize:t,maxSize:n,size:_e(e,t,n),originalSize:e,isMax:i,isMin:r}})},n._getStretchItemInfos=function(e,t){var n=e.length,i=this.getContainerInlineSize()-this.getInlineGap()*(Math.max(1,n)-1),n=this._getExpectedInlineSizes(e,t),e=v(n.map(function(e){return e.size})),t=i-e,r=i/v(n.map(function(e){return e.originalSize})),o=n.map(function(e){return p(p({},e),{passed:!1,size:e.originalSize*r})});if(0==t)return{infos:o,cost:0};for(var s=0<t,a=o.length,u=0;u<a&&"break"!==function(){var e=v(o.map(function(e){return e.passed?e.size:0})),t=v(o.map(function(e){return e.passed?0:e.originalSize})),n=(i-e)/t;if(o.forEach(function(e){e.passed||(s?e.size>e.maxSize&&(n=Math.min(n,e.maxSize/e.originalSize)):e.size<e.minSize&&(n=Math.max(n,e.minSize/e.originalSize)))}),o.forEach(function(e){!e.passed&&(e.size=_e(e.originalSize*n,e.minSize,e.maxSize),s&&!Ie(e.size-e.maxSize,.001)||!s&&!Ie(e.size-e.minSize,.001))&&(e.passed=!0)}),o.every(function(e){return e.passed}))return"break"}();++u);var c=i/v(o.map(function(e){return e.size}));return Ie(c-1,.001)&&o.forEach(function(e){e.size*=c}),{infos:o,cost:v(o.map(function(e){var t=1,n=((e.size>e.maxSize||e.size<e.minSize)&&(t=2),e.originalSize),n=s?Math.max(n,e.minSize):Math.min(n,e.maxSize);return Math.abs(e.size-n)*t}))}},n._getExpectedInlineSize=function(e,t){var n=this.getInlineGap(),t=this._getExpectedInlineSizes(e,t);return t.length?v(t.map(function(e){return e.size}))+n*(e.length-1):0},n._getCost=function(e,t,n,i){var r=e.slice(t,n),o=this.getContainerInlineSize(),s=this._getExpectedRowSize(r),a=this._getSizeRange(),u=a[0],a=a[1];if(this.isCroppedSize)return u<=s&&s<=a?0:(h=this._getExpectedInlineSize(r,s<u?u:a),Math.pow(h-o,2));var c,h,l=0;if(this.stretch)return s<u?s=u:a<s&&(s=a),c=Math.abs(s-u),h=this._getExpectedInlineSize(r,s),(l=!this.passUnstretchRow||(i?n!==e.length:0!==t)||o<=h?this._getStretchItemInfos(r,s).cost:l)+c;if(isFinite(a)){if(s<u)return Math.pow(s-u,2)+Math.pow(a,2)+l;if(a<s)return Math.pow(s-a,2)+Math.pow(a,2)+l}else if(s<u)return Math.max(Math.pow(u,2),Math.pow(s,2))+Math.pow(a,2)+l;return s-u+l},n._getPath=function(o,s){var a=this,u=o.length,e=this.options.columnRange,e=Se(e)?e:[e,e],c=e[0],h=e[1];return xe(function(e){for(var t={},n=parseInt(e,10),i=Math.min(n+c,u);i<=u&&!(h<i-n);++i){var r=a._getCost(o,n,i,s);r<0&&i===u&&(r=0),t[""+i]=Math.pow(r,2)}return t},"0",""+u)},n._setStyle=function(e,t,n,l){var f,d,i,p=this,r=(void 0===n&&(n=[]),this.options),g=r.isCroppedSize,m=r.displayedRow,y=r.stretch,R=r.passUnstretchRow,v=e.length,S=this._getSizeRange(),r=n[0]||0,z=this.getContainerInlineSize(),E=this.getInlineGap(),_=this.getContentGap(),n=function(e,t){for(var n=t.length,i=[],r=0;r<n-1;++r){var o=parseInt(t[r],10),s=parseInt(t[r+1],10);i.push(e.slice(o,s))}return i}(e,t),I=n.length,C=r,O=0;return n.forEach(function(o,e){var n,i,r=o.length,s=p._getExpectedRowSize(o,!0),t=(g&&(s=Math.max(S[0],Math.min(s,S[1]))),E*(length-1)),a=o.map(function(e,t){var n=Le(e,s);return{index:t,item:e,inlineSize:n,orgInlineSize:n,maxInlineSize:n,minInlineSize:n}}),u=p._getExpectedInlineSize(o,s),c=(z-t)/(u-t),h=u-t,t=z-t;y&&u&&t!=h&&(R&&h<t&&(l?e===I-1:0===e)?(d=[C],f=o.map(function(e,t){return v-r+t}),n=p._getExpectedInlineSizes(o,s),a.forEach(function(e,t){e.minInlineSize=n[t].minSize,e.maxInlineSize=n[t].maxSize,e.inlineSize=_e(e.inlineSize,e.minInlineSize,e.maxInlineSize)})):(i=p._getStretchItemInfos(o,s).infos,a.forEach(function(e,t){e.inlineSize=i[t].size,e.minInlineSize=i[t].minSize,e.maxInlineSize=i[t].maxSize}))),a.forEach(function(e,t){var n=e.item,i=e.inlineSize,t=o[t-1],t=t?t.cssInlinePos+t.cssInlineSize+E:0,r=(g&&(i*=c),n.gridData);r.orgInlineSize=e.orgInlineSize,r.orgContentSize=s,r.minInlineSize=e.minInlineSize,r.maxInlineSize=e.maxInlineSize,n.setCSSGridRect({inlinePos:t,contentPos:C,inlineSize:i,contentSize:s})}),C+=_+s,(m<0||e<m)&&(O=C)}),l?{start:[r],end:[O],passedItems:f,passed:d}:(i=C-r,e.forEach(function(e){e.cssContentPos-=i}),{passedItems:f,passed:d?[d[0]-i]:null,start:[r-i],end:[r]})},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getRowRange=function(){var e=this.rowRange;return Se(e)?e:[e,e]},n._getColumnRange=function(){var e=this.columnRange;return Se(e)?e:[e,e]},n._getSizeRange=function(){var e=this.sizeRange;return Se(e)?e:[e,e]},t.propertyTypes=p(p({},z.propertyTypes),{columnRange:d.RENDER_PROPERTY,rowRange:d.RENDER_PROPERTY,sizeRange:d.RENDER_PROPERTY,isCroppedSize:d.RENDER_PROPERTY,displayedRow:d.RENDER_PROPERTY,stretch:d.RENDER_PROPERTY,stretchRange:d.RENDER_PROPERTY,passUnstretchRow:d.RENDER_PROPERTY,inlineMargin:d.RENDER_PROPERTY,contentMargin:d.RENDER_PROPERTY,inlineOffset:d.RENDER_PROPERTY,contentOffset:d.RENDER_PROPERTY}),t.defaultOptions=p(p({},z.defaultOptions),{columnRange:[1,8],rowRange:0,sizeRange:[0,1/0],displayedRow:-1,isCroppedSize:!1,stretch:!1,passUnstretchRow:!0,stretchRange:["-20%","+20%"],inlineOffset:0,contentOffset:0}),l([S],t)}(z);function Ge(e){var t=-1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.max(t,e))}),isFinite(t)?t:0}function ke(e,t,n){return Ge(e)+function(e,t,n){var i=e.length;if(!i)return 0;var r=function(e){var t=1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.min(t,e))}),isFinite(t)?t:0}(t),o=Ge(e),s=0;if(!n)return 0;for(var a=0;a<i;++a){var u=e[a],c=t[a];isFinite(u)&&isFinite(c)&&(u=u-o,c=c-r,s=a?Math.max(s,s+u-c):u-c)}return s}(e,t,n)}function Ae(e,t,n){for(var i=n.inlinePos,r=n.inlineSize,o=n.contentPos,s=n.contentSize,a=i;a<i+r;++a)e[a]=Math.min(e[a],o),t[a]=Math.max(t[a],o+s)}var Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var i=this._getFrame(),r=i.inlineSize,o=i.contentSize,s=i.rects,a=this.options.useFrameFill,u=this.getRectSize(r),c=u.inlineSize,h=u.contentSize,l=this.getInlineGap(),f=this.getContentGap(),d=e.length;if(!d||!r||!o)return{start:n,end:n};for(var p=s.length,g=N(r).map(function(){return 1/0}),m=N(r).map(function(){return-1/0}),y=i.outline.map(function(e){return e*(h+f)}),R=0;R<d;R+=p)for(var v=ke(m,y,a),S=0;S<p&&R+S<d;++S){var z=e[R+S],E=s[S],_=E.contentPos,I=E.inlinePos,C=E.contentSize,E=E.inlineSize,_=v+_*(h+f),O=I*(c+l),C=C*(h+f)-f,P=E*(c+l)-l;Ae(g,m,{inlinePos:I,inlineSize:E,contentPos:_,contentSize:C+f}),z.setCSSGridRect({inlinePos:O,contentPos:_,inlineSize:P,contentSize:C})}var b,u="end"===t,o=n.length?n:[0],T=(o.length!==r&&(b=(u?Math.max:Math.min).apply(Math,o),o=N(r).map(function(){return b})),g=g.map(function(e){return isFinite(e)?e:0}),m=m.map(function(e){return isFinite(e)?e:0}),u?ke(o,g,a):ke(m,o,a));return e.forEach(function(e){e.cssContentPos+=T}),{start:g.map(function(e){return e+T}),end:m.map(function(e){return e+T})}},n.getComputedOutlineLength=function(){var e=this.options.frame;return e.length?e[0].length:0},n.getComputedOutlineSize=function(){var e,t=this.options.rectSize;return"object"==typeof t?t.inlineSize:(e=this.getInlineGap(),t||(this.getContainerInlineSize()+e)/this.getComputedOutlineLength()-e)},n.getRectSize=function(e){var t,n=this.options.rectSize;return"object"==typeof n?n:(t=this.getInlineGap(),{inlineSize:n=n||(this.getContainerInlineSize()+t)/e-t,contentSize:n})},n._getFrame=function(){for(var e=this.options.frame,t=e.length,n=t?e[0].length:0,i=[],r={},o=N(n).map(function(){return 1/0}),s=N(n).map(function(){return-1/0}),a=0;a<t;++a)for(var u=0;u<n;++u){var c=e[a][u];!c||r[a+","+u]||(Ae(o,s,c=this._findRect(r,c,a,u,n,t)),i.push(c))}return i.sort(function(e,t){return e.type<t.type?-1:1}),{rects:i,inlineSize:n,contentSize:t,outline:o}},n._findRect=function(e,t,n,i,r,o){for(var s=this.options.frame,a=1,u=1,c=i;c<r&&s[n][c]===t;++c)u=c-i+1;for(var h=n;h<o&&s[h][i]===t;++h)a=h-n+1;for(var l=n;l<n+a;++l)for(var f=i;f<i+u;++f)e[l+","+f]=!0;return{type:t,inlinePos:i,contentPos:n,inlineSize:u,contentSize:a}},t.propertyTypes=p(p({},z.propertyTypes),{frame:d.RENDER_PROPERTY,useFrameFill:d.RENDER_PROPERTY,rectSize:d.RENDER_PROPERTY}),t.defaultOptions=p(p({},z.defaultOptions),{frame:[],rectSize:0,useFrameFill:!0}),l([S],t)}(z),Ve=function(){function e(e){var t,n=p({orgInlineSize:0,orgContentSize:0,inlineSize:0,contentSize:0,inlinePos:0,contentPos:0,items:[]},e);for(t in n)this[t]=n[t]}var t=e.prototype;return t.scaleTo=function(e,t){var n=this.inlineSize?e/this.inlineSize:0,i=this.contentSize?t/this.contentSize:0;this.items.forEach(function(e){0!=n&&(e.inlinePos*=n,e.inlineSize*=n),0!=i&&(e.contentPos*=i,e.contentSize*=i)}),this.inlineSize=e,this.contentSize=t},t.push=function(e){this.items.push(e)},t.getOrgSizeWeight=function(){return this.orgInlineSize*this.orgContentSize},t.getSize=function(){return this.inlineSize*this.contentSize},t.getOrgRatio=function(){return 0===this.orgContentSize?0:this.orgInlineSize/this.orgContentSize},t.getRatio=function(){return 0===this.contentSize?0:this.inlineSize/this.contentSize},e}();function E(e,t){e/=t;return(e=e<1?1/e:e)-1}var P,b,_,Ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var i=this,r=this.options.aspectRatio,o=this.getContainerInlineSize(),s=o/r,a=this.getInlineGap(),u=this.getContentGap(),r=n.length?n:[0],c="end"===t?Math.max.apply(Math,r):Math.min.apply(Math,r)-s-u,n=c+s+u,h=new Ve({});return e.forEach(function(e){e=new Ve({inlineSize:e.orgInlineSize,contentSize:e.orgContentSize,orgInlineSize:e.orgInlineSize,orgContentSize:e.orgContentSize});i._findBestFitArea(h,e),h.push(e),h.scaleTo(o+a,s+u)}),e.forEach(function(e,t){var t=h.items[t],n=t.inlineSize-a,i=t.contentSize-u,r=c+t.contentPos,t=t.inlinePos;e.setCSSGridRect({inlinePos:t,contentPos:r,inlineSize:n,contentSize:i})}),{start:[c],end:[n]}},n._findBestFitArea=function(e,p){var g,m,y,R,v,S,z,t,n,i,r;0===e.getRatio()?(e.orgInlineSize=p.inlineSize,e.orgContentSize=p.contentSize,e.inlineSize=p.inlineSize,e.contentSize=p.contentSize):(m=1/0,y=!1,R={inlineSize:0,contentSize:0},v={inlineSize:0,contentSize:0},S=this._getWeight("size"),z=this._getWeight("ratio"),e.items.forEach(function(e){for(var t=E(e.getOrgSizeWeight(),e.getSize())*S,n=E(e.getOrgRatio(),e.getRatio())*z,i=e.inlineSize,r=e.contentSize,o=0;o<2;++o){var s=void 0,a=void 0,u=void 0,c=void 0,h=(0===o?(u=s=i,c=r-(a=r*(p.contentSize/(e.orgContentSize+p.contentSize)))):(c=a=r,u=i-(s=i*(p.inlineSize/(e.orgInlineSize+p.inlineSize)))),s*a),l=s/a,f=u*c,d=c/c,h=E(p.getSize(),h)*S;(h=(h=(h+=E(p.getRatio(),l)*z)+(E(e.getOrgSizeWeight(),f)*S-t))+(E(e.getOrgRatio(),d)*z-n))===Math.min(h,m)&&(m=h,g=e,y=0===o,R.inlineSize=s,R.contentSize=a,v.inlineSize=u,v.contentSize=c)}}),e=g,n=R,i=v,r=y,(t=p).contentSize=n.contentSize,t.inlineSize=n.inlineSize,e.contentSize=i.contentSize,e.inlineSize=i.inlineSize,r?(t.contentPos=e.contentPos+e.contentSize,t.inlinePos=e.inlinePos):(t.inlinePos=e.inlinePos+e.inlineSize,t.contentPos=e.contentPos))},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getWeight=function(e){var t=this.options,n=t.weightPriority;return n===e?100:"custom"===n?t[e+"Weight"]:1},t.propertyTypes=p(p({},z.propertyTypes),{aspectRatio:d.RENDER_PROPERTY,sizeWeight:d.RENDER_PROPERTY,ratioWeight:d.RENDER_PROPERTY,weightPriority:d.RENDER_PROPERTY}),t.defaultOptions=p(p({},z.defaultOptions),{aspectRatio:1,sizeWeight:1,ratioWeight:1,weightPriority:"custom"}),l([S],t)}(z),e="undefined"!=typeof window?window.navigator.userAgent:"",je=/iPhone|iPad/.test(e),Fe="infinitegrid-container",qe={renderOnPropertyChange:!0,useFit:!0,autoResize:!0},Ye=I({},ge),T={START:"start",END:"end",NONE:""},M={CHANGE_SCROLL:"changeScroll",REQUEST_APPEND:"requestAppend",REQUEST_PREPEND:"requestPrepend",RENDER_COMPLETE:"renderComplete",CONTENT_ERROR:"contentError"},Be={type:!0,groupKey:!0,key:!0,element:!0,html:!0,data:!0,inserted:!0,attributes:!0},t=["insertByGroupIndex","updateItems","getItems","getVisibleItems","getGroups","getVisibleGroups","renderItems","getContainerElement","getScrollContainerElement","getWrapperElement","setStatus","getStatus","removePlaceholders","prependPlaceholders","appendPlaceholders","getStartCursor","getEndCursor","setCursors"],We=((e=P=P||{})[e.NORMAL=0]="NORMAL",e[e.VIRTUAL=1]="VIRTUAL",e[e.LOADING=2]="LOADING",(e=b=b||{})[e.NORMAL=0]="NORMAL",e[e.VIRTUAL=1]="VIRTUAL",e[e.LOADING=2]="LOADING",(e=_=_||{})[e.NOT_REMOVE=0]="NOT_REMOVE",e[e.MINIMIZE_INVISIBLE_ITEMS=1]="MINIMIZE_INVISIBLE_ITEMS",e[e.MINIMIZE_INVISIBLE_GROUPS=2]="MINIMIZE_INVISIBLE_GROUPS",e[e.REMOVE_INVISIBLE_GROUPS=3]="REMOVE_INVISIBLE_GROUPS",-9999),x=function(r){function e(e,t){var n,i,e=r.call(this,e,I({html:"",type:b.NORMAL,cssRect:{top:We,left:We}},t))||this;return e.type===b.VIRTUAL&&((e.rect.width||e.rect.height)&&(e.mountState=O.UNMOUNTED),t=e.orgRect,n=e.rect,(i=e.cssRect).width?n.width=i.width:t.width&&(n.width=t.width),i.height?n.height=i.height:t.height&&(n.height=t.height)),e}o(e,r);var t=e.prototype;return t.getVirtualStatus=function(){return{type:b.VIRTUAL,groupKey:this.groupKey,key:this.key,orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,attributes:this.attributes}},t.getMinimizedStatus=function(){var e=I(I({},r.prototype.getMinimizedStatus.call(this)),{type:b.NORMAL,groupKey:this.groupKey});return this.html&&(e.html=this.html),e},e}(be),He=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="",e.isWaitEnd=!1,e.initialDisplay=null,e}o(e,t);var n=e.prototype;return n.getLoadingItem=function(){return this.items[0]||null},n.startLoading=function(){var e=this.items[0].element;e&&(null!=this.initialDisplay?this.initialDisplay=e.style.display||"":this.initialDisplay?e.style.display=this.initialDisplay:e.style.removeProperty("display"))},n.endLoading=function(){var e;this.type&&(e=this.items[0].element)&&(e.style.display="none")},n.setLoadingItem=function(e){if(e){var t=this.getLoadingItem();if(t)for(var n in e)t[n]=e[n];else this.items=[new x(this.options.horizontal,I(I({},e),{type:b.LOADING,key:"__INFINITEGRID__LOADING_ITEM"}))]}else this.items=[]},n.applyGrid=function(e,t,n){var i,r;return e.length?(i=n.length?f([],n,!0):[0],e=e[0],r=e.contentSize+this.getContentGap(),e.cssInlinePos=this.getContainerInlineSize()/2-e.inlineSize/2,"end"===t?(t=Math.max.apply(Math,i),e.cssContentPos=t,{start:i,end:i.map(function(e){return e+r})}):(t=Math.min.apply(Math,i),e.cssContentPos=t-r,{start:i.map(function(e){return e-r}),end:i})):{start:n,end:n}},e}(z);function Ze(e){var t;return e?("string"==typeof e?t=document.querySelector(e):e instanceof Element?t=e:("value"in e||"current"in e)&&(t=e.value||e.current),t):null}function Xe(e){return e===window}function Qe(e){return"number"==typeof e}function Je(e){return"string"==typeof e}function $e(e){return e.reduce(function(e,t){return f(f([],e,!0),t,!0)},[])}function et(e){var t,n={},i={},r=z.defaultOptions;for(t in e){var o=e[t];t in qe||(i[t]=o),t in r&&(n[t]=o)}return I(I({},n),{gridOptions:i})}function tt(i){var r,o=[],s={},a={},u=(i.filter(function(e){return null!=e.groupKey}).forEach(function(e){e=e.groupKey;a[e]=!0}),!1);return i.forEach(function(e,t){null!=e.groupKey?u=!1:!e.inserted&&i[t-1]?(e.groupKey=i[t-1].groupKey,u=!1):(u||(r=rt(a),u=!0,a[r]=!0),e.groupKey=r);var t=e.groupKey,n=s[t];n||(s[t]=n={groupKey:t,items:[]},o.push(n)),n.items.push(e)}),o}function nt(e,t,n,i){var e=Y(e,t,function(e){return e}),r=-1,o=-1;return e.maintained.forEach(function(e){var t=e[0],e=e[1];n<=t&&t<=i&&(o=-1===r?r=e:(r=Math.min(r,e),Math.max(o,e)))}),{startCursor:r,endCursor:o}}function it(e,t,n){var i,r=[];if("start"===t){if(-1===(i=D(e,function(e){return e.type===P.NORMAL})))return[];t=D(e,function(t){return 0<=D(n,function(e){return e.groupKey===t.groupKey})}),t=0<=t?Math.min(i,t):i,r=e.slice(0,t)}else{if(-1===(i=ut(e,function(e){return e.type===P.NORMAL})))return[];t=ut(e,function(t){return 0<=D(n,function(e){return e.groupKey===t.groupKey})}),t=0<=t?Math.max(i,t):i;r=e.slice(t+1)}return r}function w(e){var t,i=e.prototype;for(t in e.propertyTypes)!function(n){Object.defineProperty(i,n,{enumerable:!0,configurable:!0,get:function(){var e=this.groupManager.options;return(n in e?e:e.gridOptions)[n]},set:function(e){var t;this.groupManager[n]!==e&&(this.groupManager.gridOptions=((t={})[n]=e,t))}})}(t)}function rt(e,t){void 0===t&&(t="");for(var n=0;;){var i="infinitegrid_".concat(t).concat(n++);if(!(i in e))return i}}function ot(e){var t=document.createElement("div");return t.innerHTML=e,at(t.children)}function st(e,i){e=Je(e)?ot(e):e;return e.map(function(e){var t,n="";if(Je(e))n=e;else{if(!("parentNode"in e))return I({groupKey:i,inserted:!0},e);n=(t=e).outerHTML}return{key:void 0,groupKey:i,html:n,element:t,inserted:!0}})}function at(e){var t=[];if(e)for(var n=e.length,i=0;i<n;i++)t.push(e[i]);return t}function D(e,t){for(var n=e.length,i=0;i<n;++i)if(t(e[i],i))return i;return-1}function ut(e,t){for(var n=e.length-1;0<=n;--n)if(t(e[n],n))return n;return-1}function ct(e,n){return e.length===n.length&&e.every(function(e,t){return n[t]===e})}function ht(e){return $e(e.map(function(e){return e.grid.getItems()}))}function lt(e,t){return t?f([],e,!0):e.filter(function(e){return e.type!==b.VIRTUAL})}function ft(e,r){dt.forEach(function(i){i in e||(e[i]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(n=this[r])[i].apply(n,e);return n===this[r]?this:n})})}dt=t;var dt,pt,gt=function(r){function e(e,t){var n,i,t=r.call(this,e,(i=(n=t).gridOptions,n=k(t,["gridOptions"]),I(I({},et(i)),n)))||this;return t.groupItems=[],t.groups=[],t.itemKeys={},t.groupKeys={},t.startCursor=0,t.endCursor=0,t._placeholder=null,t._loadingGrid=new He(e,{externalContainerManager:t.containerManager,useFit:!1,autoResize:!1,renderOnPropertyChange:!1,gap:t.gap}),t._mainGrid=t._makeGrid(),t}o(e,r);var t=e.prototype;return Object.defineProperty(t,"gridOptions",{set:function(n){var e,t=et(n),i=t.gridOptions,r=k(t,["gridOptions"]),t=this._checkShouldRender(n);for(e in this.options.gridOptions=I(I({},this.options.gridOptions),i),f([this._mainGrid],this.groups.map(function(e){return e.grid}),!0).forEach(function(e){for(var t in n)e[t]=n[t]}),r)this[e]=r[e];this._loadingGrid.gap=this.gap,t&&this.scheduleRender()},enumerable:!1,configurable:!0}),t.getItemByKey=function(e){return this.itemKeys[e]||null},t.getGroupItems=function(e){return lt(this.groupItems,e)},t.getVisibleItems=function(e){return lt(this.items,e)},t.getRenderingItems=function(){return this.hasPlaceholder()?this.items:this.items.filter(function(e){return e.type!==b.VIRTUAL})},t.getGroups=function(e){return lt(this.groups,e)},t.hasVisibleVirtualGroups=function(){return this.getVisibleGroups(!0).some(function(e){return e.type===P.VIRTUAL})},t.hasPlaceholder=function(){return!!this._placeholder},t.hasLoadingItem=function(){return!!this._getLoadingItem()},t.updateItems=function(e,t){return void 0===e&&(e=this.groupItems),r.prototype.updateItems.call(this,e,t)},t.setPlaceholder=function(e){this._placeholder=e,this._updatePlaceholder()},t.getLoadingType=function(){return this._loadingGrid.type},t.startLoading=function(e){return this._loadingGrid.type=e,this.items=this._getRenderingItems(),!0},t.waitEndLoading=function(){return!!this._loadingGrid.type&&(this._loadingGrid.isWaitEnd=!0)},t.endLoading=function(){var e;return!!this._loadingGrid.isWaitEnd&&(e=this._loadingGrid.type,this._loadingGrid.type="",this._loadingGrid.endLoading(),this.items=this._getRenderingItems(),!!e)},t.setLoading=function(e){this._loadingGrid.setLoadingItem(e),this.items=this._getRenderingItems()},t.getVisibleGroups=function(e){return lt(this.groups.slice(this.startCursor,this.endCursor+1),e)},t.getComputedOutlineLength=function(e){return void 0===e&&(e=this.items),this._mainGrid.getComputedOutlineLength(e)},t.getComputedOutlineSize=function(e){return void 0===e&&(e=this.items),this._mainGrid.getComputedOutlineSize(e)},t.applyGrid=function(e,i,t){var n,r,o,s,a,u,c,h=this,l=this.groups.slice();return l.length?((n=this._loadingGrid).getLoadingItem()&&("start"===n.type?l.unshift(this._getLoadingGroup()):"end"===n.type&&l.push(this._getLoadingGroup())),n=l.slice(),r=t,"start"===i&&n.reverse(),o=this.options.appliedItemChecker,t=this.groupItems,s=this.getComputedOutlineLength(t),a=this.getComputedOutlineSize(t),u=this.itemRenderer,c=[],n.forEach(function(e){var t=e.grid,n=t.getItems(),e=e.type===P.VIRTUAL&&!n[0],n=(c="end"===i?f(f([],c,!0),n,!0):f(f([],n,!0),c,!0),t.outlineLength=s,t.outlineSize=a,c.filter(function(e){return e.mountState!==O.UNCHECKED&&e.rect.width||u.updateItem(e,!0),e.orgRect.width&&e.rect.width||o(e,t)})),e=e?h._applyVirtualGrid(t,i,r):n.length?t.applyGrid(n,i,r):{start:f([],r,!0),end:f([],r,!0)};t.setOutlines(e),r=e.passed||e[i],c=null!=(e=null==(n=e.passedItems)?void 0:n.map(function(e){return c[e]}))?e:[]}),{start:l[0].grid.getOutlines().start,end:l[l.length-1].grid.getOutlines().end}):{start:[],end:[]}},t.syncItems=function(e){var o=this,t=this.itemKeys,e=(this.itemKeys={},this._syncItemInfos(e.map(function(e){var t,n=e,i={};for(t in n)t in Be&&(i[t]=n[t]);return i}),t)),s=this.groupKeys,t=tt(e),e=this._splitVirtualGroups("start",t),n=this._splitVirtualGroups("end",t),e=(t=f(f(f([],e,!0),this._mergeVirtualGroups(t),!0),n,!0)).map(function(e){var t=e.groupKey,e=e.items,n=!e[0]||e[0].type===b.VIRTUAL,i=null!=(i=null==(i=s[t])?void 0:i.grid)?i:o._makeGrid(),r=n?e:e.filter(function(e){return e.type===b.NORMAL});return i.setItems(r),{type:n?P.VIRTUAL:P.NORMAL,groupKey:t,grid:i,items:r,renderItems:e}});this._registerGroups(e)},t.renderItems=function(e){var t;return(e=void 0===e?{}:e).useResize&&(this.groupItems.forEach(function(e){e.updateState=g.NEED_UPDATE}),t=this._getLoadingItem())&&(t.updateState=g.NEED_UPDATE),r.prototype.renderItems.call(this,e)},t.setCursors=function(e,t){this.startCursor=e,this.endCursor=t,this.items=this._getRenderingItems()},t.getStartCursor=function(){return this.startCursor},t.getEndCursor=function(){return this.endCursor},t.getGroupStatus=function(e,t){var n,i=this.startCursor,r=this.endCursor,o=this.groups,s=o[i],a=o[r],u=i,c=r,h=e===_.MINIMIZE_INVISIBLE_ITEMS,l=e===_.MINIMIZE_INVISIBLE_GROUPS;if(e===_.REMOVE_INVISIBLE_GROUPS)n=this.getVisibleGroups(t),c=n.length-1,u=0;else if(n=this.getGroups(t),!t){for(var u=-1,c=-1,f=i;f<=r;++f)if((d=o[f])&&d.type!==P.VIRTUAL){u=n.indexOf(d);break}for(var d,f=r;i<=f;--f)if((d=o[f])&&d.type!==P.VIRTUAL){c=n.lastIndexOf(d);break}}var e=n.map(function(e,t){var n=e.grid,e=e.groupKey,t=t<u||c<t,i=h&&t,t=l&&t,r=n.getItems(),r=t?[]:r.map(function(e){return i?e.getVirtualStatus():e.getMinimizedStatus()});return{type:t||i?P.VIRTUAL:P.NORMAL,groupKey:e,outlines:n.getOutlines(),items:r}}),t=this.getGroupItems(),p=t.indexOf(null==s?void 0:s.items[0]),t=t.indexOf(null==a?void 0:a.items.slice().reverse()[0]);return{cursors:[u,c],orgCursors:[i,r],itemCursors:[p,t],startGroupKey:null==s?void 0:s.groupKey,endGroupKey:null==a?void 0:a.groupKey,groups:e,outlines:this.outlines}},t.fitOutlines=function(e){void 0===e&&(e=this.useFit);var t,i,n=this.groups;n[0]&&(t=this.outlines.start,i=t.length?Math.min.apply(Math,t):0,!e&&0<i||(n.forEach(function(e){var e=e.grid,t=e.getOutlines(),n=t.start,t=t.end;e.setOutlines({start:n.map(function(e){return e-i}),end:t.map(function(e){return e-i})})}),this.groupItems.forEach(function(e){var t=e.cssContentPos;Qe(t)&&(e.cssContentPos=t-i)})))},t.setGroupStatus=function(e){var o=this,s=(this.itemKeys={},this.groupItems=[],this.items=[],this.groupKeys),t=e.groups.map(function(e){var t=e.type,n=e.groupKey,i=e.items,e=e.outlines,i=o._syncItemInfos(i),r=null!=(r=null==(r=s[n])?void 0:r.grid)?r:o._makeGrid();return r.setOutlines(e),r.setItems(i),{type:t,groupKey:n,grid:r,items:i,renderItems:i}});this.setOutlines(e.outlines),this._registerGroups(t),this._updatePlaceholder(),this.setCursors(e.cursors[0],e.cursors[1])},t.appendPlaceholders=function(e,t){return this.insertPlaceholders("end",e,t)},t.prependPlaceholders=function(e,t){return this.insertPlaceholders("start",e,t)},t.removePlaceholders=function(e){var t,n,i=this.groups,r=i.length;"start"===e?(n=D(i,function(e){return e.type===P.NORMAL}),i.splice(0,n)):"end"===e?(n=ut(i,function(e){return e.type===P.NORMAL}),i.splice(n+1,r-n-1)):(t=e.groupKey,-1<(n=D(i,function(e){return e.groupKey===t}))&&i.splice(n,1)),this.syncItems(ht(this.getGroups()))},t.insertPlaceholders=function(e,t,n){void 0===n&&(n=rt(this.groupKeys,"virtual_"));var i=[],t=(Qe(t)?i=function(e){for(var t=[],n=0;n<e;++n)t.push(n);return t}(t).map(function(){return{type:b.VIRTUAL,groupKey:n}}):Array.isArray(t)&&(i=t.map(function(e){return I(I({groupKey:n},e),{type:b.VIRTUAL})})),this._makeGrid()),i=this._syncItemInfos(i,this.itemKeys),t=(this._updatePlaceholder(i),t.setItems(i),{type:P.VIRTUAL,groupKey:n,grid:t,items:i,renderItems:i});return this.groupKeys[n]=t,"end"===e?(this.groups.push(t),(e=this.groupItems).push.apply(e,i)):(this.groups.splice(0,0,t),(e=this.groupItems).splice.apply(e,f([0,0],i,!1)),-1<this.startCursor&&(++this.startCursor,++this.endCursor)),{group:t,items:i}},t.shouldRerenderItems=function(){var n=!1;return this.getVisibleGroups().forEach(function(e){var t=e.items;t.length===e.renderItems.length||t.every(function(e){return e.mountState===O.UNCHECKED})||(n=!0,e.renderItems=f([],t,!0))}),n&&(this.items=this._getRenderingItems()),n},t._updateItems=function(e){this.itemRenderer.updateEqualSizeItems(e,this.groupItems)},t._getGroupItems=function(){return ht(this.getGroups(!0))},t._getRenderingItems=function(){var e=$e(this.getVisibleGroups(!0).map(function(e){return e.renderItems})),t=this._loadingGrid,n=t.getLoadingItem();return n&&("end"===t.type?e.push(n):"start"===t.type&&e.unshift(n)),e},t._checkShouldRender=function(e){var t,n=this.options.gridConstructor,i=this.gridOptions,r=n.propertyTypes;for(t in i)if(!(t in e)&&r[t]===d.RENDER_PROPERTY)return!0;for(t in e)if(i[t]!==e[t]&&r[t]===d.RENDER_PROPERTY)return!0;return!1},t._applyVirtualGrid=function(e,t,n){var i=n.length?f([],n,!0):[0],n=e.getOutlines(),e=n["end"===t?"start":"end"];return e.length!==i.length||e.some(function(e,t){return e!==i[t]})?{start:f([],i,!0),end:f([],i,!0)}:n},t._syncItemInfos=function(e,r){void 0===r&&(r={});var o=this.options.horizontal,s=this.itemKeys;return e.filter(function(e){return null!=e.key}).forEach(function(e){var t=e.key,n=r[t];n?n.type===b.VIRTUAL&&e.type!==b.VIRTUAL?s[t]=new x(o,I({orgRect:n.orgRect,rect:n.rect},e)):(e.data&&(n.data=e.data),null!=e.groupKey&&(n.groupKey=e.groupKey),e.element&&(n.element=e.element),s[t]=n):s[t]=new x(o,I({},e))}),e.map(function(e){var t,n=e.key,i=(null==e.key&&(n=rt(s,e.type===b.VIRTUAL?"virtual_":"")),s[n]);return i||((t=r[n])?(i=t,e.data&&(i.data=e.data),e.element&&(i.element=e.element)):i=new x(o,I(I({},e),{key:n})),s[n]=i),i})},t._registerGroups=function(e){var t={};e.forEach(function(e){t[e.groupKey]=e}),this.groups=e,this.groupKeys=t,this.groupItems=this._getGroupItems()},t._splitVirtualGroups=function(e,t){var e=it(this.groups,e,t),n=this.itemKeys;return e.forEach(function(e){e.renderItems.forEach(function(e){n[e.key]=e})}),e},t._mergeVirtualGroups=function(e){var i=this.itemKeys,r=this.groupKeys;return e.forEach(function(e){var t,n=r[e.groupKey];n&&(t=e.items).every(function(e){return e.mountState===O.UNCHECKED})&&n.renderItems.forEach(function(e){e.type!==b.VIRTUAL||i[e.key]||(t.push(e),i[e.key]=e)})}),e},t._updatePlaceholder=function(e){void 0===e&&(e=this.groupItems);var o=this._placeholder;o&&e.filter(function(e){return e.type===b.VIRTUAL}).forEach(function(e){var t,n=e,i=o;for(t in i){var r=i[t];n[t]="object"==typeof r?I(I({},n[t]),r):i[t]}})},t._makeGrid=function(){var e=this.options.gridConstructor,t=this.gridOptions;return new e(this.containerElement,I(I({},t),{useFit:!1,autoResize:!1,useResizeObserver:!1,observeChildren:!1,renderOnPropertyChange:!1,externalContainerManager:this.containerManager,externalItemRenderer:this.itemRenderer}))},t._getLoadingGroup=function(){var e=this._loadingGrid,t=e.getItems();return{groupKey:"__INFINITEGRID__LOADING_GRID",type:P.NORMAL,grid:e,items:t,renderItems:t}},t._getLoadingItem=function(){return this._loadingGrid.getLoadingItem()},e.defaultOptions=I(I({},z.defaultOptions),{appliedItemChecker:function(){return!1},gridConstructor:null,gridOptions:{}}),e.propertyTypes=I(I({},z.propertyTypes),{gridConstructor:d.PROPERTY,gridOptions:d.PROPERTY}),n([S],e)}(z),mt=function(n){function e(e){var t=n.call(this)||this;return t.startCursor=-1,t.endCursor=-1,t.size=0,t.items=[],t.itemKeys={},t.options=I({threshold:0,useRecycle:!0,defaultDirection:"end"},e),t}o(e,n);var t=e.prototype;return t.scroll=function(n){var e=this.startCursor,t=this.endCursor,i=this.items,r=i.length,o=this.size,s=this.options,a=s.defaultDirection,u=s.threshold,s=s.useRecycle,a="end"===a;if(r)if(-1===e||-1===t)this.trigger("change",{prevStartCursor:e,prevEndCursor:t,nextStartCursor:h=a?0:r-1,nextEndCursor:h});else{var c=n+o,h=Math.max.apply(Math,i[e].startOutline),o=Math.min.apply(Math,i[t].endOutline),l=i.map(function(e){var t=e.startOutline,e=e.endOutline;return!(!t.length||!e.length||ct(t,e))&&(t=Math.min.apply(Math,t),e=Math.max.apply(Math,e),t-u<=c)&&n<=e+u}),f=0<e,d=t<r-1,h=n<=h+u,o=o-u<=c,p=l.indexOf(!0),g=l.lastIndexOf(!0),l=(-1===p&&(p=e,g=t),s||(p=Math.min(p,e),g=Math.max(g,t)),p===e&&f&&h&&--p,g===t&&d&&o&&(g+=1),i.slice(p,g+1));if(l.every(function(e){return!0===e.isVirtual})){for(var m=!1,y=p-1;0<=y;--y)if(!i[y].isVirtual){p=y,m=!0;break}if(!m)for(y=g+1;y<r;++y)if(!i[y].isVirtual){g=y,m=!0;break}m&&(l=i.slice(p,g+1))}var R,s=l.some(function(e){return!0===e.isVirtual});(e===p&&t===g||(this.trigger("change",{prevStartCursor:e,prevEndCursor:t,nextStartCursor:p,nextEndCursor:g}),s))&&(s?(d=null==(f=l[0])?void 0:f.isVirtual,f=null==(s=l[l.length-1])?void 0:s.isVirtual,a&&o||!d?!a&&h||!f||l[s=(R=ut(l,function(e){return!e.isVirtual}))+1]&&this.trigger("requestAppend",{key:-1<R?l[R].key:void 0,nextKey:l[s].key,nextKeys:l.slice(s).map(function(e){return e.key}),isVirtual:!0}):l[d=(-1===(R=D(l,function(e){return!e.isVirtual}))?l.length:R)-1]&&this.trigger("requestPrepend",{key:-1<R?l[R].key:void 0,nextKey:l[d].key,nextKeys:l.slice(0,1+d).map(function(e){return e.key}),isVirtual:!0})):this._requestVirtualItems()||(a&&o||!h?!a&&h||!o||this.trigger("requestAppend",{key:i[t].key,isVirtual:!1}):this.trigger("requestPrepend",{key:i[e].key,isVirtual:!1})))}else this.trigger(a?"requestAppend":"requestPrepend",{key:void 0,isVirtual:!1})},t._requestVirtualItems=function(){var e="end"===this.options.defaultDirection,t=this.items,n=this.getVisibleItems(),i=n.filter(function(e){return!e.isVirtual}),r=n.length,o=i.length,s=this.getStartCursor(),a=this.getEndCursor();if(o!==r)if(o){var u=i[0].key,c=i[o-1].key,i=D(t,function(e){return e.key===u})-1,o=D(t,function(e){return e.key===c})+1,a=o<=a,s=s<=i;if((e||!s)&&a)return this.trigger("requestAppend",{key:c,nextKey:t[o].key,isVirtual:!0}),!0;if((!e||!a)&&s)return this.trigger("requestPrepend",{key:u,nextKey:t[i].key,isVirtual:!0}),!0}else if(r)return o=n[r-1],e?this.trigger("requestAppend",{nextKey:n[0].key,isVirtual:!0}):this.trigger("requestPrepend",{nextKey:o.key,isVirtual:!0}),!0;return!1},t.setCursors=function(e,t){this.startCursor=e,this.endCursor=t},t.setSize=function(e){this.size=e},t.getStartCursor=function(){return this.startCursor},t.getEndCursor=function(){return this.endCursor},t.isLoading=function(e){var t=this.startCursor,n=this.endCursor,i=this.items,r=i[t],o=i[n],i=i.length;return!(e===T.END&&-1<n&&n<i-1&&!o.isVirtual&&!ct(o.startOutline,o.endOutline)||e===T.START&&0<t&&!r.isVirtual&&!ct(r.startOutline,r.endOutline))},t.setItems=function(e){this.items=e;var t={};e.forEach(function(e){t[e.key]=e}),this.itemKeys=t},t.syncItems=function(e){var t=this.items,n=this.startCursor,i=this.endCursor,r=nt(this.items.map(function(e){return e.key}),e.map(function(e){return e.key}),n,i),o=r.startCursor,r=r.endCursor,s=r-o!=i-n||-1===n||-1===o;return s||(s=0<(t=Y(t.slice(n,i+1),e.slice(o,r+1),function(e){return e.key})).added.length||0<t.removed.length||0<t.changed.length),this.setItems(e),this.setCursors(o,r),s},t.getItems=function(){return this.items},t.getVisibleItems=function(){var e=this.startCursor,t=this.endCursor;return-1===e?[]:this.items.slice(e,t+1)},t.getSize=function(){return this.size},t.getItemByKey=function(e){return this.itemKeys[e]},t.getItemPartByKey=function(t){var n;return this.items.forEach(function(e){null!=(e=e.parts)&&e.forEach(function(e){e.key===t&&(n=e)})}),n},t.getScrollSize=function(){var e=this.items,t=e.length;return t?Math.max.apply(Math,f([0],e[t-1].endOutline,!1)):0},t.getVisibleArea=function(n,e){var t,i,r,e=(e=void 0===e?this.options.defaultDirection:e)===T.END,o=this.getRenderedVisibleItems();return o.length?(t=o[e?0:length-1],i=e?Math.min.apply(Math,t.startOutline):Math.max.apply(Math,t.endOutline),e?o.forEach(function(e){null!=(e=e.parts)&&e.forEach(function(e){r&&r.pos>=e.pos||i<e.pos&&e.pos<=n&&(i=(r=e).pos)})}):o.forEach(function(e){null!=(e=e.parts)&&e.forEach(function(e){var t=e.pos+e.size;r&&r.pos+r.size<=t||t<i&&n<=t&&(r=e,i=t)})}),{item:t,part:r}):null},t.getRenderedVisibleItems=function(){var e=this.getVisibleItems(),t=e.map(function(e){var t=e.startOutline,n=e.endOutline,e=t.length;return 0!==e&&e===n.length&&t.some(function(e,t){return n[t]!==e})}),n=t.indexOf(!0),t=t.lastIndexOf(!0);return-1===t?[]:e.slice(n,t+1)},t.destroy=function(){this.off(),this.startCursor=-1,this.endCursor=-1,this.items=[],this.size=0},e}(i),e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.items=[],e.container=null,e.rendererKey=0,e._updateTimer=0,e._state={},e._isItemChanged=!1,e}o(e,t);var n=e.prototype;return n.updateKey=function(){this.rendererKey=Date.now()},n.getItems=function(){return this.items},n.setContainer=function(e){this.container=e},n.render=function(e,t){return this.syncItems(e,t)},n.update=function(e){var t=this;void 0===e&&(e={}),this._state=I(I({},this._state),e),this.trigger("update",{state:e}),clearTimeout(this._updateTimer),this._updateTimer=window.setTimeout(function(){t.trigger("requestUpdate",{state:e})})},n.updated=function(n){void 0===n&&(n=null!=(e=null==(e=this.container)?void 0:e.children)?e:[]);var e=this._diffResult,t=!!(e.added.length||e.removed.length||e.changed.length),i=this._state,r=this._isItemChanged,e=e.list;return this._isItemChanged=!1,this._state={},(this.items=e).forEach(function(e,t){e.element=n[t]}),this.trigger("updated",{items:e,elements:at(n),diffResult:this._diffResult,state:i,isItemChanged:r,isChanged:t}),t},n.syncItems=function(e,t){void 0===t&&(t={});var n=this.rendererKey,e=Y(this.items,e.map(function(e){return I(I({},e),{renderKey:"".concat(n,"_").concat(e.key)})}),function(e){return e.renderKey});return this._isItemChanged=!!e.added.length||!!e.removed.length||!!e.changed.length,this._state=I(I({},this._state),t),this._diffResult=e},n.destroy=function(){this.off()},e}(i),yt=function(r){function e(){return null!==r&&r.apply(this,arguments)||this}return o(e,r),e.prototype.syncItems=function(n){var e=r.prototype.syncItems.call(this,n),t=e.added,i=e.list;return t.forEach(function(e){var t=n[e].orgItem;t.html&&!t.element&&(t.element=ot(t.html)[0]),i[e].element=t.element}),e},e}(function(u){function e(){return null!==u&&u.apply(this,arguments)||this}return o(e,u),e.prototype.render=function(e,t){var n=this.container,e=u.prototype.render.call(this,e,t),i=e.prevList,t=e.removed,r=e.ordered,o=e.added,s=e.list,a=f([],i,!0);return t.forEach(function(e){a.splice(e,1),n.removeChild(i[e].element)}),r.forEach(function(e){var t=e[0],e=e[1],t=a.splice(t,1)[0];a.splice(e,0,t),n.insertBefore(t.element,null!=(e=null==(t=a[e+1])?void 0:t.element)?e:null)}),o.forEach(function(e){var t=s[e];a.splice(e,0,t),n.insertBefore(t.element,null!=(e=null==(t=a[e+1])?void 0:t.element)?e:null)}),this.updated(n.children),e},e}(e)),Rt=function(i){function e(e,t){var n=i.call(this)||this;return n.wrapper=e,n.prevScrollPos=null,n.scrollOffset=0,n.contentSize=0,n._isScrollIssue=je,n._onCheck=function(){var e=n.getScrollPos(),t=n.getOrgScrollPos();n.setScrollPos(t),null===e||n._isScrollIssue&&0===t||e===t?t&&(n._isScrollIssue=!1):(n._isScrollIssue=!1,n.trigger(new C("scroll",{direction:e<t?"end":"start",scrollPos:t,relativeScrollPos:n.getRelativeScrollPos()})))},n.options=I({container:!1,containerTag:"div",horizontal:!1,scrollContainer:null},t),n._init(),n}o(e,i);var t=e.prototype;return t.getWrapper=function(){return this.wrapper},t.getContainer=function(){return this.container},t.getScrollContainer=function(){return this.scrollContainer},t.getScrollOffset=function(){return this.scrollOffset},t.getContentSize=function(){return this.contentSize},t.getRelativeScrollPos=function(){return(this.prevScrollPos||0)-this.scrollOffset},t.getScrollPos=function(){return this.prevScrollPos},t.setScrollPos=function(e){this.prevScrollPos=e},t.getOrgScrollPos=function(){var e=this.eventTarget,t=this.options.horizontal,n="scroll".concat(t?"Left":"Top");return Xe(e)?window[t?"pageXOffset":"pageYOffset"]||document.documentElement[n]||document.body[n]:e[n]},t.setStatus=function(e){this.contentSize=e.contentSize,this.scrollOffset=e.scrollOffset,this.prevScrollPos=e.prevScrollPos,this.scrollTo(this.prevScrollPos)},t.getStatus=function(){return{contentSize:this.contentSize,scrollOffset:this.scrollOffset,prevScrollPos:this.prevScrollPos}},t.scrollTo=function(e){var t=this.eventTarget,e=this.options.horizontal?[e,0]:[0,e],n=e[0],e=e[1];Xe(t)?t.scroll(n,e):(t.scrollLeft=n,t.scrollTop=e)},t.scrollBy=function(e){var t,n,i;e&&(t=this.eventTarget,n=(i=this.options.horizontal?[e,0]:[0,e])[0],i=i[1],this.prevScrollPos+=e,Xe(t)?t.scrollBy(n,i):(t.scrollLeft+=n,t.scrollTop+=i))},t.resize=function(){var e=this.scrollContainer,t=this.options.horizontal,n=e===document.body,i=n?{top:0,left:0}:e.getBoundingClientRect(),r=this.container.getBoundingClientRect();this.scrollOffset=(this.getOrgScrollPos()||0)+(t?r.left-i.left:r.top-i.top),this.contentSize=n?t?window.innerWidth:window.innerHeight:t?e.offsetWidth:e.offsetHeight},t.destroy=function(){var e,t,n,i=this.container;this.eventTarget.removeEventListener("scroll",this._onCheck),this._isCreateElement?(e=this.scrollContainer,t=document.createDocumentFragment(),n=at(i.childNodes),e.removeChild(i),n.forEach(function(e){t.appendChild(e)}),e.appendChild(t)):this.options.container&&(i.style.cssText=this._orgCSSText)},t._init=function(){var e=this.options,t=e.container,n=e.containerTag,i=e.horizontal,e=e.scrollContainer,r=this.wrapper,o=r,s=r,r="",n=(t?(!0===t?((s=document.createElement(n)).style.position="relative",s.className=Fe,at(o.childNodes).forEach(function(e){s.appendChild(e)}),o.appendChild(s),this._isCreateElement=!0):s=Ze(t),r=s.style.cssText,(n=o.style).overflowX=(t=i?["scroll","hidden"]:["hidden","scroll"])[0],n.overflowY=t[1],i&&(s.style.height="100%")):(o=Ze(e)||document.body,r=s.style.cssText),o===document.body?window:o);n.addEventListener("scroll",this._onCheck),this._orgCSSText=r,this.container=s,this.scrollContainer=o,this.eventTarget=n,this.resize(),this.setScrollPos(this.getOrgScrollPos())},e}(i),L=function(_){function e(e,t){var g=_.call(this)||this,t=(g._waitType="",g._onScroll=function(e){var t=e.direction,n=e.scrollPos,e=e.relativeScrollPos;g._scroll(),g.trigger(new C(M.CHANGE_SCROLL,{direction:t,scrollPos:n,relativeScrollPos:e}))},g._onChange=function(e){g.setCursors(e.nextStartCursor,e.nextEndCursor)},g._onRendererUpdated=function(e){var t,n,r,o,i,s,a;e.items.forEach(function(e){e.orgItem.element=e.element}),e.isChanged?(t=(i=e.diffResult).added,a=i.removed,n=i.prevList,r=i.list,a.forEach(function(e){e=n[e].orgItem;e.mountState!==O.UNCHECKED&&(e.mountState=O.UNMOUNTED)}),o=g.options.horizontal,i=t.map(function(e){var t,n,e=r[e].orgItem,i=e.element;return e.type===b.VIRTUAL?(t=I({},e.cssRect),n=e.rect,!t.width&&n.width&&(t.width=n.width),!t.height&&n.height&&(t.height=n.height),new be(o,{element:i,cssRect:t})):e}),s=g.containerManager,g.options.observeChildren&&(s.unobserveChildren(a.map(function(e){return n[e].element})),s.observeChildren(t.map(function(e){return r[e].element}))),s=(a=e.state).isRestore,a=a.isResize,g.itemRenderer.renderItems(i),s&&g._onRenderComplete({mounted:t.map(function(e){return r[e].orgItem}),updated:[],isResize:!1,direction:g.defaultDirection}),s&&!a&&!e.isItemChanged||g.groupManager.renderItems()):(g._checkEndLoading(),g._scroll())},g._onResize=function(e){e.isResizeContainer?g._renderItems({useResize:!0},!0):0<(e=me(g.getVisibleItems(),e.childEntries)).length&&g.updateItems(e)},g._onRequestAppend=function(e){g._onRequestInsert(T.END,M.REQUEST_APPEND,e)},g._onRequestPrepend=function(e){g._onRequestInsert(T.START,M.REQUEST_PREPEND,e)},g._onContentError=function(e){var t=e.element,n=e.target,i=e.item,e=e.update;g.trigger(new C(M.CONTENT_ERROR,{element:t,target:n,item:i,update:e,remove:function(){g.removeByKey(i.key)}}))},g._onRenderComplete=function(e){var t,n,i,r=e.isResize,o=e.mounted,s=e.updated,e=e.direction,a=g.infinite,u=g.scrollManager.getRelativeScrollPos(),c=a.getScrollSize(),h=a.getSize(),l=a.getVisibleArea(u,e),f=e===T.END,d=(g._syncInfinite(),l&&(d=l.part,l=l.item,n=i=void 0,d&&(i=a.getItemPartByKey(d.key)),l&&(n=a.getItemByKey(l.key)),i||n)&&(p=t=0,t=i?(p=i.pos+(f?0:i.size),d.pos+(f?0:d.size)):(i=Math.min.apply(Math,l.startOutline),d=Math.max.apply(Math,l.endOutline),l=Math.min.apply(Math,n.startOutline),n=Math.max.apply(Math,n.endOutline),p=f?l:n,f?i:d),(l=p-t)<0&&(n=a.getScrollSize(),f=a.getSize(),i=Math.max(u-Math.max(0,c-h),0),l+=u-(Math.min(u,Math.max(0,n-f))+i)),g.scrollManager.scrollBy(l)),o.filter(function(e){return e.type!==b.LOADING})),p=(g.trigger(new C(M.RENDER_COMPLETE,{isResize:r,direction:e,mounted:d,updated:s.filter(function(e){return e.type!==b.LOADING}),startCursor:g.getStartCursor(),endCursor:g.getEndCursor(),items:g.getVisibleItems(!0),groups:g.getVisibleGroups(!0)})),g.groupManager.shouldRerenderItems());(p=d.length||s.length?p||!!g.groupManager.endLoading():p)?g._update():(g._checkEndLoading(),g._scroll())},g.options=I(I(I({},g.constructor.defaultOptions),{renderer:(new yt).on("requestUpdate",function(){return g._render()})}),t),g.options),n=t.gridConstructor,i=t.containerTag,r=t.container,o=t.renderer,s=t.threshold,a=t.useRecycle,u=t.scrollContainer,c=t.appliedItemChecker,t=k(t,["gridConstructor","containerTag","container","renderer","threshold","useRecycle","scrollContainer","appliedItemChecker"]),h=t.horizontal,l=t.attributePrefix,f=t.useTransform,d=t.percentage,p=t.isConstantSize,m=t.isEqualSize,y=t.autoResize,R=t.useResizeObserver,v=t.resizeDebounce,S=t.maxResizeDebounce,z=t.defaultDirection,E=t.useRoundedSize,e=Je(e)?document.querySelector(e):e,u=new Rt(e,{scrollContainer:u,container:r,containerTag:i,horizontal:h}).on({scroll:g._onScroll}),r=u.getContainer(),i=new Oe(r,{horizontal:h,autoResize:y,resizeDebounce:v,maxResizeDebounce:S,useResizeObserver:R}).on("resize",g._onResize),y=new Pe({attributePrefix:l,horizontal:h,useTransform:f,percentage:d,isEqualSize:m,isConstantSize:p,useRoundedSize:E}),v=new mt({defaultDirection:z,useRecycle:a,threshold:s}).on({change:g._onChange,requestAppend:g._onRequestAppend,requestPrepend:g._onRequestPrepend}),S=(v.setSize(u.getContentSize()),new gt(r,{appliedItemChecker:c,gridConstructor:n,externalItemRenderer:y,externalContainerManager:i,gridOptions:t}));return S.on({renderComplete:g._onRenderComplete,contentError:g._onContentError}),o.setContainer(r),o.on("updated",g._onRendererUpdated),g.itemRenderer=y,g.groupManager=S,g.wrapperElement=e,g.scrollManager=u,g.containerManager=i,g.infinite=v,g.containerManager.resize(),g}o(e,_);var t=e.prototype;return t.renderItems=function(e){return this._renderItems(e=void 0===e?{}:e),this},t.getWrapperElement=function(){return this.scrollManager.getWrapper()},t.getScrollContainerElement=function(){return this.scrollManager.getScrollContainer()},t.getContainerElement=function(){return this.scrollManager.getContainer()},t.syncItems=function(e){return this.groupManager.syncItems(e),this._syncGroups(),this},t.setCursors=function(e,t,n){return this.groupManager.setCursors(e,t),this.infinite.setCursors(e,t),n?(this.getVisibleItems().forEach(function(e){e.cssRect.top===We&&(e.cssRect={})}),this._syncItems()):(this._update(),this._checkEndLoading()),this},t.getStartCursor=function(){return this.infinite.getStartCursor()},t.getEndCursor=function(){return this.infinite.getEndCursor()},t.append=function(e,t){return this.insert(-1,e,t)},t.prepend=function(e,t){return this.insert(0,e,t)},t.insert=function(e,t,n){var i=this.groupManager.getGroupItems(),t=st(t,n);return-1===e?i.push.apply(i,t):i.splice.apply(i,f([e,0],t,!1)),this.syncItems(i)},t.insertByGroupIndex=function(e,t,n){var i,r,e=this.groupManager.getGroups()[e];return e?(i=this.groupManager.getGroupItems(),r=e.groupKey,e=D(i,function(e){return e.groupKey===r}),this.insert(e,t,n)):this.append(t,n)},t.getStatus=function(e,t){return{containerManager:this.containerManager.getStatus(),itemRenderer:this.itemRenderer.getStatus(),groupManager:this.groupManager.getGroupStatus(e,t),scrollManager:this.scrollManager.getStatus()}},t.setPlaceholder=function(e){return this.groupManager.setPlaceholder(e),this},t.setLoading=function(e){return this.groupManager.setLoading(e),this},t.appendPlaceholders=function(e,t){var n=this,i=this.groupManager.appendPlaceholders(e,t);return this._syncGroups(!0),I(I({},i),{remove:function(){n.removePlaceholders({groupKey:i.group.groupKey})}})},t.prependPlaceholders=function(e,t){var n=this,i=this.groupManager.prependPlaceholders(e,t);return this._syncGroups(!0),I(I({},i),{remove:function(){n.removePlaceholders({groupKey:i.group.groupKey})}})},t.removePlaceholders=function(e){this.groupManager.removePlaceholders(e),this._syncGroups(!0)},t.setStatus=function(e,t){this.itemRenderer.setStatus(e.itemRenderer),this.containerManager.setStatus(e.containerManager),this.scrollManager.setStatus(e.scrollManager);var n=this.groupManager,i=this.containerManager.getInlineSize(),e=(n.setGroupStatus(e.groupManager),this._syncInfinite(),this.infinite.setCursors(n.getStartCursor(),n.getEndCursor()),this._getRenderer().updateKey(),{isResize:this.containerManager.getInlineSize()!==i,isRestore:!0});return t?this._syncItems(e):this._update(e),this},t.removeGroupByIndex=function(e){var t=this.getGroups();return this.removeGroupByKey(t[e].groupKey)},t.removeGroupByKey=function(t){var e=this.getItems(),n=D(e,function(e){return e.groupKey===t}),i=ut(e,function(e){return e.groupKey===t});return-1===n?this:(e.splice(n,i-n+1),this.syncItems(e))},t.removeByIndex=function(e){var t=this.getItems(!0);return t.splice(e,1),this.syncItems(t)},t.removeByKey=function(t){var e=D(this.getItems(!0),function(e){return e.key===t});return this.removeByIndex(e)},t.updateItems=function(e,t){return this.groupManager.updateItems(e,t=void 0===t?{}:t),this},t.getItems=function(e){return this.groupManager.getGroupItems(e)},t.getVisibleItems=function(e){return this.groupManager.getVisibleItems(e)},t.getRenderingItems=function(){return this.groupManager.getRenderingItems()},t.getGroups=function(e){return this.groupManager.getGroups(e)},t.getVisibleGroups=function(e){return this.groupManager.getVisibleGroups(e)},t.wait=function(e){this._waitType=e=void 0===e?T.END:e,this._checkStartLoading(e)},t.ready=function(e){this._waitType="",e&&(this.groupManager.waitEndLoading(),this.groupManager.endLoading())&&this._update()},t.isWait=function(){return!!this._waitType},t.destroy=function(){this.off(),this._getRenderer().destroy(),this.containerManager.destroy(),this.groupManager.destroy(),this.scrollManager.destroy(),this.infinite.destroy()},t._getRenderer=function(){return this.options.renderer},t._getRendererItems=function(){return this.getRenderingItems().map(function(e){return{element:e.element,key:"".concat(e.type,"_").concat(e.key),orgItem:e}})},t._syncItems=function(e){this._getRenderer().syncItems(this._getRendererItems(),e)},t._render=function(e){this._getRenderer().render(this._getRendererItems(),e)},t._update=function(e){void 0===e&&(e={}),this._getRenderer().update(e)},t._resizeScroll=function(){var e=this.scrollManager;e.resize(),this.infinite.setSize(e.getContentSize())},t._syncGroups=function(e){var t=this.infinite;this.scrollManager.getContentSize()||this._resizeScroll(),this._syncInfinite(),this.groupManager.setCursors(t.getStartCursor(),t.getEndCursor()),e?this._update():this._render()},t._syncInfinite=function(){this.infinite.syncItems(this.getGroups(!0).map(function(e){var t=e.groupKey,n=e.grid,e=e.type,i=n.getOutlines();return{key:t,isVirtual:e===P.VIRTUAL,startOutline:i.start,endOutline:i.end,parts:n.getItems().map(function(e){return{key:e.key,pos:e.computedContentPos,size:e.computedContentSize}})}}))},t._scroll=function(){this.infinite.scroll(this.scrollManager.getRelativeScrollPos())},t._onRequestInsert=function(e,t,n){var i=this;this._waitType?this._checkStartLoading(this._waitType):this.trigger(new C(t,{groupKey:n.key,nextGroupKey:n.nextKey,nextGroupKeys:n.nextKeys||[],isVirtual:n.isVirtual,wait:function(){i.wait(e)},ready:function(e){i.ready(e)}}))},t._renderItems=function(e,t){return void 0===e&&(e={}),!t&&e.useResize&&this.containerManager.resize(),this._resizeScroll(),this.getRenderingItems().length?this.getVisibleGroups(!0).length?this.groupManager.renderItems(e):this.setCursors(0,0):0<(t=at(this.getContainerElement().children)).length?(this.groupManager.syncItems(st(t)),this._syncInfinite(),this.setCursors(0,0,!0),this._getRenderer().updated()):this.infinite.scroll(0),this},t._checkStartLoading=function(e){var t=this.groupManager,n=this.infinite;!t.getLoadingType()&&n.isLoading(e)&&t.startLoading(e)&&t.hasLoadingItem()&&this._update()},t._checkEndLoading=function(){var e=this.groupManager,t=this.groupManager.getLoadingType();!t||this._waitType&&this.infinite.isLoading(t)||!e.waitEndLoading()||!e.hasLoadingItem()||this._update()},e.defaultOptions=I(I({},y),{container:!1,containerTag:"div",renderer:null,threshold:100,useRecycle:!0,scrollContainer:null,appliedItemChecker:function(){return!1}}),e.propertyTypes=Ye,n([w],e)}(i),vt={__proto__:null,default:L,withInfiniteGridMethods:ft,getRenderingItems:function(e,t){var n,i,r,o,s=t.status,a=t.usePlaceholder,u=t.useLoading,c=t.horizontal,h=t.useFirstRender,t=t.grid,l=[];return t?(t.setPlaceholder(a?{}:null),t.setLoading(u?{}:null),t.syncItems(e),l=t.getRenderingItems()):s?(u=s.groupManager,t=e,s=!!a,i=!!c,a=u.groups,t=tt(t),r=it(a,"start",t),o=it(a,"end",t),r=f(f(f([],r,!0),t,!0),o,!0),o=(t=nt(a.map(function(e){return e.groupKey}),r.map(function(e){return e.groupKey}),u.cursors[0],u.cursors[1])).startCursor,a=t.endCursor,u=$e(r.slice(o,a+1).map(function(e){return e.items.map(function(e){return new x(i,I({},e))})})),l=u=s?u:u.filter(function(e){return e.type!==b.VIRTUAL})):h&&(n=!!c,l=(t=tt(t=e))[0]?t[0].items.map(function(e){return new x(n,I({},e))}):[]),l},mountRenderingItems:function(e,t){var n=t.grid,i=t.usePlaceholder,r=t.useLoading,o=t.useFirstRender,t=t.status;n&&(i&&n.setPlaceholder({}),r&&n.setLoading({}),t&&n.setStatus(t,!0),n.syncItems(e),o)&&!t&&n.getGroups().length&&n.setCursors(0,0,!0)},InfiniteGridItem:x,MasonryInfiniteGrid:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.propertyTypes=I(I({},L.propertyTypes),Me.propertyTypes),t.defaultOptions=I(I(I({},L.defaultOptions),Me.defaultOptions),{gridConstructor:Me,appliedItemChecker:function(e,t){return(parseFloat(e.attributes.column)||0)>=t.outlineLength}}),n([w],t)}(L),JustifiedInfiniteGrid:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.propertyTypes=I(I({},L.propertyTypes),Ne.propertyTypes),t.defaultOptions=I(I(I({},L.defaultOptions),Ne.defaultOptions),{gridConstructor:Ne}),n([w],t)}(L),FrameInfiniteGrid:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.propertyTypes=I(I({},L.propertyTypes),Ke.propertyTypes),t.defaultOptions=I(I(I({},L.defaultOptions),Ke.defaultOptions),{gridConstructor:Ke}),n([w],t)}(L),PackingInfiniteGrid:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.propertyTypes=I(I({},L.propertyTypes),Ue.propertyTypes),t.defaultOptions=I(I(I({},L.defaultOptions),Ue.defaultOptions),{gridConstructor:Ue}),n([w],t)}(L),Renderer:e,IS_IOS:je,CONTAINER_CLASS_NAME:Fe,IGNORE_PROPERITES_MAP:qe,INFINITEGRID_PROPERTY_TYPES:Ye,DIRECTION:T,INFINITEGRID_EVENTS:M,ITEM_INFO_PROPERTIES:Be,INFINITEGRID_METHODS:t,get GROUP_TYPE(){return P},get ITEM_TYPE(){return b},get STATUS_TYPE(){return _},INVISIBLE_POS:We};for(pt in vt)L[pt]=vt[pt];return L});
//# sourceMappingURL=infinitegrid.min.js.map