import{jsx as e,jsxs as r}from"react/jsx-runtime";import{B as m}from"./button-BvFBRYHq.js";import{D as u,a as D,b,c as v,d as S,e as f}from"./dialog-BfGkTFdF.js";import{EventFormFields as C}from"./EventFormFields-CNf7621s.js";import{TemplateSelect as w}from"./TemplateSelect-DfGd1_U3.js";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-dialog";import"lucide-react";import"./label-DMnntKPk.js";import"@radix-ui/react-label";import"./input-qMvM9qch.js";import"./switch-C-6z1FXy.js";import"react";import"@radix-ui/react-switch";import"./MaskSelect-db8-mWU9.js";import"./select-DfhewM4T.js";import"@radix-ui/react-select";function Q({open:s,onOpenChange:a,mode:n,form:i,onSubmit:d,masks:c}){const o=n==="create",l=o?"Create New Event":"Edit Event",p=o?"Create a new registration milestone event with reward.":"Update event details and reward configuration.",g=o?"Create Event":"Save Changes";return e(u,{open:s,onOpenChange:a,children:r(D,{className:"max-w-2xl",children:[r(b,{children:[e(v,{children:l}),e(S,{children:p})]}),r("form",{onSubmit:d,children:[e("div",{className:"mb-4 p-3 bg-muted/50 rounded-lg border border-dashed",children:e(w,{onSelect:t=>{t&&i.setData({...i.data,item_id:String(t.item_id),item_name:t.item_name||"",item_count:String(t.count),protect_type:String(t.proctype),octet:t.octet||"",mask:String(t.mask)})}})}),e(C,{formData:i.data,onFieldChange:(t,h)=>i.setData(t,h),masks:c,idPrefix:n}),r(f,{children:[e(m,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e(m,{type:"submit",disabled:i.processing,children:g})]})]})]})})}export{Q as EventFormDialog};
