PageSourceSearch

https://www.myporta.ai/_nuxt/CHy84w5h.js

js myporta.ai collected 2026-10-05 12:19:04 UTC 34,030 bytes, 9 lines download raw bytes

1import{_ as Ce}from"./DFwAnJkN.js";import{x as K,ax as lt,ay as ot,y as Ee,q,az as nt,z as S,o as p,A as f,B as me,ab as M,D as t,C as Oe,ba as it,b7 as st,P as Ae,bH as le,aA as rt,bI as se,ao as dt,ap as ut,bG as ct,aH as mt,aR as pt,aU as ft,a_ as vt,aq as qe,a0 as ne,c as N,ar as H,M as i,an as Te,ac as Q,a2 as Me,a1 as $e,I as he,n as C,_ as bt,ad as Z,a7 as Ne,ak as yt,Z as ce,bb as Pe,Y as De,bO as _t,aS as Be,ag as ge,bF as ze,bD as B,E as gt,N as _e}from"./CMP9Vev7.js";import{_ as Le}from"./BImQauKu.js";import{_ as ht}from"./5JbqF2of.js";import{_ as pe}from"./DfS5DRSk.js";import{o as ie,f as Ve,b as wt,s as J,d as je,g as xt,a as Re,e as Ft,l as kt,u as It}from"./v_RNpJ5L.js";import{_ as Ke,a as We,b as St}from"./B1SjoeIg.js";import{_ as Ut}from"./BxxvHk_1.js";import{L as Tt}from"./CzfAtbqw.js";import{u as Vt}from"./DkHUN_cY.js";import{V as At}from"./BaW6ry1H.js";import{_ as oe}from"./CB12nNtx.js";import{_ as we}from"./BerLoPvh.js";import{a as Ct,c as qt}from"./C9wDsTLr.js";import{_ as Ge}from"./DRCTJ1Em.js";import{_ as Mt}from"./B4_S6tKS.js";import{_ as $t}from"./s0_v_wiz.js";import{_ as Rt}from"./DTxgL4gK.js";import{_ as He}from"./B_X6q-uL.js";import{_ as Qe}from"./Bzvxka1E.js";import{a as Ye,u as Ze}from"./Bf61Hl3l.js";import{u as Je,a as ue}from"./B-4YyMGg.js";import{_ as Et}from"./BUBQLFdM.js";import{u as Xe}from"./ZfyIWXEK.js";import{n as Ot}from"./BBjFxVEv.js";import{_ as Nt}from"./CXvxA75S.js";import{d as Pt}from"./BzZ_Lmjn.js";import"./DijfTimq.js";import"./DkRwKkoe.js";import"./6BOIv7Fq.js";import"./D8xGfb_T.js";import"./C6Y-ieo6.js";import"./XA1QlfzS.js";import"./Df2YbqkP.js";import"./mNR9iEWo.js";import"./Cnnl_o0-.js";import"./16WJYSmi.js";import"./BstbYvQo.js";import"./Dx8qBczs.js";import"./BRTwQ8H0.js";import"./B-_A6j6V.js";import"./D4k11_F0.js";import"./Dls9HrUI.js";import"./Bbu_6XIZ.js";import"./CBvfXoQ3.js";import"./CCLSthlM.js";const[Dt,Bt]=nt("SwitchRoot");var zt=K({__name:"SwitchRoot",props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:"on"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(d,{emit:l}){const e=d,g=l,{disabled:v}=lt(e),r=ot(e,"modelValue",g,{defaultValue:e.defaultValue,passive:e.modelValue===void 0});function y(){v.value||(r.value=!r.value)}const{forwardRef:u,currentElement:_}=Ee(),m=Vt(_),b=q(()=>e.id&&_.value?document.querySelector(`[for="${e.id}"]`)?.innerText:void 0);return Bt({modelValue:r,toggleCheck:y,disabled:v}),(c,F)=>(p(),S(t(Ae),Oe(c.$attrs,{id:c.id,ref:t(u),role:"switch",type:c.as==="button"?"button":void 0,value:c.value,"aria-label":c.$attrs["aria-label"]||b.value,"aria-checked":t(r),"aria-required":c.required,"data-state":t(r)?"checked":"unchecked","data-disabled":t(v)?"":void 0,"as-child":c.asChild,as:c.as,disabled:t(v),onClick:y,onKeydown:it(st(y,["prevent"]),["enter"])}),{default:f(()=>[me(c.$slots,"default",{modelValue:t(r)}),t(m)&&c.name?(p(),S(t(At),{key:0,type:"checkbox",name:c.name,disabled:t(v),required:c.required,value:c.value,checked:!!t(r)},null,8,["name","disabled","required","value","checked"])):M("v-if",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),Lt=zt,jt=K({__name:"SwitchThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(d){const l=Dt();return Ee(),(e,g)=>(p(),S(t(Ae),{"data-state":t(l).modelValue?.value?"checked":"unchecked","data-disabled":t(l).disabled.value?"":void 0,"as-child":e.asChild,as:e.as},{default:f(()=>[me(e.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"]))}}),Kt=jt;const Wt={slots:{root:"relative flex items-start",base:["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-2 focus-visible:outline-offset-2 data-[state=unchecked]:bg-accented","transition-[background] duration-200"],container:"flex items-center",thumb:"group pointer-events-none rounded-full bg-default shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 data-[state=unchecked]:rtl:-translate-x-0 flex items-center justify-center",icon:["absolute shrink-0 group-data-[state=unchecked]:text-dimmed opacity-0 size-10/12","transition-[color,opacity] duration-200"],wrapper:"ms-2",label:"block font-medium text-default",description:"text-muted"},variants:{color:{primary:{base:"data-[state=checked]:bg-primary focus-visible:outline-primary",icon:"group-data-[state=checked]:text-primary"},secondary:{base:"data-[state=checked]:bg-secondary focus-visible:outline-secondary",icon:"group-data-[state=checked]:text-secondary"},success:{base:"data-[state=checked]:bg-success focus-visible:outline-success",icon:"group-data-[state=checked]:text-success"},info:{base:"data-[state=checked]:bg-info focus-visible:outline-info",icon:"group-data-[state=checked]:text-info"},warning:{base:"data-[state=checked]:bg-warning focus-visible:outline-warning",icon:"group-data-[state=checked]:text-warning"}
1,error:{base:"data-[state=checked]:bg-error focus-visible:outline-error",icon:"group-data-[state=checked]:text-error"},neutral:{base:"data-[state=checked]:bg-inverted focus-visible:outline-inverted",icon:"group-data-[state=checked]:text-highlighted"}},size:{xs:{base:"w-7",container:"h-4",thumb:"size-3 data-[state=checked]:translate-x-3 data-[state=checked]:rtl:-translate-x-3",wrapper:"text-xs"},sm:{base:"w-8",container:"h-4",thumb:"size-3.5 data-[state=checked]:translate-x-3.5 data-[state=checked]:rtl:-translate-x-3.5",wrapper:"text-xs"},md:{base:"w-9",container:"h-5",thumb:"size-4 data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4",wrapper:"text-sm"},lg:{base:"w-10",container:"h-5",thumb:"size-4.5 data-[state=checked]:translate-x-4.5 data-[state=checked]:rtl:-translate-x-4.5",wrapper:"text-sm"},xl:{base:"w-11",container:"h-6",thumb:"size-5 data-[state=checked]:translate-x-5 data-[state=checked]:rtl:-translate-x-5",wrapper:"text-base"}},checked:{true:{icon:"group-data-[state=checked]:opacity-100"}},unchecked:{true:{icon:"group-data-[state=unchecked]:opacity-100"}},loading:{true:{icon:"animate-spin"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},disabled:{true:{root:"opacity-75",base:"cursor-not-allowed",label:"cursor-not-allowed",description:"cursor-not-allowed"}}},defaultVariants:{color:"primary",size:"md"}},et=Object.assign({inheritAttrs:!1},{__name:"USwitch",props:le({as:{type:null,required:!1},color:{type:null,required:!1},size:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},checkedIcon:{type:null,required:!1},uncheckedIcon:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},value:{type:String,required:!1},defaultValue:{type:Boolean,required:!1}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:le(["change"],["update:modelValue"]),setup(d,{emit:l}){const e=d,g=rt(),v=l,r=se(d,"modelValue",{type:Boolean,default:void 0}),y=dt(),u=ut("switch",e),_=ct(mt(e,"required","value","defaultValue")),{id:m,emitFormChange:b,emitFormInput:c,size:F,color:$,name:P,disabled:W,ariaAttrs:z}=pt(e),T=m.value??ft(),X=vt(),k=q(()=>{const{"data-state":G,...O}=X;return O}),V=q(()=>qe({extend:qe(Wt),...y.ui?.switch||{}})({size:F.value,color:$.value,required:e.required,loading:e.loading,disabled:W.value||e.loading}));function E(G){const O=new Event("change",{target:{value:G}});v("change",O),b(),c()}return(G,O)=>(p(),S(t(Ae),{as:d.as,"data-slot":"root",class:H(V.value.root({class:[t(u)?.root,e.class]}))},{default:f(()=>[ne("div",{"data-slot":"container",class:H(V.value.container({class:t(u)?.container}))},[i(t(Lt),Oe({id:t(T)},{...t(_),...k.value,...t(z)},{modelValue:r.value,"onUpdate:modelValue":[O[0]||(O[0]=ee=>r.value=ee),E],name:t(P),disabled:t(W)||d.loading,"data-slot":"base",class:V.value.base({class:t(u)?.base})}),{default:f(()=>[i(t(Kt),{"data-slot":"thumb",class:H(V.value.thumb({class:t(u)?.thumb}))},{default:f(()=>[d.loading?(p(),S(Te,{key:0,name:d.loadingIcon||t(y).ui.icons.loading,"data-slot":"icon",class:H(V.value.icon({class:t(u)?.icon,checked:!0,unchecked:!0}))},null,8,["name","class"])):(p(),N(Q,{key:1},[d.checkedIcon?(p(),S(Te,{key:0,name:d.checkedIcon,"data-slot":"icon",class:H(V.value.icon({class:t(u)?.icon,checked:!0}))},null,8,["name","class"])):M("",!0),d.uncheckedIcon?(p(),S(Te,{key:1,name:d.uncheckedIcon,"data-slot":"icon",class:H(V.value.icon({class:t(u)?.icon,unchecked:!0}))},null,8,["name","class"])):M("",!0)],64))]),_:1},8,["class"])]),_:1},16,["id","modelValue","name","disabled","class"])],2),d.label||g.label||d.description||g.description?(p(),N("div",{key:0,"data-slot":"wrapper",class:H(V.value.wrapper({class:t(u)?.wrapper}))},[d.label||g.label?(p(),S(t(Tt),{key:0,for:t(T),"data-slot":"label",class:H(V.value.label({class:t(u)?.label}))},{default:f(()=>[me(G.$slots,"label",{label:d.label},()=>[Me($e(d.label),1)])]),_:3},8,["for","class"])):M("",!0),d.description||g.description?(p(),N("p",{key:1,"data-slot":"description",class:H(V.value.description({class:t(u)?.description}))},[me(G.$slots,"description",{description:d.description},()=>[Me($e(d.description),1)])],2)):M("",!0)],2)):M("",!0)]),_:3},8,["as","class"]))}}),Gt=K({__name:"ConsoleFormThemeSwitch",setup(d){const l={...qt,formField:{root:"flex max-sm:flex-col justify-between items-center gap-4",wrapper:"",container:""}};return(e,g)=>{const v=Ct;return p(),S(v,{ui:l},{default:f(()=>[me(e.$slots,"default")]),_:3})}}}),tt=Object.assign(Gt,{__name:"ConsoleFormThemeSwitch"}),Ht=K({__name:"ConsoleFormFeedOptionsAdf",props:le({setForm:{type:Function}},{model:{required:!0},modelModifiers:{}}),emits:["update:model"],setup(d){const l=se(d,"model"),{$btSession:e}
1=he(),g=C(e.getRoles().includes("sysadmin")),v=d,r=ie({enableSFTP:Ve(),autoMapOffices:Ve()});return v.setForm(r,l.value),(y,u)=>{const _=et,m=oe,b=we,c=tt;return p(),S(c,null,{default:f(()=>[t(g)?(p(),N(Q,{key:0},[i(m,{name:"enableSFTP",label:"Enable SFTP",description:"When enabled, the SFTP login will be able to connect and send data. Check with the client before disabling logins, as this may cause errors at their side."},{default:f(()=>[i(_,{modelValue:l.value.enableSFTP,"onUpdate:modelValue":u[0]||(u[0]=F=>l.value.enableSFTP=F),size:"xl"},null,8,["modelValue"])]),_:1}),i(b)],64)):M("",!0),i(m,{name:"autoMapOffices",label:"Automatically map offices",description:"When enabled, automatically discovers and maps offices enclosed in feed data."},{default:f(()=>[i(_,{modelValue:l.value.autoMapOffices,"onUpdate:modelValue":u[1]||(u[1]=F=>l.value.autoMapOffices=F),size:"xl"},null,8,["modelValue"])]),_:1})]),_:1})}}}),Qt=Object.assign(Ht,{__name:"ConsoleFormFeedOptionsAdf"}),Yt=K({__name:"ConsoleFormFeedOptionsWebSearch",props:le({setForm:{type:Function}},{model:{required:!0},modelModifiers:{}}),emits:["update:model"],setup(d){const l=se(d,"model"),e=d,g=ie({domain:wt("Domain must be a valid URL."),autoMapOffices:Ve()});return e.setForm(g,l.value),(v,r)=>{const y=pe,u=oe,_=we,m=et,b=tt;return p(),N(Q,null,[i(u,{name:"domain",label:"Domain",description:"The source website URL used for web-search ingestion."},{default:f(()=>[i(y,{modelValue:l.value.domain,"onUpdate:modelValue":r[0]||(r[0]=c=>l.value.domain=c),type:"url",autocomplete:"off",placeholder:"https://example.com"},null,8,["modelValue"])]),_:1}),i(_),i(b,null,{default:f(()=>[i(u,{name:"autoMapOffices",label:"Automatically map offices",description:"When enabled, automatically discovers and maps offices from web-search data."},{default:f(()=>[i(m,{modelValue:l.value.autoMapOffices,"onUpdate:modelValue":r[1]||(r[1]=c=>l.value.autoMapOffices=c),size:"xl"},null,8,["modelValue"])]),_:1})]),_:1})],64)}}}),Zt=Object.assign(Yt,{__name:"ConsoleFormFeedOptionsWebSearch"}),Jt=K({__name:"ConsoleFormFeedOptionsReapit",props:le({setForm:{type:Function}},{model:{required:!0},modelModifiers:{}}),emits:["update:model"],setup(d){const l=se(d,"model"),e=d,g=ie({customerId:J().trim().min(1,"Customer ID is required.")});return e.setForm(g,l.value),(v,r)=>{const y=pe,u=oe;return p(),S(u,{name:"customerId",label:"Customer ID",placeholder:"The Reapit customer ID.",description:"The Reapit customer must have installed and authorised the MyPorta app."},{default:f(()=>[i(y,{modelValue:l.value.customerId,"onUpdate:modelValue":r[0]||(r[0]=_=>l.value.customerId=_),autocomplete:"off",placeholder:"The Reapit customer ID."},null,8,["modelValue"])]),_:1})}}}),Xt=Object.assign(Jt,{__name:"ConsoleFormFeedOptionsReapit"}),ea={},ta={class:"text-sm text-muted"};function aa(d,l){return p(),N("div",ta," VTUK options editor will be available in a future update. ")}const la=Object.assign(bt(ea,[["render",aa]]),{__name:"ConsoleFormFeedOptionsVtuk"}),oa=K({__name:"ConsoleFormFeedOptionsApiKey",props:{model:{},setForm:{type:Function}},emits:["update:model"],setup(d,{emit:l}){const e=d,g=l;function v(y){g("update:model",{...e.model||{},...y})}const r=q({get:()=>e.model?.secrets?.ApiKey||"",set:y=>{if(!y.trim()){if(!e.model?.secrets)return;const{ApiKey:u,..._}=e.model.secrets;v({secrets:Object.keys(_).length?_:void 0});return}v({secrets:{...e.model?.secrets||{},ApiKey:y}})}});return(y,u)=>{const _=He,m=oe;return p(),S(m,{name:"apiKey",label:"Api key"},{default:f(()=>[i(_,{modelValue:t(r),"onUpdate:modelValue":u[0]||(u[0]=b=>Z(r)?r.value=b:null),rows:5,class:"w-full font-mono",placeholder:"Any saved API key is never revealed."},null,8,["modelValue"])]),_:1})}}}),na=Object.assign(oa,{__name:"ConsoleFormFeedOptionsApiKey"}),ia=K({__name:"ConsoleSelectEmployee",async setup(d){let l,e;const{$portalClient:g}=he(),{data:v,status:r,execute:y}=([l,e]=Ne(()=>Je("select_employees",()=>g.employee_GetEmployees(),{transform:_=>_?.map(m=>({label:m.label,id:m.id,avatarUrl:m.avatarUrl,avatar:{src:m.avatarUrl,alt:m.label,loading:"lazy"}})),immediate:!1})),l=await l,e(),l);function u(){r.value==="idle"&&y()}return(_,m)=>{const b=yt,c=Ge;return p(),S(c,{items:t(v),loading:t(r)==="pending",icon:"i-lucide-user",placeholder:"Select employee","onUpdate:open":u},{leading:f(({modelValue:F,ui:$})=>[F?(p(),S(b,{key:0,alt:F.label,src:F.avatarUrl,loading:"lazy",size:$.leadingAvatarSize(),class:H($.leadingAvatar())},null,8,["alt","src","size","class"])):M("",!0)]),_:1},8,["items","loading"])}}}),sa=Object.assign(ia,{__name:"ConsoleSelectEmployee"}),ra=K({__name:"ConsoleFormFeedMapping",props:le({setForm:{}},{model:{required:!0},modelModifiers:{}}),emits:["update:model"],setup(d){const l=se(d,"model"),e=d,g=[{value:"department",label:"Department"},{value:"employee",label:"Employee"}],v=q({get:()=>{if(l.value.entityId)return{id:l.value.entityId,label:l.value.entityName||l.value.entityId,fullLabel:l.value.entityName||l.value.entityId}},set:m=>{if(l.value.entityId=m?.id||"",l.value.entityType==="department"){l.value.entityName=m?.fullLabel||m?.label||l.value.entityId;return}if(l.value.entityType==="employee"){l.value.entityName=m?.label||l.value.entityId;return}l.value.entityName=l.value.entityId}}),r=q(()=>l.value.entityType==="employee"?"Map to employee":"Map to department"),y=q(()=>l.value.entityType==="employee"?"Select employee":"Select department"),u=q(()=>l.value.entityType==="employee"?sa:Et);ce(()=>l.value.entityType,(m,b)=>{if(!m){l.value.entityType="department";return}b&&m!==b&&(l.value.entityId="",l.value.entityName="")},{immediate:!0});const _=ie({entityType:J().trim().min(1,"Type is required."),entity
1Id:J().trim().min(1,"Map from is required."),externalURN:J().trim().min(1,"Map to is required.").max(500,"Maximum 500 characters.")});return e.setForm(_,l.value),(m,b)=>{const c=je,F=oe,$=we,P=pe,W=Qe,z=Ye;return p(),N(Q,null,[i(W,{variant:"subtle",class:"mb-8"},{default:f(()=>[i(F,{name:"entityType",label:"Type"},{default:f(()=>[i(c,{modelValue:l.value.entityType,"onUpdate:modelValue":b[0]||(b[0]=T=>l.value.entityType=T),items:g,"value-key":"value","label-key":"label"},null,8,["modelValue"])]),_:1}),i($),i(F,{name:"externalURN",label:"Map from",description:"The reference/ID which appears in the feed"},{default:f(()=>[i(P,{modelValue:l.value.externalURN,"onUpdate:modelValue":b[1]||(b[1]=T=>l.value.externalURN=T),autocomplete:"off",placeholder:"External URN"},null,8,["modelValue"])]),_:1}),i($),i(F,{name:"entityId",label:t(r)},{default:f(()=>[(p(),S(Pe(t(u)),{modelValue:t(v),"onUpdate:modelValue":b[2]||(b[2]=T=>Z(v)?v.value=T:null),placeholder:t(y)},null,8,["modelValue","placeholder"]))]),_:1},8,["label"])]),_:1}),i(z,{modelValue:l.value,"onUpdate:modelValue":b[3]||(b[3]=T=>l.value=T),class:"mb-8"},null,8,["modelValue"])],64)}}}),da=Object.assign(ra,{__name:"ConsoleFormFeedMapping"}),ua={class:"flex flex-wrap items-center justify-end gap-1.5 mb-4"},ca=K({__name:"ConsoleFormFeed",props:le({setForm:{type:Function}},{model:{required:!0},modelModifiers:{}}),emits:["update:model"],setup(d){const l=d,e=se(d,"model"),g=De(),{$btSession:v}=he(),{copy:r}=_t(),{updateOrAddItem:y}=Xe(),u=Ze(),_=ge,m=C(v.getRoles().includes("sysadmin")),b=Be("mappingTable"),c=C(),F=C(),$=C(!1),P=[{label:"Legacy bulk",value:"adf"},{label:"Web search",value:"web_search"},{label:"Reapit",value:"reapit"},{label:"VTUK",value:"vtuk"},{label:"Street Group",value:"street"},{label:"Loop",value:"loop"}],W=[{label:"(Shared Alto credentials)",value:"@alto"},{label:"(Shared DezRez credentials)",value:"@dezrez"},{label:"(do not use - test credentials)",value:"@test"}],z=q(()=>!e.value.id),T=q(()=>{const a=[...W],s=e.value.externalId;return s&&!a.some(A=>A.value===s)&&a.unshift({label:s,value:s}),a}),X=q(()=>(e.value.scopeTags?.length??0)>0||!!e.value.externalId?.startsWith("@")),k=q(()=>e.value.type==="adf"&&!!e.value.externalId?.startsWith("@")),V=q(()=>(e.value.scopeTags?.length??0)>0||(e.value.map?.length??0)>0),E=q(()=>{if(e.value.type==="adf")return Qt;if(e.value.type==="web_search")return Zt;if(e.value.type==="reapit")return Xt;if(e.value.type==="vtuk")return la});function G(a){return a?a.split(",").map(s=>s.trim()).filter(Boolean):[]}function O(a){return{...a,_clientId:a?._clientId||Ot(),entityType:a?.entityType||"department",entityId:a?.entityId||"",entityName:a?.entityName||a?.entityId||"",externalURN:a?.externalURN||""}}function ee(a){const s=a;return{type:"legacy_adf",enableSFTP:s?.enableSFTP??!0,autoMapOffices:s?.autoMapOffices??!0}}function fe(a){const s=a;return{type:"web_search",domain:s?.domain,autoMapOffices:s?.autoMapOffices??!0}}function te(a){return{type:"reapit",customerId:a?.customerId}}function ae(a){return a==="adf"?{ingest:ee()}:a==="web_search"?{ingest:fe()}:a==="reapit"?{ingest:te()}:{ingest:void 0}}ce(()=>e.value.notificationEmailsCsv,a=>{!e.value.notificationEmails?.length&&a&&(e.value.notificationEmails=G(a))},{immediate:!0}),ce(()=>e.value.scope,a=>{!e.value.scopeTags?.length&&a?.length&&(e.value.scopeTags=[...a])},{immediate:!0});function re(){c.value=O(),F.value="New mapping"}function de(a,s){$.value||(c.value=structuredClone(ze(s.original)),F.value="Edit mapping")}async function xe(a){if(!c.value)return;const s=c.value;y(q({get:()=>e.value.map,set:A=>{e.value.map=A}}),s,A=>A.id&&s.id&&A.id===s.id||A._clientId===s._clientId)}async function Fe(a){$.value=!0;try{if(!await u("Delete this mapping?"))return;e.value.map=e.value.map.filter(s=>a.original.id?s.id!==a.original.id:s._clientId!==a.original._clientId)}finally{$.value=!1}}function ve(a){return[[{label:"Edit",icon:"i-lucide-pencil",onSelect(){de(void 0,a)}},{label:"Delete",icon:"i-lucide-trash",color:"error",async onSelect(){await Fe(a)}}]]}const ke=[{accessorKey:"entityType",header:"Type",cell:({row:a})=>a.original.entityType==="employee"?"Employee":"Department"},{accessorKey:"externalURN",header:"From",cell:({row:a})=>a.original.externalURN||"-"},{accessorKey:"entityName",header:"To",cell:({row:a})=>a.original.entityName||a.original.entityId||"-"},{id:"actions",meta:{class:{th:"w-1"}},cell:({row:a})=>B("div",{class:"text-right"},B(Le,{content:{align:"end"},items:ve(a),disabled:$.value},()=>B(ge,{icon:"i-lucide-ellipsis-vertical",color:"neutral",variant:"ghost",class:"ml-auto"})))}];ce(()=>e.value.type,(a,s)=>{z.value&&a&&a!==s&&(e.value.options=ae(a),e.value.label=`${g.selfIdentity?.organisation?.label} ${P.find(A=>A.value===a)?.label.toLowerCase()??a} feed`),a==="adf"?(e.value.options=e.value.options||ae(a),e.value.options.ingest=ee(e.value.options.ingest)):a==="web_search"?(e.value.options=e.value.options||ae(a),e.value.options.ingest=fe(e.value.options.ingest)):a==="reapit"&&(e.value.options=e.value.options||ae(a),e.value.options.ingest=te(e.value.options.ingest))},{immediate:!0});function be(a){T.value.push({label:a,value:a}),e.value.externalId=a}const ye=ie({type:J().trim().min(1,"Type is required."),label:J().trim().min(1,"Name is required.").max(100,"Maximum 100 characters."),externalId:J().max(500,"Maximum 500 characters.").or(kt("")).optional(),notificationEmails:Re(J()).superRefine((a,s)=>{a.some(A=>!Ft().safeParse(A).success)&&s.addIssue({code:"custom",message:"One or more notification email addresses are invalid.",path:[]})}),scopeTags:Re(J()),options:ie({ingest:xt().optional()}).optional()});return l.setForm(ye,e.value),(a,s)=>{const A=Ge,Y=oe,D=we,o=pe,n=Mt,h=$t,U=Rt,I=na,w=Qe,L=Ke,j=Ye,Ie=da,Se=We;return p(),N(Q,null,[i(w,{variant:"subtle",class:"mb-8"},{default:f(()=>[i(Y,{name:"type",label:"Type"},{default:f(()=>[i(A,{modelValue:e.value.type,"onUpdate:modelValue":s[0]||(s[0]=x=>e.value.type=x),items:P,"value-key":"value","label-key":"label",disabled:!t(z),placeholder:"Select feed type"},null,8,["modelValue","disabled"])]),_:1}),i(D),i(Y,{name:"label",label:"Name"},{default:f(()=>[i(o,{modelValue:e.value.label,"onUpdate:modelValue":s[1]||(s[1]=x=>
1e.value.label=x),autocomplete:"off"},null,8,["modelValue"])]),_:1}),e.value.type==="adf"?(p(),N(Q,{key:0},[i(D),i(Y,{name:"externalId",label:e.value.type==="adf"?"SFTP login username":"External ID"},{default:f(()=>[i(n,null,{default:f(()=>[i(A,{modelValue:e.value.externalId,"onUpdate:modelValue":s[2]||(s[2]=x=>e.value.externalId=x),items:t(T),"value-key":"value","label-key":"label","create-item":"always",disabled:!t(m)||!t(z),placeholder:"Leave blank to create automatically",onCreate:be},null,8,["modelValue","items","disabled"]),i(t(_),{color:"neutral",variant:"subtle",icon:"i-lucide-copy",onClick:s[3]||(s[3]=x=>t(r)(e.value.externalId))})]),_:1})]),_:1},8,["label"])],64)):M("",!0),t(m)||t(k)?(p(),N(Q,{key:1},[t(X)?(p(),N(Q,{key:0},[i(D),i(Y,{name:"scopeTags",label:"Branch feed IDs (scope)",description:t(k)?"Files for many agencies arrive in one shared drop-box. This feed only receives the files whose branch feed IDs are listed here, or mapped to an office below. Without them the feed can never run.":void 0},{default:f(()=>[i(h,{modelValue:e.value.scopeTags,"onUpdate:modelValue":s[4]||(s[4]=x=>e.value.scopeTags=x),"add-on-blur":!0,placeholder:"Type each branch feed ID the provider gave you, then Enter"},null,8,["modelValue"])]),_:1},8,["description"]),t(k)&&!t(V)?(p(),S(U,{key:0,color:"warning",variant:"subtle",icon:"i-lucide-triangle-alert",title:"This feed cannot receive files yet",description:"Add the branch feed IDs from the provider's confirmation (for Alto: the 'Feed ID' column in their email), or map an office to a branch reference below."})):M("",!0)],64)):M("",!0)],64)):M("",!0),i(D),i(Y,{name:"notificationEmails",label:"Feed notification email(s)"},{default:f(()=>[i(h,{modelValue:e.value.notificationEmails,"onUpdate:modelValue":s[5]||(s[5]=x=>e.value.notificationEmails=x),"add-on-blur":!0,max:3,placeholder:"Type an email"},null,8,["modelValue"])]),_:1}),t(E)||e.value.type==="street"||e.value.type==="loop"?(p(),N(Q,{key:2},[i(D),e.value.type==="street"||e.value.type==="loop"?(p(),S(I,{key:0,model:e.value,"onUpdate:model":s[6]||(s[6]=x=>e.value=x),"set-form":()=>{}},null,8,["model"])):(p(),S(Pe(t(E)),{key:1,model:e.value.options.ingest,"onUpdate:model":s[7]||(s[7]=x=>e.value.options.ingest=x),"set-form":()=>{}},null,40,["model"]))],64)):M("",!0)]),_:1}),s[11]||(s[11]=ne("h3",{class:"text-lg font-semibold mb-3"}," Mappings ",-1)),ne("div",ua,[i(t(_),{label:"Add mapping",icon:"i-lucide-plus",onClick:re})]),i(L,{ref_key:"mappingTable",ref:b,auto:"",class:"shrink-0 mb-8",data:e.value.map,columns:ke,onSelect:de},null,8,["data"]),i(j,{modelValue:e.value,"onUpdate:modelValue":s[8]||(s[8]=x=>e.value=x),class:"mb-8"},null,8,["modelValue"]),i(Se,{nested:"",open:!!t(c),title:t(F),"commit-async":xe,onClosed:s[10]||(s[10]=x=>c.value=void 0)},{default:f(({setForm:x})=>[t(c)?(p(),S(Ie,{key:0,model:t(c),"onUpdate:model":s[9]||(s[9]=Ue=>Z(c)?c.value=Ue:null),"set-form":x},null,8,["model","set-form"])):M("",!0)]),_:1},8,["open","title"])],64)}}}),ma=Object.assign(ca,{__name:"ConsoleFormFeed"}),pa={class:"flex flex-wrap items-center justify-between gap-1.5"},fa={class:"flex flex-wrap items-center gap-1.5"},va={class:"flex items-center justify-end gap-3 border-t border-default pt-4 mt-auto"},rl=K({__name:"config",async setup(d){let l,e;const g=ge,v=gt(),r=Be("table"),y=Ze(),{$portalClient:u,$btSession:_}=he(),{updateOrAddItem:m,goToRowIndex:b,goToRowById:c}=Xe(),F=De(),$=C(_.getRoles().includes("sysadmin")),P=It(),W=C([{id:"label",value:""},{id:"isActive",value:!0}]),z=C({isActive:!1}),T=C({pageIndex:0,pageSize:10}),X=C("active"),k=C(),V=C(),E=C(!1),G=C([]),O=C(),ee=q({get:()=>r.value?.tableApi?.getColumn("label")?.getFilterValue()||"",set:o=>{r.value?.tableApi?.getColumn("label")?.setFilterValue(o||void 0)}});function fe(o){return o?o.split(",").map(n=>n.trim()).filter(Boolean):[]}function te(o){const n=o;return{...n,type:n?.type??"adf",label:n?.label??"",externalId:n?.externalId??"",notificationEmails:fe(n?.notificationEmailsCsv),scopeTags:[...n?.scope??[]],map:(n?.map??[]).map(h=>({...h,_clientId:h.id})),isActive:n?.isActive??!0,isEnabled:n?.isEnabled??!0,options:n?.options??{ingest:void 0}}}function ae(o){return o==="adf"?{ingest:{type:"legacy_adf",enableSFTP:!0,autoMapOffices:!0}}:o==="web_search"?{ingest:{type:"web_search",domain:void 0,autoMapOffices:!0}}:o==="reapit"?{ingest:{type:"reapit",customerId:void 0}}:{ingest:void 0}}function re(o){const n=o.notificationEmails.map(w=>
1w.trim()).filter(Boolean),h=o.externalId?.trim()||void 0,U=o.scopeTags?.map(w=>w.trim()).filter(Boolean),I=o.secrets;return{type:o.type?.trim()||"adf",label:o.label?.trim()||"",externalId:h,notificationEmails:n.length?n:void 0,scope:U?.length?U:void 0,isActive:o.isActive??!0,isEnabled:o.isEnabled??!0,options:o.options||ae(o.type),secrets:I,map:o.map?.map(w=>({id:w.id,entityType:w.entityType||"",entityId:w.entityId||"",externalURN:w.externalURN||""}))}}function de(){O.value=G.value.shift()}function xe(o){const n=Object.entries(o||{}).map(([h,U])=>({key:h,value:U}));G.value=n,de()}function Fe(){k.value=te({type:"adf",label:"",externalId:"",isActive:!0,isEnabled:!0,options:ae("adf")}),k.value.notificationEmails=[F.selfIdentity?.emailAddress||""].filter(Boolean),V.value="New feed"}function ve(o,n){E.value||(k.value=structuredClone(ze(n.original)),V.value=`Edit ${k.value.label}`)}async function ke(o){if(!k.value)return;const n=re(k.value),h=!k.value.id,U=h?await ue(()=>u.feed_AddFeed(n),{handleProblemDetails:o.problemDetailsHandler}):await ue(()=>u.feed_SetFeed(k.value.id,n),{handleProblemDetails:o.problemDetailsHandler});if(U.status.value!=="success")return;const I=te(U.data.value);m(D,I,w=>w.id===I.id),await _e(),I.id&&c(r.value.tableApi,I.id),xe(U.data.value?.secrets),v.add({title:"Success",description:h?`${I.label} created.`:`${I.label} updated.`,icon:"i-lucide-check",color:"success"})}async function be(o,n){if(o.original.id){E.value=!0;try{const h={...o.original,isEnabled:n},U=re(h),{status:I,data:w}=await ue(()=>u.feed_SetFeed(o.original.id,U));if(I.value!=="success")return;const L=r.value?.tableApi.getPrePaginationRowModel().rows.findIndex(j=>j===o);m(D,te(w.value),j=>j.id===w.value.id),await _e(),L&&L>=0&&b(r.value.tableApi,L),v.add({title:"Success",description:`${w.value.label||"Feed"} ${n?"enabled":"disabled"}.`,icon:"i-lucide-check",color:"success"})}finally{E.value=!1}}}async function ye(o,n){if(o.original.id&&!(!n&&o.original.isEnabled&&!await y({title:"Archive this feed?",description:`Archiving the feed will disable it.
2        
3        Are you sure you want to archive this feed?`}))){E.value=!0;try{const h={...o.original,isActive:n},U=re(h),{status:I,data:w}=await ue(()=>u.feed_SetFeed(o.original.id,U));if(I.value!=="success")return;const L=r.value?.tableApi.getPrePaginationRowModel().rows.findIndex(j=>j===o);m(D,te(w.value),j=>j.id===w.value.id),await _e(),L&&L>=0&&b(r.value.tableApi,L),v.add({title:"Success",description:`${w.value.label||"Feed"} ${n?"unarchived":"archived"}.`,icon:"i-lucide-check",color:"success"})}finally{E.value=!1}}}async function a(o){if(o.original.id){E.value=!0;try{if(!await y({title:"Delete this feed?",description:`This is a destructive operation which will delete ALL feed history, ALL stored backups, and ALL logs. 
4      
5      Deleting this feed does not undo any listing changes this feed already made. Listings created by this feed will lose their audit history. 
6      
7      Any associated logins, such as SFTP users, will be deleted, which may cause client-side errors.
8      
9      Are you sure you want to delete this feed?`}))return;const h=r.value?.tableApi.getPrePaginationRowModel().rows.findIndex(I=>I===o),{status:U}=await ue(()=>u.feed_RemoveFeed(o.original.id));if(U.value!=="success")return;D.value=D.value.filter(I=>I.id!==o.original.id),await _e(),h&&h>=0&&b(r.value.tableApi,h),v.add({title:"Feed deleted",description:"The selected feed was deleted.",icon:"i-lucide-check",color:"success"})}finally{E.value=!1}}}ce(()=>X.value,o=>{const n=r.value?.tableApi?.getColumn("isActive");n&&n.setFilterValue(o==="active")},{immediate:!0});function s(o){const n=o.original.isEnabled?{label:"Disable",icon:"i-lucide-toggle-left",disabled:!P.value,onSelect(){be(o,!1)}}:{label:"Enable",icon:"i-lucide-toggle-right",disabled:!P.value,onSelect(){be(o,!0)}};return o.original.isActive?[[n],[{label:"Edit",icon:"i-lucide-pencil",onSelect(){ve(void 0,o)}},{label:"Archive",icon:"i-lucide-archive",disabled:!P.value,onSelect(){ye(o,!1)}}]]:[[{label:"Unarchive",icon:"i-lucide-archive-restore",disabled:!P.value,onSelect(){ye(o,!0)}},{label:"Delete",icon:"i-lucide-trash",color:"error",disabled:!$.value,async onSelect(){await a(o)}}]]}const A=[{accessorKey:"type",header:"Type",cell:({row:o})=>Pt(o.original.type)},{accessorKey:"label",header:"Name",cell:({row:o})=>{const n=[];return o.original.isActive||n.push(B(Ce,{color:"neutral",variant:"soft",label:"Archived"})),o.original.isEnabled||n.push(B(Ce,{color:"neutral",variant:"soft",label:"Disabled"})),B("div",{class:"min-w-0"},[B("p",{class:"font-medium text-highlighted truncate"},o.original.label||"-"),B("p",{class:"text-muted"},o.original.externalId),B("div",{class:"flex items-center gap-1.5 mt-1"},n)])}},{accessorKey:"isActive",header:"Status",filterFn:"equals",cell:({row:o})=>o.original.isActive?"Active":"Archived"},{id:"actions",meta:{class:{th:"w-1"}},cell:({row:o})=>B("div",{class:"text-right"},B(Le,{content:{align:"end"},items:s(o),disabled:E.value},()=>B(ge,{icon:"i-lucide-ellipsis-vertical",color:"neutral",variant:"ghost",class:"ml-auto"})))}],Y=([l,e]=Ne(()=>Je("feeds",()=>u.feed_GetFeeds())),l=await l,e(),l);
9if(Y.error.value)throw Y.error.value;const D=C((Y.data.value||[]).map(te));return(o,n)=>{const h=ht,U=pe,I=je,w=Ke,L=Ut,j=ma,Ie=We,Se=He,x=oe,Ue=Nt;return p(),N(Q,null,[i(h,{title:"Configuration"}),ne("div",pa,[i(U,{modelValue:t(ee),"onUpdate:modelValue":n[0]||(n[0]=R=>Z(ee)?ee.value=R:null),class:"max-w-sm",icon:"i-lucide-search",placeholder:"Filter names..."},null,8,["modelValue"]),ne("div",fa,[i(I,{modelValue:t(X),"onUpdate:modelValue":n[1]||(n[1]=R=>Z(X)?X.value=R:null),items:[{label:"Non-archived",value:"active"},{label:"Archived",value:"archived"}],class:"min-w-32"},null,8,["modelValue"]),i(t(g),{label:"New feed",icon:"i-lucide-plus",disabled:!t(P),onClick:Fe},null,8,["disabled"])])]),i(w,{ref_key:"table",ref:r,"column-filters":t(W),"onUpdate:columnFilters":n[2]||(n[2]=R=>Z(W)?W.value=R:null),"column-visibility":t(z),"onUpdate:columnVisibility":n[3]||(n[3]=R=>Z(z)?z.value=R:null),pagination:t(T),"onUpdate:pagination":n[4]||(n[4]=R=>Z(T)?T.value=R:null),auto:"","pagination-options":{getPaginationRowModel:t(St)()},class:"shrink-0",data:t(D),columns:A,onSelect:ve},null,8,["column-filters","column-visibility","pagination","pagination-options","data"]),ne("div",va,[i(L,{page:(t(r)?.tableApi?.getState().pagination.pageIndex||0)+1,"items-per-page":t(r)?.tableApi?.getState().pagination.pageSize,total:t(r)?.tableApi?.getFilteredRowModel().rows.length,"onUpdate:page":n[5]||(n[5]=R=>t(r)?.tableApi?.setPageIndex(R-1))},null,8,["page","items-per-page","total"])]),i(Ie,{open:!!t(k),title:t(V),class:"max-w-xl","commit-async":ke,"form-class":["max-w-2xl"],onClosed:n[7]||(n[7]=R=>k.value=void 0)},{default:f(({setForm:R})=>[t(k)?(p(),S(j,{key:0,model:t(k),"onUpdate:model":n[6]||(n[6]=at=>Z(k)?k.value=at:null),"set-form":R},null,8,["model","set-form"])):M("",!0)]),_:1},8,["open","title"]),i(Ue,{open:!!t(O),dismissible:!1,title:"Secret created",description:"A secret was generated 
9when you saved the feed. This secret is not stored by us and will only be displayed once."},{body:f(()=>[i(x,{label:t(O)?.key||"Secret"},{default:f(()=>[i(Se,{"model-value":t(O)?.value||"",readonly:"",rows:6,class:"w-full"},null,8,["model-value"])]),_:1},8,["label"])]),footer:f(()=>[i(t(g),{label:"Next",color:"neutral",onClick:de})]),_:1},8,["open"])],64)}}});export{rl 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.