@pagelines/widget 1.0.873 → 1.0.874

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.
Files changed (2) hide show
  1. package/dist/widget.js +1 -1
  2. package/package.json +2 -2
package/dist/widget.js CHANGED
@@ -111,7 +111,7 @@ Current User:
111
111
  - Email: ${t.email}
112
112
  - Title: ${n?.title||""}
113
113
  - About: ${n?.summary||""}
114
- `:"";return{context:`${this.settings.context||""}${i}`.trim(),firstMessage:this.settings.firstMessage||""}}updateState(e,t){e.value={...e.value,...t}}resetWorkJournalTiming(){this.toolActivityTiming.value={},this.lastVisibleProgressAtMs.value=void 0,this.liveSegments.value=[],this.liveStreamMessageId.value=void 0,this.clearBoundaryTimer()}resetState(){this.resetWorkJournalTiming(),this.updateState(this.textState,{isActive:!1,isConnected:!1,isThinking:!1,connectionStatus:"disconnected",error:void 0,sendBlockedReason:void 0,workingDescription:void 0,toolActivities:void 0,turnOutcome:void 0})}setupBoundaryWatcher(){lt(()=>this.workJournal.value?.nextBoundaryAtMs,e=>{this.scheduleBoundary(e)})}scheduleBoundary(e){if(this.clearBoundaryTimer(),e===void 0)return;let t=Math.max(0,e-Date.now());this.boundaryTimer=setTimeout(()=>{this.boundaryTimer=void 0,this.nowMs.value=Date.now()},t),this.boundaryTimer.unref?.()}clearBoundaryTimer(){this.boundaryTimer&&(clearTimeout(this.boundaryTimer),this.boundaryTimer=void 0)}rememberToolActivity(e){let t=fd(e.startedAt)??this.toolActivityTiming.value[e.activityId]?.startedAt??(e.status==="started"?Date.now():void 0),n=fd(e.endedAt)??this.toolActivityTiming.value[e.activityId]?.endedAt??(e.status==="started"?void 0:Date.now());t&&(this.toolActivityTiming.value={...this.toolActivityTiming.value,[e.activityId]:{startedAt:t,...n?{endedAt:n}:{}}})}withToolActivityTiming(e){let t=this.toolActivityTiming.value[e.activityId],n=Date.now(),i=fd(e.startedAt)??t?.startedAt??(e.status==="started"?n:void 0),r=fd(e.endedAt)??t?.endedAt??(e.status==="started"?void 0:n);return{...e,...i!==void 0&&!e.startedAt?{startedAt:new Date(i).toISOString()}:{},...r!==void 0&&!e.endedAt?{endedAt:new Date(r).toISOString()}:{}}}updateToolActivity(e){let t=this.textState.value.toolActivities??[],n=t.findIndex(o=>o.activityId===e.activityId),i=this.withToolActivityTiming({...n>=0?t[n]:{},...e}),r=n>=0?[...t.slice(0,n),i,...t.slice(n+1)]:[...t,i];this.rememberToolActivity(i),this.updateState(this.textState,{toolActivities:r})}finishToolActivities(e){let t=this.textState.value.toolActivities;if(!t?.length)return;let n=t.map(i=>i.status==="started"?this.withToolActivityTiming({...i,status:e}):i);n.forEach(i=>this.rememberToolActivity(i)),this.updateState(this.textState,{toolActivities:n})}workJournalFor(e){if(e.activities?.length)return _b({activities:e.activities,outcome:e.outcome,nowMs:this.nowMs.value,canNotifyOnCompletion:!1,includeFailureNote:e.includeFailureNote})}setupModeWatcher(){lt(this.agentMode,async(e,t)=>{this.logger.info(`Mode changed from ${t} to ${e}`),this.isTextMode&&(t==="talk"||t==="chat")&&await this.endConversation()})}setupAvailabilityWatcher(){lt(()=>[this.chatEnabled,this._agent.state.value.lifecycle],([e])=>{if(!(!this.isTextMode||this.isConnecting)){if(e){this.textState.value.isConnected||this.updateState(this.textState,{isConnected:!0,connectionStatus:"connected",error:void 0});return}this.textState.value.isConnected&&this.updateState(this.textState,{isConnected:!1,connectionStatus:"disconnected",error:this.chatUnavailableReason})}})}handleError(e,t){let n=e.message;this.logger.error("Conversation error:",{message:n,raw:t,error:e}),this.addMessage(n,"system"),this.resetState(),this.updateState(this.textState,{error:n,connectionStatus:"error"})}async setMode(e){this.agentMode.value!==e&&(this.agentMode.value=e)}async startTextConversation(e={}){if(this.isConnecting){this.logger.info("Text conversation already connecting, ignoring duplicate request");return}this.isConnecting=!0,this.isTextMode=!0,this.updateState(this.textState,{isActive:!0,connectionStatus:"connecting"});try{if(!this.chatEnabled){this.isConnecting=!1,this.updateState(this.textState,{isConnected:!1,connectionStatus:"disconnected",error:this.chatUnavailableReason});return}this.isConnecting=!1,this.updateState(this.textState,{isConnected:!0,connectionStatus:"connected"}),e.onConnect?.(),this.logger.info("Text conversation ready")}catch(t){throw this.isConnecting=!1,this.handleError(t),t}}async endConversation(){if(this.turnEpoch+=1,this.runningStreamToken=void 0,this.suppressedStreamTokens.clear(),this.queuedMessageIdSet.value=new Set,!this.isTextMode){this.resetState();return}try{this.conversationId=void 0,this.resetState(),this.isTextMode=!1}catch{this.isTextMode=!1}}async sendChatMessage(e,t){if(!this.isTextMode)return;let{chatStreamFn:n}=this.settings;if(!this.chatEnabled){this.addOfflineSystemReply();return}if(this.textState.value.sendBlockedReason==="agent_deleted")return;let{sdk:i}=this.settings;if(!n&&!this._agent.handle.value){this.handleError(Error("Agent handle required for chat"));return}let r=this.textState.value.isThinking,o=this.sharedMessages.value.length;this.addMessage(e,"user",t);let a=this.sharedMessages.value.length>o?this.sharedMessages.value[this.sharedMessages.value.length-1]?.id:void 0,s=this.turnEpoch,c=++this.nextStreamToken;r&&a?this.queuedMessageIdSet.value=new Set(this.queuedMessageIdSet.value).add(a):(this.runningStreamToken=c,this.resetWorkJournalTiming(),this.updateState(this.textState,{isThinking:!0,workingDescription:void 0,toolActivities:[],transientIssue:void 0,turnOutcome:void 0}));let u=`stream-${Date.now()}-${c}`,d=!1,p=!1,m=()=>s===this.turnEpoch&&!this.suppressedStreamTokens.has(c),f=()=>{this.runningStreamToken!==c&&(this.runningStreamToken=c,this.consumeQueuedThrough(a),this.resetWorkJournalTiming(),this.updateState(this.textState,{isThinking:!0,workingDescription:void 0,toolActivities:[],transientIssue:void 0,turnOutcome:void 0}))},S=($,B="assistant")=>{if(!m())return;f(),this.updateState(this.textState,{workingDescription:void 0}),B==="assistant"&&(this.lastVisibleProgressAtMs.value=Date.now()),d||(d=!0,this.liveStreamMessageId.value=u,this.sharedMessages.value=[...this.sharedMessages.value,{id:u,text:"",sender:B==="system"?"system":"agent",timestamp:new Date().toISOString()}]);let ae=this.liveSegments.value,he=ae[ae.length-1];this.liveSegments.value=he?.kind==="text"?[...ae.slice(0,-1),{kind:"text",content:he.content+$}]:[...ae,{kind:"text",content:$}];let te=this.sharedMessages.value,K=te[te.length-1];K?.id===u&&(K.text+=$,this.sharedMessages.value=[...te])},z=$=>{if(!m())return;if(f(),p=!0,$.sender==="agent"&&Bs($.text)){this.liveSegments.value=[],this.liveStreamMessageId.value=void 0,this.sharedMessages.value=this.sharedMessages.value.filter(de=>de.id!==u);return}d=!0;let B=$.sender==="system"||$.turnOutcome==="failed"?"failed":"completed";this.finishToolActivities(B);let ae=this.textState.value.toolActivities,he=$.toolActivities?.length||!ae?.length?$:{...$,toolActivities:ae};this.liveSegments.value=[],this.liveStreamMessageId.value=void 0,this.updateState(this.textState,{workingDescription:void 0,toolActivities:[],turnOutcome:void 0});let te=this.sharedMessages.value,K=te.findIndex(de=>de.id===he.id);if(K>=0)this.sharedMessages.value=[...te.slice(0,K),he,...te.slice(K+1)];else{let de=te[te.length-1];this.sharedMessages.value=de?.id===u?[...te.slice(0,-1),he]:[...te,he]}he.sender==="system"&&he.issue?.bucket==="account"?this.updateState(this.textState,{sendBlockedReason:"account"}):he.sender==="system"&&he.issue?.code&&gE.has(he.issue.code)&&this.updateState(this.textState,{sendBlockedReason:"agent_deleted"})},T=$=>{if(!m())return;if(!d&&!p){L("empty_stream \u2014 assistant returned no content");return}this.finishToolActivities("completed");let B=this.sharedMessages.value,ae=B[B.length-1];ae?.id===u&&ae.sender==="agent"&&Bs(ae.text)&&(this.sharedMessages.value=B.slice(0,-1)),$&&(this.conversationId=$),this.updateState(this.textState,{isThinking:!1,workingDescription:void 0,transientIssue:void 0}),this.settings.onTurnCompleted?.($)},L=$=>{if(!m())return;if(this.runningStreamToken!==c){this.consumeQueuedThrough(a),this.sharedMessages.value=this.sharedMessages.value.filter(K=>K.id!==a),this.composerState.value.text||(this.composerState.value={...this.composerState.value,text:e,pendingAttachments:t??[]});return}this.updateState(this.textState,{workingDescription:void 0,turnOutcome:"failed"}),this.finishToolActivities("failed");let B=this.sharedMessages.value,ae=B[B.length-1];if(ae?.id===u&&!ae.text&&(this.sharedMessages.value=B.slice(0,-1)),typeof $=="object"&&$.code&&$.error){let K=bO($);K.surface==="transient"?this.updateState(this.textState,{isThinking:!1,transientIssue:K.issue}):K.surface==="transcript"?(this.addMessage(yO($),"system",void 0,K.issue),this.updateState(this.textState,{isThinking:!1,...K.sendBlockedReason?{sendBlockedReason:K.sendBlockedReason}:{}})):this.handleError(Error($.error));return}let he=typeof $=="string"?$:$.error,te=this.mapChatError(he);this.isTransientError(he)?(this.logger.warn("Chat turn failed (transient):",{raw:he,friendly:te}),this.addMessage(te,"system"),this.updateState(this.textState,{isThinking:!1})):this.handleError(Error(te),he)},j=$=>{if(!m())return;f();let B=$.trim();this.updateState(this.textState,{workingDescription:B||void 0})},D=$=>{if(m()){if(f(),this.lastVisibleProgressAtMs.value=Date.now(),$.status==="started"){let B=this.liveSegments.value,ae=B[B.length-1];ae?.kind==="work"?ae.activityIds.includes($.activityId)||(this.liveSegments.value=[...B.slice(0,-1),{kind:"work",activityIds:[...ae.activityIds,$.activityId]}]):this.liveSegments.value=[...B,{kind:"work",activityIds:[$.activityId]}]}this.updateToolActivity($)}},U=()=>{m()&&this.updateState(this.textState,{workingDescription:void 0})};try{this.settings.onTurnStarted?.(),await(n?n({message:e,attachments:t,conversationId:this.conversationId,history:this.buildHistory(),onDelta:S,onMessage:z,onDone:T,onError:L,onStatus:j,onToolActivity:D,onWorkingEnd:U}):i.chat.chatStreamPublic({handle:this._agent.handle.value,message:e,attachments:t,anonymousId:i.user.generateAnonId(),context:this.getDynamicSettings().context||void 0,onDelta:S,onMessage:z,onDone:T,onError:L,onStatus:j,onToolActivity:D,onWorkingEnd:U}))}catch($){L($.message||"Something went wrong")}}async stopChatTurn(){if(this.textState.value.isThinking){this.runningStreamToken!==void 0&&this.suppressedStreamTokens.add(this.runningStreamToken),this.runningStreamToken=void 0,this.updateState(this.textState,{isThinking:!1,turnOutcome:"stopped",workingDescription:void 0,transientIssue:void 0});try{await this.settings.cancelChatTurnFn?.({conversationId:this.conversationId})}catch(e){this.logger.warn("stopChatTurn: cancel failed",{conversationId:this.conversationId,error:e instanceof Error?e.message:String(e)})}}}buildHistory(){return this.sharedMessages.value.filter(e=>e.sender==="user"||e.sender==="agent").slice(-20).map(e=>({role:e.sender==="user"?"user":"assistant",content:e.text,...e.attachments?.length?{attachments:e.attachments}:{}})).filter(e=>e.content.length>0||e.attachments&&e.attachments.length>0)}loadMessages(e){this.conversationId=e.conversationId;let t=this.sharedMessages.value,n=e.messages.filter(r=>r.sender!=="agent"||!Bs(r.text)),i=new Set(n.map(r=>r.id));this.sharedMessages.value=[...n,...t.filter(r=>!i.has(r.id))],e.activeToolActivities?.length&&(e.activeToolActivities.forEach(r=>this.rememberToolActivity(r)),this.updateState(this.textState,{isThinking:!0,workingDescription:void 0,toolActivities:e.activeToolActivities,transientIssue:void 0}))}async destroy(){this.clearBoundaryTimer(),this.voiceRecorder.teardown(),await this.endConversation()}};wO={key:0,class:"absolute inset-0 flex items-center justify-center"},da=Ae({__name:"ElAgentButton",props:{theme:{default:"primary"},size:{default:"lg"},loading:{type:Boolean,default:!1},icon:{},iconAfter:{}},setup(e){let t=N(()=>({primary:"bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",green:"bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",red:"bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",default:"bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",dark:"bg-theme-900 border-transparent hover:bg-theme-800"})[e.theme]),n=N(()=>({sm:"px-4 py-2 text-sm",md:"px-6 py-3 text-base",lg:"px-8 py-4 text-base"})[e.size]),i=N(()=>({sm:"size-4",md:"size-4",lg:"size-5"})[e.size]);return(r,o)=>(v(),x("button",{class:V(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",[t.value,n.value]])},[e.loading?(v(),x("div",wO,[...o[0]||(o[0]=[y("i",{class:"i-svg-spinners-90-ring-with-bg size-5"},null,-1)])])):q("",!0),y("span",{class:V(["flex items-center gap-2 transition-opacity duration-200",e.loading?"opacity-0":"opacity-100"])},[e.icon?(v(),x("i",{key:0,class:V([e.icon,i.value])},null,2)):q("",!0),er(r.$slots,"default"),e.iconAfter?(v(),x("i",{key:1,class:V([e.iconAfter,i.value])},null,2)):q("",!0)],2)],2))}}),kO=["value"],Ed=Ae({__name:"AgentInputEmail",props:{modelValue:{default:""}},emits:["update:modelValue"],setup(e,{emit:t}){let n=t;return(i,r)=>(v(),x("input",{name:"username",type:"email",inputmode:"email",autocomplete:"username",autocapitalize:"off",autocorrect:"off",spellcheck:"false",placeholder:"Enter your email",value:e.modelValue,class:"w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",style:{"font-size":"16px"},onInput:r[0]||(r[0]=o=>n("update:modelValue",o.target.value))},null,40,kO))}}),_O=["placeholder","value"],Id=Ae({__name:"AgentInputOneTimeCode",props:{modelValue:{},length:{},focusFirst:{type:Boolean}},emits:["update:modelValue","autoSubmit"],setup(e,{emit:t}){let n=e,i=t,r=Y(null),o=N(()=>"0".repeat(n.length));It(()=>{n.focusFirst&&!("ontouchstart"in window)&&r.value?.focus()});function a(s){let c=s.target.value.replace(/\D/g,"").slice(0,n.length);i("update:modelValue",c),c.length===n.length&&i("autoSubmit",c)}return(s,c)=>(v(),x("input",{ref_key:"input",ref:r,name:"one-time-code",type:"text",inputmode:"numeric",autocomplete:"one-time-code",autocapitalize:"off",autocorrect:"off",spellcheck:"false",enterkeyhint:"done",placeholder:o.value,value:e.modelValue,class:"w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",style:{"font-size":"16px"},onInput:a},null,40,_O))}}),$O={class:"relative flex-shrink-0"},SO=["src","alt"],EO={class:"absolute top-1 right-1"},IO={key:1,class:"size-3 bg-theme-400 rounded-full ring-2 ring-white"},TO={class:"min-w-0"},Td=Ae({__name:"ElModeHeader",props:{agent:{},size:{default:"md"},isOnline:{type:Boolean,default:!1},layout:{default:"centered"}},setup(e){return(t,n)=>(v(),x("div",{class:V(["flex gap-4",[e.layout==="centered"?"flex-col items-center text-center":"flex-row items-center justify-center"]])},[y("div",$O,[y("div",{class:V(["rounded-full overflow-hidden border-white",e.size==="lg"?"w-20 h-20 sm:w-24 sm:h-24 border-4":"w-16 sm:size-16 border-2"])},[y("img",{src:e.agent.avatarUrl.value,alt:e.agent.displayName.value,class:"w-full h-full object-cover",onError:n[0]||(n[0]=(...i)=>Ie(al)&&Ie(al)(...i))},null,40,SO)],2),y("div",EO,[e.isOnline?(v(),x(ge,{key:0},[n[1]||(n[1]=y("div",{class:"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",style:{"animation-duration":"3s"}},null,-1)),n[2]||(n[2]=y("div",{class:"size-3 bg-green-500 rounded-full ring-2 ring-white"},null,-1))],64)):(v(),x("div",IO))])]),y("div",TO,[y("h1",{class:V(["font-light text-white mb-1 truncate",[e.size==="lg"?"text-3xl mb-2":"text-xl sm:text-2xl tracking-wide leading-tight",e.layout==="horizontal"?"text-white/95":""]])},ce(e.agent.displayName.value),3),y("p",{class:V(["font-light line-clamp-1",[e.size==="lg"?"text-base text-white/60":"text-sm sm:text-base",e.layout==="horizontal"?"text-white/70 truncate":"text-white/60"]])},ce(e.layout==="horizontal"?e.agent.title.value||"Assistant":e.agent.title.value),3)])],2))}}),zO={class:"relative shrink-0 rounded-full"},NO=["src","alt"],CO=["src","alt"],AO=["aria-label"],$b=Ae({__name:"AgentAvatar",props:{agent:{},showStatus:{type:Boolean,default:!0},showOwnerMark:{type:Boolean,default:!0},isLight:{type:Boolean,default:!0}},setup(e){let t={green:"bg-green-500",amber:"bg-amber-500",red:"bg-red-500",grey:"bg-theme-300"},n=N(()=>{let o=e.agent.state.value;return e.showStatus&&o.lifecycle!=="unknown"?t[o.color]:null}),i={width:"clamp(7px, 14%, 14px)",height:"clamp(7px, 14%, 14px)",top:"calc(14.6% - clamp(3.5px, 7%, 7px))",right:"calc(14.6% - clamp(3.5px, 7%, 7px))"},r=N(()=>e.isLight?"ring-white":"ring-theme-900");return(o,a)=>(v(),x("div",zO,[y("img",{src:e.agent.avatarUrl.value,alt:e.agent.displayName.value,class:V(["size-full rounded-full object-cover ring-1",e.isLight?"ring-black/5":"ring-white/10"])},null,10,NO),e.showOwnerMark&&e.agent.ownerMarkUrl.value?(v(),x("img",{key:0,src:e.agent.ownerMarkUrl.value,alt:e.agent.owner.value?.fullName?`Owned by ${e.agent.owner.value.fullName}`:"Owner",class:V(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2",r.value])},null,10,CO)):q("",!0),n.value?(v(),x("span",{key:1,role:"status","aria-label":e.agent.state.value.tooltip,class:V(["absolute z-10 rounded-full ring-2",[n.value,r.value]]),style:i},null,10,AO)):q("",!0),n.value&&e.agent.state.value.lifecycle==="running"?(v(),x("span",{key:2,"aria-hidden":"true",class:V(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]",n.value]),style:i},null,2)):q("",!0)]))}}),OO={key:0,class:"sr-only",role:"status","aria-live":"polite"},DO=["aria-expanded","disabled"],PO=["aria-expanded"],RO={class:"flex w-5 shrink-0 justify-center self-stretch","aria-hidden":"true"},MO=["data-journal-row"],UO={class:"flex w-5 shrink-0 flex-col items-center self-stretch","aria-hidden":"true"},jO={class:"flex h-[17px] shrink-0 items-center"},LO={key:0,class:"sr-only"},mb=Ae({__name:"AgentToolActivityGroup",props:{model:{},isLight:{type:Boolean}},setup(e){let t=e,n=Xe(!1);function i(){n.value=!n.value}let r=N(()=>t.model.outcome==="completed"),o=N(()=>t.model.hiddenRows.length),a=N(()=>t.model.hint??(t.model.terminal?.tone==="active"?t.model.terminal.label:void 0)),s=N(()=>{let d=t.model;return r.value?n.value?d.hiddenRows:[]:[...n.value?d.hiddenRows:[],...d.visibleRows,...d.terminal?[d.terminal]:[]]}),c=N(()=>t.isLight?{spine:"bg-theme-200",dashed:"border-theme-300",doneMark:"text-theme-400",failedMark:"text-theme-400",activeLine:"text-theme-900",stoppedSquare:"bg-theme-500",muted:"text-theme-500",ring:"focus-visible:ring-theme-900"}:{spine:"bg-white/15",dashed:"border-white/25",doneMark:"text-white/45",failedMark:"text-white/45",activeLine:"text-white",stoppedSquare:"bg-white/55",muted:"text-white/55",ring:"focus-visible:ring-white"}),u=N(()=>{let d=t.isLight;return{done:{statusWord:"completed",label:d?"text-[12.5px] text-theme-500":"text-[12.5px] text-white/55",station:{tag:"i",class:`i-tabler-check size-3 ${c.value.doneMark}`}},active:{statusWord:"in progress",label:d?"text-[13px] font-medium text-theme-900":"text-[13px] font-medium text-white",station:{tag:"span",class:`chat-pulse-dot size-1.5 rounded-full bg-current ${c.value.activeLine}`}},failed:{statusWord:"failed",label:d?"text-[12.5px] font-medium text-theme-600":"text-[12.5px] font-medium text-white/70",station:{tag:"i",class:`i-tabler-alert-circle size-3.5 ${c.value.failedMark}`}},stopped:{label:d?"text-[13px] font-medium text-theme-600":"text-[13px] font-medium text-white/70",station:{tag:"span",class:`size-[9px] rounded-[2px] ${c.value.stoppedSquare}`}},completed:{label:d?"text-[12.5px] text-theme-500":"text-[12.5px] text-white/55",station:{tag:"i",class:"i-tabler-circle-check size-3.5 text-green-600"}}}});return(d,p)=>(v(),x("div",{class:V(["w-full py-0.5",c.value.muted])},[a.value?(v(),x("span",OO,ce(a.value),1)):q("",!0),r.value?(v(),x("button",{key:1,type:"button","data-test":"messaging-tool-activity-summary","data-journal-disclosure":"","aria-expanded":n.value,disabled:o.value===0,class:V(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default",c.value.ring]),onClick:i},[p[0]||(p[0]=y("i",{"data-journal-station":"completed",class:"i-tabler-circle-check size-3.5 shrink-0 text-green-600","aria-hidden":"true"},null,-1)),y("span",{class:V(["text-[12.5px] font-medium leading-none",c.value.muted])},ce(e.model.terminal?.label),3),o.value?(v(),x("i",{key:0,class:V(["size-[13px] shrink-0",[n.value?"i-tabler-chevron-down":"i-tabler-chevron-right",c.value.muted]]),"aria-hidden":"true"},null,2)):q("",!0)],10,DO)):o.value?(v(),x("button",{key:2,type:"button","data-test":"messaging-tool-activity-summary","data-journal-disclosure":"","aria-expanded":n.value,class:V(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",c.value.ring]),onClick:i},[y("span",RO,[y("span",{"data-journal-spine":"dashed",class:V(["w-0 border-l border-dashed",c.value.dashed])},null,2)]),y("span",{class:V(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none",c.value.muted])},[yt(ce(o.value)+" earlier updates ",1),y("i",{class:V(["size-3 shrink-0",n.value?"i-tabler-chevron-down":"i-tabler-chevron-right"]),"aria-hidden":"true"},null,2)],2)],10,PO)):q("",!0),(v(!0),x(ge,null,et(s.value,(m,f)=>(v(),x("div",{key:m.id,"data-test":"messaging-tool-activity-row","data-journal-row":m.tone,class:V([r.value?"pl-[22px]":"","flex gap-x-2.5"])},[y("div",UO,[y("span",jO,[(v(),Be(L1(u.value[m.tone].station.tag),{"data-journal-station":m.tone,class:V(u.value[m.tone].station.class)},null,8,["data-journal-station","class"]))]),f===s.value.length-1?q("",!0):(v(),x("span",{key:0,class:V(["w-px flex-1",c.value.spine])},null,2))]),y("div",{class:V(["min-w-0 flex-1",f===s.value.length-1?"":"pb-2"])},[y("span",{class:V(["relative block leading-snug",u.value[m.tone].label])},[yt(ce(m.label),1),u.value[m.tone].statusWord?(v(),x("span",LO,", "+ce(u.value[m.tone].statusWord),1)):q("",!0)],2),m.note?(v(),x("p",{key:0,class:V(["pt-0.5 text-[11.5px] leading-snug",c.value.muted])},ce(m.note),3)):q("",!0)],2)],10,MO))),128)),!r.value&&e.model.hint?(v(),x("p",{key:3,"data-test":"messaging-tool-activity-hint",class:V(["pl-[30px] pt-2.5 text-[12px] leading-snug",c.value.muted])},ce(e.model.hint),3)):q("",!0)],2))}});bE=Object.entries,V2=Object.setPrototypeOf,WO=Object.isFrozen,KO=Object.getPrototypeOf,GO=Object.getOwnPropertyDescriptor,Ut=Object.freeze,jt=Object.seal,sa=Object.create,yE=typeof Reflect<"u"&&Reflect,Sb=yE.apply,Eb=yE.construct;Ut||(Ut=function(t){return t}),jt||(jt=function(t){return t}),Sb||(Sb=function(t,n){var i=[...arguments].slice(2);return t.apply(n,i)}),Eb||(Eb=function(t){return new t(...[...arguments].slice(1))});ia=$t(Array.prototype.forEach),JO=$t(Array.prototype.lastIndexOf),F2=$t(Array.prototype.pop),oa=$t(Array.prototype.push),qO=$t(Array.prototype.splice),ci=Array.isArray,il=$t(String.prototype.toLowerCase),fb=$t(String.prototype.toString),B2=$t(String.prototype.match),Qs=$t(String.prototype.replace),Z2=$t(String.prototype.indexOf),YO=$t(String.prototype.trim),XO=$t(Number.prototype.toString),QO=$t(Boolean.prototype.toString),H2=typeof BigInt>"u"?null:$t(BigInt.prototype.toString),W2=typeof Symbol>"u"?null:$t(Symbol.prototype.toString),Ct=$t(Object.prototype.hasOwnProperty),el=$t(Object.prototype.toString),Nt=$t(RegExp.prototype.test),Li=e3(TypeError);K2=Ut("a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")),hb=Ut("svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")),gb=Ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),i3=Ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vb=Ut("math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")),o3=Ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G2=Ut(["#text"]),J2=Ut("accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")),bb=Ut("accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")),q2=Ut("accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")),hd=Ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a3=jt(/{{[\w\W]*|^[\w\W]*}}/g),s3=jt(/<%[\w\W]*|^[\w\W]*%>/g),l3=jt(/\${[\w\W]*/g),c3=jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),u3=jt(/^aria-[\-\w]+$/),Y2=jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),d3=jt(/^(?:\w+script|data):/i),p3=jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),m3=jt(/^html$/i),f3=jt(/^[a-z][.\w]*(-[.\w]+)+$/i),X2=jt(/<[/\w!]/g),Q2=jt(/<[/\w]/g),h3=jt(/<\/no(script|embed|frames)/i),g3=jt(/\/>/i),hr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},v3=function(){return typeof window>"u"?null:window},b3=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},eE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ai=function(t,n,i,r){return Ct(t,n)&&ci(t[n])?je(r.base?tr(r.base):{},t[n],r.transform):i};wE=xE();Bi=Cb();Fi={exec:()=>null};y3=((e="")=>{try{return!!RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Ft={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:aa(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:aa(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:aa(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:aa(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:aa(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:aa(e=>RegExp(`^ {0,${e}}>`))},x3=/^(?:[ \t]*(?:\n|$))+/,w3=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,k3=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ll=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_3=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ab=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,kE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_E=Le(kE).replace(/bull/g,Ab).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$3=Le(kE).replace(/bull/g,Ab).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ob=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,S3=/^[^\n]+/,Db=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,E3=Le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Db).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),I3=Le(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ab).getRegex(),zd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,T3=Le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Pb).replace("tag",zd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$E=e=>Le(Ob).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",e).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zd).getRegex(),z3=$E(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),N3=$E(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Rb={blockquote:Le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",N3).getRegex(),code:w3,def:E3,fences:k3,heading:_3,hr:ll,html:T3,lheading:_E,list:I3,newline:x3,paragraph:z3,table:Fi,text:S3},rE=Le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zd).getRegex(),C3={...Rb,lheading:$3,table:rE,paragraph:Le(Ob).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zd).getRegex()},A3={...Rb,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Pb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(Ob).replace("hr",ll).replace("heading",` *#{1,6} *[^
114
+ `:"";return{context:`${this.settings.context||""}${i}`.trim(),firstMessage:this.settings.firstMessage||""}}updateState(e,t){e.value={...e.value,...t}}resetWorkJournalTiming(){this.toolActivityTiming.value={},this.lastVisibleProgressAtMs.value=void 0,this.liveSegments.value=[],this.liveStreamMessageId.value=void 0,this.clearBoundaryTimer()}resetState(){this.resetWorkJournalTiming(),this.updateState(this.textState,{isActive:!1,isConnected:!1,isThinking:!1,connectionStatus:"disconnected",error:void 0,sendBlockedReason:void 0,workingDescription:void 0,toolActivities:void 0,turnOutcome:void 0})}setupBoundaryWatcher(){lt(()=>this.workJournal.value?.nextBoundaryAtMs,e=>{this.scheduleBoundary(e)})}scheduleBoundary(e){if(this.clearBoundaryTimer(),e===void 0)return;let t=Math.max(0,e-Date.now());this.boundaryTimer=setTimeout(()=>{this.boundaryTimer=void 0,this.nowMs.value=Date.now()},t),this.boundaryTimer.unref?.()}clearBoundaryTimer(){this.boundaryTimer&&(clearTimeout(this.boundaryTimer),this.boundaryTimer=void 0)}rememberToolActivity(e){let t=fd(e.startedAt)??this.toolActivityTiming.value[e.activityId]?.startedAt??(e.status==="started"?Date.now():void 0),n=fd(e.endedAt)??this.toolActivityTiming.value[e.activityId]?.endedAt??(e.status==="started"?void 0:Date.now());t&&(this.toolActivityTiming.value={...this.toolActivityTiming.value,[e.activityId]:{startedAt:t,...n?{endedAt:n}:{}}})}withToolActivityTiming(e){let t=this.toolActivityTiming.value[e.activityId],n=Date.now(),i=fd(e.startedAt)??t?.startedAt??(e.status==="started"?n:void 0),r=fd(e.endedAt)??t?.endedAt??(e.status==="started"?void 0:n);return{...e,...i!==void 0&&!e.startedAt?{startedAt:new Date(i).toISOString()}:{},...r!==void 0&&!e.endedAt?{endedAt:new Date(r).toISOString()}:{}}}updateToolActivity(e){let t=this.textState.value.toolActivities??[],n=t.findIndex(o=>o.activityId===e.activityId),i=this.withToolActivityTiming({...n>=0?t[n]:{},...e}),r=n>=0?[...t.slice(0,n),i,...t.slice(n+1)]:[...t,i];this.rememberToolActivity(i),this.updateState(this.textState,{toolActivities:r})}finishToolActivities(e){let t=this.textState.value.toolActivities;if(!t?.length)return;let n=t.map(i=>i.status==="started"?this.withToolActivityTiming({...i,status:e}):i);n.forEach(i=>this.rememberToolActivity(i)),this.updateState(this.textState,{toolActivities:n})}workJournalFor(e){if(e.activities?.length)return _b({activities:e.activities,outcome:e.outcome,nowMs:this.nowMs.value,canNotifyOnCompletion:!1,includeFailureNote:e.includeFailureNote})}setupModeWatcher(){lt(this.agentMode,async(e,t)=>{this.logger.info(`Mode changed from ${t} to ${e}`),this.isTextMode&&(t==="talk"||t==="chat")&&await this.endConversation()})}setupAvailabilityWatcher(){lt(()=>[this.chatEnabled,this._agent.state.value.lifecycle],([e])=>{if(!(!this.isTextMode||this.isConnecting)){if(e){this.textState.value.isConnected||this.updateState(this.textState,{isConnected:!0,connectionStatus:"connected",error:void 0});return}this.textState.value.isConnected&&this.updateState(this.textState,{isConnected:!1,connectionStatus:"disconnected",error:this.chatUnavailableReason})}})}handleError(e,t){let n=e.message;this.logger.error("Conversation error:",{message:n,raw:t,error:e}),this.addMessage(n,"system"),this.resetState(),this.updateState(this.textState,{error:n,connectionStatus:"error"})}async setMode(e){this.agentMode.value!==e&&(this.agentMode.value=e)}async startTextConversation(e={}){if(this.isConnecting){this.logger.info("Text conversation already connecting, ignoring duplicate request");return}this.isConnecting=!0,this.isTextMode=!0,this.updateState(this.textState,{isActive:!0,connectionStatus:"connecting"});try{if(!this.chatEnabled){this.isConnecting=!1,this.updateState(this.textState,{isConnected:!1,connectionStatus:"disconnected",error:this.chatUnavailableReason});return}this.isConnecting=!1,this.updateState(this.textState,{isConnected:!0,connectionStatus:"connected"}),e.onConnect?.(),this.logger.info("Text conversation ready")}catch(t){throw this.isConnecting=!1,this.handleError(t),t}}async endConversation(){if(this.turnEpoch+=1,this.runningStreamToken=void 0,this.suppressedStreamTokens.clear(),this.queuedMessageIdSet.value=new Set,!this.isTextMode){this.resetState();return}try{this.conversationId=void 0,this.resetState(),this.isTextMode=!1}catch{this.isTextMode=!1}}async sendChatMessage(e,t){if(!this.isTextMode)return;let{chatStreamFn:n}=this.settings;if(!this.chatEnabled){this.addOfflineSystemReply();return}if(this.textState.value.sendBlockedReason==="agent_deleted")return;let{sdk:i}=this.settings;if(!n&&!this._agent.handle.value){this.handleError(Error("Agent handle required for chat"));return}let r=this.textState.value.isThinking,o=this.sharedMessages.value.length;this.addMessage(e,"user",t);let a=this.sharedMessages.value.length>o?this.sharedMessages.value[this.sharedMessages.value.length-1]?.id:void 0,s=this.turnEpoch,c=++this.nextStreamToken;r&&a?this.queuedMessageIdSet.value=new Set(this.queuedMessageIdSet.value).add(a):(this.runningStreamToken=c,this.resetWorkJournalTiming(),this.updateState(this.textState,{isThinking:!0,workingDescription:void 0,toolActivities:[],transientIssue:void 0,turnOutcome:void 0}));let u=`stream-${Date.now()}-${c}`,d=!1,p=!1,m=()=>s===this.turnEpoch&&!this.suppressedStreamTokens.has(c),f=()=>{this.runningStreamToken!==c&&(this.runningStreamToken=c,this.consumeQueuedThrough(a),this.resetWorkJournalTiming(),this.updateState(this.textState,{isThinking:!0,workingDescription:void 0,toolActivities:[],transientIssue:void 0,turnOutcome:void 0}))},S=($,B="assistant")=>{if(!m())return;f(),this.updateState(this.textState,{workingDescription:void 0}),B==="assistant"&&(this.lastVisibleProgressAtMs.value=Date.now()),d||(d=!0,this.liveStreamMessageId.value=u,this.sharedMessages.value=[...this.sharedMessages.value,{id:u,text:"",sender:B==="system"?"system":"agent",timestamp:new Date().toISOString()}]);let ae=this.liveSegments.value,he=ae[ae.length-1];this.liveSegments.value=he?.kind==="text"?[...ae.slice(0,-1),{kind:"text",content:he.content+$}]:[...ae,{kind:"text",content:$}];let te=this.sharedMessages.value,K=te[te.length-1];K?.id===u&&(K.text+=$,this.sharedMessages.value=[...te])},z=$=>{if(!m())return;if(f(),p=!0,$.sender==="agent"&&Bs($.text)){this.liveSegments.value=[],this.liveStreamMessageId.value=void 0,this.sharedMessages.value=this.sharedMessages.value.filter(de=>de.id!==u);return}d=!0;let B=$.sender==="system"||$.turnOutcome==="failed"?"failed":"completed";this.finishToolActivities(B);let ae=this.textState.value.toolActivities,he=$.toolActivities?.length||!ae?.length?$:{...$,toolActivities:ae};this.liveSegments.value=[],this.liveStreamMessageId.value=void 0,this.updateState(this.textState,{workingDescription:void 0,toolActivities:[],turnOutcome:void 0});let te=this.sharedMessages.value,K=te.findIndex(de=>de.id===he.id);if(K>=0)this.sharedMessages.value=[...te.slice(0,K),he,...te.slice(K+1)];else{let de=te[te.length-1];this.sharedMessages.value=de?.id===u?[...te.slice(0,-1),he]:[...te,he]}he.sender==="system"&&he.issue?.bucket==="account"?this.updateState(this.textState,{sendBlockedReason:"account"}):he.sender==="system"&&he.issue?.code&&gE.has(he.issue.code)&&this.updateState(this.textState,{sendBlockedReason:"agent_deleted"})},T=$=>{if(!m())return;if(!d&&!p){L("empty_stream \u2014 assistant returned no content");return}this.finishToolActivities("completed");let B=this.sharedMessages.value,ae=B[B.length-1];ae?.id===u&&ae.sender==="agent"&&Bs(ae.text)&&(this.sharedMessages.value=B.slice(0,-1)),$&&(this.conversationId=$),this.updateState(this.textState,{isThinking:!1,workingDescription:void 0,transientIssue:void 0}),this.settings.onTurnCompleted?.($)},L=$=>{if(!m())return;if(this.runningStreamToken!==c){this.consumeQueuedThrough(a),this.sharedMessages.value=this.sharedMessages.value.filter(K=>K.id!==a),this.composerState.value.text||(this.composerState.value={...this.composerState.value,text:e,pendingAttachments:t??[]});return}this.updateState(this.textState,{workingDescription:void 0,turnOutcome:"failed"}),this.finishToolActivities("failed");let B=this.sharedMessages.value,ae=B[B.length-1];if(ae?.id===u&&!ae.text&&(this.sharedMessages.value=B.slice(0,-1)),typeof $=="object"&&$.code&&$.error){let K=bO($);K.surface==="transient"?this.updateState(this.textState,{isThinking:!1,transientIssue:K.issue}):K.surface==="transcript"?(this.addMessage(yO($),"system",void 0,K.issue),this.updateState(this.textState,{isThinking:!1,...K.sendBlockedReason?{sendBlockedReason:K.sendBlockedReason}:{}})):this.handleError(Error($.error));return}let he=typeof $=="string"?$:$.error,te=this.mapChatError(he);this.isTransientError(he)?(this.logger.warn("Chat turn failed (transient):",{raw:he,friendly:te}),this.addMessage(te,"system"),this.updateState(this.textState,{isThinking:!1})):this.handleError(Error(te),he)},j=$=>{if(!m())return;f();let B=$.trim();this.updateState(this.textState,{workingDescription:B||void 0})},D=$=>{if(m()){if(f(),this.lastVisibleProgressAtMs.value=Date.now(),$.status==="started"){let B=this.liveSegments.value,ae=B[B.length-1];ae?.kind==="work"?ae.activityIds.includes($.activityId)||(this.liveSegments.value=[...B.slice(0,-1),{kind:"work",activityIds:[...ae.activityIds,$.activityId]}]):this.liveSegments.value=[...B,{kind:"work",activityIds:[$.activityId]}]}this.updateToolActivity($)}},U=()=>{m()&&this.updateState(this.textState,{workingDescription:void 0})};try{this.settings.onTurnStarted?.(),await(n?n({message:e,attachments:t,conversationId:this.conversationId,history:this.buildHistory(),onDelta:S,onMessage:z,onDone:T,onError:L,onStatus:j,onToolActivity:D,onWorkingEnd:U}):i.chat.chatStreamPublic({handle:this._agent.handle.value,message:e,attachments:t,anonymousId:i.user.generateAnonId(),context:this.getDynamicSettings().context||void 0,onDelta:S,onMessage:z,onDone:T,onError:L,onStatus:j,onToolActivity:D,onWorkingEnd:U}))}catch($){L($.message||"Something went wrong")}}async stopChatTurn(){if(this.textState.value.isThinking){this.runningStreamToken!==void 0&&this.suppressedStreamTokens.add(this.runningStreamToken),this.runningStreamToken=void 0,this.updateState(this.textState,{isThinking:!1,turnOutcome:"stopped",workingDescription:void 0,transientIssue:void 0});try{await this.settings.cancelChatTurnFn?.({conversationId:this.conversationId})}catch(e){this.logger.warn("stopChatTurn: cancel failed",{conversationId:this.conversationId,error:e instanceof Error?e.message:String(e)})}}}buildHistory(){return this.sharedMessages.value.filter(e=>e.sender==="user"||e.sender==="agent").slice(-20).map(e=>({role:e.sender==="user"?"user":"assistant",content:e.text,...e.attachments?.length?{attachments:e.attachments}:{}})).filter(e=>e.content.length>0||e.attachments&&e.attachments.length>0)}loadMessages(e){this.conversationId=e.conversationId;let t=this.sharedMessages.value,n=e.messages.filter(r=>r.sender!=="agent"||!Bs(r.text)),i=new Set(n.map(r=>r.id));this.sharedMessages.value=[...n,...t.filter(r=>!i.has(r.id))],e.activeToolActivities?.length&&(e.activeToolActivities.forEach(r=>this.rememberToolActivity(r)),this.updateState(this.textState,{isThinking:!0,workingDescription:void 0,toolActivities:e.activeToolActivities,transientIssue:void 0}))}async destroy(){this.clearBoundaryTimer(),this.voiceRecorder.teardown(),await this.endConversation()}};wO={key:0,class:"absolute inset-0 flex items-center justify-center"},da=Ae({__name:"ElAgentButton",props:{theme:{default:"primary"},size:{default:"lg"},loading:{type:Boolean,default:!1},icon:{},iconAfter:{}},setup(e){let t=N(()=>({primary:"bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",green:"bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",red:"bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",default:"bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",dark:"bg-theme-900 border-transparent hover:bg-theme-800"})[e.theme]),n=N(()=>({sm:"px-4 py-2 text-sm",md:"px-6 py-3 text-base",lg:"px-8 py-4 text-base"})[e.size]),i=N(()=>({sm:"size-4",md:"size-4",lg:"size-5"})[e.size]);return(r,o)=>(v(),x("button",{class:V(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",[t.value,n.value]])},[e.loading?(v(),x("div",wO,[...o[0]||(o[0]=[y("i",{class:"i-svg-spinners-90-ring-with-bg size-5"},null,-1)])])):q("",!0),y("span",{class:V(["flex items-center gap-2 transition-opacity duration-200",e.loading?"opacity-0":"opacity-100"])},[e.icon?(v(),x("i",{key:0,class:V([e.icon,i.value])},null,2)):q("",!0),er(r.$slots,"default"),e.iconAfter?(v(),x("i",{key:1,class:V([e.iconAfter,i.value])},null,2)):q("",!0)],2)],2))}}),kO=["value"],Ed=Ae({__name:"AgentInputEmail",props:{modelValue:{default:""}},emits:["update:modelValue"],setup(e,{emit:t}){let n=t;return(i,r)=>(v(),x("input",{name:"username",type:"email",inputmode:"email",autocomplete:"username",autocapitalize:"off",autocorrect:"off",spellcheck:"false",placeholder:"Enter your email",value:e.modelValue,class:"w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",style:{"font-size":"16px"},onInput:r[0]||(r[0]=o=>n("update:modelValue",o.target.value))},null,40,kO))}}),_O=["placeholder","value"],Id=Ae({__name:"AgentInputOneTimeCode",props:{modelValue:{},length:{},focusFirst:{type:Boolean}},emits:["update:modelValue","autoSubmit"],setup(e,{emit:t}){let n=e,i=t,r=Y(null),o=N(()=>"0".repeat(n.length));It(()=>{n.focusFirst&&!("ontouchstart"in window)&&r.value?.focus()});function a(s){let c=s.target.value.replace(/\D/g,"").slice(0,n.length);i("update:modelValue",c),c.length===n.length&&i("autoSubmit",c)}return(s,c)=>(v(),x("input",{ref_key:"input",ref:r,name:"one-time-code",type:"text",inputmode:"numeric",autocomplete:"one-time-code",autocapitalize:"off",autocorrect:"off",spellcheck:"false",enterkeyhint:"done",placeholder:o.value,value:e.modelValue,class:"w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",style:{"font-size":"16px"},onInput:a},null,40,_O))}}),$O={class:"relative flex-shrink-0"},SO=["src","alt"],EO={class:"absolute top-1 right-1"},IO={key:1,class:"size-3 bg-theme-400 rounded-full ring-2 ring-white"},TO={class:"min-w-0"},Td=Ae({__name:"ElModeHeader",props:{agent:{},size:{default:"md"},isOnline:{type:Boolean,default:!1},layout:{default:"centered"}},setup(e){return(t,n)=>(v(),x("div",{class:V(["flex gap-4",[e.layout==="centered"?"flex-col items-center text-center":"flex-row items-center justify-center"]])},[y("div",$O,[y("div",{class:V(["rounded-full overflow-hidden border-white",e.size==="lg"?"w-20 h-20 sm:w-24 sm:h-24 border-4":"w-16 sm:size-16 border-2"])},[y("img",{src:e.agent.avatarUrl.value,alt:e.agent.displayName.value,class:"w-full h-full object-cover",onError:n[0]||(n[0]=(...i)=>Ie(al)&&Ie(al)(...i))},null,40,SO)],2),y("div",EO,[e.isOnline?(v(),x(ge,{key:0},[n[1]||(n[1]=y("div",{class:"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",style:{"animation-duration":"3s"}},null,-1)),n[2]||(n[2]=y("div",{class:"size-3 bg-green-500 rounded-full ring-2 ring-white"},null,-1))],64)):(v(),x("div",IO))])]),y("div",TO,[y("h1",{class:V(["font-light text-white mb-1 truncate",[e.size==="lg"?"text-3xl mb-2":"text-xl sm:text-2xl tracking-wide leading-tight",e.layout==="horizontal"?"text-white/95":""]])},ce(e.agent.displayName.value),3),y("p",{class:V(["font-light line-clamp-1",[e.size==="lg"?"text-base text-white/60":"text-sm sm:text-base",e.layout==="horizontal"?"text-white/70 truncate":"text-white/60"]])},ce(e.layout==="horizontal"?e.agent.title.value||"Assistant":e.agent.title.value),3)])],2))}}),zO={class:"relative shrink-0 rounded-full"},NO=["src","alt"],CO=["src","alt"],AO=["aria-label"],$b=Ae({__name:"AgentAvatar",props:{agent:{},showStatus:{type:Boolean,default:!0},showOwnerMark:{type:Boolean,default:!0},isLight:{type:Boolean,default:!0}},setup(e){let t={green:"bg-green-500",amber:"bg-amber-500",red:"bg-red-500",grey:"bg-theme-300"},n=N(()=>{let o=e.agent.state.value;return e.showStatus&&o.lifecycle!=="unknown"?t[o.color]:null}),i={width:"clamp(7px, 14%, 14px)",height:"clamp(7px, 14%, 14px)",top:"calc(14.6% - clamp(3.5px, 7%, 7px))",right:"calc(14.6% - clamp(3.5px, 7%, 7px))"},r=N(()=>e.isLight?"ring-white":"ring-theme-900");return(o,a)=>(v(),x("div",zO,[y("img",{src:e.agent.avatarUrl.value,alt:e.agent.displayName.value,class:V(["size-full rounded-full object-cover ring-1",e.isLight?"ring-black/5":"ring-white/10"])},null,10,NO),e.showOwnerMark&&e.agent.ownerMarkUrl.value?(v(),x("img",{key:0,src:e.agent.ownerMarkUrl.value,alt:e.agent.owner.value?.fullName?`Owned by ${e.agent.owner.value.fullName}`:"Owner",class:V(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2",r.value])},null,10,CO)):q("",!0),n.value?(v(),x("span",{key:1,role:"status","aria-label":e.agent.state.value.tooltip,class:V(["absolute z-10 rounded-full ring-2",[n.value,r.value]]),style:i},null,10,AO)):q("",!0),n.value&&e.agent.state.value.lifecycle==="running"?(v(),x("span",{key:2,"aria-hidden":"true",class:V(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]",n.value]),style:i},null,2)):q("",!0)]))}}),OO={key:0,class:"sr-only",role:"status","aria-live":"polite"},DO=["aria-expanded","disabled"],PO=["aria-expanded"],RO={class:"flex w-5 shrink-0 justify-center self-stretch","aria-hidden":"true"},MO=["data-journal-row"],UO={class:"flex w-5 shrink-0 flex-col items-center self-stretch","aria-hidden":"true"},jO={class:"flex h-[17px] shrink-0 items-center"},LO={key:0,class:"sr-only"},mb=Ae({__name:"AgentToolActivityGroup",props:{model:{},isLight:{type:Boolean}},setup(e){let t=e,n=Xe(!1);function i(){n.value=!n.value}let r=N(()=>t.model.outcome==="completed"),o=N(()=>t.model.hiddenRows.length),a=N(()=>t.model.hint??(t.model.terminal?.tone==="active"?t.model.terminal.label:void 0)),s=N(()=>{let d=t.model;return r.value?n.value?d.hiddenRows:[]:[...n.value?d.hiddenRows:[],...d.visibleRows,...d.terminal?[d.terminal]:[]]}),c=N(()=>t.isLight?{spine:"bg-theme-200",dashed:"border-theme-300",doneMark:"text-theme-400",failedMark:"text-theme-500",activeLine:"text-theme-900",stoppedSquare:"bg-theme-500",muted:"text-theme-500",ring:"focus-visible:ring-theme-900"}:{spine:"bg-white/15",dashed:"border-white/25",doneMark:"text-white/45",failedMark:"text-white/60",activeLine:"text-white",stoppedSquare:"bg-white/55",muted:"text-white/55",ring:"focus-visible:ring-white"}),u=N(()=>{let d=t.isLight;return{done:{statusWord:"completed",label:d?"text-[12.5px] text-theme-500":"text-[12.5px] text-white/55",station:{tag:"i",class:`i-tabler-check size-3 ${c.value.doneMark}`}},active:{statusWord:"in progress",label:d?"text-[13px] font-medium text-theme-900":"text-[13px] font-medium text-white",station:{tag:"span",class:`chat-pulse-dot size-1.5 rounded-full bg-current ${c.value.activeLine}`}},failed:{statusWord:"failed",label:d?"text-[12.5px] font-medium text-theme-700":"text-[12.5px] font-medium text-white/80",station:{tag:"i",class:`i-tabler-alert-circle size-3.5 ${c.value.failedMark}`}},stopped:{label:d?"text-[13px] font-medium text-theme-600":"text-[13px] font-medium text-white/70",station:{tag:"span",class:`size-[9px] rounded-[2px] ${c.value.stoppedSquare}`}},completed:{label:d?"text-[12.5px] text-theme-500":"text-[12.5px] text-white/55",station:{tag:"i",class:"i-tabler-circle-check size-3.5 text-green-600"}}}});return(d,p)=>(v(),x("div",{class:V(["w-full py-0.5",c.value.muted])},[a.value?(v(),x("span",OO,ce(a.value),1)):q("",!0),r.value?(v(),x("button",{key:1,type:"button","data-test":"messaging-tool-activity-summary","data-journal-disclosure":"","aria-expanded":n.value,disabled:o.value===0,class:V(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default",c.value.ring]),onClick:i},[p[0]||(p[0]=y("i",{"data-journal-station":"completed",class:"i-tabler-circle-check size-3.5 shrink-0 text-green-600","aria-hidden":"true"},null,-1)),y("span",{class:V(["text-[12.5px] font-medium leading-none",c.value.muted])},ce(e.model.terminal?.label),3),o.value?(v(),x("i",{key:0,class:V(["size-[13px] shrink-0",[n.value?"i-tabler-chevron-down":"i-tabler-chevron-right",c.value.muted]]),"aria-hidden":"true"},null,2)):q("",!0)],10,DO)):o.value?(v(),x("button",{key:2,type:"button","data-test":"messaging-tool-activity-summary","data-journal-disclosure":"","aria-expanded":n.value,class:V(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",c.value.ring]),onClick:i},[y("span",RO,[y("span",{"data-journal-spine":"dashed",class:V(["w-0 border-l border-dashed",c.value.dashed])},null,2)]),y("span",{class:V(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none",c.value.muted])},[yt(ce(o.value)+" earlier updates ",1),y("i",{class:V(["size-3 shrink-0",n.value?"i-tabler-chevron-down":"i-tabler-chevron-right"]),"aria-hidden":"true"},null,2)],2)],10,PO)):q("",!0),(v(!0),x(ge,null,et(s.value,(m,f)=>(v(),x("div",{key:m.id,"data-test":"messaging-tool-activity-row","data-journal-row":m.tone,class:V([r.value?"pl-[22px]":"","flex gap-x-2.5"])},[y("div",UO,[y("span",jO,[(v(),Be(L1(u.value[m.tone].station.tag),{"data-journal-station":m.tone,class:V(u.value[m.tone].station.class)},null,8,["data-journal-station","class"]))]),f===s.value.length-1?q("",!0):(v(),x("span",{key:0,class:V(["w-px flex-1",c.value.spine])},null,2))]),y("div",{class:V(["min-w-0 flex-1",f===s.value.length-1?"":"pb-2"])},[y("span",{class:V(["relative block leading-snug",u.value[m.tone].label])},[yt(ce(m.label),1),u.value[m.tone].statusWord?(v(),x("span",LO,", "+ce(u.value[m.tone].statusWord),1)):q("",!0)],2),m.note?(v(),x("p",{key:0,class:V(["pt-0.5 text-[11.5px] leading-snug",c.value.muted])},ce(m.note),3)):q("",!0)],2)],10,MO))),128)),!r.value&&e.model.hint?(v(),x("p",{key:3,"data-test":"messaging-tool-activity-hint",class:V(["pl-[30px] pt-2.5 text-[12px] leading-snug",c.value.muted])},ce(e.model.hint),3)):q("",!0)],2))}});bE=Object.entries,V2=Object.setPrototypeOf,WO=Object.isFrozen,KO=Object.getPrototypeOf,GO=Object.getOwnPropertyDescriptor,Ut=Object.freeze,jt=Object.seal,sa=Object.create,yE=typeof Reflect<"u"&&Reflect,Sb=yE.apply,Eb=yE.construct;Ut||(Ut=function(t){return t}),jt||(jt=function(t){return t}),Sb||(Sb=function(t,n){var i=[...arguments].slice(2);return t.apply(n,i)}),Eb||(Eb=function(t){return new t(...[...arguments].slice(1))});ia=$t(Array.prototype.forEach),JO=$t(Array.prototype.lastIndexOf),F2=$t(Array.prototype.pop),oa=$t(Array.prototype.push),qO=$t(Array.prototype.splice),ci=Array.isArray,il=$t(String.prototype.toLowerCase),fb=$t(String.prototype.toString),B2=$t(String.prototype.match),Qs=$t(String.prototype.replace),Z2=$t(String.prototype.indexOf),YO=$t(String.prototype.trim),XO=$t(Number.prototype.toString),QO=$t(Boolean.prototype.toString),H2=typeof BigInt>"u"?null:$t(BigInt.prototype.toString),W2=typeof Symbol>"u"?null:$t(Symbol.prototype.toString),Ct=$t(Object.prototype.hasOwnProperty),el=$t(Object.prototype.toString),Nt=$t(RegExp.prototype.test),Li=e3(TypeError);K2=Ut("a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")),hb=Ut("svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")),gb=Ut(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),i3=Ut(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vb=Ut("math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")),o3=Ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G2=Ut(["#text"]),J2=Ut("accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")),bb=Ut("accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")),q2=Ut("accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")),hd=Ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a3=jt(/{{[\w\W]*|^[\w\W]*}}/g),s3=jt(/<%[\w\W]*|^[\w\W]*%>/g),l3=jt(/\${[\w\W]*/g),c3=jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),u3=jt(/^aria-[\-\w]+$/),Y2=jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),d3=jt(/^(?:\w+script|data):/i),p3=jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),m3=jt(/^html$/i),f3=jt(/^[a-z][.\w]*(-[.\w]+)+$/i),X2=jt(/<[/\w!]/g),Q2=jt(/<[/\w]/g),h3=jt(/<\/no(script|embed|frames)/i),g3=jt(/\/>/i),hr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},v3=function(){return typeof window>"u"?null:window},b3=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},eE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ai=function(t,n,i,r){return Ct(t,n)&&ci(t[n])?je(r.base?tr(r.base):{},t[n],r.transform):i};wE=xE();Bi=Cb();Fi={exec:()=>null};y3=((e="")=>{try{return!!RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Ft={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:aa(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:aa(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:aa(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:aa(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:aa(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:aa(e=>RegExp(`^ {0,${e}}>`))},x3=/^(?:[ \t]*(?:\n|$))+/,w3=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,k3=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ll=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_3=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ab=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,kE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_E=Le(kE).replace(/bull/g,Ab).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$3=Le(kE).replace(/bull/g,Ab).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ob=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,S3=/^[^\n]+/,Db=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,E3=Le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Db).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),I3=Le(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ab).getRegex(),zd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,T3=Le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Pb).replace("tag",zd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$E=e=>Le(Ob).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",e).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zd).getRegex(),z3=$E(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),N3=$E(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Rb={blockquote:Le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",N3).getRegex(),code:w3,def:E3,fences:k3,heading:_3,hr:ll,html:T3,lheading:_E,list:I3,newline:x3,paragraph:z3,table:Fi,text:S3},rE=Le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zd).getRegex(),C3={...Rb,lheading:$3,table:rE,paragraph:Le(Ob).replace("hr",ll).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",zd).getRegex()},A3={...Rb,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Pb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(Ob).replace("hr",ll).replace("heading",` *#{1,6} *[^
115
115
  ]`).replace("lheading",_E).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},O3=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,D3=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,SE=/^( {2,}|\\)\n(?!\s*$)/,P3=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pa=/[\p{P}\p{S}]/u,Nd=/[\s\p{P}\p{S}]/u,Mb=/[^\s\p{P}\p{S}]/u,R3=Le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Nd).getRegex(),EE=/(?!~)[\p{P}\p{S}]/u,M3=/(?!~)[\s\p{P}\p{S}]/u,U3=/(?:[^\s\p{P}\p{S}]|~)/u,j3=Le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",y3?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),IE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,L3=Le(IE,"u").replace(/punct/g,pa).getRegex(),V3=Le(IE,"u").replace(/punct/g,EE).getRegex(),TE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",F3=Le(TE,"gu").replace(/notPunctSpace/g,Mb).replace(/punctSpace/g,Nd).replace(/punct/g,pa).getRegex(),B3=Le(TE,"gu").replace(/notPunctSpace/g,U3).replace(/punctSpace/g,M3).replace(/punct/g,EE).getRegex(),Z3=Le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Mb).replace(/punctSpace/g,Nd).replace(/punct/g,pa).getRegex(),H3=Le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,pa).getRegex(),W3=Le("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Mb).replace(/punctSpace/g,Nd).replace(/punct/g,pa).getRegex(),K3=Le(/\\(punct)/,"gu").replace(/punct/g,pa).getRegex(),G3=Le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),J3=Le(Pb).replace("(?:-->|$)","-->").getRegex(),q3=Le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",J3).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Y3=Le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",wd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zE=Le(/^!?\[(label)\]\[(ref)\]/).replace("label",wd).replace("ref",Db).getRegex(),NE=Le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Db).getRegex(),X3=Le("reflink|nolink(?!\\()","g").replace("reflink",zE).replace("nolink",NE).getRegex(),nE=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ub={_backpedal:Fi,anyPunctuation:K3,autolink:G3,blockSkip:j3,br:SE,code:D3,del:Fi,delLDelim:Fi,delRDelim:Fi,emStrongLDelim:L3,emStrongRDelimAst:F3,emStrongRDelimUnd:Z3,escape:O3,link:Y3,nolink:NE,punctuation:R3,reflink:zE,reflinkSearch:X3,tag:q3,text:P3,url:Fi},Q3={...Ub,link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",wd).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wd).getRegex()},Ib={...Ub,emStrongRDelimAst:B3,emStrongLDelim:V3,delLDelim:H3,delRDelim:W3,url:Le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",nE).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Le(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",nE).getRegex()},e6={...Ib,br:Le(SE).replace("{2,}","*").getRegex(),text:Le(Ib.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vd={normal:Rb,gfm:C3,pedantic:A3},tl={normal:Ub,gfm:Ib,breaks:e6,pedantic:Q3},t6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},iE=e=>t6[e];kd=class{constructor(e){Z(this,"options",void 0),Z(this,"rules",void 0),Z(this,"lexer",void 0),this.options=e||Bi}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:sE(t[0]);return{type:"code",raw:n,codeBlockStyle:"indented",text:n.replace(this.rules.other.codeRemoveIndent,"")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],i=i6(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let i=si(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:si(t[0],`
116
116
  `),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:si(t[0],`
117
117
  `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=si(t[0],`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagelines/widget",
3
- "version": "1.0.873",
3
+ "version": "1.0.874",
4
4
  "description": "Embeddable PageLines agent widget for any website",
5
5
  "type": "module",
6
6
  "main": "./dist/widget.js",
@@ -45,7 +45,7 @@
45
45
  "vue-tsc": "^3.3.8"
46
46
  },
47
47
  "dependencies": {
48
- "@pagelines/sdk": "1.0.873"
48
+ "@pagelines/sdk": "1.0.874"
49
49
  },
50
50
  "scripts": {
51
51
  "dev": "vite --config vite.config.widget.ts",