@opencxh/domain 1.166.0 → 1.171.0
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 +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +129 -111
- package/dist/platform/call-lines.d.ts +74 -0
- package/dist/platform/call-lines.test.d.ts +1 -0
- package/dist/platform/communication.d.ts +16 -0
- package/dist/platform/media.d.ts +16 -0
- package/dist/platform/sdk.d.ts +10 -0
- package/package.json +1 -1
- package/dist/entities/transcript/index.d.ts +0 -1
- package/dist/entities/transcript/types.d.ts +0 -10
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Xt(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function zt(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const D=10,_=10,T=10,b=5,Yt=new Set(["header","section","context","divider","image","list","actions","attachments"]);function v(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 qt(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=D){t("more than "+D+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const r=i;if(!Yt.has(r.type)){t("unknown block type "+String(r.type));continue}switch(r.type){case"header":if(!v(r.text)){t("a header without text");continue}break;case"context":if(!v(r.text)){t("a context block without text");continue}break;case"image":if(!r.url||!r.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(r.fields)&&r.fields.length>_&&(t("more than "+_+" fields in a section"),r.fields=r.fields.slice(0,_));break;case"list":if(!Array.isArray(r.items)||r.items.length===0){t("a list without items");continue}r.items.length>T&&(t("more than "+T+" list items"),r.items=r.items.slice(0,T));break;case"actions":{const a=Array.isArray(r.elements)?r.elements:[],o=a.filter(s=>s&&s.action_id&&s.invoke&&v(s.text));if(o.length!==a.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>b&&t("more than "+b+" actions"),r.elements=o.slice(0,b);break}}n.push(r)}return n}function be(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim()}function y(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 oe(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function L(e){return e?.split("@")?.[0]||e||""}function S(e){return e.map(t=>t.name).join(", ")}function se(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${L(e.payload.from)}`:`Outbound call started — ${L(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",connected:!0,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?` (${y(e.payload.duration)})`:""}`,timeline:e=>`Call ended${oe(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${L(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",connected:!0,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?` (${y(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:le},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:le},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=>`${S(e.payload.members)} toegevoegd`,timeline:e=>{const t=S(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=>`${S(e.payload.members)} verlaten`,timeline:e=>{const t=S(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=>`${se(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?` (${y(e.payload.duration)})`:""}`,timeline:e=>`${se(e.payload.callType)} ended${oe(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",connected:!0,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?` (${y(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 le(e){const t=e.payload,n=t.bodySnippet?.trim()||be(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function l(e){return m[e]}function Jt(e){return l(e)?.icon??"circle"}function Zt(e){return l(e)?.channelKind}function H(e){return e==="message"||e==="note"}function Qt(e){return H(l(e)?.shape)}function en(e){return l(e)?.replyable===!0}function tn(e){return l(e)?.carriesText===!0}function nn(e){return l(e)?.countsAs}function rn(e){return l(e)?.playbookAuthored===!0}function an(e){return l(e)?.connected===!0}function on(e){const t=l(e);return t?.shape==="artifact"&&t?.carriesText===!0}function Ie(e){const t=l(e.type)?.snippet;return t?t(e):""}function sn(e,t){const n=l(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function ln(e){const t=l(e.type)?.joinUrl;return t?t(e):void 0}function N(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 O(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return N(t,e.value)||null;const i={};for(const[a,o]of Object.entries(e.params??{}))i[a]=N(t,o);const r=n(e.key,i);return r===e.key?null:r}function Me(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[i,r]of Object.entries(e.params??{}))n[i]=N(t,r);return{key:e.key,params:n}}const cn=e=>e;function ce(e){const t=m[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 ue(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 Ce{constructor(t=[],n=cn){this.translate=n;for(const i of t)i?.type&&(i.type in m||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(t){if(t in m)return ce(t);const n=this.declared.get(t);return n?ue(n):void 0}triggerable(){const t=Object.keys(m).filter(i=>m[i].triggerable).map(ce),n=[...this.declared.values()].map(ue).filter(i=>i.triggerable);return[...t,...n]}timelineText(t,n){const i=m[t.type];if(i?.timeline)return i.timeline(t,n);const r=this.declared.get(t.type);return O(r?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const i=this.declared.get(t.type);return O(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}isMessage(t){return H(this.get(t)?.shape)}isReplyable(t){return this.get(t)?.replyable===!0}carriesText(t){return this.get(t)?.carriesText===!0}countsAs(t){return this.get(t)?.countsAs}channelKind(t){return this.get(t)?.channelKind}isTranscript(t){const n=this.get(t);return n?.shape==="artifact"&&n.carriesText}get translator(){return this.translate}}const un=new Ce,de=140;function dn(e){const t=e.trim();return t.length<=de?t:t.slice(0,de-1).trimEnd()+"…"}function pn(e,t){const n=Me(t?.text,e),i=t?O(t.text,e,r=>r):null;return{activityId:e.id,type:e.type,snippet:dn(i??Ie(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function fn(e,t,n=[]){const i=e.createdAt;if(!i)return[];const r=new Set(n);return e.author.type==="user"&&e.author.id&&r.add(e.author.id),Object.entries(t).filter(([a,o])=>o>=i&&!r.has(a)).map(([a])=>a)}function mn(e){return e.createdAt??0}const gn=[{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 hn(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 x(e){return e<10?`0${e}`:`${e}`}function Ne(e,t){const n=new Date(e),i=`${n.getUTCFullYear()}-${x(n.getUTCMonth()+1)}-${x(n.getUTCDate())}`;return t==="day"?i:`${i}T${x(n.getUTCHours())}`}function Oe(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const En=36e5,An=864e5;function yn(e,t,n){const i=n==="hour"?En:An,r=[];for(let a=Oe(e,n);a<=t;a+=i)r.push(Ne(a,n));return r}const Re=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],ke=Re.map(e=>e.id);function we(e,t){return`${e}.usage.${t}`}function Sn(e,t){return t.map(n=>({id:we(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...ke,...n.extraDimensions??[],"time"]}))}const ve=new Set(["info","success","warning","destructive"]),P=200,$=100,K=200,U=12,B=4,X=4e3,I=500,_n=256*1024,Tn=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Le=["http:","https:","mailto:","tel:"],bn=/^[a-z][a-z0-9+.-]*:/i;function xe(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=bn.exec(t)?.[0];return n?Le.includes(n.toLowerCase()):!t.startsWith("//")}const In=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function Mn(e){let t="",n=0;for(;n<e.length;){const i=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!i){t+=e[n],n+=1;continue}const r=n+(i?2:1),a=pe(e,r,"[","]");if(a<0||e[a+1]!=="("){t+=e[n],n+=1;continue}const o=pe(e,a+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(r,a),c=e.slice(a+2,o).trim().split(/\s+/)[0]??"";t+=i||!xe(c)?s:e.slice(n,o+1),n=o+1}return t}function pe(e,t,n,i){let r=1;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]===n)r+=1;else if(e[a]===i&&(r-=1,r===0))return a}return-1}function De(e){return Mn(e).replace(In,(t,n,i)=>xe(i)?t:"")}function d(e,t=X){return typeof e=="string"?De(e).slice(0,t):""}function Cn(e,t=X){return typeof e=="string"?e.slice(0,t):""}function Nn(e,t="info"){return typeof e=="string"&&ve.has(e)?e:t}function On(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=P){t("more than "+P+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const r=i;if(!Tn.has(r.type)){t("unknown block type "+String(r.type));continue}const a=typeof r.block_id=="string"?{block_id:r.block_id}:{};switch(r.type){case"heading":{const o=d(r.text);if(!o){t("a heading without text");continue}const s=r.level===2||r.level===3?r.level:1;n.push({...a,type:"heading",level:s,text:o});break}case"paragraph":{const o=d(r.text);if(!o){t("a paragraph without text");continue}n.push({...a,type:"paragraph",text:o});break}case"quote":{const o=d(r.text);if(!o){t("a quote without text");continue}n.push({...a,type:"quote",text:o});break}case"code":{const o=Cn(r.text);if(!o){t("a code block without text");continue}const s=typeof r.lang=="string"?{lang:r.lang.slice(0,32)}:{};n.push({...a,type:"code",...s,text:o});break}case"divider":n.push({...a,type:"divider"});break;case"list":{const o=Array.isArray(r.items)?r.items:[],s=[];for(const p of o){if(s.length>=$){t("more than "+$+" list items");break}const f=d(p?.text);if(!f)continue;const u=d(p?.lead,200);s.push(u?{lead:u,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const c=r.style==="numbered"?"numbered":"bulleted";n.push({...a,type:"list",style:c,items:s});break}case"table":{const o=Array.isArray(r.columns)?r.columns:[],s=[];for(const u of o){if(s.length>=U){t("more than "+U+" table columns");break}const A=d(u?.label,I),w=u?.align==="right"?"right":void 0;s.push(w?{label:A,align:w}:{label:A})}if(s.length===0){t("a table without columns");continue}const c=Array.isArray(r.rows)?r.rows:[],p=[];for(const u of c){if(p.length>=K){t("more than "+K+" table rows");break}const A=Array.isArray(u)?u:[];p.push(s.map((w,Ht)=>d(A[Ht],I)))}const f=d(r.caption,I);n.push({...a,type:"table",columns:s,rows:p,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(r.items)?r.items:[],s=[];for(const c of o){if(s.length>=B){t("more than "+B+" kpi items");break}const p=d(c?.value,40),f=d(c?.label,80);if(!p||!f)continue;const u=c?.tone;s.push(typeof u=="string"&&ve.has(u)?{value:p,label:f,tone:u}:{value:p,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...a,type:"kpi",items:s});break}case"callout":{const o=d(r.text);if(!o){t("a callout without text");continue}const s=d(r.title,200);n.push({...a,type:"callout",tone:Nn(r.tone),...s?{title:s}:{},text:o});break}}}return n}function Rn(e){return JSON.stringify(e).length}function kn(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function fe(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function me(e,t,n){const i=e.map((r,a)=>n?.[a]==="right"?"---:":"---");return[`| ${e.map(fe).join(" | ")} |`,`| ${i.join(" | ")} |`,...t.map(r=>`| ${r.map(fe).join(" | ")} |`)]}function wn(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const i=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${i} **${t.lead}** ${t.text}`:`${i} ${t.text}`});case"table":{const t=me(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return me(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function vn(e,t){const n=[],i=e.some(r=>r.type==="heading"&&r.level===1);t&&!i&&n.push(`# ${t}`);for(const r of e){const a=wn(r);a.length>0&&n.push(a.join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Xt(e){return e.type==="EMAIL_RECEIVED"||e.type==="EMAIL_SENT"}function zt(e){return e.type==="CHAT_MESSAGE_SENT"||e.type==="CHAT_MESSAGE_RECEIVED"}const D=10,_=10,T=10,b=5,Yt=new Set(["header","section","context","divider","image","list","actions","attachments"]);function w(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 qt(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=D){t("more than "+D+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const r=i;if(!Yt.has(r.type)){t("unknown block type "+String(r.type));continue}switch(r.type){case"header":if(!w(r.text)){t("a header without text");continue}break;case"context":if(!w(r.text)){t("a context block without text");continue}break;case"image":if(!r.url||!r.alt){t("an image without url or alt");continue}break;case"section":Array.isArray(r.fields)&&r.fields.length>_&&(t("more than "+_+" fields in a section"),r.fields=r.fields.slice(0,_));break;case"list":if(!Array.isArray(r.items)||r.items.length===0){t("a list without items");continue}r.items.length>T&&(t("more than "+T+" list items"),r.items=r.items.slice(0,T));break;case"actions":{const a=Array.isArray(r.elements)?r.elements:[],o=a.filter(s=>s&&s.action_id&&s.invoke&&w(s.text));if(o.length!==a.length&&t("an action without action_id, invoke or text"),o.length===0)continue;o.length>b&&t("more than "+b+" actions"),r.elements=o.slice(0,b);break}}n.push(r)}return n}function be(e){return e.replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\s+/g," ").trim()}function y(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 oe(e){return e?` — ${Math.floor(e/60)}m ${e%60}s`:""}function L(e){return e?.split("@")?.[0]||e||""}function S(e){return e.map(t=>t.name).join(", ")}function se(e){return e==="meeting"?"Meeting":e==="video"?"Video call":"Audio call"}const m={VOICE_CALL_STARTED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gesprek gestart",timeline:e=>e.direction==="inbound"?`Inbound call started — ${L(e.payload.from)}`:`Outbound call started — ${L(e.payload.to)}`},VOICE_CALL_ANSWERED:{shape:"event",channelKind:"voice",icon:"phone",connected:!0,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?` (${y(e.payload.duration)})`:""}`,timeline:e=>`Call ended${oe(e.payload.duration)}`},VOICE_CALL_MISSED:{shape:"event",channelKind:"voice",icon:"phone",snippet:()=>"Gemiste oproep",timeline:e=>`Missed call — ${L(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",connected:!0,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?` (${y(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:le},EMAIL_SENT:{shape:"message",component:"communication:EmailActivity",channelKind:"mail",icon:"mail",replyable:!0,carriesText:!0,countsAs:"outbound_message",snippet:le},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=>`${S(e.payload.members)} toegevoegd`,timeline:e=>{const t=S(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=>`${S(e.payload.members)} verlaten`,timeline:e=>{const t=S(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=>`${se(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?` (${y(e.payload.duration)})`:""}`,timeline:e=>`${se(e.payload.callType)} ended${oe(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",connected:!0,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?` (${y(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 le(e){const t=e.payload,n=t.bodySnippet?.trim()||be(t.body??"");return t.subject?`${t.subject} — ${n}`:n}function l(e){return m[e]}function Jt(e){return l(e)?.icon??"circle"}function Zt(e){return l(e)?.channelKind}function W(e){return e==="message"||e==="note"}function Qt(e){return W(l(e)?.shape)}function en(e){return l(e)?.replyable===!0}function tn(e){return l(e)?.carriesText===!0}function nn(e){return l(e)?.countsAs}function rn(e){return l(e)?.playbookAuthored===!0}function an(e){return l(e)?.connected===!0}function on(e){const t=l(e);return t?.shape==="artifact"&&t?.carriesText===!0}function Ie(e){const t=l(e.type)?.snippet;return t?t(e):""}function sn(e,t){const n=l(e.type)?.timeline;return n?n(e,t):e.type.replace(/_/g," ").toLowerCase()}function ln(e){const t=l(e.type)?.joinUrl;return t?t(e):void 0}function N(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 O(e,t,n){if(e===void 0)return null;if(typeof e=="string")return e||null;if("value"in e)return N(t,e.value)||null;const i={};for(const[a,o]of Object.entries(e.params??{}))i[a]=N(t,o);const r=n(e.key,i);return r===e.key?null:r}function Me(e,t){if(!e||typeof e=="string"||"value"in e)return null;const n={};for(const[i,r]of Object.entries(e.params??{}))n[i]=N(t,r);return{key:e.key,params:n}}const cn=e=>e;function ce(e){const t=m[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 ue(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 Ce{constructor(t=[],n=cn){this.translate=n;for(const i of t)i?.type&&(i.type in m||this.declared.has(i.type)||this.declared.set(i.type,i))}declared=new Map;get(t){if(t in m)return ce(t);const n=this.declared.get(t);return n?ue(n):void 0}triggerable(){const t=Object.keys(m).filter(i=>m[i].triggerable).map(ce),n=[...this.declared.values()].map(ue).filter(i=>i.triggerable);return[...t,...n]}timelineText(t,n){const i=m[t.type];if(i?.timeline)return i.timeline(t,n);const r=this.declared.get(t.type);return O(r?.text,t,this.translate)??t.type.replace(/_/g," ").toLowerCase()}snippet(t){const n=m[t.type];if(n?.snippet)return n.snippet(t);const i=this.declared.get(t.type);return O(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}isMessage(t){return W(this.get(t)?.shape)}isReplyable(t){return this.get(t)?.replyable===!0}carriesText(t){return this.get(t)?.carriesText===!0}countsAs(t){return this.get(t)?.countsAs}channelKind(t){return this.get(t)?.channelKind}isTranscript(t){const n=this.get(t);return n?.shape==="artifact"&&n.carriesText}get translator(){return this.translate}}const un=new Ce,de=140;function dn(e){const t=e.trim();return t.length<=de?t:t.slice(0,de-1).trimEnd()+"…"}function pn(e,t){const n=Me(t?.text,e),i=t?O(t.text,e,r=>r):null;return{activityId:e.id,type:e.type,snippet:dn(i??Ie(e)),authorName:e.author?.name??"",direction:e.direction,createdAt:e.createdAt??Date.now(),...n?{snippetKey:n.key,snippetParams:n.params}:{}}}function fn(e,t,n=[]){const i=e.createdAt;if(!i)return[];const r=new Set(n);return e.author.type==="user"&&e.author.id&&r.add(e.author.id),Object.entries(t).filter(([a,o])=>o>=i&&!r.has(a)).map(([a])=>a)}function mn(e){return e.createdAt??0}const gn=[{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 hn(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 x(e){return e<10?`0${e}`:`${e}`}function Ne(e,t){const n=new Date(e),i=`${n.getUTCFullYear()}-${x(n.getUTCMonth()+1)}-${x(n.getUTCDate())}`;return t==="day"?i:`${i}T${x(n.getUTCHours())}`}function Oe(e,t){const n=new Date(e);return n.setUTCMinutes(0,0,0),t==="day"&&n.setUTCHours(0),n.getTime()}const En=36e5,An=864e5;function yn(e,t,n){const i=n==="hour"?En:An,r=[];for(let a=Oe(e,n);a<=t;a+=i)r.push(Ne(a,n));return r}const Re=[{id:"resource",label:"Resource",labelSource:"raw"},{id:"origin",label:"Herkomst",labelSource:"raw"}],ke=Re.map(e=>e.id);function ve(e,t){return`${e}.usage.${t}`}function Sn(e,t){return t.map(n=>({id:ve(e,n.unit),label:n.label,category:"Verbruik",valueType:n.valueType??"count",aggregation:"sum",supportedDimensions:["provider",...ke,...n.extraDimensions??[],"time"]}))}const we=new Set(["info","success","warning","destructive"]),P=200,$=100,K=200,U=12,B=4,X=4e3,I=500,_n=256*1024,Tn=new Set(["heading","paragraph","list","quote","code","divider","table","kpi","callout"]),Le=["http:","https:","mailto:","tel:"],bn=/^[a-z][a-z0-9+.-]*:/i;function xe(e){const t=e.trim().replace(/^<|>$/g,"");if(!t)return!1;const n=bn.exec(t)?.[0];return n?Le.includes(n.toLowerCase()):!t.startsWith("//")}const In=/^[ \t]{0,3}\[([^\]]+)\]:[ \t]*(\S+).*$/gm;function Mn(e){let t="",n=0;for(;n<e.length;){const i=e[n]==="!"&&e[n+1]==="[";if(e[n]!=="["&&!i){t+=e[n],n+=1;continue}const r=n+(i?2:1),a=pe(e,r,"[","]");if(a<0||e[a+1]!=="("){t+=e[n],n+=1;continue}const o=pe(e,a+2,"(",")");if(o<0){t+=e[n],n+=1;continue}const s=e.slice(r,a),c=e.slice(a+2,o).trim().split(/\s+/)[0]??"";t+=i||!xe(c)?s:e.slice(n,o+1),n=o+1}return t}function pe(e,t,n,i){let r=1;for(let a=t;a<e.length;a+=1){if(e[a]==="\\"){a+=1;continue}if(e[a]===n)r+=1;else if(e[a]===i&&(r-=1,r===0))return a}return-1}function De(e){return Mn(e).replace(In,(t,n,i)=>xe(i)?t:"")}function d(e,t=X){return typeof e=="string"?De(e).slice(0,t):""}function Cn(e,t=X){return typeof e=="string"?e.slice(0,t):""}function Nn(e,t="info"){return typeof e=="string"&&we.has(e)?e:t}function On(e,t=()=>{}){if(!Array.isArray(e))return[];const n=[];for(const i of e){if(n.length>=P){t("more than "+P+" blocks; the rest was dropped");break}if(!i||typeof i!="object")continue;const r=i;if(!Tn.has(r.type)){t("unknown block type "+String(r.type));continue}const a=typeof r.block_id=="string"?{block_id:r.block_id}:{};switch(r.type){case"heading":{const o=d(r.text);if(!o){t("a heading without text");continue}const s=r.level===2||r.level===3?r.level:1;n.push({...a,type:"heading",level:s,text:o});break}case"paragraph":{const o=d(r.text);if(!o){t("a paragraph without text");continue}n.push({...a,type:"paragraph",text:o});break}case"quote":{const o=d(r.text);if(!o){t("a quote without text");continue}n.push({...a,type:"quote",text:o});break}case"code":{const o=Cn(r.text);if(!o){t("a code block without text");continue}const s=typeof r.lang=="string"?{lang:r.lang.slice(0,32)}:{};n.push({...a,type:"code",...s,text:o});break}case"divider":n.push({...a,type:"divider"});break;case"list":{const o=Array.isArray(r.items)?r.items:[],s=[];for(const p of o){if(s.length>=$){t("more than "+$+" list items");break}const f=d(p?.text);if(!f)continue;const u=d(p?.lead,200);s.push(u?{lead:u,text:f}:{text:f})}if(s.length===0){t("a list without usable items");continue}const c=r.style==="numbered"?"numbered":"bulleted";n.push({...a,type:"list",style:c,items:s});break}case"table":{const o=Array.isArray(r.columns)?r.columns:[],s=[];for(const u of o){if(s.length>=U){t("more than "+U+" table columns");break}const A=d(u?.label,I),v=u?.align==="right"?"right":void 0;s.push(v?{label:A,align:v}:{label:A})}if(s.length===0){t("a table without columns");continue}const c=Array.isArray(r.rows)?r.rows:[],p=[];for(const u of c){if(p.length>=K){t("more than "+K+" table rows");break}const A=Array.isArray(u)?u:[];p.push(s.map((v,Wt)=>d(A[Wt],I)))}const f=d(r.caption,I);n.push({...a,type:"table",columns:s,rows:p,...f?{caption:f}:{}});break}case"kpi":{const o=Array.isArray(r.items)?r.items:[],s=[];for(const c of o){if(s.length>=B){t("more than "+B+" kpi items");break}const p=d(c?.value,40),f=d(c?.label,80);if(!p||!f)continue;const u=c?.tone;s.push(typeof u=="string"&&we.has(u)?{value:p,label:f,tone:u}:{value:p,label:f})}if(s.length===0){t("a kpi block without usable items");continue}n.push({...a,type:"kpi",items:s});break}case"callout":{const o=d(r.text);if(!o){t("a callout without text");continue}const s=d(r.title,200);n.push({...a,type:"callout",tone:Nn(r.tone),...s?{title:s}:{},text:o});break}}}return n}function Rn(e){return JSON.stringify(e).length}function kn(e){return{blocks:e.length,types:e.map(t=>t.type),headings:e.flatMap(t=>t.type==="heading"?[t.text]:[])}}function fe(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ").trim()}function me(e,t,n){const i=e.map((r,a)=>n?.[a]==="right"?"---:":"---");return[`| ${e.map(fe).join(" | ")} |`,`| ${i.join(" | ")} |`,...t.map(r=>`| ${r.map(fe).join(" | ")} |`)]}function vn(e){switch(e.type){case"heading":return[`${"#".repeat(e.level)} ${e.text}`];case"paragraph":return[e.text];case"quote":return e.text.split(/\r?\n/).map(t=>`> ${t}`);case"code":return[`\`\`\`${e.lang??""}`,e.text,"```"];case"divider":return["---"];case"list":return e.items.map((t,n)=>{const i=e.style==="numbered"?`${n+1}.`:"-";return t.lead?`${i} **${t.lead}** ${t.text}`:`${i} ${t.text}`});case"table":{const t=me(e.columns.map(n=>n.label),e.rows,e.columns.map(n=>n.align??"left"));return e.caption?[...t,"",`*${e.caption}*`]:t}case"kpi":return me(e.items.map(t=>t.value),[e.items.map(t=>t.label)]);case"callout":return(e.title?`**${e.title}** ${e.text}`:e.text).split(/\r?\n/).map(n=>`> ${n}`)}}function wn(e,t){const n=[],i=e.some(r=>r.type==="heading"&&r.level===1);t&&!i&&n.push(`# ${t}`);for(const r of e){const a=vn(r);a.length>0&&n.push(a.join(`
|
|
2
2
|
`))}return`${n.join(`
|
|
3
3
|
|
|
4
4
|
`)}
|
|
5
|
-
`}const z=e=>`user:${e}`,Y=e=>`team:${e}`;function Ln(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(z(n.id)),n.kind==="team"&&t.add(Y(n.id)));return[...t].sort()}function xn(e,t){return[z(e),...t.map(Y)]}function Dn(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const Pe=["done","escalated"];function Pn(e){return Pe.includes(e)}const $e="assignment";function $n(e){return`${$e}:${e}`}function Kn(e,t,n){if(e.direction==="inbound")return!0;if(e.author?.type==="user"&&e.author.id===t)return!1;const i=e.payload?.mentions;return Array.isArray(i)&&i.includes(t)?!0:n==="reply"}function Un(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}const Ke=12;function Bn(e,t,n=Ke){const i=t+1;return e?e.kind==="done"?{status:"done",waitingOn:null,turns:i,reason:e.note}:e.kind==="escalate"?{status:"escalated",waitingOn:null,turns:i,reason:e.reason}:i>=n?{status:"escalated",waitingOn:null,turns:i,reason:`na ${n} beurten nog niet afgerond, dus een mens neemt het over`}:{status:"waiting",waitingOn:e.on,turns:i}:{status:"escalated",waitingOn:null,turns:i,reason:"de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"}}const F=["lookup","condition","parallel","for-each"];function G(e){for(const t of e){if(!F.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${F.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const i=G(n);if(i)return i}if(t.type==="for-each"){const n=G(t.body??[]);if(n)return n}}return null}function Fn(e,t){switch(e.kind){case"org":return!0;case"team":return!!t.teamId&&e.teamId===t.teamId;case"personal":return e.userId===t.userId}}function Gn(e,t){return e.filter(n=>n.enabled&&Fn(n.ownerScope,t))}function jn(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Vn=[{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"},{name:"assigneeUserId",type:"string"}],Wn={topics:[{name:"topicId",type:"string"},{name:"topic",type:"string"},{name:"confidence",type:"number"},{name:"reasoning",type:"string"}],question:[{name:"answer",type:"boolean"},{name:"reasoning",type:"string"}],extract:[]};function Ue(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Hn(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),r=t.slice(n+1).trim();if(r){if(i==="user")return{kind:"user",userId:r};if(i==="team")return{kind:"team",teamId:r}}}function Be(e){return Ue(e)}function Fe(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 Xn(e){return e.agentId?{kind:"user",userId:e.agentId}:Fe(e.ownerScope)}function zn(e){return Be(e)}function Yn(e,t){if(!t)return;let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n}function qn(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function Jn(e,t){if(t)return e.targets.find(n=>n.id===t)}function Ge(e){return e?.kind==="assignment"}function Zn(e){const{trigger:t,agentId:n,target:i,activityType:r,assigneeUserId:a,authorUserId:o}=e;return Ge(t)?n?i?i.activityTypes.includes(r)?a?a!==n?"assigned to someone else":o&&o===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${i.assigneePath}`:`activity type ${r} does not announce an assignment for ${i.id}`:`assignment target kind "${t.targetKind}" is not declared by any installed app`:"this playbook has no agent, so an assignment can never be for it":"trigger is not an assignment trigger"}function je(e){return`${e.type}:${e.id}`}const Ve="interaction";function We(e){return e?.type===Ve?e.id:void 0}const He=64,Xe=8e3;function Qn(e){const t=typeof e=="number"?e:Number(String(e??"").trim());if(!(!Number.isFinite(t)||t<=0))return Math.min(Math.max(Math.round(t),He),Xe)}const ei={kind:"workflow",steps:[]};function ti(e){return e?.kind==="workflow"?e.steps:[]}function ni(e){return e?.kind==="procedure"?e.procedure:void 0}const ze=["done","escalated","failed","stopped"];function ii(e){return ze.includes(e)}function Ye(e){return e==="waiting"}function ri(e){return e==="running"||Ye(e)}function q(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function ai(e){const t=q(e);return t?je(t):void 0}function oi(e){return We(q(e))}function si(e,t){const n=e.labels??[];return n.find(i=>i.locale===t)?.label??n[0]?.label??e.url}function li(e,t,n){const i=e.translations??[];return i.find(r=>r.locale===t)??(n?i.find(r=>r.locale===n):void 0)??{locale:t}}const j=[{code:"nl",label:"Nederlands",english:"Dutch"},{code:"en",label:"English",english:"English"},{code:"de",label:"Deutsch",english:"German"},{code:"fr",label:"Français",english:"French"},{code:"es",label:"Español",english:"Spanish"},{code:"it",label:"Italiano",english:"Italian"},{code:"pt",label:"Português",english:"Portuguese"},{code:"pl",label:"Polski",english:"Polish"},{code:"sv",label:"Svenska",english:"Swedish"},{code:"da",label:"Dansk",english:"Danish"},{code:"nb",label:"Norsk bokmål",english:"Norwegian Bokmål"},{code:"fi",label:"Suomi",english:"Finnish"},{code:"tr",label:"Türkçe",english:"Turkish"}];function qe(e){const t=(e??"").toLowerCase();return j.find(n=>n.code===t)??j.find(n=>n.code===t.split("-")[0])}function ci(e){return qe(e)?.label??e}function ui(e){const t=qe(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const J=3;function Je(e,t){const n=new Set;let i=1,r=t.get(e)?.parentId;for(;r;){if(n.has(r)||(n.add(r),i++,i>J+1))return 1/0;r=t.get(r)?.parentId}return i}function di(e,t,n){if(!e)return!0;if(e===t)return!1;const i=new Map(n.map(o=>[o.id,o]));if(!i.has(e)||t&&Ze(e,t,i))return!1;const r=Je(e,i),a=t?Z(t,n):1;return r+a<=J}function Ze(e,t,n){const i=new Set;let r=n.get(e)?.parentId;for(;r;){if(r===t)return!0;if(i.has(r))return!1;i.add(r),r=n.get(r)?.parentId}return!1}function Z(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const i=t.filter(r=>r.parentId===e);return i.length?1+Math.max(...i.map(r=>Z(r.id,t,n))):1}const Qe="en";function et(e){return e.defaultLocale||e.locale||Qe}function pi(e){const t=new Set,n=[];for(const i of[et(e),...e.locales??[]])!i||t.has(i)||(t.add(i),n.push(i));return n}function fi(e,t,n){const i=e.translations??[];return i.find(r=>r.locale===t)?.name??(n?i.find(r=>r.locale===n)?.name:void 0)??e.name}const tt=20,nt=20,M=300;function g(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function it(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=M)return t;const n=t.slice(0,M),i=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return i>M*.6?n.slice(0,i+1):`${n.trimEnd()}…`}function mi(e,t){const n=it(t.text),i=g(n);if(!i||(e.examples??[]).some(o=>g(o)===i))return null;const r=e.exampleCandidates??[],a=r.findIndex(o=>g(o.text)===i);if(a>=0){if(r[a].corrected||!t.corrected)return null;const o=[...r];return o[a]={...o[a],corrected:!0,addedAt:t.addedAt},ge(o)}return ge([{...t,text:n},...r]).slice(0,nt)}function ge(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function gi(e,t){const n=g(t),i=(e.examples??[]).filter(a=>a.trim());return{examples:i.some(a=>g(a)===n)?i:[...i,t].slice(-tt),exampleCandidates:rt(e,t)}}function rt(e,t){const n=g(t);return(e.exampleCandidates??[]).filter(i=>g(i.text)!==n)}function at(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function hi(e,t){return e.filter(n=>at(n,t))}const Q=[{id:"openai",attachmentKinds:["image","pdf"],label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",attachmentKinds:["image","pdf"],label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",attachmentKinds:["image","pdf"],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 E(e){return Q.find(t=>t.id===e)}function Ei(e){return E(e)?.label??e}function Ai(e,t="gpt-5-mini"){return E(e)?.defaultModel??t}function yi(e){return Q.filter(t=>t.capabilities.includes(e))}function Si(e){const t=E(e);return!!t&&!t.baseUrl}function _i(e,t){return t==="text"?!0:E(e)?.attachmentKinds?.includes(t)===!0}function Ti(e,t){if(!e.enabled)return"ok";const n=V(e.hardLimitNanos),i=V(e.softLimitNanos);return n!==void 0&&t>=n?"hard":i!==void 0&&t>=i?"soft":"ok"}function V(e){return typeof e=="number"?e:void 0}function ot(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function bi(e,t="month"){const n=new Date(ot(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function Ii(e){return e?.listeningEnabled!==!1}function Mi(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function Ci(e){return`mcp__${e}__`}const Ni=new Set(["mail","message"]);function st(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function Oi(e,t,n,i="html"){if(!e)return n;const r=st(e,t);return r?`${n}${i==="text"?`
|
|
5
|
+
`}const z=e=>`user:${e}`,Y=e=>`team:${e}`;function Ln(e){const t=new Set;for(const n of e??[])n?.id&&(n.kind==="user"&&t.add(z(n.id)),n.kind==="team"&&t.add(Y(n.id)));return[...t].sort()}function xn(e,t){return[z(e),...t.map(Y)]}function Dn(e){const t=new Set;for(const n of e??[])n?.kind&&t.add(n.kind);return[...t]}const Pe=["done","escalated"];function Pn(e){return Pe.includes(e)}const $e="assignment";function $n(e){return`${$e}:${e}`}function Kn(e,t,n){if(e.direction==="inbound")return!0;if(e.author?.type==="user"&&e.author.id===t)return!1;const i=e.payload?.mentions;return Array.isArray(i)&&i.includes(t)?!0:n==="reply"}function Un(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}const Ke=12;function Bn(e,t,n=Ke){const i=t+1;return e?e.kind==="done"?{status:"done",waitingOn:null,turns:i,reason:e.note}:e.kind==="escalate"?{status:"escalated",waitingOn:null,turns:i,reason:e.reason}:i>=n?{status:"escalated",waitingOn:null,turns:i,reason:`na ${n} beurten nog niet afgerond, dus een mens neemt het over`}:{status:"waiting",waitingOn:e.on,turns:i}:{status:"escalated",waitingOn:null,turns:i,reason:"de agent rondde zijn beurt af zonder te zeggen wat er moet gebeuren (wachten, afronden of overdragen)"}}const F=["lookup","condition","parallel","for-each"];function G(e){for(const t of e){if(!F.includes(t.type))return`staptype "${t.type}" mag niet meelezen (alleen ${F.join(", ")})`;if(t.type==="parallel")for(const n of t.branches??[]){const i=G(n);if(i)return i}if(t.type==="for-each"){const n=G(t.body??[]);if(n)return n}}return null}function Fn(e,t){switch(e.kind){case"org":return!0;case"team":return!!t.teamId&&e.teamId===t.teamId;case"personal":return e.userId===t.userId}}function Gn(e,t){return e.filter(n=>n.enabled&&Fn(n.ownerScope,t))}function jn(e){return(e.startsWith("tool:")?e.slice(5):e).replace(/__/g," · ").replace(/\./g," · ").replace(/_/g," ")}const Vn=[{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"},{name:"assigneeUserId",type:"string"}],Hn={topics:[{name:"topicId",type:"string"},{name:"topic",type:"string"},{name:"confidence",type:"number"},{name:"reasoning",type:"string"}],question:[{name:"answer",type:"boolean"},{name:"reasoning",type:"string"}],extract:[]};function Ue(e){switch(e.kind){case"user":return`user:${e.userId}`;case"team":return`team:${e.teamId}`;case"org":return"org"}}function Wn(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),r=t.slice(n+1).trim();if(r){if(i==="user")return{kind:"user",userId:r};if(i==="team")return{kind:"team",teamId:r}}}function Be(e){return Ue(e)}function Fe(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 Xn(e){return e.agentId?{kind:"user",userId:e.agentId}:Fe(e.ownerScope)}function zn(e){return Be(e)}function Yn(e,t){if(!t)return;let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n}function qn(e,t){return e.targets.find(n=>n.activityTypes.includes(t))}function Jn(e,t){if(t)return e.targets.find(n=>n.id===t)}function Ge(e){return e?.kind==="assignment"}function Zn(e){const{trigger:t,agentId:n,target:i,activityType:r,assigneeUserId:a,authorUserId:o}=e;return Ge(t)?n?i?i.activityTypes.includes(r)?a?a!==n?"assigned to someone else":o&&o===n?"the agent assigned this to itself, which would restart its own run":null:`no assignee found at ${i.assigneePath}`:`activity type ${r} does not announce an assignment for ${i.id}`:`assignment target kind "${t.targetKind}" is not declared by any installed app`:"this playbook has no agent, so an assignment can never be for it":"trigger is not an assignment trigger"}function je(e){return`${e.type}:${e.id}`}const Ve="interaction";function He(e){return e?.type===Ve?e.id:void 0}const We=64,Xe=8e3;function Qn(e){const t=typeof e=="number"?e:Number(String(e??"").trim());if(!(!Number.isFinite(t)||t<=0))return Math.min(Math.max(Math.round(t),We),Xe)}const ei={kind:"workflow",steps:[]};function ti(e){return e?.kind==="workflow"?e.steps:[]}function ni(e){return e?.kind==="procedure"?e.procedure:void 0}const ze=["done","escalated","failed","stopped"];function ii(e){return ze.includes(e)}function Ye(e){return e==="waiting"}function ri(e){return e==="running"||Ye(e)}function q(e){return e.subjectKind&&e.subjectId?{type:e.subjectKind,id:e.subjectId}:void 0}function ai(e){const t=q(e);return t?je(t):void 0}function oi(e){return He(q(e))}function si(e,t){const n=e.labels??[];return n.find(i=>i.locale===t)?.label??n[0]?.label??e.url}function li(e,t,n){const i=e.translations??[];return i.find(r=>r.locale===t)??(n?i.find(r=>r.locale===n):void 0)??{locale:t}}const j=[{code:"nl",label:"Nederlands",english:"Dutch"},{code:"en",label:"English",english:"English"},{code:"de",label:"Deutsch",english:"German"},{code:"fr",label:"Français",english:"French"},{code:"es",label:"Español",english:"Spanish"},{code:"it",label:"Italiano",english:"Italian"},{code:"pt",label:"Português",english:"Portuguese"},{code:"pl",label:"Polski",english:"Polish"},{code:"sv",label:"Svenska",english:"Swedish"},{code:"da",label:"Dansk",english:"Danish"},{code:"nb",label:"Norsk bokmål",english:"Norwegian Bokmål"},{code:"fi",label:"Suomi",english:"Finnish"},{code:"tr",label:"Türkçe",english:"Turkish"}];function qe(e){const t=(e??"").toLowerCase();return j.find(n=>n.code===t)??j.find(n=>n.code===t.split("-")[0])}function ci(e){return qe(e)?.label??e}function ui(e){const t=qe(e);return t?t.english===t.label?`${t.english} (${t.code})`:`${t.english} — ${t.label} (${t.code})`:e}const J=3;function Je(e,t){const n=new Set;let i=1,r=t.get(e)?.parentId;for(;r;){if(n.has(r)||(n.add(r),i++,i>J+1))return 1/0;r=t.get(r)?.parentId}return i}function di(e,t,n){if(!e)return!0;if(e===t)return!1;const i=new Map(n.map(o=>[o.id,o]));if(!i.has(e)||t&&Ze(e,t,i))return!1;const r=Je(e,i),a=t?Z(t,n):1;return r+a<=J}function Ze(e,t,n){const i=new Set;let r=n.get(e)?.parentId;for(;r;){if(r===t)return!0;if(i.has(r))return!1;i.add(r),r=n.get(r)?.parentId}return!1}function Z(e,t,n=new Set){if(n.has(e))return 1;n.add(e);const i=t.filter(r=>r.parentId===e);return i.length?1+Math.max(...i.map(r=>Z(r.id,t,n))):1}const Qe="en";function et(e){return e.defaultLocale||e.locale||Qe}function pi(e){const t=new Set,n=[];for(const i of[et(e),...e.locales??[]])!i||t.has(i)||(t.add(i),n.push(i));return n}function fi(e,t,n){const i=e.translations??[];return i.find(r=>r.locale===t)?.name??(n?i.find(r=>r.locale===n)?.name:void 0)??e.name}const tt=20,nt=20,M=300;function g(e){return e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").replace(/\s+/g," ").trim()}function it(e){const t=e.replace(/\s+/g," ").trim();if(t.length<=M)return t;const n=t.slice(0,M),i=Math.max(n.lastIndexOf(". "),n.lastIndexOf("! "),n.lastIndexOf("? "));return i>M*.6?n.slice(0,i+1):`${n.trimEnd()}…`}function mi(e,t){const n=it(t.text),i=g(n);if(!i||(e.examples??[]).some(o=>g(o)===i))return null;const r=e.exampleCandidates??[],a=r.findIndex(o=>g(o.text)===i);if(a>=0){if(r[a].corrected||!t.corrected)return null;const o=[...r];return o[a]={...o[a],corrected:!0,addedAt:t.addedAt},ge(o)}return ge([{...t,text:n},...r]).slice(0,nt)}function ge(e){return[...e].sort((t,n)=>Number(n.corrected)-Number(t.corrected)||n.addedAt-t.addedAt)}function gi(e,t){const n=g(t),i=(e.examples??[]).filter(a=>a.trim());return{examples:i.some(a=>g(a)===n)?i:[...i,t].slice(-tt),exampleCandidates:rt(e,t)}}function rt(e,t){const n=g(t);return(e.exampleCandidates??[]).filter(i=>g(i.text)!==n)}function at(e,t){const n=e.ownerScope;return n?n.kind==="org"?!0:n.kind==="team"?!!t&&n.teamId===t:!1:!1}function hi(e,t){return e.filter(n=>at(n,t))}const Q=[{id:"openai",attachmentKinds:["image","pdf"],label:"OpenAI",capabilities:["chat","transcription","embedding"],defaultModel:"gpt-5-mini",baseUrl:"https://api.openai.com/v1"},{id:"gemini",attachmentKinds:["image","pdf"],label:"Google Gemini",capabilities:["chat","transcription","embedding"],defaultModel:"gemini-3.5-flash",baseUrl:"https://generativelanguage.googleapis.com/v1beta"},{id:"anthropic",attachmentKinds:["image","pdf"],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 E(e){return Q.find(t=>t.id===e)}function Ei(e){return E(e)?.label??e}function Ai(e,t="gpt-5-mini"){return E(e)?.defaultModel??t}function yi(e){return Q.filter(t=>t.capabilities.includes(e))}function Si(e){const t=E(e);return!!t&&!t.baseUrl}function _i(e,t){return t==="text"?!0:E(e)?.attachmentKinds?.includes(t)===!0}function Ti(e,t){if(!e.enabled)return"ok";const n=V(e.hardLimitNanos),i=V(e.softLimitNanos);return n!==void 0&&t>=n?"hard":i!==void 0&&t>=i?"soft":"ok"}function V(e){return typeof e=="number"?e:void 0}function ot(e,t="month"){const n=new Date(e);return Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),1)}function bi(e,t="month"){const n=new Date(ot(e,t));return`${n.getUTCFullYear()}-${String(n.getUTCMonth()+1).padStart(2,"0")}`}function Ii(e){return e?.listeningEnabled!==!1}function Mi(e){return e.credentialScope?e.credentialScope:(e.authMode??"header")==="header"||e.oauth?.scope==="org"?"shared":"per-user"}function Ci(e){return`mcp__${e}__`}const Ni=new Set(["mail","message"]);function st(e,t){const n=e.settings?.signatures?.[t];return!n||!n.enabled||!n.body||n.body.trim()===""?null:n}function Oi(e,t,n,i="html"){if(!e)return n;const r=st(e,t);return r?`${n}${i==="text"?`
|
|
6
6
|
|
|
7
|
-
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${r.body}`:n}function Ri(e){return e.endpoints??[]}const ki=e=>!!e.assignedUserId||!!e.assignedInboxId,
|
|
7
|
+
`:t==="mail"?"<br><br>-- <br>":"<br><br>"}${r.body}`:n}function Ri(e){return e.endpoints??[]}const ki=e=>!!e.assignedUserId||!!e.assignedInboxId,vi=e=>e.status==="closed",wi=e=>({urgent:10,high:5,normal:2,low:1})[e.priority]||0,Li=(e,t=30)=>e.title?.length<=t?e.title:`${e.title.substring(0,t)}...`;function xi(e,t){return e.lastActivityAt?!(e.seenBy??[]).includes(t):!1}const Di=1e3,Pi=2e3,$i=500,Ki=12e3,Ui=4e3,lt=["contact","company"];function Bi(e){if(!e)return!1;const t=e.slice(0,e.indexOf(":"));return lt.includes(t)}function Fi(e,t){const n=e.accumulatedSeconds||0;return e.runningSince?n+Math.max(0,Math.floor((t-e.runningSince)/1e3)):n}function Gi(e,t){const n=Math.max(1,Math.ceil(Math.max(0,e)/60));if(!t||t==="exact")return n*60;const i=Number(t);return!Number.isFinite(i)||i<=0?n*60:Math.ceil(n/i)*i*60}function ji(e){const t=Math.max(0,Math.round(e/60));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Vi(e){const t=Math.max(0,Math.floor(e)),n=a=>String(a).padStart(2,"0"),i=Math.floor(t/60)%60,r=Math.floor(t/3600);return r>0?`${r}:${n(i)}:${n(t%60)}`:`${n(i)}:${n(t%60)}`}function ct(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function Hi(e,t){const n=ct(e)||"werksoort",i=new Set(t);if(!i.has(n))return n;for(let r=2;r<500;r++){const a=`${n}-${r}`;if(!i.has(a))return a}return`${n}-${i.size+1}`}function Wi(e,t){const n=e.ownerScope;return!n||n.kind==="org"?!0:t.includes(n.teamId)}function Xi(e){return e.filter(t=>!t.archived).sort(ut)}function ut(e,t){const n=(e.order??0)-(t.order??0);return n!==0?n:(e.label||"").localeCompare(t.label||"")}function zi(e){return e.type==="agent"}const dt="work_item",pt="work_project";function ft(e){return`${dt}:${e}`}function ee(e){return`${pt}:${e}`}function Yi(e,t,n){const i=`${e}-${t}`;return n?`${i}-${n}`:i}function qi(e){const t=/^([A-Za-z0-9]{2,8})-(\d+)(?:-(\d+))?$/.exec((e||"").trim());return t?{projectKey:t[1].toUpperCase(),sequenceNumber:Number(t[2]),...t[3]?{subSequence:Number(t[3])}:{}}:null}function Ji(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,3)||"PRJ"}function Zi(e,t=25){const n=new Set([ft(e.id)]);e.projectId&&n.add(ee(e.projectId));for(const i of e.ancestorKeys??[])n.add(i);for(const i of e.partyKeys??[])n.add(i);return Array.from(n).slice(0,t)}function Qi(e){return[ee(e.id)]}const R=[{key:"open",label:"status_open",category:"todo",order:0},{key:"in_progress",label:"status_in_progress",category:"in_progress",order:1},{key:"done",label:"status_done",category:"done",order:2}],te=R.map(e=>e.key);function mt(e){return e?.statuses?.length?e.statuses:R}function gt(e,t){return t.find(n=>n.key===e)?.category??"todo"}function er(e,t){return t.find(n=>n.key===e)}function tr(e){const t=mt(e),n=e?.defaultStatusKey;return n&&t.some(i=>i.key===n)?n:ht(t)[0]?.key??R[0].key}function ht(e){return[...e].sort((t,n)=>{const i=(t.order??0)-(n.order??0);return i!==0?i:(t.label||"").localeCompare(n.label||"")})}function nr(e,t){return gt(e,t)==="done"}function Et(e){return(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").slice(0,48).replace(/^-+|-+$/g,"")}function ir(e,t){const n=Et(e)||"status",i=new Set([...t,...te]);if(!i.has(n))return n;for(let r=2;r<500;r++){const a=`${n}-${r}`;if(!i.has(a))return a}return`${n}-${i.size+1}`}function rr(e){const t=[];if(!e.length)return[{index:-1,reason:"empty"}];const n=new Set;return e.forEach((i,r)=>{if(!i.key){t.push({index:r,reason:"missing_key"});return}te.includes(i.key)&&t.push({index:r,reason:"reserved_key",key:i.key}),n.has(i.key)&&t.push({index:r,reason:"duplicate_key",key:i.key}),n.add(i.key)}),e.some(i=>i.category==="todo"||i.category==="in_progress")||t.push({index:-1,reason:"no_open"}),e.some(i=>i.category==="done")||t.push({index:-1,reason:"no_done"}),t}const k={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}},At="NL",ar=15,or=8,sr=Array.from(new Set(Object.values(k).map(e=>e.callingCode))).sort((e,t)=>t.length-e.length);function he(e){if(e)return k[e.trim().toUpperCase()]}function C(e,t){return e.length>=t.nsnMin&&e.length<=t.nsnMax}function Ee(e){if(e.length>ar)return null;for(const t of sr){if(!e.startsWith(t))continue;const n=e.slice(t.length);for(const i of Object.values(k)){if(i.callingCode!==t)continue;const r=i.trunkPrefix,a=r&&n.startsWith(r)?n.slice(r.length):n;if(C(a,i))return`+${t}${a}`}return null}return e.length<or?null:`+${e}`}function lr(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 cr(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 H(e,t){if(!e)return null;const n=lr(e);if(!n)return null;const i=n.startsWith("+"),r=n.replace(/\D/g,"");if(!r)return null;if(i)return Ee(r);if(r.startsWith("00"))return Ee(r.slice(2));const a=he(t)??he(At);if(!a)return null;const o=a.trunkPrefix;if(o&&r.startsWith(o)){const s=r.slice(o.length);return C(s,a)?`+${a.callingCode}${s}`:null}if(r.startsWith(a.callingCode)){const s=r.slice(a.callingCode.length);if(C(s,a))return`+${a.callingCode}${s}`}return!o&&C(r,a)?`+${a.callingCode}${r}`:null}function ur(e,t=9){const n=(e??"").replace(/\D/g,"");return n.length<t?null:n.slice(-t)}function ne(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],r=t.slice(n+1);return!i||!r.includes(".")?null:`${i}@${r}`}function dr(e){const t=ne(e);return t?t.slice(t.lastIndexOf("@")+1):null}const pr=new Set(["co.uk","org.uk","gov.uk","ac.uk","com.au","co.nz","com.br","co.za"]);function yt(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 pr.has(n)&&t.length>=3?t.slice(-3).join("."):n}const St=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 fr(e){const t=yt(e);return t?St.has(t):!1}function mr(e){if(!e)return!1;const t=e.trim().toLowerCase();return t==="tel"||t==="sms"||t==="whatsapp"||t==="fax"}function gr(e,t,n){if(!e||!t)return null;const i=e.trim().toLowerCase();if(i==="tel"||i==="sms"||i==="whatsapp"){const a=H(t,n);return a?`tel:${a}`:null}if(i==="fax"){const a=H(t,n);return a?`fax:${a}`:null}if(i==="mailto"||i==="email"){const a=ne(t);return a?`mailto:${a}`:null}const r=t.trim().toLowerCase();return r?`${i}:${r}`:null}const hr=/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,Er=/(\*|_)(?=\S)([^*_\n]*?\S)\1/g;function Ar(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(`
|
|
8
8
|
`).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(`
|
|
9
9
|
`),t=t.replace(hr,"$2"),t=t.replace(Er,"$2"),t=t.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),t=t.replace(/`([^`\n]+)`/g,"$1"),t.replace(/\s+/g," ").trim()}const yr=[/<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],Ae=/^\s*(?:>+\s*)?(?:from|van|sent|verzonden|to|aan|cc|subject|onderwerp|date|datum)\s*:/i,Sr=/^\s*(?:on|op)\b.{0,200}?\b(?:wrote|schreef|geschreven)\s*:?\s*$/i;function _r(e){const t=e.split(`
|
|
10
10
|
`);for(let n=0;n<t.length;n++)if(Sr.test(t[n])||Ae.test(t[n])&&t.slice(n+1,n+4).some(i=>Ae.test(i)))return t.slice(0,n).join(`
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
`),t=t.replace(/<\/(td|th)>/gi," "),t=t.replace(/<[^>]+>/g,""),t=t.replace(/<[^>]*$/,""),t}function Se(e){return!Number.isInteger(e)||e<0||e>1114111?null:String.fromCodePoint(e)}function _e(e){return e.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/&#(\d+);/g,(t,n)=>Se(Number(n))??t).replace(/&#x([0-9a-f]+);/gi,(t,n)=>Se(parseInt(n,16))??t).replace(/&/gi,"&")}function Te(e){return e.replace(/\r/g,"").replace(/[ \t]+/g," ").replace(/ *\n */g,`
|
|
16
16
|
`).replace(/\n{3,}/g,`
|
|
17
17
|
|
|
18
|
-
`).trim()}function Tr(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const a of yr){const o=e.search(a);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let i=Te(_e(ye(n)));return i||(i=Te(_e(ye(e)))),_r(i)||i}const br=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Ir=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function Mr(e,t){return!!(e&&br.test(e)||t&&Ir.test(t))}const _t=3,Tt=600;function Cr(e,t){return e>=_t||t>=Tt}const Nr=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Or=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function bt(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Nr.has(t)?"image":t==="application/pdf"?"pdf":Or.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const h=1024*1024,It={image:5*h,pdf:20*h,text:1*h,audio:20*h},Rr=25*h,kr=5;function wr(e,t){const n=bt(e);return n==="unsupported"?"unsupported":t>It[n]?"too-large":null}function Mt(e){return`${e.kind}:${e.id||e.url||e.title}`}function vr(e,t=[]){const n=new Set(t),i=[],r=[];for(const a of e){const o=Mt(a);n.has(o)||(n.add(o),i.push(a),r.push(o))}return{sources:i,keys:r}}function Ct(e,t){const n=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},r=t.intents.filter(o=>!n.has(o.intent)).map(o=>xr(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return r;const a=new Set(r.map(o=>o.intent));for(const o of e.extraIntents)a.has(o.intent)||(r.push(o),a.add(o.intent));return r}function Nt(e,t){const n={};for(const i of e.intents){if(!i.togglable)continue;const r=t?.[i.intent];n[i.intent]=r??i.defaultEnabled??!0}return n}function Lr(e,t){const n=Nt(e,t);return Object.entries(n).filter(([,i])=>!i).map(([i])=>i)}function xr(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Dr(e,t){const n=[];for(const i of e){if(!i.enabled)continue;const r=t[i.providerId];if(r)for(const a of Ct(i,r))n.push({channel:i,description:r,capability:a})}return n}function Pr(e,t){return t.filter(n=>n.capability.intent===e)}function Ot(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function $r(e,t){return Ot(e.scheme,t)}function Kr(e,t,n){const i=[];for(const r of e)for(const a of n)a.capability.intent===t&&a.capability.targetSchemes.includes(r.scheme)&&i.push({channelIntent:a,endpoint:r});return i}var Rt=(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))(Rt||{});const Ur={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 Br(e){return e?Ur[e]??"note":"note"}const Fr="message_window",Gr="message_templates",jr={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Vr=(e,t)=>({intent:e,...t}),Wr="folder_management",Hr="remote_search",Xr={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},zr="resources.describe",Yr="resources.search",qr="resources.resolve";function Jr(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const ie="auth";function re(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function Zr(e){const t=re(e);return t?t!==ie:typeof e=="string"&&e.startsWith("/wake")}function Qr(e){return typeof e!="string"||e===""||e==="/"?!0:re(e)===ie}function ea(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kt(e){const n=e.split("/").filter(Boolean).map(i=>i.startsWith(":")?i.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":"/"+ea(i)).join("");return new RegExp(`^${n}\\/?$`)}function wt(e,t){const n=e.split("/").filter(Boolean),i=t.split("/").filter(Boolean),r={};return n.forEach((a,o)=>{if(a.startsWith(":")){const s=a.endsWith("?")?a.slice(1,-1):a.slice(1),c=i[o];c&&(r[s]=c)}}),r}function vt(e){return e.publicBasePath??`/apps/${e.name}`}function ta(e){const t=[];for(const n of e){if(!n?.name)continue;const i=vt(n);for(const r of n.routes??[]){if(!r.public)continue;const a=r.path==="/"?"":r.path;t.push({appName:n.name,resource:r.resource,pattern:`${i}${a}`,props:r.props})}}return t}function Lt(e,t){const n=e.split("/").filter(Boolean),i=t.split("/").filter(Boolean);for(let r=0;r<Math.min(n.length,i.length);r++){const a=n[r].startsWith(":"),o=i[r].startsWith(":");if(a!==o)return o}return n.length>i.length}function xt(e,t){if(typeof e!="string")return null;let n=null;for(const i of t)kt(i.pattern).test(e)&&(!n||Lt(i.pattern,n.pattern))&&(n=i);return n?{...n,params:{...n.props,...wt(n.pattern,e)}}:null}function na(e,t){return xt(e,t)!==null}const ia="sync-source",ra="sync-target",aa=20,oa={afrikaans:["[Muziek]","(C) TV GELDERLAND 2021","*Thomp thomp thomp*","www.youtube.com","ä n wood s","!.."],english:["[applause]","[APPLAUSE]","(claps)","(clapping)","(audience applauds)","(keyboard clicking)","(keyboard clacking)","(clicking)","[CLICK]","[BLANK_AUDIO]","(upbeat music)","(dramatic music)","[music playing]","(electronic music)","(audience cheering)","(audience cheers)","[MUSIC]","( ( ( ( ) ( ) ( ) ( )","(laughs)","(air whooshing)","<u>Transcribed</u> by https://otter.ai","All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is","www.mooji.org","KATHRYN A new forecast is coming up... A new forecast is coming up...","KATHRYN pandemic started. increasing since the The pandemic has been","A new look at your forecast this morning... A new look at your","We'll be right back.","We'll see you next week.","Thanks for watching!","❤️ Translated by Amara.org Communit"],flemish:["*clap*","TV GELDERLAND 2020","TV Gelderland 2021","(C) TV GELDERLAND 2021","[Muziek]","Kuman","Ondertitels ingediend door de Amara.org gemeenschap","Ondertiteld door de Amara.org gemeenschap","Dank u wel voor het kijken.","Ondertiteling door de Amara.org gemeenschap","GELUID VAN MAHIH U similarly"],french:["(applaudissements)","[Applaudissements]","Sous-titres réalisés par la communauté d'Amara.org","- Bonne journée. - Bonjour.","POP POP הי","Merci d'avoir regardé cette vidéo.","Merci d'avoir regardé cette vidéo!","Merci d'avoir regardé la vidéo.","J'espère que vous avez apprécié la vidéo.","Je vous remercie de vous abonner","Merci d'avoir regardé!","❤️ par SousTitreur.com","— Sous-titrage ST'501 —","Thanks for watching!","Sous-titres réalisés par l'Amara.org","Sous-titres réalisés para la communauté d'Amara.org","Sous-titres réalisés par la communauté d'Amara.org","Sous-titres fait par Sous-titres par Amara.org","Sous-titres réalisés par les SousTitres d'Amara.org","Sous-titres par Amara.org","Sous-titres par la communauté d'Amara.org","Sous-titres réalisés pour la communauté d'Amara.org","Sous-titres réalisés par la communauté de l'Amara.org","Sous-Titres faits par la communauté d'Amara.org","Sous-titres par l'Amara.org","Sous-titres fait par la communauté d'Amara.org","Sous-titrage ST' 501","Sous-titrage ST'501","Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org","❤️ par SousTitreur.com"],german:["[Klicken]","(Jubel)","*lacht*","[Anhaltender Beifall]","[Applaus]","(Applaus)","* Applaus *","[MUSIK]","* mustard ml Drumglöck und knack in einem Handbewerb *","Untertitelung aufgrund der Amara.org-Community","Untertitel im Auftrag des ZDF für funk, 2017","Untertitel von Stephanie Geiges","Untertitel der Amara.org-Community","Untertitel im Auftrag des ZDF, 2017","Untertitel im Auftrag des ZDF, 2020","Untertitel im Auftrag des ZDF, 2018","Untertitel im Auftrag des ZDF, 2021","Untertitelung im Auftrag des ZDF, 2021","Copyright WDR 2021","Copyright WDR 2020","Copyright WDR 2019","SWR 2021","SWR 2020"],italian:["Alla prossima!","*applauso*","[Musica]","[Musica]","[Applausi]","*Bip bip bip bip*","(musica del NS shore)","D' 1962 alle tribunte del Gulf","Sottotitoli creati dalla comunità Amara.org","Sottotitoli di Sottotitoli di Amara.org","Sottotitoli e revisione al canale di Amara.org","Sottotitoli e revisione a cura di Amara.org","Sottotitoli e revisione a cura di QTSS","Sottotitoli e revisione a cura di QTSS.","Sottotitoli a cura di QTSS","Sottotitoli a cura di Sottotitoli"],spanish:["[música]","[Música de cierre]","[Aplausos]","(Aplausos)","www.alimmenta.com","¡Gracias por ver el vídeo!","(sonidos del celular) (Inudible distorsión)","¡Suscríbete!","Subtítulos realizados por la comunidad de Amara.org","Subtitulado por la comunidad de Amara.org","Subtítulos por la comunidad de Amara.org","Subtítulos creados por la comunidad de Amara.org","Subtítulos en español de Amara.org","Subtítulos hechos por la comunidad de Amara.org","Subtitulos por la comunidad de Amara.org","Más información www.alimmenta.com","www.mooji.org","[MÚSICA]","[Music cuts in British]"]},Dt=e=>{let t=e;return Object.values(oa).forEach(n=>{n.forEach(i=>{t=t.replaceAll(i,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},Pt=6e4,$t=8e3,Kt=2,Ut=.4,sa=3,la=new Set(["aan","als","ben","bent","bij","dan","dat","deze","die","dit","doen","door","dus","echt","een","eens","even","gaan","gaat","geen","geweest","goed","graag","had","heb","hebben","hebt","heeft","het","hier","hoe","hoor","iets","inderdaad","kan","klopt","kunnen","kunt","maar","mag","mee","meer","met","mij","mijn","misschien","moet","moeten","naar","net","niet","nog","nou","oke","ook","over","prima","toch","uhm","uit","van","veel","voor","wat","weer","weet","wel","wij","wil","wilt","worden","wordt","zeg","zeggen","zijn","zou","zult","about","and","are","been","but","can","does","for","have","just","know","like","not","okay","right","she","that","the","them","then","there","they","this","want","was","well","were","what","will","with","would","yeah","you","your"]);function Bt(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<sa||la.has(n)||t.add(n);return[...t]}function Ft(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),i=new Set(e);let r=0;for(const a of i)n.has(a)||(r+=1);return r/i.size}function Gt(e,t=Pt){const n=e.filter(o=>!o.partial&&typeof o.text=="string");if(!n.length)return{text:"",segmentCount:0};const r=n.reduce((o,s)=>Math.max(o,s.endedAt??0),0)-t;return{text:n.filter(o=>(o.endedAt??0)>=r).map(o=>Dt(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const jt=60;function ca(e,t,n=jt){const i=new Set(e),r=[...e];for(const a of t)!a||i.has(a)||(i.add(a),r.push(a));return r.slice(-n)}function ua(e){const{segments:t,now:n,state:i}=e;if(i.lastTriggerAt&&n-i.lastTriggerAt<$t)return{trigger:!1,reason:"too_soon"};const r=Gt(t,e.windowMs);if(!r.text)return{trigger:!1,reason:"no_speech"};const a=r.segmentCount-(i.lastSegmentCount??0);if(i.lastQueryTerms&&a<Kt)return{trigger:!1,reason:"too_few_new"};const o=Bt(r.text);return o.length?i.lastQueryTerms?.length&&Ft(o,i.lastQueryTerms)<Ut?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:r.text,terms:o,segmentCount:r.segmentCount}:{trigger:!1,reason:"no_speech"}}const ae=9e4,Vt=["out_of_office"],Wt=e=>Vt.includes(e);function da(e,t,n){const i=n-e<ae,r=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!r?.status)return{online:i,status:i?"available":"offline"};const a=r.status;return!i&&!Wt(a)?{online:!1,status:"offline"}:{online:i,status:a,message:r.message}}function pa(e,t){const n=t-e.lastSeenAt<ae,i=n||Wt(e.status)?e.status:"offline";return n===e.online&&i===e.status?e:{...e,online:n,status:i}}function fa(e,t){return e?.teamId&&t.includes(e.teamId)?{teamId:e.teamId,mustChoose:!1}:t.length===1?{teamId:t[0],mustChoose:!1}:{teamId:void 0,mustChoose:t.length>1}}function ma(e){return e.providerAvailable&&e.allowed}const ga="installation-id";exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=It;exports.AI_ATTACHMENT_MAX_PER_TURN=kr;exports.AI_ATTACHMENT_TURN_BUDGET=Rr;exports.AI_VENDORS=Q;exports.ALLOWED_LINK_SCHEMES=Le;exports.ARTIFACT_MAX_BLOCKS=P;exports.ARTIFACT_MAX_BODY_BYTES=_n;exports.ARTIFACT_MAX_CELL_LEN=I;exports.ARTIFACT_MAX_KPI_ITEMS=B;exports.ARTIFACT_MAX_LIST_ITEMS=$;exports.ARTIFACT_MAX_TABLE_COLUMNS=U;exports.ARTIFACT_MAX_TABLE_ROWS=K;exports.ARTIFACT_MAX_TEXT_LEN=X;exports.ASSIGNMENT_SCOPE_KIND=$e;exports.AUTH_APP_NAME=ie;exports.ActivityTypeRegistry=Ce;exports.BUILT_IN_ONLY=un;exports.CADENCE_FLOOR_MS=$t;exports.CADENCE_MIN_NEW_SEGMENTS=Kt;exports.CADENCE_MIN_NOVELTY=Ut;exports.CADENCE_WINDOW_MS=Pt;exports.CLASSIFY_VARS=Wn;exports.CORE_DIMENSIONS=gn;exports.CommunicationScheme=Rt;exports.DEFAULT_MEMORY_BUDGET=Ui;exports.DEFAULT_PHONE_REGION=At;exports.EMPTY_WORKFLOW=ei;exports.FEATURE_FOLDER_MANAGEMENT=Wr;exports.FEATURE_REMOTE_SEARCH=Hr;exports.INSTALLATION_HEADER=ga;exports.INTERACTION_KIND=Ve;exports.InteractionParticipantRole=jr;exports.KB_FALLBACK_LOCALE=Qe;exports.KB_LOCALES=j;exports.LOOSE_STATUSES=R;exports.MAX_ACTIONS=b;exports.MAX_ASSIGNMENT_TURNS=Ke;exports.MAX_BLOCKS=D;exports.MAX_COLLECTION_DEPTH=J;exports.MAX_FIELDS=_;exports.MAX_LIST_ITEMS=T;exports.MAX_MEMORY_BROWSE=Di;exports.MAX_MEMORY_BUDGET=Ki;exports.MAX_MEMORY_CHARS=Pi;exports.MAX_SHOWN_KEYS=jt;exports.MAX_TOPIC_CANDIDATES=nt;exports.MAX_TOPIC_EXAMPLES=tt;exports.MAX_TOPIC_EXAMPLE_CHARS=M;exports.MIN_MEMORY_BUDGET=$i;exports.PHONE_REGIONS=k;exports.PRESENCE_ONLINE_WINDOW_MS=ae;exports.PRESENCE_SURVIVES_OFFLINE=Vt;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Gr;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Fr;exports.PUBLIC_EMAIL_DOMAINS=St;exports.READ_STEP_TYPES=F;exports.RELATED_SUBJECT_KINDS=lt;exports.RESERVED_STATUS_KEYS=te;exports.RESOURCE_DESCRIBE_SERVICE=zr;exports.RESOURCE_RESOLVE_SERVICE=qr;exports.RESOURCE_SEARCH_SERVICE=Yr;exports.SIGNATURE_INTENTS=Ni;exports.STEP_MAX_TOKENS_MAX=Xe;exports.STEP_MAX_TOKENS_MIN=He;exports.SUMMARY_MIN_LAST_CHARS=Tt;exports.SUMMARY_MIN_MESSAGES=_t;exports.SYNC_RUN_MAX_ERRORS=aa;exports.SYNC_SOURCE_PROVIDER_GROUP=ia;exports.SYNC_TARGET_PROVIDER_GROUP=ra;exports.TERMINAL_ASSIGNMENT_STATUSES=Pe;exports.TERMINAL_RUN_STATUSES=ze;exports.TRIGGER_VARS=Vn;exports.UNSUPPORTED=Xr;exports.USAGE_DIMENSIONS=Re;exports.USAGE_DIMENSION_IDS=ke;exports.WORK_ITEM_SCOPE_KIND=dt;exports.WORK_PROJECT_SCOPE_KIND=pt;exports.acceptExampleCandidate=gi;exports.actingIdentityKey=Be;exports.activeWorkTypes=Xi;exports.activityIconOf=Jt;exports.activityJoinUrl=ln;exports.activitySnippet=Ie;exports.activityTextParams=Me;exports.activityTimelineText=sn;exports.activityTimestamp=mn;exports.activityTypeInfo=l;exports.actorKey=zn;exports.addExampleCandidate=mi;exports.agePresenceEntry=pa;exports.aiAttachmentKind=bt;exports.aiAttachmentRejection=wr;exports.aiBudgetLimit=V;exports.aiBudgetPeriodKey=bi;exports.aiBudgetPeriodStart=ot;exports.aiBudgetState=Ti;exports.aiVendorAcceptsAttachment=_i;exports.aiVendorDefaultModel=Ai;exports.aiVendorLabel=Ei;exports.aiVendorNeedsBaseUrl=Si;exports.aiVendorsWith=yi;exports.appNameFromPath=re;exports.applyRounding=Gi;exports.applySignature=Oi;exports.artifactBodyBytes=Rn;exports.artifactOutline=kn;exports.artifactToMarkdown=vn;exports.assignmentMismatch=Zn;exports.assignmentScopeKey=$n;exports.assignmentSubject=Un;exports.buildActivityPreview=pn;exports.buildChannelIntents=Dr;exports.buildShareKeys=Ln;exports.buildWindow=Gt;exports.canNestUnder=di;exports.carriesText=tn;exports.categoryLabel=fi;exports.categoryOf=gt;exports.channelKindForScheme=Br;exports.channelKindOf=Zt;exports.clampStepMaxTokens=Qn;exports.cleanMessageText=Tr;exports.compareWorkTypes=ut;exports.decideAssignmentState=Bn;exports.decideCadence=ua;exports.defaultLocaleOf=et;exports.defaultStatusKey=tr;exports.defineIntent=Vr;exports.depthOf=Je;exports.derivePresence=da;exports.disabledIntentsFromCapabilities=Lr;exports.elapsedSeconds=Fi;exports.emailDomain=dr;exports.endpointKey=gr;exports.extractParams=wt;exports.extractTerms=Bt;exports.filterByEndpoint=$r;exports.filterByIntent=Pr;exports.filterByTargetScheme=Ot;exports.findAiVendor=E;exports.flattenLocales=hn;exports.floorToPeriod=Oe;exports.formatActingIdentity=Ue;exports.formatClock=Vi;exports.formatHm=ji;exports.formatItemKey=Yi;exports.formatPeriod=Ne;exports.freshSources=vr;exports.getActivitySeenUserIds=fn;exports.getContactEndpoints=Ri;exports.getShortTitle=Li;exports.getUrgencyScore=vi;exports.heightOf=Z;exports.helpCenterText=li;exports.humanizeAction=jn;exports.interactionIdOf=We;exports.isAgentUser=zi;exports.isAssigned=ki;exports.isAssignmentTerminal=Pn;exports.isAssignmentTrigger=Ge;exports.isChatMessageActivity=zt;exports.isClosed=wi;exports.isConnectedType=an;exports.isDeepLink=Zr;exports.isDescendant=Ze;exports.isEmailActivity=Xt;exports.isInFlight=ri;exports.isInteractionUnseen=xi;exports.isLandingPath=Qr;exports.isLikelyBulk=Mr;exports.isMessageShape=H;exports.isMessageType=Qt;exports.isMoreSpecificPattern=Lt;exports.isPaused=Ye;exports.isPlaybookAuthoredType=rn;exports.isPublicEmailDomain=fr;exports.isPublicPath=na;exports.isReplyableType=en;exports.isTerminal=ii;exports.isThreadLongEnough=Cr;exports.isTranscriptType=on;exports.isWorkClosed=nr;exports.isWorkTypeVisible=Hi;exports.itemDossierKeys=Zi;exports.ladderFor=mt;exports.linkLabel=si;exports.listeningAllowed=Ii;exports.localeInstruction=ui;exports.localeName=ci;exports.localesOf=pi;exports.looksLikeEmail=cr;exports.matchContactToIntents=Kr;exports.matchPublicRoute=xt;exports.mcpCredentialScope=Mi;exports.mcpToolPrefix=Ci;exports.mergeShownKeys=ca;exports.messageCountsAs=nn;exports.needsPhoneRegion=mr;exports.normalizeArtifactBlocks=On;exports.normalizeBlocks=qt;exports.normalizeEmail=ne;exports.normalizeExample=g;exports.novelty=Ft;exports.parseActingIdentity=Hn;exports.parseItemKey=qi;exports.pathToRegex=kt;exports.periodsInRange=yn;exports.phoneSuffix=ur;exports.plainTextFromMarkdown=Ar;exports.playbookActor=Fe;exports.procedureOf=ni;exports.projectDossierKeys=Qi;exports.publicBasePathFor=vt;exports.publicRoutePatterns=ta;exports.readPath=N;exports.readStepError=G;exports.refKey=je;exports.registrableDomain=yt;exports.rejectExampleCandidate=rt;exports.relatedByDefault=Bi;exports.resolveAccountCapabilities=Nt;exports.resolveActivityText=O;exports.resolveChannelIntents=Ct;exports.resolveSignature=st;exports.resolveWorkMode=fa;exports.resourceKindOf=Jr;exports.runActor=Xn;exports.runInteractionId=oi;exports.sanitizeInline=De;exports.sanitizeTranscript=Dt;exports.selectLenses=Gn;exports.shareKeyForTeam=Y;exports.shareKeyForUser=z;exports.shareKeysForViewer=xn;exports.shouldRunAudioPipeline=ma;exports.sortStatuses=ht;exports.sourceKey=Mt;exports.statusIn=er;exports.stepsOf=ti;exports.stripHtml=be;exports.subjectKeyOf=ai;exports.subjectOf=q;exports.suggestProjectKey=Ji;exports.targetById=Jn;exports.targetForActivityType=qn;exports.toE164=W;exports.toolSourceKinds=Dn;exports.topicOfferedForTeam=at;exports.topicsForTeam=hi;exports.truncateExample=it;exports.uniqueWorkStatusKey=ir;exports.uniqueWorkTypeKey=Wi;exports.usageMetricId=we;exports.usageMetrics=Sn;exports.validateStatuses=rr;exports.valueAtPath=Yn;exports.wakesAssignment=Kn;exports.workItemScopeKey=ft;exports.workProjectScopeKey=ee;exports.workStatusKey=Et;exports.workTypeKey=ct;
|
|
18
|
+
`).trim()}function Tr(e){if(typeof e!="string"||!e)return"";let t=e.length;for(const a of yr){const o=e.search(a);o>=0&&o<t&&(t=o)}const n=e.slice(0,t);let i=Te(_e(ye(n)));return i||(i=Te(_e(ye(e)))),_r(i)||i}const br=/(^|[._+-])(no-?reply|noreply|donotreply|do-not-reply|newsletter|nieuwsbrief|mailer|mailing|notifications?|bounce|postmaster|marketing)@/i,Ir=/\b(unsubscribe|afmelden|uitschrijven|opt[\s-]?out|manage (your )?preferences|geen (e-?mails?|nieuwsbrief|berichten) meer)\b/i;function Mr(e,t){return!!(e&&br.test(e)||t&&Ir.test(t))}const _t=3,Tt=600;function Cr(e,t){return e>=_t||t>=Tt}const Nr=new Set(["image/png","image/jpeg","image/jpg","image/gif","image/webp"]),Or=new Set(["text/plain","text/markdown","text/csv","application/json","text/html","application/xml","text/xml"]);function bt(e){const t=(e??"").trim().toLowerCase().split(";")[0];return t?Nr.has(t)?"image":t==="application/pdf"?"pdf":Or.has(t)?"text":t.startsWith("audio/")?"audio":"unsupported":"unsupported"}const h=1024*1024,It={image:5*h,pdf:20*h,text:1*h,audio:20*h},Rr=25*h,kr=5;function vr(e,t){const n=bt(e);return n==="unsupported"?"unsupported":t>It[n]?"too-large":null}function Mt(e){return`${e.kind}:${e.id||e.url||e.title}`}function wr(e,t=[]){const n=new Set(t),i=[],r=[];for(const a of e){const o=Mt(a);n.has(o)||(n.add(o),i.push(a),r.push(o))}return{sources:i,keys:r}}function Lr(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&e.canHold(t.providerId))}function xr(e){return e.sessions.filter(t=>t.id!==e.exceptSessionId&&t.state==="connected"&&!e.canHold(t.providerId))}function Dr(e){return e.sessions.some(n=>n.id!==e.exceptSessionId&&(n.state==="connected"||n.state==="on_hold"))?{admit:!1,reason:"busy"}:{admit:!0}}function Ct(e,t){const n=new Set(e.disabledIntents??[]),i=e.intentOverrides??{},r=t.intents.filter(o=>!n.has(o.intent)).map(o=>$r(o,i[o.intent]));if(!e.extraIntents||e.extraIntents.length===0)return r;const a=new Set(r.map(o=>o.intent));for(const o of e.extraIntents)a.has(o.intent)||(r.push(o),a.add(o.intent));return r}function Nt(e,t){const n={};for(const i of e.intents){if(!i.togglable)continue;const r=t?.[i.intent];n[i.intent]=r??i.defaultEnabled??!0}return n}function Pr(e,t){const n=Nt(e,t);return Object.entries(n).filter(([,i])=>!i).map(([i])=>i)}function $r(e,t){return t?{intent:t.intent??e.intent,targetSchemes:t.targetSchemes??e.targetSchemes,transport:t.transport??e.transport}:e}function Kr(e,t){const n=[];for(const i of e){if(!i.enabled)continue;const r=t[i.providerId];if(r)for(const a of Ct(i,r))n.push({channel:i,description:r,capability:a})}return n}function Ur(e,t){return t.filter(n=>n.capability.intent===e)}function Ot(e,t){return t.filter(n=>n.capability.targetSchemes.includes(e))}function Br(e,t){return Ot(e.scheme,t)}function Fr(e,t,n){const i=[];for(const r of e)for(const a of n)a.capability.intent===t&&a.capability.targetSchemes.includes(r.scheme)&&i.push({channelIntent:a,endpoint:r});return i}var Rt=(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))(Rt||{});const Gr={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 jr(e){return e?Gr[e]??"note":"note"}const Vr="message_window",Hr="message_templates",Wr={FROM:"from",TO:"to",CC:"cc",BCC:"bcc",ORGANIZER:"organizer",PRESENTER:"presenter",ATTENDEE:"attendee",OWNER:"owner",MEMBER:"member",GUEST:"guest",HOST:"host",PARTICIPANT:"participant"},Xr=(e,t)=>({intent:e,...t}),zr="folder_management",Yr="remote_search",qr={ok:!1,code:"UNSUPPORTED",message:"Provider does not support this op"},Jr="resources.describe",Zr="resources.search",Qr="resources.resolve";function ea(e){const t=e.indexOf(":");return t===-1?e:e.slice(0,t)}const ie="auth";function re(e){const t=typeof e=="string"?e.match(/apps\/([^/?#]+)/):null;return t?t[1]:null}function ta(e){const t=re(e);return t?t!==ie:typeof e=="string"&&e.startsWith("/wake")}function na(e){return typeof e!="string"||e===""||e==="/"?!0:re(e)===ie}function ia(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kt(e){const n=e.split("/").filter(Boolean).map(i=>i.startsWith(":")?i.endsWith("?")?"(?:/[^/]+)?":"/[^/]+":"/"+ia(i)).join("");return new RegExp(`^${n}\\/?$`)}function vt(e,t){const n=e.split("/").filter(Boolean),i=t.split("/").filter(Boolean),r={};return n.forEach((a,o)=>{if(a.startsWith(":")){const s=a.endsWith("?")?a.slice(1,-1):a.slice(1),c=i[o];c&&(r[s]=c)}}),r}function wt(e){return e.publicBasePath??`/apps/${e.name}`}function ra(e){const t=[];for(const n of e){if(!n?.name)continue;const i=wt(n);for(const r of n.routes??[]){if(!r.public)continue;const a=r.path==="/"?"":r.path;t.push({appName:n.name,resource:r.resource,pattern:`${i}${a}`,props:r.props})}}return t}function Lt(e,t){const n=e.split("/").filter(Boolean),i=t.split("/").filter(Boolean);for(let r=0;r<Math.min(n.length,i.length);r++){const a=n[r].startsWith(":"),o=i[r].startsWith(":");if(a!==o)return o}return n.length>i.length}function xt(e,t){if(typeof e!="string")return null;let n=null;for(const i of t)kt(i.pattern).test(e)&&(!n||Lt(i.pattern,n.pattern))&&(n=i);return n?{...n,params:{...n.props,...vt(n.pattern,e)}}:null}function aa(e,t){return xt(e,t)!==null}const oa="sync-source",sa="sync-target",la=20,ca={afrikaans:["[Muziek]","(C) TV GELDERLAND 2021","*Thomp thomp thomp*","www.youtube.com","ä n wood s","!.."],english:["[applause]","[APPLAUSE]","(claps)","(clapping)","(audience applauds)","(keyboard clicking)","(keyboard clacking)","(clicking)","[CLICK]","[BLANK_AUDIO]","(upbeat music)","(dramatic music)","[music playing]","(electronic music)","(audience cheering)","(audience cheers)","[MUSIC]","( ( ( ( ) ( ) ( ) ( )","(laughs)","(air whooshing)","<u>Transcribed</u> by https://otter.ai","All new tonight at 6... coming up. A new look at your forecast is A new look at your forecast is","www.mooji.org","KATHRYN A new forecast is coming up... A new forecast is coming up...","KATHRYN pandemic started. increasing since the The pandemic has been","A new look at your forecast this morning... A new look at your","We'll be right back.","We'll see you next week.","Thanks for watching!","❤️ Translated by Amara.org Communit"],flemish:["*clap*","TV GELDERLAND 2020","TV Gelderland 2021","(C) TV GELDERLAND 2021","[Muziek]","Kuman","Ondertitels ingediend door de Amara.org gemeenschap","Ondertiteld door de Amara.org gemeenschap","Dank u wel voor het kijken.","Ondertiteling door de Amara.org gemeenschap","GELUID VAN MAHIH U similarly"],french:["(applaudissements)","[Applaudissements]","Sous-titres réalisés par la communauté d'Amara.org","- Bonne journée. - Bonjour.","POP POP הי","Merci d'avoir regardé cette vidéo.","Merci d'avoir regardé cette vidéo!","Merci d'avoir regardé la vidéo.","J'espère que vous avez apprécié la vidéo.","Je vous remercie de vous abonner","Merci d'avoir regardé!","❤️ par SousTitreur.com","— Sous-titrage ST'501 —","Thanks for watching!","Sous-titres réalisés par l'Amara.org","Sous-titres réalisés para la communauté d'Amara.org","Sous-titres réalisés par la communauté d'Amara.org","Sous-titres fait par Sous-titres par Amara.org","Sous-titres réalisés par les SousTitres d'Amara.org","Sous-titres par Amara.org","Sous-titres par la communauté d'Amara.org","Sous-titres réalisés pour la communauté d'Amara.org","Sous-titres réalisés par la communauté de l'Amara.org","Sous-Titres faits par la communauté d'Amara.org","Sous-titres par l'Amara.org","Sous-titres fait par la communauté d'Amara.org","Sous-titrage ST' 501","Sous-titrage ST'501","Cliquez-vous sur les sous-titres et abonnez-vous à la chaîne d'Amara.org","❤️ par SousTitreur.com"],german:["[Klicken]","(Jubel)","*lacht*","[Anhaltender Beifall]","[Applaus]","(Applaus)","* Applaus *","[MUSIK]","* mustard ml Drumglöck und knack in einem Handbewerb *","Untertitelung aufgrund der Amara.org-Community","Untertitel im Auftrag des ZDF für funk, 2017","Untertitel von Stephanie Geiges","Untertitel der Amara.org-Community","Untertitel im Auftrag des ZDF, 2017","Untertitel im Auftrag des ZDF, 2020","Untertitel im Auftrag des ZDF, 2018","Untertitel im Auftrag des ZDF, 2021","Untertitelung im Auftrag des ZDF, 2021","Copyright WDR 2021","Copyright WDR 2020","Copyright WDR 2019","SWR 2021","SWR 2020"],italian:["Alla prossima!","*applauso*","[Musica]","[Musica]","[Applausi]","*Bip bip bip bip*","(musica del NS shore)","D' 1962 alle tribunte del Gulf","Sottotitoli creati dalla comunità Amara.org","Sottotitoli di Sottotitoli di Amara.org","Sottotitoli e revisione al canale di Amara.org","Sottotitoli e revisione a cura di Amara.org","Sottotitoli e revisione a cura di QTSS","Sottotitoli e revisione a cura di QTSS.","Sottotitoli a cura di QTSS","Sottotitoli a cura di Sottotitoli"],spanish:["[música]","[Música de cierre]","[Aplausos]","(Aplausos)","www.alimmenta.com","¡Gracias por ver el vídeo!","(sonidos del celular) (Inudible distorsión)","¡Suscríbete!","Subtítulos realizados por la comunidad de Amara.org","Subtitulado por la comunidad de Amara.org","Subtítulos por la comunidad de Amara.org","Subtítulos creados por la comunidad de Amara.org","Subtítulos en español de Amara.org","Subtítulos hechos por la comunidad de Amara.org","Subtitulos por la comunidad de Amara.org","Más información www.alimmenta.com","www.mooji.org","[MÚSICA]","[Music cuts in British]"]},Dt=e=>{let t=e;return Object.values(ca).forEach(n=>{n.forEach(i=>{t=t.replaceAll(i,"")})}),t=t.replace(/\(.*?\)/g,""),t=t.replace(/\[.*?\]/g,""),t},Pt=6e4,$t=8e3,Kt=2,Ut=.4,ua=3,da=new Set(["aan","als","ben","bent","bij","dan","dat","deze","die","dit","doen","door","dus","echt","een","eens","even","gaan","gaat","geen","geweest","goed","graag","had","heb","hebben","hebt","heeft","het","hier","hoe","hoor","iets","inderdaad","kan","klopt","kunnen","kunt","maar","mag","mee","meer","met","mij","mijn","misschien","moet","moeten","naar","net","niet","nog","nou","oke","ook","over","prima","toch","uhm","uit","van","veel","voor","wat","weer","weet","wel","wij","wil","wilt","worden","wordt","zeg","zeggen","zijn","zou","zult","about","and","are","been","but","can","does","for","have","just","know","like","not","okay","right","she","that","the","them","then","there","they","this","want","was","well","were","what","will","with","would","yeah","you","your"]);function Bt(e){const t=new Set;for(const n of e.toLowerCase().split(/[^a-z0-9À-ɏ]+/))n.length<ua||da.has(n)||t.add(n);return[...t]}function Ft(e,t){if(!e.length)return 0;if(!t.length)return 1;const n=new Set(t),i=new Set(e);let r=0;for(const a of i)n.has(a)||(r+=1);return r/i.size}function Gt(e,t=Pt){const n=e.filter(o=>!o.partial&&typeof o.text=="string");if(!n.length)return{text:"",segmentCount:0};const r=n.reduce((o,s)=>Math.max(o,s.endedAt??0),0)-t;return{text:n.filter(o=>(o.endedAt??0)>=r).map(o=>Dt(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim(),segmentCount:n.length}}const jt=60;function pa(e,t,n=jt){const i=new Set(e),r=[...e];for(const a of t)!a||i.has(a)||(i.add(a),r.push(a));return r.slice(-n)}function fa(e){const{segments:t,now:n,state:i}=e;if(i.lastTriggerAt&&n-i.lastTriggerAt<$t)return{trigger:!1,reason:"too_soon"};const r=Gt(t,e.windowMs);if(!r.text)return{trigger:!1,reason:"no_speech"};const a=r.segmentCount-(i.lastSegmentCount??0);if(i.lastQueryTerms&&a<Kt)return{trigger:!1,reason:"too_few_new"};const o=Bt(r.text);return o.length?i.lastQueryTerms?.length&&Ft(o,i.lastQueryTerms)<Ut?{trigger:!1,reason:"same_topic"}:{trigger:!0,text:r.text,terms:o,segmentCount:r.segmentCount}:{trigger:!1,reason:"no_speech"}}const ae=9e4,Vt=["out_of_office"],Ht=e=>Vt.includes(e);function ma(e,t,n){const i=n-e<ae,r=t?.status&&(!t.expiresAt||t.expiresAt>n)?t:void 0;if(!r?.status)return{online:i,status:i?"available":"offline"};const a=r.status;return!i&&!Ht(a)?{online:!1,status:"offline"}:{online:i,status:a,message:r.message}}function ga(e,t){const n=t-e.lastSeenAt<ae,i=n||Ht(e.status)?e.status:"offline";return n===e.online&&i===e.status?e:{...e,online:n,status:i}}function ha(e,t){return e?.teamId&&t.includes(e.teamId)?{teamId:e.teamId,mustChoose:!1}:t.length===1?{teamId:t[0],mustChoose:!1}:{teamId:void 0,mustChoose:t.length>1}}function Ea(e){return e.providerAvailable&&e.allowed}const Aa="installation-id";exports.ACTIVITY_CATALOG=m;exports.AI_ATTACHMENT_LIMITS=It;exports.AI_ATTACHMENT_MAX_PER_TURN=kr;exports.AI_ATTACHMENT_TURN_BUDGET=Rr;exports.AI_VENDORS=Q;exports.ALLOWED_LINK_SCHEMES=Le;exports.ARTIFACT_MAX_BLOCKS=P;exports.ARTIFACT_MAX_BODY_BYTES=_n;exports.ARTIFACT_MAX_CELL_LEN=I;exports.ARTIFACT_MAX_KPI_ITEMS=B;exports.ARTIFACT_MAX_LIST_ITEMS=$;exports.ARTIFACT_MAX_TABLE_COLUMNS=U;exports.ARTIFACT_MAX_TABLE_ROWS=K;exports.ARTIFACT_MAX_TEXT_LEN=X;exports.ASSIGNMENT_SCOPE_KIND=$e;exports.AUTH_APP_NAME=ie;exports.ActivityTypeRegistry=Ce;exports.BUILT_IN_ONLY=un;exports.CADENCE_FLOOR_MS=$t;exports.CADENCE_MIN_NEW_SEGMENTS=Kt;exports.CADENCE_MIN_NOVELTY=Ut;exports.CADENCE_WINDOW_MS=Pt;exports.CLASSIFY_VARS=Hn;exports.CORE_DIMENSIONS=gn;exports.CommunicationScheme=Rt;exports.DEFAULT_MEMORY_BUDGET=Ui;exports.DEFAULT_PHONE_REGION=At;exports.EMPTY_WORKFLOW=ei;exports.FEATURE_FOLDER_MANAGEMENT=zr;exports.FEATURE_REMOTE_SEARCH=Yr;exports.INSTALLATION_HEADER=Aa;exports.INTERACTION_KIND=Ve;exports.InteractionParticipantRole=Wr;exports.KB_FALLBACK_LOCALE=Qe;exports.KB_LOCALES=j;exports.LOOSE_STATUSES=R;exports.MAX_ACTIONS=b;exports.MAX_ASSIGNMENT_TURNS=Ke;exports.MAX_BLOCKS=D;exports.MAX_COLLECTION_DEPTH=J;exports.MAX_FIELDS=_;exports.MAX_LIST_ITEMS=T;exports.MAX_MEMORY_BROWSE=Di;exports.MAX_MEMORY_BUDGET=Ki;exports.MAX_MEMORY_CHARS=Pi;exports.MAX_SHOWN_KEYS=jt;exports.MAX_TOPIC_CANDIDATES=nt;exports.MAX_TOPIC_EXAMPLES=tt;exports.MAX_TOPIC_EXAMPLE_CHARS=M;exports.MIN_MEMORY_BUDGET=$i;exports.PHONE_REGIONS=k;exports.PRESENCE_ONLINE_WINDOW_MS=ae;exports.PRESENCE_SURVIVES_OFFLINE=Vt;exports.PROVIDER_FEATURE_MESSAGE_TEMPLATES=Hr;exports.PROVIDER_FEATURE_MESSAGE_WINDOW=Vr;exports.PUBLIC_EMAIL_DOMAINS=St;exports.READ_STEP_TYPES=F;exports.RELATED_SUBJECT_KINDS=lt;exports.RESERVED_STATUS_KEYS=te;exports.RESOURCE_DESCRIBE_SERVICE=Jr;exports.RESOURCE_RESOLVE_SERVICE=Qr;exports.RESOURCE_SEARCH_SERVICE=Zr;exports.SIGNATURE_INTENTS=Ni;exports.STEP_MAX_TOKENS_MAX=Xe;exports.STEP_MAX_TOKENS_MIN=We;exports.SUMMARY_MIN_LAST_CHARS=Tt;exports.SUMMARY_MIN_MESSAGES=_t;exports.SYNC_RUN_MAX_ERRORS=la;exports.SYNC_SOURCE_PROVIDER_GROUP=oa;exports.SYNC_TARGET_PROVIDER_GROUP=sa;exports.TERMINAL_ASSIGNMENT_STATUSES=Pe;exports.TERMINAL_RUN_STATUSES=ze;exports.TRIGGER_VARS=Vn;exports.UNSUPPORTED=qr;exports.USAGE_DIMENSIONS=Re;exports.USAGE_DIMENSION_IDS=ke;exports.WORK_ITEM_SCOPE_KIND=dt;exports.WORK_PROJECT_SCOPE_KIND=pt;exports.acceptExampleCandidate=gi;exports.actingIdentityKey=Be;exports.activeWorkTypes=Xi;exports.activityIconOf=Jt;exports.activityJoinUrl=ln;exports.activitySnippet=Ie;exports.activityTextParams=Me;exports.activityTimelineText=sn;exports.activityTimestamp=mn;exports.activityTypeInfo=l;exports.actorKey=zn;exports.addExampleCandidate=mi;exports.agePresenceEntry=ga;exports.aiAttachmentKind=bt;exports.aiAttachmentRejection=vr;exports.aiBudgetLimit=V;exports.aiBudgetPeriodKey=bi;exports.aiBudgetPeriodStart=ot;exports.aiBudgetState=Ti;exports.aiVendorAcceptsAttachment=_i;exports.aiVendorDefaultModel=Ai;exports.aiVendorLabel=Ei;exports.aiVendorNeedsBaseUrl=Si;exports.aiVendorsWith=yi;exports.appNameFromPath=re;exports.applyRounding=Gi;exports.applySignature=Oi;exports.artifactBodyBytes=Rn;exports.artifactOutline=kn;exports.artifactToMarkdown=wn;exports.assignmentMismatch=Zn;exports.assignmentScopeKey=$n;exports.assignmentSubject=Un;exports.buildActivityPreview=pn;exports.buildChannelIntents=Kr;exports.buildShareKeys=Ln;exports.buildWindow=Gt;exports.canNestUnder=di;exports.carriesText=tn;exports.categoryLabel=fi;exports.categoryOf=gt;exports.channelKindForScheme=jr;exports.channelKindOf=Zt;exports.clampStepMaxTokens=Qn;exports.cleanMessageText=Tr;exports.compareWorkTypes=ut;exports.decideAssignmentState=Bn;exports.decideCadence=fa;exports.decideIncomingCall=Dr;exports.defaultLocaleOf=et;exports.defaultStatusKey=tr;exports.defineIntent=Xr;exports.depthOf=Je;exports.derivePresence=ma;exports.disabledIntentsFromCapabilities=Pr;exports.elapsedSeconds=Fi;exports.emailDomain=dr;exports.endpointKey=gr;exports.extractParams=vt;exports.extractTerms=Bt;exports.filterByEndpoint=Br;exports.filterByIntent=Ur;exports.filterByTargetScheme=Ot;exports.findAiVendor=E;exports.flattenLocales=hn;exports.floorToPeriod=Oe;exports.formatActingIdentity=Ue;exports.formatClock=Vi;exports.formatHm=ji;exports.formatItemKey=Yi;exports.formatPeriod=Ne;exports.freshSources=wr;exports.getActivitySeenUserIds=fn;exports.getContactEndpoints=Ri;exports.getShortTitle=Li;exports.getUrgencyScore=wi;exports.heightOf=Z;exports.helpCenterText=li;exports.humanizeAction=jn;exports.interactionIdOf=He;exports.isAgentUser=zi;exports.isAssigned=ki;exports.isAssignmentTerminal=Pn;exports.isAssignmentTrigger=Ge;exports.isChatMessageActivity=zt;exports.isClosed=vi;exports.isConnectedType=an;exports.isDeepLink=ta;exports.isDescendant=Ze;exports.isEmailActivity=Xt;exports.isInFlight=ri;exports.isInteractionUnseen=xi;exports.isLandingPath=na;exports.isLikelyBulk=Mr;exports.isMessageShape=W;exports.isMessageType=Qt;exports.isMoreSpecificPattern=Lt;exports.isPaused=Ye;exports.isPlaybookAuthoredType=rn;exports.isPublicEmailDomain=fr;exports.isPublicPath=aa;exports.isReplyableType=en;exports.isTerminal=ii;exports.isThreadLongEnough=Cr;exports.isTranscriptType=on;exports.isWorkClosed=nr;exports.isWorkTypeVisible=Wi;exports.itemDossierKeys=Zi;exports.ladderFor=mt;exports.linkLabel=si;exports.listeningAllowed=Ii;exports.localeInstruction=ui;exports.localeName=ci;exports.localesOf=pi;exports.looksLikeEmail=cr;exports.matchContactToIntents=Fr;exports.matchPublicRoute=xt;exports.mcpCredentialScope=Mi;exports.mcpToolPrefix=Ci;exports.mergeShownKeys=pa;exports.messageCountsAs=nn;exports.needsPhoneRegion=mr;exports.normalizeArtifactBlocks=On;exports.normalizeBlocks=qt;exports.normalizeEmail=ne;exports.normalizeExample=g;exports.novelty=Ft;exports.parseActingIdentity=Wn;exports.parseItemKey=qi;exports.pathToRegex=kt;exports.periodsInRange=yn;exports.phoneSuffix=ur;exports.plainTextFromMarkdown=Ar;exports.playbookActor=Fe;exports.procedureOf=ni;exports.projectDossierKeys=Qi;exports.publicBasePathFor=wt;exports.publicRoutePatterns=ra;exports.readPath=N;exports.readStepError=G;exports.refKey=je;exports.registrableDomain=yt;exports.rejectExampleCandidate=rt;exports.relatedByDefault=Bi;exports.resolveAccountCapabilities=Nt;exports.resolveActivityText=O;exports.resolveChannelIntents=Ct;exports.resolveSignature=st;exports.resolveWorkMode=ha;exports.resourceKindOf=ea;exports.runActor=Xn;exports.runInteractionId=oi;exports.sanitizeInline=De;exports.sanitizeTranscript=Dt;exports.selectLenses=Gn;exports.sessionsHoldCannotReach=xr;exports.sessionsToHold=Lr;exports.shareKeyForTeam=Y;exports.shareKeyForUser=z;exports.shareKeysForViewer=xn;exports.shouldRunAudioPipeline=Ea;exports.sortStatuses=ht;exports.sourceKey=Mt;exports.statusIn=er;exports.stepsOf=ti;exports.stripHtml=be;exports.subjectKeyOf=ai;exports.subjectOf=q;exports.suggestProjectKey=Ji;exports.targetById=Jn;exports.targetForActivityType=qn;exports.toE164=H;exports.toolSourceKinds=Dn;exports.topicOfferedForTeam=at;exports.topicsForTeam=hi;exports.truncateExample=it;exports.uniqueWorkStatusKey=ir;exports.uniqueWorkTypeKey=Hi;exports.usageMetricId=ve;exports.usageMetrics=Sn;exports.validateStatuses=rr;exports.valueAtPath=Yn;exports.wakesAssignment=Kn;exports.workItemScopeKey=ft;exports.workProjectScopeKey=ee;exports.workStatusKey=Et;exports.workTypeKey=ct;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export * from './entities/team';
|
|
|
34
34
|
export * from './entities/time-entry';
|
|
35
35
|
export * from './entities/organization';
|
|
36
36
|
export * from './entities/shopify';
|
|
37
|
-
export * from './entities/transcript';
|
|
38
37
|
export * from './entities/external-identity';
|
|
39
38
|
export * from './entities/user';
|
|
40
39
|
export * from './entities/webhook';
|
|
@@ -49,6 +48,7 @@ export * from './platform/ai-tools';
|
|
|
49
48
|
export * from './platform/api';
|
|
50
49
|
export * from './platform/author';
|
|
51
50
|
export * from './platform/common';
|
|
51
|
+
export * from './platform/call-lines';
|
|
52
52
|
export * from './platform/capabilities';
|
|
53
53
|
export * from './platform/context';
|
|
54
54
|
export * from './platform/communication';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function kn(e) {
|
|
2
2
|
return e.type === "EMAIL_RECEIVED" || e.type === "EMAIL_SENT";
|
|
3
3
|
}
|
|
4
4
|
function wn(e) {
|
|
@@ -14,7 +14,7 @@ const L = 10, T = 10, I = 10, M = 5, we = /* @__PURE__ */ new Set([
|
|
|
14
14
|
"actions",
|
|
15
15
|
"attachments"
|
|
16
16
|
]);
|
|
17
|
-
function
|
|
17
|
+
function C(e) {
|
|
18
18
|
if (typeof e == "string") return e.length > 0;
|
|
19
19
|
if (!e || typeof e != "object") return !1;
|
|
20
20
|
const t = e;
|
|
@@ -37,13 +37,13 @@ function Nn(e, t = () => {
|
|
|
37
37
|
}
|
|
38
38
|
switch (i.type) {
|
|
39
39
|
case "header":
|
|
40
|
-
if (!
|
|
40
|
+
if (!C(i.text)) {
|
|
41
41
|
t("a header without text");
|
|
42
42
|
continue;
|
|
43
43
|
}
|
|
44
44
|
break;
|
|
45
45
|
case "context":
|
|
46
|
-
if (!
|
|
46
|
+
if (!C(i.text)) {
|
|
47
47
|
t("a context block without text");
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
@@ -65,7 +65,7 @@ function Nn(e, t = () => {
|
|
|
65
65
|
i.items.length > I && (t("more than " + I + " list items"), i.items = i.items.slice(0, I));
|
|
66
66
|
break;
|
|
67
67
|
case "actions": {
|
|
68
|
-
const a = Array.isArray(i.elements) ? i.elements : [], o = a.filter((s) => s && s.action_id && s.invoke &&
|
|
68
|
+
const a = Array.isArray(i.elements) ? i.elements : [], o = a.filter((s) => s && s.action_id && s.invoke && C(s.text));
|
|
69
69
|
if (o.length !== a.length && t("an action without action_id, invoke or text"), o.length === 0) continue;
|
|
70
70
|
o.length > M && t("more than " + M + " actions"), i.elements = o.slice(0, M);
|
|
71
71
|
break;
|
|
@@ -86,7 +86,7 @@ function A(e) {
|
|
|
86
86
|
function D(e) {
|
|
87
87
|
return e ? ` — ${Math.floor(e / 60)}m ${e % 60}s` : "";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function k(e) {
|
|
90
90
|
return e?.split("@")?.[0] || e || "";
|
|
91
91
|
}
|
|
92
92
|
function b(e) {
|
|
@@ -102,7 +102,7 @@ const m = {
|
|
|
102
102
|
channelKind: "voice",
|
|
103
103
|
icon: "phone",
|
|
104
104
|
snippet: () => "Gesprek gestart",
|
|
105
|
-
timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${
|
|
105
|
+
timeline: (e) => e.direction === "inbound" ? `Inbound call started — ${k(e.payload.from)}` : `Outbound call started — ${k(e.payload.to)}`
|
|
106
106
|
},
|
|
107
107
|
VOICE_CALL_ANSWERED: {
|
|
108
108
|
shape: "event",
|
|
@@ -137,7 +137,7 @@ const m = {
|
|
|
137
137
|
channelKind: "voice",
|
|
138
138
|
icon: "phone",
|
|
139
139
|
snippet: () => "Gemiste oproep",
|
|
140
|
-
timeline: (e) => `Missed call — ${
|
|
140
|
+
timeline: (e) => `Missed call — ${k(e.payload.from)}`
|
|
141
141
|
},
|
|
142
142
|
VOICE_CALL_FAILED: {
|
|
143
143
|
shape: "event",
|
|
@@ -423,13 +423,13 @@ function d(e) {
|
|
|
423
423
|
function vn(e) {
|
|
424
424
|
return d(e)?.icon ?? "circle";
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function xn(e) {
|
|
427
427
|
return d(e)?.channelKind;
|
|
428
428
|
}
|
|
429
429
|
function ce(e) {
|
|
430
430
|
return e === "message" || e === "note";
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function On(e) {
|
|
433
433
|
return ce(d(e)?.shape);
|
|
434
434
|
}
|
|
435
435
|
function $n(e) {
|
|
@@ -463,7 +463,7 @@ function jn(e) {
|
|
|
463
463
|
const t = d(e.type)?.joinUrl;
|
|
464
464
|
return t ? t(e) : void 0;
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function x(e, t) {
|
|
467
467
|
let n = e;
|
|
468
468
|
for (const r of t.split(".")) {
|
|
469
469
|
if (n == null || typeof n != "object") return "";
|
|
@@ -471,25 +471,25 @@ function O(e, t) {
|
|
|
471
471
|
}
|
|
472
472
|
return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : "";
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function O(e, t, n) {
|
|
475
475
|
if (e === void 0) return null;
|
|
476
476
|
if (typeof e == "string") return e || null;
|
|
477
477
|
if ("value" in e)
|
|
478
|
-
return
|
|
478
|
+
return x(t, e.value) || null;
|
|
479
479
|
const r = {};
|
|
480
480
|
for (const [a, o] of Object.entries(e.params ?? {}))
|
|
481
|
-
r[a] =
|
|
481
|
+
r[a] = x(t, o);
|
|
482
482
|
const i = n(e.key, r);
|
|
483
483
|
return i === e.key ? null : i;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function xe(e, t) {
|
|
486
486
|
if (!e || typeof e == "string" || "value" in e) return null;
|
|
487
487
|
const n = {};
|
|
488
488
|
for (const [r, i] of Object.entries(e.params ?? {}))
|
|
489
|
-
n[r] =
|
|
489
|
+
n[r] = x(t, i);
|
|
490
490
|
return { key: e.key, params: n };
|
|
491
491
|
}
|
|
492
|
-
const
|
|
492
|
+
const Oe = (e) => e;
|
|
493
493
|
function U(e) {
|
|
494
494
|
const t = m[e];
|
|
495
495
|
return {
|
|
@@ -522,7 +522,7 @@ function j(e) {
|
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
524
|
class $e {
|
|
525
|
-
constructor(t = [], n =
|
|
525
|
+
constructor(t = [], n = Oe) {
|
|
526
526
|
this.translate = n;
|
|
527
527
|
for (const r of t)
|
|
528
528
|
r?.type && (r.type in m || this.declared.has(r.type) || this.declared.set(r.type, r));
|
|
@@ -547,14 +547,14 @@ class $e {
|
|
|
547
547
|
const r = m[t.type];
|
|
548
548
|
if (r?.timeline) return r.timeline(t, n);
|
|
549
549
|
const i = this.declared.get(t.type);
|
|
550
|
-
return
|
|
550
|
+
return O(i?.text, t, this.translate) ?? t.type.replace(/_/g, " ").toLowerCase();
|
|
551
551
|
}
|
|
552
552
|
/** De regel voor de inboxlijst. Leeg wanneer het type niets te tonen heeft. */
|
|
553
553
|
snippet(t) {
|
|
554
554
|
const n = m[t.type];
|
|
555
555
|
if (n?.snippet) return n.snippet(t);
|
|
556
556
|
const r = this.declared.get(t.type);
|
|
557
|
-
return
|
|
557
|
+
return O(r?.text, t, this.translate) ?? "";
|
|
558
558
|
}
|
|
559
559
|
/** De descriptor zoals hij binnenkwam; nodig om `text` als sleutel op te slaan. */
|
|
560
560
|
descriptor(t) {
|
|
@@ -613,7 +613,7 @@ function Re(e) {
|
|
|
613
613
|
return t.length <= G ? t : t.slice(0, G - 1).trimEnd() + "…";
|
|
614
614
|
}
|
|
615
615
|
function Bn(e, t) {
|
|
616
|
-
const n =
|
|
616
|
+
const n = xe(t?.text, e), r = t ? O(t.text, e, (i) => i) : null;
|
|
617
617
|
return {
|
|
618
618
|
activityId: e.id,
|
|
619
619
|
type: e.type,
|
|
@@ -859,7 +859,7 @@ function qn(e, t = () => {
|
|
|
859
859
|
}
|
|
860
860
|
const y = Array.isArray(c) ? c : [];
|
|
861
861
|
p.push(
|
|
862
|
-
s.map((_,
|
|
862
|
+
s.map((_, ke) => u(y[ke], N))
|
|
863
863
|
);
|
|
864
864
|
}
|
|
865
865
|
const f = u(i.caption, N);
|
|
@@ -1205,10 +1205,10 @@ function Mr(e) {
|
|
|
1205
1205
|
const t = ge(e);
|
|
1206
1206
|
return t ? at(t) : void 0;
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function Cr(e) {
|
|
1209
1209
|
return st(ge(e));
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function kr(e, t) {
|
|
1212
1212
|
const n = e.labels ?? [];
|
|
1213
1213
|
return n.find((r) => r.locale === t)?.label ?? n[0]?.label ?? e.url;
|
|
1214
1214
|
}
|
|
@@ -1252,7 +1252,7 @@ function pt(e, t) {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
return r;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function xr(e, t, n) {
|
|
1256
1256
|
if (!e) return !0;
|
|
1257
1257
|
if (e === t) return !1;
|
|
1258
1258
|
const r = new Map(n.map((o) => [o.id, o]));
|
|
@@ -1280,7 +1280,7 @@ const mt = "en";
|
|
|
1280
1280
|
function gt(e) {
|
|
1281
1281
|
return e.defaultLocale || e.locale || mt;
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function Or(e) {
|
|
1284
1284
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
1285
1285
|
for (const r of [gt(e), ...e.locales ?? []])
|
|
1286
1286
|
!r || t.has(r) || (t.add(r), n.push(r));
|
|
@@ -1538,12 +1538,12 @@ function Mt(e, t) {
|
|
|
1538
1538
|
function mi(e) {
|
|
1539
1539
|
return e.type === "agent";
|
|
1540
1540
|
}
|
|
1541
|
-
const
|
|
1541
|
+
const Ct = "work_item", kt = "work_project";
|
|
1542
1542
|
function wt(e) {
|
|
1543
|
-
return `${
|
|
1543
|
+
return `${Ct}:${e}`;
|
|
1544
1544
|
}
|
|
1545
1545
|
function Ee(e) {
|
|
1546
|
-
return `${
|
|
1546
|
+
return `${kt}:${e}`;
|
|
1547
1547
|
}
|
|
1548
1548
|
function gi(e, t, n) {
|
|
1549
1549
|
const r = `${e}-${t}`;
|
|
@@ -1586,9 +1586,9 @@ function Ei(e, t) {
|
|
|
1586
1586
|
}
|
|
1587
1587
|
function Si(e) {
|
|
1588
1588
|
const t = Nt(e), n = e?.defaultStatusKey;
|
|
1589
|
-
return n && t.some((r) => r.key === n) ? n :
|
|
1589
|
+
return n && t.some((r) => r.key === n) ? n : xt(t)[0]?.key ?? $[0].key;
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1591
|
+
function xt(e) {
|
|
1592
1592
|
return [...e].sort((t, n) => {
|
|
1593
1593
|
const r = (t.order ?? 0) - (n.order ?? 0);
|
|
1594
1594
|
return r !== 0 ? r : (t.label || "").localeCompare(n.label || "");
|
|
@@ -1597,11 +1597,11 @@ function Ot(e) {
|
|
|
1597
1597
|
function _i(e, t) {
|
|
1598
1598
|
return vt(e, t) === "done";
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1600
|
+
function Ot(e) {
|
|
1601
1601
|
return (e || "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").slice(0, 48).replace(/^-+|-+$/g, "");
|
|
1602
1602
|
}
|
|
1603
1603
|
function Ti(e, t) {
|
|
1604
|
-
const n =
|
|
1604
|
+
const n = Ot(e) || "status", r = /* @__PURE__ */ new Set([...t, ...Se]);
|
|
1605
1605
|
if (!r.has(n)) return n;
|
|
1606
1606
|
for (let i = 2; i < 500; i++) {
|
|
1607
1607
|
const a = `${n}-${i}`;
|
|
@@ -1703,7 +1703,7 @@ function re(e, t) {
|
|
|
1703
1703
|
}
|
|
1704
1704
|
return !o && E(i, a) ? `+${a.callingCode}${i}` : null;
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1706
|
+
function Ci(e, t = 9) {
|
|
1707
1707
|
const n = (e ?? "").replace(/\D/g, "");
|
|
1708
1708
|
return n.length < t ? null : n.slice(-t);
|
|
1709
1709
|
}
|
|
@@ -1714,7 +1714,7 @@ function _e(e) {
|
|
|
1714
1714
|
const r = t.slice(0, n).split("+")[0], i = t.slice(n + 1);
|
|
1715
1715
|
return !r || !i.includes(".") ? null : `${r}@${i}`;
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function ki(e) {
|
|
1718
1718
|
const t = _e(e);
|
|
1719
1719
|
return t ? t.slice(t.lastIndexOf("@") + 1) : null;
|
|
1720
1720
|
}
|
|
@@ -1808,7 +1808,7 @@ function vi(e, t, n) {
|
|
|
1808
1808
|
return i ? `${r}:${i}` : null;
|
|
1809
1809
|
}
|
|
1810
1810
|
const Gt = /(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, Bt = /(\*|_)(?=\S)([^*_\n]*?\S)\1/g;
|
|
1811
|
-
function
|
|
1811
|
+
function xi(e) {
|
|
1812
1812
|
if (typeof e != "string" || !e) return "";
|
|
1813
1813
|
let t = e;
|
|
1814
1814
|
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(`
|
|
@@ -1860,7 +1860,7 @@ function le(e) {
|
|
|
1860
1860
|
|
|
1861
1861
|
`).trim();
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function Oi(e) {
|
|
1864
1864
|
if (typeof e != "string" || !e) return "";
|
|
1865
1865
|
let t = e.length;
|
|
1866
1866
|
for (const a of Ft) {
|
|
@@ -1913,6 +1913,21 @@ function Ki(e, t = []) {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
return { sources: r, keys: i };
|
|
1915
1915
|
}
|
|
1916
|
+
function Ui(e) {
|
|
1917
|
+
return e.sessions.filter(
|
|
1918
|
+
(t) => t.id !== e.exceptSessionId && t.state === "connected" && e.canHold(t.providerId)
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
function ji(e) {
|
|
1922
|
+
return e.sessions.filter(
|
|
1923
|
+
(t) => t.id !== e.exceptSessionId && t.state === "connected" && !e.canHold(t.providerId)
|
|
1924
|
+
);
|
|
1925
|
+
}
|
|
1926
|
+
function Gi(e) {
|
|
1927
|
+
return e.sessions.some(
|
|
1928
|
+
(n) => n.id !== e.exceptSessionId && (n.state === "connected" || n.state === "on_hold")
|
|
1929
|
+
) ? { admit: !1, reason: "busy" } : { admit: !0 };
|
|
1930
|
+
}
|
|
1916
1931
|
function tn(e, t) {
|
|
1917
1932
|
const n = new Set(e.disabledIntents ?? []), r = e.intentOverrides ?? {}, i = t.intents.filter((o) => !n.has(o.intent)).map((o) => rn(o, r[o.intent]));
|
|
1918
1933
|
if (!e.extraIntents || e.extraIntents.length === 0) return i;
|
|
@@ -1930,7 +1945,7 @@ function nn(e, t) {
|
|
|
1930
1945
|
}
|
|
1931
1946
|
return n;
|
|
1932
1947
|
}
|
|
1933
|
-
function
|
|
1948
|
+
function Bi(e, t) {
|
|
1934
1949
|
const n = nn(e, t);
|
|
1935
1950
|
return Object.entries(n).filter(([, r]) => !r).map(([r]) => r);
|
|
1936
1951
|
}
|
|
@@ -1941,7 +1956,7 @@ function rn(e, t) {
|
|
|
1941
1956
|
transport: t.transport ?? e.transport
|
|
1942
1957
|
} : e;
|
|
1943
1958
|
}
|
|
1944
|
-
function
|
|
1959
|
+
function Fi(e, t) {
|
|
1945
1960
|
const n = [];
|
|
1946
1961
|
for (const r of e) {
|
|
1947
1962
|
if (!r.enabled) continue;
|
|
@@ -1952,16 +1967,16 @@ function ji(e, t) {
|
|
|
1952
1967
|
}
|
|
1953
1968
|
return n;
|
|
1954
1969
|
}
|
|
1955
|
-
function
|
|
1970
|
+
function Vi(e, t) {
|
|
1956
1971
|
return t.filter((n) => n.capability.intent === e);
|
|
1957
1972
|
}
|
|
1958
1973
|
function an(e, t) {
|
|
1959
1974
|
return t.filter((n) => n.capability.targetSchemes.includes(e));
|
|
1960
1975
|
}
|
|
1961
|
-
function
|
|
1976
|
+
function Hi(e, t) {
|
|
1962
1977
|
return an(e.scheme, t);
|
|
1963
1978
|
}
|
|
1964
|
-
function
|
|
1979
|
+
function Wi(e, t, n) {
|
|
1965
1980
|
const r = [];
|
|
1966
1981
|
for (const i of e)
|
|
1967
1982
|
for (const a of n)
|
|
@@ -1991,10 +2006,10 @@ const sn = {
|
|
|
1991
2006
|
id: "note",
|
|
1992
2007
|
custom: "note"
|
|
1993
2008
|
};
|
|
1994
|
-
function
|
|
2009
|
+
function zi(e) {
|
|
1995
2010
|
return e ? sn[e] ?? "note" : "note";
|
|
1996
2011
|
}
|
|
1997
|
-
const
|
|
2012
|
+
const Xi = "message_window", Yi = "message_templates", qi = {
|
|
1998
2013
|
// E-mail
|
|
1999
2014
|
FROM: "from",
|
|
2000
2015
|
TO: "to",
|
|
@@ -2011,8 +2026,8 @@ const Hi = "message_window", Wi = "message_templates", zi = {
|
|
|
2011
2026
|
// Voice/conference
|
|
2012
2027
|
HOST: "host",
|
|
2013
2028
|
PARTICIPANT: "participant"
|
|
2014
|
-
},
|
|
2015
|
-
function
|
|
2029
|
+
}, Ji = (e, t) => ({ intent: e, ...t }), Zi = "folder_management", Qi = "remote_search", ea = { ok: !1, code: "UNSUPPORTED", message: "Provider does not support this op" }, ta = "resources.describe", na = "resources.search", ra = "resources.resolve";
|
|
2030
|
+
function ia(e) {
|
|
2016
2031
|
const t = e.indexOf(":");
|
|
2017
2032
|
return t === -1 ? e : e.slice(0, t);
|
|
2018
2033
|
}
|
|
@@ -2021,11 +2036,11 @@ function Ie(e) {
|
|
|
2021
2036
|
const t = typeof e == "string" ? e.match(/apps\/([^/?#]+)/) : null;
|
|
2022
2037
|
return t ? t[1] : null;
|
|
2023
2038
|
}
|
|
2024
|
-
function
|
|
2039
|
+
function aa(e) {
|
|
2025
2040
|
const t = Ie(e);
|
|
2026
2041
|
return t ? t !== Te : typeof e == "string" && e.startsWith("/wake");
|
|
2027
2042
|
}
|
|
2028
|
-
function
|
|
2043
|
+
function oa(e) {
|
|
2029
2044
|
return typeof e != "string" || e === "" || e === "/" ? !0 : Ie(e) === Te;
|
|
2030
2045
|
}
|
|
2031
2046
|
function ln(e) {
|
|
@@ -2047,7 +2062,7 @@ function un(e, t) {
|
|
|
2047
2062
|
function dn(e) {
|
|
2048
2063
|
return e.publicBasePath ?? `/apps/${e.name}`;
|
|
2049
2064
|
}
|
|
2050
|
-
function
|
|
2065
|
+
function sa(e) {
|
|
2051
2066
|
const t = [];
|
|
2052
2067
|
for (const n of e) {
|
|
2053
2068
|
if (!n?.name) continue;
|
|
@@ -2080,10 +2095,10 @@ function fn(e, t) {
|
|
|
2080
2095
|
cn(r.pattern).test(e) && (!n || pn(r.pattern, n.pattern)) && (n = r);
|
|
2081
2096
|
return n ? { ...n, params: { ...n.props, ...un(n.pattern, e) } } : null;
|
|
2082
2097
|
}
|
|
2083
|
-
function
|
|
2098
|
+
function la(e, t) {
|
|
2084
2099
|
return fn(e, t) !== null;
|
|
2085
2100
|
}
|
|
2086
|
-
const
|
|
2101
|
+
const ca = "sync-source", ua = "sync-target", da = 20, mn = {
|
|
2087
2102
|
afrikaans: [
|
|
2088
2103
|
"[Muziek]",
|
|
2089
2104
|
"(C) TV GELDERLAND 2021",
|
|
@@ -2374,13 +2389,13 @@ function In(e, t = hn) {
|
|
|
2374
2389
|
return { text: n.filter((o) => (o.endedAt ?? 0) >= i).map((o) => gn(o.text).trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), segmentCount: n.length };
|
|
2375
2390
|
}
|
|
2376
2391
|
const Mn = 60;
|
|
2377
|
-
function
|
|
2392
|
+
function pa(e, t, n = Mn) {
|
|
2378
2393
|
const r = new Set(e), i = [...e];
|
|
2379
2394
|
for (const a of t)
|
|
2380
2395
|
!a || r.has(a) || (r.add(a), i.push(a));
|
|
2381
2396
|
return i.slice(-n);
|
|
2382
2397
|
}
|
|
2383
|
-
function
|
|
2398
|
+
function fa(e) {
|
|
2384
2399
|
const { segments: t, now: n, state: r } = e;
|
|
2385
2400
|
if (r.lastTriggerAt && n - r.lastTriggerAt < yn)
|
|
2386
2401
|
return { trigger: !1, reason: "too_soon" };
|
|
@@ -2392,24 +2407,24 @@ function ua(e) {
|
|
|
2392
2407
|
const o = _n(i.text);
|
|
2393
2408
|
return o.length ? r.lastQueryTerms?.length && Tn(o, r.lastQueryTerms) < bn ? { trigger: !1, reason: "same_topic" } : { trigger: !0, text: i.text, terms: o, segmentCount: i.segmentCount } : { trigger: !1, reason: "no_speech" };
|
|
2394
2409
|
}
|
|
2395
|
-
const Me = 9e4,
|
|
2396
|
-
function
|
|
2410
|
+
const Me = 9e4, Cn = ["out_of_office"], Ce = (e) => Cn.includes(e);
|
|
2411
|
+
function ma(e, t, n) {
|
|
2397
2412
|
const r = n - e < Me, i = t?.status && (!t.expiresAt || t.expiresAt > n) ? t : void 0;
|
|
2398
2413
|
if (!i?.status) return { online: r, status: r ? "available" : "offline" };
|
|
2399
2414
|
const a = i.status;
|
|
2400
|
-
return !r && !
|
|
2415
|
+
return !r && !Ce(a) ? { online: !1, status: "offline" } : { online: r, status: a, message: i.message };
|
|
2401
2416
|
}
|
|
2402
|
-
function
|
|
2403
|
-
const n = t - e.lastSeenAt < Me, r = n ||
|
|
2417
|
+
function ga(e, t) {
|
|
2418
|
+
const n = t - e.lastSeenAt < Me, r = n || Ce(e.status) ? e.status : "offline";
|
|
2404
2419
|
return n === e.online && r === e.status ? e : { ...e, online: n, status: r };
|
|
2405
2420
|
}
|
|
2406
|
-
function
|
|
2421
|
+
function ha(e, t) {
|
|
2407
2422
|
return e?.teamId && t.includes(e.teamId) ? { teamId: e.teamId, mustChoose: !1 } : t.length === 1 ? { teamId: t[0], mustChoose: !1 } : { teamId: void 0, mustChoose: t.length > 1 };
|
|
2408
2423
|
}
|
|
2409
|
-
function
|
|
2424
|
+
function ya(e) {
|
|
2410
2425
|
return e.providerAvailable && e.allowed;
|
|
2411
2426
|
}
|
|
2412
|
-
const
|
|
2427
|
+
const Aa = "installation-id";
|
|
2413
2428
|
export {
|
|
2414
2429
|
m as ACTIVITY_CATALOG,
|
|
2415
2430
|
Qt as AI_ATTACHMENT_LIMITS,
|
|
@@ -2439,11 +2454,11 @@ export {
|
|
|
2439
2454
|
ai as DEFAULT_MEMORY_BUDGET,
|
|
2440
2455
|
$t as DEFAULT_PHONE_REGION,
|
|
2441
2456
|
Er as EMPTY_WORKFLOW,
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2457
|
+
Zi as FEATURE_FOLDER_MANAGEMENT,
|
|
2458
|
+
Qi as FEATURE_REMOTE_SEARCH,
|
|
2459
|
+
Aa as INSTALLATION_HEADER,
|
|
2445
2460
|
ot as INTERACTION_KIND,
|
|
2446
|
-
|
|
2461
|
+
qi as InteractionParticipantRole,
|
|
2447
2462
|
mt as KB_FALLBACK_LOCALE,
|
|
2448
2463
|
Z as KB_LOCALES,
|
|
2449
2464
|
$ as LOOSE_STATUSES,
|
|
@@ -2463,45 +2478,45 @@ export {
|
|
|
2463
2478
|
ri as MIN_MEMORY_BUDGET,
|
|
2464
2479
|
R as PHONE_REGIONS,
|
|
2465
2480
|
Me as PRESENCE_ONLINE_WINDOW_MS,
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2481
|
+
Cn as PRESENCE_SURVIVES_OFFLINE,
|
|
2482
|
+
Yi as PROVIDER_FEATURE_MESSAGE_TEMPLATES,
|
|
2483
|
+
Xi as PROVIDER_FEATURE_MESSAGE_WINDOW,
|
|
2469
2484
|
jt as PUBLIC_EMAIL_DOMAINS,
|
|
2470
2485
|
q as READ_STEP_TYPES,
|
|
2471
2486
|
Tt as RELATED_SUBJECT_KINDS,
|
|
2472
2487
|
Se as RESERVED_STATUS_KEYS,
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2488
|
+
ta as RESOURCE_DESCRIBE_SERVICE,
|
|
2489
|
+
ra as RESOURCE_RESOLVE_SERVICE,
|
|
2490
|
+
na as RESOURCE_SEARCH_SERVICE,
|
|
2476
2491
|
zr as SIGNATURE_INTENTS,
|
|
2477
2492
|
ct as STEP_MAX_TOKENS_MAX,
|
|
2478
2493
|
lt as STEP_MAX_TOKENS_MIN,
|
|
2479
2494
|
Yt as SUMMARY_MIN_LAST_CHARS,
|
|
2480
2495
|
Xt as SUMMARY_MIN_MESSAGES,
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2496
|
+
da as SYNC_RUN_MAX_ERRORS,
|
|
2497
|
+
ca as SYNC_SOURCE_PROVIDER_GROUP,
|
|
2498
|
+
ua as SYNC_TARGET_PROVIDER_GROUP,
|
|
2484
2499
|
Je as TERMINAL_ASSIGNMENT_STATUSES,
|
|
2485
2500
|
ut as TERMINAL_RUN_STATUSES,
|
|
2486
2501
|
ur as TRIGGER_VARS,
|
|
2487
|
-
|
|
2502
|
+
ea as UNSUPPORTED,
|
|
2488
2503
|
Ue as USAGE_DIMENSIONS,
|
|
2489
2504
|
je as USAGE_DIMENSION_IDS,
|
|
2490
|
-
|
|
2491
|
-
|
|
2505
|
+
Ct as WORK_ITEM_SCOPE_KIND,
|
|
2506
|
+
kt as WORK_PROJECT_SCOPE_KIND,
|
|
2492
2507
|
Lr as acceptExampleCandidate,
|
|
2493
2508
|
nt as actingIdentityKey,
|
|
2494
2509
|
fi as activeWorkTypes,
|
|
2495
2510
|
vn as activityIconOf,
|
|
2496
2511
|
jn as activityJoinUrl,
|
|
2497
2512
|
ve as activitySnippet,
|
|
2498
|
-
|
|
2513
|
+
xe as activityTextParams,
|
|
2499
2514
|
Un as activityTimelineText,
|
|
2500
2515
|
Vn as activityTimestamp,
|
|
2501
2516
|
d as activityTypeInfo,
|
|
2502
2517
|
mr as actorKey,
|
|
2503
2518
|
Rr as addExampleCandidate,
|
|
2504
|
-
|
|
2519
|
+
ga as agePresenceEntry,
|
|
2505
2520
|
Zt as aiAttachmentKind,
|
|
2506
2521
|
Pi as aiAttachmentRejection,
|
|
2507
2522
|
ee as aiBudgetLimit,
|
|
@@ -2523,33 +2538,34 @@ export {
|
|
|
2523
2538
|
ir as assignmentScopeKey,
|
|
2524
2539
|
or as assignmentSubject,
|
|
2525
2540
|
Bn as buildActivityPreview,
|
|
2526
|
-
|
|
2541
|
+
Fi as buildChannelIntents,
|
|
2527
2542
|
er as buildShareKeys,
|
|
2528
2543
|
In as buildWindow,
|
|
2529
|
-
|
|
2544
|
+
xr as canNestUnder,
|
|
2530
2545
|
Rn as carriesText,
|
|
2531
2546
|
$r as categoryLabel,
|
|
2532
2547
|
vt as categoryOf,
|
|
2533
|
-
|
|
2534
|
-
|
|
2548
|
+
zi as channelKindForScheme,
|
|
2549
|
+
xn as channelKindOf,
|
|
2535
2550
|
br as clampStepMaxTokens,
|
|
2536
|
-
|
|
2551
|
+
Oi as cleanMessageText,
|
|
2537
2552
|
Mt as compareWorkTypes,
|
|
2538
2553
|
sr as decideAssignmentState,
|
|
2539
|
-
|
|
2554
|
+
fa as decideCadence,
|
|
2555
|
+
Gi as decideIncomingCall,
|
|
2540
2556
|
gt as defaultLocaleOf,
|
|
2541
2557
|
Si as defaultStatusKey,
|
|
2542
|
-
|
|
2558
|
+
Ji as defineIntent,
|
|
2543
2559
|
pt as depthOf,
|
|
2544
|
-
|
|
2545
|
-
|
|
2560
|
+
ma as derivePresence,
|
|
2561
|
+
Bi as disabledIntentsFromCapabilities,
|
|
2546
2562
|
si as elapsedSeconds,
|
|
2547
|
-
|
|
2563
|
+
ki as emailDomain,
|
|
2548
2564
|
vi as endpointKey,
|
|
2549
2565
|
un as extractParams,
|
|
2550
2566
|
_n as extractTerms,
|
|
2551
|
-
|
|
2552
|
-
|
|
2567
|
+
Hi as filterByEndpoint,
|
|
2568
|
+
Vi as filterByIntent,
|
|
2553
2569
|
an as filterByTargetScheme,
|
|
2554
2570
|
S as findAiVendor,
|
|
2555
2571
|
Wn as flattenLocales,
|
|
@@ -2575,20 +2591,20 @@ export {
|
|
|
2575
2591
|
wn as isChatMessageActivity,
|
|
2576
2592
|
Jr as isClosed,
|
|
2577
2593
|
Pn as isConnectedType,
|
|
2578
|
-
|
|
2594
|
+
aa as isDeepLink,
|
|
2579
2595
|
ft as isDescendant,
|
|
2580
|
-
|
|
2596
|
+
kn as isEmailActivity,
|
|
2581
2597
|
Ir as isInFlight,
|
|
2582
2598
|
ei as isInteractionUnseen,
|
|
2583
|
-
|
|
2599
|
+
oa as isLandingPath,
|
|
2584
2600
|
$i as isLikelyBulk,
|
|
2585
2601
|
ce as isMessageShape,
|
|
2586
|
-
|
|
2602
|
+
On as isMessageType,
|
|
2587
2603
|
pn as isMoreSpecificPattern,
|
|
2588
2604
|
dt as isPaused,
|
|
2589
2605
|
Dn as isPlaybookAuthoredType,
|
|
2590
2606
|
wi as isPublicEmailDomain,
|
|
2591
|
-
|
|
2607
|
+
la as isPublicPath,
|
|
2592
2608
|
$n as isReplyableType,
|
|
2593
2609
|
Tr as isTerminal,
|
|
2594
2610
|
Ri as isThreadLongEnough,
|
|
@@ -2597,17 +2613,17 @@ export {
|
|
|
2597
2613
|
pi as isWorkTypeVisible,
|
|
2598
2614
|
Ai as itemDossierKeys,
|
|
2599
2615
|
Nt as ladderFor,
|
|
2600
|
-
|
|
2616
|
+
kr as linkLabel,
|
|
2601
2617
|
Vr as listeningAllowed,
|
|
2602
2618
|
vr as localeInstruction,
|
|
2603
2619
|
Nr as localeName,
|
|
2604
|
-
|
|
2620
|
+
Or as localesOf,
|
|
2605
2621
|
Mi as looksLikeEmail,
|
|
2606
|
-
|
|
2622
|
+
Wi as matchContactToIntents,
|
|
2607
2623
|
fn as matchPublicRoute,
|
|
2608
2624
|
Hr as mcpCredentialScope,
|
|
2609
2625
|
Wr as mcpToolPrefix,
|
|
2610
|
-
|
|
2626
|
+
pa as mergeShownKeys,
|
|
2611
2627
|
Ln as messageCountsAs,
|
|
2612
2628
|
Ni as needsPhoneRegion,
|
|
2613
2629
|
qn as normalizeArtifactBlocks,
|
|
@@ -2619,35 +2635,37 @@ export {
|
|
|
2619
2635
|
hi as parseItemKey,
|
|
2620
2636
|
cn as pathToRegex,
|
|
2621
2637
|
zn as periodsInRange,
|
|
2622
|
-
|
|
2623
|
-
|
|
2638
|
+
Ci as phoneSuffix,
|
|
2639
|
+
xi as plainTextFromMarkdown,
|
|
2624
2640
|
rt as playbookActor,
|
|
2625
2641
|
_r as procedureOf,
|
|
2626
2642
|
bi as projectDossierKeys,
|
|
2627
2643
|
dn as publicBasePathFor,
|
|
2628
|
-
|
|
2629
|
-
|
|
2644
|
+
sa as publicRoutePatterns,
|
|
2645
|
+
x as readPath,
|
|
2630
2646
|
J as readStepError,
|
|
2631
2647
|
at as refKey,
|
|
2632
2648
|
Ut as registrableDomain,
|
|
2633
2649
|
bt as rejectExampleCandidate,
|
|
2634
2650
|
oi as relatedByDefault,
|
|
2635
2651
|
nn as resolveAccountCapabilities,
|
|
2636
|
-
|
|
2652
|
+
O as resolveActivityText,
|
|
2637
2653
|
tn as resolveChannelIntents,
|
|
2638
2654
|
_t as resolveSignature,
|
|
2639
|
-
|
|
2640
|
-
|
|
2655
|
+
ha as resolveWorkMode,
|
|
2656
|
+
ia as resourceKindOf,
|
|
2641
2657
|
fr as runActor,
|
|
2642
|
-
|
|
2658
|
+
Cr as runInteractionId,
|
|
2643
2659
|
ze as sanitizeInline,
|
|
2644
2660
|
gn as sanitizeTranscript,
|
|
2645
2661
|
lr as selectLenses,
|
|
2662
|
+
ji as sessionsHoldCannotReach,
|
|
2663
|
+
Ui as sessionsToHold,
|
|
2646
2664
|
me as shareKeyForTeam,
|
|
2647
2665
|
fe as shareKeyForUser,
|
|
2648
2666
|
tr as shareKeysForViewer,
|
|
2649
|
-
|
|
2650
|
-
|
|
2667
|
+
ya as shouldRunAudioPipeline,
|
|
2668
|
+
xt as sortStatuses,
|
|
2651
2669
|
en as sourceKey,
|
|
2652
2670
|
Ei as statusIn,
|
|
2653
2671
|
Sr as stepsOf,
|
|
@@ -2671,6 +2689,6 @@ export {
|
|
|
2671
2689
|
ar as wakesAssignment,
|
|
2672
2690
|
wt as workItemScopeKey,
|
|
2673
2691
|
Ee as workProjectScopeKey,
|
|
2674
|
-
|
|
2692
|
+
Ot as workStatusKey,
|
|
2675
2693
|
It as workTypeKey
|
|
2676
2694
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { SessionState } from './communication';
|
|
2
|
+
/**
|
|
3
|
+
* Multi-line rules: which calls step aside when a new one takes the line.
|
|
4
|
+
*
|
|
5
|
+
* Kept pure and provider-agnostic because "one call has your ear at a time" is a
|
|
6
|
+
* platform rule, not a SIP rule. A phone with two live calls is a bug in any
|
|
7
|
+
* transport, and the answer must not live inside one provider's `invite`.
|
|
8
|
+
*/
|
|
9
|
+
/** The part of a `Session` this decision needs. */
|
|
10
|
+
export interface LineSession {
|
|
11
|
+
id: string;
|
|
12
|
+
providerId: string;
|
|
13
|
+
state: SessionState;
|
|
14
|
+
}
|
|
15
|
+
export interface HoldOthersInput<T extends LineSession> {
|
|
16
|
+
sessions: T[];
|
|
17
|
+
/** The call taking the line — itself never held. */
|
|
18
|
+
exceptSessionId?: string;
|
|
19
|
+
/** Whether that provider actually carries out `session.hold`. */
|
|
20
|
+
canHold: (providerId: string) => boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The calls to put on hold before a new one takes the line.
|
|
24
|
+
*
|
|
25
|
+
* Only `connected` calls qualify, and that is a substantive rule rather than a
|
|
26
|
+
* filter for tidiness:
|
|
27
|
+
* - `ringing` / `connecting` has no established dialog, so a re-INVITE (SIP) has
|
|
28
|
+
* nothing to renegotiate — holding it would throw, not hold.
|
|
29
|
+
* - `on_hold` is already where we want it; re-holding it would send a needless
|
|
30
|
+
* re-INVITE and, worse, unhold-all later would have no way to tell which calls
|
|
31
|
+
* the user had parked themselves.
|
|
32
|
+
* - `ended` / `failed` / `idle` have no media to step aside.
|
|
33
|
+
*
|
|
34
|
+
* Sessions from a provider that does not carry out hold are left out entirely:
|
|
35
|
+
* dispatching hold at a provider whose `dispatch` has no case for it returns
|
|
36
|
+
* quietly, and we would then show a call as parked while the caller can still
|
|
37
|
+
* hear the room.
|
|
38
|
+
*/
|
|
39
|
+
export declare function sessionsToHold<T extends LineSession>(input: HoldOthersInput<T>): T[];
|
|
40
|
+
/**
|
|
41
|
+
* Calls that a new line will leave live because their provider cannot hold.
|
|
42
|
+
*
|
|
43
|
+
* Split out from `sessionsToHold` so the caller can say so out loud instead of
|
|
44
|
+
* quietly ending up with two live calls — the situation that started this.
|
|
45
|
+
*/
|
|
46
|
+
export declare function sessionsHoldCannotReach<T extends LineSession>(input: HoldOthersInput<T>): T[];
|
|
47
|
+
/** Whether an incoming call may ring, and if not, what to tell the caller. */
|
|
48
|
+
export type IncomingCallDecision = {
|
|
49
|
+
admit: true;
|
|
50
|
+
} | {
|
|
51
|
+
admit: false;
|
|
52
|
+
reason: "busy";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Whether an incoming call may ring while the user already has a call.
|
|
56
|
+
*
|
|
57
|
+
* **"In gesprek" means an established call — `connected` or `on_hold`.** Both of
|
|
58
|
+
* those are a conversation you are in: a parked caller is still yours, and taking
|
|
59
|
+
* a new call means abandoning them. `connecting` and `ringing` are deliberately
|
|
60
|
+
* *not* busy, for two reasons. A call that is merely ringing is not yet a
|
|
61
|
+
* conversation, so rejecting on it would turn two near-simultaneous inbound calls
|
|
62
|
+
* into one — a queue decision that is not ours to make. And it keeps the blast
|
|
63
|
+
* radius small: were `ringing` to count, a single session that failed to clean up
|
|
64
|
+
* would silently reject every inbound call from then on.
|
|
65
|
+
*
|
|
66
|
+
* The caller gets a real busy answer rather than silence, so the PBX can roll the
|
|
67
|
+
* call to the next agent or to voicemail — see the provider that maps this to a
|
|
68
|
+
* SIP status code.
|
|
69
|
+
*/
|
|
70
|
+
export declare function decideIncomingCall<T extends LineSession>(input: {
|
|
71
|
+
sessions: T[];
|
|
72
|
+
/** The incoming call itself, when the provider already created a session. */
|
|
73
|
+
exceptSessionId?: string;
|
|
74
|
+
}): IncomingCallDecision;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -53,6 +53,20 @@ export interface CommsAccount<T = any> {
|
|
|
53
53
|
}
|
|
54
54
|
export interface ITransportProvider {
|
|
55
55
|
readonly id: string;
|
|
56
|
+
/**
|
|
57
|
+
* The ops this provider actually carries out, when it wants to say so.
|
|
58
|
+
*
|
|
59
|
+
* `dispatch` is a switch, so an op it has no case for returns quietly — the
|
|
60
|
+
* caller cannot tell "done" from "ignored". That is fine for a button the
|
|
61
|
+
* provider's own action tray never draws, but not for something the platform
|
|
62
|
+
* does on the user's behalf: auto-holding the previous call at a provider
|
|
63
|
+
* without hold would park a call that stays live.
|
|
64
|
+
*
|
|
65
|
+
* Undeclared means unknown, and unknown is tried anyway — that is the
|
|
66
|
+
* behaviour every provider had before this field existed. Declare it to be
|
|
67
|
+
* skipped rather than silently no-op'd.
|
|
68
|
+
*/
|
|
69
|
+
readonly supportedOps?: readonly TransportOpKind[];
|
|
56
70
|
subscribeSessions(callback: (sessions: Session[]) => void): () => void;
|
|
57
71
|
subscribeAccounts(callback: (accounts: CommsAccount[]) => void): () => void;
|
|
58
72
|
subscribeStreams(callback: (data: RemoteStreamEvent) => void): () => void;
|
|
@@ -685,6 +699,8 @@ export declare const UNSUPPORTED: ServerResult;
|
|
|
685
699
|
* door de frontend via `ITransportProvider.dispatch`. Geen server-
|
|
686
700
|
* roundtrip — directe controle over de lokale stack.
|
|
687
701
|
*/
|
|
702
|
+
/** The `kind` of a {@link TransportOp} — what a provider declares support for. */
|
|
703
|
+
export type TransportOpKind = TransportOp["kind"];
|
|
688
704
|
export type TransportOp = {
|
|
689
705
|
kind: "session.invite";
|
|
690
706
|
accountId: string;
|
package/dist/platform/media.d.ts
CHANGED
|
@@ -9,6 +9,17 @@ export interface AudioSegment {
|
|
|
9
9
|
endedAt: number;
|
|
10
10
|
avgRMS: number;
|
|
11
11
|
isFinal: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Dit segment begint midden in een lopende zin, omdat de VAD op
|
|
14
|
+
* `maxSpeechDurationMs` hard moest knippen in plaats van op een stilte.
|
|
15
|
+
*
|
|
16
|
+
* Dit is het enige geval waarin twee opeenvolgende segmenten elkaars tekst kunnen
|
|
17
|
+
* overlappen, en dus het enige geval waarin de naad geplakt moet worden. Een knip op
|
|
18
|
+
* stilte valt tussen twee woorden: daar valt niets te ontdubbelen. Zonder deze vlag
|
|
19
|
+
* moest de ontvanger dat verschil raden, en dat raden was de hele reden dat er drie
|
|
20
|
+
* fuzzy dedupe-lagen bestonden.
|
|
21
|
+
*/
|
|
22
|
+
continuesPrevious?: boolean;
|
|
12
23
|
}
|
|
13
24
|
export interface TranscriptWord {
|
|
14
25
|
text: string;
|
|
@@ -33,6 +44,8 @@ export interface TranscriptSegment {
|
|
|
33
44
|
endedAt: number;
|
|
34
45
|
language?: string;
|
|
35
46
|
confidence?: number;
|
|
47
|
+
/** Zie {@link AudioSegment.continuesPrevious} — reist mee zodat de store de naad kent. */
|
|
48
|
+
continuesPrevious?: boolean;
|
|
36
49
|
}
|
|
37
50
|
export interface AudioPipelineOptions {
|
|
38
51
|
silenceThreshold: number;
|
|
@@ -40,7 +53,10 @@ export interface AudioPipelineOptions {
|
|
|
40
53
|
speechFrameRatio: number;
|
|
41
54
|
silenceDurationMs: number;
|
|
42
55
|
maxSpeechDurationMs: number;
|
|
56
|
+
/** Naad-overlap, uitsluitend toegepast na een harde `maxSpeechDurationMs`-knip. */
|
|
43
57
|
overlapMs: number;
|
|
58
|
+
/** Audio die vóór de spraak-onset bewaard blijft, zodat de eerste klank niet wegvalt. */
|
|
59
|
+
preRollMs: number;
|
|
44
60
|
}
|
|
45
61
|
export type MediaPermissionKind = "microphone" | "camera";
|
|
46
62
|
export type MediaPermissionState = "granted" | "denied" | "prompt" | "unsupported";
|
package/dist/platform/sdk.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { InvokeOptions, SSEMessage } from './api';
|
|
3
|
+
import { IncomingCallDecision } from './call-lines';
|
|
3
4
|
import { CommsAccount, Session } from './communication';
|
|
4
5
|
import { PlatformConfig, PlatformContext } from './kernel';
|
|
5
6
|
import { AudioPipelineOptions, AudioSegment, MediaPermissionKind, MediaPermissionState, MediaPermissionStatus, TranscriptSegment } from './media';
|
|
@@ -111,6 +112,15 @@ export interface InternalSDK<LocalServices extends ServiceMap = {}, TranslationK
|
|
|
111
112
|
invite(target: string, accountId: string): Promise<void>;
|
|
112
113
|
interceptStream(sessionId: string, callback: (stream: MediaStream) => void): Promise<() => void>;
|
|
113
114
|
setActiveSession(sessionId: string): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Mag dit inkomende gesprek rinkelen? Een transport-provider vraagt dit zodra
|
|
117
|
+
* een invite binnenkomt, vóór het een sessie aanmaakt: het beleid ("zit ik al
|
|
118
|
+
* in een gesprek") kijkt over providers heen, de provider vertaalt alleen het
|
|
119
|
+
* antwoord naar zijn protocol (SIP 486 bijvoorbeeld).
|
|
120
|
+
*/
|
|
121
|
+
admitIncomingCall(options?: {
|
|
122
|
+
exceptSessionId?: string;
|
|
123
|
+
}): Promise<IncomingCallDecision>;
|
|
114
124
|
registerAccount(organizationId: string, userId: string, providerId: string, config: any): Promise<CommsAccount>;
|
|
115
125
|
transcripts: {
|
|
116
126
|
ingest(segments: TranscriptSegment[]): void;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './types';
|