/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */ import browser from"../utils/browser.prod.js";import clone from"../utils/clone.prod.js";import domObjects from"../utils/domObjects.prod.js";import extend from"../utils/extend.prod.js";import is from"../utils/is.prod.js";import raf from"../utils/raf.prod.js";import*as win from"../utils/window.prod.js";import{Eventable}from"./Eventable.prod.js";import events from"./events.prod.js";import interactions from"./interactions.prod.js";import{Interactable}from"./Interactable.prod.js";import{InteractableSet}from"./InteractableSet.prod.js";import{InteractEvent}from"./InteractEvent.prod.js";import{createInteractStatic}from"./InteractStatic.prod.js";import{defaults}from"./options.prod.js";import"../utils/arr.prod.js";import"../utils/normalizeListeners.prod.js";import"../utils/domUtils.prod.js";import"../utils/pointerExtend.prod.js";import"../utils/pointerUtils.prod.js";import"./interactablePreventDefault.prod.js";import"./Interaction.prod.js";import"../utils/hypot.prod.js";import"../utils/misc.prod.js";import"../utils/rect.prod.js";import"./PointerInfo.prod.js";import"./interactionFinder.prod.js";import"../utils/isNonNativeEvent.prod.js";import"../utils/getOriginXY.prod.js";import"./BaseEvent.prod.js";class Scope{constructor(){this.id="__interact_scope_"+Math.floor(100*Math.random()),this.isInitialized=!1,this.listenerMaps=[],this.browser=browser,this.defaults=clone(defaults),this.Eventable=Eventable,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=createInteractStatic(this),this.InteractEvent=InteractEvent,this.Interactable=void 0,this.interactables=new InteractableSet(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=t=>this.removeDocument(t.target);const t=this;this.Interactable=class extends Interactable{get _defaults(){return t.defaults}set(i){return super.set(i),t.fire("interactable:set",{options:i,interactable:this}),this}unset(){super.unset();const i=t.interactables.list.indexOf(this);i<0||(t.interactables.list.splice(i,1),t.fire("interactable:unset",{interactable:this}))}}}addListeners(t,i){this.listenerMaps.push({id:i,map:t})}fire(t,i){for(const{map:{[t]:e}}of this.listenerMaps)if(e&&!1===e(i,this,t))return!1}init(t){return this.isInitialized?this:initScope(this,t)}pluginIsInstalled(t){const{id:i}=t;return i?!!this._plugins.map[i]:-1!==this._plugins.list.indexOf(t)}usePlugin(t,i){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,i),t.listeners&&t.before){let i=0;const e=this.listenerMaps.length,s=t.before.reduce(((t,i)=>(t[i]=!0,t[pluginIdRoot(i)]=!0,t)),{});for(;i