@brightspot/ui 5.4.1 → 5.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- /*! For license information please see v5.4cdf07db0213a5d2f97e.js.LICENSE.txt */
2
- (()=>{var __webpack_modules__={77854(e,n,t){var o={"./af":1277,"./af.js":1277,"./ar":56313,"./ar-dz":92160,"./ar-dz.js":92160,"./ar-kw":20080,"./ar-kw.js":20080,"./ar-ly":54031,"./ar-ly.js":54031,"./ar-ma":63056,"./ar-ma.js":63056,"./ar-ps":9213,"./ar-ps.js":9213,"./ar-sa":67490,"./ar-sa.js":67490,"./ar-tn":64484,"./ar-tn.js":64484,"./ar.js":56313,"./az":99745,"./az.js":99745,"./be":47811,"./be.js":47811,"./bg":14357,"./bg.js":14357,"./bm":11259,"./bm.js":11259,"./bn":98436,"./bn-bd":22879,"./bn-bd.js":22879,"./bn.js":98436,"./bo":58925,"./bo.js":58925,"./br":50808,"./br.js":50808,"./bs":80721,"./bs.js":80721,"./ca":29400,"./ca.js":29400,"./cs":17246,"./cs.js":17246,"./cv":67939,"./cv.js":67939,"./cy":80608,"./cy.js":80608,"./da":47697,"./da.js":47697,"./de":17829,"./de-at":30685,"./de-at.js":30685,"./de-ch":23335,"./de-ch.js":23335,"./de.js":17829,"./dv":67042,"./dv.js":67042,"./el":78327,"./el.js":78327,"./en-au":49776,"./en-au.js":49776,"./en-ca":85650,"./en-ca.js":85650,"./en-gb":44217,"./en-gb.js":44217,"./en-ie":17768,"./en-ie.js":17768,"./en-il":69305,"./en-il.js":69305,"./en-in":95031,"./en-in.js":95031,"./en-nz":54898,"./en-nz.js":54898,"./en-sg":42504,"./en-sg.js":42504,"./eo":97728,"./eo.js":97728,"./es":30876,"./es-do":94290,"./es-do.js":94290,"./es-mx":8022,"./es-mx.js":8022,"./es-us":58073,"./es-us.js":58073,"./es.js":30876,"./et":62671,"./et.js":62671,"./eu":48590,"./eu.js":48590,"./fa":53243,"./fa.js":53243,"./fi":17827,"./fi.js":17827,"./fil":33457,"./fil.js":33457,"./fo":17057,"./fo.js":17057,"./fr":25652,"./fr-ca":55873,"./fr-ca.js":55873,"./fr-ch":12544,"./fr-ch.js":12544,"./fr.js":25652,"./fy":60403,"./fy.js":60403,"./ga":72500,"./ga.js":72500,"./gd":57161,"./gd.js":57161,"./gl":60177,"./gl.js":60177,"./gom-deva":76290,"./gom-deva.js":76290,"./gom-latn":75307,"./gom-latn.js":75307,"./gu":55072,"./gu.js":55072,"./he":4009,"./he.js":4009,"./hi":6789,"./hi.js":6789,"./hr":35642,"./hr.js":35642,"./hu":40601,"./hu.js":40601,"./hy-am":85116,"./hy-am.js":85116,"./id":63731,"./id.js":63731,"./is":99144,"./is.js":99144,"./it":48003,"./it-ch":48213,"./it-ch.js":48213,"./it.js":48003,"./ja":32327,"./ja.js":32327,"./jv":2692,"./jv.js":2692,"./ka":65856,"./ka.js":65856,"./kk":2494,"./kk.js":2494,"./km":85644,"./km.js":85644,"./kn":53187,"./kn.js":53187,"./ko":95970,"./ko.js":95970,"./ku":99412,"./ku-kmr":93269,"./ku-kmr.js":93269,"./ku.js":99412,"./ky":14648,"./ky.js":14648,"./lb":91286,"./lb.js":91286,"./lo":35,"./lo.js":35,"./lt":72564,"./lt.js":72564,"./lv":80234,"./lv.js":80234,"./me":20486,"./me.js":20486,"./mi":4210,"./mi.js":4210,"./mk":96604,"./mk.js":96604,"./ml":57039,"./ml.js":57039,"./mn":37713,"./mn.js":37713,"./mr":33869,"./mr.js":33869,"./ms":70628,"./ms-my":71967,"./ms-my.js":71967,"./ms.js":70628,"./mt":72695,"./mt.js":72695,"./my":62946,"./my.js":62946,"./nb":38348,"./nb.js":38348,"./ne":53279,"./ne.js":53279,"./nl":98934,"./nl-be":45848,"./nl-be.js":45848,"./nl.js":98934,"./nn":23008,"./nn.js":23008,"./oc-lnc":18752,"./oc-lnc.js":18752,"./pa-in":43211,"./pa-in.js":43211,"./pl":37904,"./pl.js":37904,"./pt":69224,"./pt-br":68393,"./pt-br.js":68393,"./pt.js":69224,"./ro":18557,"./ro.js":18557,"./ru":60867,"./ru.js":60867,"./sd":48565,"./sd.js":48565,"./se":67564,"./se.js":67564,"./si":52224,"./si.js":52224,"./sk":28150,"./sk.js":28150,"./sl":34413,"./sl.js":34413,"./sq":96664,"./sq.js":96664,"./sr":2831,"./sr-cyrl":15358,"./sr-cyrl.js":15358,"./sr.js":2831,"./ss":41646,"./ss.js":41646,"./sv":93907,"./sv.js":93907,"./sw":9202,"./sw.js":9202,"./ta":64833,"./ta.js":64833,"./te":64725,"./te.js":64725,"./tet":6607,"./tet.js":6607,"./tg":81955,"./tg.js":81955,"./th":21504,"./th.js":21504,"./tk":2103,"./tk.js":2103,"./tl-ph":52597,"./tl-ph.js":52597,"./tlh":1256,"./tlh.js":1256,"./tr":84046,"./tr.js":84046,"./tzl":98229,"./tzl.js":98229,"./tzm":90051,"./tzm-latn":26723,"./tzm-latn.js":26723,"./tzm.js":90051,"./ug-cn":5910,"./ug-cn.js":5910,"./uk":36628,"./uk.js":36628,"./ur":15541,"./ur.js":15541,"./uz":1389,"./uz-latn":63085,"./uz-latn.js":63085,"./uz.js":1389,"./vi":61203,"./vi.js":61203,"./x-pseudo":57591,"./x-pseudo.js":57591,"./yo":67780,"./yo.js":67780,"./zh-cn":72248,"./zh-cn.js":72248,"./zh-hk":18124,"./zh-hk.js":18124,"./zh-mo":91391,"./zh-mo.js":91391,"./zh-tw":75716,"./zh-tw.js":75716};function i(e){var n=r(e);return t(n)}function r(e){if(!t.o(o,e)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=r,e.exports=i,i.id=77854},31201(e,n,t){"use strict";var o=t(88630),i=t.n(o),r=t(91762);const a=window.BRIGHTSPOT?.web?.pagePaths["com.psddev.analytics.ui.AnalyticsDataToolPage"];class s{constructor(e){this.element=void 0,this.contentId=void 0,this.analyticsUrl=void 0,this.isLoaded=!1,this.cache={},this.currentPeriod="hours",this.loadingElement=void 0,this.contentElement=void 0,this.errorElement=void 0,this.periodSelector=void 0,this.element=e,this.contentId=e.dataset.contentId||"",this.analyticsUrl=a,this.loadingElement=e.querySelector(".AnalyticsWidget-loading"),this.contentElement=e.querySelector(".AnalyticsWidget-content"),this.errorElement=e.querySelector(".AnalyticsWidget-error"),this.periodSelector=e.querySelector(".AnalyticsWidget-periodSelector"),this.init()}init(){i()(this.element).closest("[data-tab]").on("tabbedShow",()=>{const e=this.element.closest("[data-tab]");this.isLoaded||e?.classList.contains("TC-unselected")||this.loadAnalyticsData()}),this.periodSelector&&this.periodSelector.addEventListener("change",e=>{const n=e.target;null!==n&&n instanceof HTMLSelectElement&&(this.currentPeriod=n.value,this.loadAnalyticsData())})}async loadAnalyticsData(){const e=this.currentPeriod;if(this.cache[e])this.displayData(this.cache[e]);else{if(!this.analyticsUrl)return console.error("Analytics data endpoint not found in pagePaths"),void this.showError();this.showLoading();try{const n=await fetch(`${this.analyticsUrl}?id=${this.contentId}&period=${e}`);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const t=await n.json();if("error"in t)throw new Error(t.error);this.cache[e]=t,this.displayData(t),this.isLoaded=!0}catch(e){console.error("Failed to load analytics data:",e),this.showError()}}}showLoading(){this.loadingElement&&(this.loadingElement.hidden=!1),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0)}showError(){this.loadingElement&&(this.loadingElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!1)}displayData(e){if(this.loadingElement&&(this.loadingElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!1),!this.contentElement)return;this.contentElement.innerHTML="";const n=document.createElement("div");n.className=`numbersPeriod numbersPeriod-${e.periodLabel}`,n.addEventListener("highchart-loaded",()=>{n.classList.add("chart-loaded")}),e.chartData&&(n.innerHTML=e.chartData),this.contentElement.appendChild(n)}}(0,r.A)(".AnalyticsWidget",e=>{new s(e)})},60655(e,n,t){"use strict";t(86634),t(57573);var o={},i="function"==typeof Map?new Map:null,r="swap",a="move",s="layoutStart",c="layoutEnd",d="layoutAbort",l="remove",p="hideStart",M="filter",u="sort",b="move",h="send",z="beforeSend",O="receive",f="beforeReceive",m="dragReleaseEnd",g="ontouchstart"in window,A=!!window.PointerEvent,w=!!window.navigator.msPointerEnabled;function v(){this._events={},this._queue=[],this._counter=0,this._clearOnEmit=!1}v.prototype.on=function(e,n){if(!this._events||!e||!n)return this;var t=this._events[e];return t||(t=this._events[e]=[]),t.push(n),this},v.prototype.off=function(e,n){if(!this._events||!e||!n)return this;var t,o=this._events[e];if(!o||!o.length)return this;for(;-1!==(t=o.indexOf(n));)o.splice(t,1);return this},v.prototype.clear=function(e){if(!this._events||!e)return this;var n=this._events[e];return n&&(n.length=0,delete this._events[e]),this},v.prototype.emit=function(e){if(!this._events||!e)return this._clearOnEmit=!1,this;var n=this._events[e];if(!n||!n.length)return this._clearOnEmit=!1,this;var t,o=this._queue,i=o.length,r=arguments.length-1;r>3&&((t=[]).push.apply(t,arguments),t.shift()),o.push.apply(o,n),this._clearOnEmit&&(n.length=0,this._clearOnEmit=!1),++this._counter;for(var a=i,s=o.length;a<s;a++)if(0===r?o[a]():1===r?o[a](arguments[1]):2===r?o[a](arguments[1],arguments[2]):3===r?o[a](arguments[1],arguments[2],arguments[3]):o[a].apply(null,t),!this._events)return this;return--this._counter,this._counter||(o.length=0),this},v.prototype.burst=function(){return this._events?(this._clearOnEmit=!0,this.emit.apply(this,arguments),this):this},v.prototype.countListeners=function(e){if(!this._events)return 0;var n=this._events[e];return n?n.length:0},v.prototype.destroy=function(){return this._events?(this._queue.length=this._counter=0,this._events=null,this):this};var q=A?"pointerout":w?"MSPointerOut":"";function k(e){q&&(this._dragger=e,this._timeout=null,this._outEvent=null,this._isActive=!1,this._addBehaviour=this._addBehaviour.bind(this),this._removeBehaviour=this._removeBehaviour.bind(this),this._onTimeout=this._onTimeout.bind(this),this._resetData=this._resetData.bind(this),this._onStart=this._onStart.bind(this),this._onOut=this._onOut.bind(this),this._dragger.on("start",this._onStart))}k.prototype._addBehaviour=function(){this._isActive||(this._isActive=!0,this._dragger.on("move",this._resetData),this._dragger.on("cancel",this._removeBehaviour),this._dragger.on("end",this._removeBehaviour),window.addEventListener(q,this._onOut))},k.prototype._removeBehaviour=function(){this._isActive&&(this._dragger.off("move",this._resetData),this._dragger.off("cancel",this._removeBehaviour),this._dragger.off("end",this._removeBehaviour),window.removeEventListener(q,this._onOut),this._resetData(),this._isActive=!1)},k.prototype._resetData=function(){window.clearTimeout(this._timeout),this._timeout=null,this._outEvent=null},k.prototype._onStart=function(e){"mouse"!==e.pointerType&&this._addBehaviour()},k.prototype._onOut=function(e){this._dragger._getTrackedTouch(e)&&(this._resetData(),this._outEvent=e,this._timeout=window.setTimeout(this._onTimeout,100))},k.prototype._onTimeout=function(){var e=this._outEvent;this._resetData(),this._dragger.isActive()&&this._dragger._onCancel(e)},k.prototype.destroy=function(){q&&(this._dragger.off("start",this._onStart),this._removeBehaviour())};var _=["","webkit","moz","ms","o","Webkit","Moz","MS","O"],y={};function W(e,n){var t=y[n]||"";if(t)return t;for(var o=n[0].toUpperCase()+n.slice(1),i=0;i<_.length;){if((t=_[i]?_[i]+o:n)in e)return y[n]=t,t;++i}return""}function x(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,n),window.removeEventListener("testPassive",null,n)}catch(e){}return e}var L=window.navigator.userAgent.toLowerCase(),C=L.indexOf("edge")>-1,R=L.indexOf("trident")>-1,N=L.indexOf("firefox")>-1,B=L.indexOf("android")>-1,S=!!x()&&{passive:!0},T="touchAction",E=W(document.documentElement.style,T);function D(e,n){this._element=e,this._emitter=new v,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._isActive=!1,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this._edgeHack=null,(C||R)&&(A||w)&&(this._edgeHack=new k(this)),this.setCssProps(n),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",D._preventDefault,!1),e.addEventListener(D._inputEvents.start,this._onStart,S)}D._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},D._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},D._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},D._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},D._inputEvents=g?D._touchEvents:A?D._pointerEvents:w?D._msPointerEvents:D._mouseEvents,D._emitter=new v,D._emitterEvents={start:"start",move:"move",end:"end",cancel:"cancel"},D._activeInstances=[],D._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},D._activateInstance=function(e){D._activeInstances.indexOf(e)>-1||(D._activeInstances.push(e),D._emitter.on(D._emitterEvents.move,e._onMove),D._emitter.on(D._emitterEvents.cancel,e._onCancel),D._emitter.on(D._emitterEvents.end,e._onEnd),1===D._activeInstances.length&&D._bindListeners())},D._deactivateInstance=function(e){var n=D._activeInstances.indexOf(e);-1!==n&&(D._activeInstances.splice(n,1),D._emitter.off(D._emitterEvents.move,e._onMove),D._emitter.off(D._emitterEvents.cancel,e._onCancel),D._emitter.off(D._emitterEvents.end,e._onEnd),D._activeInstances.length||D._unbindListeners())},D._bindListeners=function(){window.addEventListener(D._inputEvents.move,D._onMove,S),window.addEventListener(D._inputEvents.end,D._onEnd,S),D._inputEvents.cancel&&window.addEventListener(D._inputEvents.cancel,D._onCancel,S)},D._unbindListeners=function(){window.removeEventListener(D._inputEvents.move,D._onMove,S),window.removeEventListener(D._inputEvents.end,D._onEnd,S),D._inputEvents.cancel&&window.removeEventListener(D._inputEvents.cancel,D._onCancel,S)},D._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},D._getTouchById=function(e,n){if("number"==typeof e.pointerId)return e.pointerId===n?e:null;if(e.changedTouches){for(var t=0;t<e.changedTouches.length;t++)if(e.changedTouches[t].identifier===n)return e.changedTouches[t];return null}return e},D._onMove=function(e){D._emitter.emit(D._emitterEvents.move,e)},D._onCancel=function(e){D._emitter.emit(D._emitterEvents.cancel,e)},D._onEnd=function(e){D._emitter.emit(D._emitterEvents.end,e)},D.prototype._reset=function(){this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._isActive=!1,D._deactivateInstance(this)},D.prototype._createEvent=function(e,n){var t=this._getTrackedTouch(n);return{type:e,srcEvent:n,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===D._emitterEvents.start?0:this.getDeltaTime(),isFirst:e===D._emitterEvents.start,isFinal:e===D._emitterEvents.end||e===D._emitterEvents.cancel,pointerType:n.pointerType||(n.touches?"touch":"mouse"),identifier:this._pointerId,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target}},D.prototype._emit=function(e,n){this._emitter.emit(e,this._createEvent(e,n))},D.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:D._getTouchById(e,this._pointerId)},D.prototype._onStart=function(e){if(!this._isDestroyed&&null===this._pointerId&&(this._pointerId=D._getEventPointerId(e),null!==this._pointerId)){var n=this._getTrackedTouch(e);this._startX=this._currentX=n.clientX,this._startY=this._currentY=n.clientY,this._startTime=Date.now(),this._isActive=!0,this._emit(D._emitterEvents.start,e),this._isActive&&D._activateInstance(this)}},D.prototype._onMove=function(e){var n=this._getTrackedTouch(e);n&&(this._currentX=n.clientX,this._currentY=n.clientY,this._emit(D._emitterEvents.move,e))},D.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(D._emitterEvents.cancel,e),this._reset())},D.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(D._emitterEvents.end,e),this._reset())},D.prototype.isActive=function(){return this._isActive},D.prototype.setTouchAction=function(e){this._touchAction=e,E&&(this._cssProps[E]="",this._element.style[E]=e),g&&(this._element.removeEventListener(D._touchEvents.start,D._preventDefault,!0),(this._element.style[E]!==e||N&&B)&&this._element.addEventListener(D._touchEvents.start,D._preventDefault,!0))},D.prototype.setCssProps=function(e){if(e){var n,t,o=this._cssProps,i=this._element;for(n in o)i.style[n]=o[n],delete o[n];for(n in e)e[n]&&(n!==T?(t=W(i.style,n))&&(o[t]="",i.style[t]=e[n]):this.setTouchAction(e[n]))}},D.prototype.getDeltaX=function(){return this._currentX-this._startX},D.prototype.getDeltaY=function(){return this._currentY-this._startY},D.prototype.getDistance=function(){var e=this.getDeltaX(),n=this.getDeltaY();return Math.sqrt(e*e+n*n)},D.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},D.prototype.on=function(e,n){this._emitter.on(e,n)},D.prototype.off=function(e,n){this._emitter.off(e,n)},D.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element;for(var n in this._edgeHack&&this._edgeHack.destroy(),this._reset(),this._emitter.destroy(),e.removeEventListener(D._inputEvents.start,this._onStart,S),e.removeEventListener("dragstart",D._preventDefault,!1),e.removeEventListener(D._touchEvents.start,D._preventDefault,!0),this._cssProps)e.style[n]=this._cssProps[n],delete this._cssProps[n];this._element=null,this._isDestroyed=!0}};var j=1e3/60,P=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout(function(){e(Date.now())},j)}).bind(window);function X(e){this._nextStep=null,this._lanes=[],this._stepQueue=[],this._stepCallbacks={},this._step=this._step.bind(this);for(var n=0;n<e;n++)this._lanes.push(new H)}function H(){this.queue=[],this.indices={},this.callbacks={}}X.prototype._step=function(e){var n,t,o,i,r,a,s=this._lanes,c=this._stepQueue,d=this._stepCallbacks;for(this._nextStep=null,n=0;n<s.length;n++){for(i=s[n].queue,r=s[n].callbacks,a=s[n].indices,t=0;t<i.length;t++)(o=i[t])&&(c.push(o),d[o]=r[o],delete r[o],delete a[o]);i.length=0}for(n=0;n<c.length;n++)d[o=c[n]]&&d[o](e),delete d[o];c.length=0},X.prototype.add=function(e,n,t){this._lanes[e].add(n,t),this._nextStep||(this._nextStep=P(this._step))},X.prototype.remove=function(e,n){this._lanes[e].remove(n)},H.prototype.add=function(e,n){var t=this.indices[e];void 0!==t&&(this.queue[t]=void 0),this.queue.push(e),this.callbacks[e]=n,this.indices[e]=this.queue.length-1},H.prototype.remove=function(e){var n=this.indices[e];void 0!==n&&(this.queue[n]=void 0,delete this.callbacks[e],delete this.indices[e])};var Y="layoutRead",I="layoutWrite",F="visibilityRead",V="visibilityWrite",G="dragStartRead",U="dragStartWrite",$="dragMoveRead",J="dragMoveWrite",K="dragScrollRead",Z="dragScrollWrite",Q="dragSortRead",ee="placeholderLayoutRead",ne="placeholderLayoutWrite",te="placeholderResizeWrite",oe="autoScrollRead",ie="autoScrollWrite",re="debounceRead",ae=new X(3);function se(e){ae.remove(0,Y+e),ae.remove(2,I+e)}function ce(e){ae.remove(0,F+e),ae.remove(2,V+e)}function de(e){ae.remove(0,G+e),ae.remove(2,U+e)}function le(e){ae.remove(0,$+e),ae.remove(2,J+e)}function pe(e){ae.remove(0,K+e),ae.remove(2,Z+e)}function Me(e,n){ae.add(1,Q+e,n)}function ue(e){ae.remove(0,ee+e),ae.remove(2,ne+e)}function be(e,n){ae.add(0,oe,e),ae.add(2,ie,n)}function he(e){return"function"==typeof e}var ze="function"==typeof WeakMap?new WeakMap:null;function Oe(e,n){var t=ze&&ze.get(e);return t||(t=window.getComputedStyle(e,null),ze&&ze.set(e,t)),t.getPropertyValue(n)}function fe(e,n){return parseFloat(Oe(e,n))||0}var me,ge=document.documentElement,Ae=document.body,we={value:0,offset:0};function ve(e){return e===window||e===ge||e===Ae?window:e}function qe(e){return e===window?e.pageXOffset:e.scrollLeft}function ke(e){return e===window?e.pageYOffset:e.scrollTop}function _e(e){return e===window?ge.scrollWidth-ge.clientWidth:e.scrollWidth-e.clientWidth}function ye(e){return e===window?ge.scrollHeight-ge.clientHeight:e.scrollHeight-e.clientHeight}function We(e,n){if(n=n||{},e===window)n.width=ge.clientWidth,n.height=ge.clientHeight,n.left=0,n.right=n.width,n.top=0,n.bottom=n.height;else{var t=e.getBoundingClientRect(),o=e.clientLeft||fe(e,"border-left-width"),i=e.clientTop||fe(e,"border-top-width");n.width=e.clientWidth,n.height=e.clientHeight,n.left=t.left+o,n.right=n.left+n.width,n.top=t.top+i,n.bottom=n.top+n.height}return n}function xe(e){return e._drag._getGrid()._settings.dragAutoScroll}function Le(e){e._drag&&e._drag._prepareScroll()}function Ce(e){if(e._drag&&e._isActive){var n=e._drag;n._scrollDiffX=n._scrollDiffY=0,e._setTranslate(n._left,n._top)}}function Re(e,n,t,o){return we.value=Math.min(o/2,e),we.offset=Math.max(0,t+2*we.value+o*n-o)/2,we}function Ne(){this.reset()}function Be(){this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0}function Se(e,n){this.pool=[],this.createItem=e,this.releaseItem=n}function Te(e,n){var t=function(e,n){return function(e,n){return!(e.left+e.width<=n.left||n.left+n.width<=e.left||e.top+e.height<=n.top||n.top+n.height<=e.top)}(e,n)?(Math.min(e.left+e.width,n.left+n.width)-Math.max(e.left,n.left))*(Math.min(e.top+e.height,n.top+n.height)-Math.max(e.top,n.top)):0}(e,n);return t?t/(Math.min(e.width,n.width)*Math.min(e.height,n.height))*100:0}Ne.prototype.reset=function(){this.isActive&&this.onStop(),this.item=null,this.element=null,this.isActive=!1,this.isEnding=!1,this.direction=null,this.value=null,this.maxValue=0,this.threshold=0,this.distance=0,this.speed=0,this.duration=0,this.action=null},Ne.prototype.hasReachedEnd=function(){return 4&this.direction?this.value>=this.maxValue:this.value<=0},Ne.prototype.computeCurrentScrollValue=function(){return null===this.value?1&this.direction?qe(this.element):ke(this.element):Math.max(0,Math.min(this.value,this.maxValue))},Ne.prototype.computeNextScrollValue=function(e){var n=this.speed*(e/1e3),t=4&this.direction?this.value+n:this.value-n;return Math.max(0,Math.min(t,this.maxValue))},Ne.prototype.computeSpeed=(me={direction:null,threshold:0,distance:0,value:0,maxValue:0,deltaTime:0,duration:0,isEnding:!1},function(e){var n=this.item,t=xe(n).speed;return he(t)?(me.direction=this.direction,me.threshold=this.threshold,me.distance=this.distance,me.value=this.value,me.maxValue=this.maxValue,me.duration=this.duration,me.speed=this.speed,me.deltaTime=e,me.isEnding=this.isEnding,t(n,this.element,me)):t}),Ne.prototype.tick=function(e){return this.isActive||(this.isActive=!0,this.onStart()),this.value=this.computeCurrentScrollValue(),this.speed=this.computeSpeed(e),this.value=this.computeNextScrollValue(e),this.duration+=e,this.value},Ne.prototype.onStart=function(){var e=this.item,n=xe(e).onStart;he(n)&&n(e,this.element,this.direction)},Ne.prototype.onStop=function(){var e=this.item,n=xe(e).onStop;he(n)&&n(e,this.element,this.direction),e._drag&&e._drag.sort()},Be.prototype.reset=function(){this.requestX&&(this.requestX.action=null),this.requestY&&(this.requestY.action=null),this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0},Be.prototype.addRequest=function(e){1&e.direction?(this.removeRequest(this.requestX),this.requestX=e):(this.removeRequest(this.requestY),this.requestY=e),e.action=this},Be.prototype.removeRequest=function(e){e&&(this.requestX===e?(this.requestX=null,e.action=null):this.requestY===e&&(this.requestY=null,e.action=null))},Be.prototype.computeScrollValues=function(){this.scrollLeft=this.requestX?this.requestX.value:qe(this.element),this.scrollTop=this.requestY?this.requestY.value:ke(this.element)},Be.prototype.scroll=function(){var e=this.element;e&&(e.scrollTo?e.scrollTo(this.scrollLeft,this.scrollTop):(e.scrollLeft=this.scrollLeft,e.scrollTop=this.scrollTop))},Se.prototype.pick=function(){return this.pool.pop()||this.createItem()},Se.prototype.release=function(e){this.releaseItem(e),-1===this.pool.indexOf(e)&&this.pool.push(e)},Se.prototype.reset=function(){this.pool.length=0};var Ee={width:0,height:0,left:0,right:0,top:0,bottom:0},De={width:0,height:0,left:0,right:0,top:0,bottom:0};function je(){this._isDestroyed=!1,this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,this._items=[],this._actions=[],this._requests={},this._requests[1]={},this._requests[2]={},this._requestOverlapCheck={},this._dragPositions={},this._dragDirections={},this._overlapCheckInterval=150,this._requestPool=new Se(function(){return new Ne},function(e){e.reset()}),this._actionPool=new Se(function(){return new Be},function(e){e.reset()}),this._readTick=this._readTick.bind(this),this._writeTick=this._writeTick.bind(this)}je.AXIS_X=1,je.AXIS_Y=2,je.FORWARD=4,je.BACKWARD=8,je.LEFT=9,je.RIGHT=5,je.UP=10,je.DOWN=6,je.smoothSpeed=function(e,n,t){return function(o,i,r){var a=0;if(!r.isEnding)if(r.threshold>0){var s=r.threshold-Math.max(0,r.distance);a=e/r.threshold*s}else a=e;var c=r.speed,d=a;return c===a?d:c<a?(d=c+n*(r.deltaTime/1e3),Math.min(a,d)):(d=c-t*(r.deltaTime/1e3),Math.max(a,d))}},je.pointerHandle=function(e){var n={left:0,top:0,width:0,height:0},t=e||1;return function(e,o,i,r,a,s,c){return n.left=s-.5*t,n.top=c-.5*t,n.width=t,n.height=t,n}},je.prototype._readTick=function(e){this._isDestroyed||(e&&this._tickTime?(this._tickDeltaTime=e-this._tickTime,this._tickTime=e,this._updateRequests(),this._updateActions()):(this._tickTime=e,this._tickDeltaTime=0))},je.prototype._writeTick=function(){this._isDestroyed||(this._applyActions(),be(this._readTick,this._writeTick))},je.prototype._startTicking=function(){this._isTicking=!0,be(this._readTick,this._writeTick)},je.prototype._stopTicking=function(){this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,ae.remove(0,oe),ae.remove(2,ie)},je.prototype._getItemHandleRect=function(e,n,t){var o=e._drag;if(n){var i=o._dragMoveEvent||o._dragStartEvent,r=n(e,o._clientX,o._clientY,e._width,e._height,i.clientX,i.clientY);t.left=r.left,t.top=r.top,t.width=r.width,t.height=r.height}else t.left=o._clientX,t.top=o._clientY,t.width=e._width,t.height=e._height;return t.right=t.left+t.width,t.bottom=t.top+t.height,t},je.prototype._requestItemScroll=function(e,n,t,o,i,r,a){var s=this._requests[n],c=s[e._id];c?c.element===t&&c.direction===o||c.reset():c=this._requestPool.pick(),c.item=e,c.element=t,c.direction=o,c.threshold=i,c.distance=r,c.maxValue=a,s[e._id]=c},je.prototype._cancelItemScroll=function(e,n){var t=this._requests[n],o=t[e._id];o&&(o.action&&o.action.removeRequest(o),this._requestPool.release(o),delete t[e._id])},je.prototype._checkItemOverlap=function(e,n,t){var o=xe(e),i=he(o.targets)?o.targets(e):o.targets,r=o.threshold,a=o.safeZone;if(!i||!i.length)return n&&this._cancelItemScroll(e,1),void(t&&this._cancelItemScroll(e,2));var s=this._dragDirections[e._id],c=s[0],d=s[1];if(!c&&!d)return n&&this._cancelItemScroll(e,1),void(t&&this._cancelItemScroll(e,2));for(var l=this._getItemHandleRect(e,o.handle,Ee),p=De,M=null,u=null,b=!0,h=!0,z=0,O=0,f=null,m=null,g=0,A=0,w=0,v=null,q=-1/0,k=0,_=0,y=null,W=0,x=0,L=null,C=-1/0,R=0,N=0,B=null,S=0,T=0,E=0;E<i.length;E++)M=i[E],b=n&&c&&2!==M.axis,h=t&&d&&1!==M.axis,O=M.priority||0,(!b||O<q)&&(!h||O<C)||(u=ve(M.element||M),A=b?_e(u):-1,w=h?ye(u):-1,(A||w)&&((z=Te(l,p=We(u,p)))<=0||(b&&O>=q&&A>0&&(O>q||z>_)&&(m=null,f=Re("number"==typeof M.threshold?M.threshold:r,a,l.width,p.width),5===c?(g=p.right+f.offset-l.right)<=f.value&&qe(u)<A&&(m=5):9===c&&(g=l.left-(p.left-f.offset))<=f.value&&qe(u)>0&&(m=9),null!==m&&(v=u,q=O,k=f.value,_=z,y=m,W=g,x=A)),h&&O>=C&&w>0&&(O>C||z>N)&&(m=null,f=Re("number"==typeof M.threshold?M.threshold:r,a,l.height,p.height),6===d?(g=p.bottom+f.offset-l.bottom)<=f.value&&ke(u)<w&&(m=6):10===d&&(g=l.top-(p.top-f.offset))<=f.value&&ke(u)>0&&(m=10),null!==m&&(L=u,C=O,R=f.value,N=z,B=m,S=g,T=w)))));n&&(v?this._requestItemScroll(e,1,v,y,k,W,x):this._cancelItemScroll(e,1)),t&&(L?this._requestItemScroll(e,2,L,B,R,S,T):this._cancelItemScroll(e,2))},je.prototype._updateScrollRequest=function(e){for(var n=e.item,t=xe(n),o=he(t.targets)?t.targets(n):t.targets,i=o&&o.length||0,r=t.threshold,a=t.safeZone,s=this._getItemHandleRect(n,t.handle,Ee),c=De,d=null,l=null,p=!1,M=null,u=null,b=null,h=null,z=null,O=0;O<i;O++)if((l=ve((d=o[O]).element||d))===e.element){if(p=!!(1&e.direction)){if(2===d.axis)continue}else if(1===d.axis)continue;if((h=p?_e(l):ye(l))<=0)break;if(Te(s,c=We(l,c))<=0)break;if(M=Re("number"==typeof d.threshold?d.threshold:r,a,p?s.width:s.height,p?c.width:c.height),(u=9===e.direction?s.left-(c.left-M.offset):5===e.direction?c.right+M.offset-s.right:10===e.direction?s.top-(c.top-M.offset):c.bottom+M.offset-s.bottom)>M.value)break;if(b=p?qe(l):ke(l),z=4&e.direction?b>=h:b<=0)break;return e.maxValue=h,e.threshold=M.value,e.distance=u,e.isEnding=!1,!0}return!0===t.smoothStop&&e.speed>0?(null===z&&(z=e.hasReachedEnd()),e.isEnding=!z):e.isEnding=!1,e.isEnding},je.prototype._updateRequests=function(){for(var e,n,t,o,i,r,a,s=this._items,c=this._requests[1],d=this._requests[2],l=0;l<s.length;l++)e=s[l],i=(o=this._requestOverlapCheck[e._id])>0&&this._tickTime-o>this._overlapCheckInterval,r=!0,(n=c[e._id])&&n.isActive&&(r=!this._updateScrollRequest(n))&&(i=!0,this._cancelItemScroll(e,1)),a=!0,(t=d[e._id])&&t.isActive&&(a=!this._updateScrollRequest(t))&&(i=!0,this._cancelItemScroll(e,2)),i&&(this._requestOverlapCheck[e._id]=0,this._checkItemOverlap(e,r,a))},je.prototype._requestAction=function(e,n){for(var t=this._actions,o=1===n,i=null,r=0;r<t.length;r++){if(i=t[r],e.element===i.element){if(o?i.requestX:i.requestY)return void this._cancelItemScroll(e.item,n);break}i=null}i||(i=this._actionPool.pick()),i.element=e.element,i.addRequest(e),e.tick(this._tickDeltaTime),t.push(i)},je.prototype._updateActions=function(){var e,n,t,o,i=this._items,r=this._requests,a=this._actions;for(o=0;o<i.length;o++)e=i[o]._id,n=r[1][e],t=r[2][e],n&&this._requestAction(n,1),t&&this._requestAction(t,2);for(o=0;o<a.length;o++)a[o].computeScrollValues()},je.prototype._applyActions=function(){var e,n=this._actions,t=this._items;if(n.length){for(e=0;e<n.length;e++)n[e].scroll(),this._actionPool.release(n[e]);for(n.length=0,e=0;e<t.length;e++)Le(t[e]);for(e=0;e<t.length;e++)Ce(t[e])}},je.prototype._updateDragDirection=function(e){var n=this._dragPositions[e._id],t=this._dragDirections[e._id],o=e._drag._left,i=e._drag._top;if(n.length){var r=n[0],a=n[1];t[0]=o>r?5:o<r?9:t[0]||0,t[1]=i>a?6:i<a?10:t[1]||0}n[0]=o,n[1]=i},je.prototype.addItem=function(e){this._isDestroyed||-1===this._items.indexOf(e)&&(this._items.push(e),this._requestOverlapCheck[e._id]=this._tickTime,this._dragDirections[e._id]=[0,0],this._dragPositions[e._id]=[],this._isTicking||this._startTicking())},je.prototype.updateItem=function(e){this._isDestroyed||this._dragDirections[e._id]&&(this._updateDragDirection(e),this._requestOverlapCheck[e._id]||(this._requestOverlapCheck[e._id]=this._tickTime))},je.prototype.removeItem=function(e){if(!this._isDestroyed){var n=this._items.indexOf(e);if(-1!==n){var t=e._id;this._requests[1][t]&&(this._cancelItemScroll(e,1),delete this._requests[1][t]),this._requests[2][t]&&(this._cancelItemScroll(e,2),delete this._requests[2][t]),delete this._requestOverlapCheck[t],delete this._dragPositions[t],delete this._dragDirections[t],this._items.splice(n,1),this._isTicking&&!this._items.length&&this._stopTicking()}}},je.prototype.isItemScrollingX=function(e){var n=this._requests[1][e._id];return!(!n||!n.isActive)},je.prototype.isItemScrollingY=function(e){var n=this._requests[2][e._id];return!(!n||!n.isActive)},je.prototype.isItemScrolling=function(e){return this.isItemScrollingX(e)||this.isItemScrollingY(e)},je.prototype.destroy=function(){if(!this._isDestroyed){for(var e=this._items.slice(0),n=0;n<e.length;n++)this.removeItem(e[n]);this._actions.length=0,this._requestPool.reset(),this._actionPool.reset(),this._isDestroyed=!0}};var Pe=window.Element.prototype,Xe=Pe.matches||Pe.matchesSelector||Pe.webkitMatchesSelector||Pe.mozMatchesSelector||Pe.msMatchesSelector||Pe.oMatchesSelector||function(){return!1};function He(e,n){return Xe.call(e,n)}function Ye(e,n){n&&(e.classList?e.classList.add(n):He(e,"."+n)||(e.className+=" "+n))}var Ie=[];function Fe(e,n,t){var o="number"==typeof t?t:-1;o<0&&(o=e.length-o+1),e.splice.apply(e,Ie.concat(o,0,n)),Ie.length=0}function Ve(e,n,t){var o=Math.max(0,e.length-1+(t||0));return n>o?o:n<0?Math.max(o+n+1,0):n}function Ge(e,n,t){if(!(e.length<2)){var o=Ve(e,n),i=Ve(e,t);o!==i&&e.splice(i,0,e.splice(o,1)[0])}}function Ue(e,n,t){if(!(e.length<2)){var o,i=Ve(e,n),r=Ve(e,t);i!==r&&(o=e[i],e[i]=e[r],e[r]=o)}}var $e=W(document.documentElement.style,"transform")||"transform",Je=/([A-Z])/g,Ke=/^(webkit-|moz-|ms-|o-)/,Ze=/^(-m-s-)/;function Qe(e){var n=e.replace(Je,"-$1").toLowerCase();return(n=n.replace(Ke,"-$1")).replace(Ze,"-ms-")}var en=Qe($e);function nn(e){var n=Oe(e,en);if(!n||"none"===n)return!1;var t=Oe(e,"display");return"inline"!==t&&"none"!==t}function tn(e){for(var n=document,t=e||n;t&&t!==n&&"static"===Oe(t,"position")&&!nn(t);)t=t.parentElement||n;return t}var on={},rn={},an={};function sn(e,n){var t,o=n||{};return o.left=0,o.top=0,e===document||(o.left=window.pageXOffset||0,o.top=window.pageYOffset||0,e.self===window.self||(t=e.getBoundingClientRect(),o.left+=t.left,o.top+=t.top,o.left+=fe(e,"border-left-width"),o.top+=fe(e,"border-top-width"))),o}function cn(e,n,t){return an.left=0,an.top=0,e===n||t&&(e=tn(e))===(n=tn(n))||(sn(e,on),sn(n,rn),an.left=rn.left-on.left,an.top=rn.top-on.top),an}function dn(e){return"auto"===e||"scroll"===e||"overlay"===e}function ln(e){return dn(Oe(e,"overflow"))||dn(Oe(e,"overflow-x"))||dn(Oe(e,"overflow-y"))}function pn(e,n){for(n=n||[];e&&e!==document;)e.getRootNode&&e instanceof DocumentFragment?e=e.getRootNode().host:(ln(e)&&n.push(e),e=e.parentNode);return n.push(window),n}var Mn={},un=/^matrix3d/,bn=/([^,]*,){4}/,hn=/([^,]*,){12}/,zn=/[^,]*,/;function On(e){Mn.x=0,Mn.y=0;var n=Oe(e,en);if(!n||"none"===n)return Mn;var t=un.test(n),o=n.replace(t?hn:bn,""),i=o.replace(zn,"");return Mn.x=parseFloat(o)||0,Mn.y=parseFloat(i)||0,Mn}function fn(e,n){n&&(e.classList?e.classList.remove(n):He(e,"."+n)&&(e.className=(" "+e.className+" ").replace(" "+n+" "," ").trim()))}var mn,gn,An,wn,vn=/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1,qn=!!x()&&{passive:!0};function kn(e){var n=e._element,t=e.getGrid(),o=t._settings;this._item=e,this._gridId=t._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=he(o.dragStartPredicate)?o.dragStartPredicate:kn.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._isSortNeeded=!1,this._sortTimer=void 0,this._blockedSortIndex=null,this._sortX1=0,this._sortX2=0,this._sortY1=0,this._sortY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareStart=this._prepareStart.bind(this),this._applyStart=this._applyStart.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._handleSort=this._handleSort.bind(this),this._handleSortDelayed=this._handleSortDelayed.bind(this),this._handle=o.dragHandle&&n.querySelector(o.dragHandle)||n,this._dragger=new D(this._handle,o.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function _n(e,n){var t,o,i={};if(Array.isArray(n))for(o=0;o<n.length;o++)i[t=n[o]]=Oe(e,Qe(t));else for(t in n)i[t]=Oe(e,Qe(t));return i}kn.autoScroller=new je,kn.defaultStartPredicate=function(e,n,t){var o=e._drag;if(n.isFirst&&n.srcEvent.button)return!1;if(!vn&&n.isFirst&&!0===n.srcEvent.isTrusted&&!1===n.srcEvent.defaultPrevented&&!1===n.srcEvent.cancelable)return!1;if(!n.isFinal){var i=o._startPredicateData;if(!i){var r=t||o._getGrid()._settings.dragStartPredicate||{};o._startPredicateData=i={distance:Math.max(r.distance,0)||0,delay:Math.max(r.delay,0)||0}}return i.delay&&(i.event=n,i.delayTimer||(i.delayTimer=window.setTimeout(function(){i.delay=0,o._resolveStartPredicate(i.event)&&(o._forceResolveStartPredicate(i.event),o._resetStartPredicate())},i.delay))),o._resolveStartPredicate(n)}o._finishStartPredicate(n)},kn.defaultSortPredicate=(mn={},gn={},An={},wn=[],function(e,n){var t=e._drag,o=t._getGrid(),i=n&&"number"==typeof n.threshold?n.threshold:50,s=n&&n.action===r?r:a,c=n&&n.migrateAction===r?r:a;i=Math.min(Math.max(i,1),100),mn.width=e._width,mn.height=e._height,mn.left=t._clientX,mn.top=t._clientY;var d=function(e,n,t){var o,i,r,a,s,c,d,l,p,M,u=null,b=n._settings.dragSort,h=-1;if(!0===b?(wn[0]=n,i=wn):he(b)&&(i=b.call(n,e)),!i||!Array.isArray(i)||!i.length)return u;for(M=0;M<i.length;M++)if(!(r=i[M])._isDestroyed){for(r._updateBoundingRect(),c=Math.max(0,r._left),d=Math.max(0,r._top),l=Math.min(window.innerWidth,r._right),p=Math.min(window.innerHeight,r._bottom),a=r._element.parentNode;a&&a!==document&&a!==document.documentElement&&a!==document.body;)if(a.getRootNode&&a instanceof DocumentFragment)a=a.getRootNode().host;else{if("visible"!==Oe(a,"overflow")&&(s=a.getBoundingClientRect(),c=Math.max(c,s.left),d=Math.max(d,s.top),l=Math.min(l,s.right),p=Math.min(p,s.bottom)),"fixed"===Oe(a,"position"))break;a=a.parentNode}c>=l||d>=p||(gn.left=c,gn.top=d,gn.width=l-c,gn.height=p-d,(o=Te(mn,gn))>t&&o>h&&(h=o,u=r))}return wn.length=0,u}(e,o,i);if(!d)return null;var l,p,M,u=e.getGrid()!==d,b=0,h=0,z=0,O=-1,f=!1;for(d===o?(mn.left=t._gridX+e._marginLeft,mn.top=t._gridY+e._marginTop):(d._updateBorders(1,0,1,0),b=d._left+d._borderLeft,h=d._top+d._borderTop),M=0;M<d._items.length;M++)(l=d._items[M])._isActive&&l!==e&&(f=!0,gn.width=l._width,gn.height=l._height,gn.left=l._left+l._marginLeft+b,gn.top=l._top+l._marginTop+h,(p=Te(mn,gn))>z&&(O=M,z=p));return u&&z<i&&(O=f?O:0,z=i),z>=i?(An.grid=d,An.index=O,An.action=u?c:s,An):null}),kn.prototype.stop=function(){if(this._isActive)if(this._isMigrating)this._finishMigration();else{var e=this._item,n=e._id;if(kn.autoScroller.removeItem(e),de(n),le(n),pe(n),this._cancelSort(),this._isStarted){this._unbindScrollListeners();var t=e._element,o=this._getGrid(),i=o._settings.itemDraggingClass;t.parentNode!==o._element&&(o._element.appendChild(t),e._setTranslate(this._gridX,this._gridY),i&&t.clientWidth),fn(t,i)}this._reset()}},kn.prototype.sort=function(e){var n=this._item;this._isActive&&n._isActive&&this._dragMoveEvent&&(!0===e?this._handleSort():Me(n._id,this._handleSort))},kn.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._dragger.destroy(),kn.autoScroller.removeItem(this._item),this._isDestroyed=!0)},kn.prototype._getGrid=function(){return o[this._gridId]||null},kn.prototype._reset=function(){this._isActive=!1,this._isStarted=!1,this._container=null,this._containingBlock=null,this._dragStartEvent=null,this._dragMoveEvent=null,this._dragPrevMoveEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._clientX=0,this._clientY=0,this._scrollDiffX=0,this._scrollDiffY=0,this._moveDiffX=0,this._moveDiffY=0,this._containerDiffX=0,this._containerDiffY=0},kn.prototype._bindScrollListeners=function(){var e,n,t=this._getGrid()._element,o=this._container,i=this._scrollers;if(i.length=0,pn(this._item._element.parentNode,i),o!==t)for(pn(t,e=[]),n=0;n<e.length;n++)i.indexOf(e[n])<0&&i.push(e[n]);for(n=0;n<i.length;n++)i[n].addEventListener("scroll",this._onScroll,qn)},kn.prototype._unbindScrollListeners=function(){var e,n=this._scrollers;for(e=0;e<n.length;e++)n[e].removeEventListener("scroll",this._onScroll,qn);n.length=0},kn.prototype._resolveStartPredicate=function(e){var n=this._startPredicateData;if(!(e.distance<n.distance||n.delay))return this._resetStartPredicate(),!0},kn.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},kn.prototype._finishStartPredicate=function(e){var n=this._item._element,t=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),t&&function(e){if("a"===e.tagName.toLowerCase()){var n=e.getAttribute("href");if(n){var t=e.getAttribute("target");t&&"_self"!==t?window.open(n,t):window.location.href=n}}}(n)},kn.prototype._resetHeuristics=function(e,n){this._blockedSortIndex=null,this._sortX1=this._sortX2=e,this._sortY1=this._sortY2=n},kn.prototype._checkHeuristics=function(e,n){var t=this._getGrid()._settings.dragSortHeuristics,o=t.minDragDistance;if(o<=0)return this._blockedSortIndex=null,!0;var i=e-this._sortX2,r=n-this._sortY2,a=o>3&&t.minBounceBackAngle>0;if(a||(this._blockedSortIndex=null),Math.abs(i)>o||Math.abs(r)>o){if(a){var s=Math.atan2(i,r),c=Math.atan2(this._sortX2-this._sortX1,this._sortY2-this._sortY1),d=Math.atan2(Math.sin(s-c),Math.cos(s-c));Math.abs(d)>t.minBounceBackAngle&&(this._blockedSortIndex=null)}return this._sortX1=this._sortX2,this._sortY1=this._sortY2,this._sortX2=e,this._sortY2=n,!0}return!1},kn.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},kn.prototype._handleSort=function(){if(this._isActive){var e=this._getGrid()._settings;if(!e.dragSort||!e.dragAutoScroll.sortDuringScroll&&kn.autoScroller.isItemScrolling(this._item))return this._sortX1=this._sortX2=this._gridX,this._sortY1=this._sortY2=this._gridY,this._isSortNeeded=!0,void(void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)));var n=this._checkHeuristics(this._gridX,this._gridY);if(this._isSortNeeded||n){var t=e.dragSortHeuristics.sortInterval;t<=0||this._isSortNeeded?(this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),this._checkOverlap()):void 0===this._sortTimer&&(this._sortTimer=window.setTimeout(this._handleSortDelayed,t))}}},kn.prototype._handleSortDelayed=function(){this._isSortNeeded=!0,this._sortTimer=void 0,Me(this._item._id,this._handleSort)},kn.prototype._cancelSort=function(){var e;this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),e=this._item._id,ae.remove(1,Q+e)},kn.prototype._finishSort=function(){var e=this._getGrid()._settings.dragSort&&(this._isSortNeeded||void 0!==this._sortTimer);this._cancelSort(),e&&this._checkOverlap()},kn.prototype._checkOverlap=function(){if(this._isActive){var e,n,t,o,i,s,c,d,l=this._item,p=this._getGrid()._settings;(e=he(p.dragSortPredicate)?p.dragSortPredicate(l,this._dragMoveEvent):kn.defaultSortPredicate(l,p.dragSortPredicate))&&"number"==typeof e.index&&(c=e.action===r?r:a,d=(n=l.getGrid())!==(o=e.grid||n),t=n._items.indexOf(l),i=Ve(o._items,e.index,d&&c===a?1:0),(d||i!==this._blockedSortIndex)&&(d?(this._blockedSortIndex=null,s=o._items[i],n._hasListeners(z)&&n._emit(z,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),o._hasListeners(f)&&o._emit(f,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),l._gridId=o._id,this._isMigrating=l._gridId!==this._gridId,n._items.splice(t,1),Fe(o._items,l,i),l._sortData=null,n._hasListeners(h)&&n._emit(h,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),o._hasListeners(O)&&o._emit(O,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),c===r&&s&&s.isActive()&&o._items.indexOf(s)>-1&&o.send(s,n,t,{appendTo:this._container||document.body,layoutSender:!1,layoutReceiver:!1}),n.layout(),o.layout()):t!==i&&(this._blockedSortIndex=t,(c===r?Ue:Ge)(n._items,t,i),n._hasListeners(b)&&n._emit(b,{item:l,fromIndex:t,toIndex:i,action:c}),n.layout())))}},kn.prototype._finishMigration=function(){var e,n,t=this._item,o=t._dragRelease,i=t._element,r=t._isActive,a=t.getGrid(),s=a._element,c=a._settings,d=c.dragContainer||s,l=this._getGrid()._settings,p=i.parentNode,M=r?l.itemVisibleClass:l.itemHiddenClass,u=r?c.itemVisibleClass:c.itemHiddenClass;this._isMigrating=!1,this.destroy(),l.itemClass!==c.itemClass&&(fn(i,l.itemClass),Ye(i,c.itemClass)),M!==u&&(fn(i,M),Ye(i,u)),d!==p&&(d.appendChild(i),n=cn(p,d,!0),(e=On(i)).x-=n.left,e.y-=n.top),t._refreshDimensions(),n=cn(d,s,!0),o._containerDiffX=n.left,o._containerDiffY=n.top,t._drag=c.dragEnabled?new kn(t):null,d!==p&&t._setTranslate(e.x,e.y),t._visibility.setStyles(r?c.visibleStyles:c.hiddenStyles),o.start()},kn.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._resetStartPredicate(e),this._dragger._reset(),this._startPredicateState=0)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},kn.prototype._preEndCheck=function(e){var n=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,n&&this._isActive&&(this._isStarted?this._onEnd(e):this.stop())},kn.prototype._onStart=function(e){var n,t,o,i=this._item;i._isActive&&(this._isActive=!0,this._dragStartEvent=e,kn.autoScroller.addItem(i),n=i._id,t=this._prepareStart,o=this._applyStart,ae.add(0,G+n,t),ae.add(2,U+n,o))},kn.prototype._prepareStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var n=e._element,t=this._getGrid(),o=t._settings,i=t._element,r=o.dragContainer||i,a=tn(r),s=On(n),c=n.getBoundingClientRect(),d=r!==i;if(this._container=r,this._containingBlock=a,this._clientX=c.left,this._clientY=c.top,this._left=this._gridX=s.x,this._top=this._gridY=s.y,this._scrollDiffX=this._scrollDiffY=0,this._moveDiffX=this._moveDiffY=0,this._resetHeuristics(this._gridX,this._gridY),d){var l=cn(a,i);this._containerDiffX=l.left,this._containerDiffY=l.top}}}},kn.prototype._applyStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var n=this._getGrid(),t=e._element,o=e._dragRelease,i=e._migrate,r=this._container!==n._element;e.isPositioning()&&e._layout.stop(!0,this._left,this._top),i._isActive&&(this._left-=i._containerDiffX,this._top-=i._containerDiffY,this._gridX-=i._containerDiffX,this._gridY-=i._containerDiffY,i.stop(!0,this._left,this._top)),e.isReleasing()&&o._reset(),n._settings.dragPlaceholder.enabled&&e._dragPlaceholder.create(),this._isStarted=!0,n._emit("dragInit",e,this._dragStartEvent),r&&(t.parentNode===this._container?(this._gridX-=this._containerDiffX,this._gridY-=this._containerDiffY):(this._left+=this._containerDiffX,this._top+=this._containerDiffY,this._container.appendChild(t),e._setTranslate(this._left,this._top))),Ye(t,n._settings.itemDraggingClass),this._bindScrollListeners(),n._emit("dragStart",e,this._dragStartEvent)}}},kn.prototype._onMove=function(e){var n,t,o,i=this._item;i._isActive?(this._dragMoveEvent=e,n=i._id,t=this._prepareMove,o=this._applyMove,ae.add(0,$+n,t),ae.add(2,J+n,o),Me(i._id,this._handleSort)):this.stop()},kn.prototype._prepareMove=function(){if(this._isActive&&this._item._isActive){var e=this._getGrid()._settings.dragAxis,n=this._dragMoveEvent,t=this._dragPrevMoveEvent||this._dragStartEvent||n;if("y"!==e){var o=n.clientX-t.clientX;this._left=this._left-this._moveDiffX+o,this._gridX=this._gridX-this._moveDiffX+o,this._clientX=this._clientX-this._moveDiffX+o,this._moveDiffX=o}if("x"!==e){var i=n.clientY-t.clientY;this._top=this._top-this._moveDiffY+i,this._gridY=this._gridY-this._moveDiffY+i,this._clientY=this._clientY-this._moveDiffY+i,this._moveDiffY=i}this._dragPrevMoveEvent=n}},kn.prototype._applyMove=function(){if(this._isActive){var e=this._item;e._isActive&&(this._moveDiffX=this._moveDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragMoveEvent),kn.autoScroller.updateItem(e))}},kn.prototype._onScroll=function(e){var n,t,o,i=this._item;i._isActive?(this._scrollEvent=e,n=i._id,t=this._prepareScroll,o=this._applyScroll,ae.add(0,K+n,t),ae.add(2,Z+n,o),Me(i._id,this._handleSort)):this.stop()},kn.prototype._prepareScroll=function(){if(this._isActive){var e=this._item;if(e._isActive){var n=e._element,t=this._getGrid()._element,o=n.getBoundingClientRect();if(this._container!==t){var i=cn(this._containingBlock,t);this._containerDiffX=i.left,this._containerDiffY=i.top}var r=this._clientX-this._moveDiffX-o.left;this._left=this._left-this._scrollDiffX+r,this._scrollDiffX=r;var a=this._clientY-this._moveDiffY-o.top;this._top=this._top-this._scrollDiffY+a,this._scrollDiffY=a,this._gridX=this._left-this._containerDiffX,this._gridY=this._top-this._containerDiffY}}},kn.prototype._applyScroll=function(){if(this._isActive){var e=this._item;e._isActive&&(this._scrollDiffX=this._scrollDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))}},kn.prototype._onEnd=function(e){var n=this._item,t=n._element,o=this._getGrid(),i=o._settings,r=n._dragRelease;n._isActive?(de(n._id),le(n._id),pe(n._id),this._finishSort(),this._unbindScrollListeners(),r._containerDiffX=this._containerDiffX,r._containerDiffY=this._containerDiffY,this._reset(),fn(t,i.itemDraggingClass),kn.autoScroller.removeItem(n),o._emit("dragEnd",n,e),this._isMigrating?this._finishMigration():r.start()):this.stop()};var yn=/^(webkit|moz|ms|o|Webkit|Moz|MS|O)(?=[A-Z])/,Wn={};function xn(e){var n=Wn[e];return n||((n=e.replace(yn,""))!==e&&(n=n[0].toLowerCase()+n.slice(1)),Wn[e]=n,n)}function Ln(e,n){for(var t in n)e.style[t]=n[t]}var Cn,Rn,Nn=!(!Element||!he(Element.prototype.animate)),Bn=!!(Element&&(Cn=Element.prototype.animate,Rn=window.Symbol,Cn&&he(Rn)&&he(Rn.toString)&&Rn(Cn).toString().indexOf("[native code]")>-1));function Sn(e){this._element=e,this._animation=null,this._duration=0,this._easing="",this._callback=null,this._props=[],this._values=[],this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}function Tn(e,n){var t={};for(var o in e)t[n?o:xn(o)]=e[o];return t}function En(e,n){return"translateX("+e+"px) translateY("+n+"px)"}function Dn(e){this._item=e,this._animation=new Sn,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._left=0,this._top=0,this._transX=0,this._transY=0,this._nextTransX=0,this._nextTransY=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._updateDimensions=this._updateDimensions.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this),this._onHide=this._onHide.bind(this)}function jn(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Pn(e){var n=e._element,t=n.style;this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._nextLeft=0,this._nextTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animOptions={onFinish:this._finish.bind(this),duration:0,easing:0},t.left="0px",t.top="0px",e._setTranslate(0,0),this._animation=new Sn(n),this._queue="layout-"+e._id,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}function Xn(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}function Hn(e){var n=e._isActive,t=e._element,o=t.children[0],i=e.getGrid()._settings;if(!o)throw new Error("No valid child element found within item element.");this._item=e,this._isDestroyed=!1,this._isHidden=!n,this._isHiding=!1,this._isShowing=!1,this._childElement=o,this._currentStyleProps=[],this._animation=new Sn(o),this._queue="visibility-"+e._id,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),t.style.display=n?"":"none",Ye(t,n?i.itemVisibleClass:i.itemHiddenClass),this.setStyles(n?i.visibleStyles:i.hiddenStyles)}Sn.prototype.start=function(e,n,t){if(!this._isDestroyed){var o=this._element,i=t||{};if(!Nn)return Ln(o,n),this._callback=he(i.onFinish)?i.onFinish:null,void this._onFinish();var r,a,s,c=this._animation,d=this._props,l=this._values,p=i.duration||300,M=i.easing||"ease",u=!1;if(c&&(a=0,p===this._duration&&M===this._easing||(u=!0),!u)){for(r in n)if(++a,-1===(s=d.indexOf(r))||n[r]!==l[s]){u=!0;break}a!==d.length&&(u=!0)}if(u&&c.cancel(),this._callback=he(i.onFinish)?i.onFinish:null,!c||u){for(r in d.length=l.length=0,n)d.push(r),l.push(n[r]);this._duration=p,this._easing=M,this._animation=o.animate([Tn(e,Bn),Tn(n,Bn)],{duration:p,easing:M}),this._animation.onfinish=this._onFinish,Ln(o,n)}}},Sn.prototype.stop=function(){!this._isDestroyed&&this._animation&&(this._animation.cancel(),this._animation=this._callback=null,this._props.length=this._values.length=0)},Sn.prototype.getCurrentStyles=function(){return _n(element,currentProps)},Sn.prototype.isAnimating=function(){return!!this._animation},Sn.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=null,this._isDestroyed=!0)},Sn.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()},Dn.prototype._updateDimensions=function(){this.isActive()&&Ln(this._element,{width:this._item._width+"px",height:this._item._height+"px"})},Dn.prototype._onLayoutStart=function(e,n){var t=this._item;if(-1!==e.indexOf(t)){var o=t._left,i=t._top,r=this._left,a=this._top;if(this._left=o,this._top=i,n||this._didMigrate||r!==o||a!==i){var s,c,d,l=o+t._marginLeft,p=i+t._marginTop,M=t.getGrid();if(n||!(M._settings.layoutDuration>0)||this._didMigrate)return ue(t._id),this._element.style[$e]=En(l,p),this._animation.stop(),void(this._didMigrate&&(M.getElement().appendChild(this._element),this._didMigrate=!1));this._nextTransX=l,this._nextTransY=p,s=t._id,c=this._setupAnimation,d=this._startAnimation,ae.add(0,ee+s,c),ae.add(2,ne+s,d)}}else this.reset()},Dn.prototype._setupAnimation=function(){if(this.isActive()){var e=On(this._element);this._transX=e.x,this._transY=e.y}},Dn.prototype._startAnimation=function(){if(this.isActive()){var e=this._animation,n=this._transX,t=this._transY,o=this._nextTransX,i=this._nextTransY;if(n!==o||t!==i){var r=this._item.getGrid()._settings,a={},s={};a[$e]=En(n,t),s[$e]=En(o,i),e.start(a,s,{duration:r.layoutDuration,easing:r.layoutEasing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&(this._element.style[$e]=En(o,i),e.stop())}},Dn.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},Dn.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animation.isAnimating())return void this.reset();this._resetAfterLayout=!0}},Dn.prototype._onMigrate=function(e){if(e.item===this._item){var n=this._item.getGrid(),t=e.toGrid;n.off(m,this._onReleaseEnd),n.off(s,this._onLayoutStart),n.off(z,this._onMigrate),n.off(p,this._onHide),t.on(m,this._onReleaseEnd),t.on(s,this._onLayoutStart),t.on(z,this._onMigrate),t.on(p,this._onHide),this._didMigrate=!0}},Dn.prototype._onHide=function(e){e.indexOf(this._item)>-1&&this.reset()},Dn.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,n=this._item,t=n.getGrid(),o=t._settings,i=this._animation;this._left=n._left,this._top=n._top,e=he(o.dragPlaceholder.createElement)?o.dragPlaceholder.createElement(n):document.createElement("div"),this._element=e,i._element=e,this._className=o.itemPlaceholderClass||"",this._className&&Ye(e,this._className),Ln(e,{position:"absolute",left:"0px",top:"0px",width:n._width+"px",height:n._height+"px"}),e.style[$e]=En(n._left+n._marginLeft,n._top+n._marginTop),t.on(s,this._onLayoutStart),t.on(m,this._onReleaseEnd),t.on(z,this._onMigrate),t.on(p,this._onHide),he(o.dragPlaceholder.onCreate)&&o.dragPlaceholder.onCreate(n,e),t.getElement().appendChild(e)}},Dn.prototype.reset=function(){if(this.isActive()){var e,n=this._element,t=this._item,o=t.getGrid(),i=o._settings,r=this._animation;this._resetAfterLayout=!1,ue(t._id),e=t._id,ae.remove(2,te+e),r.stop(),r._element=null,o.off(m,this._onReleaseEnd),o.off(s,this._onLayoutStart),o.off(z,this._onMigrate),o.off(p,this._onHide),this._className&&(fn(n,this._className),this._className=""),n.parentNode.removeChild(n),this._element=null,he(i.dragPlaceholder.onRemove)&&i.dragPlaceholder.onRemove(t,n)}},Dn.prototype.isActive=function(){return!!this._element},Dn.prototype.getElement=function(){return this._element},Dn.prototype.updateDimensions=function(){var e,n;this.isActive()&&(e=this._item._id,n=this._updateDimensions,ae.add(2,te+e,n))},Dn.prototype.destroy=function(){this.reset(),this._animation.destroy(),this._item=this._animation=null},jn.prototype.start=function(){if(!this._isDestroyed&&!this._isActive){var e=this._item,n=e.getGrid(),t=n._settings;this._isActive=!0,Ye(e._element,t.itemReleasingClass),t.dragRelease.useDragContainer||this._placeToGrid(),n._emit("dragReleaseStart",e),n._nextLayoutData||e._layout.start(!1)}},jn.prototype.stop=function(e,n,t){if(!this._isDestroyed&&this._isActive){var o=this._item,i=o.getGrid();e||void 0!==n&&void 0!==t||(n=o._left,t=o._top);var r=this._placeToGrid(n,t);this._reset(r),e||i._emit(m,o)}},jn.prototype.isJustReleased=function(){return this._isActive&&!1===this._isPositioningStarted},jn.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},jn.prototype._placeToGrid=function(e,n){if(!this._isDestroyed){var t=this._item,o=t._element,i=t.getGrid()._element,r=!1;if(o.parentNode!==i){if(void 0===e||void 0===n){var a=On(o);e=a.x-this._containerDiffX,n=a.y-this._containerDiffY}i.appendChild(o),t._setTranslate(e,n),r=!0}return this._containerDiffX=0,this._containerDiffY=0,r}},jn.prototype._reset=function(e){if(!this._isDestroyed){var n=this._item,t=n.getGrid()._settings.itemReleasingClass;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,t&&(e&&n._element.clientWidth,fn(n._element,t))}},Pn.prototype.start=function(e,n){if(!this._isDestroyed){var t,o,i,r=this._item,a=r._dragRelease,s=r.getGrid()._settings,c=this._isActive,d=a.isJustReleased(),l=d?s.dragRelease.duration:s.layoutDuration,p=d?s.dragRelease.easing:s.layoutEasing,M=!e&&!this._skipNextAnimation&&l>0;if(c&&(se(r._id),r._emitter.burst(this._queue,!0,r)),d&&(a._isPositioningStarted=!0),he(n)&&r._emitter.on(this._queue,n),this._skipNextAnimation=!1,!M)return this._updateOffsets(),r._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._animation.isAnimating()&&(this._animation._animation.onfinish=null),this._isActive=!0,this._animOptions.easing=p,this._animOptions.duration=l,this._isInterrupted=c,t=r._id,o=this._setupAnimation,i=this._startAnimation,ae.add(0,Y+t,o),ae.add(2,I+t,i)}},Pn.prototype.stop=function(e,n,t){if(!this._isDestroyed&&this._isActive){var o=this._item;if(se(o._id),this._animation.isAnimating()){if(void 0===n||void 0===t){var i=On(o._element);n=i.x,t=i.y}o._setTranslate(n,t),this._animation.stop()}fn(o._element,o.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&o._emitter.burst(this._queue,!0,o)}},Pn.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item._element.style;this.stop(!0,0,0),this._item._emitter.clear(this._queue),this._animation.destroy(),e[$e]="",e.left="",e.top="",this._item=null,this._currentStyles=null,this._targetStyles=null,this._animOptions=null,this._isDestroyed=!0}},Pn.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,n=e._migrate,t=e._dragRelease;this._offsetLeft=t._isActive?t._containerDiffX:n._isActive?n._containerDiffX:0,this._offsetTop=t._isActive?t._containerDiffY:n._isActive?n._containerDiffY:0,this._nextLeft=this._item._left+this._offsetLeft,this._nextTop=this._item._top+this._offsetTop}},Pn.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,n=e._migrate,t=e._dragRelease;e._tX=this._nextLeft,e._tY=this._nextTop,this._isActive&&(this._isActive=!1,fn(e._element,e.getGrid()._settings.itemPositioningClass)),t._isActive&&t.stop(),n._isActive&&n.stop(),e._emitter.burst(this._queue,!1,e)}},Pn.prototype._setupAnimation=function(){var e=this._item;if(void 0===e._tX||void 0===e._tY){var n=On(e._element);e._tX=n.x,e._tY=n.y}},Pn.prototype._startAnimation=function(){var e=this._item,n=e.getGrid()._settings,t=this._animOptions.duration<=0;this._updateOffsets();var o=Math.abs(e._left-(e._tX-this._offsetLeft)),i=Math.abs(e._top-(e._tY-this._offsetTop));if(t||o<2&&i<2)return(o||i||this._isInterrupted)&&e._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._isInterrupted||Ye(e._element,n.itemPositioningClass),this._currentStyles[$e]=En(e._tX,e._tY),this._targetStyles[$e]=En(this._nextLeft,this._nextTop),e._tX=e._tY=void 0,this._animation.start(this._currentStyles,this._targetStyles,this._animOptions)},Xn.prototype.start=function(e,n,t){if(!this._isDestroyed){var o,i,r,a,s,c,d,l,p,M,u=this._item,b=u._element,m=u.isActive(),g=u.isVisible(),A=u.getGrid(),w=A._settings,v=e._settings,q=e._element,k=e._items,_=A._items.indexOf(u),y=t||document.body;if("number"==typeof n)o=Ve(k,n,1);else{if(!(i=e.getItem(n)))return;o=k.indexOf(i)}(u.isPositioning()||this._isActive||u.isReleasing())&&(d=(c=On(b)).x,l=c.y),u.isPositioning()&&u._layout.stop(!0,d,l),this._isActive&&(d-=this._containerDiffX,l-=this._containerDiffY,this.stop(!0,d,l)),u.isReleasing()&&(d-=u._dragRelease._containerDiffX,l-=u._dragRelease._containerDiffY,u._dragRelease.stop(!0,d,l)),u._visibility.stop(!0),u._drag&&u._drag.destroy(),A._hasListeners(z)&&A._emit(z,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o}),e._hasListeners(f)&&e._emit(f,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o}),w.itemClass!==v.itemClass&&(fn(b,w.itemClass),Ye(b,v.itemClass)),(p=g?w.itemVisibleClass:w.itemHiddenClass)!==(M=g?v.itemVisibleClass:v.itemHiddenClass)&&(fn(b,p),Ye(b,M)),A._items.splice(_,1),Fe(k,u,o),u._gridId=e._id,m?y!==(r=b.parentNode)&&(y.appendChild(b),a=cn(y,r,!0),c||(d=(c=On(b)).x,l=c.y),u._setTranslate(d+a.left,l+a.top)):q.appendChild(b),u._visibility.setStyles(g?v.visibleStyles:v.hiddenStyles),m&&(s=cn(y,q,!0)),u._refreshDimensions(),u._sortData=null,u._drag=v.dragEnabled?new kn(u):null,m?(this._isActive=!0,this._container=y,this._containerDiffX=s.left,this._containerDiffY=s.top):(this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0),A._hasListeners(h)&&A._emit(h,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o}),e._hasListeners(O)&&e._emit(O,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o})}},Xn.prototype.stop=function(e,n,t){if(!this._isDestroyed&&this._isActive){var o,i=this._item,r=i._element,a=i.getGrid()._element;this._container!==a&&(void 0!==n&&void 0!==t||(e?(n=(o=On(r)).x-this._containerDiffX,t=o.y-this._containerDiffY):(n=i._left,t=i._top)),a.appendChild(r),i._setTranslate(n,t)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0}},Xn.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},Hn.prototype.show=function(e,n){if(!this._isDestroyed){var t=this._item,o=t._element,i=he(n)?n:null,r=t.getGrid()._settings;this._isShowing||this._isHidden?!this._isShowing||e?(this._isShowing||(t._emitter.burst(this._queue,!0,t),fn(o,r.itemHiddenClass),Ye(o,r.itemVisibleClass),this._isHiding||(o.style.display="")),i&&t._emitter.on(this._queue,i),this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow)):i&&t._emitter.on(this._queue,i):i&&i(!1,t)}},Hn.prototype.hide=function(e,n){if(!this._isDestroyed){var t=this._item,o=t._element,i=he(n)?n:null,r=t.getGrid()._settings;this._isHiding||!this._isHidden?!this._isHiding||e?(this._isHiding||(t._emitter.burst(this._queue,!0,t),Ye(o,r.itemHiddenClass),fn(o,r.itemVisibleClass)),i&&t._emitter.on(this._queue,i),this._isHidden=this._isHiding=!0,this._isShowing=!1,this._startAnimation(!1,e,this._finishHide)):i&&t._emitter.on(this._queue,i):i&&i(!1,t)}},Hn.prototype.stop=function(e){if(!this._isDestroyed&&(this._isHiding||this._isShowing)){var n=this._item;ce(n._id),this._animation.stop(),e&&n._emitter.burst(this._queue,!0,n)}},Hn.prototype.setStyles=function(e){var n=this._childElement,t=this._currentStyleProps;for(var o in this._removeCurrentStyles(),e)t.push(o),n.style[o]=e[o]},Hn.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item,n=e._element,t=e.getGrid()._settings;this.stop(!0),e._emitter.clear(this._queue),this._animation.destroy(),this._removeCurrentStyles(),fn(n,t.itemVisibleClass),fn(n,t.itemHiddenClass),n.style.display="",this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0}},Hn.prototype._startAnimation=function(e,n,t){if(!this._isDestroyed){var o,i=this._item,r=this._animation,a=this._childElement,s=i.getGrid()._settings,c=e?s.visibleStyles:s.hiddenStyles,d=e?s.showDuration:s.hideDuration,l=e?s.showEasing:s.hideEasing,p=n||d<=0;if(c){if(ce(i._id),p)return Ln(a,c),r.stop(),void(t&&t());var M,u,b;r.isAnimating()&&(r._animation.onfinish=null),M=i._id,u=function(){o=_n(a,c)},b=function(){r.start(o,c,{duration:d,easing:l,onFinish:t})},ae.add(0,F+M,u),ae.add(2,V+M,b)}else t&&t()}},Hn.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._item._emitter.burst(this._queue,!1,this._item))},Hn.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,e._layout.stop(!0,0,0),e._element.style.display="none",e._emitter.burst(this._queue,!1,e)}},Hn.prototype._removeCurrentStyles=function(){for(var e=this._childElement,n=this._currentStyleProps,t=0;t<n.length;t++)e.style[n[t]]="";n.length=0};var Yn=0;function In(){return++Yn}function Fn(e,n,t){var o=e._settings;if(i){if(i.has(n))throw new Error("You can only create one Muuri Item per element!");i.set(n,this)}this._id=In(),this._gridId=e._id,this._element=n,this._isDestroyed=!1,this._left=0,this._top=0,this._width=0,this._height=0,this._marginLeft=0,this._marginRight=0,this._marginTop=0,this._marginBottom=0,this._tX=void 0,this._tY=void 0,this._sortData=null,this._emitter=new v,n.parentNode!==e._element&&e._element.appendChild(n),Ye(n,o.itemClass),"boolean"!=typeof t&&(t="none"!==Oe(n,"display")),this._isActive=t,this._visibility=new Hn(this),this._layout=new Pn(this),this._migrate=new Xn(this),this._drag=o.dragEnabled?new kn(this):null,this._dragRelease=new jn(this),this._dragPlaceholder=new Dn(this)}function Vn(e){var n,t,o,i,r,a=.001,s=.5;function c(e){return((1e3*e+.5|0)/10|0)/100}function d(){this.currentRects=[],this.nextRects=[],this.rectTarget={},this.rectStore=[],this.slotSizes=[],this.rectId=0,this.slotIndex=-1,this.slotData={left:0,top:0,width:0,height:0},this.sortRectsLeftTop=this.sortRectsLeftTop.bind(this),this.sortRectsTopLeft=this.sortRectsTopLeft.bind(this)}if(d.prototype.computeLayout=function(e,n){var t,o,i,r,a,s,d=e.items,l=e.slots,p=!!(1&n),M=!!(2&n),u=!!(4&n),b=!!(8&n),h=!!(16&n),z="number"==typeof d[0];if(!d.length)return e;for(o=z?2:1,t=0;t<d.length;t+=o)z?(r=d[t],a=d[t+1]):(r=(i=d[t])._width+i._marginLeft+i._marginRight,a=i._height+i._marginTop+i._marginBottom),h&&(r=c(r),a=c(a)),s=this.computeNextSlot(e,r,a,p,M),M?s.left+s.width>e.width&&(e.width=s.left+s.width):s.top+s.height>e.height&&(e.height=s.top+s.height),l[++this.slotIndex]=s.left,l[++this.slotIndex]=s.top,(u||b)&&this.slotSizes.push(s.width,s.height);if(u)for(t=0;t<l.length;t+=2)l[t]=e.width-(l[t]+this.slotSizes[t]);if(b)for(t=1;t<l.length;t+=2)l[t]=e.height-(l[t]+this.slotSizes[t]);return this.slotSizes.length=0,this.currentRects.length=0,this.nextRects.length=0,this.rectStore.length=0,this.rectId=0,this.slotIndex=-1,e},d.prototype.computeNextSlot=function(e,n,t,o,i){var r,c,d,l,p,M=this.slotData,u=this.currentRects,b=this.nextRects,h=!1;for(b.length=0,M.left=null,M.top=null,M.width=n,M.height=t,l=0;l<u.length;l++)if((c=u[l])&&(r=this.getRect(c),M.width<=r.width+a&&M.height<=r.height+a)){M.left=r.left,M.top=r.top;break}if(null===M.left&&(i?(M.left=e.width,M.top=0):(M.left=0,M.top=e.height),o||(h=!0)),!i&&M.top+M.height>e.height+a&&(M.left>s&&b.push(this.addRect(0,e.height,M.left,1/0)),M.left+M.width<e.width-s&&b.push(this.addRect(M.left+M.width,e.height,e.width-M.left-M.width,1/0)),e.height=M.top+M.height),i&&M.left+M.width>e.width+a&&(M.top>s&&b.push(this.addRect(e.width,0,1/0,M.top)),M.top+M.height<e.height-s&&b.push(this.addRect(e.width,M.top+M.height,1/0,e.height-M.top-M.height)),e.width=M.left+M.width),!h)for(o&&(l=0);l<u.length;l++)if(c=u[l])for(r=this.getRect(c),d=this.splitRect(r,M),p=0;p<d.length;p++)c=d[p],r=this.getRect(c),(i?r.left+a<e.width-a:r.top+a<e.height-a)&&b.push(c);return b.length>1&&this.purgeRects(b).sort(i?this.sortRectsLeftTop:this.sortRectsTopLeft),this.currentRects=b,this.nextRects=u,M},d.prototype.addRect=function(e,n,t,o){var i=++this.rectId;return this.rectStore[i]=e||0,this.rectStore[++this.rectId]=n||0,this.rectStore[++this.rectId]=t||0,this.rectStore[++this.rectId]=o||0,i},d.prototype.getRect=function(e,n){return n||(n=this.rectTarget),n.left=this.rectStore[e]||0,n.top=this.rectStore[++e]||0,n.width=this.rectStore[++e]||0,n.height=this.rectStore[++e]||0,n},d.prototype.splitRect=(n=[],t=0,o=0,function(e,i){return n.length=0,e.left+e.width<=i.left+a||i.left+i.width<=e.left+a||e.top+e.height<=i.top+a||i.top+i.height<=e.top+a?(n.push(this.addRect(e.left,e.top,e.width,e.height)),n):((t=i.left-e.left)>=s&&n.push(this.addRect(e.left,e.top,t,e.height)),(t=e.left+e.width-(i.left+i.width))>=s&&n.push(this.addRect(i.left+i.width,e.top,t,e.height)),(o=i.top-e.top)>=s&&n.push(this.addRect(e.left,e.top,e.width,o)),(o=e.top+e.height-(i.top+i.height))>=s&&n.push(this.addRect(e.left,i.top+i.height,e.width,o)),n)}),d.prototype.isRectAWithinRectB=function(e,n){return e.left+a>=n.left&&e.top+a>=n.top&&e.left+e.width-a<=n.left+n.width&&e.top+e.height-a<=n.top+n.height},d.prototype.purgeRects=(i={},r={},function(e){for(var n,t=e.length;t--;)if(n=e.length,e[t])for(this.getRect(e[t],i);n--;)if(e[n]&&t!==n&&(this.getRect(e[n],r),this.isRectAWithinRectB(i,r))){e[t]=0;break}return e}),d.prototype.sortRectsTopLeft=function(){var e={},n={};return function(t,o){return this.getRect(t,e),this.getRect(o,n),e.top<n.top&&e.top+a<n.top?-1:e.top>n.top&&e.top-a>n.top?1:e.left<n.left&&e.left+a<n.left?-1:e.left>n.left&&e.left-a>n.left?1:0}}(),d.prototype.sortRectsLeftTop=function(){var e={},n={};return function(t,o){return this.getRect(t,e),this.getRect(o,n),e.left<n.left&&e.left+a<n.left?-1:e.left>n.left&&e.left-a<n.left?1:e.top<n.top&&e.top+a<n.top?-1:e.top>n.top&&e.top-a>n.top?1:0}}(),e){var l=new d;self.onmessage=function(e){var n=new Float32Array(e.data),t=n.subarray(4,n.length),o=new Float32Array(t.length),i=n[3],r={items:t,slots:o,width:n[1],height:n[2]};l.computeLayout(r,i),n[1]=r.width,n[2]=r.height,n.set(r.slots,4),postMessage(n.buffer,[n.buffer])}}return d}Fn.prototype.getGrid=function(){return o[this._gridId]},Fn.prototype.getElement=function(){return this._element},Fn.prototype.getWidth=function(){return this._width},Fn.prototype.getHeight=function(){return this._height},Fn.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Fn.prototype.getPosition=function(){return{left:this._left,top:this._top}},Fn.prototype.isActive=function(){return this._isActive},Fn.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Fn.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Fn.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Fn.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Fn.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Fn.prototype.isReleasing=function(){return!(!this._dragRelease||!this._dragRelease._isActive)},Fn.prototype.isDestroyed=function(){return this._isDestroyed},Fn.prototype._refreshDimensions=function(e){if(!(this._isDestroyed||!0!==e&&this._visibility._isHidden)){var n=this._element,t=this._dragPlaceholder,o=n.getBoundingClientRect();this._width=o.width,this._height=o.height,this._marginLeft=Math.max(0,fe(n,"margin-left")),this._marginRight=Math.max(0,fe(n,"margin-right")),this._marginTop=Math.max(0,fe(n,"margin-top")),this._marginBottom=Math.max(0,fe(n,"margin-bottom")),t&&t.updateDimensions()}},Fn.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,n=this._sortData={},t=this.getGrid()._settings.sortData;for(e in t)n[e]=t[e](this,this._element)}},Fn.prototype._addToLayout=function(e,n){!0!==this._isActive&&(this._isActive=!0,this._left=e||0,this._top=n||0)},Fn.prototype._removeFromLayout=function(){!1!==this._isActive&&(this._isActive=!1,this._left=0,this._top=0)},Fn.prototype._canSkipLayout=function(e,n){return this._left===e&&this._top===n&&!this._migrate._isActive&&!this._layout._skipNextAnimation&&!this._dragRelease.isJustReleased()},Fn.prototype._setTranslate=function(e,n){return(this._tX!==e||this._tY!==n)&&(this._tX=e,this._tY=n,this._element.style[$e]=En(e,n),!0)},Fn.prototype._destroy=function(e){if(!this._isDestroyed){var n=this._element,t=this.getGrid()._settings;this._dragPlaceholder.destroy(),this._dragRelease.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._drag&&this._drag.destroy(),this._emitter.destroy(),fn(n,t.itemClass),e&&n.parentNode.removeChild(n),i&&i.delete(n),this._isActive=!1,this._isDestroyed=!0}};var Gn=Vn(),Un=null,$n=[];function Jn(e,n){if(this._options=0,this._processor=null,this._layoutQueue=[],this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={},this._workers=[],this._onWorkerMessage=this._onWorkerMessage.bind(this),this.setOptions(n),(e="number"==typeof e?Math.max(0,e):0)&&window.Worker&&window.URL&&window.Blob)try{this._workers=function(e,n){var t=[];if(e>0){Un||(Un=URL.createObjectURL(new Blob(["("+Vn.toString()+")(true)"],{type:"application/javascript"})));for(var o,i=0;i<e;i++)o=new Worker(Un),n&&(o.onmessage=n),t.push(o),$n.push(o)}return t}(e,this._onWorkerMessage)}catch(e){this._processor=new Gn}else this._processor=new Gn}Jn.prototype._sendToWorker=function(){if(this._layoutQueue.length&&this._workers.length){var e=this._layoutQueue.shift(),n=this._workers.pop(),t=this._layoutWorkerData[e];delete this._layoutWorkerData[e],this._layoutWorkers[e]=n,n.postMessage(t.buffer,[t.buffer])}},Jn.prototype._onWorkerMessage=function(e){var n=new Float32Array(e.data),t=n[0],o=this._layouts[t],i=this._layoutCallbacks[t],r=this._layoutWorkers[t];o&&delete this._layouts[t],i&&delete this._layoutCallbacks[t],r&&delete this._layoutWorkers[t],o&&i&&(o.width=n[1],o.height=n[2],o.slots=n.subarray(4,n.length),this._finalizeLayout(o),i(o)),r&&(this._workers.push(r),this._sendToWorker())},Jn.prototype._finalizeLayout=function(e){var n=e._grid,t=2&e._settings,o="border-box"===n._boxSizing;return delete e._grid,delete e._settings,e.styles={},t?e.styles.width=(o?e.width+n._borderLeft+n._borderRight:e.width)+"px":e.styles.height=(o?e.height+n._borderTop+n._borderBottom:e.height)+"px",e},Jn.prototype.setOptions=function(e){var n,t,o,i,r;e&&(n="boolean"==typeof e.fillGaps?e.fillGaps?1:0:1&this._options,t="boolean"==typeof e.horizontal?e.horizontal?2:0:2&this._options,o="boolean"==typeof e.alignRight?e.alignRight?4:0:4&this._options,i="boolean"==typeof e.alignBottom?e.alignBottom?8:0:8&this._options,r="boolean"==typeof e.rounding?e.rounding?16:0:16&this._options,this._options=n|t|o|i|r)},Jn.prototype.createLayout=function(e,n,t,o,i,r){if(this._layouts[n])throw new Error("A layout with the provided id is currently being processed.");var a=2&this._options,s={id:n,items:t,slots:null,width:a?0:o,height:a?i:0,_grid:e,_settings:this._options};if(!t.length)return s.slots=[],this._finalizeLayout(s),void r(s);if(this._processor)return s.slots=window.Float32Array?new Float32Array(2*t.length):new Array(2*t.length),this._processor.computeLayout(s,s._settings),this._finalizeLayout(s),void r(s);var c,d,l,p=new Float32Array(4+2*t.length);for(p[0]=n,p[1]=s.width,p[2]=s.height,p[3]=s._settings,c=0,d=3;c<t.length;c++)l=t[c],p[++d]=l._width+l._marginLeft+l._marginRight,p[++d]=l._height+l._marginTop+l._marginBottom;return this._layoutQueue.push(n),this._layouts[n]=s,this._layoutCallbacks[n]=r,this._layoutWorkerData[n]=p,this._sendToWorker(),this.cancelLayout.bind(this,n)},Jn.prototype.cancelLayout=function(e){if(this._layouts[e]&&(delete this._layouts[e],delete this._layoutCallbacks[e],this._layoutWorkerData[e])){delete this._layoutWorkerData[e];var n=this._layoutQueue.indexOf(e);n>-1&&this._layoutQueue.splice(n,1)}},Jn.prototype.destroy=function(){for(var e in this._layoutWorkers)this._workers.push(this._layoutWorkers[e]);!function(e){for(var n,t,o=0;o<e.length;o++)(n=e[o]).onmessage=null,n.onerror=null,n.onmessageerror=null,n.terminate(),(t=$n.indexOf(n))>-1&&$n.splice(t,1);Un&&!$n.length&&(URL.revokeObjectURL(Un),Un=null)}(this._workers),this._workers.length=0,this._layoutQueue.length=0,this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={}};var Kn=0;function Zn(e){var n=Object.prototype.toString.call(e);return"[object HTMLCollection]"===n||"[object NodeList]"===n}var Qn=Object.prototype.toString;function et(e){return"object"==typeof e&&"[object Object]"===Qn.call(e)}function nt(){}var tt,ot="number",it="string",rt="instant",at=0;function st(e,n){if(typeof e===it&&(e=document.querySelector(e)),!(e.getRootNode?e.getRootNode({composed:!0})===document:document.body.contains(e))||e===document.documentElement)throw new Error("Container element must be an existing DOM element.");var t,i,r=function(e,n){var t=ct({},e);return n&&(t=ct(t,n)),n&&n.visibleStyles?t.visibleStyles=n.visibleStyles:e&&e.visibleStyles&&(t.visibleStyles=e.visibleStyles),n&&n.hiddenStyles?t.hiddenStyles=n.hiddenStyles:e&&e.hiddenStyles&&(t.hiddenStyles=e.hiddenStyles),t}(st.defaultOptions,n);r.visibleStyles=dt(r.visibleStyles),r.hiddenStyles=dt(r.hiddenStyles),he(r.dragSort)||(r.dragSort=!!r.dragSort),this._id=In(),this._element=e,this._settings=r,this._isDestroyed=!1,this._items=[],this._layout={id:0,items:[],slots:[]},this._isLayoutFinished=!0,this._nextLayoutData=null,this._emitter=new v,this._onLayoutDataReceived=this._onLayoutDataReceived.bind(this),o[this._id]=this,Ye(e,r.containerClass),t=this,typeof(i=r.layoutOnResize)!==ot&&(i=!0===i?0:-1),i>=0&&(t._resizeHandler=function(e,n){var t=++Kn,o=0,i=0,r=!1,a=function(n){r||(i&&(o-=n-i),i=n,o>0?function(e,n){ae.add(0,re+e,n)}(t,a):(o=i=0,e()))};return function(s){if(!r){if(!(n<=0))return!0===s?(r=!0,o=i=0,a=void 0,void function(e){ae.remove(0,re+e)}(t)):void(o<=0?(o=n,a(0)):o=n);!0!==s&&e()}}}(function(){t.refreshItems().layout()},i),window.addEventListener("resize",t._resizeHandler)),this.add(function(e,n){if("*"===n)return e.children;if(typeof n===it){for(var t=[],o=e.children,i=0;i<o.length;i++)He(o[i],n)&&t.push(o[i]);return t}return Array.isArray(n)||Zn(n)?n:[]}(e,r.items),{layout:!1}),r.layoutOnInit&&this.layout(!0)}function ct(e,n){var t,o,i,r=Object.keys(n),a=r.length;for(i=0;i<a;i++)t=et(n[o=r[i]]),et(e[o])&&t?e[o]=ct(ct({},e[o]),n[o]):t?e[o]=ct({},n[o]):Array.isArray(n[o])?e[o]=n[o].slice(0):e[o]=n[o];return e}function dt(e){var n,t,o={},i=document.documentElement.style;for(n in e)e[n]&&(t=W(i,n))&&(o[t]=e[n]);return o}function lt(e){for(var n={},t=0;t<e.length;t++)n[e[t]._id]=t;return n}function pt(e,n,t){return e[n._id]-e[t._id]}st.Item=Fn,st.ItemLayout=Pn,st.ItemVisibility=Hn,st.ItemMigrate=Xn,st.ItemDrag=kn,st.ItemDragRelease=jn,st.ItemDragPlaceholder=Dn,st.Emitter=v,st.Animator=Sn,st.Dragger=D,st.Packer=Jn,st.AutoScroller=je,st.defaultPacker=new Jn(2),st.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!1},layoutOnResize:150,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragHandle:null,dragStartPredicate:{distance:0,delay:0},dragAxis:"xy",dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:a,migrateAction:a},dragRelease:{duration:300,easing:"ease",useDragContainer:!0},dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,createElement:null,onCreate:null,onRemove:null},dragAutoScroll:{targets:[],handle:null,threshold:50,safeZone:.2,speed:je.smoothSpeed(1e3,2e3,2500),sortDuringScroll:!0,smoothStop:!1,onStart:null,onStop:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},st.prototype.on=function(e,n){return this._emitter.on(e,n),this},st.prototype.off=function(e,n){return this._emitter.off(e,n),this},st.prototype.getElement=function(){return this._element},st.prototype.getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if(typeof e===ot)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof Fn)return e._gridId===this._id?e:null;if(i){var n=i.get(e);return n&&n._gridId===this._id?n:null}for(var t=0;t<this._items.length;t++)if(this._items[t]._element===e)return this._items[t];return null},st.prototype.getItems=function(e){if(this._isDestroyed||void 0===e)return this._items.slice(0);var n,t,o=[];if(Array.isArray(e)||Zn(e))for(n=0;n<e.length;n++)(t=this.getItem(e[n]))&&o.push(t);else(t=this.getItem(e))&&o.push(t);return o},st.prototype.refreshItems=function(e,n){if(this._isDestroyed)return this;var t,o,i,r,a=e||this._items;if(!0===n)for(r=[],t=0;t<a.length;t++)(o=a[t]).isVisible()||o.isHiding()||((i=o.getElement().style).visibility="hidden",i.display="",r.push(i));for(t=0;t<a.length;t++)a[t]._refreshDimensions(n);if(!0===n){for(t=0;t<r.length;t++)(i=r[t]).visibility="",i.display="none";r.length=0}return this},st.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;for(var n=e||this._items,t=0;t<n.length;t++)n[t]._refreshSortData();return this},st.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,n,t=this._items;if(!t.length)return this;for(var o=0;o<t.length;o++)(n=t[o]._element).parentNode===this._element&&(e=e||document.createDocumentFragment()).appendChild(n);return e?(this._element.appendChild(e),this._emit("synchronize"),this):this},st.prototype.layout=function(e,n){if(this._isDestroyed)return this;var t=this._nextLayoutData;t&&he(t.cancel)&&t.cancel();var o=at=at%16777216+1;this._nextLayoutData={id:o,instant:e,onFinish:n,cancel:null};for(var i=this._items,r=[],a=0;a<i.length;a++)i[a]._isActive&&r.push(i[a]);this._refreshDimensions();var s,c=this._width-this._borderLeft-this._borderRight,d=this._height-this._borderTop-this._borderBottom,l=this._settings.layout;return he(l)?s=l(this,o,r,c,d,this._onLayoutDataReceived):(st.defaultPacker.setOptions(l),s=st.defaultPacker.createLayout(this,o,r,c,d,this._onLayoutDataReceived)),he(s)&&this._nextLayoutData&&this._nextLayoutData.id===o&&(this._nextLayoutData.cancel=s),this},st.prototype.add=function(e,n){if(this._isDestroyed||!e)return[];var t,o=Zn(t=e)?Array.prototype.slice.call(t):Array.prototype.concat(t);if(!o.length)return o;var i,r,a,s,c=n||{},d=c.layout?c.layout:void 0===c.layout,l=this._items,p=!1;for(s=0;s<o.length;s++)(r=o[s]).parentNode!==this._element&&(i=i||document.createDocumentFragment()).appendChild(r);for(i&&this._element.appendChild(i),s=0;s<o.length;s++)r=o[s],(a=o[s]=new Fn(this,r,c.active))._isActive&&(p=!0,a._layout._skipNextAnimation=!0);for(s=0;s<o.length;s++)(a=o[s])._refreshDimensions(),a._refreshSortData();return Fe(l,o,c.index),this._hasListeners("add")&&this._emit("add",o.slice(0)),p&&d&&this.layout(d===rt,he(d)?d:void 0),o},st.prototype.remove=function(e,n){if(this._isDestroyed||!e.length)return[];var t,o,i,r=n||{},a=r.layout?r.layout:void 0===r.layout,s=!1,c=this.getItems(),d=[],p=[];for(i=0;i<e.length;i++)(o=e[i])._isDestroyed||-1!==(t=this._items.indexOf(o))&&(o._isActive&&(s=!0),d.push(o),p.push(c.indexOf(o)),o._destroy(r.removeElements),this._items.splice(t,1));return this._hasListeners(l)&&this._emit(l,d.slice(0),p),s&&a&&this.layout(a===rt,he(a)?a:void 0),d},st.prototype.show=function(e,n){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!0,n),this},st.prototype.hide=function(e,n){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!1,n),this},st.prototype.filter=function(e,n){if(this._isDestroyed||!this._items.length)return this;var t,o,i=[],r=[],a=typeof e===it,s=he(e),c=n||{},d=!0===c.instant,l=c.syncWithLayout,p=c.layout?c.layout:void 0===c.layout,u=he(c.onFinish)?c.onFinish:null,b=-1,h=nt;if(u&&(h=function(){++b&&u(i.slice(0),r.slice(0))}),s||a)for(o=0;o<this._items.length;o++)t=this._items[o],(s?e(t):He(t._element,e))?i.push(t):r.push(t);return i.length?this.show(i,{instant:d,syncWithLayout:l,onFinish:h,layout:!1}):h(),r.length?this.hide(r,{instant:d,syncWithLayout:l,onFinish:h,layout:!1}):h(),(i.length||r.length)&&(this._hasListeners(M)&&this._emit(M,i.slice(0),r.slice(0)),p&&this.layout(p===rt,he(p)?p:void 0)),this},st.prototype.sort=function(){var e,n,t,o;function i(i,r){for(var a,s,c,d,l=0,p=0;p<e.length;p++)if(a=e[p][0],s=e[p][1],c=(i._sortData?i:i._refreshSortData())._sortData[a],d=(r._sortData?r:r._refreshSortData())._sortData[a],l="desc"===s||!s&&n?d<c?-1:d>c?1:0:c<d?-1:c>d?1:0)return l;return l||(o||(o=lt(t)),l=n?pt(o,r,i):pt(o,i,r)),l}function r(i,r){var a=n?-e(i,r):e(i,r);return a||(o||(o=lt(t)),a=n?pt(o,r,i):pt(o,i,r)),a}return function(a,s){if(this._isDestroyed||this._items.length<2)return this;var c=this._items,d=s||{},l=d.layout?d.layout:void 0===d.layout;if(n=!!d.descending,t=c.slice(0),o=null,he(a))e=a,c.sort(r);else if(typeof a===it)e=a.trim().split(" ").filter(function(e){return e}).map(function(e){return e.split(":")}),c.sort(i);else{if(!Array.isArray(a))throw e=n=t=o=null,new Error("Invalid comparer argument provided.");c.length=0,c.push.apply(c,a)}return this._hasListeners(u)&&this._emit(u,c.slice(0),t),l&&this.layout(l===rt,he(l)?l:void 0),e=n=t=o=null,this}}(),st.prototype.move=function(e,n,t){if(this._isDestroyed||this._items.length<2)return this;var o,i,s=this._items,c=t||{},d=c.layout?c.layout:void 0===c.layout,l=c.action===r,p=l?r:a,M=this.getItem(e),u=this.getItem(n);return M&&u&&M!==u&&(o=s.indexOf(M),i=s.indexOf(u),l?Ue(s,o,i):Ge(s,o,i),this._hasListeners(b)&&this._emit(b,{item:M,fromIndex:o,toIndex:i,action:p}),d&&this.layout(d===rt,he(d)?d:void 0)),this},st.prototype.send=function(e,n,t,o){if(this._isDestroyed||n._isDestroyed||this===n)return this;if(!(e=this.getItem(e)))return this;var i=o||{},r=i.appendTo||document.body,a=i.layoutSender?i.layoutSender:void 0===i.layoutSender,s=i.layoutReceiver?i.layoutReceiver:void 0===i.layoutReceiver;return e._migrate.start(n,t,r),e._migrate._isActive&&e._isActive&&(a&&this.layout(a===rt,he(a)?a:void 0),s&&n.layout(s===rt,he(s)?s:void 0)),this},st.prototype.destroy=function(e){if(this._isDestroyed)return this;var n,t,i,r=this._element,a=this._items.slice(0),s=this._layout&&this._layout.styles||{};for((i=this)._resizeHandler&&(i._resizeHandler(!0),window.removeEventListener("resize",i._resizeHandler),i._resizeHandler=null),n=0;n<a.length;n++)a[n]._destroy(e);for(t in this._items.length=0,fn(r,this._settings.containerClass),s)r.style[t]="";return this._emit("destroy"),this._emitter.destroy(),delete o[this._id],this._isDestroyed=!0,this},st.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},st.prototype._hasListeners=function(e){return!this._isDestroyed&&this._emitter.countListeners(e)>0},st.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top,this._right=e.right,this._bottom=e.bottom},st.prototype._updateBorders=function(e,n,t,o){var i=this._element;e&&(this._borderLeft=fe(i,"border-left-width")),n&&(this._borderRight=fe(i,"border-right-width")),t&&(this._borderTop=fe(i,"border-top-width")),o&&(this._borderBottom=fe(i,"border-bottom-width"))},st.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1),this._boxSizing=Oe(this._element,"box-sizing")},st.prototype._onLayoutDataReceived=(tt=[],function(e){if(!this._isDestroyed&&this._nextLayoutData&&this._nextLayoutData.id===e.id){var n,t,o,i,r=this,a=this._nextLayoutData.instant,l=this._nextLayoutData.onFinish,p=e.items.length,M=p;for(this._nextLayoutData=null,!this._isLayoutFinished&&this._hasListeners(d)&&this._emit(d,this._layout.items.slice(0)),this._layout=e,tt.length=0,i=0;i<p;i++)(n=e.items[i])?(t=e.slots[2*i],o=e.slots[2*i+1],n._canSkipLayout(t,o)?--M:(n._left=t,n._top=o,n.isActive()&&!n.isDragging()?tt.push(n):--M)):--M;if(e.styles&&Ln(this._element,e.styles),!this._hasListeners(s)||(this._emit(s,e.items.slice(0),!0===a),this._layout.id===e.id)){var u=function(){if(!(--M>0)){var n=r._layout.id!==e.id,t=he(a)?a:l;n||(r._isLayoutFinished=!0),he(t)&&t(e.items.slice(0),n),!n&&r._hasListeners(c)&&r._emit(c,e.items.slice(0))}};if(!tt.length)return u(),this;for(this._isLayoutFinished=!1,i=0;i<tt.length&&this._layout.id===e.id;i++)tt[i]._layout.start(!0===a,u);return this._layout.id===e.id&&(tt.length=0),this}}}),st.prototype._setItemsVisibility=function(e,n,t){var o,i,r=this,a=e.slice(0),c=t||{},d=!0===c.instant,l=c.onFinish,M=c.layout?c.layout:void 0===c.layout,u=a.length,b=n?"showStart":p,h=n?"showEnd":"hideEnd",z=n?"show":"hide",O=!1,f=[],m=[];if(u){for(i=0;i<a.length;i++)o=a[i],(n&&!o._isActive||!n&&o._isActive)&&(O=!0),o._layout._skipNextAnimation=!(!n||o._isActive),n&&o._visibility._isHidden&&m.push(o),n?o._addToLayout():o._removeFromLayout();m.length&&(this.refreshItems(m,!0),m.length=0),O&&!1!==c.syncWithLayout?this.on(s,g):g(),O&&M&&this.layout(M===rt,he(M)?M:void 0)}else he(l)&&l(a);function g(){for(O&&!1!==c.syncWithLayout&&r.off(s,g),r._hasListeners(b)&&r._emit(b,a.slice(0)),i=0;i<a.length;i++)a[i]._gridId===r._id?a[i]._visibility[z](d,function(e,n){e||f.push(n),--u<1&&(he(l)&&l(f.slice(0)),r._hasListeners(h)&&r._emit(h,f.slice(0)))}):--u<1&&(he(l)&&l(f.slice(0)),r._hasListeners(h)&&r._emit(h,f.slice(0)))}};const Mt=st;var ut=t(24510),bt=t(25936),ht=t(91762);const zt=[];let Ot,ft;const mt=()=>{let e=document.querySelector(".SearchResult-dragContainer");return e||(e=(0,bt.A)("div",{className:"SearchResult-dragContainer"}),document.body.appendChild(e)),e},gt=()=>{const e=ft.querySelector(":scope .SearchResult-board"),n=()=>{if(e){const o=e.lastChild;if(o instanceof Element){const i=o.classList.contains("frame")?e.querySelector(".SearchResult-board-column:nth-last-child(-n+2)"):e.lastChild;i instanceof Element&&t.observe(i),Ot.off("layoutEnd",n);const r=e.closest(".Popup");r instanceof HTMLDivElement&&document.body.style.setProperty("--BoardContainer-zIndex",(parseInt(r.style.zIndex)+1).toString())}}},t=new IntersectionObserver(e=>{for(const n of e){const{isIntersecting:e,target:o}=n;if(e&&!o.classList.contains("frame")){t.unobserve(o);const e=ft.querySelector(":scope button.moreColumns-button");e&&e.click()}}},{root:ft,rootMargin:"25px",threshold:.75});Ot.on("layoutEnd",n)},At=(e,n)=>{const t=n.parentNode;if(t instanceof HTMLDivElement){const o=new IntersectionObserver(e=>{for(const n of e){const{isIntersecting:e,target:i}=n;if(e){o.unobserve(i);const e=t?.querySelector(":scope button.moreCards-button");e&&e.click()}}},{root:t,rootMargin:"25px",threshold:.75}),i=()=>{const t=n.lastChild;t instanceof Element&&(o.observe(t),e.off("layoutEnd",i))};e.on("layoutEnd",i)}};let wt,vt,qt;(0,ht.A)(".is-muuri .SearchResult-boardContainer",e=>{ft=e;const n=e.querySelector(":scope div.SearchResult-board");if(!n)return;Ot=new Mt(n,{items:".SearchResult-board-column",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",layout:(e,n,t,o,i,r)=>(Mt.defaultPacker.setOptions({horizontal:!0}),Mt.defaultPacker.createLayout(e,n,t,o,i,e=>{delete e.styles,r(e)})),dragEnabled:!1,dragAxis:"x",dragSortHeuristics:{sortInterval:0},dragHandle:".BoardView-title",dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!1},dragAutoScroll:{targets:[{element:ft,axis:Mt.AutoScroller.AXIS_X}]}});const t=ft.querySelector(".SearchResult-board-errors");(0,ht.A)(".SearchResult-board-errors-close",e=>{e.onclick=()=>{t&&(t.innerHTML="")}}),gt()}),(0,ht.A)(".SearchResult-items .SearchResult-boardContainer",e=>{const n=e.closest(".SearchResult-items");n?.classList.add("is-muuri")}),(0,ht.A)("ol.BoardView-list",e=>{const n=e.closest(".SearchResult-board"),t=!!n?.hasAttribute("data-dragEnabled"),o=new Mt(e,{items:".BoardView-card",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",dragEnabled:t,dragSort:()=>zt.filter(e=>n?.contains(e.getElement())),dragContainer:mt(),dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!0},dragStartPredicate:(e,n)=>{const t=n.target,o=e.getElement();return!("A"===t.tagName||t.className.includes("ContentSummary-info")||o&&o.hasAttribute("data-archived"))},dragPlaceholder:{enabled:!0,createElement:e=>{const n=e.getElement();return n?.cloneNode(!0)}},dragAutoScroll:{targets:e=>[window,{element:ft,priority:1,axis:Mt.AutoScroller.AXIS_X},{element:e.getGrid()?.getElement().parentNode,priority:1,axis:Mt.AutoScroller.AXIS_Y}],sortDuringScroll:!1}});let i;new MutationObserver(e=>{for(const n of e){const e=n.target;if("childList"===n.type&&e instanceof HTMLElement){new ResizeObserver((n,t)=>{o.refreshItems().layout(),t.unobserve(e)}).observe(e)}}}).observe(e,{childList:!0,subtree:!0}),o.on("dragReleaseEnd",e=>{if(i===e){const n=e.getElement();n instanceof HTMLElement&&n.classList.add("is-saving"),r(e);let t=null,i=null;if(wt){const e=wt.getElement().closest(".SearchResult-board-column");t=e?.querySelector(".BoardView-title")}if(o){const e=o.getElement().closest(".SearchResult-board-column");i=e?.querySelector(".BoardView-title")}if(t instanceof HTMLElement){const e=t.dataset.count;e&&(t.dataset.count=(parseInt(e)-1).toString())}if(i instanceof HTMLElement){const e=i.dataset.count;e&&(i.dataset.count=(parseInt(e)+1).toString())}}i=null,vt=0}),o.on("dragStart",e=>{const n=e.getGrid();if(n instanceof Mt){wt=n,vt=o.getItems().indexOf(e);const t=o.getElement();if(t){const e=t.closest(".SearchResult-board-column"),n=e?.getAttribute("data-boardFieldValue");n&&(qt=n)}const i=e.getElement();i&&(i.style.width=e.getWidth()+"px",i.style.height=e.getHeight()+"px")}}),o.on("dragMove",e=>{o===wt&&null!==vt&&o.move(e,vt,{layout:"instant"})}),o.on("layoutStart",()=>{Ot&&Ot.refreshItems().layout()}),o.on("receive",e=>{i=e.item});const r=async e=>{const n=e.getElement(),t=n?.getAttribute("data-objectId"),i=document.querySelector('li[data-objectId="'+t+'"]');let r,a,s;if(i){const e=i.closest(".SearchResult-board");e&&(r=e.getAttribute("data-boardField"),s=e.getAttribute("data-search"))}if(n){const e=n.closest(".SearchResult-board-column");a=e?.getAttribute("data-boardFieldValue")}const c=new Headers,d=ut.A.get("bsp.csrf");d&&c.append("Brightspot-CSRF",d);const l=new FormData;t&&l.append("objectId",t),r&&l.append("boardField",r),a&&l.append("boardFieldValue",a),s&&l.append("search",s),l.append("previousBoardFieldValue",qt);const p=await fetch(window.CONTEXT_PATH+"board/fieldUpdate",{method:"post",credentials:"include",headers:c,body:l}),M=await p.text();if(p.ok){const n=o.getItems().indexOf(e);o.remove([e],{removeElements:!0});const t=document.createElement("template");t.innerHTML=M;const i=t.content.firstChild;i instanceof HTMLElement&&o.add(i,{index:n})}else if(M){o.send(e,wt,vt);const n=document.querySelector(".SearchResult-board-errors");n&&(n.innerHTML=M)}};At(o,e),zt.push(o)}),window.addEventListener("brightspot-frame-load",e=>{const n=e.target;if(n instanceof HTMLElement)if(n.classList.contains("BoardResults")){const e=[...n.querySelectorAll("li.BoardView-card")],t=n.closest(".BoardView-listContainer"),o=t?.querySelector("ol.BoardView-list");zt.forEach(n=>{n instanceof Object&&n.getElement()===o&&(At(n,o),n.add(e))})}else n.classList.contains("BoardResults-Horiz")&&(gt(),Ot.add([...n.querySelectorAll("div.SearchResult-board-column")]))})},81664(e,n,t){"use strict";(0,t(91762).A)(".Page .Page-broadcastAlert",e=>{const n=e.querySelector(".pagination");if(!n)return;const t=n.querySelector(".pagination-count");if(!t)return;const o=e.querySelectorAll(".Page-broadcastAlert-messages > *");if(!o)return;const i=n.querySelector(".previous");if(!i)return;const r=i.querySelector(":scope > a");if(!r)return;const a=n.querySelector(".next");if(!a)return;const s=a.querySelector(":scope > a");if(!s)return;const c=o.length;for(let e=1;e<c;e++)o[e].hidden=!0;let d=0;const l=()=>{t.textContent=`${d+1} / ${c}`};l();const p=e=>{o[d].hidden=!0,d+=e?1:-1,o[d].hidden=!1,l();const n=0===d;i.classList.toggle("is-disabled",n),r.tabIndex=n?-1:0;const t=d===c-1;a.classList.toggle("is-disabled",t),s.tabIndex=t?-1:0};i.addEventListener("click",e=>{e.preventDefault(),d>0&&p(!1)}),a.addEventListener("click",e=>{e.preventDefault(),d<c-1&&p(!0)})})},53664(e,n,t){"use strict";var o=t(91762),i=t(25936),r=t(24510),a=t(55408),s=t(17664);(0,o.A)(".BulkWorkflow-button",e=>{let n=null;e.addEventListener("keydown",n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),e.click())}),e.addEventListener("click",async t=>{t.preventDefault(),t.stopPropagation();const o=t.target;let c;if(o instanceof HTMLElement&&(c=o.getAttribute("action-url")),!c)return;if(!n){const e=new Headers,t=r.A.get("bsp.csrf");t&&e.append("Brightspot-CSRF",t);const o=await fetch(c,{headers:e}),a=await o.text();n=(0,i.A)("div",{className:"BulkWorkflow",innerHTML:a,role:"dialog","aria-modal":"true"}),document.body.appendChild(n),n.addEventListener("keydown",e=>{if("Escape"===e.key){e.stopPropagation();const t=n?.querySelector(".closeButton");t&&t.click()}})}e.closest(".Popup")&&(n.style.zIndex=(0,s.default)().toString()),a.A.toggle(e,n,()=>{const t=e.classList.toggle("is-open");return n?.classList.toggle("is-open"),t&&requestAnimationFrame(()=>{const e=n?.querySelector(".closeButton");e&&e.focus()}),t});const d=n.querySelector(".closeButton");d?.addEventListener("click",()=>{const t=a.A.toggles.get(e);t&&t.closeListener&&window.removeEventListener("click",t.closeListener,!0),e.classList.remove("is-open"),n?.classList.remove("is-open"),n?.remove(),n=null;const o=e.closest(".SearchResult")?.querySelector(".SearchResult-actions-toggle");o&&o.focus()})})})},35053(e,n,t){"use strict";t.d(n,{A:()=>A}),t(57573),t(49371),t(42723),t(96648),t(56065);var o=t(71224),i=t(98474),r=t(89713),a=t(67324),s=t(44209);function c(){c=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,n){["method","field"].forEach(function(t){n.forEach(function(n){n.kind===t&&"own"===n.placement&&this.defineClassElement(e,n)},this)},this)},initializeClassElements:function(e,n){var t=e.prototype;["method","field"].forEach(function(o){n.forEach(function(n){var i=n.placement;if(n.kind===o&&("static"===i||"prototype"===i)){var r="static"===i?e:t;this.defineClassElement(r,n)}},this)},this)},defineClassElement:function(e,n){var t=n.descriptor;if("field"===n.kind){var o=n.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===o?void 0:o.call(e)}}Object.defineProperty(e,n.key,t)},decorateClass:function(e,n){var t=[],o=[],i={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,i)},this),e.forEach(function(e){if(!p(e))return t.push(e);var n=this.decorateElement(e,i);t.push(n.element),t.push.apply(t,n.extras),o.push.apply(o,n.finishers)},this),!n)return{elements:t,finishers:o};var r=this.decorateConstructor(t,n);return o.push.apply(o,r.finishers),r.finishers=o,r},addElementPlacement:function(e,n,t){var o=n[e.placement];if(!t&&-1!==o.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");o.push(e.key)},decorateElement:function(e,n){for(var t=[],o=[],i=e.decorators,r=i.length-1;r>=0;r--){var a=n[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[r])(s)||s);e=c.element,this.addElementPlacement(e,n),c.finisher&&o.push(c.finisher);var d=c.extras;if(d){for(var l=0;l<d.length;l++)this.addElementPlacement(d[l],n);t.push.apply(t,d)}}return{element:e,finishers:o,extras:t}},decorateConstructor:function(e,n){for(var t=[],o=n.length-1;o>=0;o--){var i=this.fromClassDescriptor(e),r=this.toClassDescriptor((0,n[o])(i)||i);if(void 0!==r.finisher&&t.push(r.finisher),void 0!==r.elements){e=r.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:t}},fromElementDescriptor:function(e){var n={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(n.initializer=e.initializer),n},toElementDescriptors:function(e){if(void 0!==e)return(n=e,function(e){if(Array.isArray(e))return e}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,n){if(e){if("string"==typeof e)return h(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,n):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var n=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),n},this);var n},toElementDescriptor:function(e){var n=e.kind+"";if("method"!==n&&"field"!==n)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+n+'"');var t=b(e.key),o=e.placement+"";if("static"!==o&&"prototype"!==o&&"own"!==o)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+o+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var r={kind:n,key:t,placement:o,descriptor:Object.assign({},i)};return"field"!==n?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),r.initializer=e.initializer),r},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:u(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var n={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),n},toClassDescriptor:function(e){var n=e.kind+"";if("class"!==n)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+n+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var t=u(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,n){for(var t=0;t<n.length;t++){var o=(0,n[t])(e);if(void 0!==o){if("function"!=typeof o)throw new TypeError("Finishers must return a constructor.");e=o}}return e},disallowProperty:function(e,n,t){if(void 0!==e[n])throw new TypeError(t+" can't have a ."+n+" property.")}};return e}function d(e){var n,t=b(e.key);"method"===e.kind?n={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?n={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?n={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(n={configurable:!0,writable:!0,enumerable:!0});var o={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:n};return e.decorators&&(o.decorators=e.decorators),"field"===e.kind&&(o.initializer=e.value),o}function l(e,n){void 0!==e.descriptor.get?n.descriptor.get=e.descriptor.get:n.descriptor.set=e.descriptor.set}function p(e){return e.decorators&&e.decorators.length}function M(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function u(e,n){var t=e[n];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+n+"' to be a function");return t}function b(e){var n=function(e){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof n?n:n+""}function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function z(){return z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,n,t){var o=function(e,n){for(;!{}.hasOwnProperty.call(e,n)&&null!==(e=O(e)););return e}(e,n);if(o){var i=Object.getOwnPropertyDescriptor(o,n);return i.get?i.get.call(arguments.length<3?e:t):i.value}},z.apply(null,arguments)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}const f=window.localStorage,m=window.BRIGHTSPOT?.ui.tooltips.collapse,g=window.BRIGHTSPOT?.ui.tooltips.expand;let A=(w=[(0,i.EM)("btu-cig-cluster")],v=(0,r.j)((0,a.m)(o.WF)),q=c(),k=function(e,n){class t extends n{constructor(...n){super(...n),e(this)}}return{F:t,d:[{kind:"field",key:"_collapsed",value:()=>!0},{kind:"field",decorators:[(0,i.MZ)({type:String,reflect:!0,attribute:"cluster-title"})],key:"clusterTitle",value:void 0},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"tab",value:void 0},{kind:"set",decorators:[(0,i.MZ)()],key:"collapsed",value:function(e){this._collapsed=e;const n=this.closest(".CIG"),t=n?.dataset.type,o=this.clusterTitle?.trim(),i=`BSP.ContentEdit.clusterExpanded.${t}.${o}`;t&&o&&(e?f.removeItem(i):f.setItem(i,"1")),this._collapsed?this.states.delete("btu-expanded"):this.states.add("btu-expanded"),this.requestUpdate()}},{kind:"get",key:"collapsed",value:function(){return this._collapsed}},{kind:"method",key:"_toggleRowVisibility",value:function(e){this.querySelectorAll(":scope > :not(.CIG-title)").forEach(n=>{n.childNodes.length&&(n.toggleAttribute("hidden",e),n.classList.toggle("TC-unselected",e))})}},{kind:"method",key:"connectedCallback",value:function(){var e,n,o,i,r;(e=t,n="connectedCallback",o=this,r=z(O(1&(i=3)?e.prototype:e),n,o),2&i&&"function"==typeof r?function(e){return r.apply(o,e)}:r)([]);const a=this.closest(".CIG"),s=a?.dataset.type,c=`BSP.ContentEdit.clusterExpanded.${s}.${this.clusterTitle}`;this.collapsed=!f.getItem(c)}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"firstUpdated",value:function(){this.emit("btu-cig-cluster-ready");const e=this.querySelector(".CIG-title"),n=this.firstChild;n instanceof Element&&!n.classList.contains("CIG-title")&&e&&this.insertBefore(e,n),this.dataset.tab=this.tab;const t=Array.from(this.querySelectorAll(".CIG-row")).filter(e=>e.childNodes.length);this.toggleAttribute("hidden",!t.length),Array.from(this.querySelectorAll(".CIG-row")).filter(e=>!e.childNodes.length).forEach(e=>e.toggleAttribute("hidden",!0)),this.querySelectorAll(".CIG-row > .Message.is-error").length>0?this.states.add("btu-error"):this.states.delete("btu-error")}},{kind:"method",key:"render",value:function(){return this._toggleRowVisibility(this.collapsed),o.qy`<h2 class="CIG-title" data-tab=${this.tab}>
1
+ /*! For license information please see v5.b7af407a8c1506dbc92f.js.LICENSE.txt */
2
+ (()=>{var __webpack_modules__={77854(e,n,t){var o={"./af":1277,"./af.js":1277,"./ar":56313,"./ar-dz":92160,"./ar-dz.js":92160,"./ar-kw":20080,"./ar-kw.js":20080,"./ar-ly":54031,"./ar-ly.js":54031,"./ar-ma":63056,"./ar-ma.js":63056,"./ar-ps":9213,"./ar-ps.js":9213,"./ar-sa":67490,"./ar-sa.js":67490,"./ar-tn":64484,"./ar-tn.js":64484,"./ar.js":56313,"./az":99745,"./az.js":99745,"./be":47811,"./be.js":47811,"./bg":14357,"./bg.js":14357,"./bm":11259,"./bm.js":11259,"./bn":98436,"./bn-bd":22879,"./bn-bd.js":22879,"./bn.js":98436,"./bo":58925,"./bo.js":58925,"./br":50808,"./br.js":50808,"./bs":80721,"./bs.js":80721,"./ca":29400,"./ca.js":29400,"./cs":17246,"./cs.js":17246,"./cv":67939,"./cv.js":67939,"./cy":80608,"./cy.js":80608,"./da":47697,"./da.js":47697,"./de":17829,"./de-at":30685,"./de-at.js":30685,"./de-ch":23335,"./de-ch.js":23335,"./de.js":17829,"./dv":67042,"./dv.js":67042,"./el":78327,"./el.js":78327,"./en-au":49776,"./en-au.js":49776,"./en-ca":85650,"./en-ca.js":85650,"./en-gb":44217,"./en-gb.js":44217,"./en-ie":17768,"./en-ie.js":17768,"./en-il":69305,"./en-il.js":69305,"./en-in":95031,"./en-in.js":95031,"./en-nz":54898,"./en-nz.js":54898,"./en-sg":42504,"./en-sg.js":42504,"./eo":97728,"./eo.js":97728,"./es":30876,"./es-do":94290,"./es-do.js":94290,"./es-mx":8022,"./es-mx.js":8022,"./es-us":58073,"./es-us.js":58073,"./es.js":30876,"./et":62671,"./et.js":62671,"./eu":48590,"./eu.js":48590,"./fa":53243,"./fa.js":53243,"./fi":17827,"./fi.js":17827,"./fil":33457,"./fil.js":33457,"./fo":17057,"./fo.js":17057,"./fr":25652,"./fr-ca":55873,"./fr-ca.js":55873,"./fr-ch":12544,"./fr-ch.js":12544,"./fr.js":25652,"./fy":60403,"./fy.js":60403,"./ga":72500,"./ga.js":72500,"./gd":57161,"./gd.js":57161,"./gl":60177,"./gl.js":60177,"./gom-deva":76290,"./gom-deva.js":76290,"./gom-latn":75307,"./gom-latn.js":75307,"./gu":55072,"./gu.js":55072,"./he":4009,"./he.js":4009,"./hi":6789,"./hi.js":6789,"./hr":35642,"./hr.js":35642,"./hu":40601,"./hu.js":40601,"./hy-am":85116,"./hy-am.js":85116,"./id":63731,"./id.js":63731,"./is":99144,"./is.js":99144,"./it":48003,"./it-ch":48213,"./it-ch.js":48213,"./it.js":48003,"./ja":32327,"./ja.js":32327,"./jv":2692,"./jv.js":2692,"./ka":65856,"./ka.js":65856,"./kk":2494,"./kk.js":2494,"./km":85644,"./km.js":85644,"./kn":53187,"./kn.js":53187,"./ko":95970,"./ko.js":95970,"./ku":99412,"./ku-kmr":93269,"./ku-kmr.js":93269,"./ku.js":99412,"./ky":14648,"./ky.js":14648,"./lb":91286,"./lb.js":91286,"./lo":35,"./lo.js":35,"./lt":72564,"./lt.js":72564,"./lv":80234,"./lv.js":80234,"./me":20486,"./me.js":20486,"./mi":4210,"./mi.js":4210,"./mk":96604,"./mk.js":96604,"./ml":57039,"./ml.js":57039,"./mn":37713,"./mn.js":37713,"./mr":33869,"./mr.js":33869,"./ms":70628,"./ms-my":71967,"./ms-my.js":71967,"./ms.js":70628,"./mt":72695,"./mt.js":72695,"./my":62946,"./my.js":62946,"./nb":38348,"./nb.js":38348,"./ne":53279,"./ne.js":53279,"./nl":98934,"./nl-be":45848,"./nl-be.js":45848,"./nl.js":98934,"./nn":23008,"./nn.js":23008,"./oc-lnc":18752,"./oc-lnc.js":18752,"./pa-in":43211,"./pa-in.js":43211,"./pl":37904,"./pl.js":37904,"./pt":69224,"./pt-br":68393,"./pt-br.js":68393,"./pt.js":69224,"./ro":18557,"./ro.js":18557,"./ru":60867,"./ru.js":60867,"./sd":48565,"./sd.js":48565,"./se":67564,"./se.js":67564,"./si":52224,"./si.js":52224,"./sk":28150,"./sk.js":28150,"./sl":34413,"./sl.js":34413,"./sq":96664,"./sq.js":96664,"./sr":2831,"./sr-cyrl":15358,"./sr-cyrl.js":15358,"./sr.js":2831,"./ss":41646,"./ss.js":41646,"./sv":93907,"./sv.js":93907,"./sw":9202,"./sw.js":9202,"./ta":64833,"./ta.js":64833,"./te":64725,"./te.js":64725,"./tet":6607,"./tet.js":6607,"./tg":81955,"./tg.js":81955,"./th":21504,"./th.js":21504,"./tk":2103,"./tk.js":2103,"./tl-ph":52597,"./tl-ph.js":52597,"./tlh":1256,"./tlh.js":1256,"./tr":84046,"./tr.js":84046,"./tzl":98229,"./tzl.js":98229,"./tzm":90051,"./tzm-latn":26723,"./tzm-latn.js":26723,"./tzm.js":90051,"./ug-cn":5910,"./ug-cn.js":5910,"./uk":36628,"./uk.js":36628,"./ur":15541,"./ur.js":15541,"./uz":1389,"./uz-latn":63085,"./uz-latn.js":63085,"./uz.js":1389,"./vi":61203,"./vi.js":61203,"./x-pseudo":57591,"./x-pseudo.js":57591,"./yo":67780,"./yo.js":67780,"./zh-cn":72248,"./zh-cn.js":72248,"./zh-hk":18124,"./zh-hk.js":18124,"./zh-mo":91391,"./zh-mo.js":91391,"./zh-tw":75716,"./zh-tw.js":75716};function i(e){var n=r(e);return t(n)}function r(e){if(!t.o(o,e)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return o[e]}i.keys=function(){return Object.keys(o)},i.resolve=r,e.exports=i,i.id=77854},31201(e,n,t){"use strict";var o=t(88630),i=t.n(o),r=t(91762);const a=window.BRIGHTSPOT?.web?.pagePaths?.["com.psddev.analytics.ui.AnalyticsDataToolPage"];class s{constructor(e){this.element=void 0,this.contentId=void 0,this.analyticsUrl=void 0,this.isLoaded=!1,this.cache={},this.currentPeriod="hours",this.loadingElement=void 0,this.contentElement=void 0,this.errorElement=void 0,this.periodSelector=void 0,this.element=e,this.contentId=e.dataset.contentId||"",this.analyticsUrl=a,this.loadingElement=e.querySelector(".AnalyticsWidget-loading"),this.contentElement=e.querySelector(".AnalyticsWidget-content"),this.errorElement=e.querySelector(".AnalyticsWidget-error"),this.periodSelector=e.querySelector(".AnalyticsWidget-periodSelector"),this.init()}init(){i()(this.element).closest("[data-tab]").on("tabbedShow",()=>{const e=this.element.closest("[data-tab]");this.isLoaded||e?.classList.contains("TC-unselected")||this.loadAnalyticsData()}),this.periodSelector&&this.periodSelector.addEventListener("change",e=>{const n=e.target;null!==n&&n instanceof HTMLSelectElement&&(this.currentPeriod=n.value,this.loadAnalyticsData())})}async loadAnalyticsData(){const e=this.currentPeriod;if(this.cache[e])this.displayData(this.cache[e]);else{if(!this.analyticsUrl)return console.error("Analytics data endpoint not found in pagePaths"),void this.showError();this.showLoading();try{const n=await fetch(`${this.analyticsUrl}?id=${this.contentId}&period=${e}`);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const t=await n.json();if("error"in t)throw new Error(t.error);this.cache[e]=t,this.displayData(t),this.isLoaded=!0}catch(e){console.error("Failed to load analytics data:",e),this.showError()}}}showLoading(){this.loadingElement&&(this.loadingElement.hidden=!1),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0)}showError(){this.loadingElement&&(this.loadingElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!1)}displayData(e){if(this.loadingElement&&(this.loadingElement.hidden=!0),this.errorElement&&(this.errorElement.hidden=!0),this.contentElement&&(this.contentElement.hidden=!1),!this.contentElement)return;this.contentElement.innerHTML="";const n=document.createElement("div");n.className=`numbersPeriod numbersPeriod-${e.periodLabel}`,n.addEventListener("highchart-loaded",()=>{n.classList.add("chart-loaded")}),e.chartData&&(n.innerHTML=e.chartData),this.contentElement.appendChild(n)}}(0,r.A)(".AnalyticsWidget",e=>{new s(e)})},60655(e,n,t){"use strict";t(86634),t(57573);var o={},i="function"==typeof Map?new Map:null,r="swap",a="move",s="layoutStart",c="layoutEnd",d="layoutAbort",l="remove",p="hideStart",M="filter",u="sort",b="move",h="send",z="beforeSend",O="receive",f="beforeReceive",m="dragReleaseEnd",g="ontouchstart"in window,A=!!window.PointerEvent,w=!!window.navigator.msPointerEnabled;function v(){this._events={},this._queue=[],this._counter=0,this._clearOnEmit=!1}v.prototype.on=function(e,n){if(!this._events||!e||!n)return this;var t=this._events[e];return t||(t=this._events[e]=[]),t.push(n),this},v.prototype.off=function(e,n){if(!this._events||!e||!n)return this;var t,o=this._events[e];if(!o||!o.length)return this;for(;-1!==(t=o.indexOf(n));)o.splice(t,1);return this},v.prototype.clear=function(e){if(!this._events||!e)return this;var n=this._events[e];return n&&(n.length=0,delete this._events[e]),this},v.prototype.emit=function(e){if(!this._events||!e)return this._clearOnEmit=!1,this;var n=this._events[e];if(!n||!n.length)return this._clearOnEmit=!1,this;var t,o=this._queue,i=o.length,r=arguments.length-1;r>3&&((t=[]).push.apply(t,arguments),t.shift()),o.push.apply(o,n),this._clearOnEmit&&(n.length=0,this._clearOnEmit=!1),++this._counter;for(var a=i,s=o.length;a<s;a++)if(0===r?o[a]():1===r?o[a](arguments[1]):2===r?o[a](arguments[1],arguments[2]):3===r?o[a](arguments[1],arguments[2],arguments[3]):o[a].apply(null,t),!this._events)return this;return--this._counter,this._counter||(o.length=0),this},v.prototype.burst=function(){return this._events?(this._clearOnEmit=!0,this.emit.apply(this,arguments),this):this},v.prototype.countListeners=function(e){if(!this._events)return 0;var n=this._events[e];return n?n.length:0},v.prototype.destroy=function(){return this._events?(this._queue.length=this._counter=0,this._events=null,this):this};var q=A?"pointerout":w?"MSPointerOut":"";function k(e){q&&(this._dragger=e,this._timeout=null,this._outEvent=null,this._isActive=!1,this._addBehaviour=this._addBehaviour.bind(this),this._removeBehaviour=this._removeBehaviour.bind(this),this._onTimeout=this._onTimeout.bind(this),this._resetData=this._resetData.bind(this),this._onStart=this._onStart.bind(this),this._onOut=this._onOut.bind(this),this._dragger.on("start",this._onStart))}k.prototype._addBehaviour=function(){this._isActive||(this._isActive=!0,this._dragger.on("move",this._resetData),this._dragger.on("cancel",this._removeBehaviour),this._dragger.on("end",this._removeBehaviour),window.addEventListener(q,this._onOut))},k.prototype._removeBehaviour=function(){this._isActive&&(this._dragger.off("move",this._resetData),this._dragger.off("cancel",this._removeBehaviour),this._dragger.off("end",this._removeBehaviour),window.removeEventListener(q,this._onOut),this._resetData(),this._isActive=!1)},k.prototype._resetData=function(){window.clearTimeout(this._timeout),this._timeout=null,this._outEvent=null},k.prototype._onStart=function(e){"mouse"!==e.pointerType&&this._addBehaviour()},k.prototype._onOut=function(e){this._dragger._getTrackedTouch(e)&&(this._resetData(),this._outEvent=e,this._timeout=window.setTimeout(this._onTimeout,100))},k.prototype._onTimeout=function(){var e=this._outEvent;this._resetData(),this._dragger.isActive()&&this._dragger._onCancel(e)},k.prototype.destroy=function(){q&&(this._dragger.off("start",this._onStart),this._removeBehaviour())};var _=["","webkit","moz","ms","o","Webkit","Moz","MS","O"],y={};function W(e,n){var t=y[n]||"";if(t)return t;for(var o=n[0].toUpperCase()+n.slice(1),i=0;i<_.length;){if((t=_[i]?_[i]+o:n)in e)return y[n]=t,t;++i}return""}function x(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,n),window.removeEventListener("testPassive",null,n)}catch(e){}return e}var L=window.navigator.userAgent.toLowerCase(),C=L.indexOf("edge")>-1,R=L.indexOf("trident")>-1,N=L.indexOf("firefox")>-1,B=L.indexOf("android")>-1,S=!!x()&&{passive:!0},T="touchAction",E=W(document.documentElement.style,T);function D(e,n){this._element=e,this._emitter=new v,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._isActive=!1,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this._edgeHack=null,(C||R)&&(A||w)&&(this._edgeHack=new k(this)),this.setCssProps(n),this._touchAction||this.setTouchAction("auto"),e.addEventListener("dragstart",D._preventDefault,!1),e.addEventListener(D._inputEvents.start,this._onStart,S)}D._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},D._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},D._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},D._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},D._inputEvents=g?D._touchEvents:A?D._pointerEvents:w?D._msPointerEvents:D._mouseEvents,D._emitter=new v,D._emitterEvents={start:"start",move:"move",end:"end",cancel:"cancel"},D._activeInstances=[],D._preventDefault=function(e){e.preventDefault&&!1!==e.cancelable&&e.preventDefault()},D._activateInstance=function(e){D._activeInstances.indexOf(e)>-1||(D._activeInstances.push(e),D._emitter.on(D._emitterEvents.move,e._onMove),D._emitter.on(D._emitterEvents.cancel,e._onCancel),D._emitter.on(D._emitterEvents.end,e._onEnd),1===D._activeInstances.length&&D._bindListeners())},D._deactivateInstance=function(e){var n=D._activeInstances.indexOf(e);-1!==n&&(D._activeInstances.splice(n,1),D._emitter.off(D._emitterEvents.move,e._onMove),D._emitter.off(D._emitterEvents.cancel,e._onCancel),D._emitter.off(D._emitterEvents.end,e._onEnd),D._activeInstances.length||D._unbindListeners())},D._bindListeners=function(){window.addEventListener(D._inputEvents.move,D._onMove,S),window.addEventListener(D._inputEvents.end,D._onEnd,S),D._inputEvents.cancel&&window.addEventListener(D._inputEvents.cancel,D._onCancel,S)},D._unbindListeners=function(){window.removeEventListener(D._inputEvents.move,D._onMove,S),window.removeEventListener(D._inputEvents.end,D._onEnd,S),D._inputEvents.cancel&&window.removeEventListener(D._inputEvents.cancel,D._onCancel,S)},D._getEventPointerId=function(e){return"number"==typeof e.pointerId?e.pointerId:e.changedTouches?e.changedTouches[0]?e.changedTouches[0].identifier:null:1},D._getTouchById=function(e,n){if("number"==typeof e.pointerId)return e.pointerId===n?e:null;if(e.changedTouches){for(var t=0;t<e.changedTouches.length;t++)if(e.changedTouches[t].identifier===n)return e.changedTouches[t];return null}return e},D._onMove=function(e){D._emitter.emit(D._emitterEvents.move,e)},D._onCancel=function(e){D._emitter.emit(D._emitterEvents.cancel,e)},D._onEnd=function(e){D._emitter.emit(D._emitterEvents.end,e)},D.prototype._reset=function(){this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._isActive=!1,D._deactivateInstance(this)},D.prototype._createEvent=function(e,n){var t=this._getTrackedTouch(n);return{type:e,srcEvent:n,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:e===D._emitterEvents.start?0:this.getDeltaTime(),isFirst:e===D._emitterEvents.start,isFinal:e===D._emitterEvents.end||e===D._emitterEvents.cancel,pointerType:n.pointerType||(n.touches?"touch":"mouse"),identifier:this._pointerId,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:t.target}},D.prototype._emit=function(e,n){this._emitter.emit(e,this._createEvent(e,n))},D.prototype._getTrackedTouch=function(e){return null===this._pointerId?null:D._getTouchById(e,this._pointerId)},D.prototype._onStart=function(e){if(!this._isDestroyed&&null===this._pointerId&&(this._pointerId=D._getEventPointerId(e),null!==this._pointerId)){var n=this._getTrackedTouch(e);this._startX=this._currentX=n.clientX,this._startY=this._currentY=n.clientY,this._startTime=Date.now(),this._isActive=!0,this._emit(D._emitterEvents.start,e),this._isActive&&D._activateInstance(this)}},D.prototype._onMove=function(e){var n=this._getTrackedTouch(e);n&&(this._currentX=n.clientX,this._currentY=n.clientY,this._emit(D._emitterEvents.move,e))},D.prototype._onCancel=function(e){this._getTrackedTouch(e)&&(this._emit(D._emitterEvents.cancel,e),this._reset())},D.prototype._onEnd=function(e){this._getTrackedTouch(e)&&(this._emit(D._emitterEvents.end,e),this._reset())},D.prototype.isActive=function(){return this._isActive},D.prototype.setTouchAction=function(e){this._touchAction=e,E&&(this._cssProps[E]="",this._element.style[E]=e),g&&(this._element.removeEventListener(D._touchEvents.start,D._preventDefault,!0),(this._element.style[E]!==e||N&&B)&&this._element.addEventListener(D._touchEvents.start,D._preventDefault,!0))},D.prototype.setCssProps=function(e){if(e){var n,t,o=this._cssProps,i=this._element;for(n in o)i.style[n]=o[n],delete o[n];for(n in e)e[n]&&(n!==T?(t=W(i.style,n))&&(o[t]="",i.style[t]=e[n]):this.setTouchAction(e[n]))}},D.prototype.getDeltaX=function(){return this._currentX-this._startX},D.prototype.getDeltaY=function(){return this._currentY-this._startY},D.prototype.getDistance=function(){var e=this.getDeltaX(),n=this.getDeltaY();return Math.sqrt(e*e+n*n)},D.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},D.prototype.on=function(e,n){this._emitter.on(e,n)},D.prototype.off=function(e,n){this._emitter.off(e,n)},D.prototype.destroy=function(){if(!this._isDestroyed){var e=this._element;for(var n in this._edgeHack&&this._edgeHack.destroy(),this._reset(),this._emitter.destroy(),e.removeEventListener(D._inputEvents.start,this._onStart,S),e.removeEventListener("dragstart",D._preventDefault,!1),e.removeEventListener(D._touchEvents.start,D._preventDefault,!0),this._cssProps)e.style[n]=this._cssProps[n],delete this._cssProps[n];this._element=null,this._isDestroyed=!0}};var j=1e3/60,P=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return this.setTimeout(function(){e(Date.now())},j)}).bind(window);function X(e){this._nextStep=null,this._lanes=[],this._stepQueue=[],this._stepCallbacks={},this._step=this._step.bind(this);for(var n=0;n<e;n++)this._lanes.push(new H)}function H(){this.queue=[],this.indices={},this.callbacks={}}X.prototype._step=function(e){var n,t,o,i,r,a,s=this._lanes,c=this._stepQueue,d=this._stepCallbacks;for(this._nextStep=null,n=0;n<s.length;n++){for(i=s[n].queue,r=s[n].callbacks,a=s[n].indices,t=0;t<i.length;t++)(o=i[t])&&(c.push(o),d[o]=r[o],delete r[o],delete a[o]);i.length=0}for(n=0;n<c.length;n++)d[o=c[n]]&&d[o](e),delete d[o];c.length=0},X.prototype.add=function(e,n,t){this._lanes[e].add(n,t),this._nextStep||(this._nextStep=P(this._step))},X.prototype.remove=function(e,n){this._lanes[e].remove(n)},H.prototype.add=function(e,n){var t=this.indices[e];void 0!==t&&(this.queue[t]=void 0),this.queue.push(e),this.callbacks[e]=n,this.indices[e]=this.queue.length-1},H.prototype.remove=function(e){var n=this.indices[e];void 0!==n&&(this.queue[n]=void 0,delete this.callbacks[e],delete this.indices[e])};var Y="layoutRead",I="layoutWrite",F="visibilityRead",V="visibilityWrite",G="dragStartRead",U="dragStartWrite",$="dragMoveRead",J="dragMoveWrite",K="dragScrollRead",Z="dragScrollWrite",Q="dragSortRead",ee="placeholderLayoutRead",ne="placeholderLayoutWrite",te="placeholderResizeWrite",oe="autoScrollRead",ie="autoScrollWrite",re="debounceRead",ae=new X(3);function se(e){ae.remove(0,Y+e),ae.remove(2,I+e)}function ce(e){ae.remove(0,F+e),ae.remove(2,V+e)}function de(e){ae.remove(0,G+e),ae.remove(2,U+e)}function le(e){ae.remove(0,$+e),ae.remove(2,J+e)}function pe(e){ae.remove(0,K+e),ae.remove(2,Z+e)}function Me(e,n){ae.add(1,Q+e,n)}function ue(e){ae.remove(0,ee+e),ae.remove(2,ne+e)}function be(e,n){ae.add(0,oe,e),ae.add(2,ie,n)}function he(e){return"function"==typeof e}var ze="function"==typeof WeakMap?new WeakMap:null;function Oe(e,n){var t=ze&&ze.get(e);return t||(t=window.getComputedStyle(e,null),ze&&ze.set(e,t)),t.getPropertyValue(n)}function fe(e,n){return parseFloat(Oe(e,n))||0}var me,ge=document.documentElement,Ae=document.body,we={value:0,offset:0};function ve(e){return e===window||e===ge||e===Ae?window:e}function qe(e){return e===window?e.pageXOffset:e.scrollLeft}function ke(e){return e===window?e.pageYOffset:e.scrollTop}function _e(e){return e===window?ge.scrollWidth-ge.clientWidth:e.scrollWidth-e.clientWidth}function ye(e){return e===window?ge.scrollHeight-ge.clientHeight:e.scrollHeight-e.clientHeight}function We(e,n){if(n=n||{},e===window)n.width=ge.clientWidth,n.height=ge.clientHeight,n.left=0,n.right=n.width,n.top=0,n.bottom=n.height;else{var t=e.getBoundingClientRect(),o=e.clientLeft||fe(e,"border-left-width"),i=e.clientTop||fe(e,"border-top-width");n.width=e.clientWidth,n.height=e.clientHeight,n.left=t.left+o,n.right=n.left+n.width,n.top=t.top+i,n.bottom=n.top+n.height}return n}function xe(e){return e._drag._getGrid()._settings.dragAutoScroll}function Le(e){e._drag&&e._drag._prepareScroll()}function Ce(e){if(e._drag&&e._isActive){var n=e._drag;n._scrollDiffX=n._scrollDiffY=0,e._setTranslate(n._left,n._top)}}function Re(e,n,t,o){return we.value=Math.min(o/2,e),we.offset=Math.max(0,t+2*we.value+o*n-o)/2,we}function Ne(){this.reset()}function Be(){this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0}function Se(e,n){this.pool=[],this.createItem=e,this.releaseItem=n}function Te(e,n){var t=function(e,n){return function(e,n){return!(e.left+e.width<=n.left||n.left+n.width<=e.left||e.top+e.height<=n.top||n.top+n.height<=e.top)}(e,n)?(Math.min(e.left+e.width,n.left+n.width)-Math.max(e.left,n.left))*(Math.min(e.top+e.height,n.top+n.height)-Math.max(e.top,n.top)):0}(e,n);return t?t/(Math.min(e.width,n.width)*Math.min(e.height,n.height))*100:0}Ne.prototype.reset=function(){this.isActive&&this.onStop(),this.item=null,this.element=null,this.isActive=!1,this.isEnding=!1,this.direction=null,this.value=null,this.maxValue=0,this.threshold=0,this.distance=0,this.speed=0,this.duration=0,this.action=null},Ne.prototype.hasReachedEnd=function(){return 4&this.direction?this.value>=this.maxValue:this.value<=0},Ne.prototype.computeCurrentScrollValue=function(){return null===this.value?1&this.direction?qe(this.element):ke(this.element):Math.max(0,Math.min(this.value,this.maxValue))},Ne.prototype.computeNextScrollValue=function(e){var n=this.speed*(e/1e3),t=4&this.direction?this.value+n:this.value-n;return Math.max(0,Math.min(t,this.maxValue))},Ne.prototype.computeSpeed=(me={direction:null,threshold:0,distance:0,value:0,maxValue:0,deltaTime:0,duration:0,isEnding:!1},function(e){var n=this.item,t=xe(n).speed;return he(t)?(me.direction=this.direction,me.threshold=this.threshold,me.distance=this.distance,me.value=this.value,me.maxValue=this.maxValue,me.duration=this.duration,me.speed=this.speed,me.deltaTime=e,me.isEnding=this.isEnding,t(n,this.element,me)):t}),Ne.prototype.tick=function(e){return this.isActive||(this.isActive=!0,this.onStart()),this.value=this.computeCurrentScrollValue(),this.speed=this.computeSpeed(e),this.value=this.computeNextScrollValue(e),this.duration+=e,this.value},Ne.prototype.onStart=function(){var e=this.item,n=xe(e).onStart;he(n)&&n(e,this.element,this.direction)},Ne.prototype.onStop=function(){var e=this.item,n=xe(e).onStop;he(n)&&n(e,this.element,this.direction),e._drag&&e._drag.sort()},Be.prototype.reset=function(){this.requestX&&(this.requestX.action=null),this.requestY&&(this.requestY.action=null),this.element=null,this.requestX=null,this.requestY=null,this.scrollLeft=0,this.scrollTop=0},Be.prototype.addRequest=function(e){1&e.direction?(this.removeRequest(this.requestX),this.requestX=e):(this.removeRequest(this.requestY),this.requestY=e),e.action=this},Be.prototype.removeRequest=function(e){e&&(this.requestX===e?(this.requestX=null,e.action=null):this.requestY===e&&(this.requestY=null,e.action=null))},Be.prototype.computeScrollValues=function(){this.scrollLeft=this.requestX?this.requestX.value:qe(this.element),this.scrollTop=this.requestY?this.requestY.value:ke(this.element)},Be.prototype.scroll=function(){var e=this.element;e&&(e.scrollTo?e.scrollTo(this.scrollLeft,this.scrollTop):(e.scrollLeft=this.scrollLeft,e.scrollTop=this.scrollTop))},Se.prototype.pick=function(){return this.pool.pop()||this.createItem()},Se.prototype.release=function(e){this.releaseItem(e),-1===this.pool.indexOf(e)&&this.pool.push(e)},Se.prototype.reset=function(){this.pool.length=0};var Ee={width:0,height:0,left:0,right:0,top:0,bottom:0},De={width:0,height:0,left:0,right:0,top:0,bottom:0};function je(){this._isDestroyed=!1,this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,this._items=[],this._actions=[],this._requests={},this._requests[1]={},this._requests[2]={},this._requestOverlapCheck={},this._dragPositions={},this._dragDirections={},this._overlapCheckInterval=150,this._requestPool=new Se(function(){return new Ne},function(e){e.reset()}),this._actionPool=new Se(function(){return new Be},function(e){e.reset()}),this._readTick=this._readTick.bind(this),this._writeTick=this._writeTick.bind(this)}je.AXIS_X=1,je.AXIS_Y=2,je.FORWARD=4,je.BACKWARD=8,je.LEFT=9,je.RIGHT=5,je.UP=10,je.DOWN=6,je.smoothSpeed=function(e,n,t){return function(o,i,r){var a=0;if(!r.isEnding)if(r.threshold>0){var s=r.threshold-Math.max(0,r.distance);a=e/r.threshold*s}else a=e;var c=r.speed,d=a;return c===a?d:c<a?(d=c+n*(r.deltaTime/1e3),Math.min(a,d)):(d=c-t*(r.deltaTime/1e3),Math.max(a,d))}},je.pointerHandle=function(e){var n={left:0,top:0,width:0,height:0},t=e||1;return function(e,o,i,r,a,s,c){return n.left=s-.5*t,n.top=c-.5*t,n.width=t,n.height=t,n}},je.prototype._readTick=function(e){this._isDestroyed||(e&&this._tickTime?(this._tickDeltaTime=e-this._tickTime,this._tickTime=e,this._updateRequests(),this._updateActions()):(this._tickTime=e,this._tickDeltaTime=0))},je.prototype._writeTick=function(){this._isDestroyed||(this._applyActions(),be(this._readTick,this._writeTick))},je.prototype._startTicking=function(){this._isTicking=!0,be(this._readTick,this._writeTick)},je.prototype._stopTicking=function(){this._isTicking=!1,this._tickTime=0,this._tickDeltaTime=0,ae.remove(0,oe),ae.remove(2,ie)},je.prototype._getItemHandleRect=function(e,n,t){var o=e._drag;if(n){var i=o._dragMoveEvent||o._dragStartEvent,r=n(e,o._clientX,o._clientY,e._width,e._height,i.clientX,i.clientY);t.left=r.left,t.top=r.top,t.width=r.width,t.height=r.height}else t.left=o._clientX,t.top=o._clientY,t.width=e._width,t.height=e._height;return t.right=t.left+t.width,t.bottom=t.top+t.height,t},je.prototype._requestItemScroll=function(e,n,t,o,i,r,a){var s=this._requests[n],c=s[e._id];c?c.element===t&&c.direction===o||c.reset():c=this._requestPool.pick(),c.item=e,c.element=t,c.direction=o,c.threshold=i,c.distance=r,c.maxValue=a,s[e._id]=c},je.prototype._cancelItemScroll=function(e,n){var t=this._requests[n],o=t[e._id];o&&(o.action&&o.action.removeRequest(o),this._requestPool.release(o),delete t[e._id])},je.prototype._checkItemOverlap=function(e,n,t){var o=xe(e),i=he(o.targets)?o.targets(e):o.targets,r=o.threshold,a=o.safeZone;if(!i||!i.length)return n&&this._cancelItemScroll(e,1),void(t&&this._cancelItemScroll(e,2));var s=this._dragDirections[e._id],c=s[0],d=s[1];if(!c&&!d)return n&&this._cancelItemScroll(e,1),void(t&&this._cancelItemScroll(e,2));for(var l=this._getItemHandleRect(e,o.handle,Ee),p=De,M=null,u=null,b=!0,h=!0,z=0,O=0,f=null,m=null,g=0,A=0,w=0,v=null,q=-1/0,k=0,_=0,y=null,W=0,x=0,L=null,C=-1/0,R=0,N=0,B=null,S=0,T=0,E=0;E<i.length;E++)M=i[E],b=n&&c&&2!==M.axis,h=t&&d&&1!==M.axis,O=M.priority||0,(!b||O<q)&&(!h||O<C)||(u=ve(M.element||M),A=b?_e(u):-1,w=h?ye(u):-1,(A||w)&&((z=Te(l,p=We(u,p)))<=0||(b&&O>=q&&A>0&&(O>q||z>_)&&(m=null,f=Re("number"==typeof M.threshold?M.threshold:r,a,l.width,p.width),5===c?(g=p.right+f.offset-l.right)<=f.value&&qe(u)<A&&(m=5):9===c&&(g=l.left-(p.left-f.offset))<=f.value&&qe(u)>0&&(m=9),null!==m&&(v=u,q=O,k=f.value,_=z,y=m,W=g,x=A)),h&&O>=C&&w>0&&(O>C||z>N)&&(m=null,f=Re("number"==typeof M.threshold?M.threshold:r,a,l.height,p.height),6===d?(g=p.bottom+f.offset-l.bottom)<=f.value&&ke(u)<w&&(m=6):10===d&&(g=l.top-(p.top-f.offset))<=f.value&&ke(u)>0&&(m=10),null!==m&&(L=u,C=O,R=f.value,N=z,B=m,S=g,T=w)))));n&&(v?this._requestItemScroll(e,1,v,y,k,W,x):this._cancelItemScroll(e,1)),t&&(L?this._requestItemScroll(e,2,L,B,R,S,T):this._cancelItemScroll(e,2))},je.prototype._updateScrollRequest=function(e){for(var n=e.item,t=xe(n),o=he(t.targets)?t.targets(n):t.targets,i=o&&o.length||0,r=t.threshold,a=t.safeZone,s=this._getItemHandleRect(n,t.handle,Ee),c=De,d=null,l=null,p=!1,M=null,u=null,b=null,h=null,z=null,O=0;O<i;O++)if((l=ve((d=o[O]).element||d))===e.element){if(p=!!(1&e.direction)){if(2===d.axis)continue}else if(1===d.axis)continue;if((h=p?_e(l):ye(l))<=0)break;if(Te(s,c=We(l,c))<=0)break;if(M=Re("number"==typeof d.threshold?d.threshold:r,a,p?s.width:s.height,p?c.width:c.height),(u=9===e.direction?s.left-(c.left-M.offset):5===e.direction?c.right+M.offset-s.right:10===e.direction?s.top-(c.top-M.offset):c.bottom+M.offset-s.bottom)>M.value)break;if(b=p?qe(l):ke(l),z=4&e.direction?b>=h:b<=0)break;return e.maxValue=h,e.threshold=M.value,e.distance=u,e.isEnding=!1,!0}return!0===t.smoothStop&&e.speed>0?(null===z&&(z=e.hasReachedEnd()),e.isEnding=!z):e.isEnding=!1,e.isEnding},je.prototype._updateRequests=function(){for(var e,n,t,o,i,r,a,s=this._items,c=this._requests[1],d=this._requests[2],l=0;l<s.length;l++)e=s[l],i=(o=this._requestOverlapCheck[e._id])>0&&this._tickTime-o>this._overlapCheckInterval,r=!0,(n=c[e._id])&&n.isActive&&(r=!this._updateScrollRequest(n))&&(i=!0,this._cancelItemScroll(e,1)),a=!0,(t=d[e._id])&&t.isActive&&(a=!this._updateScrollRequest(t))&&(i=!0,this._cancelItemScroll(e,2)),i&&(this._requestOverlapCheck[e._id]=0,this._checkItemOverlap(e,r,a))},je.prototype._requestAction=function(e,n){for(var t=this._actions,o=1===n,i=null,r=0;r<t.length;r++){if(i=t[r],e.element===i.element){if(o?i.requestX:i.requestY)return void this._cancelItemScroll(e.item,n);break}i=null}i||(i=this._actionPool.pick()),i.element=e.element,i.addRequest(e),e.tick(this._tickDeltaTime),t.push(i)},je.prototype._updateActions=function(){var e,n,t,o,i=this._items,r=this._requests,a=this._actions;for(o=0;o<i.length;o++)e=i[o]._id,n=r[1][e],t=r[2][e],n&&this._requestAction(n,1),t&&this._requestAction(t,2);for(o=0;o<a.length;o++)a[o].computeScrollValues()},je.prototype._applyActions=function(){var e,n=this._actions,t=this._items;if(n.length){for(e=0;e<n.length;e++)n[e].scroll(),this._actionPool.release(n[e]);for(n.length=0,e=0;e<t.length;e++)Le(t[e]);for(e=0;e<t.length;e++)Ce(t[e])}},je.prototype._updateDragDirection=function(e){var n=this._dragPositions[e._id],t=this._dragDirections[e._id],o=e._drag._left,i=e._drag._top;if(n.length){var r=n[0],a=n[1];t[0]=o>r?5:o<r?9:t[0]||0,t[1]=i>a?6:i<a?10:t[1]||0}n[0]=o,n[1]=i},je.prototype.addItem=function(e){this._isDestroyed||-1===this._items.indexOf(e)&&(this._items.push(e),this._requestOverlapCheck[e._id]=this._tickTime,this._dragDirections[e._id]=[0,0],this._dragPositions[e._id]=[],this._isTicking||this._startTicking())},je.prototype.updateItem=function(e){this._isDestroyed||this._dragDirections[e._id]&&(this._updateDragDirection(e),this._requestOverlapCheck[e._id]||(this._requestOverlapCheck[e._id]=this._tickTime))},je.prototype.removeItem=function(e){if(!this._isDestroyed){var n=this._items.indexOf(e);if(-1!==n){var t=e._id;this._requests[1][t]&&(this._cancelItemScroll(e,1),delete this._requests[1][t]),this._requests[2][t]&&(this._cancelItemScroll(e,2),delete this._requests[2][t]),delete this._requestOverlapCheck[t],delete this._dragPositions[t],delete this._dragDirections[t],this._items.splice(n,1),this._isTicking&&!this._items.length&&this._stopTicking()}}},je.prototype.isItemScrollingX=function(e){var n=this._requests[1][e._id];return!(!n||!n.isActive)},je.prototype.isItemScrollingY=function(e){var n=this._requests[2][e._id];return!(!n||!n.isActive)},je.prototype.isItemScrolling=function(e){return this.isItemScrollingX(e)||this.isItemScrollingY(e)},je.prototype.destroy=function(){if(!this._isDestroyed){for(var e=this._items.slice(0),n=0;n<e.length;n++)this.removeItem(e[n]);this._actions.length=0,this._requestPool.reset(),this._actionPool.reset(),this._isDestroyed=!0}};var Pe=window.Element.prototype,Xe=Pe.matches||Pe.matchesSelector||Pe.webkitMatchesSelector||Pe.mozMatchesSelector||Pe.msMatchesSelector||Pe.oMatchesSelector||function(){return!1};function He(e,n){return Xe.call(e,n)}function Ye(e,n){n&&(e.classList?e.classList.add(n):He(e,"."+n)||(e.className+=" "+n))}var Ie=[];function Fe(e,n,t){var o="number"==typeof t?t:-1;o<0&&(o=e.length-o+1),e.splice.apply(e,Ie.concat(o,0,n)),Ie.length=0}function Ve(e,n,t){var o=Math.max(0,e.length-1+(t||0));return n>o?o:n<0?Math.max(o+n+1,0):n}function Ge(e,n,t){if(!(e.length<2)){var o=Ve(e,n),i=Ve(e,t);o!==i&&e.splice(i,0,e.splice(o,1)[0])}}function Ue(e,n,t){if(!(e.length<2)){var o,i=Ve(e,n),r=Ve(e,t);i!==r&&(o=e[i],e[i]=e[r],e[r]=o)}}var $e=W(document.documentElement.style,"transform")||"transform",Je=/([A-Z])/g,Ke=/^(webkit-|moz-|ms-|o-)/,Ze=/^(-m-s-)/;function Qe(e){var n=e.replace(Je,"-$1").toLowerCase();return(n=n.replace(Ke,"-$1")).replace(Ze,"-ms-")}var en=Qe($e);function nn(e){var n=Oe(e,en);if(!n||"none"===n)return!1;var t=Oe(e,"display");return"inline"!==t&&"none"!==t}function tn(e){for(var n=document,t=e||n;t&&t!==n&&"static"===Oe(t,"position")&&!nn(t);)t=t.parentElement||n;return t}var on={},rn={},an={};function sn(e,n){var t,o=n||{};return o.left=0,o.top=0,e===document||(o.left=window.pageXOffset||0,o.top=window.pageYOffset||0,e.self===window.self||(t=e.getBoundingClientRect(),o.left+=t.left,o.top+=t.top,o.left+=fe(e,"border-left-width"),o.top+=fe(e,"border-top-width"))),o}function cn(e,n,t){return an.left=0,an.top=0,e===n||t&&(e=tn(e))===(n=tn(n))||(sn(e,on),sn(n,rn),an.left=rn.left-on.left,an.top=rn.top-on.top),an}function dn(e){return"auto"===e||"scroll"===e||"overlay"===e}function ln(e){return dn(Oe(e,"overflow"))||dn(Oe(e,"overflow-x"))||dn(Oe(e,"overflow-y"))}function pn(e,n){for(n=n||[];e&&e!==document;)e.getRootNode&&e instanceof DocumentFragment?e=e.getRootNode().host:(ln(e)&&n.push(e),e=e.parentNode);return n.push(window),n}var Mn={},un=/^matrix3d/,bn=/([^,]*,){4}/,hn=/([^,]*,){12}/,zn=/[^,]*,/;function On(e){Mn.x=0,Mn.y=0;var n=Oe(e,en);if(!n||"none"===n)return Mn;var t=un.test(n),o=n.replace(t?hn:bn,""),i=o.replace(zn,"");return Mn.x=parseFloat(o)||0,Mn.y=parseFloat(i)||0,Mn}function fn(e,n){n&&(e.classList?e.classList.remove(n):He(e,"."+n)&&(e.className=(" "+e.className+" ").replace(" "+n+" "," ").trim()))}var mn,gn,An,wn,vn=/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1,qn=!!x()&&{passive:!0};function kn(e){var n=e._element,t=e.getGrid(),o=t._settings;this._item=e,this._gridId=t._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=he(o.dragStartPredicate)?o.dragStartPredicate:kn.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._isSortNeeded=!1,this._sortTimer=void 0,this._blockedSortIndex=null,this._sortX1=0,this._sortX2=0,this._sortY1=0,this._sortY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareStart=this._prepareStart.bind(this),this._applyStart=this._applyStart.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._handleSort=this._handleSort.bind(this),this._handleSortDelayed=this._handleSortDelayed.bind(this),this._handle=o.dragHandle&&n.querySelector(o.dragHandle)||n,this._dragger=new D(this._handle,o.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function _n(e,n){var t,o,i={};if(Array.isArray(n))for(o=0;o<n.length;o++)i[t=n[o]]=Oe(e,Qe(t));else for(t in n)i[t]=Oe(e,Qe(t));return i}kn.autoScroller=new je,kn.defaultStartPredicate=function(e,n,t){var o=e._drag;if(n.isFirst&&n.srcEvent.button)return!1;if(!vn&&n.isFirst&&!0===n.srcEvent.isTrusted&&!1===n.srcEvent.defaultPrevented&&!1===n.srcEvent.cancelable)return!1;if(!n.isFinal){var i=o._startPredicateData;if(!i){var r=t||o._getGrid()._settings.dragStartPredicate||{};o._startPredicateData=i={distance:Math.max(r.distance,0)||0,delay:Math.max(r.delay,0)||0}}return i.delay&&(i.event=n,i.delayTimer||(i.delayTimer=window.setTimeout(function(){i.delay=0,o._resolveStartPredicate(i.event)&&(o._forceResolveStartPredicate(i.event),o._resetStartPredicate())},i.delay))),o._resolveStartPredicate(n)}o._finishStartPredicate(n)},kn.defaultSortPredicate=(mn={},gn={},An={},wn=[],function(e,n){var t=e._drag,o=t._getGrid(),i=n&&"number"==typeof n.threshold?n.threshold:50,s=n&&n.action===r?r:a,c=n&&n.migrateAction===r?r:a;i=Math.min(Math.max(i,1),100),mn.width=e._width,mn.height=e._height,mn.left=t._clientX,mn.top=t._clientY;var d=function(e,n,t){var o,i,r,a,s,c,d,l,p,M,u=null,b=n._settings.dragSort,h=-1;if(!0===b?(wn[0]=n,i=wn):he(b)&&(i=b.call(n,e)),!i||!Array.isArray(i)||!i.length)return u;for(M=0;M<i.length;M++)if(!(r=i[M])._isDestroyed){for(r._updateBoundingRect(),c=Math.max(0,r._left),d=Math.max(0,r._top),l=Math.min(window.innerWidth,r._right),p=Math.min(window.innerHeight,r._bottom),a=r._element.parentNode;a&&a!==document&&a!==document.documentElement&&a!==document.body;)if(a.getRootNode&&a instanceof DocumentFragment)a=a.getRootNode().host;else{if("visible"!==Oe(a,"overflow")&&(s=a.getBoundingClientRect(),c=Math.max(c,s.left),d=Math.max(d,s.top),l=Math.min(l,s.right),p=Math.min(p,s.bottom)),"fixed"===Oe(a,"position"))break;a=a.parentNode}c>=l||d>=p||(gn.left=c,gn.top=d,gn.width=l-c,gn.height=p-d,(o=Te(mn,gn))>t&&o>h&&(h=o,u=r))}return wn.length=0,u}(e,o,i);if(!d)return null;var l,p,M,u=e.getGrid()!==d,b=0,h=0,z=0,O=-1,f=!1;for(d===o?(mn.left=t._gridX+e._marginLeft,mn.top=t._gridY+e._marginTop):(d._updateBorders(1,0,1,0),b=d._left+d._borderLeft,h=d._top+d._borderTop),M=0;M<d._items.length;M++)(l=d._items[M])._isActive&&l!==e&&(f=!0,gn.width=l._width,gn.height=l._height,gn.left=l._left+l._marginLeft+b,gn.top=l._top+l._marginTop+h,(p=Te(mn,gn))>z&&(O=M,z=p));return u&&z<i&&(O=f?O:0,z=i),z>=i?(An.grid=d,An.index=O,An.action=u?c:s,An):null}),kn.prototype.stop=function(){if(this._isActive)if(this._isMigrating)this._finishMigration();else{var e=this._item,n=e._id;if(kn.autoScroller.removeItem(e),de(n),le(n),pe(n),this._cancelSort(),this._isStarted){this._unbindScrollListeners();var t=e._element,o=this._getGrid(),i=o._settings.itemDraggingClass;t.parentNode!==o._element&&(o._element.appendChild(t),e._setTranslate(this._gridX,this._gridY),i&&t.clientWidth),fn(t,i)}this._reset()}},kn.prototype.sort=function(e){var n=this._item;this._isActive&&n._isActive&&this._dragMoveEvent&&(!0===e?this._handleSort():Me(n._id,this._handleSort))},kn.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._dragger.destroy(),kn.autoScroller.removeItem(this._item),this._isDestroyed=!0)},kn.prototype._getGrid=function(){return o[this._gridId]||null},kn.prototype._reset=function(){this._isActive=!1,this._isStarted=!1,this._container=null,this._containingBlock=null,this._dragStartEvent=null,this._dragMoveEvent=null,this._dragPrevMoveEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._clientX=0,this._clientY=0,this._scrollDiffX=0,this._scrollDiffY=0,this._moveDiffX=0,this._moveDiffY=0,this._containerDiffX=0,this._containerDiffY=0},kn.prototype._bindScrollListeners=function(){var e,n,t=this._getGrid()._element,o=this._container,i=this._scrollers;if(i.length=0,pn(this._item._element.parentNode,i),o!==t)for(pn(t,e=[]),n=0;n<e.length;n++)i.indexOf(e[n])<0&&i.push(e[n]);for(n=0;n<i.length;n++)i[n].addEventListener("scroll",this._onScroll,qn)},kn.prototype._unbindScrollListeners=function(){var e,n=this._scrollers;for(e=0;e<n.length;e++)n[e].removeEventListener("scroll",this._onScroll,qn);n.length=0},kn.prototype._resolveStartPredicate=function(e){var n=this._startPredicateData;if(!(e.distance<n.distance||n.delay))return this._resetStartPredicate(),!0},kn.prototype._forceResolveStartPredicate=function(e){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(e))},kn.prototype._finishStartPredicate=function(e){var n=this._item._element,t=Math.abs(e.deltaX)<2&&Math.abs(e.deltaY)<2&&e.deltaTime<200;this._resetStartPredicate(),t&&function(e){if("a"===e.tagName.toLowerCase()){var n=e.getAttribute("href");if(n){var t=e.getAttribute("target");t&&"_self"!==t?window.open(n,t):window.location.href=n}}}(n)},kn.prototype._resetHeuristics=function(e,n){this._blockedSortIndex=null,this._sortX1=this._sortX2=e,this._sortY1=this._sortY2=n},kn.prototype._checkHeuristics=function(e,n){var t=this._getGrid()._settings.dragSortHeuristics,o=t.minDragDistance;if(o<=0)return this._blockedSortIndex=null,!0;var i=e-this._sortX2,r=n-this._sortY2,a=o>3&&t.minBounceBackAngle>0;if(a||(this._blockedSortIndex=null),Math.abs(i)>o||Math.abs(r)>o){if(a){var s=Math.atan2(i,r),c=Math.atan2(this._sortX2-this._sortX1,this._sortY2-this._sortY1),d=Math.atan2(Math.sin(s-c),Math.cos(s-c));Math.abs(d)>t.minBounceBackAngle&&(this._blockedSortIndex=null)}return this._sortX1=this._sortX2,this._sortY1=this._sortY2,this._sortX2=e,this._sortY2=n,!0}return!1},kn.prototype._resetStartPredicate=function(){var e=this._startPredicateData;e&&(e.delayTimer&&(e.delayTimer=window.clearTimeout(e.delayTimer)),this._startPredicateData=null)},kn.prototype._handleSort=function(){if(this._isActive){var e=this._getGrid()._settings;if(!e.dragSort||!e.dragAutoScroll.sortDuringScroll&&kn.autoScroller.isItemScrolling(this._item))return this._sortX1=this._sortX2=this._gridX,this._sortY1=this._sortY2=this._gridY,this._isSortNeeded=!0,void(void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)));var n=this._checkHeuristics(this._gridX,this._gridY);if(this._isSortNeeded||n){var t=e.dragSortHeuristics.sortInterval;t<=0||this._isSortNeeded?(this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),this._checkOverlap()):void 0===this._sortTimer&&(this._sortTimer=window.setTimeout(this._handleSortDelayed,t))}}},kn.prototype._handleSortDelayed=function(){this._isSortNeeded=!0,this._sortTimer=void 0,Me(this._item._id,this._handleSort)},kn.prototype._cancelSort=function(){var e;this._isSortNeeded=!1,void 0!==this._sortTimer&&(this._sortTimer=window.clearTimeout(this._sortTimer)),e=this._item._id,ae.remove(1,Q+e)},kn.prototype._finishSort=function(){var e=this._getGrid()._settings.dragSort&&(this._isSortNeeded||void 0!==this._sortTimer);this._cancelSort(),e&&this._checkOverlap()},kn.prototype._checkOverlap=function(){if(this._isActive){var e,n,t,o,i,s,c,d,l=this._item,p=this._getGrid()._settings;(e=he(p.dragSortPredicate)?p.dragSortPredicate(l,this._dragMoveEvent):kn.defaultSortPredicate(l,p.dragSortPredicate))&&"number"==typeof e.index&&(c=e.action===r?r:a,d=(n=l.getGrid())!==(o=e.grid||n),t=n._items.indexOf(l),i=Ve(o._items,e.index,d&&c===a?1:0),(d||i!==this._blockedSortIndex)&&(d?(this._blockedSortIndex=null,s=o._items[i],n._hasListeners(z)&&n._emit(z,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),o._hasListeners(f)&&o._emit(f,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),l._gridId=o._id,this._isMigrating=l._gridId!==this._gridId,n._items.splice(t,1),Fe(o._items,l,i),l._sortData=null,n._hasListeners(h)&&n._emit(h,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),o._hasListeners(O)&&o._emit(O,{item:l,fromGrid:n,fromIndex:t,toGrid:o,toIndex:i}),c===r&&s&&s.isActive()&&o._items.indexOf(s)>-1&&o.send(s,n,t,{appendTo:this._container||document.body,layoutSender:!1,layoutReceiver:!1}),n.layout(),o.layout()):t!==i&&(this._blockedSortIndex=t,(c===r?Ue:Ge)(n._items,t,i),n._hasListeners(b)&&n._emit(b,{item:l,fromIndex:t,toIndex:i,action:c}),n.layout())))}},kn.prototype._finishMigration=function(){var e,n,t=this._item,o=t._dragRelease,i=t._element,r=t._isActive,a=t.getGrid(),s=a._element,c=a._settings,d=c.dragContainer||s,l=this._getGrid()._settings,p=i.parentNode,M=r?l.itemVisibleClass:l.itemHiddenClass,u=r?c.itemVisibleClass:c.itemHiddenClass;this._isMigrating=!1,this.destroy(),l.itemClass!==c.itemClass&&(fn(i,l.itemClass),Ye(i,c.itemClass)),M!==u&&(fn(i,M),Ye(i,u)),d!==p&&(d.appendChild(i),n=cn(p,d,!0),(e=On(i)).x-=n.left,e.y-=n.top),t._refreshDimensions(),n=cn(d,s,!0),o._containerDiffX=n.left,o._containerDiffY=n.top,t._drag=c.dragEnabled?new kn(t):null,d!==p&&t._setTranslate(e.x,e.y),t._visibility.setStyles(r?c.visibleStyles:c.hiddenStyles),o.start()},kn.prototype._preStartCheck=function(e){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,e),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(e)):!1===this._startPredicateResult&&(this._resetStartPredicate(e),this._dragger._reset(),this._startPredicateState=0)):2===this._startPredicateState&&this._isActive&&this._onMove(e)},kn.prototype._preEndCheck=function(e){var n=2===this._startPredicateState;this._startPredicate(this._item,e),this._startPredicateState=0,n&&this._isActive&&(this._isStarted?this._onEnd(e):this.stop())},kn.prototype._onStart=function(e){var n,t,o,i=this._item;i._isActive&&(this._isActive=!0,this._dragStartEvent=e,kn.autoScroller.addItem(i),n=i._id,t=this._prepareStart,o=this._applyStart,ae.add(0,G+n,t),ae.add(2,U+n,o))},kn.prototype._prepareStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var n=e._element,t=this._getGrid(),o=t._settings,i=t._element,r=o.dragContainer||i,a=tn(r),s=On(n),c=n.getBoundingClientRect(),d=r!==i;if(this._container=r,this._containingBlock=a,this._clientX=c.left,this._clientY=c.top,this._left=this._gridX=s.x,this._top=this._gridY=s.y,this._scrollDiffX=this._scrollDiffY=0,this._moveDiffX=this._moveDiffY=0,this._resetHeuristics(this._gridX,this._gridY),d){var l=cn(a,i);this._containerDiffX=l.left,this._containerDiffY=l.top}}}},kn.prototype._applyStart=function(){if(this._isActive){var e=this._item;if(e._isActive){var n=this._getGrid(),t=e._element,o=e._dragRelease,i=e._migrate,r=this._container!==n._element;e.isPositioning()&&e._layout.stop(!0,this._left,this._top),i._isActive&&(this._left-=i._containerDiffX,this._top-=i._containerDiffY,this._gridX-=i._containerDiffX,this._gridY-=i._containerDiffY,i.stop(!0,this._left,this._top)),e.isReleasing()&&o._reset(),n._settings.dragPlaceholder.enabled&&e._dragPlaceholder.create(),this._isStarted=!0,n._emit("dragInit",e,this._dragStartEvent),r&&(t.parentNode===this._container?(this._gridX-=this._containerDiffX,this._gridY-=this._containerDiffY):(this._left+=this._containerDiffX,this._top+=this._containerDiffY,this._container.appendChild(t),e._setTranslate(this._left,this._top))),Ye(t,n._settings.itemDraggingClass),this._bindScrollListeners(),n._emit("dragStart",e,this._dragStartEvent)}}},kn.prototype._onMove=function(e){var n,t,o,i=this._item;i._isActive?(this._dragMoveEvent=e,n=i._id,t=this._prepareMove,o=this._applyMove,ae.add(0,$+n,t),ae.add(2,J+n,o),Me(i._id,this._handleSort)):this.stop()},kn.prototype._prepareMove=function(){if(this._isActive&&this._item._isActive){var e=this._getGrid()._settings.dragAxis,n=this._dragMoveEvent,t=this._dragPrevMoveEvent||this._dragStartEvent||n;if("y"!==e){var o=n.clientX-t.clientX;this._left=this._left-this._moveDiffX+o,this._gridX=this._gridX-this._moveDiffX+o,this._clientX=this._clientX-this._moveDiffX+o,this._moveDiffX=o}if("x"!==e){var i=n.clientY-t.clientY;this._top=this._top-this._moveDiffY+i,this._gridY=this._gridY-this._moveDiffY+i,this._clientY=this._clientY-this._moveDiffY+i,this._moveDiffY=i}this._dragPrevMoveEvent=n}},kn.prototype._applyMove=function(){if(this._isActive){var e=this._item;e._isActive&&(this._moveDiffX=this._moveDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragMove",e,this._dragMoveEvent),kn.autoScroller.updateItem(e))}},kn.prototype._onScroll=function(e){var n,t,o,i=this._item;i._isActive?(this._scrollEvent=e,n=i._id,t=this._prepareScroll,o=this._applyScroll,ae.add(0,K+n,t),ae.add(2,Z+n,o),Me(i._id,this._handleSort)):this.stop()},kn.prototype._prepareScroll=function(){if(this._isActive){var e=this._item;if(e._isActive){var n=e._element,t=this._getGrid()._element,o=n.getBoundingClientRect();if(this._container!==t){var i=cn(this._containingBlock,t);this._containerDiffX=i.left,this._containerDiffY=i.top}var r=this._clientX-this._moveDiffX-o.left;this._left=this._left-this._scrollDiffX+r,this._scrollDiffX=r;var a=this._clientY-this._moveDiffY-o.top;this._top=this._top-this._scrollDiffY+a,this._scrollDiffY=a,this._gridX=this._left-this._containerDiffX,this._gridY=this._top-this._containerDiffY}}},kn.prototype._applyScroll=function(){if(this._isActive){var e=this._item;e._isActive&&(this._scrollDiffX=this._scrollDiffY=0,e._setTranslate(this._left,this._top),this._getGrid()._emit("dragScroll",e,this._scrollEvent))}},kn.prototype._onEnd=function(e){var n=this._item,t=n._element,o=this._getGrid(),i=o._settings,r=n._dragRelease;n._isActive?(de(n._id),le(n._id),pe(n._id),this._finishSort(),this._unbindScrollListeners(),r._containerDiffX=this._containerDiffX,r._containerDiffY=this._containerDiffY,this._reset(),fn(t,i.itemDraggingClass),kn.autoScroller.removeItem(n),o._emit("dragEnd",n,e),this._isMigrating?this._finishMigration():r.start()):this.stop()};var yn=/^(webkit|moz|ms|o|Webkit|Moz|MS|O)(?=[A-Z])/,Wn={};function xn(e){var n=Wn[e];return n||((n=e.replace(yn,""))!==e&&(n=n[0].toLowerCase()+n.slice(1)),Wn[e]=n,n)}function Ln(e,n){for(var t in n)e.style[t]=n[t]}var Cn,Rn,Nn=!(!Element||!he(Element.prototype.animate)),Bn=!!(Element&&(Cn=Element.prototype.animate,Rn=window.Symbol,Cn&&he(Rn)&&he(Rn.toString)&&Rn(Cn).toString().indexOf("[native code]")>-1));function Sn(e){this._element=e,this._animation=null,this._duration=0,this._easing="",this._callback=null,this._props=[],this._values=[],this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}function Tn(e,n){var t={};for(var o in e)t[n?o:xn(o)]=e[o];return t}function En(e,n){return"translateX("+e+"px) translateY("+n+"px)"}function Dn(e){this._item=e,this._animation=new Sn,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._left=0,this._top=0,this._transX=0,this._transY=0,this._nextTransX=0,this._nextTransY=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._updateDimensions=this._updateDimensions.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this),this._onHide=this._onHide.bind(this)}function jn(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function Pn(e){var n=e._element,t=n.style;this._item=e,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._nextLeft=0,this._nextTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animOptions={onFinish:this._finish.bind(this),duration:0,easing:0},t.left="0px",t.top="0px",e._setTranslate(0,0),this._animation=new Sn(n),this._queue="layout-"+e._id,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}function Xn(e){this._item=e,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}function Hn(e){var n=e._isActive,t=e._element,o=t.children[0],i=e.getGrid()._settings;if(!o)throw new Error("No valid child element found within item element.");this._item=e,this._isDestroyed=!1,this._isHidden=!n,this._isHiding=!1,this._isShowing=!1,this._childElement=o,this._currentStyleProps=[],this._animation=new Sn(o),this._queue="visibility-"+e._id,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),t.style.display=n?"":"none",Ye(t,n?i.itemVisibleClass:i.itemHiddenClass),this.setStyles(n?i.visibleStyles:i.hiddenStyles)}Sn.prototype.start=function(e,n,t){if(!this._isDestroyed){var o=this._element,i=t||{};if(!Nn)return Ln(o,n),this._callback=he(i.onFinish)?i.onFinish:null,void this._onFinish();var r,a,s,c=this._animation,d=this._props,l=this._values,p=i.duration||300,M=i.easing||"ease",u=!1;if(c&&(a=0,p===this._duration&&M===this._easing||(u=!0),!u)){for(r in n)if(++a,-1===(s=d.indexOf(r))||n[r]!==l[s]){u=!0;break}a!==d.length&&(u=!0)}if(u&&c.cancel(),this._callback=he(i.onFinish)?i.onFinish:null,!c||u){for(r in d.length=l.length=0,n)d.push(r),l.push(n[r]);this._duration=p,this._easing=M,this._animation=o.animate([Tn(e,Bn),Tn(n,Bn)],{duration:p,easing:M}),this._animation.onfinish=this._onFinish,Ln(o,n)}}},Sn.prototype.stop=function(){!this._isDestroyed&&this._animation&&(this._animation.cancel(),this._animation=this._callback=null,this._props.length=this._values.length=0)},Sn.prototype.getCurrentStyles=function(){return _n(element,currentProps)},Sn.prototype.isAnimating=function(){return!!this._animation},Sn.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=null,this._isDestroyed=!0)},Sn.prototype._onFinish=function(){var e=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,e&&e()},Dn.prototype._updateDimensions=function(){this.isActive()&&Ln(this._element,{width:this._item._width+"px",height:this._item._height+"px"})},Dn.prototype._onLayoutStart=function(e,n){var t=this._item;if(-1!==e.indexOf(t)){var o=t._left,i=t._top,r=this._left,a=this._top;if(this._left=o,this._top=i,n||this._didMigrate||r!==o||a!==i){var s,c,d,l=o+t._marginLeft,p=i+t._marginTop,M=t.getGrid();if(n||!(M._settings.layoutDuration>0)||this._didMigrate)return ue(t._id),this._element.style[$e]=En(l,p),this._animation.stop(),void(this._didMigrate&&(M.getElement().appendChild(this._element),this._didMigrate=!1));this._nextTransX=l,this._nextTransY=p,s=t._id,c=this._setupAnimation,d=this._startAnimation,ae.add(0,ee+s,c),ae.add(2,ne+s,d)}}else this.reset()},Dn.prototype._setupAnimation=function(){if(this.isActive()){var e=On(this._element);this._transX=e.x,this._transY=e.y}},Dn.prototype._startAnimation=function(){if(this.isActive()){var e=this._animation,n=this._transX,t=this._transY,o=this._nextTransX,i=this._nextTransY;if(n!==o||t!==i){var r=this._item.getGrid()._settings,a={},s={};a[$e]=En(n,t),s[$e]=En(o,i),e.start(a,s,{duration:r.layoutDuration,easing:r.layoutEasing,onFinish:this._onLayoutEnd})}else e.isAnimating()&&(this._element.style[$e]=En(o,i),e.stop())}},Dn.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},Dn.prototype._onReleaseEnd=function(e){if(e._id===this._item._id){if(!this._animation.isAnimating())return void this.reset();this._resetAfterLayout=!0}},Dn.prototype._onMigrate=function(e){if(e.item===this._item){var n=this._item.getGrid(),t=e.toGrid;n.off(m,this._onReleaseEnd),n.off(s,this._onLayoutStart),n.off(z,this._onMigrate),n.off(p,this._onHide),t.on(m,this._onReleaseEnd),t.on(s,this._onLayoutStart),t.on(z,this._onMigrate),t.on(p,this._onHide),this._didMigrate=!0}},Dn.prototype._onHide=function(e){e.indexOf(this._item)>-1&&this.reset()},Dn.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var e,n=this._item,t=n.getGrid(),o=t._settings,i=this._animation;this._left=n._left,this._top=n._top,e=he(o.dragPlaceholder.createElement)?o.dragPlaceholder.createElement(n):document.createElement("div"),this._element=e,i._element=e,this._className=o.itemPlaceholderClass||"",this._className&&Ye(e,this._className),Ln(e,{position:"absolute",left:"0px",top:"0px",width:n._width+"px",height:n._height+"px"}),e.style[$e]=En(n._left+n._marginLeft,n._top+n._marginTop),t.on(s,this._onLayoutStart),t.on(m,this._onReleaseEnd),t.on(z,this._onMigrate),t.on(p,this._onHide),he(o.dragPlaceholder.onCreate)&&o.dragPlaceholder.onCreate(n,e),t.getElement().appendChild(e)}},Dn.prototype.reset=function(){if(this.isActive()){var e,n=this._element,t=this._item,o=t.getGrid(),i=o._settings,r=this._animation;this._resetAfterLayout=!1,ue(t._id),e=t._id,ae.remove(2,te+e),r.stop(),r._element=null,o.off(m,this._onReleaseEnd),o.off(s,this._onLayoutStart),o.off(z,this._onMigrate),o.off(p,this._onHide),this._className&&(fn(n,this._className),this._className=""),n.parentNode.removeChild(n),this._element=null,he(i.dragPlaceholder.onRemove)&&i.dragPlaceholder.onRemove(t,n)}},Dn.prototype.isActive=function(){return!!this._element},Dn.prototype.getElement=function(){return this._element},Dn.prototype.updateDimensions=function(){var e,n;this.isActive()&&(e=this._item._id,n=this._updateDimensions,ae.add(2,te+e,n))},Dn.prototype.destroy=function(){this.reset(),this._animation.destroy(),this._item=this._animation=null},jn.prototype.start=function(){if(!this._isDestroyed&&!this._isActive){var e=this._item,n=e.getGrid(),t=n._settings;this._isActive=!0,Ye(e._element,t.itemReleasingClass),t.dragRelease.useDragContainer||this._placeToGrid(),n._emit("dragReleaseStart",e),n._nextLayoutData||e._layout.start(!1)}},jn.prototype.stop=function(e,n,t){if(!this._isDestroyed&&this._isActive){var o=this._item,i=o.getGrid();e||void 0!==n&&void 0!==t||(n=o._left,t=o._top);var r=this._placeToGrid(n,t);this._reset(r),e||i._emit(m,o)}},jn.prototype.isJustReleased=function(){return this._isActive&&!1===this._isPositioningStarted},jn.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},jn.prototype._placeToGrid=function(e,n){if(!this._isDestroyed){var t=this._item,o=t._element,i=t.getGrid()._element,r=!1;if(o.parentNode!==i){if(void 0===e||void 0===n){var a=On(o);e=a.x-this._containerDiffX,n=a.y-this._containerDiffY}i.appendChild(o),t._setTranslate(e,n),r=!0}return this._containerDiffX=0,this._containerDiffY=0,r}},jn.prototype._reset=function(e){if(!this._isDestroyed){var n=this._item,t=n.getGrid()._settings.itemReleasingClass;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,t&&(e&&n._element.clientWidth,fn(n._element,t))}},Pn.prototype.start=function(e,n){if(!this._isDestroyed){var t,o,i,r=this._item,a=r._dragRelease,s=r.getGrid()._settings,c=this._isActive,d=a.isJustReleased(),l=d?s.dragRelease.duration:s.layoutDuration,p=d?s.dragRelease.easing:s.layoutEasing,M=!e&&!this._skipNextAnimation&&l>0;if(c&&(se(r._id),r._emitter.burst(this._queue,!0,r)),d&&(a._isPositioningStarted=!0),he(n)&&r._emitter.on(this._queue,n),this._skipNextAnimation=!1,!M)return this._updateOffsets(),r._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._animation.isAnimating()&&(this._animation._animation.onfinish=null),this._isActive=!0,this._animOptions.easing=p,this._animOptions.duration=l,this._isInterrupted=c,t=r._id,o=this._setupAnimation,i=this._startAnimation,ae.add(0,Y+t,o),ae.add(2,I+t,i)}},Pn.prototype.stop=function(e,n,t){if(!this._isDestroyed&&this._isActive){var o=this._item;if(se(o._id),this._animation.isAnimating()){if(void 0===n||void 0===t){var i=On(o._element);n=i.x,t=i.y}o._setTranslate(n,t),this._animation.stop()}fn(o._element,o.getGrid()._settings.itemPositioningClass),this._isActive=!1,e&&o._emitter.burst(this._queue,!0,o)}},Pn.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item._element.style;this.stop(!0,0,0),this._item._emitter.clear(this._queue),this._animation.destroy(),e[$e]="",e.left="",e.top="",this._item=null,this._currentStyles=null,this._targetStyles=null,this._animOptions=null,this._isDestroyed=!0}},Pn.prototype._updateOffsets=function(){if(!this._isDestroyed){var e=this._item,n=e._migrate,t=e._dragRelease;this._offsetLeft=t._isActive?t._containerDiffX:n._isActive?n._containerDiffX:0,this._offsetTop=t._isActive?t._containerDiffY:n._isActive?n._containerDiffY:0,this._nextLeft=this._item._left+this._offsetLeft,this._nextTop=this._item._top+this._offsetTop}},Pn.prototype._finish=function(){if(!this._isDestroyed){var e=this._item,n=e._migrate,t=e._dragRelease;e._tX=this._nextLeft,e._tY=this._nextTop,this._isActive&&(this._isActive=!1,fn(e._element,e.getGrid()._settings.itemPositioningClass)),t._isActive&&t.stop(),n._isActive&&n.stop(),e._emitter.burst(this._queue,!1,e)}},Pn.prototype._setupAnimation=function(){var e=this._item;if(void 0===e._tX||void 0===e._tY){var n=On(e._element);e._tX=n.x,e._tY=n.y}},Pn.prototype._startAnimation=function(){var e=this._item,n=e.getGrid()._settings,t=this._animOptions.duration<=0;this._updateOffsets();var o=Math.abs(e._left-(e._tX-this._offsetLeft)),i=Math.abs(e._top-(e._tY-this._offsetTop));if(t||o<2&&i<2)return(o||i||this._isInterrupted)&&e._setTranslate(this._nextLeft,this._nextTop),this._animation.stop(),void this._finish();this._isInterrupted||Ye(e._element,n.itemPositioningClass),this._currentStyles[$e]=En(e._tX,e._tY),this._targetStyles[$e]=En(this._nextLeft,this._nextTop),e._tX=e._tY=void 0,this._animation.start(this._currentStyles,this._targetStyles,this._animOptions)},Xn.prototype.start=function(e,n,t){if(!this._isDestroyed){var o,i,r,a,s,c,d,l,p,M,u=this._item,b=u._element,m=u.isActive(),g=u.isVisible(),A=u.getGrid(),w=A._settings,v=e._settings,q=e._element,k=e._items,_=A._items.indexOf(u),y=t||document.body;if("number"==typeof n)o=Ve(k,n,1);else{if(!(i=e.getItem(n)))return;o=k.indexOf(i)}(u.isPositioning()||this._isActive||u.isReleasing())&&(d=(c=On(b)).x,l=c.y),u.isPositioning()&&u._layout.stop(!0,d,l),this._isActive&&(d-=this._containerDiffX,l-=this._containerDiffY,this.stop(!0,d,l)),u.isReleasing()&&(d-=u._dragRelease._containerDiffX,l-=u._dragRelease._containerDiffY,u._dragRelease.stop(!0,d,l)),u._visibility.stop(!0),u._drag&&u._drag.destroy(),A._hasListeners(z)&&A._emit(z,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o}),e._hasListeners(f)&&e._emit(f,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o}),w.itemClass!==v.itemClass&&(fn(b,w.itemClass),Ye(b,v.itemClass)),(p=g?w.itemVisibleClass:w.itemHiddenClass)!==(M=g?v.itemVisibleClass:v.itemHiddenClass)&&(fn(b,p),Ye(b,M)),A._items.splice(_,1),Fe(k,u,o),u._gridId=e._id,m?y!==(r=b.parentNode)&&(y.appendChild(b),a=cn(y,r,!0),c||(d=(c=On(b)).x,l=c.y),u._setTranslate(d+a.left,l+a.top)):q.appendChild(b),u._visibility.setStyles(g?v.visibleStyles:v.hiddenStyles),m&&(s=cn(y,q,!0)),u._refreshDimensions(),u._sortData=null,u._drag=v.dragEnabled?new kn(u):null,m?(this._isActive=!0,this._container=y,this._containerDiffX=s.left,this._containerDiffY=s.top):(this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0),A._hasListeners(h)&&A._emit(h,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o}),e._hasListeners(O)&&e._emit(O,{item:u,fromGrid:A,fromIndex:_,toGrid:e,toIndex:o})}},Xn.prototype.stop=function(e,n,t){if(!this._isDestroyed&&this._isActive){var o,i=this._item,r=i._element,a=i.getGrid()._element;this._container!==a&&(void 0!==n&&void 0!==t||(e?(n=(o=On(r)).x-this._containerDiffX,t=o.y-this._containerDiffY):(n=i._left,t=i._top)),a.appendChild(r),i._setTranslate(n,t)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0}},Xn.prototype.destroy=function(){this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0)},Hn.prototype.show=function(e,n){if(!this._isDestroyed){var t=this._item,o=t._element,i=he(n)?n:null,r=t.getGrid()._settings;this._isShowing||this._isHidden?!this._isShowing||e?(this._isShowing||(t._emitter.burst(this._queue,!0,t),fn(o,r.itemHiddenClass),Ye(o,r.itemVisibleClass),this._isHiding||(o.style.display="")),i&&t._emitter.on(this._queue,i),this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,e,this._finishShow)):i&&t._emitter.on(this._queue,i):i&&i(!1,t)}},Hn.prototype.hide=function(e,n){if(!this._isDestroyed){var t=this._item,o=t._element,i=he(n)?n:null,r=t.getGrid()._settings;this._isHiding||!this._isHidden?!this._isHiding||e?(this._isHiding||(t._emitter.burst(this._queue,!0,t),Ye(o,r.itemHiddenClass),fn(o,r.itemVisibleClass)),i&&t._emitter.on(this._queue,i),this._isHidden=this._isHiding=!0,this._isShowing=!1,this._startAnimation(!1,e,this._finishHide)):i&&t._emitter.on(this._queue,i):i&&i(!1,t)}},Hn.prototype.stop=function(e){if(!this._isDestroyed&&(this._isHiding||this._isShowing)){var n=this._item;ce(n._id),this._animation.stop(),e&&n._emitter.burst(this._queue,!0,n)}},Hn.prototype.setStyles=function(e){var n=this._childElement,t=this._currentStyleProps;for(var o in this._removeCurrentStyles(),e)t.push(o),n.style[o]=e[o]},Hn.prototype.destroy=function(){if(!this._isDestroyed){var e=this._item,n=e._element,t=e.getGrid()._settings;this.stop(!0),e._emitter.clear(this._queue),this._animation.destroy(),this._removeCurrentStyles(),fn(n,t.itemVisibleClass),fn(n,t.itemHiddenClass),n.style.display="",this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0}},Hn.prototype._startAnimation=function(e,n,t){if(!this._isDestroyed){var o,i=this._item,r=this._animation,a=this._childElement,s=i.getGrid()._settings,c=e?s.visibleStyles:s.hiddenStyles,d=e?s.showDuration:s.hideDuration,l=e?s.showEasing:s.hideEasing,p=n||d<=0;if(c){if(ce(i._id),p)return Ln(a,c),r.stop(),void(t&&t());var M,u,b;r.isAnimating()&&(r._animation.onfinish=null),M=i._id,u=function(){o=_n(a,c)},b=function(){r.start(o,c,{duration:d,easing:l,onFinish:t})},ae.add(0,F+M,u),ae.add(2,V+M,b)}else t&&t()}},Hn.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._item._emitter.burst(this._queue,!1,this._item))},Hn.prototype._finishHide=function(){if(this._isHidden){var e=this._item;this._isHiding=!1,e._layout.stop(!0,0,0),e._element.style.display="none",e._emitter.burst(this._queue,!1,e)}},Hn.prototype._removeCurrentStyles=function(){for(var e=this._childElement,n=this._currentStyleProps,t=0;t<n.length;t++)e.style[n[t]]="";n.length=0};var Yn=0;function In(){return++Yn}function Fn(e,n,t){var o=e._settings;if(i){if(i.has(n))throw new Error("You can only create one Muuri Item per element!");i.set(n,this)}this._id=In(),this._gridId=e._id,this._element=n,this._isDestroyed=!1,this._left=0,this._top=0,this._width=0,this._height=0,this._marginLeft=0,this._marginRight=0,this._marginTop=0,this._marginBottom=0,this._tX=void 0,this._tY=void 0,this._sortData=null,this._emitter=new v,n.parentNode!==e._element&&e._element.appendChild(n),Ye(n,o.itemClass),"boolean"!=typeof t&&(t="none"!==Oe(n,"display")),this._isActive=t,this._visibility=new Hn(this),this._layout=new Pn(this),this._migrate=new Xn(this),this._drag=o.dragEnabled?new kn(this):null,this._dragRelease=new jn(this),this._dragPlaceholder=new Dn(this)}function Vn(e){var n,t,o,i,r,a=.001,s=.5;function c(e){return((1e3*e+.5|0)/10|0)/100}function d(){this.currentRects=[],this.nextRects=[],this.rectTarget={},this.rectStore=[],this.slotSizes=[],this.rectId=0,this.slotIndex=-1,this.slotData={left:0,top:0,width:0,height:0},this.sortRectsLeftTop=this.sortRectsLeftTop.bind(this),this.sortRectsTopLeft=this.sortRectsTopLeft.bind(this)}if(d.prototype.computeLayout=function(e,n){var t,o,i,r,a,s,d=e.items,l=e.slots,p=!!(1&n),M=!!(2&n),u=!!(4&n),b=!!(8&n),h=!!(16&n),z="number"==typeof d[0];if(!d.length)return e;for(o=z?2:1,t=0;t<d.length;t+=o)z?(r=d[t],a=d[t+1]):(r=(i=d[t])._width+i._marginLeft+i._marginRight,a=i._height+i._marginTop+i._marginBottom),h&&(r=c(r),a=c(a)),s=this.computeNextSlot(e,r,a,p,M),M?s.left+s.width>e.width&&(e.width=s.left+s.width):s.top+s.height>e.height&&(e.height=s.top+s.height),l[++this.slotIndex]=s.left,l[++this.slotIndex]=s.top,(u||b)&&this.slotSizes.push(s.width,s.height);if(u)for(t=0;t<l.length;t+=2)l[t]=e.width-(l[t]+this.slotSizes[t]);if(b)for(t=1;t<l.length;t+=2)l[t]=e.height-(l[t]+this.slotSizes[t]);return this.slotSizes.length=0,this.currentRects.length=0,this.nextRects.length=0,this.rectStore.length=0,this.rectId=0,this.slotIndex=-1,e},d.prototype.computeNextSlot=function(e,n,t,o,i){var r,c,d,l,p,M=this.slotData,u=this.currentRects,b=this.nextRects,h=!1;for(b.length=0,M.left=null,M.top=null,M.width=n,M.height=t,l=0;l<u.length;l++)if((c=u[l])&&(r=this.getRect(c),M.width<=r.width+a&&M.height<=r.height+a)){M.left=r.left,M.top=r.top;break}if(null===M.left&&(i?(M.left=e.width,M.top=0):(M.left=0,M.top=e.height),o||(h=!0)),!i&&M.top+M.height>e.height+a&&(M.left>s&&b.push(this.addRect(0,e.height,M.left,1/0)),M.left+M.width<e.width-s&&b.push(this.addRect(M.left+M.width,e.height,e.width-M.left-M.width,1/0)),e.height=M.top+M.height),i&&M.left+M.width>e.width+a&&(M.top>s&&b.push(this.addRect(e.width,0,1/0,M.top)),M.top+M.height<e.height-s&&b.push(this.addRect(e.width,M.top+M.height,1/0,e.height-M.top-M.height)),e.width=M.left+M.width),!h)for(o&&(l=0);l<u.length;l++)if(c=u[l])for(r=this.getRect(c),d=this.splitRect(r,M),p=0;p<d.length;p++)c=d[p],r=this.getRect(c),(i?r.left+a<e.width-a:r.top+a<e.height-a)&&b.push(c);return b.length>1&&this.purgeRects(b).sort(i?this.sortRectsLeftTop:this.sortRectsTopLeft),this.currentRects=b,this.nextRects=u,M},d.prototype.addRect=function(e,n,t,o){var i=++this.rectId;return this.rectStore[i]=e||0,this.rectStore[++this.rectId]=n||0,this.rectStore[++this.rectId]=t||0,this.rectStore[++this.rectId]=o||0,i},d.prototype.getRect=function(e,n){return n||(n=this.rectTarget),n.left=this.rectStore[e]||0,n.top=this.rectStore[++e]||0,n.width=this.rectStore[++e]||0,n.height=this.rectStore[++e]||0,n},d.prototype.splitRect=(n=[],t=0,o=0,function(e,i){return n.length=0,e.left+e.width<=i.left+a||i.left+i.width<=e.left+a||e.top+e.height<=i.top+a||i.top+i.height<=e.top+a?(n.push(this.addRect(e.left,e.top,e.width,e.height)),n):((t=i.left-e.left)>=s&&n.push(this.addRect(e.left,e.top,t,e.height)),(t=e.left+e.width-(i.left+i.width))>=s&&n.push(this.addRect(i.left+i.width,e.top,t,e.height)),(o=i.top-e.top)>=s&&n.push(this.addRect(e.left,e.top,e.width,o)),(o=e.top+e.height-(i.top+i.height))>=s&&n.push(this.addRect(e.left,i.top+i.height,e.width,o)),n)}),d.prototype.isRectAWithinRectB=function(e,n){return e.left+a>=n.left&&e.top+a>=n.top&&e.left+e.width-a<=n.left+n.width&&e.top+e.height-a<=n.top+n.height},d.prototype.purgeRects=(i={},r={},function(e){for(var n,t=e.length;t--;)if(n=e.length,e[t])for(this.getRect(e[t],i);n--;)if(e[n]&&t!==n&&(this.getRect(e[n],r),this.isRectAWithinRectB(i,r))){e[t]=0;break}return e}),d.prototype.sortRectsTopLeft=function(){var e={},n={};return function(t,o){return this.getRect(t,e),this.getRect(o,n),e.top<n.top&&e.top+a<n.top?-1:e.top>n.top&&e.top-a>n.top?1:e.left<n.left&&e.left+a<n.left?-1:e.left>n.left&&e.left-a>n.left?1:0}}(),d.prototype.sortRectsLeftTop=function(){var e={},n={};return function(t,o){return this.getRect(t,e),this.getRect(o,n),e.left<n.left&&e.left+a<n.left?-1:e.left>n.left&&e.left-a<n.left?1:e.top<n.top&&e.top+a<n.top?-1:e.top>n.top&&e.top-a>n.top?1:0}}(),e){var l=new d;self.onmessage=function(e){var n=new Float32Array(e.data),t=n.subarray(4,n.length),o=new Float32Array(t.length),i=n[3],r={items:t,slots:o,width:n[1],height:n[2]};l.computeLayout(r,i),n[1]=r.width,n[2]=r.height,n.set(r.slots,4),postMessage(n.buffer,[n.buffer])}}return d}Fn.prototype.getGrid=function(){return o[this._gridId]},Fn.prototype.getElement=function(){return this._element},Fn.prototype.getWidth=function(){return this._width},Fn.prototype.getHeight=function(){return this._height},Fn.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Fn.prototype.getPosition=function(){return{left:this._left,top:this._top}},Fn.prototype.isActive=function(){return this._isActive},Fn.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Fn.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Fn.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Fn.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Fn.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Fn.prototype.isReleasing=function(){return!(!this._dragRelease||!this._dragRelease._isActive)},Fn.prototype.isDestroyed=function(){return this._isDestroyed},Fn.prototype._refreshDimensions=function(e){if(!(this._isDestroyed||!0!==e&&this._visibility._isHidden)){var n=this._element,t=this._dragPlaceholder,o=n.getBoundingClientRect();this._width=o.width,this._height=o.height,this._marginLeft=Math.max(0,fe(n,"margin-left")),this._marginRight=Math.max(0,fe(n,"margin-right")),this._marginTop=Math.max(0,fe(n,"margin-top")),this._marginBottom=Math.max(0,fe(n,"margin-bottom")),t&&t.updateDimensions()}},Fn.prototype._refreshSortData=function(){if(!this._isDestroyed){var e,n=this._sortData={},t=this.getGrid()._settings.sortData;for(e in t)n[e]=t[e](this,this._element)}},Fn.prototype._addToLayout=function(e,n){!0!==this._isActive&&(this._isActive=!0,this._left=e||0,this._top=n||0)},Fn.prototype._removeFromLayout=function(){!1!==this._isActive&&(this._isActive=!1,this._left=0,this._top=0)},Fn.prototype._canSkipLayout=function(e,n){return this._left===e&&this._top===n&&!this._migrate._isActive&&!this._layout._skipNextAnimation&&!this._dragRelease.isJustReleased()},Fn.prototype._setTranslate=function(e,n){return(this._tX!==e||this._tY!==n)&&(this._tX=e,this._tY=n,this._element.style[$e]=En(e,n),!0)},Fn.prototype._destroy=function(e){if(!this._isDestroyed){var n=this._element,t=this.getGrid()._settings;this._dragPlaceholder.destroy(),this._dragRelease.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._drag&&this._drag.destroy(),this._emitter.destroy(),fn(n,t.itemClass),e&&n.parentNode.removeChild(n),i&&i.delete(n),this._isActive=!1,this._isDestroyed=!0}};var Gn=Vn(),Un=null,$n=[];function Jn(e,n){if(this._options=0,this._processor=null,this._layoutQueue=[],this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={},this._workers=[],this._onWorkerMessage=this._onWorkerMessage.bind(this),this.setOptions(n),(e="number"==typeof e?Math.max(0,e):0)&&window.Worker&&window.URL&&window.Blob)try{this._workers=function(e,n){var t=[];if(e>0){Un||(Un=URL.createObjectURL(new Blob(["("+Vn.toString()+")(true)"],{type:"application/javascript"})));for(var o,i=0;i<e;i++)o=new Worker(Un),n&&(o.onmessage=n),t.push(o),$n.push(o)}return t}(e,this._onWorkerMessage)}catch(e){this._processor=new Gn}else this._processor=new Gn}Jn.prototype._sendToWorker=function(){if(this._layoutQueue.length&&this._workers.length){var e=this._layoutQueue.shift(),n=this._workers.pop(),t=this._layoutWorkerData[e];delete this._layoutWorkerData[e],this._layoutWorkers[e]=n,n.postMessage(t.buffer,[t.buffer])}},Jn.prototype._onWorkerMessage=function(e){var n=new Float32Array(e.data),t=n[0],o=this._layouts[t],i=this._layoutCallbacks[t],r=this._layoutWorkers[t];o&&delete this._layouts[t],i&&delete this._layoutCallbacks[t],r&&delete this._layoutWorkers[t],o&&i&&(o.width=n[1],o.height=n[2],o.slots=n.subarray(4,n.length),this._finalizeLayout(o),i(o)),r&&(this._workers.push(r),this._sendToWorker())},Jn.prototype._finalizeLayout=function(e){var n=e._grid,t=2&e._settings,o="border-box"===n._boxSizing;return delete e._grid,delete e._settings,e.styles={},t?e.styles.width=(o?e.width+n._borderLeft+n._borderRight:e.width)+"px":e.styles.height=(o?e.height+n._borderTop+n._borderBottom:e.height)+"px",e},Jn.prototype.setOptions=function(e){var n,t,o,i,r;e&&(n="boolean"==typeof e.fillGaps?e.fillGaps?1:0:1&this._options,t="boolean"==typeof e.horizontal?e.horizontal?2:0:2&this._options,o="boolean"==typeof e.alignRight?e.alignRight?4:0:4&this._options,i="boolean"==typeof e.alignBottom?e.alignBottom?8:0:8&this._options,r="boolean"==typeof e.rounding?e.rounding?16:0:16&this._options,this._options=n|t|o|i|r)},Jn.prototype.createLayout=function(e,n,t,o,i,r){if(this._layouts[n])throw new Error("A layout with the provided id is currently being processed.");var a=2&this._options,s={id:n,items:t,slots:null,width:a?0:o,height:a?i:0,_grid:e,_settings:this._options};if(!t.length)return s.slots=[],this._finalizeLayout(s),void r(s);if(this._processor)return s.slots=window.Float32Array?new Float32Array(2*t.length):new Array(2*t.length),this._processor.computeLayout(s,s._settings),this._finalizeLayout(s),void r(s);var c,d,l,p=new Float32Array(4+2*t.length);for(p[0]=n,p[1]=s.width,p[2]=s.height,p[3]=s._settings,c=0,d=3;c<t.length;c++)l=t[c],p[++d]=l._width+l._marginLeft+l._marginRight,p[++d]=l._height+l._marginTop+l._marginBottom;return this._layoutQueue.push(n),this._layouts[n]=s,this._layoutCallbacks[n]=r,this._layoutWorkerData[n]=p,this._sendToWorker(),this.cancelLayout.bind(this,n)},Jn.prototype.cancelLayout=function(e){if(this._layouts[e]&&(delete this._layouts[e],delete this._layoutCallbacks[e],this._layoutWorkerData[e])){delete this._layoutWorkerData[e];var n=this._layoutQueue.indexOf(e);n>-1&&this._layoutQueue.splice(n,1)}},Jn.prototype.destroy=function(){for(var e in this._layoutWorkers)this._workers.push(this._layoutWorkers[e]);!function(e){for(var n,t,o=0;o<e.length;o++)(n=e[o]).onmessage=null,n.onerror=null,n.onmessageerror=null,n.terminate(),(t=$n.indexOf(n))>-1&&$n.splice(t,1);Un&&!$n.length&&(URL.revokeObjectURL(Un),Un=null)}(this._workers),this._workers.length=0,this._layoutQueue.length=0,this._layouts={},this._layoutCallbacks={},this._layoutWorkers={},this._layoutWorkerData={}};var Kn=0;function Zn(e){var n=Object.prototype.toString.call(e);return"[object HTMLCollection]"===n||"[object NodeList]"===n}var Qn=Object.prototype.toString;function et(e){return"object"==typeof e&&"[object Object]"===Qn.call(e)}function nt(){}var tt,ot="number",it="string",rt="instant",at=0;function st(e,n){if(typeof e===it&&(e=document.querySelector(e)),!(e.getRootNode?e.getRootNode({composed:!0})===document:document.body.contains(e))||e===document.documentElement)throw new Error("Container element must be an existing DOM element.");var t,i,r=function(e,n){var t=ct({},e);return n&&(t=ct(t,n)),n&&n.visibleStyles?t.visibleStyles=n.visibleStyles:e&&e.visibleStyles&&(t.visibleStyles=e.visibleStyles),n&&n.hiddenStyles?t.hiddenStyles=n.hiddenStyles:e&&e.hiddenStyles&&(t.hiddenStyles=e.hiddenStyles),t}(st.defaultOptions,n);r.visibleStyles=dt(r.visibleStyles),r.hiddenStyles=dt(r.hiddenStyles),he(r.dragSort)||(r.dragSort=!!r.dragSort),this._id=In(),this._element=e,this._settings=r,this._isDestroyed=!1,this._items=[],this._layout={id:0,items:[],slots:[]},this._isLayoutFinished=!0,this._nextLayoutData=null,this._emitter=new v,this._onLayoutDataReceived=this._onLayoutDataReceived.bind(this),o[this._id]=this,Ye(e,r.containerClass),t=this,typeof(i=r.layoutOnResize)!==ot&&(i=!0===i?0:-1),i>=0&&(t._resizeHandler=function(e,n){var t=++Kn,o=0,i=0,r=!1,a=function(n){r||(i&&(o-=n-i),i=n,o>0?function(e,n){ae.add(0,re+e,n)}(t,a):(o=i=0,e()))};return function(s){if(!r){if(!(n<=0))return!0===s?(r=!0,o=i=0,a=void 0,void function(e){ae.remove(0,re+e)}(t)):void(o<=0?(o=n,a(0)):o=n);!0!==s&&e()}}}(function(){t.refreshItems().layout()},i),window.addEventListener("resize",t._resizeHandler)),this.add(function(e,n){if("*"===n)return e.children;if(typeof n===it){for(var t=[],o=e.children,i=0;i<o.length;i++)He(o[i],n)&&t.push(o[i]);return t}return Array.isArray(n)||Zn(n)?n:[]}(e,r.items),{layout:!1}),r.layoutOnInit&&this.layout(!0)}function ct(e,n){var t,o,i,r=Object.keys(n),a=r.length;for(i=0;i<a;i++)t=et(n[o=r[i]]),et(e[o])&&t?e[o]=ct(ct({},e[o]),n[o]):t?e[o]=ct({},n[o]):Array.isArray(n[o])?e[o]=n[o].slice(0):e[o]=n[o];return e}function dt(e){var n,t,o={},i=document.documentElement.style;for(n in e)e[n]&&(t=W(i,n))&&(o[t]=e[n]);return o}function lt(e){for(var n={},t=0;t<e.length;t++)n[e[t]._id]=t;return n}function pt(e,n,t){return e[n._id]-e[t._id]}st.Item=Fn,st.ItemLayout=Pn,st.ItemVisibility=Hn,st.ItemMigrate=Xn,st.ItemDrag=kn,st.ItemDragRelease=jn,st.ItemDragPlaceholder=Dn,st.Emitter=v,st.Animator=Sn,st.Dragger=D,st.Packer=Jn,st.AutoScroller=je,st.defaultPacker=new Jn(2),st.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!1},layoutOnResize:150,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragHandle:null,dragStartPredicate:{distance:0,delay:0},dragAxis:"xy",dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:a,migrateAction:a},dragRelease:{duration:300,easing:"ease",useDragContainer:!0},dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,createElement:null,onCreate:null,onRemove:null},dragAutoScroll:{targets:[],handle:null,threshold:50,safeZone:.2,speed:je.smoothSpeed(1e3,2e3,2500),sortDuringScroll:!0,smoothStop:!1,onStart:null,onStop:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},st.prototype.on=function(e,n){return this._emitter.on(e,n),this},st.prototype.off=function(e,n){return this._emitter.off(e,n),this},st.prototype.getElement=function(){return this._element},st.prototype.getItem=function(e){if(this._isDestroyed||!e&&0!==e)return null;if(typeof e===ot)return this._items[e>-1?e:this._items.length+e]||null;if(e instanceof Fn)return e._gridId===this._id?e:null;if(i){var n=i.get(e);return n&&n._gridId===this._id?n:null}for(var t=0;t<this._items.length;t++)if(this._items[t]._element===e)return this._items[t];return null},st.prototype.getItems=function(e){if(this._isDestroyed||void 0===e)return this._items.slice(0);var n,t,o=[];if(Array.isArray(e)||Zn(e))for(n=0;n<e.length;n++)(t=this.getItem(e[n]))&&o.push(t);else(t=this.getItem(e))&&o.push(t);return o},st.prototype.refreshItems=function(e,n){if(this._isDestroyed)return this;var t,o,i,r,a=e||this._items;if(!0===n)for(r=[],t=0;t<a.length;t++)(o=a[t]).isVisible()||o.isHiding()||((i=o.getElement().style).visibility="hidden",i.display="",r.push(i));for(t=0;t<a.length;t++)a[t]._refreshDimensions(n);if(!0===n){for(t=0;t<r.length;t++)(i=r[t]).visibility="",i.display="none";r.length=0}return this},st.prototype.refreshSortData=function(e){if(this._isDestroyed)return this;for(var n=e||this._items,t=0;t<n.length;t++)n[t]._refreshSortData();return this},st.prototype.synchronize=function(){if(this._isDestroyed)return this;var e,n,t=this._items;if(!t.length)return this;for(var o=0;o<t.length;o++)(n=t[o]._element).parentNode===this._element&&(e=e||document.createDocumentFragment()).appendChild(n);return e?(this._element.appendChild(e),this._emit("synchronize"),this):this},st.prototype.layout=function(e,n){if(this._isDestroyed)return this;var t=this._nextLayoutData;t&&he(t.cancel)&&t.cancel();var o=at=at%16777216+1;this._nextLayoutData={id:o,instant:e,onFinish:n,cancel:null};for(var i=this._items,r=[],a=0;a<i.length;a++)i[a]._isActive&&r.push(i[a]);this._refreshDimensions();var s,c=this._width-this._borderLeft-this._borderRight,d=this._height-this._borderTop-this._borderBottom,l=this._settings.layout;return he(l)?s=l(this,o,r,c,d,this._onLayoutDataReceived):(st.defaultPacker.setOptions(l),s=st.defaultPacker.createLayout(this,o,r,c,d,this._onLayoutDataReceived)),he(s)&&this._nextLayoutData&&this._nextLayoutData.id===o&&(this._nextLayoutData.cancel=s),this},st.prototype.add=function(e,n){if(this._isDestroyed||!e)return[];var t,o=Zn(t=e)?Array.prototype.slice.call(t):Array.prototype.concat(t);if(!o.length)return o;var i,r,a,s,c=n||{},d=c.layout?c.layout:void 0===c.layout,l=this._items,p=!1;for(s=0;s<o.length;s++)(r=o[s]).parentNode!==this._element&&(i=i||document.createDocumentFragment()).appendChild(r);for(i&&this._element.appendChild(i),s=0;s<o.length;s++)r=o[s],(a=o[s]=new Fn(this,r,c.active))._isActive&&(p=!0,a._layout._skipNextAnimation=!0);for(s=0;s<o.length;s++)(a=o[s])._refreshDimensions(),a._refreshSortData();return Fe(l,o,c.index),this._hasListeners("add")&&this._emit("add",o.slice(0)),p&&d&&this.layout(d===rt,he(d)?d:void 0),o},st.prototype.remove=function(e,n){if(this._isDestroyed||!e.length)return[];var t,o,i,r=n||{},a=r.layout?r.layout:void 0===r.layout,s=!1,c=this.getItems(),d=[],p=[];for(i=0;i<e.length;i++)(o=e[i])._isDestroyed||-1!==(t=this._items.indexOf(o))&&(o._isActive&&(s=!0),d.push(o),p.push(c.indexOf(o)),o._destroy(r.removeElements),this._items.splice(t,1));return this._hasListeners(l)&&this._emit(l,d.slice(0),p),s&&a&&this.layout(a===rt,he(a)?a:void 0),d},st.prototype.show=function(e,n){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!0,n),this},st.prototype.hide=function(e,n){return!this._isDestroyed&&e.length&&this._setItemsVisibility(e,!1,n),this},st.prototype.filter=function(e,n){if(this._isDestroyed||!this._items.length)return this;var t,o,i=[],r=[],a=typeof e===it,s=he(e),c=n||{},d=!0===c.instant,l=c.syncWithLayout,p=c.layout?c.layout:void 0===c.layout,u=he(c.onFinish)?c.onFinish:null,b=-1,h=nt;if(u&&(h=function(){++b&&u(i.slice(0),r.slice(0))}),s||a)for(o=0;o<this._items.length;o++)t=this._items[o],(s?e(t):He(t._element,e))?i.push(t):r.push(t);return i.length?this.show(i,{instant:d,syncWithLayout:l,onFinish:h,layout:!1}):h(),r.length?this.hide(r,{instant:d,syncWithLayout:l,onFinish:h,layout:!1}):h(),(i.length||r.length)&&(this._hasListeners(M)&&this._emit(M,i.slice(0),r.slice(0)),p&&this.layout(p===rt,he(p)?p:void 0)),this},st.prototype.sort=function(){var e,n,t,o;function i(i,r){for(var a,s,c,d,l=0,p=0;p<e.length;p++)if(a=e[p][0],s=e[p][1],c=(i._sortData?i:i._refreshSortData())._sortData[a],d=(r._sortData?r:r._refreshSortData())._sortData[a],l="desc"===s||!s&&n?d<c?-1:d>c?1:0:c<d?-1:c>d?1:0)return l;return l||(o||(o=lt(t)),l=n?pt(o,r,i):pt(o,i,r)),l}function r(i,r){var a=n?-e(i,r):e(i,r);return a||(o||(o=lt(t)),a=n?pt(o,r,i):pt(o,i,r)),a}return function(a,s){if(this._isDestroyed||this._items.length<2)return this;var c=this._items,d=s||{},l=d.layout?d.layout:void 0===d.layout;if(n=!!d.descending,t=c.slice(0),o=null,he(a))e=a,c.sort(r);else if(typeof a===it)e=a.trim().split(" ").filter(function(e){return e}).map(function(e){return e.split(":")}),c.sort(i);else{if(!Array.isArray(a))throw e=n=t=o=null,new Error("Invalid comparer argument provided.");c.length=0,c.push.apply(c,a)}return this._hasListeners(u)&&this._emit(u,c.slice(0),t),l&&this.layout(l===rt,he(l)?l:void 0),e=n=t=o=null,this}}(),st.prototype.move=function(e,n,t){if(this._isDestroyed||this._items.length<2)return this;var o,i,s=this._items,c=t||{},d=c.layout?c.layout:void 0===c.layout,l=c.action===r,p=l?r:a,M=this.getItem(e),u=this.getItem(n);return M&&u&&M!==u&&(o=s.indexOf(M),i=s.indexOf(u),l?Ue(s,o,i):Ge(s,o,i),this._hasListeners(b)&&this._emit(b,{item:M,fromIndex:o,toIndex:i,action:p}),d&&this.layout(d===rt,he(d)?d:void 0)),this},st.prototype.send=function(e,n,t,o){if(this._isDestroyed||n._isDestroyed||this===n)return this;if(!(e=this.getItem(e)))return this;var i=o||{},r=i.appendTo||document.body,a=i.layoutSender?i.layoutSender:void 0===i.layoutSender,s=i.layoutReceiver?i.layoutReceiver:void 0===i.layoutReceiver;return e._migrate.start(n,t,r),e._migrate._isActive&&e._isActive&&(a&&this.layout(a===rt,he(a)?a:void 0),s&&n.layout(s===rt,he(s)?s:void 0)),this},st.prototype.destroy=function(e){if(this._isDestroyed)return this;var n,t,i,r=this._element,a=this._items.slice(0),s=this._layout&&this._layout.styles||{};for((i=this)._resizeHandler&&(i._resizeHandler(!0),window.removeEventListener("resize",i._resizeHandler),i._resizeHandler=null),n=0;n<a.length;n++)a[n]._destroy(e);for(t in this._items.length=0,fn(r,this._settings.containerClass),s)r.style[t]="";return this._emit("destroy"),this._emitter.destroy(),delete o[this._id],this._isDestroyed=!0,this},st.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},st.prototype._hasListeners=function(e){return!this._isDestroyed&&this._emitter.countListeners(e)>0},st.prototype._updateBoundingRect=function(){var e=this._element.getBoundingClientRect();this._width=e.width,this._height=e.height,this._left=e.left,this._top=e.top,this._right=e.right,this._bottom=e.bottom},st.prototype._updateBorders=function(e,n,t,o){var i=this._element;e&&(this._borderLeft=fe(i,"border-left-width")),n&&(this._borderRight=fe(i,"border-right-width")),t&&(this._borderTop=fe(i,"border-top-width")),o&&(this._borderBottom=fe(i,"border-bottom-width"))},st.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1),this._boxSizing=Oe(this._element,"box-sizing")},st.prototype._onLayoutDataReceived=(tt=[],function(e){if(!this._isDestroyed&&this._nextLayoutData&&this._nextLayoutData.id===e.id){var n,t,o,i,r=this,a=this._nextLayoutData.instant,l=this._nextLayoutData.onFinish,p=e.items.length,M=p;for(this._nextLayoutData=null,!this._isLayoutFinished&&this._hasListeners(d)&&this._emit(d,this._layout.items.slice(0)),this._layout=e,tt.length=0,i=0;i<p;i++)(n=e.items[i])?(t=e.slots[2*i],o=e.slots[2*i+1],n._canSkipLayout(t,o)?--M:(n._left=t,n._top=o,n.isActive()&&!n.isDragging()?tt.push(n):--M)):--M;if(e.styles&&Ln(this._element,e.styles),!this._hasListeners(s)||(this._emit(s,e.items.slice(0),!0===a),this._layout.id===e.id)){var u=function(){if(!(--M>0)){var n=r._layout.id!==e.id,t=he(a)?a:l;n||(r._isLayoutFinished=!0),he(t)&&t(e.items.slice(0),n),!n&&r._hasListeners(c)&&r._emit(c,e.items.slice(0))}};if(!tt.length)return u(),this;for(this._isLayoutFinished=!1,i=0;i<tt.length&&this._layout.id===e.id;i++)tt[i]._layout.start(!0===a,u);return this._layout.id===e.id&&(tt.length=0),this}}}),st.prototype._setItemsVisibility=function(e,n,t){var o,i,r=this,a=e.slice(0),c=t||{},d=!0===c.instant,l=c.onFinish,M=c.layout?c.layout:void 0===c.layout,u=a.length,b=n?"showStart":p,h=n?"showEnd":"hideEnd",z=n?"show":"hide",O=!1,f=[],m=[];if(u){for(i=0;i<a.length;i++)o=a[i],(n&&!o._isActive||!n&&o._isActive)&&(O=!0),o._layout._skipNextAnimation=!(!n||o._isActive),n&&o._visibility._isHidden&&m.push(o),n?o._addToLayout():o._removeFromLayout();m.length&&(this.refreshItems(m,!0),m.length=0),O&&!1!==c.syncWithLayout?this.on(s,g):g(),O&&M&&this.layout(M===rt,he(M)?M:void 0)}else he(l)&&l(a);function g(){for(O&&!1!==c.syncWithLayout&&r.off(s,g),r._hasListeners(b)&&r._emit(b,a.slice(0)),i=0;i<a.length;i++)a[i]._gridId===r._id?a[i]._visibility[z](d,function(e,n){e||f.push(n),--u<1&&(he(l)&&l(f.slice(0)),r._hasListeners(h)&&r._emit(h,f.slice(0)))}):--u<1&&(he(l)&&l(f.slice(0)),r._hasListeners(h)&&r._emit(h,f.slice(0)))}};const Mt=st;var ut=t(24510),bt=t(25936),ht=t(91762);const zt=[];let Ot,ft;const mt=()=>{let e=document.querySelector(".SearchResult-dragContainer");return e||(e=(0,bt.A)("div",{className:"SearchResult-dragContainer"}),document.body.appendChild(e)),e},gt=()=>{const e=ft.querySelector(":scope .SearchResult-board"),n=()=>{if(e){const o=e.lastChild;if(o instanceof Element){const i=o.classList.contains("frame")?e.querySelector(".SearchResult-board-column:nth-last-child(-n+2)"):e.lastChild;i instanceof Element&&t.observe(i),Ot.off("layoutEnd",n);const r=e.closest(".Popup");r instanceof HTMLDivElement&&document.body.style.setProperty("--BoardContainer-zIndex",(parseInt(r.style.zIndex)+1).toString())}}},t=new IntersectionObserver(e=>{for(const n of e){const{isIntersecting:e,target:o}=n;if(e&&!o.classList.contains("frame")){t.unobserve(o);const e=ft.querySelector(":scope button.moreColumns-button");e&&e.click()}}},{root:ft,rootMargin:"25px",threshold:.75});Ot.on("layoutEnd",n)},At=(e,n)=>{const t=n.parentNode;if(t instanceof HTMLDivElement){const o=new IntersectionObserver(e=>{for(const n of e){const{isIntersecting:e,target:i}=n;if(e){o.unobserve(i);const e=t?.querySelector(":scope button.moreCards-button");e&&e.click()}}},{root:t,rootMargin:"25px",threshold:.75}),i=()=>{const t=n.lastChild;t instanceof Element&&(o.observe(t),e.off("layoutEnd",i))};e.on("layoutEnd",i)}};let wt,vt,qt;(0,ht.A)(".is-muuri .SearchResult-boardContainer",e=>{ft=e;const n=e.querySelector(":scope div.SearchResult-board");if(!n)return;Ot=new Mt(n,{items:".SearchResult-board-column",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",layout:(e,n,t,o,i,r)=>(Mt.defaultPacker.setOptions({horizontal:!0}),Mt.defaultPacker.createLayout(e,n,t,o,i,e=>{delete e.styles,r(e)})),dragEnabled:!1,dragAxis:"x",dragSortHeuristics:{sortInterval:0},dragHandle:".BoardView-title",dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!1},dragAutoScroll:{targets:[{element:ft,axis:Mt.AutoScroller.AXIS_X}]}});const t=ft.querySelector(".SearchResult-board-errors");(0,ht.A)(".SearchResult-board-errors-close",e=>{e.onclick=()=>{t&&(t.innerHTML="")}}),gt()}),(0,ht.A)(".SearchResult-items .SearchResult-boardContainer",e=>{const n=e.closest(".SearchResult-items");n?.classList.add("is-muuri")}),(0,ht.A)("ol.BoardView-list",e=>{const n=e.closest(".SearchResult-board"),t=!!n?.hasAttribute("data-dragEnabled"),o=new Mt(e,{items:".BoardView-card",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",layoutDuration:300,layoutEasing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",dragEnabled:t,dragSort:()=>zt.filter(e=>n?.contains(e.getElement())),dragContainer:mt(),dragRelease:{duration:300,easing:"cubic-bezier(0.625, 0.225, 0.100, 0.890)",useDragContainer:!0},dragStartPredicate:(e,n)=>{const t=n.target,o=e.getElement();return!("A"===t.tagName||t.className.includes("ContentSummary-info")||o&&o.hasAttribute("data-archived"))},dragPlaceholder:{enabled:!0,createElement:e=>{const n=e.getElement();return n?.cloneNode(!0)}},dragAutoScroll:{targets:e=>[window,{element:ft,priority:1,axis:Mt.AutoScroller.AXIS_X},{element:e.getGrid()?.getElement().parentNode,priority:1,axis:Mt.AutoScroller.AXIS_Y}],sortDuringScroll:!1}});let i;new MutationObserver(e=>{for(const n of e){const e=n.target;if("childList"===n.type&&e instanceof HTMLElement){new ResizeObserver((n,t)=>{o.refreshItems().layout(),t.unobserve(e)}).observe(e)}}}).observe(e,{childList:!0,subtree:!0}),o.on("dragReleaseEnd",e=>{if(i===e){const n=e.getElement();n instanceof HTMLElement&&n.classList.add("is-saving"),r(e);let t=null,i=null;if(wt){const e=wt.getElement().closest(".SearchResult-board-column");t=e?.querySelector(".BoardView-title")}if(o){const e=o.getElement().closest(".SearchResult-board-column");i=e?.querySelector(".BoardView-title")}if(t instanceof HTMLElement){const e=t.dataset.count;e&&(t.dataset.count=(parseInt(e)-1).toString())}if(i instanceof HTMLElement){const e=i.dataset.count;e&&(i.dataset.count=(parseInt(e)+1).toString())}}i=null,vt=0}),o.on("dragStart",e=>{const n=e.getGrid();if(n instanceof Mt){wt=n,vt=o.getItems().indexOf(e);const t=o.getElement();if(t){const e=t.closest(".SearchResult-board-column"),n=e?.getAttribute("data-boardFieldValue");n&&(qt=n)}const i=e.getElement();i&&(i.style.width=e.getWidth()+"px",i.style.height=e.getHeight()+"px")}}),o.on("dragMove",e=>{o===wt&&null!==vt&&o.move(e,vt,{layout:"instant"})}),o.on("layoutStart",()=>{Ot&&Ot.refreshItems().layout()}),o.on("receive",e=>{i=e.item});const r=async e=>{const n=e.getElement(),t=n?.getAttribute("data-objectId"),i=document.querySelector('li[data-objectId="'+t+'"]');let r,a,s;if(i){const e=i.closest(".SearchResult-board");e&&(r=e.getAttribute("data-boardField"),s=e.getAttribute("data-search"))}if(n){const e=n.closest(".SearchResult-board-column");a=e?.getAttribute("data-boardFieldValue")}const c=new Headers,d=ut.A.get("bsp.csrf");d&&c.append("Brightspot-CSRF",d);const l=new FormData;t&&l.append("objectId",t),r&&l.append("boardField",r),a&&l.append("boardFieldValue",a),s&&l.append("search",s),l.append("previousBoardFieldValue",qt);const p=await fetch(window.CONTEXT_PATH+"board/fieldUpdate",{method:"post",credentials:"include",headers:c,body:l}),M=await p.text();if(p.ok){const n=o.getItems().indexOf(e);o.remove([e],{removeElements:!0});const t=document.createElement("template");t.innerHTML=M;const i=t.content.firstChild;i instanceof HTMLElement&&o.add(i,{index:n})}else if(M){o.send(e,wt,vt);const n=document.querySelector(".SearchResult-board-errors");n&&(n.innerHTML=M)}};At(o,e),zt.push(o)}),window.addEventListener("brightspot-frame-load",e=>{const n=e.target;if(n instanceof HTMLElement)if(n.classList.contains("BoardResults")){const e=[...n.querySelectorAll("li.BoardView-card")],t=n.closest(".BoardView-listContainer"),o=t?.querySelector("ol.BoardView-list");zt.forEach(n=>{n instanceof Object&&n.getElement()===o&&(At(n,o),n.add(e))})}else n.classList.contains("BoardResults-Horiz")&&(gt(),Ot.add([...n.querySelectorAll("div.SearchResult-board-column")]))})},81664(e,n,t){"use strict";(0,t(91762).A)(".Page .Page-broadcastAlert",e=>{const n=e.querySelector(".pagination");if(!n)return;const t=n.querySelector(".pagination-count");if(!t)return;const o=e.querySelectorAll(".Page-broadcastAlert-messages > *");if(!o)return;const i=n.querySelector(".previous");if(!i)return;const r=i.querySelector(":scope > a");if(!r)return;const a=n.querySelector(".next");if(!a)return;const s=a.querySelector(":scope > a");if(!s)return;const c=o.length;for(let e=1;e<c;e++)o[e].hidden=!0;let d=0;const l=()=>{t.textContent=`${d+1} / ${c}`};l();const p=e=>{o[d].hidden=!0,d+=e?1:-1,o[d].hidden=!1,l();const n=0===d;i.classList.toggle("is-disabled",n),r.tabIndex=n?-1:0;const t=d===c-1;a.classList.toggle("is-disabled",t),s.tabIndex=t?-1:0};i.addEventListener("click",e=>{e.preventDefault(),d>0&&p(!1)}),a.addEventListener("click",e=>{e.preventDefault(),d<c-1&&p(!0)})})},53664(e,n,t){"use strict";var o=t(91762),i=t(25936),r=t(24510),a=t(55408),s=t(17664);(0,o.A)(".BulkWorkflow-button",e=>{let n=null;e.addEventListener("keydown",n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),e.click())}),e.addEventListener("click",async t=>{t.preventDefault(),t.stopPropagation();const o=t.target;let c;if(o instanceof HTMLElement&&(c=o.getAttribute("action-url")),!c)return;if(!n){const e=new Headers,t=r.A.get("bsp.csrf");t&&e.append("Brightspot-CSRF",t);const o=await fetch(c,{headers:e}),a=await o.text();n=(0,i.A)("div",{className:"BulkWorkflow",innerHTML:a,role:"dialog","aria-modal":"true"}),document.body.appendChild(n),n.addEventListener("keydown",e=>{if("Escape"===e.key){e.stopPropagation();const t=n?.querySelector(".closeButton");t&&t.click()}})}e.closest(".Popup")&&(n.style.zIndex=(0,s.default)().toString()),a.A.toggle(e,n,()=>{const t=e.classList.toggle("is-open");return n?.classList.toggle("is-open"),t&&requestAnimationFrame(()=>{const e=n?.querySelector(".closeButton");e&&e.focus()}),t});const d=n.querySelector(".closeButton");d?.addEventListener("click",()=>{const t=a.A.toggles.get(e);t&&t.closeListener&&window.removeEventListener("click",t.closeListener,!0),e.classList.remove("is-open"),n?.classList.remove("is-open"),n?.remove(),n=null;const o=e.closest(".SearchResult")?.querySelector(".SearchResult-actions-toggle");o&&o.focus()})})})},35053(e,n,t){"use strict";t.d(n,{A:()=>A}),t(57573),t(49371),t(42723),t(96648),t(56065);var o=t(71224),i=t(98474),r=t(89713),a=t(67324),s=t(44209);function c(){c=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,n){["method","field"].forEach(function(t){n.forEach(function(n){n.kind===t&&"own"===n.placement&&this.defineClassElement(e,n)},this)},this)},initializeClassElements:function(e,n){var t=e.prototype;["method","field"].forEach(function(o){n.forEach(function(n){var i=n.placement;if(n.kind===o&&("static"===i||"prototype"===i)){var r="static"===i?e:t;this.defineClassElement(r,n)}},this)},this)},defineClassElement:function(e,n){var t=n.descriptor;if("field"===n.kind){var o=n.initializer;t={enumerable:t.enumerable,writable:t.writable,configurable:t.configurable,value:void 0===o?void 0:o.call(e)}}Object.defineProperty(e,n.key,t)},decorateClass:function(e,n){var t=[],o=[],i={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,i)},this),e.forEach(function(e){if(!p(e))return t.push(e);var n=this.decorateElement(e,i);t.push(n.element),t.push.apply(t,n.extras),o.push.apply(o,n.finishers)},this),!n)return{elements:t,finishers:o};var r=this.decorateConstructor(t,n);return o.push.apply(o,r.finishers),r.finishers=o,r},addElementPlacement:function(e,n,t){var o=n[e.placement];if(!t&&-1!==o.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");o.push(e.key)},decorateElement:function(e,n){for(var t=[],o=[],i=e.decorators,r=i.length-1;r>=0;r--){var a=n[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,i[r])(s)||s);e=c.element,this.addElementPlacement(e,n),c.finisher&&o.push(c.finisher);var d=c.extras;if(d){for(var l=0;l<d.length;l++)this.addElementPlacement(d[l],n);t.push.apply(t,d)}}return{element:e,finishers:o,extras:t}},decorateConstructor:function(e,n){for(var t=[],o=n.length-1;o>=0;o--){var i=this.fromClassDescriptor(e),r=this.toClassDescriptor((0,n[o])(i)||i);if(void 0!==r.finisher&&t.push(r.finisher),void 0!==r.elements){e=r.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:t}},fromElementDescriptor:function(e){var n={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(n.initializer=e.initializer),n},toElementDescriptors:function(e){if(void 0!==e)return(n=e,function(e){if(Array.isArray(e))return e}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,n){if(e){if("string"==typeof e)return h(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?h(e,n):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){var n=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),n},this);var n},toElementDescriptor:function(e){var n=e.kind+"";if("method"!==n&&"field"!==n)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+n+'"');var t=b(e.key),o=e.placement+"";if("static"!==o&&"prototype"!==o&&"own"!==o)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+o+'"');var i=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var r={kind:n,key:t,placement:o,descriptor:Object.assign({},i)};return"field"!==n?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(i,"get","The property descriptor of a field descriptor"),this.disallowProperty(i,"set","The property descriptor of a field descriptor"),this.disallowProperty(i,"value","The property descriptor of a field descriptor"),r.initializer=e.initializer),r},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:u(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var n={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(n,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),n},toClassDescriptor:function(e){var n=e.kind+"";if("class"!==n)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+n+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var t=u(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:t}},runClassFinishers:function(e,n){for(var t=0;t<n.length;t++){var o=(0,n[t])(e);if(void 0!==o){if("function"!=typeof o)throw new TypeError("Finishers must return a constructor.");e=o}}return e},disallowProperty:function(e,n,t){if(void 0!==e[n])throw new TypeError(t+" can't have a ."+n+" property.")}};return e}function d(e){var n,t=b(e.key);"method"===e.kind?n={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?n={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?n={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(n={configurable:!0,writable:!0,enumerable:!0});var o={kind:"field"===e.kind?"field":"method",key:t,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:n};return e.decorators&&(o.decorators=e.decorators),"field"===e.kind&&(o.initializer=e.value),o}function l(e,n){void 0!==e.descriptor.get?n.descriptor.get=e.descriptor.get:n.descriptor.set=e.descriptor.set}function p(e){return e.decorators&&e.decorators.length}function M(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function u(e,n){var t=e[n];if(void 0!==t&&"function"!=typeof t)throw new TypeError("Expected '"+n+"' to be a function");return t}function b(e){var n=function(e){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var t=n.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof n?n:n+""}function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function z(){return z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,n,t){var o=function(e,n){for(;!{}.hasOwnProperty.call(e,n)&&null!==(e=O(e)););return e}(e,n);if(o){var i=Object.getOwnPropertyDescriptor(o,n);return i.get?i.get.call(arguments.length<3?e:t):i.value}},z.apply(null,arguments)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}const f=window.localStorage,m=window.BRIGHTSPOT?.ui.tooltips.collapse,g=window.BRIGHTSPOT?.ui.tooltips.expand;let A=(w=[(0,i.EM)("btu-cig-cluster")],v=(0,r.j)((0,a.m)(o.WF)),q=c(),k=function(e,n){class t extends n{constructor(...n){super(...n),e(this)}}return{F:t,d:[{kind:"field",key:"_collapsed",value:()=>!0},{kind:"field",decorators:[(0,i.MZ)({type:String,reflect:!0,attribute:"cluster-title"})],key:"clusterTitle",value:void 0},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"tab",value:void 0},{kind:"set",decorators:[(0,i.MZ)()],key:"collapsed",value:function(e){this._collapsed=e;const n=this.closest(".CIG"),t=n?.dataset.type,o=this.clusterTitle?.trim(),i=`BSP.ContentEdit.clusterExpanded.${t}.${o}`;t&&o&&(e?f.removeItem(i):f.setItem(i,"1")),this._collapsed?this.states.delete("btu-expanded"):this.states.add("btu-expanded"),this.requestUpdate()}},{kind:"get",key:"collapsed",value:function(){return this._collapsed}},{kind:"method",key:"_toggleRowVisibility",value:function(e){this.querySelectorAll(":scope > :not(.CIG-title)").forEach(n=>{n.childNodes.length&&(n.toggleAttribute("hidden",e),n.classList.toggle("TC-unselected",e))})}},{kind:"method",key:"connectedCallback",value:function(){var e,n,o,i,r;(e=t,n="connectedCallback",o=this,r=z(O(1&(i=3)?e.prototype:e),n,o),2&i&&"function"==typeof r?function(e){return r.apply(o,e)}:r)([]);const a=this.closest(".CIG"),s=a?.dataset.type,c=`BSP.ContentEdit.clusterExpanded.${s}.${this.clusterTitle}`;this.collapsed=!f.getItem(c)}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"firstUpdated",value:function(){this.emit("btu-cig-cluster-ready");const e=this.querySelector(".CIG-title"),n=this.firstChild;n instanceof Element&&!n.classList.contains("CIG-title")&&e&&this.insertBefore(e,n),this.dataset.tab=this.tab;const t=Array.from(this.querySelectorAll(".CIG-row")).filter(e=>e.childNodes.length);this.toggleAttribute("hidden",!t.length),Array.from(this.querySelectorAll(".CIG-row")).filter(e=>!e.childNodes.length).forEach(e=>e.toggleAttribute("hidden",!0)),this.querySelectorAll(".CIG-row > .Message.is-error").length>0?this.states.add("btu-error"):this.states.delete("btu-error")}},{kind:"method",key:"render",value:function(){return this._toggleRowVisibility(this.collapsed),o.qy`<h2 class="CIG-title" data-tab=${this.tab}>
3
3
  <button
4
4
  type="button"
5
5
  title="${this.collapsed?g:m}"
@@ -8,6 +8,10 @@
8
8
  width: 1px;
9
9
  }
10
10
 
11
+ .visible-if-focused {
12
+ position: fixed;
13
+ }
14
+
11
15
  .visible-if-focused:not(:focus, :hover) {
12
16
  opacity: 0;
13
17
  transform: translateY(-100vh);