1import{i as h,t as b}from"./react-C6JdJxIB.js";import{t as f}from"./jsx-runtime-CGXBp6bb.js";import{t as j}from"./FormSelectInput-BdHVu58Z.js";import{t as N}from"./FormOffcanvas-Dh4a-3SG.js";import{t as v}from"./TenantRegistrationFields-ykODWMj0.js";var P=h(b(),1),e=f();function w({languages:o,value:l,onChange:t,error:a,label:i="Tenant Languages"}){const n=Array.isArray(l)?l:[],d=s=>{if(n.includes(s)){t(n.filter(r=>r!==s));return}t([...n,s])};return(0,e.jsxs)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4",children:[(0,e.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-semibold text-slate-800",children:i}),(0,e.jsx)("p",{className:"text-xs text-slate-500",children:"Choose which languages this tenant can use."})]}),(0,e.jsxs)("span",{className:"rounded-full border border-slate-200 bg-white px-2.5 py-1 text-[11px] font-semibold text-slate-500",children:[n.length," selected"]})]}),(0,e.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:o.map(s=>{const r=n.includes(s.code);return(0,e.jsxs)("label",{className:`flex cursor-pointer items-start gap-3 rounded-xl border px-3 py-2.5 transition-colors ${r?"border-indigo-300 bg-indigo-50":"border-slate-200 bg-white hover:border-slate-300"}`,children:[(0,e.jsx)("input",{type:"checkbox",checked:r,onChange:()=>d(s.code),className:"mt-0.5 h-4 w-4 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500"}),(0,e.jsxs)("span",{className:"min-w-0",children:[(0,e.jsx)("span",{className:"block text-sm font-medium text-slate-800",children:s.name}),(0,e.jsx)("span",{className:"block text-xs uppercase tracking-wide text-slate-400",children:s.code})]})]},s.code)})}),a&&(0,e.jsx)("p",{className:"mt-2 text-xs text-rose-600",children:a})]})}function L({isOpen:o,onClose:l,form:t,errors:a,languages:i,tenantTypes:n,rootDomain:d,planOptions:s,onSubmit:r,onFieldChange:c,onPlanChange:p,submitLabel:u="Create Tenant"}){return(0,e.jsxs)(N,{isOpen:o,onClose:l,title:"Add New Tenant",fields:[],data:t.data,setData:c,onSubmit:r,processing:t.processing,errors:a,submitLabel:u,children:[(0,e.jsx)(v,{data:t.data,errors:a,onFieldChange:c,tenantTypes:n,rootDomain:d,showTenantType:!0,showPasswords:!0}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("label",{htmlFor:"offcanvas-plan_id",className:"form-label text-sm font-medium text-gray-700",children:["Plan",(0,e.jsx)("span",{className:"ms-0.5 text-rose-500",children:"*"})]}),(0,e.jsx)(j,{id:"offcanvas-plan_id",name:"plan_id",label:null,value:t.data.plan_id??"",onChange:p,options:s,error:a.plan_id,placeholder:"â Select â",selectClassName:"select w-full rounded-xl border border-gray-200 bg-gray-50 px-4 py-2.5 text-sm text-gray-800 transition-colors focus:border-indigo-400 focus:bg-white focus:outline-none focus:ring-2 focus:ring-indigo-100",eventNamespace:"select2-add-tenant-plan",resolveDropdownParent:(x,g)=>{const m=x.closest(".offcanvas");return m.length?m:g(document.body)}})]}),(0,e.jsx)(w,{languages:i,value:t.data.langs,onChange:x=>c("langs",x),error:a.langs,label:"Tenant Languages"}),(0,e.jsx)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4 text-xs text-slate-500",children:"Choose a tenant type first, then pick one of its matching plans."})]})}export{L as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.