PageSourceSearch

https://momowin.ai/build/assets/edit-Cd-otimb.js

js momowin.ai collected 2026-10-05 12:18:06 UTC 3,834 bytes, 1 lines download raw bytes

1import{u as e,c as s,j as r,H as t}from"./app-8BGoMeoF.js";import{B as i}from"./button-tZFMKeJc.js";import{C as a}from"./checkbox-DrePgi_A.js";import{I as o}from"./input-CFz7cti6.js";import{L as d}from"./label-rOjb96Kt.js";import{A as l}from"./app-layout-Ben2AKH_.js";import{a as n,u as m}from"./index-Dj8d3sfY.js";/* empty css            */import"./index-ClU6SMsh.js";import"./utils-Gh3qGYQG.js";import"./index-CGjuUuKM.js";import"./index-DP4g_nWX.js";import"./index-DPxxhbm8.js";import"./index-DvGf2Ovk.js";import"./check-BJJUjtD3.js";import"./createLucideIcon-9ZsJPtOG.js";import"./index-Bd9-ZKTV.js";import"./index-BQAJ9Hay.js";import"./index-5YTGFVjL.js";import"./x-qbLtqKem.js";import"./index-DVE4Z3g9.js";import"./use-translations-97pI6kOj.js";import"./index-kwMATVaW.js";import"./globe-BmDcP3U6.js";import"./index-tP_aniLQ.js";import"./dropdown-menu-B7FjJRsm.js";import"./index-CIKlOljv.js";import"./chevrons-up-down-CEFVmjeW.js";import"./index-Dv5l98Q-.js";import"./index-CoWK8FkW.js";import"./index-ByU783J8.js";import"./chevron-right-BMj6lg9c.js";function p({user:p,roles:c,isAdmin:x}){const{auth:j}=e().props,u=j.permissions.includes("assign-roles"),h=[{title:x?"Admins":"Users",href:x?n.index().url:m.index().url},{title:x?"Edit Admin":"Edit User",href:"#"}],f=p.roles?.map(e=>e.id)||[],b=s({name:p.name||"",email:p.email||"",password:"",roles:f});return r.jsxs(l,{breadcrumbs:h,children:[r.jsx(t,{title:x?"Edit Admin":"Edit User"}),r.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 overflow-x-auto rounded-xl p-4 xl:mx-auto xl:w-lg",children:[r.jsxs("h1",{className:"text-xl font-bold",children:[x?"Edit Admin":"Edit User",": ",p.name]}),r.jsxs("form",{onSubmit:e=>{e.preventDefault(),b.patch(x?n.update({user:p.id}).url:m.update({user:p.id}).url,{onSuccess:()=>{b.reset("password")}})},className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(d,{htmlFor:"name",children:"Name"}),r.jsx(o,{id:"name",type:"text",value:b.data.name,onChange:e=>b.setData("name",e.target.value),required:!0}),b.errors.name&&r.jsx("p",{className:"text-sm text-red-500",children:b.errors.name})]}),r.jsxs("div",{children:[r.jsx(d,{htmlFor:"email",children:"Email"}),r.jsx(o,{id:"email",type:"email",value:b.data.email,onChange:e=>b.setData("email",e.target.value),required:!0}),b.errors.email&&r.jsx("p",{className:"text-sm text-red-500",children:b.errors.email})]}),r.jsxs("div",{children:[r.jsx(d,{htmlFor:"password",children:"Password (leave blank to keep current)"}),r.jsx(o,{id:"password",type:"password",value:b.data.password,onChange:e=>b.setData("password",e.target.value),placeholder:"Leave blank to keep current password"}),b.errors.password&&r.jsx("p",{className:"text-sm text-red-500",children:b.errors.password})]}),x&&u&&c.length>0&&r.jsxs("div",{children:[r.jsx(d,{className:"text-base",children:"Roles"}),r.jsx("div",{className:"mt-3 space-y-3 rounded-md border p-4",children:c.map(e=>r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(a,{id:`role-${e.id}`,checked:b.data.roles.includes(e.id),onCheckedChange:s=>((e,s)=>{s?b.setData("roles",[...b.data.roles,e]):b.setData("roles",b.data.roles.filter(s=>s!==e))})(e.id,s)}),r.jsx("label",{htmlFor:`role-${e.id}`,className:"cursor-pointer text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e.name})]},e.id))}),(b.errors.roles||Object.keys(b.errors).some(e=>e.startsWith("roles.")))&&r.jsx("p",{className:"mt-1 text-sm text-red-500",children:b.errors.roles||Object.entries(b.errors).filter(([e])=>e.startsWith("roles.")).map(([,e])=>e).join(" ")})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(i,{type:"submit",disabled:b.processing,children:"Update User"}),r.jsx(i,{type:"button",variant:"outline",onClick:()=>window.history.back(),children:"Cancel"})]})]})]})]})}export{p 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.