PageSourceSearch

https://portal.enlassa.ai/assets/workflows-DZWNEGch.js

js enlassa.ai collected 2026-10-05 15:19:06 UTC 6,334 bytes, 1 lines download raw bytes

1import{ai as T,aa as h,a4 as o,S as d,B as N}from"./embed-DzZnFwh5.js";import{eD as G,dK as M,e9 as K,dR as W,es as $,cs as H,bo as A,d9 as u,bC as j,bA as g,bR as Q,bx as k,cc as U,G as V,s as D,bu as X,c1 as J,d as Y,cl as Z,dF as S,cy as x}from"./index-CHBia7bu.js";import{B as v,E as _}from"./MarkdownMessage-C9y0smex.js";import{l as aa,m as oa}from"./flow-pestanas-B6clLabv.js";import{P}from"./power-ozOlWZsW.js";import{O as F}from"./octagon-x-_kBPsfGi.js";function ia(){const{t:a}=T("misc"),L=G(l=>l.resolved),n=M(),y=K(),C=W(),r=$({queryKey:["admin-orgs-min"],queryFn:async()=>(await H.get("/admin/organizations")).data.items}),[f,O]=h.useState(""),[i,q]=h.useState(""),c=h.useMemo(()=>(r.data??[]).filter(l=>!l.archivedAt).sort((l,e)=>l.name.localeCompare(e.name)),[r.data]),R=l=>c.find(e=>e.id===l)?.name??l,m=async l=>{try{await y.mutateAsync(l)}catch(e){S({tone:"bad",title:a("flows.pantallas.plataforma.falloAlGuardar"),desc:u(e,a("flows.modulo.errorGenerico"))})}},E=async l=>{if(l)return m({enabled:!0});await x({danger:!0,title:a("flows.pantallas.plataforma.apagar.titulo"),message:a("flows.pantallas.plataforma.apagar.mensaje"),confirmLabel:a("flows.pantallas.plataforma.apagar.confirmar")})&&await m({enabled:!1})},z=async(l,e)=>{await x({danger:l==="todas"||e.length===0,title:a(`flows.pantallas.plataforma.modulo.confirmar.${l}Titulo`),message:l==="todas"?a("flows.pantallas.plataforma.modulo.confirmar.todas"):a("flows.pantallas.plataforma.modulo.confirmar.algunas",{count:e.length}),confirmLabel:a("flows.pantallas.plataforma.modulo.confirmar.si")})&&await m({enabledOrgIds:l==="todas"?null:e})},B=()=>{if(!i)return;const l=R(i);x({danger:!0,title:a("flows.pantallas.plataforma.freno.confirmarTitulo",{nombre:l}),message:a("flows.pantallas.plataforma.freno.confirmarMensaje"),confirmLabel:a("flows.pantallas.plataforma.freno.confirmar"),onConfirm:async()=>{try{const e=await C.mutateAsync(i);S({tone:e.canceladas>0?"ok":"info",title:a("flows.pantallas.plataforma.freno.listo",{count:e.canceladas,nombre:l})})}catch(e){throw new Error(u(e,a("flows.pantallas.plataforma.freno.fallo")))}}})},t=n.data,w=t?aa(t):null;let p;if(n.isLoading)p=o.jsxs("div",{className:"cia-flujo-registro-esqueleto","aria-busy":"true",children:[o.jsx(d,{h:140,r:14}),o.jsx(d,{h:260,r:14}),o.jsx(d,{h:140,r:14})]});else if(n.isError||!t)p=o.jsx(v,{tone:"bad",actionPlacement:"end",action:{label:a("flows.modulo.reintentar"),icon:A,loading:n.isFetching,onClick:()=>void n.refetch()},children:u(n.error,a("flows.pantallas.plataforma.errorAlCargar"))});else{const l=t.enabledOrgIds!==null,e=t.enabledOrgIds??[],b=c.filter(s=>!f.trim()||s.name.toLowerCase().includes(f.trim().toLowerCase())||s.id.includes(f.trim()));p=o.jsxs(o.Fragment,{children:[o.jsx(v,{tone:w==="apagado"||w==="ninguna"?"warn":"info",children:a(`flows.pantallas.plataforma.alcance.${w}`,{count:e.length})}),o.jsxs(j,{title:a("flows.pantallas.plataforma.modulo.titulo"),description:a("flows.pantallas.plataforma.modulo.desc"),icon:P,children:[o.jsx(g,{icon:P,title:a("flows.pantallas.plataforma.modulo.encendido"),description:a(t.enabled?"flows.pantallas.plataforma.modulo.encendidoDesc":"flows.pantallas.plataforma.modulo.apagadoDesc"),control:o.jsx(Q,{checked:t.enabled,onChange:s=>E(s)})}),o.jsx(g,{dependent:!0,title:a("flows.pantallas.plataforma.modulo.quien"),description:a(l?"flows.pantallas.plataforma.modulo.quienAlgunas":"flows.pantallas.plataforma.modulo.quienTodas"),disabled:!t.enabled,disabledReason:t.enabled?void 0:a("flows.pantallas.plataforma.modulo.encendeloPrimero"),control:o.jsx(k,{value:l?"algunas":"todas",onChange:s=>void z(s==="todas"?"todas":"algunas",e),options:[{value:"todas",label:a("flows.pantallas.plataforma.modulo.todas")},{value:"algunas",label:a("flows.pantallas.plataforma.modulo.algunas")}]})})]}),l?o.jsx(j,{title:a("flows.pantallas.plataforma.piloto.titulo"),description:a("flows.pantallas.plataforma.piloto.desc",{count:e.length}),icon:U,aside:o.jsx(X,{value:f,onChange:O,placeholder:a("flows.pantallas.plataforma.piloto.buscar"),"aria-label":a("flows.pantallas.plataforma.piloto.buscar"),size:"sm"}),children:r.isLoading?o.jsxs("div",{className:"cia-flujo-registro-esqueleto","aria-busy":"true",children:[o.jsx(d,{h:32,r:8}),o.jsx(d,{h:32,r:8}),o.jsx(d,{h:32,r:8})]}):r.isError?o.jsx(v,{tone:"bad",actionPlacement:"end",action:{label:a("flows.modulo.reintentar"),icon:A,onClick:()=>void r.refetch()},children:u(r.error,a("flows.pantallas.plataforma.piloto.errorOrgs"))}):b.length?o.jsx("div",{className:"cia-flujo-orgs cia-scroll",role:"group","aria-label":a("flows.pantallas.plataforma.piloto.titulo"),children:b.map(s=>
1o.jsx(V,{checked:e.includes(s.id),disabled:!t.enabled||y.isPending,onChange:I=>void m({enabledOrgIds:oa(e,s.id,I)}),label:s.name,description:s.isInternal?a("flows.pantallas.plataforma.piloto.interna",{id:s.id}):s.id},s.id))}):o.jsx(_,{mini:!0,icon:D,title:a("flows.pantallas.plataforma.piloto.sinResultados")})}):null,o.jsxs(j,{title:a("flows.pantallas.plataforma.freno.titulo"),description:a("flows.pantallas.plataforma.freno.desc"),icon:F,children:[o.jsx(g,{icon:D,title:a("flows.pantallas.plataforma.freno.organizacion"),description:a("flows.pantallas.plataforma.freno.organizacionDesc"),disabled:!c.length,disabledReason:c.length?void 0:a("flows.pantallas.plataforma.freno.cargandoOrgs"),control:o.jsx(k,{value:i,onChange:q,placeholder:a("flows.pantallas.plataforma.freno.elegi"),options:c.map(s=>({value:s.id,label:s.name}))})}),o.jsx(g,{dependent:!0,title:a("flows.pantallas.plataforma.freno.accion"),description:a("flows.pantallas.plataforma.freno.accionDesc"),control:o.jsx(N,{variant:"danger",icon:o.jsx(F,{}),disabled:!i,disabledReason:i?void 0:a("flows.pantallas.plataforma.freno.eligePrimero"),loading:C.isPending,onClick:B,children:a("flows.pantallas.plataforma.freno.boton")})})]})]})}return o.jsxs(o.Fragment,{children:[o.jsx(J,{eyebrow:a("flows.modulo.admin.eyebrow"),title:a("flows.modulo.admin.titulo"),titleAs:"div"}),o.jsx("main",{className:"cia flex-1 overflow-y-auto cia-scroll","data-theme":L,style:{background:"var(--cia-bg)",color:"var(--cia-text)"},children:o.jsxs("div",{className:"cia-flujos-pagina",children:[o.jsx(Y,{eyebrow:a("flows.modulo.admin.eyebrow"),title:a("flows.modulo.admin.titulo"),subtitle:a("flows.modulo.admin.subtitulo"),icon:Z}),p]})})]})}export{ia 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.