"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("lodash-unified"),u=require("vue"),d=require("../../item-group/helper.js");require("../../../utils/index.js");const c=require("./use-collapse-input-count.js"),p=require("../../../utils/is.js");function f(n,r){const i=new Set(n.map(t=>t.name)),a=new Map;for(const t of r){const e=String(d.getStringName(c.getTargetNode(t).props?.name));e&&i.has(e)&&a.set(e,t)}const s=new Set,o=[];for(const t of n){const e=a.get(t.name);e&&(o.push(e),s.add(e))}for(const t of r)s.has(t)||o.push(t);return o}const g=n=>{const r=u.ref(!1),i=u.computed(()=>(n.value||[]).map(o=>{const e=c.getTargetNode(o).props;return{label:e.description||e.label||e.placeholder,name:d.getStringName(e.name),isHidden:l.isBoolean(e.hidden)?!!e.hidden:p.isDef(e.hidden)}}));function a(s){const o=f(s||[],n.value||[]);r.value=!0,n.value=o}return{items:i,handleClickConfirm:a,sorted:r}};exports.useSorter=g;
