PageSourceSearch

https://www.teamazing.de/assets/SuperAdminInstructionsDebug-DXEuXNRr.js

js teamazing.de collected 2026-10-05 03:23:16 UTC 25,997 bytes, 1 lines download raw bytes

1import{d as je,o as Ae,m as V,f as a,r as p,e as l,b as i,D as k,h as n,B as w,C as z,t as u,V as f,n as Le,dq as j,c as _,k as A,F as L,j as g,e7 as Oe,E as te,dr as le,O as ae,b3 as oe,cN as $e,q as Me,aj as Be,y as m}from"./main-6eULpPZN.js";import{u as Pe,v as Ne,ah as qe,W as Ee,X as xe,Y as Ge,ai as Re,aj as Ke}from"./super-admin-requests-6xJF1jRX.js";import{V as We}from"./VContainer-CIqUGvYe.js";import{V as v}from"./VCol-T0yZS7Gd.js";import{V as O}from"./VRow-DdNytAWq.js";import{V as y}from"./VChip-DwrVeitf.js";import{b as $}from"./VSelect-Ce7Epw6d.js";import{V as D}from"./VTextField-BC1sheCz.js";import{V as Xe,a as Ye}from"./VDataTable-CEi3h-6Q.js";import{V as He}from"./VSheet-DJMWeSuF.js";import{V as Je}from"./VForm-4eKycqwE.js";import{V as Qe}from"./VSwitch-DDZBc8zO.js";import{V as Ze}from"./VTextarea-CBGvOFXo.js";import{V as ie}from"./VCombobox-BZeVsWU-.js";import"./tools-debug-requests-CDpkExM8.js";import"./index-TH8tcqBw.js";import"./VSlideGroup-D-nzjqJs.js";import"./VInput-Bb5A33u7.js";import"./autofocus-C0Pbn5uX.js";import"./VList-CYW22sXU.js";import"./ssrBoot-RLhal8Kz.js";import"./VMenu-BmQ98oE9.js";import"./VCheckboxBtn-DNDJzlZs.js";import"./VSelectionControl-BYoq2oep.js";import"./VTable-BEMF0jf7.js";import"./filter-D-cipF7x.js";const he={class:"d-flex align-center justify-space-between mb-4"},et={class:"d-flex align-center justify-space-between"},tt={class:"text-h5 font-weight-bold"},lt={class:"d-flex align-center justify-space-between"},at={class:"text-h5 font-weight-bold text-success"},ot={class:"d-flex align-center justify-space-between"},it={class:"d-flex align-center justify-space-between"},st={class:"text-h5 font-weight-bold"},nt={class:"text-body-2 font-weight-medium"},ut={key:0,class:"text-grey text-body-2"},rt={class:"text-body-2 font-weight-medium"},dt={key:0,class:"text-grey text-body-2"},ct={class:"text-body-2 font-weight-medium"},vt={key:0,class:"text-grey text-body-2"},mt={class:"text-body-2"},pt={class:"text-body-2 font-weight-medium"},ft={class:"text-caption text-grey"},_t={class:"text-body-2"},yt={class:"d-flex align-center justify-space-between px-4 py-2"},gt={class:"text-caption text-grey"},bt={class:"d-flex flex-wrap ga-2 mb-4"},xt={class:"mb-3"},Vt={class:"text-body-2"},kt={class:"text-body-2"},wt={class:"text-body-2"},Ct={class:"text-body-2"},It={key:0,class:"mb-3"},zt={class:"d-flex flex-wrap ga-1"},Ut={key:1,class:"mb-3"},St={class:"d-flex flex-wrap ga-1"},Dt={key:2,class:"mb-3"},Tt={class:"d-flex flex-wrap ga-1"},Ft={class:"mb-3"},jt={class:"text-body-2",style:{"white-space":"pre-wrap","word-break":"break-word"}},At={class:"d-flex ga-4 text-caption text-grey"},nl=je({__name:"SuperAdminInstructionsDebug",setup(Lt){const T=p(!1),G=p(!1),b=p(null),R=p([]),N=p(0),q=p(1),K=p(50),x=p({}),W=p([]),X=p([]),se=p([]),Ve=[{title:"Active",value:"true"},{title:"Inactive",value:"false"}],F=p(!1),r=p(null),M=p(!1),E=p(null),U=p(!1),Y=p(!1),H=p(null),ne=p([]),ue=()=>({scope:"global",person_id:null,org_unit_id:null,company_id:null,slug:"",title:"",content:"",instruction_type:"guideline",tags:[],auto_load_for_intents:[],auto_load_for_tools:[],is_active:!0,priority:0}),s=p(ue()),B=p({show:!1,text:"",color:"success"}),ke=Me(()=>Math.ceil(N.value/K.value)),we=[{title:"",key:"is_active",width:"40px",sortable:!1},{title:"Title",key:"title",sortable:!1},{title:"Scope",key:"scope",width:"100px",sortable:!1},{title:"Type",key:"instruction_type",width:"110px",sortable:!1},{title:"Source",key:"source_type",width:"110px",sortable:!1},{title:"Tokens",key:"token_estimate",width:"90px",sortable:!1},{title:"Priority",key:"priority",width:"80px",sortable:!1},{title:"Updated",key:"updated_at",width:"140px",sortable:!1},{title:"",key:"actions",width:"90px",sortable:!1}];function J(o){return{global:"deep-purple",company:"blue",org_unit:"teal",user:"green"}[o]||"grey"}function Q(o){return{procedure:"blue",guideline:"green",playbook:"orange",policy:"red"}[o]||"grey"}function Z(o){return{admin:"primary",ai_generated:"purple",imported:"teal"}[o]||"grey"}function h(o){return o.toLocaleString()}function ee(o){return o?new Date(o).toLocaleDateString("de-AT",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"-"}async function P(){T.value=!0;try{b.value=await Pe()}catch(o){console.error("Failed to load stats:",o)}finally{T.value=!1}}async function C(){G.value=!0;try{const o=await Ne({...x.value,page:q.value,per_page:K.value});R.value=o.items||[],N.value=o.total_count}catch(o){console.error("Failed to load instructions:",o)}finally{G.value=!1}}async function Ce(){try{const o=await qe();W.value=o.scopes||[],X.value=o.types||[],se.value=o.sources||[],ne.value=o.intents||[]}catch(o){console.error("Failed to load lookups:",o)}}async function Ie(o){try{r.value=await Ee(o.instruction_id),F.value=!0}catch(e){console.error("Failed to load detail:",e),I("Failed to load instruction details","error")}}async function ze(o){try{const e=await xe(o.instruction_id);
1o.is_active=e.is_active,I(`Instruction ${e.is_active?"activated":"deactivated"}`,e.is_active?"success":"warning"),P()}catch(e){console.error("Failed to toggle:",e),I("Failed to toggle instruction","error")}}async function Ue(){var o;if((o=r.value)!=null&&o.instruction)try{const e=r.value.instruction.instruction_id,t=await xe(e);r.value.instruction.is_active=t.is_active;const d=R.value.find(S=>S.instruction_id===e);d&&(d.is_active=t.is_active),I(`Instruction ${t.is_active?"activated":"deactivated"}`,t.is_active?"success":"warning"),P()}catch{I("Failed to toggle instruction","error")}}function Se(o){E.value=o,M.value=!0}async function De(){if(E.value)try{await Ge(E.value.instruction_id),M.value=!1,I("Instruction deleted","success"),C(),P()}catch(o){console.error("Failed to delete:",o),I("Failed to delete instruction","error")}}function Te(){s.value=ue(),U.value=!0}function Fe(o){s.value={instruction_id:o.instruction_id,scope:o.scope,person_id:o.person_id??null,org_unit_id:o.org_unit_id??null,company_id:o.company_id??null,slug:o.slug,title:o.title,content:o.content,instruction_type:o.instruction_type,tags:o.tags??[],auto_load_for_intents:o.auto_load_for_intents??[],auto_load_for_tools:o.auto_load_for_tools??[],is_active:o.is_active,priority:o.priority},F.value=!1,U.value=!0}async function re(){if(H.value){const{valid:o}=await H.value.validate();if(!o)return}Y.value=!0;try{const o={scope:s.value.scope,person_id:s.value.person_id||void 0,org_unit_id:s.value.org_unit_id||void 0,company_id:s.value.company_id||void 0,slug:s.value.slug,title:s.value.title,content:s.value.content,instruction_type:s.value.instruction_type,tags:s.value.tags,auto_load_for_intents:s.value.auto_load_for_intents,auto_load_for_tools:s.value.auto_load_for_tools,is_active:s.value.is_active,priority:s.value.priority};s.value.instruction_id?(await Re(s.value.instruction_id,o),I("Instruction updated","success")):(await Ke(o),I("Instruction created","success")),U.value=!1,C(),P()}catch(o){console.error("Failed to save instruction:",o),I(Be(o)||"Failed to save instruction","error")}finally{Y.value=!1}}function I(o,e){B.value={show:!0,text:o,color:e}}return Ae(()=>{P(),Ce(),C()}),(o,e)=>(m(),V(We,{fluid:""},{default:a(()=>[l(O,null,{default:a(()=>[l(v,{cols:"12"},{default:a(()=>[e[33]||(e[33]=i("h2",{class:"text-h4 mb-2"},"Instructions Debug",-1)),i("div",he,[e[32]||(e[32]=i("p",{class:"text-medium-emphasis mb-0"}," Manage and inspect the Unified Instruction Management System. View active instructions, token budgets, and auto-load mappings. ",-1)),l(k,{color:"primary","prepend-icon":"mdi-plus",onClick:Te},{default:a(()=>[...e[31]||(e[31]=[n(" Create Instruction ",-1)])]),_:1})])]),_:1})]),_:1}),l(O,{class:"mb-4"},{default:a(()=>[l(v,{cols:"12",md:"3"},{default:a(()=>[l(w,{loading:T.value},{default:a(()=>[l(z,null,{default:a(()=>{var t;return[i("div",et,[i("div",null,[e[34]||(e[34]=i("div",{class:"text-caption text-grey-darken-1"}," Total Instructions ",-1)),i("div",tt,u(((t=b.value)==null?void 0:t.total_count)??0),1)]),l(f,{size:"32",color:"primary"},{default:a(()=>[...e[35]||(e[35]=[n("mdi-file-document-multiple",-1)])]),_:1})])]}),_:1})]),_:1},8,["loading"])]),_:1}),l(v,{cols:"12",md:"3"},{default:a(()=>[l(w,{loading:T.value},{default:a(()=>[l(z,null,{default:a(()=>{var t;return[i("div",lt,[i("div",null,[e[36]||(e[36]=i("div",{class:"text-caption text-grey-darken-1"},"Active",-1)),i("div",at,u(((t=b.value)==null?void 0:t.active_count)??0),1)]),l(f,{size:"32",color:"success"},{default:a(()=>[...e[37]||(e[37]=[n("mdi-check-circle",-1)])]),_:1})])]}),_:1})]),_:1},8,["loading"])]),_:1}),l(v,{cols:"12",md:"3"},{default:a(()=>[l(w,{loading:T.value},{default:a(()=>[l(z,null,{default:a(()=>{var t,d;return[i("div",ot,[i("div",null,[e[38]||(e[38]=i("div",{class:"text-caption text-grey-darken-1"},"Inactive",-1)),i("div",{class:Le(["text-h5 font-weight-bold",(((t=b.value)==null?void 0:t.inactive_count)??0)>0?"text-warning":"text-success"])},u(((d=b.value)==null?void 0:d.inactive_count)??0),3)]),l(f,{size:"32",color:"warning"},{default:a(()=>[...e[39]||(e[39]=[n("mdi-pause-circle",-1)])]),_:1})])]}),_:1})]),_:1},8,["loading"])]),_:1}),l(v,{cols:"12",md:"3"},{default:a(()=>[l(w,{loading:T.value},{default:a(()=>[l(z,null,{default:a(()=>{var t;return[i("div",it,[i("div",null,[e[40]||(e[40]=i("div",{class:"text-caption text-grey-darken-1"}," Total Tokens (Active) ",-1)),i("div",st,u(h(((t=b.value)==null?void 0:t.total_tokens)??0)),1)]),l(f,{size:"32",color:"info"},{default:a(()=>[...e[41]||(e[41]=[n("mdi-counter",-1)])]),_:1})])]}),_:1})]),_:1},8,["loading"])]),_:1})]),_:1}),b.value?(m(),V(O,{key:0,class:"mb-4"},{default:a(()=>[l(v,{cols:"12",md:"4"},{default:a(()=>[l(w,null,{default:a(()=>[l(j,{class:"text-subtitle-1"},{default:a(()=>[...e[42]||(e[42]=[n("By Scope",-1)])]),_:1}),l(z,null,{default:a(()=>[(m(!0),_(L,null,A(b.value.by_scope,(t,d)=>(m(),_("div",{key:d,class:"d-flex justify-space-between align-center mb-1"}
1,[l(y,{size:"small",color:J(d),variant:"tonal"},{default:a(()=>[n(u(d),1)]),_:2},1032,["color"]),i("span",nt,u(t),1)]))),128)),Object.keys(b.value.by_scope).length===0?(m(),_("div",ut," No active instructions ")):g("",!0)]),_:1})]),_:1})]),_:1}),l(v,{cols:"12",md:"4"},{default:a(()=>[l(w,null,{default:a(()=>[l(j,{class:"text-subtitle-1"},{default:a(()=>[...e[43]||(e[43]=[n("By Type",-1)])]),_:1}),l(z,null,{default:a(()=>[(m(!0),_(L,null,A(b.value.by_type,(t,d)=>(m(),_("div",{key:d,class:"d-flex justify-space-between align-center mb-1"},[l(y,{size:"small",color:Q(d),variant:"tonal"},{default:a(()=>[n(u(d),1)]),_:2},1032,["color"]),i("span",rt,u(t),1)]))),128)),Object.keys(b.value.by_type).length===0?(m(),_("div",dt," No active instructions ")):g("",!0)]),_:1})]),_:1})]),_:1}),l(v,{cols:"12",md:"4"},{default:a(()=>[l(w,null,{default:a(()=>[l(j,{class:"text-subtitle-1"},{default:a(()=>[...e[44]||(e[44]=[n("By Source",-1)])]),_:1}),l(z,null,{default:a(()=>[(m(!0),_(L,null,A(b.value.by_source,(t,d)=>(m(),_("div",{key:d,class:"d-flex justify-space-between align-center mb-1"},[l(y,{size:"small",color:Z(d),variant:"tonal"},{default:a(()=>[n(u(d),1)]),_:2},1032,["color"]),i("span",ct,u(t),1)]))),128)),Object.keys(b.value.by_source).length===0?(m(),_("div",vt," No active instructions ")):g("",!0)]),_:1})]),_:1})]),_:1})]),_:1})):g("",!0),l(O,{class:"mb-2"},{default:a(()=>[l(v,{cols:"12",md:"3"},{default:a(()=>[l($,{modelValue:x.value.scope,"onUpdate:modelValue":[e[0]||(e[0]=t=>x.value.scope=t),C],items:W.value,label:"Scope",clearable:"",density:"compact",variant:"outlined"},null,8,["modelValue","items"])]),_:1}),l(v,{cols:"12",md:"3"},{default:a(()=>[l($,{modelValue:x.value.type,"onUpdate:modelValue":[e[1]||(e[1]=t=>x.value.type=t),C],items:X.value,label:"Type",clearable:"",density:"compact",variant:"outlined"},null,8,["modelValue","items"])]),_:1}),l(v,{cols:"12",md:"2"},{default:a(()=>[l($,{modelValue:x.value.source,"onUpdate:modelValue":[e[2]||(e[2]=t=>x.value.source=t),C],items:se.value,label:"Source",clearable:"",density:"compact",variant:"outlined"},null,8,["modelValue","items"])]),_:1}),l(v,{cols:"12",md:"2"},{default:a(()=>[l($,{modelValue:x.value.active,"onUpdate:modelValue":[e[3]||(e[3]=t=>x.value.active=t),C],items:Ve,label:"Status",clearable:"",density:"compact",variant:"outlined"},null,8,["modelValue"])]),_:1}),l(v,{cols:"12",md:"2"},{default:a(()=>[l(D,{modelValue:x.value.search,"onUpdate:modelValue":e[4]||(e[4]=t=>x.value.search=t),label:"Search",clearable:"",density:"compact",variant:"outlined","prepend-inner-icon":"mdi-magnify",onKeyup:Oe(C,["enter"]),"onClick:clear":e[5]||(e[5]=t=>{x.value.search="",C()})},null,8,["modelValue"])]),_:1})]),_:1}),l(w,{loading:G.value},{default:a(()=>[l(Xe,{headers:we,items:R.value,"items-per-page":K.value,page:q.value,"item-value":"instruction_id",class:"elevation-0",density:"compact",hover:"","onClick:row":e[7]||(e[7]=(t,d)=>Ie(d.item))},{"item.is_active":a(({item:t})=>[l(f,{color:t.is_active?"success":"grey",size:"small"},{default:a(()=>[n(u(t.is_active?"mdi-check-circle":"mdi-close-circle"),1)]),_:2},1032,["color"])]),"item.scope":a(({item:t})=>[l(y,{size:"x-small",color:J(t.scope),variant:"tonal"},{default:a(()=>[n(u(t.scope),1)]),_:2},1032,["color"])]),"item.instruction_type":a(({item:t})=>[l(y,{size:"x-small",color:Q(t.instruction_type),variant:"tonal"},{default:a(()=>[n(u(t.instruction_type),1)]),_:2},1032,["color"])]),"item.source_type":a(({item:t})=>[l(y,{size:"x-small",color:Z(t.source_type),variant:"outlined"},{default:a(()=>[n(u(t.source_type),1)]),_:2},1032,["color"])]),"item.token_estimate":a(({item:t})=>[i("span",mt,u(h(t.token_estimate)),1)]),"item.title":a(({item:t})=>[i("span",pt,u(t.title.length>50?t.title.substring(0,47)+"...":t.title),1)]),"item.updated_at":a(({item:t})=>[i("span",ft,u(ee(t.updated_at)),1)]),"item.priority":a(({item:t})=>
1[i("span",_t,u(t.priority),1)]),"item.actions":a(({item:t})=>[l(k,{icon:"",size:"x-small",variant:"text",color:t.is_active?"warning":"success",onClick:te(d=>ze(t),["stop"]),title:t.is_active?"Deactivate":"Activate"},{default:a(()=>[l(f,{size:"small"},{default:a(()=>[n(u(t.is_active?"mdi-pause":"mdi-play"),1)]),_:2},1024)]),_:2},1032,["color","onClick","title"]),l(k,{icon:"",size:"x-small",variant:"text",color:"error",onClick:te(d=>Se(t),["stop"]),title:"Delete"},{default:a(()=>[l(f,{size:"small"},{default:a(()=>[...e[45]||(e[45]=[n("mdi-delete",-1)])]),_:1})]),_:1},8,["onClick"])]),bottom:a(()=>[i("div",yt,[i("span",gt,u(N.value)+" instruction"+u(N.value!==1?"s":"")+" total ",1),l(Ye,{modelValue:q.value,"onUpdate:modelValue":[e[6]||(e[6]=t=>q.value=t),C],length:ke.value,"total-visible":5,density:"compact"},null,8,["modelValue","length"])])]),_:1},8,["items","items-per-page","page"])]),_:1},8,["loading"]),l(oe,{modelValue:F.value,"onUpdate:modelValue":e[11]||(e[11]=t=>F.value=t),"max-width":"800",scrollable:""},{default:a(()=>[r.value?(m(),V(w,{key:0},{default:a(()=>[l(j,{class:"d-flex align-center justify-space-between"},{default:a(()=>{var t;return[i("span",null,u((t=r.value.instruction)==null?void 0:t.title),1),l(k,{icon:"",variant:"text",onClick:e[8]||(e[8]=d=>F.value=!1)},{default:a(()=>[l(f,null,{default:a(()=>[...e[46]||(e[46]=[n("mdi-close",-1)])]),_:1})]),_:1})]}),_:1}),l(z,null,{default:a(()=>{var t,d,S,de,ce,ve,me,pe,fe,_e,ye,ge,be;return[i("div",bt,[l(y,{size:"small",color:J(((t=r.value.instruction)==null?void 0:t.scope)||""),variant:"tonal"},{default:a(()=>{var c;return[l(f,{start:"",size:"x-small"},{default:a(()=>[...e[47]||(e[47]=[n("mdi-target",-1)])]),_:1}),n(" "+u((c=r.value.instruction)==null?void 0:c.scope),1)]}),_:1},8,["color"]),l(y,{size:"small",color:Q(((d=r.value.instruction)==null?void 0:d.instruction_type)||""),variant:"tonal"},{default:a(()=>{var c;return[l(f,{start:"",size:"x-small"},{default:a(()=>[...e[48]||(e[48]=[n("mdi-tag",-1)])]),_:1}),n(" "+u((c=r.value.instruction)==null?void 0:c.instruction_type),1)]}),_:1},8,["color"]),l(y,{size:"small",color:Z(((S=r.value.instruction)==null?void 0:S.source_type)||""),variant:"outlined"},{default:a(()=>{var c;return[n(u((c=r.value.instruction)==null?void 0:c.source_type),1)]}),_:1},8,["color"]),l(y,{size:"small",color:(de=r.value.instruction)!=null&&de.is_active?"success":"grey",variant:"tonal"},{default:a(()=>{var c;return[n(u((c=r.value.instruction)!=null&&c.is_active?"Active":"Inactive"),1)]}),_:1},8,["color"]),l(y,{size:"small",variant:"outlined",color:"info"},{default:a(()=>{var c;return[l(f,{start:"",size:"x-small"},{default:a(()=>[...e[49]||(e[49]=[n("mdi-counter",-1)])]),_:1}),n(" "+u(h(((c=r.value.instruction)==null?void 0:c.token_estimate)||0))+" tokens ",1)]}),_:1}),l(y,{size:"small",variant:"outlined"},{default:a(()=>{var c;return[n(" Priority: "+u((c=r.value.instruction)==null?void 0:c.priority),1)]}),_:1})]),i("div",xt,[e[50]||(e[50]=i("div",{class:"text-caption text-grey mb-1"},"Slug",-1)),i("code",Vt,u((ce=r.value.instruction)==null?void 0:ce.slug),1)]),l(O,{class:"mb-3",dense:""},{default:a(()=>[r.value.creator_name?(m(),V(v,{key:0,cols:"12",md:"4"},{default:a(()=>[e[51]||(e[51]=i("div",{class:"text-caption text-grey"},"Created By",-1)),i("div",kt,u(r.value.creator_name),1)]),_:1})):g("",!0),r.value.org_unit_name?(m(),V(v,{key:1,cols:"12",md:"4"},{default:a(()=>[e[52]||(e[52]=i("div",{class:"text-caption text-grey"},"Org Unit",-1)),i("div",wt,u(r.value.org_unit_name),1)]),_:1})):g("",!0),r.value.company_name?(m(),V(v,{key:2,cols:"12",md:"4"},{default:a(()=>[e[53]||(e[53]=i("div",{class:"text-caption text-grey"},"Company",-1)),i("div",Ct,u(r.value.company_name),1)]),_:1})):g("",!0)]),_:1}),(me=(ve=r.value.instruction)==null?void 0:ve.tags)!=null&&me.length?(m(),_("div",It,[e[54]||(e[54]=i("div",{class:"text-caption text-grey mb-1"},"Tags",-1)),i("div",zt,[(m(!0),_(L,null,A(r.value.instruction.tags,c=>(m(),V(y,{key:c,size:"x-small",variant:"tonal",color:"secondary"},{default:a(()=>[n(u(c),1)]),_:2},1024))),128))])])):g("",!0),(fe=(pe=r.value.instruction)==null?void 0:pe.auto_load_for_intents)!=null&&fe.length?(m(),_("div",Ut,[e[56]||(e[56]=i("div",{class:"text-caption text-grey mb-1"},"Auto-Load for Intents",-1)),i("div",St,[(m(!0),_(L,null,A(r.value.instruction.auto_load_for_intents,c=>(m(),V(y,{key:c,size:"x-small",variant:"tonal",color:"primary"},{default:a(()=>[l(f,{start:"",size:"x-small"},{default:a(()=>[...e[55]||(e[55]=[n("mdi-lightning-bolt",-1)])]),_:1}),n(" "+u(c),1)]),_:2},1024))),128))])])):g("",!0),(ye=(_e=r.value.instruction)==null?void 0:_e.auto_load_for_tools)!=null&&ye.length?(m(),_("div",Dt,[e[58]||(e[58]=i("div",{class:"text-caption text-grey mb-1"},"Auto-Load for Tools",-1)),i("div",Tt,[(m(!0),_(L,null,A(r.value.instruction.auto_load_for_tools,c=>(m(),V(y,{key:c,size:"x-small",variant:"outlined",color:"deep-purple"},{default:a(()=>[l(f,{start:"",size:"x-small"},{default:a(()=>[...e[57]||(e[57]=[n("mdi-tools",-1)])]),_:1}),n(" "+u(c),1)]),_:2},1024))),128))])])):g("",!0),i("div",Ft,[e[59]||(e[59]=i("div",{class:"text-caption text-grey mb-1"},"Content",-1)),l(He,{rounded:"lg",class:"pa-3 bg-grey-lighten-4",style:{"max-height":"300px","overflow-y":"auto"}},{default:a(()=>{var c;return[i("pre",jt,u((c=r.value.instruction)==null?void 0:c.content),1)]}),_:1})]),i("div",At,[i("span",null,"Created: "+u(ee(((ge=r.value.instruction)==null?void 0:ge.created_at)||"")),1),i("span",null,"Updated: "+u(ee(((be=r.value.instruction)==null?void 0:be.updated_at)||"")),1)])]}),_:1}),l(le,null,{default:a(()=>{var t;return[l(k,{color:(t=r.value.instruction)!=null&&t.is_active?"warning":"success",variant:"tonal",onClick:Ue},{default:a(()=>{var d;return[l(f,{start:""},{default:a(()=>{var S;return[n(u((S=r.value.instruction)!=null&&S.is_active?"mdi-pause":"mdi-play"),
11)]}),_:1}),n(" "+u((d=r.value.instruction)!=null&&d.is_active?"Deactivate":"Activate"),1)]}),_:1},8,["color"]),l(k,{color:"primary",variant:"tonal",onClick:e[9]||(e[9]=d=>Fe(r.value.instruction))},{default:a(()=>[l(f,{start:""},{default:a(()=>[...e[60]||(e[60]=[n("mdi-pencil",-1)])]),_:1}),e[61]||(e[61]=n(" Edit ",-1))]),_:1}),l(ae),l(k,{variant:"text",onClick:e[10]||(e[10]=d=>F.value=!1)},{default:a(()=>[...e[62]||(e[62]=[n("Close",-1)])]),_:1})]}),_:1})]),_:1})):g("",!0)]),_:1},8,["modelValue"]),l(oe,{modelValue:M.value,"onUpdate:modelValue":e[13]||(e[13]=t=>M.value=t),"max-width":"450"},{default:a(()=>[l(w,null,{default:a(()=>[l(j,null,{default:a(()=>[...e[63]||(e[63]=[n("Delete Instruction",-1)])]),_:1}),l(z,null,{default:a(()=>{var t;return[e[64]||(e[64]=n(" Are you sure you want to delete ",-1)),i("strong",null,'"'+u((t=E.value)==null?void 0:t.title)+'"',1),e[65]||(e[65]=n("? This action cannot be undone. ",-1))]}),_:1}),l(le,null,{default:a(()=>[l(ae),l(k,{variant:"text",onClick:e[12]||(e[12]=t=>M.value=!1)},{default:a(()=>[...e[66]||(e[66]=[n("Cancel",-1)])]),_:1}),l(k,{color:"error",variant:"tonal",onClick:De},{default:a(()=>[...e[67]||(e[67]=[n("Delete",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),l(oe,{modelValue:U.value,"onUpdate:modelValue":e[29]||(e[29]=t=>U.value=t),"max-width":"800",scrollable:"",persistent:""},{default:a(()=>[l(w,null,{default:a(()=>[l(j,{class:"d-flex align-center justify-space-between"},{default:a(()=>[i("span",null,u(s.value.instruction_id?"Edit Instruction":"Create Instruction"),1),l(k,{icon:"",variant:"text",onClick:e[14]||(e[14]=t=>U.value=!1)},{default:a(()=>[l(f,null,{default:a(()=>[...e[68]||(e[68]=[n("mdi-close",-1)])]),_:1})]),_:1})]),_:1}),l(z,null,{default:a(()=>[l(Je,{ref_key:"editFormRef",ref:H,onSubmit:te(re,["prevent"])},{default:a(()=>[l(O,{dense:""},{default:a(()=>[l(v,{cols:"12",md:"6"},{default:a(()=>[l($,{modelValue:s.value.scope,"onUpdate:modelValue":e[15]||(e[15]=t=>s.value.scope=t),items:W.value,label:"Scope *",rules:[t=>!!t||"Scope is required"],density:"compact",variant:"outlined"},null,8,["modelValue","items","rules"])]),_:1}),l(v,{cols:"12",md:"6"},{default:a(()=>[l($,{modelValue:s.value.instruction_type,"onUpdate:modelValue":e[16]||(e[16]=t=>s.value.instruction_type=t),items:X.value,label:"Type *",rules:[t=>!!t||"Type is required"],density:"compact",variant:"outlined"},null,8,["modelValue","items","rules"])]),_:1}),s.value.scope==="user"?(m(),V(v,{key:0,cols:"12",md:"4"},{default:a(()=>[l(D,{modelValue:s.value.person_id,"onUpdate:modelValue":e[17]||(e[17]=t=>s.value.person_id=t),modelModifiers:{number:!0},label:"Person ID",type:"number",density:"compact",variant:"outlined"},null,8,["modelValue"])]),_:1})):g("",!0),s.value.scope==="org_unit"||s.value.scope==="company"?(m(),V(v,{key:1,cols:"12",md:"4"},{default:a(()=>[l(D,{modelValue:s.value.org_unit_id,"onUpdate:modelValue":e[18]||(e[18]=t=>s.value.org_unit_id=t),modelModifiers:{number:!0},label:"Org Unit ID",type:"number",density:"compact",variant:"outlined"},null,8,["modelValue"])]),_:1})):g("",!0),s.value.scope==="company"?(m(),V(v,{key:2,cols:"12",md:"4"},{default:a(()=>[l(D,{modelValue:s.value.company_id,"onUpdate:modelValue":e[19]||(e[19]=t=>s.value.company_id=t),modelModifiers:{number:!0},label:"Company ID (auto-resolved from Org Unit)",type:"number",density:"compact",variant:"outlined"},null,8,["modelValue"])]),_:1})):g("",!0),l(v,{cols:"12",md:"6"},{default:a(()=>[l(D,{modelValue:s.value.slug,"onUpdate:modelValue":e[20]||(e[20]=t=>s.value.slug=t),label:"Slug *",density:"compact",variant:"outlined",hint:"lowercase letters, numbers, hyphens only",rules:[t=>!!t||"Slug is required",t=>/^[a-z0-9-]+$/.test(t)||"Must match a-z, 0-9, hyphens only"]},null,8,["modelValue","rules"])]),_:1}),l(v,{cols:"12",md:"3"},{default:a(()=>[l(D,{modelValue:s.value.priority,"onUpdate:modelValue":e[21]||(e[21]=t=>s.value.priority=t),modelModifiers:{number:!0},label:"Priority",type:"number",density:"compact",variant:"outlined"},null,8,["modelValue"])]),_:1}),l(v,{cols:"12",md:"3",class:"d-flex align-center"},{default:a(()=>[l(Qe,{modelValue:s.value.is_active,"onUpdate:modelValue":e[22]||(e[22]=t=>s.value.is_active=t),label:"Active",color:"success",density:"compact","hide-details":""},null,8,["modelValue"])]),_:1}),l(v,{cols:"12"},{default:a(()=>[l(D,{modelValue:s.value.title,"onUpdate:modelValue":e[23]||(e[23]=t=>s.value.title=t),label:"Title *",density:"compact",variant:"outlined",rules:[t=>!!(t!=null&&t.trim())||"Title is required"]},null,8,["modelValue","rules"])]),_:1}),l(v,{cols:"12"},{default:a(()=>[l(Ze,{modelValue:s.value.content,"onUpdate:modelValue":e[24]||(e[24]=t=>s.value.content=t),label:"Content *",variant:"outlined",rows:"8",rules:[t=>!!(t!=null&&t.trim())||"Content is required"]},null,8,["modelValue","rules"])]),_:1}),l(v,{cols:"12",md:"6"},{default:a(()=>[l(ie,{modelValue:s.value.tags,"onUpdate:modelValue":e[25]||(e[25]=t=>s.value.tags=t),label:"Tags",multiple:"",chips:"","closable-chips":"",density:"compact",variant:"outlined",hint:"Press enter to add a tag"},null,8,["modelValue"])]),_:1}),l(v,{cols:"12",md:"6"},{default:a(()=>[l(ie,{modelValue:s.value.auto_load_for_intents,"onUpdate:modelValue":e[26]||(e[26]=t=>s.value.auto_load_for_intents=t),items:ne.value,label:"Auto-Load for Intents",multiple:"",chips:"","closable-chips":"",density:"compact",variant:"outlined"},null,8,["modelValue","items"])]),_:1}),l(v,{cols:"12"},{default:a(()=>[l(ie,{modelValue:s.value.auto_load_for_tools,"onUpdate:modelValue":e[27]||(e[27]=t=>s.value.auto_load_for_tools=t),label:"Auto-Load for Tools",multiple:"",chips:"","closable-chips":"",density:"compact",variant:"outlined",hint:"Press enter to add a tool name"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},512)]),_:1}),l(le,null,{default:a(()=>[l(ae),l(k,{variant:"text",onClick:e[28]||(e[28]=t=>U.value=!1)},{default:a(()=>[...e[69]||(e[69]=[n("Cancel",-1)])]),_:1}),l(k,{color:"primary",variant:"tonal",loading:Y.value,onClick:re},{default:a(()=>[n(u(s.value.instruction_id?"Update":"Create"),1)]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),l($e,{modelValue:B.value.show,"onUpdate:modelValue":e[30]||(e[30]=t=>B.value.show=t),color:B.value.color,timeout:3e3},{default:a(()=>
1[n(u(B.value.text),1)]),_:1},8,["modelValue","color"])]),_:1}))}});export{nl 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.