"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[5849],{5849(e,t,l){l.r(t),l.d(t,{default:()=>o});var a=l(1609),r=l(7723),n=l(4256),i=l(2684),d=l(9968),s=l(4173);const m=({field:e})=>{if(!e.collapsible)return;const t=e.group_title||(e.clone?(0,r.__)("Entry {#}","meta-box-builder"):(0,r.__)("Entry","meta-box-builder"));return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"rwmb-group-title-wrapper"},(0,a.createElement)("h4",{className:"rwmb-group-title"},t)),(0,a.createElement)("button",{className:"rwmb-group-toggle-handle button-link"},(0,a.createElement)("span",{className:"rwmb-group-toggle-indicator"})))},o=({field:e,parent:t})=>{const{fields:l,...o}=(0,i.Ay)(e._id)();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(m,{field:e}),(0,a.createElement)(n.ReactSortable,{className:"mb-field--group__fields mb-fields",delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,animation:200,invertSwap:!0,group:{name:"nested",pull:!0,put:!0},list:l,setList:e=>o.setFields([...e].filter(e=>void 0!==e?._id)),onAdd:e=>{e.from.classList.contains("mb-add-field__list")&&o.addFieldAt(e.item.dataset.type,e.newDraggableIndex)}},l.map(l=>(0,a.createElement)(s.A,{key:l._id,field:l,parent:`${t}[${e._id}][fields]`,...o}))),(0,a.createElement)(d.A,{text:(0,r.__)("+ Add Subfield","meta-box-builder"),variant:"secondary",...o}))}}}]);