PageSourceSearch

https://app.knockknockapp.ai/assets/Config-PCVOoNjK.js

js knockknockapp.ai collected 2026-09-24 13:19:16 UTC 18,981 bytes, 1 lines download raw bytes

1import{w as G,l as n,m as l,q as e,K as c,p as S,y as E,u as b,J as C,D as f,F as P,v as D,aa as v,ae as N,ac as I,Y as W,b as M,B as u,z as O,ag as J,a6 as K,r as k}from"./vue-vendor-B52ivs5F.js";import{b as Q,a as H}from"./query-vendor-Ab0nfCYP.js";import{R as z,S as Y,T as Z}from"./identity-BTAc5Y7A.js";import{t as w}from"./index-NM9cAr_v.js";import{L as U,aq as X,w as ee,bJ as te,bZ as ae,b as re}from"./ui-vendor-D-1UBobO.js";import"./date-vendor-HBGOQ70J.js";import"./twilio-DAuME2Y9.js";import"./charts-D4hDxUnJ.js";import"./socket-CzTGKfeH.js";const se={class:"mb-4 flex items-start justify-between gap-4"},oe={class:"text-lg font-semibold text-gray-900 dark:text-white"},ie={key:0,class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},ne=["disabled"],le={class:"flex items-center justify-between border-b border-gray-100 py-4 dark:border-gray-700"},de={class:"flex items-center justify-between border-b border-gray-100 py-4 dark:border-gray-700"},ue={class:"border-b border-gray-100 py-4 dark:border-gray-700"},ce={class:"space-y-2"},ge=["value"],be={class:"text-sm font-medium text-gray-900 dark:text-white"},me={class:"mt-0.5 text-xs text-gray-500 dark:text-gray-400"},ye={class:"flex items-center justify-between border-b border-gray-100 py-4 dark:border-gray-700"},pe={class:"border-b border-gray-100 py-4 dark:border-gray-700"},fe={class:"grid gap-2 sm:grid-cols-2"},xe=["checked","onChange"],ve={class:"text-gray-900 dark:text-white"},_e={class:"border-b border-gray-100 py-4 dark:border-gray-700"},he={class:"py-4"},ke={class:"grid gap-4 sm:grid-cols-3"},A={__name:"_ConfigForm",props:{modelValue:{type:Object,required:!0},title:{type:String,default:"Config"},description:{type:String,default:""},submitting:{type:Boolean,default:!1},saveLabel:{type:String,default:"Save Changes"}},emits:["save"],setup(m,{emit:F}){const V=m,j=F,$=[{id:"permissive",label:"Permissive — trust every claim",description:"Any session that types a known visitor's email or phone gets full cross-session access. Highest impersonation risk."},{id:"moderate",label:"Moderate — score-based",description:"Auto-verifies when corroborating signals (FingerprintJS hash, browser signature, IP / subnet, identifier already known) reach a moderate threshold."},{id:"strict",label:"Strict — high score threshold",description:"Same scoring engine as Moderate but requires multiple corroborating signals or a direct trigger."},{id:"regulated",label:"Regulated — direct triggers only",description:"Score-based path is disabled entirely. Only form/CRM/inbound-call/first-profile/returning-device trigger verification."}],x=[{id:"identity",label:"Identity"},{id:"enrichment",label:"Company Insights"},{id:"engagement",label:"Engagement"},{id:"current_session",label:"Current Session"},{id:"recent_pages",label:"Recent Pages"},{id:"past_conversations",label:"Past Conversations"},{id:"behavioral_signals",label:"Behavioral Signals"},{id:"crm_state",label:"CRM State"},{id:"bookings",label:"Bookings"},{id:"form_responses",label:"Form Responses"},{id:"extracted_facts",label:"Extracted Facts"}],a=M({enabled:!0,capture_website_forms:!0,verification_policy:"strict",accept_inbound_call_verification:!0,enabled_sections:[],custom_intro:"",max_recent_pages:5,max_past_conversations:5,max_extracted_facts:15});G(()=>V.modelValue,o=>{o&&Object.assign(a,{enabled:o.enabled??!0,capture_website_forms:o.capture_website_forms??!0,verification_policy:o.verification_policy||"strict",accept_inbound_call_verification:o.accept_inbound_call_verification??!0,enabled_sections:Array.isArray(o.enabled_sections)?[...o.enabled_sections]:[],custom_intro:o.custom_intro||"",max_recent_pages:o.max_recent_pages??5,max_past_conversations:o.max_past_conversations??5,max_extracted_facts:o.max_extracted_facts??15})},{immediate:!0,deep:!0});function y(o){return a.enabled_sections.length?a.enabled_sections.includes(o):!0}function p(o){if(!a.enabled_sections.length){a.enabled_sections=x.map(r=>r.id).filter(r=>r!==o);return}const t=a.enabled_sections.indexOf(o);t>=0?a.enabled_sections.splice(t,1):a.enabled_sections.push(o),a.enabled_sections.length===x.length&&(a.enabled_sections=[])}function d(){j("save",{enabled:a.enabled,capture_website_forms:a.capture_website_forms,verification_policy:a.verification_policy,accept_inbound_call_verification:a.accept_inbound_call_verification,enabled_sections:[...a.enabled_sections],custom_intro:a.custom_intro,max_recent_pages:a.max_recent_pages,max_past_conversations:a.max_past_conversations,max_extracted_facts:a.max_extracted_facts})}return(o,t)=>(n(),l("form",{class:"rounded-2xl border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800/50",onSubmit:W(d,["prevent"])}
1,[e("div",se,[e("div",null,[e("h3",oe,c(m.title),1),m.description?(n(),l("p",ie,c(m.description),1)):S("",!0)]),e("button",{type:"submit",disabled:m.submitting,class:"flex shrink-0 items-center gap-2 rounded-xl bg-linear-to-r from-teal-500 to-cyan-500 px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition-all hover:from-teal-600 hover:to-cyan-600 disabled:cursor-not-allowed disabled:opacity-50"},[m.submitting?(n(),E(b(U),{key:0,size:16,class:"animate-spin"})):S("",!0),C(" "+c(m.saveLabel),1)],8,ne)]),e("div",le,[t[8]||(t[8]=e("div",null,[e("p",{class:"font-medium text-gray-900 dark:text-white"},"Enable Identity Graph"),e("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," When off, AI agents receive no cross-session identity context. ")],-1)),e("button",{type:"button",onClick:t[0]||(t[0]=r=>a.enabled=!a.enabled),class:f(["relative h-6 w-11 shrink-0 rounded-full transition-colors focus:ring-2 focus:ring-teal-500 focus:ring-offset-2 focus:outline-none",a.enabled?"bg-teal-500":"bg-gray-300 dark:bg-gray-600"])},[e("span",{class:f(["absolute top-0.5 left-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform",a.enabled?"translate-x-5":"translate-x-0"])},null,2)],2)]),e("div",de,[t[9]||(t[9]=e("div",null,[e("p",{class:"font-medium text-gray-900 dark:text-white"},"Capture Website Forms"),e("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," Inject the form-intercept script alongside the widget so customer-site form submissions flow into the Identity Graph. ")],-1)),e("button",{type:"button",onClick:t[1]||(t[1]=r=>a.capture_website_forms=!a.capture_website_forms),class:f(["relative h-6 w-11 shrink-0 rounded-full transition-colors focus:ring-2 focus:ring-teal-500 focus:ring-offset-2 focus:outline-none",a.capture_website_forms?"bg-teal-500":"bg-gray-300 dark:bg-gray-600"])},[e("span",{class:f(["absolute top-0.5 left-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform",a.capture_website_forms?"translate-x-5":"translate-x-0"])},null,2)],2)]),e("div",ue,[t[10]||(t[10]=e("p",{class:"font-medium text-gray-900 dark:text-white"},"Verification Policy",-1)),t[11]||(t[11]=e("p",{class:"mb-3 text-sm text-gray-500 dark:text-gray-400"},' Determines how aggressively a session that claims an identity is promoted to "verified" for cross-session AI context. ',-1)),e("div",ce,[(n(),l(P,null,D($,r=>e("label",{key:r.id,class:f(["flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors",[a.verification_policy===r.id?"border-teal-500 bg-teal-50 dark:bg-teal-500/10":"border-gray-200 hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-700/50"]])},[v(e("input",{type:"radio",value:r.id,"onUpdate:modelValue":t[2]||(t[2]=_=>a.verification_policy=_),class:"mt-1 h-4 w-4 border-gray-300 text-teal-600 focus:ring-teal-500"},null,8,ge),[[N,a.verification_policy]]),e("div",null,[e("p",be,c(r.label),1),e("p",me,c(r.description),1)])],2)),64))])]),e("div",ye,[t[12]||(t[12]=e("div",null,[e("p",{class:"font-medium text-gray-900 dark:text-white"},"Trust Inbound Caller-ID"),e("p",{class:"text-sm text-gray-500 dark:text-gray-400"}
1,` Promote an inbound voice call's session to "verified" when the caller-ID matches a known phone for the visitor. `)],-1)),e("button",{type:"button",onClick:t[3]||(t[3]=r=>a.accept_inbound_call_verification=!a.accept_inbound_call_verification),class:f(["relative h-6 w-11 shrink-0 rounded-full transition-colors focus:ring-2 focus:ring-teal-500 focus:ring-offset-2 focus:outline-none",a.accept_inbound_call_verification?"bg-teal-500":"bg-gray-300 dark:bg-gray-600"])},[e("span",{class:f(["absolute top-0.5 left-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform",a.accept_inbound_call_verification?"translate-x-5":"translate-x-0"])},null,2)],2)]),e("div",pe,[t[13]||(t[13]=e("p",{class:"font-medium text-gray-900 dark:text-white"},"AI Agent Context Sections",-1)),t[14]||(t[14]=e("p",{class:"mb-3 text-sm text-gray-500 dark:text-gray-400"}," Which sections to include in the visitor context sent to AI agents. Leave all unchecked to include everything. ",-1)),e("div",fe,[(n(),l(P,null,D(x,r=>e("label",{key:r.id,class:f(["flex cursor-pointer items-center gap-3 rounded-lg border border-gray-200 p-2 text-sm transition-colors hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-700/50",{"border-teal-300 bg-teal-50 dark:border-teal-700 dark:bg-teal-900/20":y(r.id)}])},[e("input",{type:"checkbox",checked:y(r.id),onChange:_=>p(r.id),class:"h-4 w-4 rounded border-gray-300 text-teal-600 focus:ring-teal-500"},null,40,xe),e("span",ve,c(r.label),1)],2)),64))])]),e("div",_e,[t[15]||(t[15]=e("label",{class:"mb-1 block font-medium text-gray-900 dark:text-white"},"Custom Intro",-1)),t[16]||(t[16]=e("p",{class:"mb-2 text-sm text-gray-500 dark:text-gray-400"}," Optional paragraph prepended to every AI prompt's visitor-context block. ",-1)),v(e("textarea",{"onUpdate:modelValue":t[4]||(t[4]=r=>a.custom_intro=r),rows:"3",placeholder:"e.g. Use the visitor's name naturally. Reference past objections to build rapport.",class:"w-full rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 focus:border-teal-500 focus:ring-1 focus:ring-teal-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white"},null,512),[[I,a.custom_intro]])]),e("div",he,[t[20]||(t[20]=e("p",{class:"mb-3 font-medium text-gray-900 dark:text-white"},"Limits",-1)),e("div",ke,[e("div",null,[t[17]||(t[17]=e("label",{class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"}," Max Recent Pages ",-1)),v(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>a.max_recent_pages=r),type:"number",min:"1",max:"20",class:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-white"},null,512),[[I,a.max_recent_pages,void 0,{number:!0}]])]),e("div",null,[t[18]||(t[18]=e("label",{class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"}," Max Past Conversations ",-1)),v(e("input",{"onUpdate:modelValue":t[6]||(t[6]=r=>a.max_past_conversations=r),type:"number",min:"1",max:"20",class:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-white"},null,512),[[I,a.max_past_conversations,void 0,{number:!0}]])]),e("div",null,[t[19]||(t[19]=e("label",{class:"mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300"}," Max Extracted Facts ",-1)),v(e("input",{"onUpdate:modelValue":t[7]||(t[7]=r=>a.max_extracted_facts=r),type:"number",min:"1",max:"50",class:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-white"},null,512),[[I,a.max_extracted_facts,void 0,{number:!0}]])])])])],32))}},we={class:"mb-6 flex flex-wrap gap-2"},Ce={key:0,class:"rounded-lg border border-gray-200 bg-white p-8 text-center dark:border-gray-700 dark:bg-gray-800"},Se={key:1,class:"space-y-6"},$e={class:"rounded-2xl border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800/50"},Ie={class:"mt-4"},Oe={class:"relative"},Fe={key:0,class:"mt-2 max-h-60 overflow-auto rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800"},Ve=["onClick"],je={class:"font-medium text-gray-900 dark:text-white"},Pe={class:"text-xs text-gray-500 dark:text-gray-400"},De={key:0,class:"mt-6 rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-700/50"},Me={class:"mb-3 flex items-center justify-between"},Ue={class:"font-semibold text-gray-900 dark:text-white"},ze={class:"text-xs text-gray-500 dark:text-gray-400"},Ae={class:"flex cursor-pointer items-center gap-3 pb-3"},Ge={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Ee={key:1,class:"mt-4"},Le={key:2,class:"mt-4 flex justify-end"},Re=["disabled"],Ze={__name:"Config",setup(m){const{isLoading:F,data:V,refetch:j}
1=Q({queryKey:["admin","identity","config","defaults"],queryFn:Z}),$=M({});G(()=>V.value?.defaults,i=>{i&&Object.assign($,i)},{immediate:!0});const x=k(!1);async function a(i){x.value=!0;try{await Y(i),w.success("Global defaults saved"),j()}catch(s){w.error(s?.response?.data?.message||"Failed to save defaults")}finally{x.value=!1}}const y=k(""),p=k([]),d=k(null),o=k(!1),t=M({}),r=k(!1);let _=null;function L(){if(_&&clearTimeout(_),!y.value.trim()){p.value=[];return}_=setTimeout(async()=>{try{const{data:i}=await H.get("/admin/companies",{params:{search:y.value,limit:8}}),s=i?.companies||i?.data||[];p.value=s.slice(0,8)}catch{p.value=[]}},250)}function R(i){d.value=i,y.value="",p.value=[],o.value=!!i.identity_graph_use_custom_config,Object.keys(t).forEach(h=>delete t[h]);const s=i.identity_graph_config&&Object.keys(i.identity_graph_config).length?i.identity_graph_config:$;Object.assign(t,s)}function T(){d.value=null,o.value=!1,Object.keys(t).forEach(i=>delete t[i])}async function B(i){if(d.value){r.value=!0;try{await z(d.value._id,{use_custom_config:!0,config:i}),w.success("Per-company override saved")}catch(s){w.error(s?.response?.data?.message||"Failed to save override")}finally{r.value=!1}}}async function q(){if(d.value){r.value=!0;try{await z(d.value._id,{use_custom_config:!1}),w.success("Company reverted to global defaults")}catch(i){w.error(i?.response?.data?.message||"Failed to update company")}finally{r.value=!1}}}return(i,s)=>{const h=K("router-link");return n(),l("div",null,[s[12]||(s[12]=e("div",{class:"mb-6"},[e("h1",{class:"text-2xl font-bold text-gray-900 dark:text-white"},"Identity Graph Config"),e("p",{class:"mt-1 text-sm text-gray-600 dark:text-gray-400"}," Set the global Identity Graph configuration that applies to every company by default. For tenants that need a different posture, set a per-company override below. ")],-1)),e("div",we,[u(h,{to:"/admin/identity/persons",class:"inline-flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"},{default:O(()=>[u(b(X),{size:16}),s[2]||(s[2]=C(" Persons ",-1))]),_:1}),u(h,{to:"/admin/identity/profiles",class:"inline-flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"},{default:O(()=>[u(b(ee),{size:16}),s[3]||(s[3]=C(" Profiles ",-1))]),_:1}),u(h,{to:"/admin/identity/form-submissions",class:"inline-flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"},{default:O(()=>[u(b(te),{size:16}),s[4]||(s[4]=C(" Form Submissions ",-1))]),_:1}),u(h,{to:"/admin/identity/config",class:"inline-flex items-center gap-2 rounded-lg border border-teal-500 bg-teal-50 px-4 py-2 text-sm font-medium text-teal-700 dark:border-teal-500 dark:bg-teal-500/20 dark:text-teal-300"},{default:O(()=>[u(b(ae),{size:16}),s[5]||(s[5]=C(" Config ",-1))]),_:1})]),b(F)?(n(),l("div",Ce,[u(b(U),{size:32,class:"mx-auto animate-spin text-teal-500"}),s[6]||(s[6]=e("p",{class:"mt-3 text-sm text-gray-500 dark:text-gray-400"},"Loading defaults…",-1))])):(n(),l("div",Se,[u(A,{"model-value":$,submitting:x.value,title:"Global Defaults",description:"These values apply to every company that has not been opted into a custom config below.",onSave:a},null,8,["model-value","submitting"]),e("div",$e,[s[10]||(s[10]=e("h2",{class:"text-lg font-semibold text-gray-900 dark:text-white"},"Per-Company Override",-1)),s[11]||(s[11]=e("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"}," Find a company, then either flip it onto a custom config or return it to the global defaults. Override fields you leave blank inherit from the global defaults. ",-1)),e("div",Ie,[s[7]||(s[7]=e("label",{class:"mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"}," Search company ",-1)),e("div",Oe,[u(b(re),{size:18,class:"absolute top-1/2 left-3 -translate-y-1/2 text-gray-400 dark:text-gray-500"}),v(e("input",{"onUpdate:modelValue":s[0]||(s[0]=g=>y.value=g),type:"search",placeholder:"Company name…",class:"w-full rounded-lg border border-gray-200 bg-white py-2 pr-3 pl-10 text-sm focus:border-teal-500 focus:ring-1 focus:ring-teal-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white",onInput:L},null,544),[[I,y.value]])]),p.value.length?(n(),l("ul",Fe,[(n(!0),l(P,null,D(p.value,g=>(n(),l("li",{key:g._id,class:"cursor-pointer border-b border-gray-100 px-4 py-2 text-sm hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-700",onClick:Te=>R(g)},[e("div",je,c(g.company_name||"(unnamed)"),1),e("div",Pe,c(g.website||g._id),1)],8,Ve))),128))])):S("",!0)]),d.value?(n(),l("div",De,[e
1("div",Me,[e("div",null,[e("div",Ue,c(d.value.company_name),1),e("div",ze,c(d.value.website||d.value._id),1)]),e("button",{type:"button",onClick:T,class:"text-xs text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}," Change ")]),e("label",Ae,[v(e("input",{type:"checkbox","onUpdate:modelValue":s[1]||(s[1]=g=>o.value=g),class:"h-4 w-4 rounded border-gray-300 text-teal-600 focus:ring-teal-500"},null,512),[[J,o.value]]),s[8]||(s[8]=e("span",{class:"text-sm font-medium text-gray-900 dark:text-white"}," Use a custom Identity Graph config for this company ",-1))]),o.value?S("",!0):(n(),l("p",Ge," With the checkbox off, this company will read from the global defaults above. ")),o.value?(n(),l("div",Ee,[u(A,{"model-value":t,submitting:r.value,title:"Override Values",description:"Only the fields you change here are persisted; the rest stay tied to the global defaults.","save-label":"Save Override",onSave:B},null,8,["model-value","submitting"])])):(n(),l("div",Le,[e("button",{type:"button",disabled:r.value,onClick:q,class:"flex items-center gap-2 rounded-xl bg-linear-to-r from-teal-500 to-cyan-500 px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition-all hover:from-teal-600 hover:to-cyan-600 disabled:cursor-not-allowed disabled:opacity-50"},[r.value?(n(),E(b(U),{key:0,size:16,class:"animate-spin"})):S("",!0),s[9]||(s[9]=C(" Save (use global defaults) ",-1))],8,Re)]))])):S("",!0)])]))])}}};export{Ze 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.