UNPKG

vue3-grid-layout-next

Version:

A draggable and resizable grid layout, as a Vue component.

8 lines 107 kB
(function(rt,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(rt=typeof globalThis<"u"?globalThis:rt||self,h(rt["vue3-gird-layout"]={},rt.Vue))})(this,function(rt,h){"use strict";var ms=Object.defineProperty;var vs=(rt,h,Ht)=>h in rt?ms(rt,h,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):rt[h]=Ht;var g=(rt,h,Ht)=>(vs(rt,typeof h!="symbol"?h+"":h,Ht),Ht);function Ht(e){let t=0,n;for(let i=0,o=e.length;i<o;i++)n=e[i].y+e[i].h,n>t&&(t=n);return t}function Me(e){const t=Array(e.length);for(let n=0,i=e.length;n<i;n++)t[n]=Ei(e[n]);return t}function Ei(e){return JSON.parse(JSON.stringify(e))}function cn(e,t){return!(e===t||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Yt(e,t,n){const i=dn(e),o=pn(e),r=Array(e.length);for(let s=0,a=o.length;s<a;s++){let l=o[s];l.static||(l=Ii(i,l,t,n),i.push(l)),r[e.indexOf(l)]=l,l.moved=!1}return r}function Ii(e,t,n,i){if(n)for(;t.y>0&&!Jt(e,t);)t.y--;else if(i){const r=i[t.i].y;for(;t.y>r&&!Jt(e,t);)t.y--}let o;for(;o=Jt(e,t);)t.y=o.y+o.h;return t}function zi(e,t){const n=dn(e);for(let i=0,o=e.length;i<o;i++){const r=e[i];if(r.x+r.w>t.cols&&(r.x=t.cols-r.w),r.x<0&&(r.x=0,r.w=t.cols),!r.static)n.push(r);else for(;Jt(n,r);)r.y++}return e}function un(e,t){for(let n=0,i=e.length;n<i;n++)if(e[n].i===t)return e[n]}function Jt(e,t){for(let n=0,i=e.length;n<i;n++)if(cn(e[n],t))return e[n]}function fn(e,t){return e.filter(n=>cn(n,t))}function dn(e){return e.filter(t=>t.static)}function _e(e,t,n,i,o,r){if(t.static)return e;const s=t.x,a=t.y,l=i&&t.y>i;typeof n=="number"&&(t.x=n),typeof i=="number"&&(t.y=i),t.moved=!0;let c=pn(e);l&&(c=c.reverse());const u=fn(c,t);if(r&&u.length)return t.x=s,t.y=a,t.moved=!1,e;for(let f=0,v=u.length;f<v;f++){const x=u[f];x.moved||t.y>x.y&&t.y-x.y>x.h/4||(x.static?e=hn(e,x,t,o):e=hn(e,t,x,o))}return e}function hn(e,t,n,i){if(i){const r={x:n.x,y:n.y,w:n.w,h:n.h,i:"-1"};if(r.y=Math.max(t.y-n.h,0),!Jt(e,r))return _e(e,n,void 0,r.y,!1)}return _e(e,n,void 0,n.y+1,!1)}function Ti(e,t,n,i){const o="translate3d("+t+"px,"+e+"px, 0)";return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:n+"px",height:i+"px",position:"absolute"}}function Mi(e,t,n,i){const o="translate3d("+t*-1+"px,"+e+"px, 0)";return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:n+"px",height:i+"px",position:"absolute"}}function _i(e,t,n,i){return{top:e+"px",left:t+"px",width:n+"px",height:i+"px",position:"absolute"}}function Ci(e,t,n,i){return{top:e+"px",right:t+"px",width:n+"px",height:i+"px",position:"absolute"}}function pn(e){return[].concat(e).sort(function(n,i){return n.y===i.y&&n.x===i.x?0:n.y>i.y||n.y===i.y&&n.x>i.x?1:-1})}function Di(e,t){t=t||"Layout";const n=["x","y","w","h"],i=[];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let o=0,r=e.length;o<r;o++){const s=e[o];for(let a=0;a<n.length;a++)if(typeof s[n[a]]!="number")throw new Error("VueGridLayout: "+t+"["+o+"]."+n[a]+" must be a number!");if(s.i===void 0||s.i===null)throw new Error("VueGridLayout: "+t+"["+o+"].i cannot be null!");if(typeof s.i!="number"&&typeof s.i!="string")throw new Error("VueGridLayout: "+t+"["+o+"].i must be a string or number!");if(i.indexOf(s.i)>=0)throw new Error("VueGridLayout: "+t+"["+o+"].i must be unique!");if(i.push(s.i),s.static!==void 0&&typeof s.static!="boolean")throw new Error("VueGridLayout: "+t+"["+o+"].static must be a boolean!")}}function gn(e){return Pi(e)}function Pi(e){const t=e.target,n=t.offsetParent||document.body,i=t.offsetParent===document.body?{left:0,top:0}:n.getBoundingClientRect(),o=e.clientX+n.scrollLeft-i.left,r=e.clientY+n.scrollTop-i.top;return{x:o,y:r}}function mn(e,t,n,i){return ki(e)?{deltaX:n-e,deltaY:i-t,lastX:e,lastY:t,x:n,y:i}:{deltaX:0,deltaY:0,lastX:n,lastY:i,x:n,y:i}}function ki(e){return typeof e=="number"&&!isNaN(e)}function Ai(e,t){const n=vn(e);let i=n[0];for(let o=1,r=n.length;o<r;o++){const s=n[o];t>e[s]&&(i=s)}return i}function Ce(e,t){if(!t[e])throw new Error("ResponsiveGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Oi(e,t,n,i,o,r,s){if(t[i])return Me(t[i]);let a=e;const l=vn(n),c=l.slice(l.indexOf(i));for(let u=0,f=c.length;u<f;u++){const v=c[u];if(t[v]){a=t[v];break}}return a=Me(a||[]),Yt(zi(a,{cols:r}),s)}function vn(e){return Object.keys(e).sort(function(n,i){return e[n]-e[i]})}let Ri="auto";function Hi(){return typeof document<"u"}function yn(){return typeof window<"u"}function bn(){return Hi()?typeof document.dir<"u"?document.dir:document.getElementsByTagName("html")[0].getAttribute("dir")||"auto":Ri}function $i(e,t){return yn?(window.addEventListener(e,t),!0):(t(),!1)}function Bi(e,t){!yn||window.removeEventListener(e,t)}const pt={init:Wi,document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function Xt(){}const ct=pt;function Wi(e){const t=e;pt.document=t.document,pt.DocumentFragment=t.DocumentFragment||Xt,pt.SVGElement=t.SVGElement||Xt,pt.SVGSVGElement=t.SVGSVGElement||Xt,pt.SVGElementInstance=t.SVGElementInstance||Xt,pt.Element=t.Element||Xt,pt.HTMLElement=t.HTMLElement||pt.Element,pt.Event=t.Event,pt.Touch=t.Touch||Xt,pt.PointerEvent=t.PointerEvent||t.MSPointerEvent}const xn=e=>!!(e&&e.Window)&&e instanceof e.Window;let wn,_t;function Sn(e){wn=e;const t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),_t=e}typeof window<"u"&&!!window&&Sn(window);function $t(e){return xn(e)?e:(e.ownerDocument||e).defaultView||_t.window}const Li=e=>e===_t||xn(e),Fi=e=>ue(e)&&e.nodeType===11,ue=e=>!!e&&typeof e=="object",En=e=>typeof e=="function",m={window:Li,docFrag:Fi,object:ue,func:En,number:e=>typeof e=="number",bool:e=>typeof e=="boolean",string:e=>typeof e=="string",element:e=>{if(!e||typeof e!="object")return!1;const t=$t(e)||_t;return/object|function/.test(typeof Element)?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:e=>ue(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString()),array:e=>ue(e)&&typeof e.length<"u"&&En(e.splice)},gt={init:Ni,supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null};function Ni(e){const t=ct.Element,n=e.navigator||{};gt.supportsTouch="ontouchstart"in e||m.func(e.DocumentTouch)&&ct.document instanceof e.DocumentTouch,gt.supportsPointerEvent=n.pointerEnabled!==!1&&!!ct.PointerEvent,gt.isIOS=/iP(hone|od|ad)/.test(n.platform),gt.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),gt.isIe9=/MSIE 9/.test(n.userAgent),gt.isOperaMobile=n.appName==="Opera"&&gt.supportsTouch&&/Presto/.test(n.userAgent),gt.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",gt.pEventTypes=gt.supportsPointerEvent?ct.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,gt.wheelEvent=ct.document&&"onmousewheel"in ct.document?"mousewheel":"wheel"}const vt=gt;function Bt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function In(e,t){for(;m.element(e);){if(Wt(e,t))return e;e=Ct(e)}return null}function Ct(e){let t=e.parentNode;if(m.docFrag(t)){for(;(t=t.host)&&m.docFrag(t););return t}return t}function Wt(e,t){return _t!==wn&&(t=t.replace(/\/deep\//g," ")),e[vt.prefixedMatchesSelector](t)}function De(e,t,n){for(;m.element(e);){if(Wt(e,t))return!0;if(e=Ct(e),e===n)return Wt(e,t)}return!1}function zn(e){return e.correspondingUseElement||e}function ji(e){return e=e||_t,{x:e.scrollX||e.document.documentElement.scrollLeft,y:e.scrollY||e.document.documentElement.scrollTop}}function Pe(e){const t=e instanceof ct.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ke(e){const t=Pe(e);if(!vt.isIOS7&&t){const n=ji($t(e));t.left+=n.x,t.right+=n.x,t.top+=n.y,t.bottom+=n.y}return t}function Tn(e){return m.string(e)?(ct.document.querySelector(e),!0):!1}function _(e,t){for(const i in t)e[i]=t[i];return e}function Zt(e,t){let n=!1;return function(){return n||(_t.console.warn(t),n=!0),e.apply(this,arguments)}}function Mn(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Yi(e){const{Interactable:t}=e;t.prototype.getAction=function(i,o,r,s){const a=Xi(this,o,r,s,e);return this.options.actionChecker?this.options.actionChecker(i,o,a,this,s,r):a},t.prototype.ignoreFrom=Zt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=Zt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=qi,t.prototype.styleCursor=Gi}function Xi(e,t,n,i,o){const r=e.getRect(i),s=t.buttons||{0:1,1:4,3:8,4:16}[t.button],a={action:null,interactable:e,interaction:n,element:i,rect:r,buttons:s};return o.fire("auto-start:check",a),a.action}function Gi(e){return m.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function qi(e){return m.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}const Ui={id:"auto-start/interactableMethods",install:Yi};function Vi(e){const{interactStatic:t,defaults:n}=e;e.usePlugin(Ui),n.base.actionChecker=null,n.base.styleCursor=!0,_(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=i=>Pn(i,e),e.autoStart={maxInteractions:1/0,withinInteractionLimit:fe,cursorElement:null}}function Ki({interaction:e,pointer:t,event:n,eventTarget:i},o){if(e.interacting())return;const r=Cn(e,t,n,i,o);Dn(e,r,o)}function Ji({interaction:e,pointer:t,event:n,eventTarget:i},o){if(e.pointerType!=="mouse"||e.pointerIsDown||e.interacting())return;const r=Cn(e,t,n,i,o);Dn(e,r,o)}function Zi(e,t){const{interaction:n}=e;if(!n.pointerIsDown||n.interacting()||!n.pointerWasMoved||!n.prepared.name)return;t.fire("autoStart:before-start",e);const{interactable:i}=n,o=n.prepared.name;o&&i&&(i.options[o].manualStart||!fe(i,n.element,n.prepared,t)?n.stop():(n.start(n.prepared,i,n.element),kn(n,t)))}function Qi({interaction:e},t){const{interactable:n}=e;n&&n.options.styleCursor&&Ae(e.element,"",t)}function _n(e,t,n,i,o){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&fe(t,n,e,o)?e:null}function to(e,t,n,i,o,r,s){for(let a=0,l=i.length;a<l;a++){const c=i[a],u=o[a],f=c.getAction(t,n,e,u);if(!f)continue;const v=_n(f,c,u,r,s);if(v)return{action:v,interactable:c,element:u}}return{action:null,interactable:null,element:null}}function Cn(e,t,n,i,o){let r=[],s=[],a=i;function l(c){r.push(c),s.push(a)}for(;m.element(a);){r=[],s=[],o.interactables.forEachMatch(a,l);const c=to(e,t,n,r,s,i,o);if(c.action&&!c.interactable.options[c.action.name].manualStart)return c;a=Ct(a)}return{action:null,interactable:null,element:null}}function Dn(e,{action:t,interactable:n,element:i},o){t=t||{name:null},e.interactable=n,e.element=i,Mn(e.prepared,t),e.rect=n&&t.name?n.getRect(i):null,kn(e,o),o.fire("autoStart:prepared",{interaction:e})}function fe(e,t,n,i){const o=e.options,r=o[n.name].max,s=o[n.name].maxPerElement,a=i.autoStart.maxInteractions;let l=0,c=0,u=0;if(!(r&&s&&a))return!1;for(const f of i.interactions.list){const v=f.prepared.name;if(!!f.interacting()){if(l++,l>=a)return!1;if(f.interactable===e&&(c+=v===n.name?1:0,c>=r||f.element===t&&(u++,v===n.name&&u>=s)))return!1}}return a>0}function Pn(e,t){return m.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function Ae(e,t,n){const{cursorElement:i}=n.autoStart;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function kn(e,t){const{interactable:n,element:i,prepared:o}=e;if(!(e.pointerType==="mouse"&&n&&n.options.styleCursor)){t.autoStart.cursorElement&&Ae(t.autoStart.cursorElement,"",t);return}let r="";if(o.name){const s=n.options[o.name].cursorChecker;m.func(s)?r=s(o,n,i,e._interacting):r=t.actions.map[o.name].getCursor(o)}Ae(e.element,r||"",t)}const Oe={id:"auto-start/base",before:["actions"],install:Vi,listeners:{"interactions:down":Ki,"interactions:move":(e,t)=>{Ji(e,t),Zi(e,t)},"interactions:stop":Qi},maxInteractions:Pn,withinInteractionLimit:fe,validateAction:_n};function eo({interaction:e,eventTarget:t,dx:n,dy:i},o){if(e.prepared.name!=="drag")return;const r=Math.abs(n),s=Math.abs(i),a=e.interactable.options.drag,l=a.startAxis,c=r>s?"x":r<s?"y":"xy";if(e.prepared.axis=a.lockAxis==="start"?c[0]:a.lockAxis,c!=="xy"&&l!=="xy"&&l!==c){e.prepared.name=null;let u=t;const f=function(v){if(v===e.interactable)return;const x=e.interactable.options.drag;if(!x.manualStart&&v.testIgnoreAllow(x,u,t)){const w=v.getAction(e.downPointer,e.downEvent,e,u);if(w&&w.name==="drag"&&no(c,v)&&Oe.validateAction(w,v,u,t,o))return v}};for(;m.element(u);){const v=o.interactables.forEachMatch(u,f);if(v){e.prepared.name="drag",e.interactable=v,e.element=u;break}u=Ct(u)}}}function no(e,t){if(!t)return!1;const n=t.options.drag.startAxis;return e==="xy"||n==="xy"||n===e}const io={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":eo}};function oo(e){const{defaults:t}=e;e.usePlugin(Oe),t.perAction.hold=0,t.perAction.delay=0}function Re(e){const t=e.prepared&&e.prepared.name;if(!t)return null;const n=e.interactable.options;return n[t].hold||n[t].delay}const ro={id:"auto-start/hold",install:oo,listeners:{"interactions:new":({interaction:e})=>{e.autoStartHoldTimer=null},"autoStart:prepared":({interaction:e})=>{const t=Re(e);t>0&&(e.autoStartHoldTimer=setTimeout(()=>{e.start(e.prepared,e.interactable,e.element)},t))},"interactions:move":({interaction:e,duplicate:t})=>{e.autoStartHoldTimer&&e.pointerWasMoved&&!t&&(clearTimeout(e.autoStartHoldTimer),e.autoStartHoldTimer=null)},"autoStart:before-start":({interaction:e})=>{Re(e)>0&&(e.prepared.name=null)}},getHoldDuration:Re},so={id:"auto-start",install(e){e.usePlugin(Oe),e.usePlugin(ro),e.usePlugin(io)}},ao=(e,t)=>e.indexOf(t)!==-1,An=(e,t)=>{for(const n of t)e.push(n);return e},On=e=>An([],e),de=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return n;return-1},He=(e,t)=>e[de(e,t)];function Gt(e){const t={};for(const n in e){const i=e[n];m.plainObject(i)?t[n]=Gt(i):m.array(i)?t[n]=On(i):t[n]=i}return t}let Rn=0,St,Lt;function lo(e){if(St=e.requestAnimationFrame,Lt=e.cancelAnimationFrame,!St){const t=["ms","moz","webkit","o"];for(const n of t)St=e[`${n}RequestAnimationFrame`],Lt=e[`${n}CancelAnimationFrame`]||e[`${n}CancelRequestAnimationFrame`]}St=St&&St.bind(e),Lt=Lt&&Lt.bind(e),St||(St=t=>{const n=Date.now(),i=Math.max(0,16-(n-Rn)),o=e.setTimeout(()=>{t(n+i)},i);return Rn=n+i,o},Lt=t=>clearTimeout(t))}const qt={request:e=>St(e),cancel:e=>Lt(e),init:lo};function Ut(e,t,n){if(n=n||{},m.string(e)&&e.search(" ")!==-1&&(e=Hn(e)),m.array(e))return e.reduce((i,o)=>_(i,Ut(o,t,n)),n);if(m.object(e)&&(t=e,e=""),m.func(t))n[e]=n[e]||[],n[e].push(t);else if(m.array(t))for(const i of t)Ut(e,i,n);else if(m.object(t))for(const i in t){const o=Hn(i).map(r=>`${e}${r}`);Ut(o,t[i],n)}return n}function Hn(e){return e.trim().split(/ +/)}function $n(e,t){for(const n of t){if(e.immediatePropagationStopped)break;n(e)}}class Bn{constructor(t){g(this,"options");g(this,"types",{});g(this,"propagationStopped",!1);g(this,"immediatePropagationStopped",!1);g(this,"global");this.options=_({},t||{})}fire(t){let n;const i=this.global;(n=this.types[t.type])&&$n(t,n),!t.propagationStopped&&i&&(n=i[t.type])&&$n(t,n)}on(t,n){const i=Ut(t,n);for(t in i)this.types[t]=An(this.types[t]||[],i[t])}off(t,n){const i=Ut(t,n);for(t in i){const o=this.types[t];if(!(!o||!o.length))for(const r of i[t]){const s=o.indexOf(r);s!==-1&&o.splice(s,1)}}}getRect(t){return null}}function Wn(e,t,n){return e==="parent"?Ct(n):e==="self"?t.getRect(n):In(n,e)}function Qt(e,t,n,i){let o=e;return m.string(o)?o=Wn(o,t,n):m.func(o)&&(o=o(...i)),m.element(o)&&(o=ke(o)),o}function he(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function co(e){return e&&!("left"in e&&"top"in e)&&(e=_({},e),e.left=e.x||0,e.top=e.y||0,e.right=e.right||e.left+e.width,e.bottom=e.bottom||e.top+e.height),e}function Ln(e){return e&&!("x"in e&&"y"in e)&&(e=_({},e),e.x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function $e(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function Be(e,t,n){const i=e.options[n],r=i&&i.origin||e.options.origin,s=Qt(r,e,t,[e&&t]);return he(s)||{x:0,y:0}}const pe=(e,t)=>Math.sqrt(e*e+t*t);class Fn{constructor(t){g(this,"immediatePropagationStopped",!1);g(this,"propagationStopped",!1);this._interaction=t}preventDefault(){}stopPropagation(){this.propagationStopped=!0}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}}Object.defineProperty(Fn.prototype,"interaction",{get(){return this._interaction._proxy},set(){}});const Nn={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}};class We extends Fn{constructor(n,i,o,r,s,a,l){super(n);g(this,"relatedTarget",null);g(this,"screenX");g(this,"screenY");g(this,"button");g(this,"buttons");g(this,"ctrlKey");g(this,"shiftKey");g(this,"altKey");g(this,"metaKey");g(this,"page");g(this,"client");g(this,"delta");g(this,"rect");g(this,"x0");g(this,"y0");g(this,"t0");g(this,"dt");g(this,"duration");g(this,"clientX0");g(this,"clientY0");g(this,"velocity");g(this,"speed");g(this,"swipe");g(this,"axes");g(this,"preEnd");s=s||n.element;const c=n.interactable,u=(c&&c.options||Nn).deltaSource,f=Be(c,s,o),v=r==="start",x=r==="end",w=v?this:n.prevEvent,E=v?n.coords.start:x?{page:w.page,client:w.client,timeStamp:n.coords.cur.timeStamp}:n.coords.cur;this.page=_({},E.page),this.client=_({},E.client),this.rect=_({},n.rect),this.timeStamp=E.timeStamp,x||(this.page.x-=f.x,this.page.y-=f.y,this.client.x-=f.x,this.client.y-=f.y),this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.shiftKey=i.shiftKey,this.metaKey=i.metaKey,this.button=i.button,this.buttons=i.buttons,this.target=s,this.currentTarget=s,this.preEnd=a,this.type=l||o+(r||""),this.interactable=c,this.t0=v?n.pointers[n.pointers.length-1].downTime:w.t0,this.x0=n.coords.start.page.x-f.x,this.y0=n.coords.start.page.y-f.y,this.clientX0=n.coords.start.client.x-f.x,this.clientY0=n.coords.start.client.y-f.y,v||x?this.delta={x:0,y:0}:this.delta={x:this[u].x-w[u].x,y:this[u].y-w[u].y},this.dt=n.coords.delta.timeStamp,this.duration=this.timeStamp-this.t0,this.velocity=_({},n.coords.velocity[u]),this.speed=pe(this.velocity.x,this.velocity.y),this.swipe=x||r==="inertiastart"?this.getSwipe():null}getSwipe(){const n=this._interaction;if(n.prevEvent.speed<600||this.timeStamp-n.prevEvent.timeStamp>150)return null;let i=180*Math.atan2(n.prevEvent.velocityY,n.prevEvent.velocityX)/Math.PI;const o=22.5;i<0&&(i+=360);const r=135-o<=i&&i<225+o,s=225-o<=i&&i<315+o,a=!r&&(315-o<=i||i<45+o),l=!s&&45-o<=i&&i<135+o;return{up:s,down:l,left:r,right:a,angle:i,speed:n.prevEvent.speed,velocity:{x:n.prevEvent.velocityX,y:n.prevEvent.velocityY}}}preventDefault(){}stopImmediatePropagation(){this.immediatePropagationStopped=this.propagationStopped=!0}stopPropagation(){this.propagationStopped=!0}}Object.defineProperties(We.prototype,{pageX:{get(){return this.page.x},set(e){this.page.x=e}},pageY:{get(){return this.page.y},set(e){this.page.y=e}},clientX:{get(){return this.client.x},set(e){this.client.x=e}},clientY:{get(){return this.client.y},set(e){this.client.y=e}},dx:{get(){return this.delta.x},set(e){this.delta.x=e}},dy:{get(){return this.delta.y},set(e){this.delta.y=e}},velocityX:{get(){return this.velocity.x},set(e){this.velocity.x=e}},velocityY:{get(){return this.velocity.y},set(e){this.velocity.y=e}}});function jn(e,t){e.__set||(e.__set={});for(const n in t)typeof e[n]!="function"&&n!=="__set"&&Object.defineProperty(e,n,{get(){return n in e.__set?e.__set[n]:e.__set[n]=t[n]},set(i){e.__set[n]=i},configurable:!0});return e}function Le(e,t){e.page=e.page||{},e.page.x=t.page.x,e.page.y=t.page.y,e.client=e.client||{},e.client.x=t.client.x,e.client.y=t.client.y,e.timeStamp=t.timeStamp}function uo(e,t,n){e.page.x=n.page.x-t.page.x,e.page.y=n.page.y-t.page.y,e.client.x=n.client.x-t.client.x,e.client.y=n.client.y-t.client.y,e.timeStamp=n.timeStamp-t.timeStamp}function fo(e,t){const n=Math.max(t.timeStamp/1e3,.001);e.page.x=t.page.x/n,e.page.y=t.page.y/n,e.client.x=t.client.x/n,e.client.y=t.client.y/n,e.timeStamp=n}function ho(e){e.page.x=0,e.page.y=0,e.client.x=0,e.client.y=0}function Yn(e){return e instanceof ct.Event||e instanceof ct.Touch}function ge(e,t,n){return n=n||{},e=e||"page",n.x=t[e+"X"],n.y=t[e+"Y"],n}function po(e,t){return t=t||{x:0,y:0},vt.isOperaMobile&&Yn(e)?(ge("screen",e,t),t.x+=window.scrollX,t.y+=window.scrollY):ge("page",e,t),t}function go(e,t){return t=t||{},vt.isOperaMobile&&Yn(e)?ge("screen",e,t):ge("client",e,t),t}function me(e){return m.number(e.pointerId)?e.pointerId:e.identifier}function mo(e,t,n){const i=t.length>1?Xn(t):t[0];po(i,e.page),go(i,e.client),e.timeStamp=n}function Fe(e){const t=[];return m.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xn(e){const t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0};for(const n of e)for(const i in t)t[i]+=n[i];for(const n in t)t[n]/=e.length;return t}function vo(e){if(!e.length)return null;const t=Fe(e),n=Math.min(t[0].pageX,t[1].pageX),i=Math.min(t[0].pageY,t[1].pageY),o=Math.max(t[0].pageX,t[1].pageX),r=Math.max(t[0].pageY,t[1].pageY);return{x:n,y:i,left:n,top:i,right:o,bottom:r,width:o-n,height:r-i}}function yo(e,t){const n=t+"X",i=t+"Y",o=Fe(e),r=o[0][n]-o[1][n],s=o[0][i]-o[1][i];return pe(r,s)}function bo(e,t){const n=t+"X",i=t+"Y",o=Fe(e),r=o[1][n]-o[0][n],s=o[1][i]-o[0][i];return 180*Math.atan2(s,r)/Math.PI}function xo(e){return m.string(e.pointerType)?e.pointerType:m.number(e.pointerType)?[void 0,void 0,"touch","pen","mouse"][e.pointerType]:/touch/.test(e.type||"")||e instanceof ct.Touch?"touch":"mouse"}function Gn(e){const t=m.func(e.composedPath)?e.composedPath():e.path;return[zn(t?t[0]:e.target),zn(e.currentTarget)]}function te(){return{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}}function Ne(e,t){if(t.phaselessTypes[e])return!0;for(const n in t.map)if(e.indexOf(n)===0&&e.substr(n.length)in t.phases)return!0;return!1}function wo(e){const t=(n,i)=>{let o=e.interactables.get(n,i);return o||(o=e.interactables.new(n,i),o.events.global=t.globalEvents),o};return t.getPointerAverage=Xn,t.getTouchBBox=vo,t.getTouchDistance=yo,t.getTouchAngle=bo,t.getElementRect=ke,t.getElementClientRect=Pe,t.matchesSelector=Wt,t.closest=In,t.globalEvents={},t.version="1.10.18",t.scope=e,t.use=function(n,i){return this.scope.usePlugin(n,i),this},t.isSet=function(n,i){return!!this.scope.interactables.get(n,i&&i.context)},t.on=Zt(function(i,o,r){if(m.string(i)&&i.search(" ")!==-1&&(i=i.trim().split(/ +/)),m.array(i)){for(const s of i)this.on(s,o,r);return this}if(m.object(i)){for(const s in i)this.on(s,i[s],o);return this}return Ne(i,this.scope.actions)?this.globalEvents[i]?this.globalEvents[i].push(o):this.globalEvents[i]=[o]:this.scope.events.add(this.scope.document,i,o,{options:r}),this},"The interact.on() method is being deprecated"),t.off=Zt(function(i,o,r){if(m.string(i)&&i.search(" ")!==-1&&(i=i.trim().split(/ +/)),m.array(i)){for(const s of i)this.off(s,o,r);return this}if(m.object(i)){for(const s in i)this.off(s,i[s],o);return this}if(Ne(i,this.scope.actions)){let s;i in this.globalEvents&&(s=this.globalEvents[i].indexOf(o))!==-1&&this.globalEvents[i].splice(s,1)}else this.scope.events.remove(this.scope.document,i,o,r);return this},"The interact.off() method is being deprecated"),t.debug=function(){return this.scope},t.supportsTouch=function(){return vt.supportsTouch},t.supportsPointerEvent=function(){return vt.supportsPointerEvent},t.stop=function(){for(const n of this.scope.interactions.list)n.stop();return this},t.pointerMoveTolerance=function(n){return m.number(n)?(this.scope.interactions.pointerMoveTolerance=n,this):this.scope.interactions.pointerMoveTolerance},t.addDocument=function(n,i){this.scope.addDocument(n,i)},t.removeDocument=function(n){this.scope.removeDocument(n)},t}class So{constructor(t,n,i,o){g(this,"options");g(this,"_actions");g(this,"target");g(this,"events",new Bn);g(this,"_context");g(this,"_win");g(this,"_doc");g(this,"_scopeEvents");g(this,"_rectChecker");this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=$t(Tn(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=o,this.set(n)}get _defaults(){return{base:{},perAction:{},actions:{}}}setOnEvents(t,n){return m.func(n.onstart)&&this.on(`${t}start`,n.onstart),m.func(n.onmove)&&this.on(`${t}move`,n.onmove),m.func(n.onend)&&this.on(`${t}end`,n.onend),m.func(n.oninertiastart)&&this.on(`${t}inertiastart`,n.oninertiastart),this}updatePerActionListeners(t,n,i){(m.array(n)||m.object(n))&&this.off(t,n),(m.array(i)||m.object(i))&&this.on(t,i)}setPerAction(t,n){const i=this._defaults;for(const o in n){const r=o,s=this.options[t],a=n[r];r==="listeners"&&this.updatePerActionListeners(t,s.listeners,a),m.array(a)?s[r]=On(a):m.plainObject(a)?(s[r]=_(s[r]||{},Gt(a)),m.object(i.perAction[r])&&"enabled"in i.perAction[r]&&(s[r].enabled=a.enabled!==!1)):m.bool(a)&&m.object(i.perAction[r])?s[r].enabled=a:s[r]=a}}getRect(t){return t=t||(m.element(this.target)?this.target:null),m.string(this.target)&&(t=t||this._context.querySelector(this.target)),ke(t)}rectChecker(t){return m.func(t)?(this._rectChecker=t,this.getRect=n=>{const i=_({},this._rectChecker(n));return"width"in i||(i.width=i.right-i.left,i.height=i.bottom-i.top),i},this):t===null?(delete this.getRect,delete this._rectChecker,this):this.getRect}_backCompatOption(t,n){if(Tn(n)||m.object(n)){this.options[t]=n;for(const i in this._actions.map)this.options[i][t]=n;return this}return this.options[t]}origin(t){return this._backCompatOption("origin",t)}deltaSource(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}context(){return this._context}inContext(t){return this._context===t.ownerDocument||Bt(this._context,t)}testIgnoreAllow(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}testAllow(t,n,i){return t?m.element(i)?m.string(t)?De(i,t,n):m.element(t)?Bt(t,i):!1:!1:!0}testIgnore(t,n,i){return!t||!m.element(i)?!1:m.string(t)?De(i,t,n):m.element(t)?Bt(t,i):!1}fire(t){return this.events.fire(t),this}_onOff(t,n,i,o){m.object(n)&&!m.array(n)&&(o=i,i=null);const r=t==="on"?"add":"remove",s=Ut(n,i);for(let a in s){a==="wheel"&&(a=vt.wheelEvent);for(const l of s[a])Ne(a,this._actions)?this.events[t](a,l):m.string(this.target)?this._scopeEvents[`${r}Delegate`](this.target,this._context,a,l,o):this._scopeEvents[r](this.target,a,l,o)}return this}on(t,n,i){return this._onOff("on",t,n,i)}off(t,n,i){return this._onOff("off",t,n,i)}set(t){const n=this._defaults;m.object(t)||(t={}),this.options=Gt(n.base);for(const i in this._actions.methodDict){const o=i,r=this._actions.methodDict[o];this.options[o]={},this.setPerAction(o,_(_({},n.perAction),n.actions[o])),this[r](t[o])}for(const i in t)m.func(this[i])&&this[i](t[i]);return this}unset(){if(m.string(this.target))for(const t in this._scopeEvents.delegatedEvents){const n=this._scopeEvents.delegatedEvents[t];for(let i=n.length-1;i>=0;i--){const{selector:o,context:r,listeners:s}=n[i];o===this.target&&r===this._context&&n.splice(i,1);for(let a=s.length-1;a>=0;a--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[a][0],s[a][1])}}else this._scopeEvents.remove(this.target,"all")}}class Eo{constructor(t){g(this,"list",[]);g(this,"selectorMap",{});g(this,"scope");this.scope=t,t.addListeners({"interactable:unset":({interactable:n})=>{const{target:i,_context:o}=n,r=m.string(i)?this.selectorMap[i]:i[this.scope.id],s=de(r,a=>a.context===o);r[s]&&(r[s].context=null,r[s].interactable=null),r.splice(s,1)}})}new(t,n){n=_(n||{},{actions:this.scope.actions});const i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events),o={context:i._context,interactable:i};return this.scope.addDocument(i._doc),this.list.push(i),m.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(o)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(o)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}get(t,n){const i=n&&n.context||this.scope.document,o=m.string(t),r=o?this.selectorMap[t]:t[this.scope.id];if(!r)return null;const s=He(r,a=>a.context===i&&(o||a.interactable.inContext(t)));return s&&s.interactable}forEachMatch(t,n){for(const i of this.list){let o;if((m.string(i.target)?m.element(t)&&Wt(t,i.target):t===i.target)&&i.inContext(t)&&(o=n(i)),o!==void 0)return o}}}function Io(e){var t;const n=[],i={},o=[],r={add:s,remove:a,addDelegate:l,removeDelegate:c,delegateListener:u,delegateUseCapture:f,delegatedEvents:i,documents:o,targets:n,supportsOptions:!1,supportsPassive:!1};(t=e.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return r.supportsOptions=!0},get passive(){return r.supportsPassive=!0}}),e.events=r;function s(v,x,w,E){const T=ee(E);let H=He(n,M=>M.eventTarget===v);H||(H={eventTarget:v,events:{}},n.push(H)),H.events[x]||(H.events[x]=[]),v.addEventListener&&!ao(H.events[x],w)&&(v.addEventListener(x,w,r.supportsOptions?T:T.capture),H.events[x].push(w))}function a(v,x,w,E){const T=ee(E),H=de(n,d=>d.eventTarget===v),M=n[H];if(!M||!M.events)return;if(x==="all"){for(x in M.events)M.events.hasOwnProperty(x)&&a(v,x,"all");return}let D=!1;const y=M.events[x];if(y){if(w==="all"){for(let d=y.length-1;d>=0;d--)a(v,x,y[d],T);return}else for(let d=0;d<y.length;d++)if(y[d]===w){v.removeEventListener(x,w,r.supportsOptions?T:T.capture),y.splice(d,1),y.length===0&&(delete M.events[x],D=!0);break}}D&&!Object.keys(M.events).length&&n.splice(H,1)}function l(v,x,w,E,T){const H=ee(T);if(!i[w]){i[w]=[];for(const y of o)s(y,w,u),s(y,w,f,!0)}const M=i[w];let D=He(M,y=>y.selector===v&&y.context===x);D||(D={selector:v,context:x,listeners:[]},M.push(D)),D.listeners.push([E,H])}function c(v,x,w,E,T){const H=ee(T),M=i[w];let D=!1,y;if(!!M)for(y=M.length-1;y>=0;y--){const d=M[y];if(d.selector===v&&d.context===x){const{listeners:R}=d;for(let S=R.length-1;S>=0;S--){const[F,{capture:V,passive:A}]=R[S];if(F===E&&V===H.capture&&A===H.passive){R.splice(S,1),R.length||(M.splice(y,1),a(x,w,u),a(x,w,f,!0)),D=!0;break}}if(D)break}}}function u(v,x){const w=ee(x),E=new zo(v),T=i[v.type],[H]=Gn(v);let M=H;for(;m.element(M);){for(let D=0;D<T.length;D++){const y=T[D],{selector:d,context:R}=y;if(Wt(M,d)&&Bt(R,H)&&Bt(R,M)){const{listeners:S}=y;E.currentTarget=M;for(const[F,{capture:V,passive:A}]of S)V===w.capture&&A===w.passive&&F(E)}}M=Ct(M)}}function f(v){return u.call(this,v,!0)}return r}class zo{constructor(t){g(this,"currentTarget");g(this,"originalEvent");g(this,"type");this.originalEvent=t,jn(this,t)}preventOriginalDefault(){this.originalEvent.preventDefault()}stopPropagation(){this.originalEvent.stopPropagation()}stopImmediatePropagation(){this.originalEvent.stopImmediatePropagation()}}function ee(e){if(!m.object(e))return{capture:!!e,passive:!1};const t=_({},e);return t.capture=!!e.capture,t.passive=!!e.passive,t}const To={id:"events",install:Io};class Mo{constructor(t,n,i,o,r){g(this,"id");g(this,"pointer");g(this,"event");g(this,"downTime");g(this,"downTarget");this.id=t,this.pointer=n,this.event=i,this.downTime=o,this.downTarget=r}}let je;(function(e){e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy=""})(je||(je={}));let Ye;(function(e){e.start="",e.move="",e.end="",e.stop="",e.interacting=""})(Ye||(Ye={}));let _o=0;class Co{constructor({pointerType:t,scopeFire:n}){g(this,"interactable",null);g(this,"element",null);g(this,"rect",null);g(this,"_rects");g(this,"edges",null);g(this,"_scopeFire");g(this,"prepared",{name:null,axis:null,edges:null});g(this,"pointerType");g(this,"pointers",[]);g(this,"downEvent",null);g(this,"downPointer",{});g(this,"_latestPointer",{pointer:null,event:null,eventTarget:null});g(this,"prevEvent",null);g(this,"pointerIsDown",!1);g(this,"pointerWasMoved",!1);g(this,"_interacting",!1);g(this,"_ending",!1);g(this,"_stopped",!0);g(this,"_proxy",null);g(this,"simulation",null);g(this,"doMove",Zt(function(t){this.move(t)},"The interaction.doMove() method has been renamed to interaction.move()"));g(this,"coords",{start:te(),prev:te(),cur:te(),delta:te(),velocity:te()});g(this,"_id",_o++);this._scopeFire=n,this.pointerType=t;const i=this;this._proxy={};for(const o in je)Object.defineProperty(this._proxy,o,{get(){return i[o]}});for(const o in Ye)Object.defineProperty(this._proxy,o,{value:(...r)=>i[o](...r)});this._scopeFire("interactions:new",{interaction:this})}get pointerMoveTolerance(){return 1}pointerDown(t,n,i){const o=this.updatePointer(t,n,i,!0),r=this.pointers[o];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:o,pointerInfo:r,type:"down",interaction:this})}start(t,n,i){return this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled?!1:(Mn(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?_({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}pointerMove(t,n,i){!this.simulation&&!(this.modification&&this.modification.endResult)&&this.updatePointer(t,n,i,!1);const o=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;let r,s;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,s=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=pe(r,s)>this.pointerMoveTolerance);const a=this.getPointerIndex(t),l={pointer:t,pointerIndex:a,pointerInfo:this.pointers[a],event:n,type:"move",eventTarget:i,dx:r,dy:s,duplicate:o,interaction:this};o||fo(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",l),!o&&!this.simulation&&(this.interacting()&&(l.type=null,this.move(l)),this.pointerWasMoved&&Le(this.coords.prev,this.coords.cur))}move(t){(!t||!t.event)&&ho(this.coords.delta),t=_({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{}),t.phase="move",this._doPhase(t)}pointerUp(t,n,i,o){let r=this.getPointerIndex(t);r===-1&&(r=this.updatePointer(t,n,i,!1));const s=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire(`interactions:${s}`,{pointer:t,pointerIndex:r,pointerInfo:this.pointers[r],event:n,eventTarget:i,type:s,curEventTarget:o,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}documentBlur(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}end(t){this._ending=!0,t=t||this._latestPointer.event;let n;this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}currentAction(){return this._interacting?this.prepared.name:null}interacting(){return this._interacting}stop(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}getPointerIndex(t){const n=me(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:de(this.pointers,i=>i.id===n)}getPointerInfo(t){return this.pointers[this.getPointerIndex(t)]}updatePointer(t,n,i,o){const r=me(t);let s=this.getPointerIndex(t),a=this.pointers[s];return o=o===!1?!1:o||/(down|start)$/i.test(n.type),a?a.pointer=t:(a=new Mo(r,t,n,null,null),s=this.pointers.length,this.pointers.push(a)),mo(this.coords.cur,this.pointers.map(l=>l.pointer),this._now()),uo(this.coords.delta,this.coords.prev,this.coords.cur),o&&(this.pointerIsDown=!0,a.downTime=this.coords.cur.timeStamp,a.downTarget=i,jn(this.downPointer,t),this.interacting()||(Le(this.coords.start,this.coords.cur),Le(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:o,pointerInfo:a,pointerIndex:s,interaction:this}),s}removePointer(t,n){const i=this.getPointerIndex(t);if(i===-1)return;const o=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:o,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}_updateLatestPointer(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}destroy(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}_createPreparedEvent(t,n,i,o){return new We(this,t,this.prepared.name,n,this.element,i,o)}_fireEvent(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}_doPhase(t){const{event:n,phase:i,preEnd:o,type:r}=t,{rect:s}=this;if(s&&i==="move"&&($e(this.edges,s,this.coords.delta[this.interactable.options.deltaSource]),s.width=s.right-s.left,s.height=s.bottom-s.top),this._scopeFire(`interactions:before-action-${i}`,t)===!1)return!1;const l=t.iEvent=this._createPreparedEvent(n,i,o,r);return this._scopeFire(`interactions:action-${i}`,t),i==="start"&&(this.prevEvent=l),this._fireEvent(l),this._scopeFire(`interactions:after-action-${i}`,t),!0}_now(){return Date.now()}}const Do=Co;function Po(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):m.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault}function ko(e,t,n){const i=e.options.preventDefault;if(i!=="never"){if(i==="always"){n.preventDefault();return}if(t.events.supportsPassive&&/^touch(start|move)$/.test(n.type)){const o=$t(n.target).document,r=t.getDocOptions(o);if(!(r&&r.events)||r.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(n.type)||m.element(n.target)&&Wt(n.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||n.preventDefault()}}function Ao({interaction:e,event:t}){e.interactable&&e.interactable.checkAndPreventDefault(t)}function Oo(e){const{Interactable:t}=e;t.prototype.preventDefault=Po,t.prototype.checkAndPreventDefault=function(n){return ko(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener(n){for(const i of e.interactions.list)if(i.element&&(i.element===n.target||Bt(i.element,n.target))){i.interactable.checkAndPreventDefault(n);return}}})}const Ro={id:"core/interactablePreventDefault",install:Oo,listeners:["down","move","up","cancel"].reduce((e,t)=>(e[`interactions:${t}`]=Ao,e),{})},Xe={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search(e){for(const t of Xe.methodOrder){const n=Xe[t](e);if(n)return n}return null},simulationResume({pointerType:e,eventType:t,eventTarget:n,scope:i}){if(!/down|start/i.test(t))return null;for(const o of i.interactions.list){let r=n;if(o.simulation&&o.simulation.allowResume&&o.pointerType===e)for(;r;){if(r===o.element)return o;r=Ct(r)}}return null},mouseOrPen({pointerId:e,pointerType:t,eventType:n,scope:i}){if(t!=="mouse"&&t!=="pen")return null;let o;for(const r of i.interactions.list)if(r.pointerType===t){if(r.simulation&&!qn(r,e))continue;if(r.interacting())return r;o||(o=r)}if(o)return o;for(const r of i.interactions.list)if(r.pointerType===t&&!(/down/i.test(n)&&r.simulation))return r;return null},hasPointer({pointerId:e,scope:t}){for(const n of t.interactions.list)if(qn(n,e))return n;return null},idle({pointerType:e,scope:t}){for(const n of t.interactions.list){if(n.pointers.length===1){const i=n.interactable;if(i&&!(i.options.gesture&&i.options.gesture.enabled))continue}else if(n.pointers.length>=2)continue;if(!n.interacting()&&e===n.pointerType)return n}return null}};function qn(e,t){return e.pointers.some(({id:n})=>n===t)}const Ho=Xe,Un=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function $o(e){const t={};for(const r of Un)t[r]=Vn(r,e);const n=vt.pEventTypes;let i;ct.PointerEvent?i=[{type:n.down,listener:o},{type:n.down,listener:t.pointerDown},{type:n.move,listener:t.pointerMove},{type:n.up,listener:t.pointerUp},{type:n.cancel,listener:t.pointerUp}]:i=[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:o},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}],i.push({type:"blur",listener(r){for(const s of e.interactions.list)s.documentBlur(r)}}),e.prevTouchTime=0,e.Interaction=class extends Do{get pointerMoveTolerance(){return e.interactions.pointerMoveTolerance}set pointerMoveTolerance(r){e.interactions.pointerMoveTolerance=r}_now(){return e.now()}},e.interactions={list:[],new(r){r.scopeFire=(a,l)=>e.fire(a,l);const s=new e.Interaction(r);return e.interactions.list.push(s),s},listeners:t,docEvents:i,pointerMoveTolerance:1};function o(){for(const r of e.interactions.list)if(!(!r.pointerIsDown||r.pointerType!=="touch"||r._interacting))for(const s of r.pointers)e.documents.some(({doc:a})=>Bt(a,s.downTarget))||r.removePointer(s.pointer,s.event)}e.usePlugin(Ro)}function Vn(e,t){return function(n){const i=t.interactions.list,o=xo(n),[r,s]=Gn(n),a=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(const l of n.changedTouches){const c=l,u=me(c),f={pointer:c,pointerId:u,pointerType:o,eventType:n.type,eventTarget:r,curEventTarget:s,scope:t},v=Kn(f);a.push([f.pointer,f.eventTarget,f.curEventTarget,v])}}else{let l=!1;if(!vt.supportsPointerEvent&&/mouse/.test(n.type)){for(let c=0;c<i.length&&!l;c++)l=i[c].pointerType!=="mouse"&&i[c].pointerIsDown;l=l||t.now()-t.prevTouchTime<500||n.timeStamp===0}if(!l){const c={pointer:n,pointerId:me(n),pointerType:o,eventType:n.type,curEventTarget:s,eventTarget:r,scope:t},u=Kn(c);a.push([c.pointer,c.eventTarget,c.curEventTarget,u])}}for(const[l,c,u,f]of a)f[e](l,n,c,u)}}function Kn(e){const{pointerType:t,scope:n}=e,o={interaction:Ho.search(e),searchDetails:e};return n.fire("interactions:find",o),o.interaction||n.interactions.new({pointerType:t})}function Ge({doc:e,scope:t,options:n},i){const{interactions:{docEvents:o},events:r}=t,s=r[i];t.browser.isIOS&&!n.events&&(n.events={passive:!1});for(const l in r.delegatedEvents)s(e,l,r.delegateListener),s(e,l,r.delegateUseCapture,!0);const a=n&&n.events;for(const{type:l,listener:c}of o)s(e,l,c,a)}const Bo={id:"core/interactions",install:$o,listeners:{"scope:add-document":e=>Ge(e,"add"),"scope:remove-document":e=>Ge(e,"remove"),"interactable:unset":({interactable:e},t)=>{for(let n=t.interactions.list.length-1;n>=0;n--){const i=t.interactions.list[n];i.interactable===e&&(i.stop(),t.fire("interactions:destroy",{interaction:i}),i.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(n,1))}}},onDocSignal:Ge,doOnInteractions:Vn,methodNames:Un};class Wo{constructor(){g(this,"id",`__interact_scope_${Math.floor(Math.random()*100)}`);g(this,"isInitialized",!1);g(this,"listenerMaps",[]);g(this,"browser",vt);g(this,"defaults",Gt(Nn));g(this,"Eventable",Bn);g(this,"actions",{map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}});g(this,"interactStatic",wo(this));g(this,"InteractEvent",We);g(this,"Interactable");g(this,"interactables",new Eo(this));g(this,"_win");g(this,"document");g(this,"window");g(this,"documents",[]);g(this,"_plugins",{list:[],map:{}});g(this,"onWindowUnload",t=>this.removeDocument(t.target));const t=this;this.Interactable=class extends So{get _defaults(){return t.defaults}set(n){return super.set(n),t.fire("interactable:set",{options:n,interactable:this}),this}unset(){super.unset();const n=t.interactables.list.indexOf(this);n<0||(super.unset(),t.interactables.list.splice(n,1),t.fire("interactable:unset",{interactable:this}))}}}addListeners(t,n){this.listenerMaps.push({id:n,map:t})}fire(t,n){for(const{map:{[t]:i}}of this.listenerMaps)if(!!i&&i(n,this,t)===!1)return!1}init(t){return this.isInitialized?this:Lo(this,t)}pluginIsInstalled(t){return this._plugins.map[t.id]||this._plugins.list.indexOf(t)!==-1}usePlugin(t,n){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,n),t.listeners&&t.before){let i=0;const o=this.listenerMaps.length,r=t.before.reduce((s,a)=>(s[a]=!0,s[Jn(a)]=!0,s),{});for(;i<o;i++){const s=this.listenerMaps[i].id;if(r[s]||r[Jn(s)])break}this.listenerMaps.splice(i,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}addDocument(t,n){if(this.getDocIndex(t)!==-1)return!1;const i=$t(t);n=n?_({},n):{},this.documents.push({doc:t,options:n}),this.events.documents.push(t),t!==this.document&&this.events.add(i,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:i,scope:this,options:n})}removeDocument(t){const n=this.getDocIndex(t),i=$t(t),o=this.documents[n].options;this.events.remove(i,"unload",this.onWindowUnload),this.documents.splice(n,1),this.events.documents.splice(n,1),this.fire("scope:remove-document",{doc:t,window:i,scope:this,options:o})}getDocIndex(t){for(let n=0;n<this.documents.length;n++)if(this.documents[n].doc===t)return n;return-1}getDocOptions(t){const n=this.getDocIndex(t);return n===-1?null:this.documents[n].options}now(){return(this.window.Date||Date).now()}}function Lo(e,t){return e.isInitialized=!0,m.window(t)&&Sn(t),ct.init(t),vt.init(t),qt.init(t),e.window=t,e.document=t.document,e.usePlugin(Bo),e.usePlugin(To),e}function Jn(e){return e&&e.replace(/\/.*$/,"")}const Zn=new Wo,Et=Zn.interactStatic,Fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:globalThis;Zn.init(Fo),Et.use(so);function No(e){const{defaults:t,actions:n}=e;e.autoScroll=k,k.now=()=>e.now(),n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults}const k={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start(e){k.isScrolling=!0,qt.cancel(k.i),e.autoScroll=k,k.interaction=e,k.prevTime=k.now(),k.i=qt.request(k.scroll)},stop(){k.isScrolling=!1,k.interaction&&(k.interaction.autoScroll=null),qt.cancel(k.i)},scroll(){const{interaction:e}=k,{interactable:t,element:n}=e,i=e.prepared.name,o=t.options[i].autoScroll,r=Qn(o.container,t,n),s=k.now(),a=(s-k.prevTime)/1e3,l=o.speed*a;if(l>=1){const c={x:k.x*l,y:k.y*l};if(c.x||c.y){const u=ti(r);m.window(r)?r.scrollBy(c.x,c.y):r&&(r.scrollLeft+=c.x,r.scrollTop+=c.y);const f=ti(r),v={x:f.x-u.x,y:f.y-u.y};(v.x||v.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:v,interaction:e,container:r})}k.prevTime=s}k.isScrolling&&(qt.cancel(k.i),k.i=qt.request(k.scroll))},check(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove({interaction:e,pointer:t}){if(!(e.interacting()&&k.check(e.interactable,e.prepared.name)))return;if(e.simulation){k.x=k.y=0;return}let n,i,o,r;const{interactable:s,element:a}=e,l=e.prepared.name,c=s.options[l].autoScroll,u=Qn(c.container,s,a);if(m.window(u))r=t.clientX<k.margin,n=t.clientY<k.margin,i=t.clientX>u.innerWidth-k.margin,o=t.clientY>u.innerHeight-k.margin;else{const f=Pe(u);r=t.clientX<f.left+k.margin,n=t.clientY<f.top+k.margin,i=t.clientX>f.right-k.margin,o=t.clientY>f.bottom-k.margin}k.x=i?1:r?-1:0,k.y=o?1:n?-1:0,k.isScrolling||(k.margin=c.margin,k.speed=c.speed,k.start(e))}};function Qn(e,t,n){return(m.string(e)?Wn(e,t,n):e)||$t(n)}function ti(e){return m.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}const jo={id:"auto-scroll",install:No,listeners:{"interactions:new":({interaction:e})=>{e.autoScroll=null},"interactions:destroy":({interaction:e})=>{e.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":e=>k.onInteractionMove(e)}};Et.use(jo);function Yo(e){const{actions:t,Interactable:n,defaults:i}=e;n.prototype.draggable=ve.draggable,t.map.drag=ve,t.methodDict.drag="draggable",i.actions.drag=ve.defaults}function qe({interaction:e}){if(e.prepared.name!=="drag")return;const t=e.prepared.axis;t==="x"?(e.coords.cur.page.y=e.coords.start.page.y,e.coords.cur.client.y=e.coords.start.client.y,e.coords.velocity.client.y=0,e.coords.velocity.page.y=0):t==="y"&&(e.coords.cur.page.x=e.coords.start.page.x,e.coords.cur.client.x=e.coords.start.client.x,e.coords.velocity.client.x=0,e.coords.velocity.page.x=0)}function ei({iEvent:e,interaction:t}){if(t.prepared.name!=="drag")return;const n=t.prepared.axis;if(n==="x"||n==="y"){const i=n==="x"?"y":"x";e.page[i]=t.coords.start.page[i],e.client[i]=t.coords.start.client[i],e.delta[i]=0}}const ve={id:"actions/drag",install:Yo,listeners:{"interactions:before-action-move":qe,"interactions:action-resume":qe,"interactions:action-move":ei,"auto-start:check":e=>{const{interaction:t,interactable:n,buttons:i}=e,o=n.options.drag;if(!(!(o&&o.enabled)||t.pointerIsDown&&/mouse|pointer/.test(t.pointerType)&&(i&n.options.drag.mouseButtons)===0))return e.action={name:"drag",axis:o.lockAxis==="start"?o.startAxis:o.lockAxis},!1}},draggable:function(t){return m.object(t)?(this.options.drag.enabled=t.enabled!==!1,this.setPerAction("drag",t),this.setOnEvents("drag",t),/^(xy|x|y|start)$/.test(t.lockAxis)&&(this.options.drag.lockAxis=t.lockAxis),/^(xy|x|y)$/.test(t.startAxis)&&(this.options.drag.startAxis=t.startAxis),this):m.bool(t)?(this.options.drag.enabled=t,this):this.options.drag},beforeMove:qe,move:ei,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor(){return"move"}},Xo=ve;Et.use(Xo);function Go(e){const{actions:t,browser:n,Interactable:i,defaults:o}=e;It.cursors=Ko(n),It.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(r){return Uo(this,r,e)},t.map.resize=It,t.methodDict.resize="resizable",o.actions.resize=It.defaults}function qo(e){const{interaction:t,interactable:n,element:i,rect:o,buttons:r}=e;if(!o)return;const s=_({},t.coords.cur.page),a=n.options.resize;if(!(!(a&&a.enabled)||t.pointerIsDown&&/mouse|pointer/.test(t.pointerType)&&(r&a.mouseButtons)===0)){if(m.object(a.edges)){const l={left:!1,right:!1,top:!1,bottom:!1};for(const c in l)l[c]=Vo(c,a.edges[c],s,t._latestPointer.eventTarget,i,o,a.margin||It.defaultMargin);l.left=l.left&&!l.right,l.top=l.top&&!l.bottom,(l.left||l.right||l.top||l.bottom)&&(e.action={name:"resize",edges:l})}else{const l=a.axis!=="y"&&s.x>o.right-It.defaultMargin,c=a.axis!=="x"&&s.y>o.bottom-It.defaultMargin;(l||c)&&(e.action={name:"resize",axes:(l?"x":"")+(c?"y":"")})}return e.action?!1:void 0}}function Uo(e,t,n){return m.object(t)?(e.options.resize.enabled=t.enabled!==!1,e.setPerAction("resize",t),e.setOnEvents("resize",t),m.string(t.axis)&&/^x$|^y$|^xy$/.test(t.axis)?e.options.resize.axis=t.axis:t.axis===null&&(e.options.resize.axis=n.defaults.actions.resize.axis),m.bool(t.preserveAspectRatio)?e.options.resize.preserveAspectRatio=t.preserveAspectRatio:m.bool(t.square)&&(e.options.resize.square=t.square),e):m.bool(t)?(e.options.resize.enabled=t,e):e.options.resize}function Vo(e,t,n,i,o,r,s){if(!t)return!1;if(t===!0){const a=m.number(r.width)?r.width:r.right-r.left,l=m.number(r.height)?r.height:r.bottom-r.top;if(s=Math.min(s,Math.abs((e==="left"||e==="right"?a:l)/2)),a<0&&(e==="left"?e="right":e==="right"&&(e="left")),l<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){const c=a>=0?r.left:r.right;return n.x<c+s}if(e==="top"){const c=l>=0?r.top:r.bottom;return n.y<c+s}if(e==="right")return n.x>(a>=0?r.right:r.left)-s;if(e==="bottom")return n.y>(l>=0?r.bottom:r.top)-s}return m.element(i)?m.element(t)?t===i:De(i,t,o):!1}function Ko(e){return e.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}function Jo({iEvent:e,interaction:t}){if(t.prepared.name!=="resize"||!t.prepared.edges)return;const n=e,i=t.rect;t._rects={start:_({},i),corrected:_({},i),previous:_({},i),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},n.edges=t.prepared.edges,n.rect=t._rects.corrected,n.deltaRect=t._rects.delta}function Zo({iEvent:e,interaction:t}){if(t.prepared.name!=="resize"||!t.prepared.edges)return;const n=e,o=t.interactable.options.resize.invert,r=o==="reposition"||o==="negate",s=t.rect,{start:a,corrected:l,delta:c,previous:u}=t._rects;if(_(u,l),r){if(_(l,s),o==="reposition"){if(l.top>l.bottom){const f=l.top;l.top=l.bottom,l.bottom=f}if(l.left>l.right){const f=l.left;l.left=l.right,l.right=f}}}else l.top=Math.min(s.top,a.bottom),l.bottom=Math.max(s.bottom,a.top),l.left=Math.min(s.left,a.right),l.right=Math.max(s.right,a.left);l.width=l.right-l.left,l.height=l.bottom-l.top;for(const f in l)c[f]=l[f]-u[f];n.edges=t.prepared.edges,n.rect=l,n.deltaRect=c}function Qo({iEvent:e,interaction:t}){if(t.prepared.name!=="resize"||!t.prepared.edges)return;const n=e;n.edges=t.prepared.edges,n.rect=t._rects.corrected,n.deltaRect=t._rects.delta}function ni({iEvent:e,interaction:t}){if(t.prepared.name!=="resize"||!t.resizeAxes)return;const n=t.interactable.options,i=e;n.resize.square?(t.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=t.resizeAxes,t.resizeAxes==="x"?i.delta.y=0:t.resizeAxes==="y"&&(i.delta.x=0))}const It={id:"actions/resize",before:["actions/drag"],install:Go,listeners:{"interactions:new":({interaction:e})=>{e.resizeAxes="xy"},"interactions:action-start":e=>{Jo(e),ni(e)},"interactions:action-move":e=>{Zo(e),ni(e)},"interactions:action-end":Qo,"auto-start:check":qo},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor({edges:e,axis:t,name:n}){const i=It.cursors;let o=null;if(t)o=i[n+t];else if(e){let r="";for(const s of["top","bottom","left","right"])e[s]&&(r+=s);o=i[r]}return o},defaultMargin:null},tr=It;Et.use(tr);const er=Object.freeze(Object.defineProperty({__proto__:null,edgeTarget:()=>{},elements:()=>{},grid:e=>{const t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(([i,o])=>i in e||o in e),n=(i,o)=>{const{range:r,limits:s={left:-1/0,right:1/0,top:-1/0,bottom:1/0},offset:a={x:0,y:0}}=e,l={range:r,grid:e,x:null,y:null};for(const[c,u]of t){const f=Math.round((i-a.x)/e[c]),v=Math.round((o-a.y)/e[u]);l[c]=Math.max(s.left,Math.min(s.right,f*e[c]+a.x)),l[u]=Math.max(s.top,Math.min(s.bottom,v*e[u]+a.y))}return l};return n.grid=e,n.coordFields=t,n}},Symbol.toStringTag,{value:"Module"})),nr={id:"snappers",install(e){const{interactStatic:t}=e;t.snappers=_(t.snappers||{},er),t.createSnapGrid=t.snappers.grid}};class ii{constructor(t){g(this,"states",[]);g(this,"startOffset",{left:0,right:0,top:0,bottom:0});g(this,"startDelta");g(this,"result");g(this,"endResult");g(this,"startEdges");g(this,"edges");g(this,"interaction");this.interaction=t,this.result=ye(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}start({phase:t},n){const{interaction:i}=this,o=ir(i);this.prepareStates(o),this.startEdges=_({},i.edges),this.edges=_({},this.startEdges),this.startOffset=or(i.rect,n),this.startDelta={x:0,y:0};const r=this.fillArg({phase:t,pageCoords:n,preEnd:!1});return this.result=ye(),this.startAll(r),this.result=this.setAll(r)}fillArg(t){const{interaction:n}=this;return t.interaction=n,t.interactable=n.interactable,t.element=n.element,t.rect||(t.rect=n.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}startAll(t){for(const n of this.states)n.methods.start&&(t.state=n,n.methods.start(t))}setAll(t){const{phase:n,preEnd:i,skipModifiers:o,rect:r,edges:s}=t;t.coords=_({},t.pageCoords),t.rect=_({},r),t.edges=_({},s);const a=o?this.states.slice(o):this.states,l=ye(t.coords,t.rect);for(const v of a){var c;const{options:x}=v,w=_({},t.coords);let E=null;(c=v.methods)!=null&&c.set&&this.shouldDo(x,i,n)&&(t.state=v,E=v.methods.set(t),$e(t.edges,t.rect,{x:t.coords.x-w.x,y:t.coords.y-w.y})),l.eventProps.push(E)}_(this.edges,t.edges),l.delta.x=t.coords.x-t.pageCoords.x,l.delta.y=t.coords.y-t.pageCoords.y,l.rectDelta.left=t.rect.left-r.left,l.rectDelta.right=t.rect.right-r.right,l.rectDelta.top=t.rect.top-r.top,l.rectDelta.bottom=t.rect.bottom-r.bottom;const u=this.result.coords,f=this.result.rect;if(u&&f){const v=l.rect.left!==f.left||l.rect.right!==f.right||l.rect.top!==f.top||l.rect.bottom!==f.bottom;l.changed=v||u.x!==l.coords.x||u.y!==l.coords.y}return l}applyToInteraction(t){const{interaction:n}=this,{phase:i}=t,o=n.coords.cur,r=n.coords.start,{result:s,startDelta:a}=this,l=s.delta;i==="start"&&_(this.startDelta,s.delta);for(const[f,v]of[[r,a],[o,l]])f.page.x+=v.x,f.page.y+=v.y,f.client.x+=v.x,f.client.y+=v.y;const{rectDelta:c}=this.result,u=t.rect||n.rect;u.left+=c.left,u.right+=c.right,u.top+=c.top,u.bottom+=c.bottom,u.width=u.right-u.left,u.height=u.bottom-u.top}setAndApply(t){const{interaction:n}=this,{phase:i,preEnd:o,skipModifiers:r}=t,s=this.setAll(this.fillArg({preEnd:o,phase:i,pageCoords:t.modifiedCoords||n.coords.cur.page}));if(this.result=s,!s.changed&&(!r||r<this.states.length)&&n.interacting())return!1;if(t.modifiedCoords){const{page:a}=n.coords.cur,l={x:t.modifiedCoords.x-a.x,y:t.modifiedCoords.y-a.y};s.coords.x+=l.x,s.coords.y+=l.y,s.delta.x+=l.x,s.delta.y+=l.y}this.applyToInteraction(t)}beforeEnd(t){const{interaction:n,event:i}=t,o=this.states;if(!o||!o.length)return;let r=!1;for(const s of o){t.state=s;const{options:a,methods:l}=s,c=l.beforeEnd&&l.beforeEnd(t);if(c)return this.endResult=c,!1;r=r||!r&&this.shouldDo(a,!0,t.phase,!0)}r&&n.move({event:i,preEnd:!0})}stop(t){const{interaction:n}=t;if(!this.states||!this.states.length)return;const i=_({states:this.states,interactable:n.interactable,element:n.element,rect:null},t);this.fillArg(i);for(const o of this.states)i.state=o,o.methods.stop&&o.methods.stop(i);this.states=null,this.endResult=null}prepareStates(t){this.states=[];for(let n=0;n<t.length;n++){const{options:i,methods:o,name:r}=t[n];this.states.push({options:i,methods:o,index:n,name:r})}return this.states}restoreInteractionCoords({interaction:{coords:t,rect:n,modification:i}}){if(!i.result)return;const{startDelta:o}=i,{delta:r,rectDelta:s}=i.result,a=[[t.start,o],[t.cur,r]];for(const[l,c]of a)l.page.x-=c.x,l.page.y-=c.y,l.client.x-=c.x,l.client.y-=c.y;n.left-=s.left,n.right-=s.right,n.top-=s.top,n.bottom-=s.bottom}shouldDo(t,n,i,o){return!(!t||t.enabled===!1||o&&!t.endOnly||t.endOnly&&!n||i==="start"&&!t.setStart)}copyFrom(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map(n=>Gt(n)),this.result=ye(_({},t.result.coords),_({},t.result.rect))}destroy(){for(const t in this)this[t]=null}}function ye(e,t){return{rect:t,coords:e,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function ir(e){const t=e.interactable.options[e.prepared.name],n=t.modifiers;return n&&n.length?n:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(i=>{const o=t[i];return o&&o.enabled&&{options:o,methods:o._methods}}).filter(i=>!!i)}function or(e,t){return e?{left:t.x-e.left,top:t.y-e.top,right:e.right-t.x,bottom:e.bottom-t.y}:{left:0,top:0,right:0,bottom:0}}function Dt(e,t){const{defaults:n}=e,i={start:e.start,set:e.set,beforeEnd:e.beforeEnd,stop:e.stop},o=r=>{const s=r||{};s.enabled=s.enabled!==!1;for(const l in n)l in s||(s[l]=n[l]);const a={options:s,methods:i,name:t,enable:()=>(s.enabled=!0,a),disable:()=>(s.enabled=!1,a)};return a};return t&&typeof t=="string"&&(o._defaults=n,o._methods=i),o}function Ue({iEvent:e,interaction:t}){const n=t.modification.result;n&&(e.modifiers=n.eventProps)}const rr={id:"modifiers/base",before:["actions"],install:e=>{e.defaults.perAction.modifiers=[]},listeners:{"interactions:new":({interaction:e})=>{e.modification=new ii(e)},"interactions:before-action-start":e=>{const{interaction:t}=e,n=e.interaction.modification;n.start(e,t.coords.start.page),t.edges=n.edges,n.applyToInteraction(e)},"interactions:before-action-move":e=>{const{interaction:t}=e,{modification:n}=t,i=n.setAndApply(e);return t.edges=n.edges,i},"interactions:before-action-end":e=>{const{interaction:t}=e,{modification:n}=t,i=n.beforeEnd(e);return t.edges=n.startEdges,i},"interactions:action-start":Ue,"interactions:action-move":Ue,"interactions:action-end":Ue,"interactions:after-action-start":e=>e.interaction.modification.restoreInteractionCoords(e),"interactions:after-action-move":e=>e.interaction.modification.restoreInteractionCoords(e),"interactions:stop":e=>e.interaction.modification.stop(e)}},sr={start(e){const{state:t,rect:n,edges:i,pageCoords:o}=e;let{ratio:r,enabled:s}=t.options;const{equalDelta:a,modifiers:l}=t.options;r==="preserve"&&(r=n.width/n.height),t.startCoords=_({},o),t.startRect=_({},n),t.ratio=r,t.equalDelta=a;const c=t.linkedEdges={top:i.top||i.left&&!i.bottom,left:i.left||i.top&&!i.right,bottom:i.bottom||i.right&&!i.top,right:i.right||i.bottom&&!i.left};if(t.xIsPrimaryAxis=!!(i.left||i.right),t.equalDelta){const f=(c.left?1:-1)*(c.top?1:-1);t.edgeSign={x:f,y:f}}else t.edgeSign={x:c.left?-1:1,y:c.top?-1:1};if(s!==!1&&_(i,c),!(l!=null&&l.length))return;const u=new ii(e.interaction);u.copyFrom(e.interaction.modification),u.prepareStates(l),t.subModification=u,u.startAll({...e})},set(e){const{state:t,rect:n,coords:i}=e,{linkedEdges:o}=t,r=_({},i),s=t.equalDelta?ar:lr;if(_(e.edges,o),s(t,t.xIsPrimaryAxis,i,n),!t.subModification)return null;const a=_({},n);$e(o,a,{x:i.x-r.x,y:i.y-r.y});const l=t.subModification.setAll({...e,rect:a,edges:o,pageCoords:i,prevCoords:i,prevRect:a}),{delta:c}=l;if(l.changed){const u=Math.abs(c.x)>Math.abs(c.y);s(t,u,l.coords,l.rect),_(i,l.coords)}return l.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ar({startCoords:e,edgeSign:t},n,i){n?i.y=e.y+(i.x-e.x)*t.y:i.x=e.x+(i.y-e.y)*t.x}function lr({startRect:e,startCoords:t,ratio:n,edgeSign:i},o,r,s){if(o){const a=s.width/n;r.y=t.y+(a-e.height)*i.y}else{const a=s.height*n;r.x=t.x+(a-e.width)*i.x}}const cr=Dt(sr,"aspectRatio"),oi=()=>{};oi._defaults={};const be=oi;function ur({rect:e,startOffset:t,state:n,interaction:i,pageCoords:o}){const{options:r}=n,{elementRect:s}=r,a=_({left:0,top:0,right:0,bottom:0},r.offset||{});if(e&&s){const l=Ft(r.restriction,i,o);if(l){const c=l.right-l.left-e.width,u=l.bottom-l.top-e.height;c<0&&(a.left+=c,a.right+=c),u<0&&(a.top+=u,a.bottom+=u)}a.left+=t.left-e.width*s.left,a.top+=t.top-e.height*s.top,a.right+=t.right-e.width*(1-s.right),a.bottom+=t.bottom-e.height*(1-s.bottom)}n.offset=a}function fr({coords:e,interaction:t,state:n}){const{options:i,offset:o}=n,r=Ft(i.restriction,t,e);if(!r)return;const s=co(r);e.x=Math.max(Math.min(s.right-o.right,e.x),s.left+o.left),e.y=Math.max(Math.min(s.bottom-o.bottom,e.y),s.top+o.top)}function Ft(e,t,n){return m.func(e)?Qt(e,t.interactable,t.element,[n.x,n.y,t]):Qt(e,t.interactable,t.element)}const xe={start:ur,set:fr,defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},dr=Dt(xe,"restrict"),ri={top:1/0,left:1/0,bottom:-1/0,right:-1/0},si={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function hr({interaction:e,startOffset:t,state:n}){const{options:i}=n;let o;if(i){const r=Ft(i.offset,e,e.coords.start.page);o=he(r)}o=o||{x:0,y:0},n.offset={top:o.y+t.top,left:o.x+t.left,bottom:o.y-t.bottom,right:o.x-t.right}}function pr({coords:e,edges:t,interaction:n,state:i}){const{offset:o,options:r}=i;if(!t)return;const s=_({},e),a=Ft(r.inner,n,s)||{},l=Ft(r.outer,n,s)||{};ai(a,ri),ai(l,si),t.top?e.y=Math.min(Math.max(l.top+o.top,s.y),a.top+o.top):t.bottom&&(e.y=Math.max(Math.min(l.bottom+o.bottom,s.y),a.bottom+o.bottom)),t.left?e.x=Math.min(Math.max(l.left+o.left,s.x),a.left+o.left):t.right&&(e.x=Math.max(Math.min(l.right+o.right,s.x),a.right+o.right))}function ai(e,t){for(const n of["top","left","bottom","right"])n in e||(e[n]=t[n]);return e}const ne={noInner:ri,noOuter:si,start:hr,set:pr,defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},gr=Dt(ne,"restrictEdges"),mr=_({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(e){}},xe.defaults),vr={start:xe.start,set:xe.set,defaults:mr},yr=Dt(vr,"restrictRect"),br={width:-1/0,height:-1/0},xr={width:1/0,height:1/0};function wr(e){return ne.start(e)}function Sr(e){const{interaction:t,state:n,rect:i,edges:o}=e,{options:r}=n;if(!o)return;const s=Ln(Ft(r.min,t,e.coords))||br,a=Ln(Ft(r.max,t,e.coords))||xr;n.options={endOnly:r.endOnly,inner:_({},ne.noInner),outer:_({},ne.noOuter)},o.top?(n.options.inner.top=i.bottom-s.height,n.options.outer.top=i.bottom-a.height):o.bottom&&(n.options.inner.bottom=i.top+s.height,n.options.outer.bottom=i.top+a.height),o.left?(n.options.inner.left=i.right-s.width,n.options.outer.left=i.right-a.width):o.right&&(n.options.inner.right=i.left+s.width,n.options.outer.right=i.left+a.width),ne.set(e),n.options=r}const Er=Dt({start:wr,set:Sr,defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize");function Ir(e){const{interaction:t,interactable:n,element:i,rect:o,state:r,startOffset:s}=e,{options:a}=r,l=a.offsetWithOrigin?Tr(e):{x:0,y:0};let c;if(a.offset==="startCoords")c={x:t.coords.start.page.x,y:t.coords.start.page.y};else{const f=Qt(a.offset,n,i,[t]);c=he(f)||{x:0,y:0},c.x+=l.x,c.y+=l.y}const{relativePoints:u}=a;r.offsets=o&&u&&u.length?u.map((f,v)=>({index:v,relativePoint:f,x:s.left-o.width*f.x+c.x,y:s.top-o.height*f.y+c.y})):[{index:0,relativePoint:null,x:c.x,y:c.y}]}function zr(e){const{interaction:t,coords:n,state:i}=e,{options:o,offsets:r}=i,s=Be(t.interactable,t.element,t.prepared.name),a=_({},n),l=[];o.offsetWithOrigin||(a.x-=s.x,a.y-=s.y);for(const u of r){const f=a.x-u.x,v=a.y-u.y;for(let x=0,w=o.targets.length;x<w;x++){const E=o.targets[x];let T;m.func(E)?T=E(f,v,t._proxy,u,x):T=E,T&&l.push({x:(m.number(T.x)?T.x:f)+u.x,y:(m.number(T.y)?T.y:v)+u.y,range:m.number(T.range)?T.range:o.range,source:E,index:x,offset:u})}}const c={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}};for(const u of l){const f=u.range,v=u.x-a.x,x=u.y-a.y,w=pe(v,x);let E=w<=f;f===1/0&&c.inRange&&c.range!==1/0&&(E=!1),(!c.target||(E?c.inRange&&f!==1/0?w/f<c.distance/c.range:f===1/0&&c.range!==1/0||w<c.distance:!c.inRange&&w<c.distance))&&(c.target=u,c.distance=w,c.range=f,c.inRange=E,c.delta.x=v,c.delta.y=x)}return c.inRange&&(n.x=c.target.x,n.y=c.target.y),i.closest=c,c}function Tr(e){const{element:t}=e.interaction;return he(Qt(e.state.options.origin,null,null,[t]))||Be(e.interactable,t,e.interaction.prepared.name)}const Ve={start:Ir,set:zr,defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},Mr=Dt(Ve,"snap");function _r(e){const{state:t,edges:n}=e,{options:i}=t;if(!n)return null;e.state={options:{targets:null,relativePoints:[{x:n.left?0:1,y:n.top?0:1}],offset:i.offset||"self",origin:{x:0,y:0},range:i.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],Ve.start(e),t.offsets=e.state.offsets,e.state=t}function Cr(e){const{interaction:t,state:n,coords:i}=e,{options:o,offsets:r}=n,s={x:i.x-r[0].x,y:i.y-r[0].y};n.options=_({},o),n.options.targets=[];for(const l of o.targets||[]){let c;if(m.func(l)?c=l(s.x,s.y,t):c=l,!!c){for(const[u,f]of n.targetFields)if(u in c||f in c){c.x=c[u],c.y=c[f];break}n.options.targets.push(c)}}const a=Ve.set(e);return n.options=o,a}const we={start:_r,set:Cr,defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},Dr=Dt(we,"snapSize");function Pr(e){const{edges:t}=e;return t?(e.state.targetFields=e.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],we.start(e)):null}const kr={start:Pr,set:we.set,defaults:_(Gt(we.defaults),{targets:null,range:null,offset:{x:0,y:0}})},Ar=Dt(kr,"snapEdges"),Ke={aspectRatio:cr,restrictEdges:gr,restrict:dr,restrictRect:yr,restrictSize:Er,snapEdges:Ar,snap:Mr,snapSize:Dr,spring:be,avoid:be,transform:be,rubberband:be},Or={id:"modifiers",install(e){const{interactStatic:t}=e;e.usePlugin(rr),e.usePlugin(nr),t.modifiers=Ke;for(const n in Ke){const{_defaults:i,_methods:o}=Ke[n];i._methods=o,e.defaults.perAction[n]=i}}};Et.use(Or);const Rr={};var Vt;(function(e){e.touchAction="touchAction",e.boxSizing="boxSizing",e.noListeners="noListeners"})(Vt||(Vt={}));const li="[interact.js] ",Je={touchAction:"https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action",boxSizing:"https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing"},Hr=!1;function $r(e,{logger:t}={}){const{Interactable:n,defaults:i}=e;e.logger=t||console,i.base.devTools={ignore:{}},n.prototype.devTools=function(o){return o?(_(this.options.devTools,o),this):this.options.devTools},e.usePlugin(Rr)}const ci=[{name:Vt.touchAction,perform({element:e}){return!Br(e,"touchAction",/pan-|pinch|none/)},getInfo({element:e}){return[e,Je.touchAction]},text:`Consider adding CSS "touch-action: none" to this element
`},{name:Vt.boxSizing,perform(e){const{element:t}=e;return e.prepared.name==="resize"&&t instanceof ct.HTMLElement&&!ui(t,"boxSizing",/border-box/)},text:'Consider adding CSS "box-sizing: border-box" to this resizable element',getInfo({element:e}){return[e,Je.boxSizing]}},{name:Vt.noListeners,perform(e){const t=e.prepared.name;return!(e.interactable.events.types[`${t}move`]||[]).length},getInfo(e){return[e.prepared.name,e.interactable]},text:"There are no listeners set for this action"}];function ui(e,t,n){const i=e.style[t]||_t.getComputedStyle(e)[t];return n.test((i||"").toString())}function Br(e,t,n){let i=e;for(;m.element(i);){if(ui(i,t,n))return!0;i=Ct(i)}return!1}const fi="dev-tools",Wr=Hr?{id:fi,install:()=>{}}:{id:fi,install:$r,listeners:{"interactions:action-start":({interaction:e},t)=>{for(const n of ci){const i=e.interactable&&e.interactable.options;!(i&&i.devTools&&i.devTools.ignore[n.name])&&n.perform(e)&&t.logger.warn(li+n.text,...n.getInfo(e))}}},checks:ci,CheckName:Vt,links:Je,prefix:li};Et.use(Wr);function Lr(){const{appContext:e,proxy:t}=h.getCurrentInstance(),n=e.config.globalProperties;return{proxy:t,appContext:e,globalProperties:n}}const Fr={name:"GridItem"},Ze=h.defineComponent({...Fr,props:{isDraggable:{type:[Boolean,null],default:null},isResizable:{type:[Boolean,null],default:null},isBounded:{type:[Boolean,null],default:null},static:{type:Boolean,default:!1},minH:{default:1},minW:{default:1},maxH:{default:1/0},maxW:{default:1/0},x:{},y:{},w:{},h:{},i:{},dragIgnoreFrom:{default:"a, button"},dragAllowFrom:{default:null},resizeIgnoreFrom:{default:"a, button"},preserveAspectRatio:{type:Boolean,default:!1},dragOption:{default:()=>({})},resizeOption:{default:()=>({})}},emits:["container-resized","resize","resized","move","moved","dragging","dragend"],setup(e,{expose:t,emit:n}){const i=e,{proxy:o}=Lr(),r=o==null?void 0:o.$parent,s=h.inject("eventBus"),a=h.ref({}),l=h.ref(1),c=h.ref(100),u=h.ref(30),f=h.ref([10,10]),v=h.ref(1/0),x=h.ref(null),w=h.ref(null),E=h.ref(1),T=h.ref(!0),H=h.ref(!0),M=h.ref(!1),D=h.ref(null),y=h.ref(!1),d=h.ref(null),R=h.ref(NaN),S=h.ref(NaN),F=h.ref(NaN),V=h.ref(NaN),A=h.ref({}),K=h.ref(!1),b=h.ref(!1),P=h.ref(!1),B=h.ref(null),j=h.ref(null),U=h.ref(null),J=h.ref(null),C=h.ref(i.x),Z=h.ref(i.y),nt=h.ref(i.w),Q=h.ref(i.h),st=h.ref(null),X=h.ref(null),Se=h.computed(()=>w.value&&!i.static),nn=h.computed(()=>(x.value||w.value)&&!i.static),on=h.computed(()=>navigator.userAgent.toLowerCase().indexOf("android")!==-1),ut=h.computed(()=>r!=null&&r.isMirrored?!K.value:K.value),Ee=h.computed(()=>({"vue-resizable":Se.value,static:i.static,resizing:y.value,"vue-draggable-dragging":M.value,cssTransforms:T.value,"render-rtl":ut.value,"disable-userselect":M.value,"no-touch":on.value&&nn.value})),z=h.computed(()=>ut.value?"vue-resizable-handle vue-rtl-resizable-handle":"vue-resizable-handle");h.watch(()=>i.isDraggable,p=>{x.value=p}),h.watch(()=>i.static,()=>{ze(),lt()}),h.watch(x,()=>{ze()}),h.watch(()=>i.isResizable,p=>{w.value=p}),h.watch(()=>i.isBounded,p=>{st.value=p}),h.watch(w,()=>{lt()}),h.watch(u,()=>{tt(),dt()}),h.watch(l,()=>{lt(),tt(),dt()}),h.watch(c,()=>{lt(),tt()}),h.watch(()=>i.x,p=>{C.value=p,tt()}),h.watch(()=>i.y,p=>{Z.value=p,tt()}),h.watch(()=>i.h,p=>{Q.value=p,tt()}),h.watch(()=>i.w,p=>{nt.value=p,tt()}),h.watch(ut,()=>{lt(),tt()}),h.watch(()=>i.minH,()=>{lt()}),h.watch(()=>i.maxH,()=>{lt()}),h.watch(()=>i.minW,()=>{lt()}),h.watch(()=>i.maxW,()=>{lt()}),h.watch(()=>r==null?void 0:r.margin,p=>{!p||p[0]==f.value[0]&&p[1]==f.value[1]||(f.value=p.map(I=>Number(I)),tt(),dt())});function $(p){Ot(p)}function G(p){wt()}function ft(p){i.isDraggable===null&&(x.value=p)}function yt(p){i.isResizable===null&&(w.value=p)}function zt(p){i.isBounded===null&&(st.value=p)}function Tt(p){E.value=p}function ot(p){u.value=p}function W(p){v.value=p}function at(){K.value=bn()==="rtl",wt()}function bt(p){const I=p.toString();l.value=parseInt(I)}s.on("updateWidth",$),s.on("compact",G),s.on("setDraggable",ft),s.on("setResizable",yt),s.on("setBounded",zt),s.on("setTransformScale",Tt),s.on("setRowHeight",ot),s.on("setMaxRows",W),s.on("directionchange",at),s.on("setColNum",bt),K.value=bn()==="rtl",h.onBeforeUnmount(()=>{s.off("updateWidth",$),s.off("compact",G),s.off("setDraggable",ft),s.off("setResizable",yt),s.off("setBounded",zt),s.off("setTransformScale",Tt),s.off("setRowHeight",ot),s.off("setMaxRows",W),s.off("directionchange",at),s.off("setColNum",bt),X.value&&X.value.unset()}),h.onMounted(()=>{(r==null?void 0:r.responsive)&&r.lastBreakpoint?l.value=Ce(r.lastBreakpoint,r==null?void 0:r.cols):l.value=r==null?void 0:r.colNum,u.value=r==null?void 0:r.rowHeight,c.value=(r==null?void 0:r.width)!==null?r==null?void 0:r.width:100,f.value=(r==null?void 0:r.margin)!==void 0?r.margin:[10,10],v.value=r==null?void 0:r.maxRows,i.isDraggable===null?x.value=r==null?void 0:r.isDraggable:x.value=i.isDraggable,i.isResizable===null?w.value=r==null?void 0:r.isResizable:w.value=i.isResizable,i.isBounded===null?st.value=r==null?void 0:r.isBounded:st.value=i.isBounded,E.value=r==null?void 0:r.transformScale,T.value=r==null?void 0:r.useCssTransforms,H.value=r==null?void 0:r.useStyleCursor,tt()});function tt(){var L,Y,O,q,jt;i.x+i.w>l.value?(C.value=0,nt.value=i.w>l.value?l.value:i.w):(C.value=i.x,nt.value=i.w);let p=xt(C.value,Z.value,nt.value,Q.value);M.value&&(p.top=(L=D.value)==null?void 0:L.top,ut.value?p.right=(Y=D.value)==null?void 0:Y.left:p.left=(O=D.value)==null?void 0:O.left),y.value&&(p.width=(q=d.value)==null?void 0:q.width,p.height=(jt=d.value)==null?void 0:jt.height);let I;T.value?ut.value?I=Mi(p.top,p.right,p.width,p.height):I=Ti(p.top,p.left,p.width,p.height):ut.value?I=Ci(p.top,p.right,p.width,p.height):I=_i(p.top,p.left,p.width,p.height),A.value=I}function dt(){let p={};for(let I of["width","height"]){let Y=A.value[I].match(/^(\d+)px$/);if(!Y)return;p[I]=Y[1]}n("container-resized",i.i,i.h,i.w,p.height,p.width)}function At(p){var I,L,Y;{if(i.static)return;const O=gn(p);if(O==null)return;const{x:q,y:jt}=O,it={width:0,height:0};let N;switch(p.type){case"resizestart":{lt(),B.value=nt.value,j.value=Q.value,N=xt(C.value,Z.value,nt.value,Q.value),it.width=N.width,it.height=N.height,d.value=it,y.value=!0;break}case"resizemove":{const ht=mn(F.value,V.value,q,jt);ut.value?it.width=Number((I=d.value)==null?void 0:I.width)-ht.deltaX/E.value:it.width=Number((L=d.value)==null?void 0:L.width)+ht.deltaX/E.value,it.height=Number((Y=d.value)==null?void 0:Y.height)+ht.deltaY/E.value,d.value=it;break}case"resizeend":{N=xt(C.value,Z.value,nt.value,Q.value),it.width=N.width,it.height=N.height,d.value=null,y.value=!1;break}}N=mt(it.height,it.width),N.w<i.minW&&(N.w=i.minW),N.w>i.maxW&&(N.w=i.maxW),N.h<i.minH&&(N.h=i.minH),N.h>i.maxH&&(N.h=i.maxH),N.h<1&&(N.h=1),N.w<1&&(N.w=1),F.value=q,V.value=jt,(nt.value!==N.w||Q.value!==N.h)&&n("resize",i.i,N.h,N.w,it.height,it.width),p.type==="resizeend"&&(B.value!==nt.value||j.value!==Q.value)&&n("resized",i.i,N.h,N.w,it.height,it.width);const Te={eventType:p.type,i:i.i,x:C.value,y:Z.value,h:N.h,w:N.w};s.emit("resizeEvent",Te)}}function Ie(p){var it,N,Te;if(i.static||y.value)return;const I=gn(p);if(I===null)return;const{x:L,y:Y}=I;let O={top:0,left:0};switch(p.type){case"dragstart":{U.value=C.value,J.value=Z.value;const ht=p.target;let Rt=ht.offsetParent.getBoundingClientRect(),Mt=ht.getBoundingClientRect();const le=Mt.left/E.value,ce=Rt.left/E.value,rn=Mt.right/E.value,sn=Rt.right/E.value,an=Mt.top/E.value,ln=Rt.top/E.value;ut.value?O.left=(rn-sn)*-1:O.left=le-ce,O.top=an-ln,D.value=O,M.value=!0;break}case"dragend":{if(!M.value)return;n("dragend",p,i.i);const ht=p.target;let Rt=ht.offsetParent.getBoundingClientRect(),Mt=ht.getBoundingClientRect();const le=Mt.left/E.value,ce=Rt.left/E.value,rn=Mt.right/E.value,sn=Rt.right/E.value,an=Mt.top/E.value,ln=Rt.top/E.value;ut.value?O.left=(rn-sn)*-1:O.left=le-ce,O.top=an-ln,D.value=null,M.value=!1;break}case"dragmove":{n("dragging",p,i.i);const ht=mn(R.value,S.value,L,Y);if(ut.value?O.left=Number((it=D.value)==null?void 0:it.left)-ht.deltaX/E.value:O.left=Number((N=D.value)==null?void 0:N.left)+ht.deltaX/E.value,O.top=Number((Te=D.value)==null?void 0:Te.top)+ht.deltaY/E.value,st.value){const Mt=p.target.offsetParent.clientHeight-re(i.h,u.value,f.value[1]);O.top=et(O.top,0,Mt);const le=Nt(),ce=c.value-re(i.w,le,f.value[0]);O.left=et(O.left,0,ce)}D.value=O;break}}let q;ut.value,q=Kt(O.top,O.left),R.value=L,S.value=Y,(C.value!==q.x||Z.value!==q.y)&&n("move",i.i,q.x,q.y),p.type==="dragend"&&(U.value!==C.value||J.value!==Z.value)&&n("moved",i.i,q.x,q.y);const jt={eventType:p.type,i:i.i,x:q.x,y:q.y,h:Q.value,w:nt.value};s.emit("dragEvent",jt)}function xt(p,I,L,Y){const O=Nt();let q;return ut.value?q={right:Math.round(O*p+(p+1)*f.value[0]),top:Math.round(u.value*I+(I+1)*f.value[1]),width:L===1/0?L:Math.round(O*L+Math.max(0,L-1)*f.value[0]),height:Y===1/0?Y:Math.round(u.value*Y+Math.max(0,Y-1)*f.value[1])}:q={left:Math.round(O*p+(p+1)*f.value[0]),top:Math.round(u.value*I+(I+1)*f.value[1]),width:L===1/0?L:Math.round(O*L+Math.max(0,L-1)*f.value[0]),height:Y===1/0?Y:Math.round(u.value*Y+Math.max(0,Y-1)*f.value[1])},q}function Kt(p,I){const L=Nt();let Y=Math.round((I-f.value[0])/(L+f.value[0])),O=Math.round((p-f.value[1])/(u.value+f.value[1]));return Y=Math.max(Math.min(Y,l.value-nt.value),0),O=Math.max(Math.min(O,v.value-Q.value),0),{x:Y,y:O}}function Nt(){return(c.value-f.value[0]*(l.value+1))/l.value}function re(p,I,L){return Number.isFinite(p)?Math.round(I*p+Math.max(0,p-1)*L):p}function et(p,I,L){return Math.max(Math.min(p,L),I)}function mt(p,I,L=!1){const Y=Nt();let O=Math.round((I+f.value[0])/(Y+f.value[0])),q=0;return L?q=Math.ceil((p+f.value[1])/(u.value+f.value[1])):q=Math.round((p+f.value[1])/(u.value+f.value[1])),O=Math.max(Math.min(O,l.value-C.value),0),q=Math.max(Math.min(q,v.value-Z.value),0),{w:O,h:q}}function Ot(p,I){c.value=p,I!=null&&(l.value=I)}function wt(p){tt()}function ze(){if((X.value===null||X.value===void 0)&&(X.value=Et(a.value),H.value||X.value.styleCursor(!1)),x.value&&!i.static){const p={ignoreFrom:i.dragIgnoreFrom,allowFrom:i.dragAllowFrom,...i.dragOption};X.value.draggable(p),b.value||(b.value=!0,X.value.on("dragstart dragmove dragend",function(I){Ie(I)}))}else X.value.draggable({enabled:!1})}function lt(){if((X.value===null||X.value===void 0)&&(X.value=Et(a.value),H.value||X.value.styleCursor(!1)),w.value&&!i.static){let p=xt(0,0,i.maxW,i.maxH),I=xt(0,0,i.minW,i.minH);const L={edges:{left:!1,right:"."+z.value.trim().replace(" ","."),bottom:"."+z.value.trim().replace(" ","."),top:!1},ignoreFrom:i.resizeIgnoreFrom,restrictSize:{min:{height:I.height*E.value,width:I.width*E.value},max:{height:p.height*E.value,width:p.width*E.value}},...i.resizeOption};i.preserveAspectRatio&&(L.modifiers=[Et.modifiers.aspectRatio({ratio:"preserve"})]),X.value.resizable(L),P.value||(P.value=!0,X.value.on("resizestart resizemove resizeend",function(Y){At(Y)}))}else X.value.resizable({enabled:!1})}const se=h.useSlots();function ae(){B.value=nt.value,j.value=Q.value;let p=se==null?void 0:se.default[0].elm.getBoundingClientRect(),I=mt(p.height,p.width,!0);if(I.w<i.minW&&(I.w=i.minW),I.w>i.maxW&&(I.w=i.maxW),I.h<i.minH&&(I.h=i.minH),I.h>i.maxH&&(I.h=i.maxH),I.h<1&&(I.h=1),I.w<1&&(I.w=1),(nt.value!==I.w||Q.value!==I.h)&&n("resize",i.i,I.h,I.w,p.height,p.width),B.value!==I.w||j.value!==I.h){n("resized",i.i,I.h,I.w,p.height,p.width);const L={eventType:"resizeend",i:i.i,x:C.value,y:Z.value,h:I.h,w:I.w};s.emit("resizeEvent",L)}}return t({autoSize:ae,calcXY:Kt,dragging:D,...i}),(p,I)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"this$refsItem",ref:a,class:h.normalizeClass(["vue-grid-item",Ee.value]),style:h.normalizeStyle(A.value)},[h.renderSlot(p.$slots,"default",{style:h.normalizeStyle(A.value)}),Se.value?(h.openBlock(),h.createElementBlock("span",{key:0,ref:"handle",class:h.normalizeClass(z.value)},null,2)):h.createCommentVNode("",!0)],6))}}),js="";function Nr(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map(function(o){o(n)}),(i=e.get("*"))&&i.slice().map(function(o){o(t,n)})}}}var Qe={exports:{}},jr=Qe.exports={};jr.forEach=function(e,t){for(var n=0;n<e.length;n++){var i=t(e[n]);if(i)return i}};var Yr=function(e){var t=e.stateHandler.getState;function n(s){var a=t(s);return a&&!!a.isDetectable}function i(s){t(s).isDetectable=!0}function o(s){return!!t(s).busy}function r(s,a){t(s).busy=!!a}return{isDetectable:n,markAsDetectable:i,isBusy:o,markBusy:r}},Xr=function(e){var t={};function n(s){var a=e.get(s);return a===void 0?[]:t[a]||[]}function i(s,a){var l=e.get(s);t[l]||(t[l]=[]),t[l].push(a)}function o(s,a){for(var l=n(s),c=0,u=l.length;c<u;++c)if(l[c]===a){l.splice(c,1);break}}function r(s){var a=n(s);!a||(a.length=0)}return{get:n,add:i,removeListener:o,removeAllListeners:r}},Gr=function(){var e=1;function t(){return e++}return{generate:t}},qr=function(e){var t=e.idGenerator,n=e.stateHandler.getState;function i(r){var s=n(r);return s&&s.id!==void 0?s.id:null}function o(r){var s=n(r);if(!s)throw new Error("setId required the element to have a resize detection state.");var a=t.generate();return s.id=a,a}return{get:i,set:o}},Ur=function(e){function t(){}var n={log:t,warn:t,error:t};if(!e&&window.console){var i=function(o,r){o[r]=function(){var a=console[r];if(a.apply)a.apply(console,arguments);else for(var l=0;l<arguments.length;l++)a(arguments[l])}};i(n,"log"),i(n,"warn"),i(n,"error")}return n},tn={exports:{}},di=tn.exports={};di.isIE=function(e){function t(){var i=navigator.userAgent.toLowerCase();return i.indexOf("msie")!==-1||i.indexOf("trident")!==-1||i.indexOf(" edge/")!==-1}if(!t())return!1;if(!e)return!0;var n=function(){var i,o=3,r=document.createElement("div"),s=r.getElementsByTagName("i");do r.innerHTML="<!--[if gt IE "+ ++o+"]><i></i><![endif]-->";while(s[0]);return o>4?o:i}();return e===n},di.isLegacyOpera=function(){return!!window.opera};var hi={exports:{}},Vr=hi.exports={};Vr.getOption=Kr;function Kr(e,t,n){var i=e[t];return i==null&&n!==void 0?n:i}var pi=hi.exports,Jr=function(t){t=t||{};var n=t.reporter,i=pi.getOption(t,"async",!0),o=pi.getOption(t,"auto",!0);o&&!i&&(n&&n.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),i=!0);var r=gi(),s,a=!1;function l(w,E){!a&&o&&i&&r.size()===0&&f(),r.add(w,E)}function c(){for(a=!0;r.size();){var w=r;r=gi(),w.process()}a=!1}function u(w){a||(w===void 0&&(w=i),s&&(v(s),s=null),w?f():c())}function f(){s=x(c)}function v(w){var E=clearTimeout;return E(w)}function x(w){var E=function(T){return setTimeout(T,0)};return E(w)}return{add:l,force:u}};function gi(){var e={},t=0,n=0,i=0;function o(a,l){l||(l=a,a=0),a>n?n=a:a<i&&(i=a),e[a]||(e[a]=[]),e[a].push(l),t++}function r(){for(var a=i;a<=n;a++)for(var l=e[a],c=0;c<l.length;c++){var u=l[c];u()}}function s(){return t}return{add:o,process:r,size:s}}var en="_erd";function Zr(e){return e[en]={},mi(e)}function mi(e){return e[en]}function Qr(e){delete e[en]}var ts={initState:Zr,getState:mi,cleanState:Qr},ie=tn.exports,es=function(e){e=e||{};var t=e.reporter,n=e.batchProcessor,i=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function o(c,u){function f(){u(c)}if(ie.isIE(8))i(c).object={proxy:f},c.attachEvent("onresize",f);else{var v=a(c);if(!v)throw new Error("Element is not detectable by this strategy.");v.contentDocument.defaultView.addEventListener("resize",f)}}function r(c){var u=e.important?" !important; ":"; ";return(c.join(u)+u).trim()}function s(c,u,f){f||(f=u,u=c,c=null),c=c||{},c.debug;function v(x,w){var E=r(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),T=!1,H=window.getComputedStyle(x),M=x.offsetWidth,D=x.offsetHeight;i(x).startSize={width:M,height:D};function y(){function d(){if(H.position==="static"){x.style.setProperty("position","relative",c.important?"important":"");var F=function(V,A,K,b){function P(j){return j.replace(/[^-\d\.]/g,"")}var B=K[b];B!=="auto"&&P(B)!=="0"&&(V.warn("An element that is positioned static has style."+b+"="+B+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+b+" will be set to 0. Element: ",A),A.style.setProperty(b,"0",c.important?"important":""))};F(t,x,H,"top"),F(t,x,H,"right"),F(t,x,H,"bottom"),F(t,x,H,"left")}}function R(){T||d();function F(A,K){if(!A.contentDocument){var b=i(A);b.checkForObjectDocumentTimeoutId&&window.clearTimeout(b.checkForObjectDocumentTimeoutId),b.checkForObjectDocumentTimeoutId=setTimeout(function(){b.checkForObjectDocumentTimeoutId=0,F(A,K)},100);return}K(A.contentDocument)}var V=this;F(V,function(K){w(x)})}H.position!==""&&(d(),T=!0);var S=document.createElement("object");S.style.cssText=E,S.tabIndex=-1,S.type="text/html",S.setAttribute("aria-hidden","true"),S.onload=R,ie.isIE()||(S.data="about:blank"),i(x)&&(x.appendChild(S),i(x).object=S,ie.isIE()&&(S.data="about:blank"))}n?n.add(y):y()}ie.isIE(8)?f(u):v(u,f)}function a(c){return i(c).object}function l(c){if(!!i(c)){var u=a(c);!u||(ie.isIE(8)?c.detachEvent("onresize",u.proxy):c.removeChild(u),i(c).checkForObjectDocumentTimeoutId&&window.clearTimeout(i(c).checkForObjectDocumentTimeoutId),delete i(c).object)}}return{makeDetectable:s,addListener:o,uninstall:l}},ns=Qe.exports.forEach,is=function(e){e=e||{};var t=e.reporter,n=e.batchProcessor,i=e.stateHandler.getState;e.stateHandler.hasState;var o=e.idHandler;if(!n)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var r=u(),s="erd_scroll_detection_scrollbar_style",a="erd_scroll_detection_container";function l(y){f(y,s,a)}l(window.document);function c(y){var d=e.important?" !important; ":"; ";return(y.join(d)+d).trim()}function u(){var y=500,d=500,R=document.createElement("div");R.style.cssText=c(["position: absolute","width: "+y*2+"px","height: "+d*2+"px","visibility: hidden","margin: 0","padding: 0"]);var S=document.createElement("div");S.style.cssText=c(["position: absolute","width: "+y+"px","height: "+d+"px","overflow: scroll","visibility: none","top: "+-y*3+"px","left: "+-d*3+"px","visibility: hidden","margin: 0","padding: 0"]),S.appendChild(R),document.body.insertBefore(S,document.body.firstChild);var F=y-S.clientWidth,V=d-S.clientHeight;return document.body.removeChild(S),{width:F,height:V}}function f(y,d,R){function S(K,b){b=b||function(B){y.head.appendChild(B)};var P=y.createElement("style");return P.innerHTML=K,P.id=d,b(P),P}if(!y.getElementById(d)){var F=R+"_animation",V=R+"_animation_active",A=`/* Created by the element-resize-detector library. */
`;A+="."+R+" > div::-webkit-scrollbar { "+c(["display: none"])+` }

`,A+="."+V+" { "+c(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+F,"animation-name: "+F])+` }
`,A+="@-webkit-keyframes "+F+` { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }
`,A+="@keyframes "+F+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",S(A)}}function v(y){y.className+=" "+a+"_animation_active"}function x(y,d,R){if(y.addEventListener)y.addEventListener(d,R);else if(y.attachEvent)y.attachEvent("on"+d,R);else return t.error("[scroll] Don't know how to add event listeners.")}function w(y,d,R){if(y.removeEventListener)y.removeEventListener(d,R);else if(y.detachEvent)y.detachEvent("on"+d,R);else return t.error("[scroll] Don't know how to remove event listeners.")}function E(y){return i(y).container.childNodes[0].childNodes[0].childNodes[0]}function T(y){return i(y).container.childNodes[0].childNodes[0].childNodes[1]}function H(y,d){var R=i(y).listeners;if(!R.push)throw new Error("Cannot add listener to an element that is not detectable.");i(y).listeners.push(d)}function M(y,d,R){R||(R=d,d=y,y=null),y=y||{};function S(){if(y.debug){var z=Array.prototype.slice.call(arguments);if(z.unshift(o.get(d),"Scroll: "),t.log.apply)t.log.apply(null,z);else for(var $=0;$<z.length;$++)t.log(z[$])}}function F(z){function $(G){var ft=G.getRootNode&&G.getRootNode().contains(G);return G===G.ownerDocument.body||G.ownerDocument.body.contains(G)||ft}return!$(z)||window.getComputedStyle(z)===null}function V(z){var $=i(z).container.childNodes[0],G=window.getComputedStyle($);return!G.width||G.width.indexOf("px")===-1}function A(){var z=window.getComputedStyle(d),$={};return $.position=z.position,$.width=d.offsetWidth,$.height=d.offsetHeight,$.top=z.top,$.right=z.right,$.bottom=z.bottom,$.left=z.left,$.widthCSS=z.width,$.heightCSS=z.height,$}function K(){var z=A();i(d).startSize={width:z.width,height:z.height},S("Element start size",i(d).startSize)}function b(){i(d).listeners=[]}function P(){if(S("storeStyle invoked."),!i(d)){S("Aborting because element has been uninstalled");return}var z=A();i(d).style=z}function B(z,$,G){i(z).lastWidth=$,i(z).lastHeight=G}function j(z){return E(z).childNodes[0]}function U(){return 2*r.width+1}function J(){return 2*r.height+1}function C(z){return z+10+U()}function Z(z){return z+10+J()}function nt(z){return z*2+U()}function Q(z){return z*2+J()}function st(z,$,G){var ft=E(z),yt=T(z),zt=C($),Tt=Z(G),ot=nt($),W=Q(G);ft.scrollLeft=zt,ft.scrollTop=Tt,yt.scrollLeft=ot,yt.scrollTop=W}function X(){var z=i(d).container;if(!z){z=document.createElement("div"),z.className=a,z.style.cssText=c(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),i(d).container=z,v(z),d.appendChild(z);var $=function(){i(d).onRendered&&i(d).onRendered()};x(z,"animationstart",$),i(d).onAnimationStart=$}return z}function Se(){function z(){var et=i(d).style;if(et.position==="static"){d.style.setProperty("position","relative",y.important?"important":"");var mt=function(Ot,wt,ze,lt){function se(p){return p.replace(/[^-\d\.]/g,"")}var ae=ze[lt];ae!=="auto"&&se(ae)!=="0"&&(Ot.warn("An element that is positioned static has style."+lt+"="+ae+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+lt+" will be set to 0. Element: ",wt),wt.style[lt]=0)};mt(t,d,et,"top"),mt(t,d,et,"right"),mt(t,d,et,"bottom"),mt(t,d,et,"left")}}function $(et,mt,Ot,wt){return et=et?et+"px":"0",mt=mt?mt+"px":"0",Ot=Ot?Ot+"px":"0",wt=wt?wt+"px":"0",["left: "+et,"top: "+mt,"right: "+wt,"bottom: "+Ot]}if(S("Injecting elements"),!i(d)){S("Aborting because element has been uninstalled");return}z();var G=i(d).container;G||(G=X());var ft=r.width,yt=r.height,zt=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),Tt=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat($(-(1+ft),-(1+yt),-yt,-ft))),ot=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),W=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),at=c(["position: absolute","left: 0","top: 0"]),bt=c(["position: absolute","width: 200%","height: 200%"]),tt=document.createElement("div"),dt=document.createElement("div"),At=document.createElement("div"),Ie=document.createElement("div"),xt=document.createElement("div"),Kt=document.createElement("div");tt.dir="ltr",tt.style.cssText=zt,tt.className=a,dt.className=a,dt.style.cssText=Tt,At.style.cssText=ot,Ie.style.cssText=at,xt.style.cssText=W,Kt.style.cssText=bt,At.appendChild(Ie),xt.appendChild(Kt),dt.appendChild(At),dt.appendChild(xt),tt.appendChild(dt),G.appendChild(tt);function Nt(){var et=i(d);et&&et.onExpand?et.onExpand():S("Aborting expand scroll handler: element has been uninstalled")}function re(){var et=i(d);et&&et.onShrink?et.onShrink():S("Aborting shrink scroll handler: element has been uninstalled")}x(At,"scroll",Nt),x(xt,"scroll",re),i(d).onExpandScroll=Nt,i(d).onShrinkScroll=re}function nn(){function z(ot,W,at){var bt=j(ot),tt=C(W),dt=Z(at);bt.style.setProperty("width",tt+"px",y.important?"important":""),bt.style.setProperty("height",dt+"px",y.important?"important":"")}function $(ot){var W=d.offsetWidth,at=d.offsetHeight,bt=W!==i(d).lastWidth||at!==i(d).lastHeight;S("Storing current size",W,at),B(d,W,at),n.add(0,function(){if(!!bt){if(!i(d)){S("Aborting because element has been uninstalled");return}if(!G()){S("Aborting because element container has not been initialized");return}if(y.debug){var dt=d.offsetWidth,At=d.offsetHeight;(dt!==W||At!==at)&&t.warn(o.get(d),"Scroll: Size changed before updating detector elements.")}z(d,W,at)}}),n.add(1,function(){if(!i(d)){S("Aborting because element has been uninstalled");return}if(!G()){S("Aborting because element container has not been initialized");return}st(d,W,at)}),bt&&ot&&n.add(2,function(){if(!i(d)){S("Aborting because element has been uninstalled");return}if(!G()){S("Aborting because element container has not been initialized");return}ot()})}function G(){return!!i(d).container}function ft(){function ot(){return i(d).lastNotifiedWidth===void 0}S("notifyListenersIfNeeded invoked");var W=i(d);if(ot()&&W.lastWidth===W.startSize.width&&W.lastHeight===W.startSize.height)return S("Not notifying: Size is the same as the start size, and there has been no notification yet.");if(W.lastWidth===W.lastNotifiedWidth&&W.lastHeight===W.lastNotifiedHeight)return S("Not notifying: Size already notified");S("Current size not notified, notifying..."),W.lastNotifiedWidth=W.lastWidth,W.lastNotifiedHeight=W.lastHeight,ns(i(d).listeners,function(at){at(d)})}function yt(){if(S("startanimation triggered."),V(d)){S("Ignoring since element is still unrendered...");return}S("Element rendered.");var ot=E(d),W=T(d);(ot.scrollLeft===0||ot.scrollTop===0||W.scrollLeft===0||W.scrollTop===0)&&(S("Scrollbars out of sync. Updating detector elements..."),$(ft))}function zt(){if(S("Scroll detected."),V(d)){S("Scroll event fired while unrendered. Ignoring...");return}$(ft)}if(S("registerListenersAndPositionElements invoked."),!i(d)){S("Aborting because element has been uninstalled");return}i(d).onRendered=yt,i(d).onExpand=zt,i(d).onShrink=zt;var Tt=i(d).style;z(d,Tt.width,Tt.height)}function on(){if(S("finalizeDomMutation invoked."),!i(d)){S("Aborting because element has been uninstalled");return}var z=i(d).style;B(d,z.width,z.height),st(d,z.width,z.height)}function ut(){R(d)}function Ee(){S("Installing..."),b(),K(),n.add(0,P),n.add(1,Se),n.add(2,nn),n.add(3,on),n.add(4,ut)}S("Making detectable..."),F(d)?(S("Element is detached"),X(),S("Waiting until element is attached..."),i(d).onRendered=function(){S("Element is now attached"),Ee()}):Ee()}function D(y){var d=i(y);!d||(d.onExpandScroll&&w(E(y),"scroll",d.onExpandScroll),d.onShrinkScroll&&w(T(y),"scroll",d.onShrinkScroll),d.onAnimationStart&&w(d.container,"animationstart",d.onAnimationStart),d.container&&y.removeChild(d.container))}return{makeDetectable:M,addListener:H,uninstall:D,initDocument:l}},oe=Qe.exports.forEach,os=Yr,rs=Xr,ss=Gr,as=qr,ls=Ur,vi=tn.exports,cs=Jr,Pt=ts,us=es,fs=is;function yi(e){return Array.isArray(e)||e.length!==void 0}function bi(e){if(Array.isArray(e))return e;var t=[];return oe(e,function(n){t.push(n)}),t}function xi(e){return e&&e.nodeType===1}var ds=function(e){e=e||{};var t;if(e.idHandler)t={get:function(M){return e.idHandler.get(M,!0)},set:e.idHandler.set};else{var n=ss(),i=as({idGenerator:n,stateHandler:Pt});t=i}var o=e.reporter;if(!o){var r=o===!1;o=ls(r)}var s=kt(e,"batchProcessor",cs({reporter:o})),a={};a.callOnAdd=!!kt(e,"callOnAdd",!0),a.debug=!!kt(e,"debug",!1);var l=rs(t),c=os({stateHandler:Pt}),u,f=kt(e,"strategy","object"),v=kt(e,"important",!1),x={reporter:o,batchProcessor:s,stateHandler:Pt,idHandler:t,important:v};if(f==="scroll"&&(vi.isLegacyOpera()?(o.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),f="object"):vi.isIE(9)&&(o.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),f="object")),f==="scroll")u=fs(x);else if(f==="object")u=us(x);else throw new Error("Invalid strategy name: "+f);var w={};function E(M,D,y){function d(K){var b=l.get(K);oe(b,function(B){B(K)})}function R(K,b,P){l.add(b,P),K&&P(b)}if(y||(y=D,D=M,M={}),!D)throw new Error("At least one element required.");if(!y)throw new Error("Listener required.");if(xi(D))D=[D];else if(yi(D))D=bi(D);else return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");var S=0,F=kt(M,"callOnAdd",a.callOnAdd),V=kt(M,"onReady",function(){}),A=kt(M,"debug",a.debug);oe(D,function(b){Pt.getState(b)||(Pt.initState(b),t.set(b));var P=t.get(b);if(A&&o.log("Attaching listener to element",P,b),!c.isDetectable(b)){if(A&&o.log(P,"Not detectable."),c.isBusy(b)){A&&o.log(P,"System busy making it detectable"),R(F,b,y),w[P]=w[P]||[],w[P].push(function(){S++,S===D.length&&V()});return}return A&&o.log(P,"Making detectable..."),c.markBusy(b,!0),u.makeDetectable({debug:A,important:v},b,function(j){if(A&&o.log(P,"onElementDetectable"),Pt.getState(j)){c.markAsDetectable(j),c.markBusy(j,!1),u.addListener(j,d),R(F,j,y);var U=Pt.getState(j);if(U&&U.startSize){var J=j.offsetWidth,C=j.offsetHeight;(U.startSize.width!==J||U.startSize.height!==C)&&d(j)}w[P]&&oe(w[P],function(Z){Z()})}else A&&o.log(P,"Element uninstalled before being detectable.");delete w[P],S++,S===D.length&&V()})}A&&o.log(P,"Already detecable, adding listener."),R(F,b,y),S++}),S===D.length&&V()}function T(M){if(!M)return o.error("At least one element is required.");if(xi(M))M=[M];else if(yi(M))M=bi(M);else return o.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");oe(M,function(D){l.removeAllListeners(D),u.uninstall(D),Pt.cleanState(D)})}function H(M){u.initDocument&&u.initDocument(M)}return{listenTo:E,removeListener:l.removeListener,removeAllListeners:l.removeAllListeners,uninstall:T,initDocument:H}};function kt(e,t,n){var i=e[t];return i==null&&n!==void 0?n:i}const hs={name:"GridLayout"},wi=h.defineComponent({...hs,props:{autoSize:{type:Boolean,default:!0},colNum:{default:12},rowHeight:{default:100},maxRows:{default:1/0},margin:{default:()=>[10,10]},isDraggable:{type:Boolean,default:!0},isResizable:{type:Boolean,default:!0},isMirrored:{type:Boolean,default:!1},isBounded:{type:Boolean,default:!1},useCssTransforms:{type:Boolean,default:!0},verticalCompact:{type:Boolean,default:!0},restoreOnDrag:{type:Boolean,default:!1},layout:{},responsive:{type:Boolean,default:!1},responsiveLayouts:{default:()=>({})},transformScale:{default:1},breakpoints:{default:()=>({lg:1200,md:996,sm:768,xs:480,xxs:0})},cols:{default:()=>({lg:12,md:10,sm:6,xs:4,xxs:2})},preventCollision:{type:Boolean,default:!1},useStyleCursor:{type:Boolean,default:!0}},emits:["layout-created","layout-before-mount","layout-mounted","layout-updated","layout-ready","update:layout","breakpoint-changed"],setup(e,{expose:t,emit:n}){const i=e,o=h.ref(null),r=h.ref({}),s=h.ref(0),a=h.ref(!1),l=h.ref({x:0,y:0,w:0,h:0,i:-1}),c=h.ref({}),u=h.ref(null),f=h.ref(null),v=h.ref(null),x=h.ref(),w=h.ref({}),E=h.ref(),T=Nr();h.provide("eventBus",T);function H(b){if(!b)F();else{const{eventType:P,i:B,x:j,y:U,h:J,w:C}=b;F(P,B,j,U,J,C)}}function M(b){if(!b)S();else{const{eventType:P,i:B,x:j,y:U,h:J,w:C}=b;S(P,B,j,U,J,C)}}T.on("resizeEvent",H),T.on("dragEvent",M),n("layout-created",i.layout),h.onBeforeUnmount(()=>{T.off("resizeEvent",H),T.off("dragEvent",M),Bi("resize",d),v.value&&v.value.uninstall(w.value)}),h.onBeforeMount(()=>{n("layout-before-mount",i.layout)}),h.onMounted(()=>{n("layout-mounted",i.layout),h.nextTick(function(){Di(i.layout),f.value=i.layout,h.nextTick(()=>{A(),d(),$i("resize",d),Yt(i.layout,i.verticalCompact),n("layout-updated",i.layout),y(),h.nextTick(()=>{v.value=ds({strategy:"scroll",callOnAdd:!1}),v.value.listenTo(w.value,function(){d()})})})})}),h.watch(o,(b,P)=>{h.nextTick(()=>{T.emit("updateWidth",b),P===null&&h.nextTick(()=>{n("layout-ready",i.layout)}),y()})}),h.watch(()=>i.layout,()=>{D()}),h.watch(()=>i.layout.length,()=>{D()}),h.watch(()=>i.colNum,b=>{T.emit("setColNum",b)}),h.watch(()=>i.rowHeight,b=>{T.emit("setRowHeight",b)}),h.watch(()=>i.isDraggable,b=>{T.emit("setDraggable",b)}),h.watch(()=>i.isResizable,b=>{T.emit("setResizable",b)}),h.watch(()=>i.isBounded,b=>{T.emit("setBounded",b)}),h.watch(()=>i.transformScale,b=>{T.emit("setTransformScale",b)}),h.watch(()=>i.responsive,b=>{b||(n("update:layout",f.value||[]),T.emit("setColNum",i.colNum)),d()}),h.watch(()=>i.maxRows,b=>{T.emit("setMaxRows",b)}),h.watch(()=>i.margin,()=>{y()});function D(){if(i.layout!==void 0&&f.value!==null){if(i.layout.length!==f.value.length){let b=K(i.layout,f.value);b.length>0&&(i.layout.length>f.value.length?f.value=f.value.concat(b):f.value=f.value.filter(P=>!b.some(B=>P.i===B.i))),s.value=i.layout.length,A()}Yt(i.layout,i.verticalCompact),T.emit("updateWidth",o.value),y(),n("layout-updated",i.layout)}}function y(){r.value={height:R()}}function d(){w.value!==null&&w.value!==void 0&&(o.value=w.value.offsetWidth),T.emit("resizeEvent")}function R(){return i.autoSize?Ht(i.layout)*(i.rowHeight+i.margin[1])+i.margin[1]+"px":""}function S(b,P,B,j,U,J){let C=un(i.layout,P);C==null&&(C={x:0,y:0}),b==="dragstart"&&!i.verticalCompact&&(x.value=i.layout.reduce((nt,{i:Q,x:st,y:X})=>({...nt,[Q]:{x:st,y:X}}),{})),b==="dragmove"||b==="dragstart"?(l.value.i=P,l.value.x=C.x,l.value.y=C.y,l.value.w=J,l.value.h=U,h.nextTick(function(){a.value=!0}),T.emit("updateWidth",o.value)):h.nextTick(function(){a.value=!1});const Z=_e(i.layout,C,B,j,!0,i.preventCollision);n("update:layout",Z),i.restoreOnDrag?(C.static=!0,Yt(i.layout,i.verticalCompact,x.value),C.static=!1):Yt(i.layout,i.verticalCompact),T.emit("compact"),y(),b==="dragend"&&(x.value=void 0,n("layout-updated",Z))}function F(b,P,B,j,U,J){let C=un(i.layout,P);C==null&&(C={h:0,w:0}),J=Number(J),U=Number(U);let Z;if(i.preventCollision){const nt=fn(i.layout,{...C,w:J,h:U}).filter(Q=>Q.i!==(C==null?void 0:C.i));if(Z=nt.length>0,Z){let Q=1/0,st=1/0;nt.forEach(X=>{X.x>Number(C==null?void 0:C.x)&&(Q=Math.min(Q,X.x)),X.y>Number(C==null?void 0:C.y)&&(st=Math.min(st,X.y))}),Number.isFinite(Q)&&(C.w=Q-C.x),Number.isFinite(st)&&(C.h=st-C.y)}}Z||(C.w=J,C.h=U),b==="resizestart"||b==="resizemove"?(l.value.i=P,l.value.x=B,l.value.y=j,l.value.w=C.w,l.value.h=C.h,h.nextTick(function(){a.value=!0}),T.emit("updateWidth",o.value)):h.nextTick(function(){a.value=!1}),i.responsive&&V(),Yt(i.layout,i.verticalCompact),T.emit("compact"),y(),b==="resizeend"&&n("layout-updated",i.layout)}function V(){let b=Ai(i.breakpoints,o.value),P=Ce(b,i.cols);u.value!=null&&!c.value[u.value]&&(c.value[u.value]=Me(i.layout));let B=Oi(f.value,c.value,i.breakpoints,b,u.value,P,i.verticalCompact);c.value[b]=B,u.value!==b&&n("breakpoint-changed",b,B),n("update:layout",B),u.value=b,T.emit("setColNum",Ce(b,i.cols))}function A(){c.value=Object.assign({},i.responsiveLayouts)}function K(b,P){let B=b.filter(function(U){return!P.some(function(J){return U.i===J.i})}),j=P.filter(function(U){return!b.some(function(J){return U.i===J.i})});return B.concat(j)}return t({...i,width:o,mergeStyle:r,lastLayoutLength:s,isDragging:a,placeholder:l,layouts:c,lastBreakpoint:u,originalLayout:f,erd:v,defaultGridItem:E,dragEvent:S}),(b,P)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"this$refsLayout",ref:w,class:"vue-grid-layout",style:h.normalizeStyle(r.value)},[h.renderSlot(b.$slots,"default"),h.withDirectives(h.createVNode(Ze,{ref_key:"defaultGridItem",ref:E,class:"vue-grid-placeholder",x:l.value.x,y:l.value.y,w:l.value.w,h:l.value.h,i:l.value.i},null,8,["x","y","w","h","i"]),[[h.vShow,a.value]])],4))}}),Ys="",ps=[wi,Ze],gs={install(e){ps.forEach(t=>{e.component(t.name,t)})}};rt.GridItem=Ze,rt.GridLayout=wi,rt.default=gs,Object.defineProperties(rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});