class LiquidMoveElementBehavior extends LiquidBehavior{static behaviorName="liquidMoveElement";options(){return{elementsToMove:null,moveElementsTo:"body",matchFirstParent:!1,withElementorWrapper:!1,appendingType:"append"}}get bindToThis(){return["moveElement"]}initialize(){this.getOption("elementsToMove")&&(this.view.trigger("before:move"),_.defer(this.moveElement))}moveElement(){if(this.isDestroyed)return;const e=this.getOption("moveElementsTo"),l=this.getOption("withElementorWrapper");let i=this.view.el.querySelectorAll(this.getOption("elementsToMove")),t=document.querySelector(e);if(this.getOption("matchFirstParent")&&(t=this.view.el.parentElement.closest(e)),l){const o=document.createElement("div"),n=this.view.el.parentElement?.closest(".elementor");n&&([...n.attributes].forEach(({name:s,value:r})=>{o.setAttribute(s,r)}),o.append(...i),i=[o])}e==="parent"?t=this.view.model.get("parentsCollection")?.at(0)?.view?.el||this.view.el.parentElement:e==="topParent"&&(t=this.view.model.get("topParentContainer")?.view?.el||this.view.el.parentElement),t[this.getOption("appendingType")](...i),this.view.model.set({isMoved:!0}),this.view.trigger("done:elementMove")}}typeof window<"u"&&(window.liquid?.app?window.liquid?.app?.model?.set("loadedBehaviors",[...window.liquid.app.model.get("loadedBehaviors"),LiquidMoveElementBehavior]):window.liquid?.loadedBehaviors?.push(LiquidMoveElementBehavior));
