@opencxh/domain 1.134.7 → 1.134.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=10,d=10,m=10,f=5,ue=new Set(["header","section","context","divider","image","list","actions","attachments"]);function b(e){if(typeof e=="string")return e.length>0;if(!e||typeof e!="object")return!1;const n=e;return typeof n.key=="string"||typeof n.value=="string"}function de(e,n=()=>{}){if(!Array.isArray(e))return[];const t=[];for(const i of e){if(t.length>=T){n("more than "+T+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const a=i;if(!ue.has(a.type)){n("unknown block type "+String(a.type));continue}switch(a.type){case"header":if(!b(a.text)){n("a header without text");continue}break;case"context":if(!b(a.text)){n("a context block without text");continue}break;case"image":if(!a.url||!a.alt){n("an image without url or alt");continue}break;case"section":Array.isArray(a.fields)&&a.fields.length>d&&(n("more than "+d+" fields in a section"),a.fields=a.fields.slice(0,d));break;case"list":if(!Array.isArray(a.items)||a.items.length===0){n("a list without items");continue}a.items.length>m&&(n("more than "+m+" list items"),a.items=a.items.slice(0,m));break;case"actions":{const r=Array.isArray(a.elements)?a.elements:[],o=r.filter(l=>l&&l.action_id&&l.invoke&&b(l.text));if(o.length!==r.length&&n("an action without action_id, invoke or text"),o.length===0)continue;o.length>f&&n("more than "+f+" actions"),a.elements=o.slice(0,f);break}}t.push(a)}return t}function w(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/\s+/g," ").trim()}function p(e){if(!e||e<0)return"";const n=Math.floor(e/60),t=Math.floor(e%60);return`${n}:${t.toString().padStart(2,"0")}`}function C(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function I(e){return e?.split("@")?.[0]||e||""}function u(e){return e.map(n=>n.name).join(", ")}function v(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const c={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${I(e.payload.from)}`:`Outbound call started — ${I(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,n)=>`Call answered — ${n}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,n)=>`Call on hold — ${n}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:e=>`Call ended${C(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${I(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:()=>"Video call ended"},VIDEO_CALL_MISSED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gemiste oproep",timeline:()=>"Missed video call"},VIDEO_CALL_FAILED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek mislukt",timeline:()=>"Video call failed"},EMAIL_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.EMAIL_RECEIVED",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:O},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:O},CHAT_MESSAGE_SENT:{shape:"message",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:e=>e.payload.text??""},CHAT_MESSAGE_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.CHAT_MESSAGE_RECEIVED",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:e=>e.payload.text??""},CHAT_MEMBER_JOINED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${u(e.payload.members)} toegevoegd`,timeline:e=>{const n=u(e.payload.members)||"Someone",t=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${n} joined the chat${t}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${u(e.payload.members)} verlaten`,timeline:e=>{const n=u(e.payload.members)||"Someone",t=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${n} left the chat${t}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${v(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:e=>`${v(e.payload.callType)} ended${C(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(n=>n.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,n)=>`${n} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,n)=>`${n} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,n)=>`Interaction started by ${n}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,n)=>`Status changed to ${e.payload.toStatus} by ${n}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,n)=>`Assigned by ${n}`}};function O(e){const n=e.payload,t=n.bodySnippet?.trim()||w(n.body??"");return n.subject?`${n.subject} — ${t}`:t}function s(e){return c[e]}function me(e){return s(e)?.icon??"circle"}function fe(e){return s(e)?.channelKind}function ge(e){const n=s(e)?.shape;return n==="message"||n==="note"}function Ee(e){return s(e)?.replyable===!0}function he(e){return s(e)?.carriesText===!0}function ye(e){return s(e)?.countsAs}function Ae(e){return s(e)?.playbookAuthored===!0}function V(e){const n=s(e.type)?.snippet;return n?n(e):""}function be(e,n){const t=s(e.type)?.timeline;return t?t(e,n):e.type.replace(/_/g," ").toLowerCase()}function Ie(e){const n=s(e.type)?.joinUrl;return n?n(e):void 0}function E(e,n){let t=e;for(const i of n.split(".")){if(t==null||typeof t!="object")return"";t=t[i]}return t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):""}function h(e,n,t){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return E(n,e.value)||null;const i={};for(const[r,o]of Object.entries(e.params??{}))i[r]=E(n,o);const a=t(e.key,i);return a===e.key?null:a}function B(e,n){if(!e||typeof e=="string"||"value"in e)return null;const t={};for(const[i,a]of Object.entries(e.params??{}))t[i]=E(n,a);return{key:e.key,params:t}}const _e=e=>e;function R(e){const n=c[e];return{type:e,shape:n.shape,channelKind:n.channelKind,icon:n.icon,replyable:n.replyable===!0,countsAs:n.countsAs,carriesText:n.carriesText===!0,triggerable:n.triggerable===!0,component:n.component,builtIn:!0,displayNameKey:n.displayNameKey}}function D(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class H{constructor(n=[],t=_e){this.translate=t;for(const i of n)i?.type&&(i.type in c||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(n){if(n in c)return R(n);const t=this.declared.get(n);return t?D(t):void 0}triggerable(){const n=Object.keys(c).filter(i=>c[i].triggerable).map(R),t=[...this.declared.values()].map(D).filter(i=>i.triggerable);return[...n,...t]}timelineText(n,t){const i=c[n.type];if(i?.timeline)return i.timeline(n,t);const a=this.declared.get(n.type);return h(a?.text,n,this.translate)??n.type.replace(/_/g," ").toLowerCase()}snippet(n){const t=c[n.type];if(t?.snippet)return t.snippet(n);const i=this.declared.get(n.type);return h(i?.text,n,this.translate)??""}descriptor(n){return this.declared.get(n)}blocks(n){const t=this.declared.get(n)?.render;return t?.length?t:void 0}get translator(){return this.translate}}const Te=new H,L=140;function Se(e){const n=e.trim();return n.length<=L?n:n.slice(0,L-1).trimEnd()+"…"}function Me(e,n){const t=B(n?.text,e),i=n?h(n.text,e,a=>a):null;return{activityId:e.id,type:e.type,snippet:Se(i??V(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...t?{snippetKey:t.key,snippetParams:t.params}:{}}}function Ne(e,n,t=[]){const i=e.createdAt;if(!i)return[];const a=new Set(t);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(n).filter(([r,o])=>o>=i&&!a.has(r)).map(([r])=>r)}function Ce(e){return e.createdAt??0}const ve=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function Oe(e){const n=[];for(const t of Object.keys(e))for(const i of Object.keys(e[t]))n.push({lang:t,key:i,value:e[t][i]});return n}function _(e){return e<10?`0${e}`:`${e}`}function j(e,n){const t=new Date(e),i=`${t.getUTCFullYear()}-${_(t.getUTCMonth()+1)}-${_(t.getUTCDate())}`;return n==="day"?i:`${i}T${_(t.getUTCHours())}`}function F(e,n){const t=new Date(e);return t.setUTCMinutes(0,0,0),n==="day"&&t.setUTCHours(0),t.getTime()}const Re=36e5,De=864e5;function Le(e,n,t){const i=t==="hour"?Re:De,a=[];for(let r=F(e,t);r<=n;r+=i)a.push(j(r,t));return a}const W=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Y=W.map(e=>e.id);function z(e,n){return`${e}.usage.${n}`}function ke(e,n){return n.map(t=>({id:z(e,t.unit),label:t.label,category:"Verbruik",valueType:t.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Y,...t.extraDimensions??[],"time"]}))}function Ue(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const $e=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],xe={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function X(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Pe(e){if(typeof e!="string")return;const n=e.trim();if(n==="org")return{kind:"org"};const t=n.indexOf(":");if(t<=0)return;const i=n.slice(0,t),a=n.slice(t+1).trim();if(a){if(i==="user")return{kind:"user",userId:a};if(i==="team")return{kind:"team",teamId:a}}}function q(e){return X(e)}function Ge(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function Ke(e){return q(e)}const J=["done","escalated","failed","timed_out","stopped"],Q=["awaiting_approval","awaiting_reply"];function Z(e){return J.includes(e)}function we(e){return Z(e)}function Ve(e){return Q.includes(e)}const M=[{id:"openai",label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function y(e){return M.find(n=>n.id===e)}function Be(e){return y(e)?.label??e}function He(e,n="gpt-5-mini"){return y(e)?.defaultModel??n}function je(e){return M.filter(n=>n.capabilities.includes(e))}function Fe(e){const n=y(e);return!!n&&!n.baseUrl}const We=new Set(["mail","message"]);function ee(e,n){const t=e.settings?.signatures?.[n];return!t||!t.enabled||!t.body||t.body.trim()===""?null:t}function Ye(e,n,t,i="html"){if(!e)return t;const a=ee(e,n);return a?`${t}${i==="text"?`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=10,d=10,m=10,f=5,ue=new Set(["header","section","context","divider","image","list","actions","attachments"]);function b(e){if(typeof e=="string")return e.length>0;if(!e||typeof e!="object")return!1;const t=e;return typeof t.key=="string"||typeof t.value=="string"}function de(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=S){t("more than "+S+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const a=i;if(!ue.has(a.type)){t("unknown block type "+String(a.type));continue}switch(a.type){case"header":if(!b(a.text)){t("a header without text");continue}break;case"context":if(!b(a.text)){t("a context block without text");continue}break;case"image":if(!a.url||!a.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(a.fields)&&a.fields.length>d&&(t("more than "+d+" fields in a section"),a.fields=a.fields.slice(0,d));break;case"list":if(!Array.isArray(a.items)||a.items.length===0){t("a list without items");continue}a.items.length>m&&(t("more than "+m+" list items"),a.items=a.items.slice(0,m));break;case"actions":{const r=Array.isArray(a.elements)?a.elements:[],o=r.filter(l=>l&&l.action_id&&l.invoke&&b(l.text));if(o.length!==r.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>f&&t("more than "+f+" actions"),a.elements=o.slice(0,f);break}}n.push(a)}return n}function w(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/\s+/g," ").trim()}function p(e){if(!e||e<0)return"";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function C(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function I(e){return e?.split("@")?.[0]||e||""}function u(e){return e.map(t=>t.name).join(", ")}function v(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const c={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${I(e.payload.from)}`:`Outbound call started — ${I(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek aangenomen",timeline:(e,t)=>`Call answered — ${t}`},VOICE_CALL_HOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"In de wacht",timeline:(e,t)=>`Call on hold — ${t}`},VOICE_CALL_UNHOLD:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Hervat"},VOICE_CALL_ENDED:{shape:"event",channelKind:"voice",icon:"phone",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:e=>`Call ended${C(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${I(e.payload.from)}`},VOICE_CALL_FAILED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek mislukt",timeline:()=>"Call failed"},VOICE_CALL_VOICEMAIL:{shape:"artifact",channelKind:"voice",icon:"phone",snippet:e=>e.payload.transcription?.trim()?e.payload.transcription:"Voicemail ontvangen"},VIDEO_CALL_STARTED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek gestart",timeline:()=>"Video call started"},VIDEO_CALL_ANSWERED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek aangenomen",timeline:()=>"Video call answered"},VIDEO_CALL_HOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"In de wacht"},VIDEO_CALL_UNHOLD:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Hervat"},VIDEO_CALL_ENDED:{shape:"event",channelKind:"video",icon:"video",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:()=>"Video call ended"},VIDEO_CALL_MISSED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gemiste oproep",timeline:()=>"Missed video call"},VIDEO_CALL_FAILED:{shape:"event",channelKind:"video",icon:"video",snippet:()=>"Gesprek mislukt",timeline:()=>"Video call failed"},EMAIL_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.EMAIL_RECEIVED",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:O},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:O},CHAT_MESSAGE_SENT:{shape:"message",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:e=>e.payload.text??""},CHAT_MESSAGE_RECEIVED:{shape:"message",triggerable:!0,displayNameKey:"communication:activity.CHAT_MESSAGE_RECEIVED",component:"communication:ChatMessage",channelKind:"chat",icon:"message-circle",replyable:!0,carriesText:!0,countsAs:"inbound_message",snippet:e=>e.payload.text??""},CHAT_MEMBER_JOINED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${u(e.payload.members)} toegevoegd`,timeline:e=>{const t=u(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · added by ${e.payload.initiator.name}`:"";return`${t} joined the chat${n}`}},CHAT_MEMBER_LEFT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`${u(e.payload.members)} verlaten`,timeline:e=>{const t=u(e.payload.members)||"Someone",n=e.payload.initiator?.name?` · removed by ${e.payload.initiator.name}`:"";return`${t} left the chat${n}`}},CHAT_RENAMED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Hernoemd naar "${e.payload.newName}"`,timeline:e=>`Chat renamed to "${e.payload.newName}"${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`},CHAT_CALL_STARTED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:()=>"Gesprek gestart",timeline:e=>`${v(e.payload.callType)} started${e.payload.initiator?` by ${e.payload.initiator.name}`:""}`,joinUrl:e=>e.payload.joinUrl},CHAT_CALL_ENDED:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>`Gesprek beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:e=>`${v(e.payload.callType)} ended${C(e.payload.duration)}`,joinUrl:e=>e.payload.joinUrl},CHAT_EVENT:{shape:"event",channelKind:"chat",icon:"message-circle",snippet:e=>e.payload.text??e.payload.eventType,timeline:e=>e.payload.text||e.payload.eventType},TRANSCRIPT_ADDED:{shape:"artifact",triggerable:!0,displayNameKey:"communication:activity.TRANSCRIPT_ADDED",component:"communication:TranscriptionActivity",icon:"captions",carriesText:!0,snippet:e=>(e.payload.segments??[]).map(t=>t.text).join(" ")},COMMENT_ADDED:{shape:"note",component:"communication:CommentActivity",icon:"sticky-note",carriesText:!0,snippet:e=>e.payload.text??""},FILE_UPLOADED:{shape:"artifact",component:"communication:FileActivity",icon:"paperclip",snippet:e=>`Bestand: ${e.payload.fileName}`},AI_MESSAGE_ADDED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.AI_MESSAGE_ADDED",icon:"circle",snippet:e=>e.payload.output?.text??e.payload.input?.text??"",timeline:()=>"AI message added"},AI_ACTION_PROPOSED:{shape:"event",component:"communication:ProposedActionCard",icon:"circle",playbookAuthored:!0,snippet:e=>`Voorstel wacht op goedkeuring (${e.payload.actions?.length??0} actie(s))`},PLAYBOOK_STARTED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:e=>`Playbook gestart${e.payload.playbookName?`: ${e.payload.playbookName}`:""}`,timeline:e=>`Playbook gestart${e.payload.playbookName?` — ${e.payload.playbookName}`:""}`},PLAYBOOK_COMPLETED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook afgerond",timeline:()=>"Playbook afgerond"},PLAYBOOK_ESCALATED:{shape:"event",icon:"circle",playbookAuthored:!0,snippet:()=>"Playbook geëscaleerd naar een mens",timeline:()=>"Playbook geëscaleerd naar een mens"},MEETING_SCHEDULED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gepland: ${e.payload.title}`,timeline:()=>"Meeting scheduled",joinUrl:e=>e.payload.joinUrl},MEETING_STARTED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering gestart: ${e.payload.title}`,timeline:()=>"Meeting started",joinUrl:e=>e.payload.joinUrl},MEETING_ENDED:{shape:"event",icon:"calendar",snippet:e=>`Vergadering beëindigd${e.payload.duration?` (${p(e.payload.duration)})`:""}`,timeline:()=>"Meeting ended"},MEETING_PARTICIPANT_JOINED:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} deelgenomen`,timeline:(e,t)=>`${t} joined the meeting`},MEETING_PARTICIPANT_LEFT:{shape:"event",icon:"calendar",snippet:e=>`${e.payload.name} verlaten`,timeline:(e,t)=>`${t} left the meeting`},INTERACTION_CREATED:{shape:"event",icon:"circle",snippet:()=>"Interactie aangemaakt",timeline:(e,t)=>`Interaction started by ${t}`},INTERACTION_STATUS_CHANGED:{shape:"event",triggerable:!0,displayNameKey:"communication:activity.INTERACTION_STATUS_CHANGED",icon:"circle-dot",snippet:e=>`Status: ${e.payload.fromStatus} → ${e.payload.toStatus}`,timeline:(e,t)=>`Status changed to ${e.payload.toStatus} by ${t}`},INTERACTION_ASSIGNED:{shape:"event",icon:"user",snippet:()=>"Interactie toegewezen",timeline:(e,t)=>`Assigned by ${t}`}};function O(e){const t=e.payload,n=t.bodySnippet?.trim()||w(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function s(e){return c[e]}function me(e){return s(e)?.icon??"circle"}function fe(e){return s(e)?.channelKind}function ge(e){const t=s(e)?.shape;return t==="message"||t==="note"}function Ee(e){return s(e)?.replyable===!0}function he(e){return s(e)?.carriesText===!0}function ye(e){return s(e)?.countsAs}function Ae(e){return s(e)?.playbookAuthored===!0}function V(e){const t=s(e.type)?.snippet;return t?t(e):""}function be(e,t){const n=s(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function Ie(e){const t=s(e.type)?.joinUrl;return t?t(e):void 0}function E(e,t){let n=e;for(const i of t.split(".")){if(n==null||typeof n!="object")return"";n=n[i]}return n==null?"":typeof n=="string"?n:typeof n=="number"||typeof n=="boolean"?String(n):""}function h(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return E(t,e.value)||null;const i={};for(const[r,o]of Object.entries(e.params??{}))i[r]=E(t,o);const a=n(e.key,i);return a===e.key?null:a}function B(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[i,a]of Object.entries(e.params??{}))n[i]=E(t,a);return{key:e.key,params:n}}const _e=e=>e;function R(e){const t=c[e];return{type:e,shape:t.shape,channelKind:t.channelKind,icon:t.icon,replyable:t.replyable===!0,countsAs:t.countsAs,carriesText:t.carriesText===!0,triggerable:t.triggerable===!0,component:t.component,builtIn:!0,displayNameKey:t.displayNameKey}}function D(e){return{type:e.type,shape:e.shape,channelKind:e.channelKind,icon:e.icon||"circle",replyable:e.replyable===!0,countsAs:e.countsAs,carriesText:e.carriesText===!0,triggerable:e.triggerable===!0,component:e.component,builtIn:!1,displayNameKey:e.displayNameKey}}class H{constructor(t=[],n=_e){this.translate=n;for(const i of t)i?.type&&(i.type in c||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(t){if(t in c)return R(t);const n=this.declared.get(t);return n?D(n):void 0}triggerable(){const t=Object.keys(c).filter(i=>c[i].triggerable).map(R),n=[...this.declared.values()].map(D).filter(i=>i.triggerable);return[...t,...n]}timelineText(t,n){const i=c[t.type];if(i?.timeline)return i.timeline(t,n);const a=this.declared.get(t.type);return h(a?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=c[t.type];if(n?.snippet)return n.snippet(t);const i=this.declared.get(t.type);return h(i?.text,t,this.translate)??""}descriptor(t){return this.declared.get(t)}blocks(t){const n=this.declared.get(t)?.render;return n?.length?n:void 0}get translator(){return this.translate}}const Se=new H,L=140;function Te(e){const t=e.trim();return t.length<=L?t:t.slice(0,L-1).trimEnd()+"…"}function Me(e,t){const n=B(t?.text,e),i=t?h(t.text,e,a=>a):null;return{activityId:e.id,type:e.type,snippet:Te(i??V(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function Ne(e,t,n=[]){const i=e.createdAt;if(!i)return[];const a=new Set(n);return e.author.type==="user"&&e.author.id&&a.add(e.author.id),Object.entries(t).filter(([r,o])=>o>=i&&!a.has(r)).map(([r])=>r)}function Ce(e){return e.createdAt??0}const ve=[{id:"agent",label:"Agent",labelSource:"user"},{id:"team",label:"Team",labelSource:"team"},{id:"inbox",label:"Inbox",labelSource:"inbox"},{id:"channel",label:"Kanaal",labelSource:"channel"},{id:"provider",label:"Provider",labelSource:"raw"},{id:"status",label:"Status",labelSource:"raw"},{id:"handledBy",label:"Afhandelaar",labelSource:"raw"},{id:"time",label:"Tijd",labelSource:"raw"}];function Oe(e){const t=[];for(const n of Object.keys(e))for(const i of Object.keys(e[n]))t.push({lang:n,key:i,value:e[n][i]});return t}function _(e){return e<10?`0${e}`:`${e}`}function F(e,t){const n=new Date(e),i=`${n.getUTCFullYear()}-${_(n.getUTCMonth()+1)}-${_(n.getUTCDate())}`;return t==="day"?i:`${i}T${_(n.getUTCHours())}`}function j(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const Re=36e5,De=864e5;function Le(e,t,n){const i=n==="hour"?Re:De,a=[];for(let r=j(e,n);r<=t;r+=i)a.push(F(r,n));return a}const W=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],Y=W.map(e=>e.id);function z(e,t){return`${e}.usage.${t}`}function ke(e,t){return t.map(n=>({id:z(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...Y,...n.extraDimensions??[],"time"]}))}function Ue(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const $e=[{name:"text",type:"string"},{name:"subject",type:"string"},{name:"from",type:"string"},{name:"type",type:"string"},{name:"direction",type:"string"},{name:"channelId",type:"string"},{name:"interactionId",type:"string"},{name:"activityId",type:"string"},{name:"authorType",type:"string"},{name:"authorName",type:"string"},{name:"textRaw",type:"string"},{name:"fromStatus",type:"string"},{name:"toStatus",type:"string"},{name:"contactId",type:"string"},{name:"companyId",type:"string"}],xe={topics:[{name:"topic",type:"string"},{name:"confidence",type:"number"}],question:[{name:"answer",type:"boolean"},{name:"confidence",type:"number"}],extract:[]};function X(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Pe(e){if(typeof e!="string")return;const t=e.trim();if(t==="org")return{kind:"org"};const n=t.indexOf(":");if(n<=0)return;const i=t.slice(0,n),a=t.slice(n+1).trim();if(a){if(i==="user")return{kind:"user",userId:a};if(i==="team")return{kind:"team",teamId:a}}}function q(e){return X(e)}function Ge(e){switch(e.kind){case"personal":return{kind:"user",userId:e.userId};case"team":return{kind:"team",teamId:e.teamId};case"org":return{kind:"org"}}}function Ke(e){return q(e)}const J=["done","escalated","failed","timed_out","stopped"],Q=["awaiting_approval","awaiting_reply"];function Z(e){return J.includes(e)}function we(e){return Z(e)}function Ve(e){return Q.includes(e)}const M=[{id:"openai",label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",label:"Anthropic",capabilities:["chat"],defaultModel:"claude-haiku-4-5",baseUrl:"https://api.anthropic.com/v1"},{id:"elevenlabs",label:"ElevenLabs",capabilities:["transcription"],baseUrl:"https://api.elevenlabs.io/v1"},{id:"moonshot",label:"Moonshot (Kimi)",capabilities:["chat"],defaultModel:"kimi-k3",baseUrl:"https://api.moonshot.ai/v1"},{id:"deepseek",label:"DeepSeek",capabilities:["chat"],defaultModel:"deepseek-v4-flash",baseUrl:"https://api.deepseek.com/v1"},{id:"groq",label:"Groq",capabilities:["chat"],defaultModel:"openai/gpt-oss-120b",baseUrl:"https://api.groq.com/openai/v1"},{id:"mistral",label:"Mistral",capabilities:["chat"],defaultModel:"mistral-large-latest",baseUrl:"https://api.mistral.ai/v1"},{id:"openrouter",label:"OpenRouter",capabilities:["chat"],defaultModel:"openrouter/auto",baseUrl:"https://openrouter.ai/api/v1"},{id:"ollama",label:"Ollama (self-hosted)",capabilities:["chat"],defaultModel:"llama3.3"},{id:"openai-compatible",label:"OpenAI-compatible (eigen endpoint)",capabilities:["chat"],defaultModel:"default"}];function y(e){return M.find(t=>t.id===e)}function Be(e){return y(e)?.label??e}function He(e,t="gpt-5-mini"){return y(e)?.defaultModel??t}function Fe(e){return M.filter(t=>t.capabilities.includes(e))}function je(e){const t=y(e);return!!t&&!t.baseUrl}const We=new Set(["mail","message"]);function ee(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function Ye(e,t,n,i="html"){if(!e)return n;const a=ee(e,t);return a?`${n}${i==="text"?`
2
2
 
3
- `:n==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:t}function ze(e){return e.endpoints??[]}const Xe=e=>!!e.assignedUserId||!!e.assignedInboxId,qe=e=>e.status==="closed",Je=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Qe=(e,n=30)=>e.title?.length<=n?e.title:`${e.title.substring(0,n)}...`;function Ze(e,n){return e.lastActivityAt?!(e.seenBy??[]).includes(n):!1}const en=2e3,nn=500,tn=12e3,an=4e3,ne=["contact","company"];function rn(e){if(!e)return!1;const n=e.slice(0,e.indexOf(":"));return ne.includes(n)}const A={NL:{callingCode:"31",trunkPrefix:"0",nsnMin:7,nsnMax:9},BE:{callingCode:"32",trunkPrefix:"0",nsnMin:8,nsnMax:9},LU:{callingCode:"352",nsnMin:6,nsnMax:9},DE:{callingCode:"49",trunkPrefix:"0",nsnMin:6,nsnMax:13},FR:{callingCode:"33",trunkPrefix:"0",nsnMin:9,nsnMax:9},GB:{callingCode:"44",trunkPrefix:"0",nsnMin:9,nsnMax:10},IE:{callingCode:"353",trunkPrefix:"0",nsnMin:7,nsnMax:9},ES:{callingCode:"34",nsnMin:9,nsnMax:9},PT:{callingCode:"351",nsnMin:9,nsnMax:9},IT:{callingCode:"39",nsnMin:6,nsnMax:11},AT:{callingCode:"43",trunkPrefix:"0",nsnMin:7,nsnMax:13},CH:{callingCode:"41",trunkPrefix:"0",nsnMin:9,nsnMax:9},DK:{callingCode:"45",nsnMin:8,nsnMax:8},SE:{callingCode:"46",trunkPrefix:"0",nsnMin:7,nsnMax:13},NO:{callingCode:"47",nsnMin:8,nsnMax:8},FI:{callingCode:"358",trunkPrefix:"0",nsnMin:5,nsnMax:12},PL:{callingCode:"48",nsnMin:9,nsnMax:9},US:{callingCode:"1",nsnMin:10,nsnMax:10},CA:{callingCode:"1",nsnMin:10,nsnMax:10}},te="NL",on=15,sn=8,ln=Array.from(new Set(Object.values(A).map(e=>e.callingCode))).sort((e,n)=>n.length-e.length);function k(e){if(e)return A[e.trim().toUpperCase()]}function g(e,n){return e.length>=n.nsnMin&&e.length<=n.nsnMax}function U(e){if(e.length>on)return null;for(const n of ln){if(!e.startsWith(n))continue;const t=e.slice(n.length);for(const i of Object.values(A)){if(i.callingCode!==n)continue;const a=i.trunkPrefix,r=a&&t.startsWith(a)?t.slice(a.length):t;if(g(r,i))return`+${n}${r}`}return null}return e.length<sn?null:`+${e}`}function cn(e){let n=e.trim();const t=n.match(/^(sips?|tel|whatsapp):/i);t&&(n=n.slice(t[0].length));const i=n.indexOf("@");return i>=0&&(n=n.slice(0,i)),n.trim()}function pn(e){if(!e)return!1;const n=e.indexOf("@");if(n<=0)return!1;const t=e.slice(0,n).trim();return!/^[+\d\s().-]+$/.test(t)}function S(e,n){if(!e)return null;const t=cn(e);if(!t)return null;const i=t.startsWith("+"),a=t.replace(/\D/g,"");if(!a)return null;if(i)return U(a);if(a.startsWith("00"))return U(a.slice(2));const r=k(n)??k(te);if(!r)return null;const o=r.trunkPrefix;if(o&&a.startsWith(o)){const l=a.slice(o.length);return g(l,r)?`+${r.callingCode}${l}`:null}if(a.startsWith(r.callingCode)){const l=a.slice(r.callingCode.length);if(g(l,r))return`+${r.callingCode}${l}`}return!o&&g(a,r)?`+${r.callingCode}${a}`:null}function un(e,n=9){const t=(e??"").replace(/\D/g,"");return t.length<n?null:t.slice(-n)}function N(e){if(!e)return null;const n=e.trim().toLowerCase(),t=n.lastIndexOf("@");if(t<=0||t===n.length-1)return null;const i=n.slice(0,t).split("+")[0],a=n.slice(t+1);return!i||!a.includes(".")?null:`${i}@${a}`}function dn(e){const n=N(e);return n?n.slice(n.lastIndexOf("@")+1):null}const mn=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function ie(e){if(!e)return null;const n=e.trim().toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);if(n.length<2)return null;const t=n.slice(-2).join(".");return mn.has(t)&&n.length>=3?n.slice(-3).join("."):t}const ae=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","hotmail.nl","hotmail.be","hotmail.co.uk","live.com","live.nl","live.be","msn.com","yahoo.com","yahoo.co.uk","ymail.com","icloud.com","me.com","mac.com","aol.com","gmx.net","gmx.de","web.de","protonmail.com","proton.me","pm.me","tutanota.com","zoho.com","mail.com","ziggo.nl","kpnmail.nl","planet.nl","home.nl","casema.nl","chello.nl","xs4all.nl","telfort.nl","hetnet.nl","zonnet.nl","upcmail.nl","quicknet.nl","telenet.be","skynet.be","proximus.be","scarlet.be"]);function fn(e){const n=ie(e);return n?ae.has(n):!1}function gn(e){if(!e)return!1;const n=e.trim().toLowerCase();return n==="tel"||n==="sms"||n==="whatsapp"||n==="fax"}function En(e,n,t){if(!e||!n)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const r=S(n,t);return r?`tel:${r}`:null}if(i==="fax"){const r=S(n,t);return r?`fax:${r}`:null}if(i==="mailto"||i==="email"){const r=N(n);return r?`mailto:${r}`:null}const a=n.trim().toLowerCase();return a?`${i}:${a}`:null}const hn=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,yn=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function An(e){if(typeof e!="string"||!e)return"";let n=e;return n=n.replace(/```[a-z]*\n?/gi,"").replace(/~~~[a-z]*\n?/gi,""),n=n.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1"),n=n.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1"),n=n.replace(/\[([^\]]*)\]\[[^\]]*\]/g,"$1"),n=n.replace(/<((?:https?|mailto):[^>\s]+)>/gi,"$1"),n=n.split(`
4
- `).map(t=>t.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s{0,3}>\s?/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").replace(/^\s*(?:[-*_]\s*){3,}$/,"")).join(`
5
- `),n=n.replace(hn,"$2"),n=n.replace(yn,"$2"),n=n.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),n=n.replace(/`([^`\n]+)`/g,"$1"),n.replace(/\s+/g," ").trim()}const bn=[/<blockquote/i,/class="?gmail_quote/i,/id="?[^"]*divRplyFwdMsg/i,/id="?[^"]*mail-editor-reference-message-container/i,/-{3,}\s*Original Message\s*-{3,}/i,/\n_{5,}\s*\n/,/\bOn\b[\s\S]{0,200}?\bwrote:/i],$=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,In=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function _n(e){const n=e.split(`
6
- `);for(let t=0;t<n.length;t++)if(In.test(n[t])||$.test(n[t])&&n.slice(t+1,t+4).some(i=>$.test(i)))return n.slice(0,t).join(`
7
- `).trim();return e}function x(e){let n=e;return n=n.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),n=n.replace(/<br\s*\/?>/gi,`
8
- `),n=n.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi,`
9
- `),n=n.replace(/<[^>]+>/g,""),n=n.replace(/<[^>]*$/,""),n}function P(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function G(e){return e.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#(\d+);/g,(n,t)=>P(Number(t))??n).replace(/&#x([0-9a-f]+);/gi,(n,t)=>P(parseInt(t,16))??n).replace(/&amp;/gi,"&")}function K(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
3
+ `:t==="mail"?"<br><br>-- <br>":"<br><br>"}${a.body}`:n}function ze(e){return e.endpoints??[]}const Xe=e=>!!e.assignedUserId||!!e.assignedInboxId,qe=e=>e.status==="closed",Je=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Qe=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function Ze(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const et=2e3,tt=500,nt=12e3,it=4e3,te=["contact","company"];function at(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return te.includes(t)}const A={NL:{callingCode:"31",trunkPrefix:"0",nsnMin:7,nsnMax:9},BE:{callingCode:"32",trunkPrefix:"0",nsnMin:8,nsnMax:9},LU:{callingCode:"352",nsnMin:6,nsnMax:9},DE:{callingCode:"49",trunkPrefix:"0",nsnMin:6,nsnMax:13},FR:{callingCode:"33",trunkPrefix:"0",nsnMin:9,nsnMax:9},GB:{callingCode:"44",trunkPrefix:"0",nsnMin:9,nsnMax:10},IE:{callingCode:"353",trunkPrefix:"0",nsnMin:7,nsnMax:9},ES:{callingCode:"34",nsnMin:9,nsnMax:9},PT:{callingCode:"351",nsnMin:9,nsnMax:9},IT:{callingCode:"39",nsnMin:6,nsnMax:11},AT:{callingCode:"43",trunkPrefix:"0",nsnMin:7,nsnMax:13},CH:{callingCode:"41",trunkPrefix:"0",nsnMin:9,nsnMax:9},DK:{callingCode:"45",nsnMin:8,nsnMax:8},SE:{callingCode:"46",trunkPrefix:"0",nsnMin:7,nsnMax:13},NO:{callingCode:"47",nsnMin:8,nsnMax:8},FI:{callingCode:"358",trunkPrefix:"0",nsnMin:5,nsnMax:12},PL:{callingCode:"48",nsnMin:9,nsnMax:9},US:{callingCode:"1",nsnMin:10,nsnMax:10},CA:{callingCode:"1",nsnMin:10,nsnMax:10}},ne="NL",rt=15,ot=8,st=Array.from(new Set(Object.values(A).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function k(e){if(e)return A[e.trim().toUpperCase()]}function g(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function U(e){if(e.length>rt)return null;for(const t of st){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const i of Object.values(A)){if(i.callingCode!==t)continue;const a=i.trunkPrefix,r=a&&n.startsWith(a)?n.slice(a.length):n;if(g(r,i))return`+${t}${r}`}return null}return e.length<ot?null:`+${e}`}function lt(e){let t=e.trim();const n=t.match(/^(sips?|tel|whatsapp):/i);n&&(t=t.slice(n[0].length));const i=t.indexOf("@");return i>=0&&(t=t.slice(0,i)),t.trim()}function ct(e){if(!e)return!1;const t=e.indexOf("@");if(t<=0)return!1;const n=e.slice(0,t).trim();return!/^[+\d\s().-]+$/.test(n)}function T(e,t){if(!e)return null;const n=lt(e);if(!n)return null;const i=n.startsWith("+"),a=n.replace(/\D/g,"");if(!a)return null;if(i)return U(a);if(a.startsWith("00"))return U(a.slice(2));const r=k(t)??k(ne);if(!r)return null;const o=r.trunkPrefix;if(o&&a.startsWith(o)){const l=a.slice(o.length);return g(l,r)?`+${r.callingCode}${l}`:null}if(a.startsWith(r.callingCode)){const l=a.slice(r.callingCode.length);if(g(l,r))return`+${r.callingCode}${l}`}return!o&&g(a,r)?`+${r.callingCode}${a}`:null}function pt(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function N(e){if(!e)return null;const t=e.trim().toLowerCase(),n=t.lastIndexOf("@");if(n<=0||n===t.length-1)return null;const i=t.slice(0,n).split("+")[0],a=t.slice(n+1);return!i||!a.includes(".")?null:`${i}@${a}`}function ut(e){const t=N(e);return t?t.slice(t.lastIndexOf("@")+1):null}const dt=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function ie(e){if(!e)return null;const t=e.trim().toLowerCase().replace(/\.$/,"").split(".").filter(Boolean);if(t.length<2)return null;const n=t.slice(-2).join(".");return dt.has(n)&&t.length>=3?t.slice(-3).join("."):n}const ae=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","hotmail.nl","hotmail.be","hotmail.co.uk","live.com","live.nl","live.be","msn.com","yahoo.com","yahoo.co.uk","ymail.com","icloud.com","me.com","mac.com","aol.com","gmx.net","gmx.de","web.de","protonmail.com","proton.me","pm.me","tutanota.com","zoho.com","mail.com","ziggo.nl","kpnmail.nl","planet.nl","home.nl","casema.nl","chello.nl","xs4all.nl","telfort.nl","hetnet.nl","zonnet.nl","upcmail.nl","quicknet.nl","telenet.be","skynet.be","proximus.be","scarlet.be"]);function mt(e){const t=ie(e);return t?ae.has(t):!1}function ft(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function gt(e,t,n){if(!e||!t)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const r=T(t,n);return r?`tel:${r}`:null}if(i==="fax"){const r=T(t,n);return r?`fax:${r}`:null}if(i==="mailto"||i==="email"){const r=N(t);return r?`mailto:${r}`:null}const a=t.trim().toLowerCase();return a?`${i}:${a}`:null}const Et=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,ht=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function yt(e){if(typeof e!="string"||!e)return"";let t=e;return t=t.replace(/```[a-z]*\n?/gi,"").replace(/~~~[a-z]*\n?/gi,""),t=t.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1"),t=t.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1"),t=t.replace(/\[([^\]]*)\]\[[^\]]*\]/g,"$1"),t=t.replace(/<((?:https?|mailto):[^>\s]+)>/gi,"$1"),t=t.split(`
4
+ `).map(n=>n.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s{0,3}>\s?/,"").replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").replace(/^\s*(?:[-*_]\s*){3,}$/,"")).join(`
5
+ `),t=t.replace(Et,"$2"),t=t.replace(ht,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const At=[/<blockquote/i,/class="?gmail_quote/i,/id="?[^"]*divRplyFwdMsg/i,/id="?[^"]*mail-editor-reference-message-container/i,/-{3,}\s*Original Message\s*-{3,}/i,/\n_{5,}\s*\n/,/\bOn\b[\s\S]{0,200}?\bwrote:/i],$=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,bt=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function It(e){const t=e.split(`
6
+ `);for(let n=0;n<t.length;n++)if(bt.test(t[n])||$.test(t[n])&&t.slice(n+1,n+4).some(i=>$.test(i)))return t.slice(0,n).join(`
7
+ `).trim();return e}function x(e){let t=e;return t=t.replace(/<(script|style)[\s\S]*?<\/\1>/gi,""),t=t.replace(/<br\s*\/?>/gi,`
8
+ `),t=t.replace(/<\/(p|div|li|tr|h[1-6]|ul|ol|table)>/gi,`
9
+ `),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function P(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function G(e){return e.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#(\d+);/g,(t,n)=>P(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>P(parseInt(n,16))??t).replace(/&amp;/gi,"&")}function K(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
10
10
  `).replace(/\n{3,}/g,`
11
11
 
12
- `).trim()}function Tn(e){if(typeof e!="string"||!e)return"";let n=e.length;for(const r of bn){const o=e.search(r);o>=0&&o<n&&(n=o)}const t=e.slice(0,n);let i=K(G(x(t)));return i||(i=K(G(x(e)))),_n(i)||i}const Sn=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Mn=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function Nn(e,n){return!!(e&&Sn.test(e)||n&&Mn.test(n))}const re=3,oe=600;function Cn(e,n){return e>=re||n>=oe}function se(e,n){const t=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},a=n.intents.filter(o=>!t.has(o.intent)).map(o=>On(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return a;const r=new Set(a.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(a.push(o),r.add(o.intent));return a}function le(e,n){const t={};for(const i of e.intents){if(!i.togglable)continue;const a=n?.[i.intent];t[i.intent]=a??i.defaultEnabled??!0}return t}function vn(e,n){const t=le(e,n);return Object.entries(t).filter(([,i])=>!i).map(([i])=>i)}function On(e,n){return n?{intent:n.intent??e.intent,targetSchemes:n.targetSchemes??e.targetSchemes,transport:n.transport??e.transport}:e}function Rn(e,n){const t=[];for(const i of e){if(!i.enabled)continue;const a=n[i.providerId];if(a)for(const r of se(i,a))t.push({channel:i,description:a,capability:r})}return t}function Dn(e,n){return n.filter(t=>t.capability.intent===e)}function ce(e,n){return n.filter(t=>t.capability.targetSchemes.includes(e))}function Ln(e,n){return ce(e.scheme,n)}function kn(e,n,t){const i=[];for(const a of e)for(const r of t)r.capability.intent===n&&r.capability.targetSchemes.includes(a.scheme)&&i.push({channelIntent:r,endpoint:a});return i}var pe=(e=>(e.MAILTO="mailto",e.SIP="sip",e.TEL="tel",e.WEBHOOK="webhook",e.USERNAME="username",e.ID="id",e.CUSTOM="custom",e.URL="url",e.TELEGRAM="telegram",e.WHATSAPP="whatsapp",e.MESSENGER="messenger",e.INSTAGRAM="instagram",e.VIBER="viber",e.SMS="sms",e.FAX="fax",e.TEAMS="teams",e.CALENDAR="calendar",e))(pe||{});const Un="message_window",$n="message_templates",xn={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Pn=(e,n)=>({intent:e,...n}),Gn="folder_management",Kn="remote_search",wn={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Vn=9e4,Bn="installation-id";exports.ACTIVITY_CATALOG=c;exports.AI_VENDORS=M;exports.ActivityTypeRegistry=H;exports.BUILT_IN_ONLY=Te;exports.CLASSIFY_VARS=xe;exports.CORE_DIMENSIONS=ve;exports.CommunicationScheme=pe;exports.DEFAULT_MEMORY_BUDGET=an;exports.DEFAULT_PHONE_REGION=te;exports.FEATURE_FOLDER_MANAGEMENT=Gn;exports.FEATURE_REMOTE_SEARCH=Kn;exports.INSTALLATION_HEADER=Bn;exports.InteractionParticipantRole=xn;exports.MAX_ACTIONS=f;exports.MAX_BLOCKS=T;exports.MAX_FIELDS=d;exports.MAX_LIST_ITEMS=m;exports.MAX_MEMORY_BUDGET=tn;exports.MAX_MEMORY_CHARS=en;exports.MIN_MEMORY_BUDGET=nn;exports.PAUSED_RUN_STATUSES=Q;exports.PHONE_REGIONS=A;exports.PRESENCE_ONLINE_WINDOW_MS=Vn;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=$n;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Un;exports.PUBLIC_EMAIL_DOMAINS=ae;exports.RELATED_SUBJECT_KINDS=ne;exports.SIGNATURE_INTENTS=We;exports.SUMMARY_MIN_LAST_CHARS=oe;exports.SUMMARY_MIN_MESSAGES=re;exports.TERMINAL_RUN_STATUSES=J;exports.TRIGGER_VARS=$e;exports.UNSUPPORTED=wn;exports.USAGE_DIMENSIONS=W;exports.USAGE_DIMENSION_IDS=Y;exports.actingIdentityKey=q;exports.activityIconOf=me;exports.activityJoinUrl=Ie;exports.activitySnippet=V;exports.activityTextParams=B;exports.activityTimelineText=be;exports.activityTimestamp=Ce;exports.activityTypeInfo=s;exports.actorKey=Ke;exports.aiVendorDefaultModel=He;exports.aiVendorLabel=Be;exports.aiVendorNeedsBaseUrl=Fe;exports.aiVendorsWith=je;exports.applySignature=Ye;exports.buildActivityPreview=Me;exports.buildChannelIntents=Rn;exports.carriesText=he;exports.channelKindOf=fe;exports.cleanMessageText=Tn;exports.defineIntent=Pn;exports.disabledIntentsFromCapabilities=vn;exports.emailDomain=dn;exports.endpointKey=En;exports.filterByEndpoint=Ln;exports.filterByIntent=Dn;exports.filterByTargetScheme=ce;exports.findAiVendor=y;exports.flattenLocales=Oe;exports.floorToPeriod=F;exports.formatActingIdentity=X;exports.formatPeriod=j;exports.getActivitySeenUserIds=Ne;exports.getContactEndpoints=ze;exports.getShortTitle=Qe;exports.getUrgencyScore=Je;exports.humanizeAction=Ue;exports.isAssigned=Xe;exports.isClosed=qe;exports.isInteractionUnseen=Ze;exports.isLikelyBulk=Nn;exports.isMessageType=ge;exports.isPaused=Ve;exports.isPlaybookAuthoredType=Ae;exports.isPublicEmailDomain=fn;exports.isReplyableType=Ee;exports.isRetryable=we;exports.isTerminal=Z;exports.isThreadLongEnough=Cn;exports.looksLikeEmail=pn;exports.matchContactToIntents=kn;exports.messageCountsAs=ye;exports.needsPhoneRegion=gn;exports.normalizeBlocks=de;exports.normalizeEmail=N;exports.parseActingIdentity=Pe;exports.periodsInRange=Le;exports.phoneSuffix=un;exports.plainTextFromMarkdown=An;exports.playbookActor=Ge;exports.readPath=E;exports.registrableDomain=ie;exports.relatedByDefault=rn;exports.resolveAccountCapabilities=le;exports.resolveActivityText=h;exports.resolveChannelIntents=se;exports.resolveSignature=ee;exports.stripHtml=w;exports.toE164=S;exports.usageMetricId=z;exports.usageMetrics=ke;
12
+ `).trim()}function _t(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const r of At){const o=e.search(r);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let i=K(G(x(n)));return i||(i=K(G(x(e)))),It(i)||i}const St=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Tt=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function Mt(e,t){return!!(e&&St.test(e)||t&&Tt.test(t))}const re=3,oe=600;function Nt(e,t){return e>=re||t>=oe}function se(e,t){const n=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},a=t.intents.filter(o=>!n.has(o.intent)).map(o=>vt(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return a;const r=new Set(a.map(o=>o.intent));for(const o of e.extraIntents)r.has(o.intent)||(a.push(o),r.add(o.intent));return a}function le(e,t){const n={};for(const i of e.intents){if(!i.togglable)continue;const a=t?.[i.intent];n[i.intent]=a??i.defaultEnabled??!0}return n}function Ct(e,t){const n=le(e,t);return Object.entries(n).filter(([,i])=>!i).map(([i])=>i)}function vt(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Ot(e,t){const n=[];for(const i of e){if(!i.enabled)continue;const a=t[i.providerId];if(a)for(const r of se(i,a))n.push({channel:i,description:a,capability:r})}return n}function Rt(e,t){return t.filter(n=>n.capability.intent===e)}function ce(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function Dt(e,t){return ce(e.scheme,t)}function Lt(e,t,n){const i=[];for(const a of e)for(const r of n)r.capability.intent===t&&r.capability.targetSchemes.includes(a.scheme)&&i.push({channelIntent:r,endpoint:a});return i}var pe=(e=>(e.MAILTO="mailto",e.SIP="sip",e.TEL="tel",e.WEBHOOK="webhook",e.USERNAME="username",e.ID="id",e.CUSTOM="custom",e.URL="url",e.TELEGRAM="telegram",e.WHATSAPP="whatsapp",e.MESSENGER="messenger",e.INSTAGRAM="instagram",e.VIBER="viber",e.SMS="sms",e.FAX="fax",e.TEAMS="teams",e.CALENDAR="calendar",e))(pe||{});const kt={mailto:"mail",sip:"tel",tel:"tel",fax:"tel",sms:"chat",teams:"chat",telegram:"chat",messenger:"chat",instagram:"chat",viber:"chat",whatsapp:"wa",webhook:"note",url:"note",calendar:"note",username:"note",id:"note",custom:"note"};function Ut(e){return e?kt[e]??"note":"note"}const $t="message_window",xt="message_templates",Pt={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Gt=(e,t)=>({intent:e,...t}),Kt="folder_management",wt="remote_search",Vt={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Bt=9e4,Ht="installation-id";exports.ACTIVITY_CATALOG=c;exports.AI_VENDORS=M;exports.ActivityTypeRegistry=H;exports.BUILT_IN_ONLY=Se;exports.CLASSIFY_VARS=xe;exports.CORE_DIMENSIONS=ve;exports.CommunicationScheme=pe;exports.DEFAULT_MEMORY_BUDGET=it;exports.DEFAULT_PHONE_REGION=ne;exports.FEATURE_FOLDER_MANAGEMENT=Kt;exports.FEATURE_REMOTE_SEARCH=wt;exports.INSTALLATION_HEADER=Ht;exports.InteractionParticipantRole=Pt;exports.MAX_ACTIONS=f;exports.MAX_BLOCKS=S;exports.MAX_FIELDS=d;exports.MAX_LIST_ITEMS=m;exports.MAX_MEMORY_BUDGET=nt;exports.MAX_MEMORY_CHARS=et;exports.MIN_MEMORY_BUDGET=tt;exports.PAUSED_RUN_STATUSES=Q;exports.PHONE_REGIONS=A;exports.PRESENCE_ONLINE_WINDOW_MS=Bt;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=xt;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=$t;exports.PUBLIC_EMAIL_DOMAINS=ae;exports.RELATED_SUBJECT_KINDS=te;exports.SIGNATURE_INTENTS=We;exports.SUMMARY_MIN_LAST_CHARS=oe;exports.SUMMARY_MIN_MESSAGES=re;exports.TERMINAL_RUN_STATUSES=J;exports.TRIGGER_VARS=$e;exports.UNSUPPORTED=Vt;exports.USAGE_DIMENSIONS=W;exports.USAGE_DIMENSION_IDS=Y;exports.actingIdentityKey=q;exports.activityIconOf=me;exports.activityJoinUrl=Ie;exports.activitySnippet=V;exports.activityTextParams=B;exports.activityTimelineText=be;exports.activityTimestamp=Ce;exports.activityTypeInfo=s;exports.actorKey=Ke;exports.aiVendorDefaultModel=He;exports.aiVendorLabel=Be;exports.aiVendorNeedsBaseUrl=je;exports.aiVendorsWith=Fe;exports.applySignature=Ye;exports.buildActivityPreview=Me;exports.buildChannelIntents=Ot;exports.carriesText=he;exports.channelKindForScheme=Ut;exports.channelKindOf=fe;exports.cleanMessageText=_t;exports.defineIntent=Gt;exports.disabledIntentsFromCapabilities=Ct;exports.emailDomain=ut;exports.endpointKey=gt;exports.filterByEndpoint=Dt;exports.filterByIntent=Rt;exports.filterByTargetScheme=ce;exports.findAiVendor=y;exports.flattenLocales=Oe;exports.floorToPeriod=j;exports.formatActingIdentity=X;exports.formatPeriod=F;exports.getActivitySeenUserIds=Ne;exports.getContactEndpoints=ze;exports.getShortTitle=Qe;exports.getUrgencyScore=Je;exports.humanizeAction=Ue;exports.isAssigned=Xe;exports.isClosed=qe;exports.isInteractionUnseen=Ze;exports.isLikelyBulk=Mt;exports.isMessageType=ge;exports.isPaused=Ve;exports.isPlaybookAuthoredType=Ae;exports.isPublicEmailDomain=mt;exports.isReplyableType=Ee;exports.isRetryable=we;exports.isTerminal=Z;exports.isThreadLongEnough=Nt;exports.looksLikeEmail=ct;exports.matchContactToIntents=Lt;exports.messageCountsAs=ye;exports.needsPhoneRegion=ft;exports.normalizeBlocks=de;exports.normalizeEmail=N;exports.parseActingIdentity=Pe;exports.periodsInRange=Le;exports.phoneSuffix=pt;exports.plainTextFromMarkdown=yt;exports.playbookActor=Ge;exports.readPath=E;exports.registrableDomain=ie;exports.relatedByDefault=at;exports.resolveAccountCapabilities=le;exports.resolveActivityText=h;exports.resolveChannelIntents=se;exports.resolveSignature=ee;exports.stripHtml=w;exports.toE164=T;exports.usageMetricId=z;exports.usageMetrics=ke;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const Me = 10, Ce = 10, ve = 10, Ne = 5, U = /* @__PURE__ */ new Set([
1
+ const Ce = 10, ve = 10, Ne = 10, Oe = 5, U = /* @__PURE__ */ new Set([
2
2
  "header",
3
3
  "section",
4
4
  "context",
@@ -14,7 +14,7 @@ function m(e) {
14
14
  const n = e;
15
15
  return typeof n.key == "string" || typeof n.value == "string";
16
16
  }
17
- function Oe(e, n = () => {
17
+ function ke(e, n = () => {
18
18
  }) {
19
19
  if (!Array.isArray(e)) return [];
20
20
  const t = [];
@@ -86,7 +86,7 @@ function f(e) {
86
86
  function u(e) {
87
87
  return e.map((n) => n.name).join(", ");
88
88
  }
89
- function I(e) {
89
+ function _(e) {
90
90
  return e === "meeting" ? "Meeting" : e === "video" ? "Video call" : "Audio call";
91
91
  }
92
92
  const c = {
@@ -204,7 +204,7 @@ const c = {
204
204
  replyable: !0,
205
205
  carriesText: !0,
206
206
  countsAs: "inbound_message",
207
- snippet: _
207
+ snippet: I
208
208
  },
209
209
  EMAIL_SENT: {
210
210
  shape: "message",
@@ -214,7 +214,7 @@ const c = {
214
214
  replyable: !0,
215
215
  carriesText: !0,
216
216
  countsAs: "outbound_message",
217
- snippet: _
217
+ snippet: I
218
218
  },
219
219
  /* ---- chat ---- */
220
220
  CHAT_MESSAGE_SENT: {
@@ -271,7 +271,7 @@ const c = {
271
271
  channelKind: "chat",
272
272
  icon: "message-circle",
273
273
  snippet: () => "Gesprek gestart",
274
- timeline: (e) => `${I(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
274
+ timeline: (e) => `${_(e.payload.callType)} started${e.payload.initiator ? ` by ${e.payload.initiator.name}` : ""}`,
275
275
  joinUrl: (e) => e.payload.joinUrl
276
276
  },
277
277
  CHAT_CALL_ENDED: {
@@ -279,7 +279,7 @@ const c = {
279
279
  channelKind: "chat",
280
280
  icon: "message-circle",
281
281
  snippet: (e) => `Gesprek beëindigd${e.payload.duration ? ` (${p(e.payload.duration)})` : ""}`,
282
- timeline: (e) => `${I(e.payload.callType)} ended${A(e.payload.duration)}`,
282
+ timeline: (e) => `${_(e.payload.callType)} ended${A(e.payload.duration)}`,
283
283
  joinUrl: (e) => e.payload.joinUrl
284
284
  },
285
285
  CHAT_EVENT: {
@@ -404,44 +404,44 @@ const c = {
404
404
  timeline: (e, n) => `Assigned by ${n}`
405
405
  }
406
406
  };
407
- function _(e) {
407
+ function I(e) {
408
408
  const n = e.payload, t = n.bodySnippet?.trim() || P(n.body ?? "");
409
409
  return n.subject ? `${n.subject} — ${t}` : t;
410
410
  }
411
411
  function l(e) {
412
412
  return c[e];
413
413
  }
414
- function ke(e) {
414
+ function De(e) {
415
415
  return l(e)?.icon ?? "circle";
416
416
  }
417
- function De(e) {
417
+ function Le(e) {
418
418
  return l(e)?.channelKind;
419
419
  }
420
- function Le(e) {
420
+ function $e(e) {
421
421
  const n = l(e)?.shape;
422
422
  return n === "message" || n === "note";
423
423
  }
424
- function $e(e) {
424
+ function Re(e) {
425
425
  return l(e)?.replyable === !0;
426
426
  }
427
- function Re(e) {
427
+ function xe(e) {
428
428
  return l(e)?.carriesText === !0;
429
429
  }
430
- function xe(e) {
430
+ function Ue(e) {
431
431
  return l(e)?.countsAs;
432
432
  }
433
- function Ue(e) {
433
+ function Pe(e) {
434
434
  return l(e)?.playbookAuthored === !0;
435
435
  }
436
436
  function w(e) {
437
437
  const n = l(e.type)?.snippet;
438
438
  return n ? n(e) : "";
439
439
  }
440
- function Pe(e, n) {
440
+ function we(e, n) {
441
441
  const t = l(e.type)?.timeline;
442
442
  return t ? t(e, n) : e.type.replace(/_/g, " ").toLowerCase();
443
443
  }
444
- function we(e) {
444
+ function Ke(e) {
445
445
  const n = l(e.type)?.joinUrl;
446
446
  return n ? n(e) : void 0;
447
447
  }
@@ -552,12 +552,12 @@ class V {
552
552
  return this.translate;
553
553
  }
554
554
  }
555
- const Ke = new V(), M = 140;
555
+ const Ge = new V(), M = 140;
556
556
  function H(e) {
557
557
  const n = e.trim();
558
558
  return n.length <= M ? n : n.slice(0, M - 1).trimEnd() + "…";
559
559
  }
560
- function Ge(e, n) {
560
+ function Ve(e, n) {
561
561
  const t = K(n?.text, e), i = n ? y(n.text, e, (a) => a) : null;
562
562
  return {
563
563
  activityId: e.id,
@@ -569,16 +569,16 @@ function Ge(e, n) {
569
569
  ...t ? { snippetKey: t.key, snippetParams: t.params } : {}
570
570
  };
571
571
  }
572
- function Ve(e, n, t = []) {
572
+ function He(e, n, t = []) {
573
573
  const i = e.createdAt;
574
574
  if (!i) return [];
575
575
  const a = new Set(t);
576
576
  return e.author.type === "user" && e.author.id && a.add(e.author.id), Object.entries(n).filter(([r, o]) => o >= i && !a.has(r)).map(([r]) => r);
577
577
  }
578
- function He(e) {
578
+ function je(e) {
579
579
  return e.createdAt ?? 0;
580
580
  }
581
- const je = [
581
+ const Be = [
582
582
  { id: "agent", label: "Agent", labelSource: "user" },
583
583
  { id: "team", label: "Team", labelSource: "team" },
584
584
  { id: "inbox", label: "Inbox", labelSource: "inbox" },
@@ -588,7 +588,7 @@ const je = [
588
588
  { id: "handledBy", label: "Afhandelaar", labelSource: "raw" },
589
589
  { id: "time", label: "Tijd", labelSource: "raw" }
590
590
  ];
591
- function Be(e) {
591
+ function Fe(e) {
592
592
  const n = [];
593
593
  for (const t of Object.keys(e))
594
594
  for (const i of Object.keys(e[t]))
@@ -607,7 +607,7 @@ function B(e, n) {
607
607
  return t.setUTCMinutes(0, 0, 0), n === "day" && t.setUTCHours(0), t.getTime();
608
608
  }
609
609
  const F = 36e5, X = 864e5;
610
- function Fe(e, n, t) {
610
+ function Xe(e, n, t) {
611
611
  const i = t === "hour" ? F : X, a = [];
612
612
  for (let r = B(e, t); r <= n; r += i)
613
613
  a.push(j(r, t));
@@ -620,7 +620,7 @@ const W = [
620
620
  function z(e, n) {
621
621
  return `${e}.usage.${n}`;
622
622
  }
623
- function Xe(e, n) {
623
+ function We(e, n) {
624
624
  return n.map((t) => ({
625
625
  id: z(e, t.unit),
626
626
  label: t.label,
@@ -635,10 +635,10 @@ function Xe(e, n) {
635
635
  ]
636
636
  }));
637
637
  }
638
- function We(e) {
638
+ function Ye(e) {
639
639
  return (e.startsWith("tool:") ? e.slice(5) : e).replace(/__/g, " · ").replace(/\./g, " · ").replace(/_/g, " ");
640
640
  }
641
- const Ye = [
641
+ const ze = [
642
642
  { name: "text", type: "string" },
643
643
  { name: "subject", type: "string" },
644
644
  { name: "from", type: "string" },
@@ -661,7 +661,7 @@ const Ye = [
661
661
  // een nieuw adres) — een stap die hierop leunt hoort dus een `condition` te hebben.
662
662
  { name: "contactId", type: "string" },
663
663
  { name: "companyId", type: "string" }
664
- ], ze = {
664
+ ], qe = {
665
665
  topics: [
666
666
  { name: "topic", type: "string" },
667
667
  { name: "confidence", type: "number" }
@@ -682,7 +682,7 @@ function q(e) {
682
682
  return "org";
683
683
  }
684
684
  }
685
- function qe(e) {
685
+ function Je(e) {
686
686
  if (typeof e != "string") return;
687
687
  const n = e.trim();
688
688
  if (n === "org") return { kind: "org" };
@@ -697,7 +697,7 @@ function qe(e) {
697
697
  function J(e) {
698
698
  return q(e);
699
699
  }
700
- function Je(e) {
700
+ function Qe(e) {
701
701
  switch (e.kind) {
702
702
  case "personal":
703
703
  return { kind: "user", userId: e.userId };
@@ -707,17 +707,17 @@ function Je(e) {
707
707
  return { kind: "org" };
708
708
  }
709
709
  }
710
- function Qe(e) {
710
+ function Ze(e) {
711
711
  return J(e);
712
712
  }
713
713
  const Q = ["done", "escalated", "failed", "timed_out", "stopped"], Z = ["awaiting_approval", "awaiting_reply"];
714
714
  function ee(e) {
715
715
  return Q.includes(e);
716
716
  }
717
- function Ze(e) {
717
+ function en(e) {
718
718
  return ee(e);
719
719
  }
720
- function en(e) {
720
+ function nn(e) {
721
721
  return Z.includes(e);
722
722
  }
723
723
  const R = [
@@ -811,45 +811,45 @@ const R = [
811
811
  function E(e) {
812
812
  return R.find((n) => n.id === e);
813
813
  }
814
- function nn(e) {
814
+ function tn(e) {
815
815
  return E(e)?.label ?? e;
816
816
  }
817
- function tn(e, n = "gpt-5-mini") {
817
+ function an(e, n = "gpt-5-mini") {
818
818
  return E(e)?.defaultModel ?? n;
819
819
  }
820
- function an(e) {
820
+ function rn(e) {
821
821
  return R.filter((n) => n.capabilities.includes(e));
822
822
  }
823
- function rn(e) {
823
+ function on(e) {
824
824
  const n = E(e);
825
825
  return !!n && !n.baseUrl;
826
826
  }
827
- const on = /* @__PURE__ */ new Set(["mail", "message"]);
827
+ const sn = /* @__PURE__ */ new Set(["mail", "message"]);
828
828
  function ne(e, n) {
829
829
  const t = e.settings?.signatures?.[n];
830
830
  return !t || !t.enabled || !t.body || t.body.trim() === "" ? null : t;
831
831
  }
832
- function sn(e, n, t, i = "html") {
832
+ function ln(e, n, t, i = "html") {
833
833
  if (!e) return t;
834
834
  const a = ne(e, n);
835
835
  return a ? `${t}${i === "text" ? `
836
836
 
837
837
  ` : n === "mail" ? "<br><br>-- <br>" : "<br><br>"}${a.body}` : t;
838
838
  }
839
- function ln(e) {
839
+ function cn(e) {
840
840
  return e.endpoints ?? [];
841
841
  }
842
- const cn = (e) => !!e.assignedUserId || !!e.assignedInboxId, pn = (e) => e.status === "closed", un = (e) => ({
842
+ const pn = (e) => !!e.assignedUserId || !!e.assignedInboxId, un = (e) => e.status === "closed", dn = (e) => ({
843
843
  urgent: 10,
844
844
  high: 5,
845
845
  normal: 2,
846
846
  low: 1
847
- })[e.priority] || 0, dn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
848
- function mn(e, n) {
847
+ })[e.priority] || 0, mn = (e, n = 30) => e.title?.length <= n ? e.title : `${e.title.substring(0, n)}...`;
848
+ function fn(e, n) {
849
849
  return e.lastActivityAt ? !(e.seenBy ?? []).includes(n) : !1;
850
850
  }
851
- const fn = 2e3, gn = 500, hn = 12e3, yn = 4e3, te = ["contact", "company"];
852
- function En(e) {
851
+ const gn = 2e3, hn = 500, yn = 12e3, En = 4e3, te = ["contact", "company"];
852
+ function bn(e) {
853
853
  if (!e) return !1;
854
854
  const n = e.slice(0, e.indexOf(":"));
855
855
  return te.includes(n);
@@ -908,7 +908,7 @@ function se(e) {
908
908
  const i = n.indexOf("@");
909
909
  return i >= 0 && (n = n.slice(0, i)), n.trim();
910
910
  }
911
- function bn(e) {
911
+ function An(e) {
912
912
  if (!e) return !1;
913
913
  const n = e.indexOf("@");
914
914
  if (n <= 0) return !1;
@@ -936,7 +936,7 @@ function N(e, n) {
936
936
  }
937
937
  return !o && d(a, r) ? `+${r.callingCode}${a}` : null;
938
938
  }
939
- function An(e, n = 9) {
939
+ function _n(e, n = 9) {
940
940
  const t = (e ?? "").replace(/\D/g, "");
941
941
  return t.length < n ? null : t.slice(-n);
942
942
  }
@@ -1013,16 +1013,16 @@ const pe = /* @__PURE__ */ new Set([
1013
1013
  "proximus.be",
1014
1014
  "scarlet.be"
1015
1015
  ]);
1016
- function _n(e) {
1016
+ function Tn(e) {
1017
1017
  const n = ce(e);
1018
1018
  return n ? pe.has(n) : !1;
1019
1019
  }
1020
- function Tn(e) {
1020
+ function Sn(e) {
1021
1021
  if (!e) return !1;
1022
1022
  const n = e.trim().toLowerCase();
1023
1023
  return n === "tel" || n === "sms" || n === "whatsapp" || n === "fax";
1024
1024
  }
1025
- function Sn(e, n, t) {
1025
+ function Mn(e, n, t) {
1026
1026
  if (!e || !n) return null;
1027
1027
  const i = e.trim().toLowerCase();
1028
1028
  if (i === "tel" || i === "sms" || i === "whatsapp") {
@@ -1041,7 +1041,7 @@ function Sn(e, n, t) {
1041
1041
  return a ? `${i}:${a}` : null;
1042
1042
  }
1043
1043
  const ue = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, de = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
1044
- function Mn(e) {
1044
+ function Cn(e) {
1045
1045
  if (typeof e != "string" || !e) return "";
1046
1046
  let n = e;
1047
1047
  return n = n.replace(/```[a-z]*\n?/gi, "").replace(/~~~[a-z]*\n?/gi, ""), n = n.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1"), n = n.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1"), n = n.replace(/\[([^\]]*)\]\[[^\]]*\]/g, "$1"), n = n.replace(/<((?:https?|mailto):[^>\s]+)>/gi, "$1"), n = n.split(`
@@ -1091,7 +1091,7 @@ function $(e) {
1091
1091
 
1092
1092
  `).trim();
1093
1093
  }
1094
- function Cn(e) {
1094
+ function vn(e) {
1095
1095
  if (typeof e != "string" || !e) return "";
1096
1096
  let n = e.length;
1097
1097
  for (const r of me) {
@@ -1103,22 +1103,22 @@ function Cn(e) {
1103
1103
  return i || (i = $(L(k(e)))), ge(i) || i;
1104
1104
  }
1105
1105
  const he = /(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i, ye = /\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;
1106
- function vn(e, n) {
1106
+ function Nn(e, n) {
1107
1107
  return !!(e && he.test(e) || n && ye.test(n));
1108
1108
  }
1109
1109
  const Ee = 3, be = 600;
1110
- function Nn(e, n) {
1110
+ function On(e, n) {
1111
1111
  return e >= Ee || n >= be;
1112
1112
  }
1113
1113
  function Ae(e, n) {
1114
- const t = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = n.intents.filter((o) => !t.has(o.intent)).map((o) => _e(o, i[o.intent]));
1114
+ const t = new Set(e.disabledIntents ?? []), i = e.intentOverrides ?? {}, a = n.intents.filter((o) => !t.has(o.intent)).map((o) => Ie(o, i[o.intent]));
1115
1115
  if (!e.extraIntents || e.extraIntents.length === 0) return a;
1116
1116
  const r = new Set(a.map((o) => o.intent));
1117
1117
  for (const o of e.extraIntents)
1118
1118
  r.has(o.intent) || (a.push(o), r.add(o.intent));
1119
1119
  return a;
1120
1120
  }
1121
- function Ie(e, n) {
1121
+ function _e(e, n) {
1122
1122
  const t = {};
1123
1123
  for (const i of e.intents) {
1124
1124
  if (!i.togglable) continue;
@@ -1127,18 +1127,18 @@ function Ie(e, n) {
1127
1127
  }
1128
1128
  return t;
1129
1129
  }
1130
- function On(e, n) {
1131
- const t = Ie(e, n);
1130
+ function kn(e, n) {
1131
+ const t = _e(e, n);
1132
1132
  return Object.entries(t).filter(([, i]) => !i).map(([i]) => i);
1133
1133
  }
1134
- function _e(e, n) {
1134
+ function Ie(e, n) {
1135
1135
  return n ? {
1136
1136
  intent: n.intent ?? e.intent,
1137
1137
  targetSchemes: n.targetSchemes ?? e.targetSchemes,
1138
1138
  transport: n.transport ?? e.transport
1139
1139
  } : e;
1140
1140
  }
1141
- function kn(e, n) {
1141
+ function Dn(e, n) {
1142
1142
  const t = [];
1143
1143
  for (const i of e) {
1144
1144
  if (!i.enabled) continue;
@@ -1149,16 +1149,16 @@ function kn(e, n) {
1149
1149
  }
1150
1150
  return t;
1151
1151
  }
1152
- function Dn(e, n) {
1152
+ function Ln(e, n) {
1153
1153
  return n.filter((t) => t.capability.intent === e);
1154
1154
  }
1155
1155
  function Te(e, n) {
1156
1156
  return n.filter((t) => t.capability.targetSchemes.includes(e));
1157
1157
  }
1158
- function Ln(e, n) {
1158
+ function $n(e, n) {
1159
1159
  return Te(e.scheme, n);
1160
1160
  }
1161
- function $n(e, n, t) {
1161
+ function Rn(e, n, t) {
1162
1162
  const i = [];
1163
1163
  for (const a of e)
1164
1164
  for (const r of t)
@@ -1166,7 +1166,32 @@ function $n(e, n, t) {
1166
1166
  return i;
1167
1167
  }
1168
1168
  var Se = /* @__PURE__ */ ((e) => (e.MAILTO = "mailto", e.SIP = "sip", e.TEL = "tel", e.WEBHOOK = "webhook", e.USERNAME = "username", e.ID = "id", e.CUSTOM = "custom", e.URL = "url", e.TELEGRAM = "telegram", e.WHATSAPP = "whatsapp", e.MESSENGER = "messenger", e.INSTAGRAM = "instagram", e.VIBER = "viber", e.SMS = "sms", e.FAX = "fax", e.TEAMS = "teams", e.CALENDAR = "calendar", e))(Se || {});
1169
- const Rn = "message_window", xn = "message_templates", Un = {
1169
+ const Me = {
1170
+ mailto: "mail",
1171
+ sip: "tel",
1172
+ tel: "tel",
1173
+ fax: "tel",
1174
+ sms: "chat",
1175
+ teams: "chat",
1176
+ telegram: "chat",
1177
+ messenger: "chat",
1178
+ instagram: "chat",
1179
+ viber: "chat",
1180
+ whatsapp: "wa",
1181
+ // Not ways of reaching a person: a webhook is a machine, a URL is a page,
1182
+ // a calendar entry is an appointment, and username/id/custom say nothing
1183
+ // about transport on their own.
1184
+ webhook: "note",
1185
+ url: "note",
1186
+ calendar: "note",
1187
+ username: "note",
1188
+ id: "note",
1189
+ custom: "note"
1190
+ };
1191
+ function xn(e) {
1192
+ return e ? Me[e] ?? "note" : "note";
1193
+ }
1194
+ const Un = "message_window", Pn = "message_templates", wn = {
1170
1195
  // E-mail
1171
1196
  FROM: "from",
1172
1197
  TO: "to",
@@ -1183,111 +1208,112 @@ const Rn = "message_window", xn = "message_templates", Un = {
1183
1208
  // Voice/conference
1184
1209
  HOST: "host",
1185
1210
  PARTICIPANT: "participant"
1186
- }, Pn = (e, n) => ({ intent: e, ...n }), wn = "folder_management", Kn = "remote_search", Gn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, Vn = 9e4, Hn = "installation-id";
1211
+ }, Kn = (e, n) => ({ intent: e, ...n }), Gn = "folder_management", Vn = "remote_search", Hn = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, jn = 9e4, Bn = "installation-id";
1187
1212
  export {
1188
1213
  c as ACTIVITY_CATALOG,
1189
1214
  R as AI_VENDORS,
1190
1215
  V as ActivityTypeRegistry,
1191
- Ke as BUILT_IN_ONLY,
1192
- ze as CLASSIFY_VARS,
1193
- je as CORE_DIMENSIONS,
1216
+ Ge as BUILT_IN_ONLY,
1217
+ qe as CLASSIFY_VARS,
1218
+ Be as CORE_DIMENSIONS,
1194
1219
  Se as CommunicationScheme,
1195
- yn as DEFAULT_MEMORY_BUDGET,
1220
+ En as DEFAULT_MEMORY_BUDGET,
1196
1221
  ie as DEFAULT_PHONE_REGION,
1197
- wn as FEATURE_FOLDER_MANAGEMENT,
1198
- Kn as FEATURE_REMOTE_SEARCH,
1199
- Hn as INSTALLATION_HEADER,
1200
- Un as InteractionParticipantRole,
1201
- Ne as MAX_ACTIONS,
1202
- Me as MAX_BLOCKS,
1203
- Ce as MAX_FIELDS,
1204
- ve as MAX_LIST_ITEMS,
1205
- hn as MAX_MEMORY_BUDGET,
1206
- fn as MAX_MEMORY_CHARS,
1207
- gn as MIN_MEMORY_BUDGET,
1222
+ Gn as FEATURE_FOLDER_MANAGEMENT,
1223
+ Vn as FEATURE_REMOTE_SEARCH,
1224
+ Bn as INSTALLATION_HEADER,
1225
+ wn as InteractionParticipantRole,
1226
+ Oe as MAX_ACTIONS,
1227
+ Ce as MAX_BLOCKS,
1228
+ ve as MAX_FIELDS,
1229
+ Ne as MAX_LIST_ITEMS,
1230
+ yn as MAX_MEMORY_BUDGET,
1231
+ gn as MAX_MEMORY_CHARS,
1232
+ hn as MIN_MEMORY_BUDGET,
1208
1233
  Z as PAUSED_RUN_STATUSES,
1209
1234
  b as PHONE_REGIONS,
1210
- Vn as PRESENCE_ONLINE_WINDOW_MS,
1211
- xn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1212
- Rn as PROVIDER_FEATURE_MESSAGE_WINDOW,
1235
+ jn as PRESENCE_ONLINE_WINDOW_MS,
1236
+ Pn as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
1237
+ Un as PROVIDER_FEATURE_MESSAGE_WINDOW,
1213
1238
  pe as PUBLIC_EMAIL_DOMAINS,
1214
1239
  te as RELATED_SUBJECT_KINDS,
1215
- on as SIGNATURE_INTENTS,
1240
+ sn as SIGNATURE_INTENTS,
1216
1241
  be as SUMMARY_MIN_LAST_CHARS,
1217
1242
  Ee as SUMMARY_MIN_MESSAGES,
1218
1243
  Q as TERMINAL_RUN_STATUSES,
1219
- Ye as TRIGGER_VARS,
1220
- Gn as UNSUPPORTED,
1244
+ ze as TRIGGER_VARS,
1245
+ Hn as UNSUPPORTED,
1221
1246
  W as USAGE_DIMENSIONS,
1222
1247
  Y as USAGE_DIMENSION_IDS,
1223
1248
  J as actingIdentityKey,
1224
- ke as activityIconOf,
1225
- we as activityJoinUrl,
1249
+ De as activityIconOf,
1250
+ Ke as activityJoinUrl,
1226
1251
  w as activitySnippet,
1227
1252
  K as activityTextParams,
1228
- Pe as activityTimelineText,
1229
- He as activityTimestamp,
1253
+ we as activityTimelineText,
1254
+ je as activityTimestamp,
1230
1255
  l as activityTypeInfo,
1231
- Qe as actorKey,
1232
- tn as aiVendorDefaultModel,
1233
- nn as aiVendorLabel,
1234
- rn as aiVendorNeedsBaseUrl,
1235
- an as aiVendorsWith,
1236
- sn as applySignature,
1237
- Ge as buildActivityPreview,
1238
- kn as buildChannelIntents,
1239
- Re as carriesText,
1240
- De as channelKindOf,
1241
- Cn as cleanMessageText,
1242
- Pn as defineIntent,
1243
- On as disabledIntentsFromCapabilities,
1256
+ Ze as actorKey,
1257
+ an as aiVendorDefaultModel,
1258
+ tn as aiVendorLabel,
1259
+ on as aiVendorNeedsBaseUrl,
1260
+ rn as aiVendorsWith,
1261
+ ln as applySignature,
1262
+ Ve as buildActivityPreview,
1263
+ Dn as buildChannelIntents,
1264
+ xe as carriesText,
1265
+ xn as channelKindForScheme,
1266
+ Le as channelKindOf,
1267
+ vn as cleanMessageText,
1268
+ Kn as defineIntent,
1269
+ kn as disabledIntentsFromCapabilities,
1244
1270
  In as emailDomain,
1245
- Sn as endpointKey,
1246
- Ln as filterByEndpoint,
1247
- Dn as filterByIntent,
1271
+ Mn as endpointKey,
1272
+ $n as filterByEndpoint,
1273
+ Ln as filterByIntent,
1248
1274
  Te as filterByTargetScheme,
1249
1275
  E as findAiVendor,
1250
- Be as flattenLocales,
1276
+ Fe as flattenLocales,
1251
1277
  B as floorToPeriod,
1252
1278
  q as formatActingIdentity,
1253
1279
  j as formatPeriod,
1254
- Ve as getActivitySeenUserIds,
1255
- ln as getContactEndpoints,
1256
- dn as getShortTitle,
1257
- un as getUrgencyScore,
1258
- We as humanizeAction,
1259
- cn as isAssigned,
1260
- pn as isClosed,
1261
- mn as isInteractionUnseen,
1262
- vn as isLikelyBulk,
1263
- Le as isMessageType,
1264
- en as isPaused,
1265
- Ue as isPlaybookAuthoredType,
1266
- _n as isPublicEmailDomain,
1267
- $e as isReplyableType,
1268
- Ze as isRetryable,
1280
+ He as getActivitySeenUserIds,
1281
+ cn as getContactEndpoints,
1282
+ mn as getShortTitle,
1283
+ dn as getUrgencyScore,
1284
+ Ye as humanizeAction,
1285
+ pn as isAssigned,
1286
+ un as isClosed,
1287
+ fn as isInteractionUnseen,
1288
+ Nn as isLikelyBulk,
1289
+ $e as isMessageType,
1290
+ nn as isPaused,
1291
+ Pe as isPlaybookAuthoredType,
1292
+ Tn as isPublicEmailDomain,
1293
+ Re as isReplyableType,
1294
+ en as isRetryable,
1269
1295
  ee as isTerminal,
1270
- Nn as isThreadLongEnough,
1271
- bn as looksLikeEmail,
1272
- $n as matchContactToIntents,
1273
- xe as messageCountsAs,
1274
- Tn as needsPhoneRegion,
1275
- Oe as normalizeBlocks,
1296
+ On as isThreadLongEnough,
1297
+ An as looksLikeEmail,
1298
+ Rn as matchContactToIntents,
1299
+ Ue as messageCountsAs,
1300
+ Sn as needsPhoneRegion,
1301
+ ke as normalizeBlocks,
1276
1302
  x as normalizeEmail,
1277
- qe as parseActingIdentity,
1278
- Fe as periodsInRange,
1279
- An as phoneSuffix,
1280
- Mn as plainTextFromMarkdown,
1281
- Je as playbookActor,
1303
+ Je as parseActingIdentity,
1304
+ Xe as periodsInRange,
1305
+ _n as phoneSuffix,
1306
+ Cn as plainTextFromMarkdown,
1307
+ Qe as playbookActor,
1282
1308
  h as readPath,
1283
1309
  ce as registrableDomain,
1284
- En as relatedByDefault,
1285
- Ie as resolveAccountCapabilities,
1310
+ bn as relatedByDefault,
1311
+ _e as resolveAccountCapabilities,
1286
1312
  y as resolveActivityText,
1287
1313
  Ae as resolveChannelIntents,
1288
1314
  ne as resolveSignature,
1289
1315
  P as stripHtml,
1290
1316
  N as toE164,
1291
1317
  z as usageMetricId,
1292
- Xe as usageMetrics
1318
+ We as usageMetrics
1293
1319
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -84,6 +84,37 @@ export declare enum CommunicationScheme {
84
84
  TEAMS = "teams",
85
85
  CALENDAR = "calendar"
86
86
  }
87
+ /**
88
+ * The colour-coded channel kinds the design system defines tokens for. This is
89
+ * about *how you reach someone*, not about which product delivers it: Teams and
90
+ * Telegram are both `chat`, SIP and a phone number are both `tel`.
91
+ */
92
+ export type ChannelKind = "mail" | "wa" | "chat" | "tel" | "note";
93
+ /** Channel kind for a scheme; anything unrecognised is neutral. */
94
+ export declare function channelKindForScheme(scheme?: string | null): ChannelKind;
95
+ /**
96
+ * How a provider wants its channel drawn.
97
+ *
98
+ * Two routes, mirroring how apps ship translations. `icon`/`tone`/`label` are
99
+ * declarative and travel in `/provider/describe`, so they work for a provider
100
+ * with no frontend at all and on any surface where no bundle is loaded yet.
101
+ * `resource` is the escape hatch: a federated component (`"app:Component"`)
102
+ * that renders the provider's own mark and wins once it loads.
103
+ */
104
+ export interface ChannelPresentation {
105
+ /** Lucide icon name, resolved by the host's icon renderer. */
106
+ icon?: string;
107
+ /**
108
+ * A {@link ChannelKind} to borrow that channel's colour, or any other
109
+ * stable string — a provider bringing its own channel gets a colour derived
110
+ * from it rather than collapsing onto the neutral tone.
111
+ */
112
+ tone?: ChannelKind | string;
113
+ /** What to call this channel in the UI, e.g. "WhatsApp". */
114
+ label?: string;
115
+ /** Federated component key, e.g. `"whatsapp:ChannelIcon"`. */
116
+ resource?: string;
117
+ }
87
118
  /**
88
119
  * Account selector for `transport: session` intents. Narrows the registered
89
120
  * `CommsAccount`s down to the one that should service this intent.
@@ -161,6 +192,12 @@ export interface ProviderDescription {
161
192
  intents: IntentCapability[];
162
193
  /** Provider feature flags — separate from routing. */
163
194
  features: ProviderFeature[];
195
+ /**
196
+ * How this provider's channel is drawn. Optional: without it the UI falls
197
+ * back to the scheme's channel kind, which is what every surface did before
198
+ * providers could say anything about themselves.
199
+ */
200
+ presentation?: ChannelPresentation;
164
201
  }
165
202
  /**
166
203
  * Provider-feature names die de composer generiek interpreteert (geen
package/package.json CHANGED
@@ -1,10 +1,19 @@
1
1
  {
2
2
  "name": "@opencxh/domain",
3
- "version": "1.134.7",
3
+ "version": "1.134.11",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./package.json": "./package.json"
16
+ },
8
17
  "files": [
9
18
  "dist"
10
19
  ],