import{d as Ut,c as Ct,bo as bn,l as F,r as Lt,dD as yn,dE as wn,dF as mt,aM as qt,o as Sn,aT as zt,cq as Dn,aS as Qe,aL as En,aH as et,a as Cn,h as _t,w as Q,aN as _n,g as re,aO as Tn,O as xn,b as tt,e as Tt,j as ue,t as ie,z as me,F as xt,p as On,aP as In,M as Mn,f as _e,Q as bt,Y as yt,L as An}from"./main-BhFWIRV_.js";import{b as Nn}from"./model_utils-CVQgSPL_.js";var kn=Object.defineProperty,Ue=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,Ot=(e,n,t)=>n in e?kn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Se=(e,n)=>{for(var t in n||(n={}))Gt.call(n,t)&&Ot(e,t,n[t]);if(Ue)for(var t of Ue(n))Jt.call(n,t)&&Ot(e,t,n[t]);return e},Zt=(e,n)=>{var t={};for(var o in e)Gt.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&Ue)for(var o of Ue(e))n.indexOf(o)<0&&Jt.call(e,o)&&(t[o]=e[o]);return t};const Kt="[vue-draggable-plus]: ";function Pn(e){console.warn(Kt+e)}function Rn(e){console.error(Kt+e)}function It(e,n,t){return t>=0&&tt?t.toUpperCase():"")}function Bn(e){return Object.keys(e).reduce((n,t)=>(typeof e[t]<"u"&&(n[Yn(t)]=e[t]),n),{})}function Mt(e,n){return Array.isArray(e)&&e.splice(n,1),e}function At(e,n,t){return Array.isArray(e)&&e.splice(n,0,t),e}function Xn(e){return typeof e>"u"}function Fn(e){return typeof e=="string"}function Nt(e,n,t){const o=e.children[t];e.insertBefore(n,o)}function nt(e){e.parentNode&&e.parentNode.removeChild(e)}function Vn(e,n=document){var t;let o=null;return typeof n?.querySelector=="function"?o=(t=n?.querySelector)==null?void 0:t.call(n,e):o=document.querySelector(e),o||Pn(`Element not found: ${e}`),o}function jn(e,n,t=null){return function(...o){return e.apply(t,o),n.apply(t,o)}}function Hn(e,n){const t=Se({},e);return Object.keys(n).forEach(o=>{t[o]?t[o]=jn(e[o],n[o]):t[o]=n[o]}),t}function $n(e){return e instanceof HTMLElement}function kt(e,n){Object.keys(e).forEach(t=>{n(t,e[t])})}function Wn(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}const Un=Object.assign;/**! * Sortable 1.15.2 * @author RubaXa * @author owenm * @license MIT */function Pt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function te(e){for(var n=1;n=0)&&(t[r]=e[r]);return t}function zn(e,n){if(e==null)return{};var t=qn(e,n),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}var Gn="1.15.2";function ae(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var se=ae(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pe=ae(/Edge/i),Rt=ae(/firefox/i),Ie=ae(/safari/i)&&!ae(/chrome/i)&&!ae(/android/i),Qt=ae(/iP(ad|od|hone)/i),en=ae(/chrome/i)&&ae(/android/i),tn={capture:!1,passive:!1};function D(e,n,t){e.addEventListener(n,t,!se&&tn)}function y(e,n,t){e.removeEventListener(n,t,!se&&tn)}function Le(e,n){if(n){if(n[0]===">"&&(n=n.substring(1)),e)try{if(e.matches)return e.matches(n);if(e.msMatchesSelector)return e.msMatchesSelector(n);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(n)}catch{return!1}return!1}}function Jn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Z(e,n,t,o){if(e){t=t||document;do{if(n!=null&&(n[0]===">"?e.parentNode===t&&Le(e,n):Le(e,n))||o&&e===t)return e;if(e===t)break}while(e=Jn(e))}return null}var Yt=/\s+/g;function W(e,n,t){if(e&&n)if(e.classList)e.classList[t?"add":"remove"](n);else{var o=(" "+e.className+" ").replace(Yt," ").replace(" "+n+" "," ");e.className=(o+(t?" "+n:"")).replace(Yt," ")}}function p(e,n,t){var o=e&&e.style;if(o){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(t=e.currentStyle),n===void 0?t:t[n];!(n in o)&&n.indexOf("webkit")===-1&&(n="-webkit-"+n),o[n]=t+(typeof t=="string"?"":"px")}}function Ee(e,n){var t="";if(typeof e=="string")t=e;else do{var o=p(e,"transform");o&&o!=="none"&&(t=o+" "+t)}while(!n&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function nn(e,n,t){if(e){var o=e.getElementsByTagName(n),r=0,a=o.length;if(t)for(;r=a,!i)return o;if(o===ee())break;o=fe(o,!1)}return!1}function Ce(e,n,t,o){for(var r=0,a=0,i=e.children;a2&&arguments[2]!==void 0?arguments[2]:{},o=t.evt,r=zn(t,ro);Re.pluginEvent.bind(g)(e,n,te({dragEl:d,parentEl:x,ghostEl:v,rootEl:_,nextEl:ve,lastDownEl:je,cloneEl:T,cloneHidden:de,dragStarted:Te,putSortable:B,activeSortable:g.active,originalEvent:o,oldIndex:De,oldDraggableIndex:Ae,newIndex:U,newDraggableIndex:ce,hideGhostForTarget:dn,unhideGhostForTarget:fn,cloneNowHidden:function(){de=!0},cloneNowShown:function(){de=!1},dispatchSortableEvent:function(a){V({sortable:n,name:a,originalEvent:o})}},r))};function V(e){oo(te({putSortable:B,cloneEl:T,targetEl:d,rootEl:_,oldIndex:De,oldDraggableIndex:Ae,newIndex:U,newDraggableIndex:ce},e))}var d,x,v,_,ve,je,T,de,De,U,Ae,ce,Ye,B,we=!1,qe=!1,ze=[],pe,J,it,at,Ft,Vt,Te,ye,Ne,ke=!1,Be=!1,He,X,lt=[],ft=!1,Ge=[],Ze=typeof document<"u",Xe=Qt,jt=Pe||se?"cssFloat":"float",io=Ze&&!en&&!Qt&&"draggable"in document.createElement("div"),sn=function(){if(Ze){if(se)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),un=function(e,n){var t=p(e),o=parseInt(t.width)-parseInt(t.paddingLeft)-parseInt(t.paddingRight)-parseInt(t.borderLeftWidth)-parseInt(t.borderRightWidth),r=Ce(e,0,n),a=Ce(e,1,n),i=r&&p(r),s=a&&p(a),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+N(r).width,u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+N(a).width;if(t.display==="flex")return t.flexDirection==="column"||t.flexDirection==="column-reverse"?"vertical":"horizontal";if(t.display==="grid")return t.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&i.float&&i.float!=="none"){var c=i.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===c)?"vertical":"horizontal"}return r&&(i.display==="block"||i.display==="flex"||i.display==="table"||i.display==="grid"||l>=o&&t[jt]==="none"||a&&t[jt]==="none"&&l+u>o)?"vertical":"horizontal"},ao=function(e,n,t){var o=t?e.left:e.top,r=t?e.right:e.bottom,a=t?e.width:e.height,i=t?n.left:n.top,s=t?n.right:n.bottom,l=t?n.width:n.height;return o===i||r===s||o+a/2===i+l/2},lo=function(e,n){var t;return ze.some(function(o){var r=o[L].options.emptyInsertThreshold;if(!(!r||wt(o))){var a=N(o),i=e>=a.left-r&&e<=a.right+r,s=n>=a.top-r&&n<=a.bottom+r;if(i&&s)return t=o}}),t},cn=function(e){function n(r,a){return function(i,s,l,u){var c=i.options.group.name&&s.options.group.name&&i.options.group.name===s.options.group.name;if(r==null&&(a||c))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(i,s,l,u),a)(i,s,l,u);var f=(a?i:s).options.group.name;return r===!0||typeof r=="string"&&r===f||r.join&&r.indexOf(f)>-1}}var t={},o=e.group;(!o||Ve(o)!="object")&&(o={name:o}),t.name=o.name,t.checkPull=n(o.pull,!0),t.checkPut=n(o.put),t.revertClone=o.revertClone,e.group=t},dn=function(){!sn&&v&&p(v,"display","none")},fn=function(){!sn&&v&&p(v,"display","")};Ze&&!en&&document.addEventListener("click",function(e){if(qe)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),qe=!1,!1},!0);var ge=function(e){if(d){e=e.touches?e.touches[0]:e;var n=lo(e.clientX,e.clientY);if(n){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.target=t.rootEl=n,t.preventDefault=void 0,t.stopPropagation=void 0,n[L]._onDragOver(t)}}},so=function(e){d&&d.parentNode[L]._isOutsideThisEl(e.target)};function g(e,n){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=n=le({},n),e[L]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return un(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,i){a.setData("Text",i.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:g.supportPointer!==!1&&"PointerEvent"in window&&!Ie,emptyInsertThreshold:5};Re.initializePlugins(this,e,t);for(var o in t)!(o in n)&&(n[o]=t[o]);cn(n);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=n.forceFallback?!1:io,this.nativeDraggable&&(this.options.touchStartThreshold=1),n.supportPointer?D(e,"pointerdown",this._onTapStart):(D(e,"mousedown",this._onTapStart),D(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(D(e,"dragover",this),D(e,"dragenter",this)),ze.push(this.el),n.store&&n.store.get&&this.sort(n.store.get(this)||[]),le(this,eo())}g.prototype={constructor:g,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ye=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,t=this.el,o=this.options,r=o.preventOnFilter,a=e.type,i=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(i||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,u=o.filter;if(mo(t),!d&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||o.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ie&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Z(s,o.draggable,t,!1),!(s&&s.animated)&&je!==s)){if(De=z(s),Ae=z(s,o.draggable),typeof u=="function"){if(u.call(this,e,s,this)){V({sortable:n,rootEl:l,name:"filter",targetEl:s,toEl:t,fromEl:t}),H("filter",n,{evt:e}),r&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(c){if(c=Z(l,c.trim(),t,!1),c)return V({sortable:n,rootEl:c,name:"filter",targetEl:s,fromEl:t,toEl:t}),H("filter",n,{evt:e}),!0}),u)){r&&e.cancelable&&e.preventDefault();return}o.handle&&!Z(l,o.handle,t,!1)||this._prepareDragStart(e,i,s)}}},_prepareDragStart:function(e,n,t){var o=this,r=o.el,a=o.options,i=r.ownerDocument,s;if(t&&!d&&t.parentNode===r){var l=N(t);if(_=r,d=t,x=d.parentNode,ve=d.nextSibling,je=t,Ye=a.group,g.dragged=d,pe={target:d,clientX:(n||e).clientX,clientY:(n||e).clientY},Ft=pe.clientX-l.left,Vt=pe.clientY-l.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,d.style["will-change"]="all",s=function(){if(H("delayEnded",o,{evt:e}),g.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Rt&&o.nativeDraggable&&(d.draggable=!0),o._triggerDragStart(e,n),V({sortable:o,name:"choose",originalEvent:e}),W(d,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){nn(d,u.trim(),st)}),D(i,"dragover",ge),D(i,"mousemove",ge),D(i,"touchmove",ge),D(i,"mouseup",o._onDrop),D(i,"touchend",o._onDrop),D(i,"touchcancel",o._onDrop),Rt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),H("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Pe||se))){if(g.eventCanceled){this._onDrop();return}D(i,"mouseup",o._disableDelayedDrag),D(i,"touchend",o._disableDelayedDrag),D(i,"touchcancel",o._disableDelayedDrag),D(i,"mousemove",o._delayedDragTouchMoveHandler),D(i,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&D(i,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&st(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._disableDelayedDrag),y(e,"touchend",this._disableDelayedDrag),y(e,"touchcancel",this._disableDelayedDrag),y(e,"mousemove",this._delayedDragTouchMoveHandler),y(e,"touchmove",this._delayedDragTouchMoveHandler),y(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?D(document,"pointermove",this._onTouchMove):n?D(document,"touchmove",this._onTouchMove):D(document,"mousemove",this._onTouchMove):(D(d,"dragend",this),D(_,"dragstart",this._onDragStart));try{document.selection?$e(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(we=!1,_&&d){H("dragStarted",this,{evt:n}),this.nativeDraggable&&D(document,"dragover",so);var t=this.options;!e&&W(d,t.dragClass,!1),W(d,t.ghostClass,!0),g.active=this,e&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(J){this._lastX=J.clientX,this._lastY=J.clientY,dn();for(var e=document.elementFromPoint(J.clientX,J.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(J.clientX,J.clientY),e!==n);)n=e;if(d.parentNode[L]._isOutsideThisEl(e),n)do{if(n[L]){var t=void 0;if(t=n[L]._onDragOver({clientX:J.clientX,clientY:J.clientY,target:e,rootEl:n}),t&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);fn()}},_onTouchMove:function(e){if(pe){var n=this.options,t=n.fallbackTolerance,o=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=v&&Ee(v,!0),i=v&&a&&a.a,s=v&&a&&a.d,l=Xe&&X&&Xt(X),u=(r.clientX-pe.clientX+o.x)/(i||1)+(l?l[0]-lt[0]:0)/(i||1),c=(r.clientY-pe.clientY+o.y)/(s||1)+(l?l[1]-lt[1]:0)/(s||1);if(!g.active&&!we){if(t&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(V({rootEl:x,name:"add",toEl:x,fromEl:_,originalEvent:e}),V({sortable:this,name:"remove",toEl:x,originalEvent:e}),V({rootEl:x,name:"sort",toEl:x,fromEl:_,originalEvent:e}),V({sortable:this,name:"sort",toEl:x,originalEvent:e})),B&&B.save()):U!==De&&U>=0&&(V({sortable:this,name:"update",toEl:x,originalEvent:e}),V({sortable:this,name:"sort",toEl:x,originalEvent:e})),g.active&&((U==null||U===-1)&&(U=De,ce=Ae),V({sortable:this,name:"end",toEl:x,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){H("nulling",this),_=d=x=v=ve=T=je=de=pe=J=Te=U=ce=De=Ae=ye=Ne=B=Ye=g.dragged=g.ghost=g.clone=g.active=null,Ge.forEach(function(e){e.checked=!0}),Ge.length=it=at=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),uo(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,t=this.el.children,o=0,r=t.length,a=this.options;or.right+a||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>r.bottom+a||e.clientX>o.right&&e.clientY>o.top}function po(e,n,t,o,r,a,i,s){var l=o?e.clientY:e.clientX,u=o?t.height:t.width,c=o?t.top:t.left,f=o?t.bottom:t.right,S=!1;if(!i){if(s&&Hec+u*a/2:lf-He)return-Ne}else if(l>c+u*(1-r)/2&&lf-u*a/2)?l>c+u/2?1:-1:0}function go(e){return z(d){if(P&&r?.length!==E.childNodes.length)return j.insertBefore(P,q.nextSibling),!0;const Ke=E.childNodes[oe];P=E?.replaceChild(q,Ke)})}}catch(P){O=P}finally{r=null}zt(()=>{if($t(),O)throw O})}const I={onUpdate:w,onStart:S,onAdd:h,onRemove:C,onEnd:$};function G(m){const b=F(a);return m||(m=Fn(b)?Vn(b,o?.$el):b),m&&!$n(m)&&(m=m.$el),m||Rn("Root element not found"),m}function k(){var m;const b=(m=F(s))!=null?m:{},{immediate:M,clone:j}=b,E=Zt(b,["immediate","clone"]);return kt(E,(O,Y)=>{Wn(O)&&(E[O]=(P,...q)=>{const oe=Do();return Un(P,oe),Y(P,...q)})}),Hn(i===null?{}:I,E)}const K=m=>{m=G(m),l&&R.destroy(),l=new g(m,k())};qt(()=>s,()=>{l&&kt(k(),(m,b)=>{l?.option(m,b)})},{deep:!0});const R={option:(m,b)=>l?.option(m,b),destroy:()=>{l?.destroy(),l=null},save:()=>l?.save(),toArray:()=>l?.toArray(),closest:(...m)=>l?.closest(...m)},ne=()=>R?.option("disabled",!0),he=()=>R?.option("disabled",!1);return So(()=>{u&&K()}),wo(R.destroy),Se({start:K,pause:ne,resume:he},R)}const vt=["update","start","add","remove","choose","unchoose","end","sort","filter","clone","move","change"],Co=["clone","animation","ghostClass","group","sort","disabled","store","handle","draggable","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","chosenClass","dragClass","ignore","filter","preventOnFilter","easing","setData","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","emptyInsertThreshold","scroll","forceAutoScrollFallback","scrollSensitivity","scrollSpeed","bubbleScroll","modelValue","tag","target","customUpdate",...vt.map(e=>`on${e.replace(/^\S/,n=>n.toUpperCase())}`)],Oo=Ut({name:"VueDraggable",model:{prop:"modelValue",event:"update:modelValue"},props:Co,emits:["update:modelValue",...vt],setup(e,{slots:n,emit:t,expose:o,attrs:r}){const a=vt.reduce((c,f)=>{const S=`on${f.replace(/^\S/,h=>h.toUpperCase())}`;return c[S]=(...h)=>t(f,...h),c},{}),i=Ct(()=>{const c=bn(e),{modelValue:f}=c,S=Zt(c,["modelValue"]),h=Object.entries(S).reduce((C,[w,$])=>{const I=F($);return I!==void 0&&(C[w]=I),C},{});return Se(Se({},a),Bn(Se(Se({},r),h)))}),s=Ct({get:()=>e.modelValue,set:c=>t("update:modelValue",c)}),l=Lt(),u=yn(Eo(e.target||l,s,i));return o(u),()=>{var c;return wn(e.tag||"div",{ref:l},(c=n?.default)==null?void 0:c.call(n,u))}}}),_o={key:0},Io=Ut({__name:"StepIngredientSorterDialog",props:En({stepIndex:{type:Number,required:!0},ingredientIndex:{type:Number,required:!0}},{modelValue:{required:!0,default:!1},modelModifiers:{},step:{required:!0},stepModifiers:{},recipe:{required:!0},recipeModifiers:{}}),emits:["update:modelValue","update:step","update:recipe"],setup(e){const n=et(e,"modelValue"),t=et(e,"step"),o=et(e,"recipe"),r=e,{mobile:a}=Cn();qt(()=>r.ingredientIndex,()=>{console.log("updated ingredient inex"),i.value=r.ingredientIndex});const i=Lt(0);function s(l,u,c){let f=t.value.ingredients[l];t.value.ingredients.splice(l,1),o.value.steps[u].ingredients.splice(c,0,f),u!=r.stepIndex?n.value=!1:i.value=c}return(l,u)=>(_e(),_t(_n,{modelValue:n.value,"onUpdate:modelValue":u[6]||(u[6]=c=>n.value=c),"max-width":F(a)?"100vw":"25vw",fullscreen:F(a)},{default:Q(()=>[re(Mn,null,{default:Q(()=>[re(Tn,{title:l.$t("Move"),modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=c=>n.value=c),"sub-title":F(Nn)(t.value.ingredients[i.value])},null,8,["title","modelValue","sub-title"]),re(xn,null,{default:Q(()=>[t.value.ingredients.length>1?(_e(),tt(xt,{key:0},[ue(ie(l.$t("Order"))+" ",1),re(me,{block:"",disabled:i.value==0,onClick:u[1]||(u[1]=c=>s(i.value,r.stepIndex,0))},{default:Q(()=>[ue(ie(l.$t("First")),1)]),_:1},8,["disabled"]),re(me,{block:"",disabled:i.value==0,class:"mt-1",onClick:u[2]||(u[2]=c=>s(i.value,r.stepIndex,i.value-1))},{default:Q(()=>[ue(ie(l.$t("Up")),1)]),_:1},8,["disabled"]),re(me,{block:"",disabled:i.value+1==t.value.ingredients.length,class:"mt-1",onClick:u[3]||(u[3]=c=>s(i.value,r.stepIndex,i.value+1))},{default:Q(()=>[ue(ie(l.$t("Down")),1)]),_:1},8,["disabled"]),re(me,{block:"",disabled:i.value+1==t.value.ingredients.length,class:"mt-1",onClick:u[4]||(u[4]=c=>s(i.value,r.stepIndex,t.value.ingredients.length-1))},{default:Q(()=>[ue(ie(l.$t("Last")),1)]),_:1},8,["disabled"])],64)):Tt("",!0),ue(" "+ie(l.$t("MoveToStep"))+" ",1),(_e(!0),tt(xt,null,On(o.value.steps,(c,f)=>(_e(),_t(me,{block:"",disabled:f==r.stepIndex,class:"mt-1",onClick:S=>s(i.value,f,o.value.steps[f].ingredients.length)},{default:Q(()=>[ue(ie(f+1)+" ",1),"name"in c?(_e(),tt("span",_o,ie(c.name),1)):Tt("",!0)]),_:2},1032,["disabled","onClick"]))),256))]),_:1}),re(In,null,{default:Q(()=>[re(me,{onClick:u[5]||(u[5]=c=>n.value=!1)},{default:Q(()=>[ue(ie(l.$t("Close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","max-width","fullscreen"]))}});function vn(e,n){let t=[];return e.instruction&&(e.instruction.split(n).forEach(o=>{o.trim()!==""&&t.push({instruction:o,ingredients:[],time:0,showIngredientsTable:An().userSettings.showStepIngredients})}),t[0].ingredients=e.ingredients),t}function Mo(e,n){let t=[];e?(e.forEach(o=>{t=t.concat(vn(o,n))}),e.splice(0,e.length,...t)):bt().addMessage(yt.ERROR,"no steps found to split")}function Ao(e,n,t){if(e){let o=e.findIndex(a=>a===n),r=vn(n,t);e.splice(o,1,...r)}else bt().addMessage(yt.ERROR,"no steps found to split")}function No(e,n){return n.instruction&&(e.instruction=e.instruction+` `+n.instruction),e.ingredients=e.ingredients.concat(n.ingredients),e}function ko(e){return e.length>1?(e[0].instruction=e.map(n=>n.instruction).join(` `),e[0].ingredients=e.flatMap(n=>n.ingredients),e=[e[0]]):bt().addMessage(yt.ERROR,"no steps found to split"),e}export{Io as _,Ao as a,No as b,Oo as l,ko as m,Mo as s};