import{x as te,r as f,j as e,U as le,t as u}from"./app-BBZbvTSO.js";import{c as re,s as oe}from"./utils-YhN_nlHn.js";import{D as ne,a as ie,b as de,c as ce,d as me}from"./dialog-D_v2qgP5.js";import{c as p,B as v}from"./button-CZmOQP7j.js";import{I as m}from"./input-dmj4QjAp.js";import{L as r}from"./label-BPDCCRHl.js";import{T as he}from"./textarea-DorjplNc.js";import{C as d}from"./checkbox-B0_9jnY6.js";import{S as I}from"./Select-BSWSW26d.js";import{A as ue,a as pe,b as xe,c as ge,d as be,e as je,f as fe,g as ve}from"./alert-dialog-Ct4MX6gw.js";import{S as Ne}from"./scroll-area-hNGxDuJk.js";import{R as U,a as N}from"./radio-group-Ba_2z_o7.js";import{I as y}from"./input-error-Bz7f2c6i.js";import{C as ye}from"./code-aABRHl_L.js";import{I as Ce}from"./image-BEhzBCM8.js";import{C as ke}from"./clock-gA1FmRyJ.js";import{C as we}from"./calendar-DoGBS4zB.js";import{H as Ae}from"./hash-CTCupukW.js";import{L as Se}from"./lock-C-nUbAQc.js";import{A as Ie}from"./at-sign-Czm704vp.js";import{L as De}from"./link-BHviGKHc.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Le=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],_e=p("AlignLeft",Le);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qe=[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]],Me=p("Droplet",qe);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oe=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Ee=p("GitBranch",Oe);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pe=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],Fe=p("ListOrdered",Pe);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Re=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ve=p("SquareCheckBig",Re);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Be=[["path",{d:"M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1",key:"uvaxm9"}],["path",{d:"M7 22h1a4 4 0 0 0 4-4v-1",key:"11xy8d"}],["path",{d:"M7 2h1a4 4 0 0 1 4 4v1",key:"1uw06m"}]],G=p("TextCursor",Be),He={label:"Text",desc:"Single line text (headings, titles)",icon:"TextCursor",bg:"bg-yellow-400"},Ue={label:"Long Text",desc:"Multi line text like descriptions",icon:"TextAlignLeft",bg:"bg-yellow-600"},Ge={label:"Rich Text",desc:"Rich text editor with formatting",icon:"TextAlignLeft",bg:"bg-yellow-900"},$e={label:"Slug",desc:"Like Urls and permalinks",icon:"Link",bg:"bg-green-400"},ze={label:"E-mail",desc:"Email field with validation",icon:"AtSign",bg:"bg-red-400"},Te={label:"Password",desc:"Password field with encryption",icon:"Lock",bg:"bg-blue-400"},Je={label:"Number",desc:"Integer, decimal, float numbers",icon:"SortNumericUp",bg:"bg-pink-600"},Ke={label:"Enumeration",desc:"List of values",icon:"ListOrdered",bg:"bg-green-600"},Qe={label:"Boolean",desc:"True or false",icon:"CheckSquare",bg:"bg-red-600"},We={label:"Color",desc:"Color picker",icon:"Tint",bg:"bg-orange-400"},Xe={label:"Date",desc:"Calendar date picker",icon:"Calendar",bg:"bg-indigo-600"},Ye={label:"Time",desc:"Time picker",icon:"CalendarCheck",bg:"bg-purple-600"},Ze={label:"Media",desc:"Files from the asset library",icon:"PhotoVideo",bg:"bg-gray-500"},es={label:"Relation",desc:"Collection relations",icon:"ExchangeAlt",bg:"bg-pink-400"},ss={label:"JSON",desc:"Data in JSON format",icon:"Code",bg:"bg-red-700"},as={text:He,longtext:Ue,richtext:Ge,slug:$e,email:ze,password:Te,number:Je,enumeration:Ke,boolean:Qe,color:We,date:Xe,time:Ye,media:Ze,relation:es,json:ss};function ts({isOpen:$,onClose:x,fieldType:t,collectionId:C,projectId:k,collections:D,collectionFields:w,editField:o,can:z}){var O,E,P,F,R,V,B,H;const{data:a,setData:n,post:T,put:J,delete:K,processing:L,errors:g,reset:A}=te({type:t,label:"",name:"",description:"",placeholder:"",validations:{required:{status:!1,message:""},unique:{status:!1,message:""},charcount:{status:!1,message:"",type:"Between",min:null,max:null}},options:{repeatable:!1,hideInContentList:!1,hiddenInAPI:!1,editor:{type:1},enumeration:{list:[]},multiple:!1,relation:{collection:null,type:1},slug:{field:null,readonly:!1},includeTime:!1,mode:"single",media:{type:1},includeDraft:!1}}),[Q,_]=f.useState(!1);f.useEffect(()=>{o&&n({type:o.type,label:o.label,name:o.name,description:o.description,placeholder:o.placeholder,validations:o.validations,options:o.options})},[o]);const[S,q]=f.useState(""),[W,M]=f.useState(!0),X=()=>{var s;S?(n("options",{...a.options,enumeration:{...a.options.enumeration,list:[...((s=a.options.enumeration)==null?void 0:s.list)||[],S]}}),q(""),M(!0)):M(!1)},Y=s=>{var i;const l=[...((i=a.options.enumeration)==null?void 0:i.list)||[]];l.splice(s,1),n("options",{...a.options,enumeration:{...a.options.enumeration,list:l}})},Z=s=>{s.preventDefault(),o?J(route("projects.collections.fields.update",{project:k,collection:C,field:o.id}),{onSuccess:()=>{u.success("Field updated successfully"),A(),x()},onError:l=>{u.error("Failed to update field"),console.error(l)},preserveScroll:!0}):T(route("projects.collections.fields.store",{project:k,collection:C}),{onSuccess:()=>{u.success("Field created successfully"),A(),x()},onError:l=>{u.error("Failed to create field"),console.error(l)},preserveScroll:!0})},b=s=>{const{name:l,value:i}=s.target;if(l==="label"){const h=oe(i);n(ae=>({...ae,label:i,name:h}))}else n(h=>({...h,[l]:i}))},c=(s,l,i)=>{n(h=>({...h,validations:{...h.validations,[s]:{...h.validations[s],[l]:i}}}))},j=as[t],ee=t!=="boolean",se=()=>{o&&K(route("projects.collections.fields.destroy",{project:k,collection:C,field:o.id}),{onSuccess:()=>{u.success("Field deleted successfully"),A(),x()},onError:s=>{u.error("Failed to delete field"),console.error(s)},preserveScroll:!0})};return e.jsxs(e.Fragment,{children:[e.jsx(ne,{open:$,onOpenChange:x,children:e.jsxs(ie,{className:"sm:max-w-3xl",children:[e.jsxs(de,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3 ml-1",children:[e.jsx("div",{className:re("rounded-md p-2",j.bg),children:le.createElement({TextCursor:G,TextAlignLeft:_e,Link:De,AtSign:Ie,Lock:Se,SortNumericUp:Ae,ListOrdered:Fe,CheckSquare:Ve,Tint:Me,Calendar:we,CalendarCheck:ke,PhotoVideo:Ce,ExchangeAlt:Ee,Code:ye}[j.icon]||G,{className:"text-white"})}),e.jsxs(ce,{children:[o?"Edit":"Add"," ",j.label," Field"]})]}),o&&z.delete_field&&e.jsx(v,{variant:"destructive",onClick:()=>_(!0),className:"mr-4",children:"Delete Field"})]}),e.jsxs(me,{className:"sr-only",children:[o?"Edit":"Add"," a new ",j.label," field to your collection."]})]}),e.jsx(Ne,{className:"h-[80vh] pr-4",children:e.jsxs("form",{onSubmit:Z,className:"space-y-4 overflow-y-auto p-1",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"label",children:"Label"}),e.jsx(m,{id:"label",name:"label",value:a.label,onChange:b,placeholder:"Enter field label",required:!0}),e.jsx(y,{message:g.label})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"name",children:"Field Name"}),e.jsx(m,{id:"name",name:"name",value:a.name,onChange:b,placeholder:"Enter field name",required:!0}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This will be used as the field identifier in the API. It is automatically generated from the label."}),e.jsx(y,{message:g.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"description",children:"Description"}),e.jsx(he,{id:"description",name:"description",value:a.description,onChange:b,placeholder:"Enter field description",rows:3}),e.jsx(y,{message:g.description})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"placeholder",children:"Placeholder"}),e.jsx(m,{id:"placeholder",name:"placeholder",value:a.placeholder,onChange:b,placeholder:"Enter placeholder text"}),e.jsx(y,{message:g.placeholder})]}),t==="slug"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"SLUG OPTIONS"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"attachSlug",children:"Attach slug to a field (optional)"}),e.jsx(I,{isClearable:!0,value:(O=a.options.slug)!=null&&O.field?{value:a.options.slug.field,label:a.options.slug.field}:null,onChange:s=>{n(l=>{var i;return{...l,options:{...l.options,slug:{field:(s==null?void 0:s.value)||null,readonly:((i=l.options.slug)==null?void 0:i.readonly)??!1}}}})},options:w==null?void 0:w.filter(s=>{var l;return s.type==="text"&&!((l=s.options)!=null&&l.repeatable)}).map(s=>({value:s.name,label:s.label}))}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Slug will be generated from the selected field. Only ",e.jsx("strong",{children:"text fields"})," can be selected"]})]}),((E=a.options.slug)==null?void 0:E.field)&&e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400 mt-4",children:[e.jsx(d,{id:"readonly",checked:((P=a.options.slug)==null?void 0:P.readonly)??!1,onCheckedChange:s=>n(l=>{var i;return{...l,options:{...l.options,slug:{field:((i=l.options.slug)==null?void 0:i.field)??null,readonly:s}}}}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"readonly",className:"font-medium",children:"Read Only"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prevents editing slug field"})]})]})]})]}),t==="enumeration"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"ENUMERATION OPTIONS"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"List of Values"}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(m,{value:S,onChange:s=>q(s.target.value),placeholder:"Enter value"}),e.jsx(v,{type:"button",onClick:X,children:"+ Add"})]}),!W&&e.jsx("p",{className:"text-sm text-red-500",children:"! Enter a value"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(F=a.options.enumeration)==null?void 0:F.list.map((s,l)=>e.jsxs("div",{className:"bg-blue-200 dark:bg-blue-700 dark:text-gray-300 rounded-md px-3 py-1 text-sm  items-center gap-2 cursor-pointer hover:bg-blue-100 dark:hover:bg-blue-600",onClick:()=>Y(l),children:[s,e.jsx("i",{className:"fas fa-times-circle"})]},l))}),e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"multiple",checked:a.options.multiple,onCheckedChange:s=>n("options",{...a.options,multiple:s}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"multiple",className:"font-medium",children:"Allow multiple"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Allows multiple values to be selected"})]})]})]})]}),t==="date"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"DATE OPTIONS"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"includeTime",checked:a.options.includeTime,onCheckedChange:s=>n("options",{...a.options,includeTime:s}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"includeTime",className:"font-medium",children:"Include time picker"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Allows time to be selected along with date"})]})]}),e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"range",checked:a.options.mode==="range",onCheckedChange:s=>n("options",{...a.options,mode:s?"range":"single"}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"range",className:"font-medium",children:"Allow range select"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Allows selecting a range of dates"})]})]})]})]}),t==="media"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"MEDIA OPTIONS"}),e.jsxs(U,{value:(R=a.options.media)==null?void 0:R.type.toString(),onValueChange:s=>n("options",{...a.options,media:{...a.options.media,type:parseInt(s)}}),className:"flex space-x-2",children:[e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md flex-1 border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(N,{value:"1",id:"media_single"}),e.jsx(r,{htmlFor:"media_single",className:"font-medium",children:"Single File"})]}),e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md flex-1 border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(N,{value:"2",id:"media_multi"}),e.jsx(r,{htmlFor:"media_multi",className:"font-medium",children:"Multiple Files"})]})]})]}),t==="relation"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"RELATION OPTIONS"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"relationCollection",children:"Relation Collection"}),e.jsx(I,{value:(V=a.options.relation)!=null&&V.collection?{value:a.options.relation.collection,label:((B=D.find(s=>s.id===a.options.relation.collection))==null?void 0:B.name)??""}:null,onChange:s=>{var i;const l=(s==null?void 0:s.value)??null;n("options",{...a.options,relation:{collection:l,type:((i=a.options.relation)==null?void 0:i.type)??1}})},options:D.map(s=>({value:s.id,label:s.name})),placeholder:"Select a collection",isClearable:!0,classNamePrefix:"react-select"})]}),e.jsxs(U,{value:(H=a.options.relation)==null?void 0:H.type.toString(),onValueChange:s=>{var l;return n("options",{...a.options,relation:{collection:((l=a.options.relation)==null?void 0:l.collection)??null,type:parseInt(s)}})},className:"flex space-x-2 mt-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 p-4 rounded-md flex-1 border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(N,{value:"1",id:"relation_one_to_one"}),e.jsx(r,{htmlFor:"relation_one_to_one",className:"font-medium",children:"One to One"})]}),e.jsxs("div",{className:"flex items-center space-x-2 p-4 rounded-md flex-1 border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(N,{value:"2",id:"relation_one_to_many"}),e.jsx(r,{htmlFor:"relation_one_to_many",className:"font-medium",children:"One to Many"})]})]}),e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"includeDraft",checked:a.options.includeDraft??!1,onCheckedChange:s=>n("options",{...a.options,includeDraft:s}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"includeDraft",className:"font-medium",children:"Include Draft"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Allows draft content to be included in the relation"})]})]})]})]}),ee&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"VALIDATIONS"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"required",checked:a.validations.required.status,onCheckedChange:s=>c("required","status",s),className:"mt-1"}),e.jsxs("div",{className:"space-y-1 w-full",children:[e.jsx(r,{htmlFor:"required",className:"font-medium",children:"Required"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prevents saving content if this field is empty"}),a.validations.required.status&&e.jsx(m,{placeholder:"Custom error message",value:a.validations.required.message||"",onChange:s=>c("required","message",s.target.value),className:"mt-2"})]})]}),t!=="richtext"&&t!=="password"&&t!=="enumeration"&&t!=="boolean"&&t!=="color"&&t!=="date"&&t!=="time"&&t!=="media"&&t!=="relation"&&t!=="json"&&e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"unique",checked:a.validations.unique.status,onCheckedChange:s=>c("unique","status",s),disabled:a.options.repeatable,className:"mt-1"}),e.jsxs("div",{className:"space-y-1 w-full",children:[e.jsx(r,{htmlFor:"unique",className:"font-medium",children:"Unique"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.options.repeatable?"Unique validation cannot be used with repeatable fields":"Prevents saving content if this field value is already used"}),a.validations.unique.status&&!a.options.repeatable&&e.jsx(m,{placeholder:"Custom error message",value:a.validations.unique.message||"",onChange:s=>c("unique","message",s.target.value),className:"mt-2"})]})]}),t!=="richtext"&&t!=="enumeration"&&t!=="boolean"&&t!=="color"&&t!=="date"&&t!=="time"&&t!=="media"&&t!=="relation"&&t!=="json"&&e.jsxs("div",{className:"space-y-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsxs("div",{className:"flex items-start space-x-2",children:[e.jsx(d,{id:"charcount",checked:a.validations.charcount.status,onCheckedChange:s=>c("charcount","status",s),className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"charcount",className:"font-medium",children:t==="number"?"Integer limitations":"Character count"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t==="number"?"Specifies a minimum and/or maximum allowed numbers":"Specifies a minimum and/or maximum allowed number of characters"})]})]}),a.validations.charcount.status&&e.jsxs("div",{className:"ml-6 space-y-2",children:[e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(I,{className:"w-[180px]",value:{value:a.validations.charcount.type,label:a.validations.charcount.type},onChange:s=>c("charcount","type",s==null?void 0:s.value),options:[{value:"Between",label:"Between"},{value:"Min",label:"Min"},{value:"Max",label:"Max"}],isClearable:!1}),e.jsxs("div",{className:"flex space-x-2",children:[(a.validations.charcount.type==="Between"||a.validations.charcount.type==="Min")&&e.jsx(m,{type:"number",placeholder:"Min",value:a.validations.charcount.min??"",onChange:s=>c("charcount","min",s.target.value?Number(s.target.value):null),className:"w-24"}),(a.validations.charcount.type==="Between"||a.validations.charcount.type==="Max")&&e.jsx(m,{type:"number",placeholder:"Max",value:a.validations.charcount.max??"",onChange:s=>c("charcount","max",s.target.value?Number(s.target.value):null),className:"w-24"})]})]}),e.jsx(m,{placeholder:"Custom error message",value:a.validations.charcount.message||"",onChange:s=>c("charcount","message",s.target.value)})]})]})]})]}),t!=="password"&&e.jsxs("div",{className:"space-y-4 border-t pt-4",children:[e.jsx("h2",{className:"font-bold",children:"OTHER OPTIONS"}),e.jsxs("div",{className:"space-y-2",children:[t!=="richtext"&&t!=="slug"&&t!=="enumeration"&&t!=="boolean"&&t!=="media"&&t!=="relation"&&t!=="json"&&e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"repeatable",checked:a.options.repeatable,onCheckedChange:s=>{n("options",{...a.options,repeatable:s}),s&&c("unique","status",!1)},className:"mt-1"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(r,{htmlFor:"repeatable",className:"font-medium",children:"Repeatable Field"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Allows multiple values to be added to this field"})]})]}),e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"hideInContentList",checked:a.options.hideInContentList,onCheckedChange:s=>n("options",{...a.options,hideInContentList:s}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1 w-full",children:[e.jsx(r,{htmlFor:"hideInContentList",className:"font-medium",children:"Hide in content list"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prevents this field from being displayed in the content list"})]})]}),e.jsxs("div",{className:"flex items-start space-x-2 p-4 rounded-md border border-dashed border-gray-600 dark:border-gray-400",children:[e.jsx(d,{id:"hiddenInAPI",checked:a.options.hiddenInAPI,onCheckedChange:s=>n("options",{...a.options,hiddenInAPI:s}),className:"mt-1"}),e.jsxs("div",{className:"space-y-1 w-full",children:[e.jsx(r,{htmlFor:"hiddenInAPI",className:"font-medium",children:"Hidden in API"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prevents this field from being included in the API response"})]})]})]})]}),e.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[e.jsx(v,{variant:"outline",type:"button",onClick:x,children:"Cancel"}),e.jsx(v,{type:"submit",disabled:L,children:L?o?"Updating...":"Adding...":o?"Update Field":"Add Field"})]})]})})]})}),e.jsx(ue,{open:Q,onOpenChange:_,children:e.jsxs(pe,{children:[e.jsxs(xe,{children:[e.jsx(ge,{children:"Are you sure you want to delete this field?"}),e.jsx(be,{children:"This action cannot be undone. All content data associated with this field will be lost."})]}),e.jsxs(je,{children:[e.jsx(fe,{children:"Cancel"}),e.jsx(ve,{onClick:se,className:"bg-destructive hover:bg-destructive/90",children:"Delete Field"})]})]})})]})}const ws=Object.freeze(Object.defineProperty({__proto__:null,default:ts},Symbol.toStringTag,{value:"Module"}));export{_e as A,Me as D,ts as F,Ee as G,Fe as L,Ve as S,G as T,ws as a,as as f};
