import{a as ri}from"./chunk-JEBQFVFV.js";import{a as Pt}from"./chunk-7CAH5JY2.js";import{f as oi}from"./chunk-PVT2TCFK.js";import{a as ii}from"./chunk-S7TPI5WJ.js";import{a as jt}from"./chunk-5U7RRVH2.js";import{a as vt}from"./chunk-R6EOTM56.js";import{a as ti}from"./chunk-OIAL2MBO.js";import{a as Mt}from"./chunk-M7NRMR5C.js";import{a as ni}from"./chunk-2DOD3TZP.js";import{a as Nt}from"./chunk-VJNS2G4F.js";import{b as Kn,h as ei}from"./chunk-ZHB7Y3RV.js";import{a as Z,b as J}from"./chunk-5BQ7EGVC.js";import{a as Zn,c as Jn}from"./chunk-UACQJK7R.js";import{S as Gn,_ as je,da as jn,ea as Wn,j as Un,v as Ae,z as Ln}from"./chunk-Q232IBQN.js";import{i as Yn,j as Qn}from"./chunk-LGT7QKWT.js";import{Aa as Ve,Ba as z}from"./chunk-E4UUPK46.js";import{a as Fn}from"./chunk-AK5L5EKD.js";import{m as Yt}from"./chunk-K3AFQ46O.js";import{A as At,B as xt,C as bt,L as Ye,c as zn,i as Xe,j as Vn,l as Xn,p as qe,q as qn}from"./chunk-WWNBTMQ7.js";import{$c as F,Ac as v,Ad as K,Bc as it,Cc as yn,Da as E,Dc as In,Dd as le,Ea as A,Ec as f,Ed as $,F as Nn,Fc as ot,Fd as Oe,Gc as rt,Ic as N,Ja as vn,K as et,Kc as d,Kd as wn,Ma as gt,Ob as P,Oc as se,Pa as U,Pc as j,Qb as ht,Qc as Q,Qd as Hn,Rb as Tt,Sa as ve,Sc as Ot,Tb as ne,Tc as St,Uc as pe,Vc as R,Wa as Mn,Wc as X,X as tt,Yc as oe,Zc as T,_c as O,ad as Ge,bd as Bn,cd as Me,dd as Pe,e as Ne,ed as Re,ee as ze,fd as Vt,gd as Xt,ha as nt,hc as ie,hd as Fe,he as Et,id as at,j as Ke,jc as C,ke as ue,lc as u,ld as kn,le as $n,mc as ft,me as Dn,nc as Rn,nd as Ce,oc as I,pb as Ue,pc as B,pd as qt,qb as L,qc as b,rb as Pn,rc as l,rd as w,sa as mt,sc as c,sd as W,tc as g,td as q,uc as ce,vc as ae,wb as s,wc as Le,wd as ye,xa as Y,xc as he,yc as Te,zc as fe}from"./chunk-O7RN3KYY.js";import{f as xe}from"./chunk-MPPP2QUX.js";import{a as x}from"./chunk-ZE2KCNEA.js";import{a as te,b as De,j as ge}from"./chunk-CEWFFWI2.js";x();var ai="chatbot_pending_draft",si={web:$localize`Web`,page:$localize`Pages`,grouppage:$localize`Community Pages`,group:$localize`Communities`,externalsearchdocument:$localize`External Search`,resource:$localize`Resources`,faq:$localize`FAQs`,user:$localize`Users`,event:$localize`Events`,tool:$localize`Tools`,building:$localize`Buildings`,room:$localize`Rooms`,form:$localize`Forms`};x();x();x();var Se=(function(t){return t.USER="USER",t.CHATBOT="CHATBOT",t})(Se||{}),Ie=(function(t){return t.SOURCED="SOURCED",t.VERIFIED="VERIFIED",t.OPEN_DOMAIN="OPEN_DOMAIN",t})(Ie||{}),Qt=(function(t){return t.COURSE_SCHEDULE="courseSchedule",t.ADVISORS="advisors",t.BALANCES="balances",t.HOLDS_AND_RESTRICTIONS="holdsAndRestrictions",t.FINAL_GRADES="finalGrades",t.UPCOMING_ASSESSMENTS="upcomingAssessments",t.COURSE_CALENDAR="courseCalendar",t.JOB_OPPORTUNITIES="jobOpportunities",t.COURSE_LIST="courseList",t.IFRAME="iframe",t.HELPDESK="helpdesk",t.PLAIN_TEXT="plainText",t.GPA="gpa",t})(Qt||{});function Ki(t,o){t&1&&(l(0,"div",2),g(1,"icon",4),l(2,"span"),f(3,0),c()())}function eo(t,o){t&1&&(l(0,"div",3),g(1,"icon",5),l(2,"span"),f(3,1),c()())}var li=(()=>{class t{constructor(){this.answerType=$.required(),this.BotMessageAnswerType=Ie}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["bot-message-answer-type-label"]],inputs:{answerType:[1,"answerType"]},decls:2,vars:1,consts:()=>{let e;e=$localize`This answer is verified because it's taken directly from a database.`;let i;i=$localize`This answer is based on your school's data sources, or web search results.`;let n;n=$localize`Verified`;let r;return r=$localize`Sourced`,[n,r,["tooltip",e,1,"ai-message-label","ai-message-label--verified","mt-8"],["tooltip",i,1,"ai-message-label","ai-message-label--sourced","mt-8"],["name","common-grades",1,"size-16"],["name","common-university",1,"size-16"]]},template:function(i,n){i&1&&C(0,Ki,4,0,"div",2)(1,eo,4,0,"div",3),i&2&&u(n.answerType()===n.BotMessageAnswerType.VERIFIED?0:n.answerType()===n.BotMessageAnswerType.SOURCED?1:-1)},dependencies:[z,Ve],styles:["[_nghost-%COMP%]{display:contents}.ai-message-label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:4px 10px 4px 8px;border-radius:999px;border:.5px solid var(--border-color-base);font-size:12px;line-height:1}.ai-message-label--sourced[_ngcontent-%COMP%]{background:var(--n1-transp);color:var(--color-quiet)}.ai-message-label--verified[_ngcontent-%COMP%]{background:var(--g1);color:var(--g3)}"],changeDetection:0})}}return t})();x();function to(t,o){if(t&1){let e=v();l(0,"button",2),N("click",function(){E(e);let n=d();return A(n.download())}),l(1,"div",3)(2,"div",4),T(3),c()(),g(4,"icon",5),c()}if(t&2){let e=d();ie("aria-label",e.getDownloadAriaLabel(e.source().title)),s(3),O(e.source().title)}}function no(t,o){if(t&1&&(l(0,"a",1)(1,"div",3)(2,"div",4),T(3),c(),l(4,"div",6),T(5),c()(),g(6,"icon",7),c()),t&2){let e=d();b("href",e.source().link,L),ie("aria-label",e.getLinkAriaLabel(e.source().title)),s(3),O(e.source().title),s(2),O(e.source().link)}}var Rt=(()=>{class t{constructor(){this.resourcesService=Y(oi),this.source=$.required(),this.isFileResource=K(()=>{let e=this.source();return e.source==="internal"&&e.object_type==="resource"&&e.resource_type===Kn.FILE})}download(){let e=this.source();e.source==="internal"&&e.object_type==="resource"&&this.resourcesService.downloadResourceById(e.id)}getLinkAriaLabel(e){return $localize`:open an AI Agent source link in a new browser tab:Open source ${e}:source title: in a new tab`}getDownloadAriaLabel(e){return $localize`:download an AI Agent source file:Download source ${e}:source title:`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-source-link"]],inputs:{source:[1,"source"]},decls:2,vars:1,consts:[["type","button",1,"d-flex","align-items-center","pa-12","gap-12","hoverable","rounded","w-100","link-unstyled","bg-n1"],["target","_blank","rel","noopener noreferrer",1,"d-flex","align-items-center","pa-12","gap-12","hoverable","rounded","w-100","link-unstyled","bg-n1",3,"href"],["type","button",1,"d-flex","align-items-center","pa-12","gap-12","hoverable","rounded","w-100","link-unstyled","bg-n1",3,"click"],[1,"d-flex","flex-column","flex-grow","minw-0"],[1,"text-md","text-wrap-all"],["name","common-download",1,"size-16","text-quiet","flex-no-shrink"],[1,"text-truncate","text-sm","text-quiet"],["name","common-open",1,"size-16","text-quiet","flex-no-shrink"]],template:function(i,n){i&1&&C(0,to,5,2,"button",0)(1,no,7,4,"a",1),i&2&&u(n.isFileResource()?0:1)},dependencies:[z],encapsulation:2,changeDetection:0})}}return t})();x();var io=(t,o)=>o.identity;function oo(t,o){if(t&1&&g(0,"chatbot-source-link",4),t&2){let e=o.$implicit;b("source",e)}}function ro(t,o){if(t&1&&(l(0,"div",2),I(1,oo,1,1,"chatbot-source-link",4,io),c()),t&2){let e=d();b("id",e.sourcesListId),s(),B(e.sources())}}function ao(t,o){t&1&&(l(0,"span"),f(1,0),c(),g(2,"icon",5))}function so(t,o){t&1&&(l(0,"span"),f(1,1),c(),g(2,"icon",6))}var ci=(()=>{class t{constructor(){this.sources=$.required(),this.sourcesListId=`sources-list-${t.nextId++}`,this.expanded=U(!1)}static{this.nextId=0}toggle(){this.expanded.update(e=>!e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-sources"]],inputs:{sources:[1,"sources"]},decls:4,vars:8,consts:()=>{let e;e=$localize`Hide Sources`;let i;return i=$localize`Show Sources`,[e,i,[1,"d-flex","flex-column","gap-4","mt-8",3,"id"],["type","button",1,"btn","sm","secondary","w-100","inset-focus-indicator",3,"click"],[3,"source"],["name","internal-chevron-up"],["name","internal-chevron-down"]]},template:function(i,n){i&1&&(C(0,ro,3,1,"div",2),l(1,"button",3),N("click",function(){return n.toggle()}),C(2,ao,3,0)(3,so,3,0),c()),i&2&&(u(n.expanded()?0:-1),s(),X("mt-4",n.expanded())("mt-8",!n.expanded()),ie("aria-controls",n.expanded()?n.sourcesListId:void 0)("aria-expanded",n.expanded()),s(),u(n.expanded()?2:3))},dependencies:[Rt,z],encapsulation:2,changeDetection:0})}}return t})();x();x();var _i=(()=>{class t{constructor(){this.classes="w-100"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-gpa"]],hostVars:2,hostBindings:function(i,n){i&2&&oe(n.classes)},inputs:{messageUpgrade:"messageUpgrade"},decls:4,vars:1,consts:()=>{let e;return e=$localize`:e.g. Your GPA is 3.48:Your GPA is`,[e]},template:function(i,n){i&1&&(ce(0,"div")(1,"span"),f(2,0),ae(),T(3),ae()),i&2&&(s(3),F(" ",n.messageUpgrade.gpa,` `))},encapsulation:2,changeDetection:0})}}return t})();x();var lo=t=>["/profile",t],co=(t,o)=>o.name;function _o(t,o){if(t&1&&g(0,"img",7),t&2){let e=d(2);ie("src",e.selectedAdvisor.profile_pic,L)}}function po(t,o){t&1&&g(0,"icon",8)}function Co(t,o){if(t&1&&(l(0,"div",10),T(1),c()),t&2){let e=d(2);s(),O(e.selectedAdvisor.type)}}function uo(t,o){if(t&1&&(l(0,"a",11),T(1),c()),t&2){let e=d(2);b("href",at("mailto:",e.selectedAdvisor.email||e.selectedAdvisor.contact_email),L),s(),F(" ",e.selectedAdvisor.email||e.selectedAdvisor.contact_email," ")}}function mo(t,o){if(t&1&&(l(0,"a",12),T(1),c()),t&2){let e=d(2);b("href",at("tel:",e.selectedAdvisor.contact_phone),L),s(),O(e.selectedAdvisor.contact_phone)}}function go(t,o){if(t&1){let e=v();l(0,"button",23),N("click",function(){let n=E(e).$index,r=d(2);return A(r.selectAdvisor(n))}),g(1,"span",24),c()}if(t&2){let e=o.$index,i=d(2);s(),oe(i.messageUpgrade.advisors.indexOf(i.selectedAdvisor)===e?"bg-n5":"bg-n4")}}function ho(t,o){if(t&1&&(l(0,"a",20)(1,"span"),f(2,0),c()()),t&2){let e=d(2);b("routerLink",Ce(1,lo,e.selectedAdvisor.linkId))}}function To(t,o){if(t&1&&(l(0,"a",21)(1,"span"),f(2,1),c()()),t&2){let e=d(2);b("href",e.selectedAdvisor.non_portal_linkId,L)}}function fo(t,o){t&1&&(l(0,"button",22)(1,"span"),f(2,2),c()())}function Oo(t,o){if(t&1){let e=v();l(0,"div",4)(1,"div",5)(2,"div",6),C(3,_o,1,1,"img",7)(4,po,1,0,"icon",8),c(),l(5,"div",9),T(6),c(),C(7,Co,2,1,"div",10),C(8,uo,2,3,"a",11),C(9,mo,2,3,"a",12),c(),l(10,"div",13),I(11,go,2,2,"button",14,co),c(),l(13,"div",15),N("click",function(){E(e);let n=d();return A(n.previousAdvisor())}),g(14,"icon",16),c(),l(15,"div",17),N("click",function(){E(e);let n=d();return A(n.nextAdvisor())}),g(16,"icon",18),c()(),l(17,"div",19),C(18,ho,3,3,"a",20)(19,To,3,1,"a",21)(20,fo,3,0,"button",22),c()}if(t&2){let e=d();R("height",244,"px"),s(3),u(e.selectedAdvisor.profile_pic?3:4),s(3),F(" ",e.selectedAdvisor.preferred_name||e.selectedAdvisor.name," "),s(),u(e.selectedAdvisor.type?7:-1),s(),u(e.selectedAdvisor.email||e.selectedAdvisor.contact_email?8:-1),s(),u(e.selectedAdvisor.contact_phone?9:-1),s(2),B(e.messageUpgrade.advisors),s(2),R("top","calc(50% - 16px)")("width",32,"px")("height",32,"px"),s(2),R("top","calc(50% - 16px)")("width",32,"px")("height",32,"px"),s(3),u(e.selectedAdvisor.linkId?18:e.selectedAdvisor.non_portal_linkId?19:20)}}var di=(()=>{class t{constructor(){this.advisorCountPluralMap={"=1":$localize`You have 1 advisor:`,other:$localize`:# > 1:You have # advisors:`}}ngOnInit(){this.selectedAdvisor=this.messageUpgrade.advisors[0]}nextAdvisor(){let e=this.messageUpgrade.advisors.indexOf(this.selectedAdvisor);this.selectedAdvisor=this.messageUpgrade.advisors[(e+1)%this.messageUpgrade.advisors.length]}previousAdvisor(){let e=this.messageUpgrade.advisors.indexOf(this.selectedAdvisor);this.selectedAdvisor=this.messageUpgrade.advisors[(e-1+this.messageUpgrade.advisors.length)%this.messageUpgrade.advisors.length]}selectAdvisor(e){this.selectedAdvisor=this.messageUpgrade.advisors[e]}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-advisors"]],inputs:{messageUpgrade:"messageUpgrade"},decls:5,vars:5,consts:()=>{let e;e=$localize`profile picture`;let i;i=$localize`profile picture placeholder`;let n;n=$localize`View Profile`;let r;r=$localize`View Profile`;let a;return a=$localize`View Profile`,[n,r,a,[1,"rounded-double","bg-white","ba","mt-8"],[1,"pt-24","px-24","pb-16","pos-rel","d-flex","flex-column"],[1,"px-24","d-flex","flex-column","align-items-center","text-center"],[1,"avatar","size-64","mb-12"],["alt",e,1,"avatar-img"],["name","common-user","aria-label",i,1,"avatar-placeholder"],[1,"h3","text-truncate","w-100"],[1,"text-quiet"],["target","_blank",1,"text-md","text-quiet",3,"href"],[1,"text-md","text-quiet",3,"href"],[1,"d-flex","pt-12","mt-auto","justify-content-center"],["type","button",1,"pa-4"],["type","button",1,"btn","md","floating","circle","pos-abs","left-8",3,"click"],["name","internal-chevron-left-ios",1,"size-16"],["type","button",1,"btn","md","floating","circle","pos-abs","right-8",3,"click"],["name","internal-chevron-right-ios",1,"size-16"],[1,"py-12","px-16","bt"],[1,"btn","md","primary","w-100",3,"routerLink"],["target","_blank",1,"btn","md","primary","w-100",3,"href"],["type","button","disabled","",1,"btn","md","primary","w-100"],["type","button",1,"pa-4",3,"click"],[1,"d-block","size-8","circle"]]},template:function(i,n){i&1&&(l(0,"div"),T(1),w(2,"i18nPlural"),c(),l(3,"div",3),C(4,Oo,21,20),c()),i&2&&(s(),O(q(2,2,n.messageUpgrade.advisors.length,n.advisorCountPluralMap)),s(3),u(n.selectedAdvisor?4:-1))},dependencies:[z,Un,ue],encapsulation:2,changeDetection:0})}}return t})();x();var pi=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-iframe"]],inputs:{messageUpgrade:"messageUpgrade"},decls:3,vars:5,consts:[[1,"rounded","bg-white","ba","overflow-hidden"],[1,"w-100","h-100","bn",3,"src"]],template:function(i,n){i&1&&(ce(0,"div",0),Le(1,"iframe",1),w(2,"safeUrl"),ae()),i&2&&(R("max-height",244,"px"),s(),it("src",W(2,3,n.messageUpgrade.url),Pn))},dependencies:[ei],encapsulation:2,changeDetection:0})}}return t})();x();var So=["backButton"],Eo=["listButtons"],Ao=(t,o)=>o.name+o.time,xo=(t,o)=>o.courseNumber;function bo(t,o){if(t&1&&(l(0,"div",22)(1,"a",23)(2,"span"),f(3,3),c()()()),t&2){let e=d().$implicit;s(),b("href",e.link,L)}}function No(t,o){if(t&1&&(l(0,"div",15)(1,"div",17),g(2,"icon",18),l(3,"div",12),T(4),w(5,"dateFormat"),c()(),l(6,"div",19),g(7,"icon",20),l(8,"div",12)(9,"span",21),T(10),c(),T(11),w(12,"stripHtml"),c()(),C(13,bo,4,1,"div",22),c()),t&2){let e=o.$implicit;s(4),F(" ",q(5,6,e.time,"MMM D, hh:mma")," "),s(3),R("margin-top",2,"px"),s(3),F("",e.name,":"),s(),F(" ",W(12,9,e.description)," "),s(2),u(e.link?13:-1)}}function vo(t,o){t&1&&(l(0,"div",16),f(1,4),c())}function Mo(t,o){if(t&1){let e=v();l(0,"div",7)(1,"div",9)(2,"button",10,0),N("click",function(){E(e);let n=d(2);return A(n.deselectCourse())}),g(4,"icon",11),l(5,"span",12),f(6,2),c()()(),l(7,"div",13),T(8),c(),l(9,"ngx-simplebar",14),I(10,No,14,11,"div",15,Ao,!1,vo,2,0,"div",16),c()()}if(t&2){let e=d(2);s(8),O(e.selectedCourse.courseTitle),s(),R("max-height",360,"px"),s(),B(e.futureEventsForSelectedCourse)}}function Po(t,o){t&1&&g(0,"hr",29)}function Ro(t,o){if(t&1){let e=v();l(0,"button",25,1),N("click",function(){let n=E(e).$implicit,r=d(3);return A(r.selectCourse(n))}),l(2,"div",26)(3,"div",27),T(4),c(),l(5,"div"),T(6),c()(),g(7,"icon",28),c(),C(8,Po,1,0,"hr",29)}if(t&2){let e=o.$implicit,i=o.$index,n=o.$count;s(4),O(e.courseNumber),s(2),O(e.courseTitle),s(2),u(i!==n-1?8:-1)}}function yo(t,o){if(t&1&&(l(0,"ngx-simplebar",24),I(1,Ro,9,3,null,null,xo),c()),t&2){let e=d(2);R("max-height",360,"px"),s(),B(e.messageUpgrade.courses)}}function Io(t,o){if(t&1&&(l(0,"div",6),C(1,Mo,13,4,"div",7)(2,yo,3,2,"ngx-simplebar",8),c()),t&2){let e=d();s(),u(e.selectedCourse?1:2)}}function Bo(t,o){t&1&&(l(0,"div"),f(1,5),c())}var Ci=(()=>{class t{selectCourse(e){this.selectedCourse=e,setTimeout(()=>{this.backButton?.nativeElement.focus()})}deselectCourse(){let e=this.messageUpgrade.courses.indexOf(this.selectedCourse);this.selectedCourse=void 0,setTimeout(()=>{this.listButtons.get(e)?.nativeElement.focus()})}get futureEventsForSelectedCourse(){return this.selectedCourse.events.filter(e=>Ae.from(e.time).isAfter(Ae.now()))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-course-calendar"]],viewQuery:function(i,n){if(i&1&&se(So,5)(Eo,5),i&2){let r;j(r=Q())&&(n.backButton=r.first),j(r=Q())&&(n.listButtons=r)}},inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:1,consts:()=>{let e;e=$localize`:back to all courses:Back`;let i;i=$localize`View in Moodle`;let n;n=$localize`No upcoming calendar events`;let r;return r=$localize`No courses found.`,[["backButton",""],["listButtons",""],e,i,n,r,[1,"rounded-double","bg-white","ba","mt-8"],[1,"px-8","pt-8","d-flex","flex-column"],[1,"pa-8",3,"max-height"],[1,"mb-12"],["type","button",1,"btn","md","link","active",3,"click"],["name","internal-chevron-left-ios",1,"size-16","mr-4"],[1,"text-md"],[1,"h3","px-8","pb-12"],[1,"px-8","flex-grow","minh-0"],[1,"py-12"],[1,"py-12","text-quiet","text-md"],[1,"d-flex","align-items-center","gap-8","mb-4"],["name","common-calendar",1,"size-16"],[1,"d-flex","align-items-start","gap-8"],["name","common-description",1,"size-16"],[1,"text-bold"],[1,"mt-8"],["target","_blank",1,"btn","sm","secondary",3,"href"],[1,"pa-8"],["type","button",1,"d-flex","align-items-center","pa-12","hoverable","rounded","w-100","text-left",3,"click"],[1,"flex-grow"],[1,"text-sm","text-quiet"],["name","internal-chevron-right-ios",1,"size-16"],["role","separator",1,"mx-8"]]},template:function(i,n){i&1&&C(0,Io,3,1,"div",6)(1,Bo,2,0,"div"),i&2&&u(n.messageUpgrade.courses!=null&&n.messageUpgrade.courses.length?0:1)},dependencies:[J,Z,z,ii,je],encapsulation:2,changeDetection:0})}}return t})();x();var ui=(()=>{class t{constructor(){this.classes="w-100"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-plain-text"]],hostVars:2,hostBindings:function(i,n){i&2&&oe(n.classes)},inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:1,template:function(i,n){i&1&&(ce(0,"div"),T(1),ae()),i&2&&(s(),O(n.messageUpgrade.content))},encapsulation:2,changeDetection:0})}}return t})();x();var ko=(t,o)=>o.label,wo=(t,o)=>o.name;function Ho(t,o){if(t&1&&(l(0,"div",8)(1,"div",9),T(2),c(),l(3,"div",10),T(4),w(5,"number"),c()()),t&2){let e=o.$implicit,i=o.$index,n=o.$count;s(),X("text-bold",i===n-1),s(),F(" ",e.name," "),s(2),Ge(" ",e.currency,"",q(5,5,e.amount,"1.2-2")," ")}}function $o(t,o){if(t&1&&(l(0,"div")(1,"div",7),T(2),c(),I(3,Ho,6,8,"div",8,wo),c()),t&2){let e=o.$implicit;s(2),O(e.label),s(),B(e.data)}}function Do(t,o){if(t&1&&(l(0,"div",5)(1,"div",11),T(2),c(),l(3,"div",10),T(4),w(5,"number"),c()()),t&2){let e=d(2);s(2),O(e.messageUpgrade.totalLabel),s(2),Ge(" ",e.messageUpgrade.totalCurrency,"",q(5,3,e.messageUpgrade.totalAmount,"1.2-2")," ")}}function Uo(t,o){if(t&1&&(l(0,"div",6)(1,"a",12)(2,"span"),T(3),c()()()),t&2){let e=d(2);s(),b("href",e.messageUpgrade.ctaData.url,L),s(2),O(e.messageUpgrade.ctaData.text)}}function Lo(t,o){if(t&1&&(l(0,"div"),f(1,0),c(),l(2,"div",2)(3,"ngx-simplebar",3)(4,"div",4),I(5,$o,5,1,"div",null,ko),C(7,Do,6,6,"div",5),c()(),C(8,Uo,4,2,"div",6),c()),t&2){let e=d();s(3),R("max-height",292,"px"),s(2),B(e.messageUpgrade.balances),s(2),u(e.messageUpgrade.totalLabel&&e.messageUpgrade.totalAmount&&e.messageUpgrade.totalCurrency?7:-1),s(),u("ctaData"in e.messageUpgrade?8:-1)}}function Go(t,o){t&1&&(l(0,"div"),f(1,1),c())}var mi=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-balances"]],inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:1,consts:()=>{let e;e=$localize`Your balances are:`;let i;return i=$localize`Sorry, I could not find your balances.`,[e,i,[1,"rounded-double","bg-white","ba","mt-8","d-flex","flex-column"],[1,"px-12","py-8","flex-grow"],[1,"d-flex","flex-column","gap-16"],[1,"py-12","px-8","d-flex"],[1,"px-16","py-12","bt"],[1,"text-bold","py-12","px-8","bb"],[1,"py-12","px-8","bb","d-flex"],[1,"flex-grow"],[1,"text-bold"],[1,"flex-grow","text-bold"],[1,"btn","md","primary","w-100",3,"href"]]},template:function(i,n){i&1&&C(0,Lo,9,4)(1,Go,2,0,"div"),i&2&&u("balances"in n.messageUpgrade?0:1)},dependencies:[J,Z,Dn],encapsulation:2,changeDetection:0})}}return t})();x();var Fo=["backButton"],zo=["listButtons"],Vo=(t,o)=>o.name+o.course;function Xo(t,o){if(t&1&&(l(0,"div",19),T(1),c()),t&2){let e=d(3);s(),F(" ",e.selectedAssessment.courseCode," ")}}function qo(t,o){if(t&1){let e=v();l(0,"div",7)(1,"div",8)(2,"button",9,0),N("click",function(){E(e);let n=d(2);return A(n.deselectAssessment())}),g(4,"icon",10),l(5,"span",11),f(6,2),c()()(),l(7,"ngx-simplebar",12)(8,"div",13),T(9),c(),l(10,"div",14)(11,"div",15),g(12,"icon",16),l(13,"div"),T(14),c()(),l(15,"div",17),g(16,"icon",18),l(17,"div")(18,"div"),T(19),c(),C(20,Xo,2,1,"div",19),c()()(),l(21,"div",20),T(22),c()()(),l(23,"div",21)(24,"a",22)(25,"span"),f(26,3),c()()()}if(t&2){let e=d(2);s(7),R("max-height",227,"px"),s(2),O(e.selectedAssessment.name),s(5),O(e.dueString(e.selectedAssessment)),s(2),R("margin-top",2,"px"),s(3),O(e.selectedAssessment.course),s(),u(e.selectedAssessment.courseid?20:-1),s(2),O(e.selectedAssessment.description),s(2),b("href",e.selectedAssessment.url,L)}}function Yo(t,o){if(t&1&&(l(0,"div",19),T(1),c()),t&2){let e=d().$implicit;s(),O(e.courseCode)}}function jo(t,o){t&1&&g(0,"hr",29)}function Qo(t,o){if(t&1){let e=v();l(0,"button",24,1),N("click",function(){let n=E(e).$implicit,r=d(3);return A(r.selectAssessment(n))}),l(2,"div",25)(3,"div",19),T(4),c(),l(5,"div",26),T(6),c(),l(7,"div",27),T(8),c(),C(9,Yo,2,1,"div",19),c(),g(10,"icon",28),c(),C(11,jo,1,0,"hr",29)}if(t&2){let e=o.$implicit,i=o.$index,n=o.$count,r=d(3);s(4),O(r.dueString(e)),s(2),O(e.name),s(2),O(e.course),s(),u(e.courseid?9:-1),s(2),u(i!==n-1?11:-1)}}function Wo(t,o){if(t&1&&(l(0,"ngx-simplebar",23),I(1,Qo,12,5,null,null,Vo),c()),t&2){let e=d(2);R("max-height",360,"px"),s(),B(e.messageUpgrade.assessments)}}function Zo(t,o){if(t&1&&(l(0,"div"),T(1),w(2,"i18nPlural"),c(),l(3,"div",5),C(4,qo,27,10)(5,Wo,3,2,"ngx-simplebar",6),c()),t&2){let e=d();s(),F(" ",q(2,2,e.messageUpgrade.assessments.length,e.assessmentCountPluralMap)," "),s(3),u(e.selectedAssessment?4:5)}}function Jo(t,o){t&1&&(l(0,"div"),f(1,4),c())}var gi=(()=>{class t{constructor(){this.assessmentCountPluralMap={1:$localize`You currently have 1 assignment due:`,other:$localize`:# > 1:You currently have # assignments due:`}}selectAssessment(e){this.selectedAssessment=e,setTimeout(()=>{this.backButton?.nativeElement.focus()})}deselectAssessment(){let e=this.messageUpgrade.assessments.indexOf(this.selectedAssessment);this.selectedAssessment=void 0,setTimeout(()=>{this.listButtons.get(e)?.nativeElement.focus()})}dueString(e){if(!e.dueAt)return $localize`No due date`;if(e.duedate===!1){let a=Ae.from(e.created).format("MMM D, hh:mma");return $localize`Created: ${a}:date & time:`}let n=Ae.from(e.dueAt).format("MMM D, hh:mma");return $localize`Due: ${n}:date & time:`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-upcoming-assessments"]],viewQuery:function(i,n){if(i&1&&se(Fo,5)(zo,5),i&2){let r;j(r=Q())&&(n.backButton=r.first),j(r=Q())&&(n.listButtons=r)}},inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:1,consts:()=>{let e;e=$localize`:back to all assessments:Back`;let i;i=$localize`Go To Assignment`;let n;return n=$localize`No assignments due! Enjoy the break!`,[["backButton",""],["listButtons",""],e,i,n,[1,"rounded-double","bg-white","ba","mt-8"],[1,"pa-8",3,"max-height"],[1,"px-8","pt-8","d-flex","flex-column"],[1,"mb-12"],["type","button",1,"btn","md","link","active",3,"click"],["name","internal-chevron-left-ios",1,"size-16","mr-4"],[1,"text-md"],[1,"px-8","pb-8","flex-grow","minh-0"],[1,"h3"],[1,"my-16","text-md","d-flex","flex-column","gap-8"],[1,"d-flex","align-items-center","gap-8"],["name","common-calendar",1,"size-16"],[1,"d-flex","align-items-start","gap-8"],["name","common-courses-alt",1,"size-16"],[1,"text-sm","text-quiet"],[1,"text-keep-newlines"],[1,"bt","px-12","py-16"],["target","_blank",1,"btn","md","primary","w-100",3,"href"],[1,"pa-8"],["type","button",1,"d-flex","align-items-center","pa-12","hoverable","rounded","w-100",3,"click"],[1,"flex-grow"],[1,"text-bold"],[1,"text-sm"],["name","internal-chevron-right-ios",1,"size-16"],["role","separator",1,"mx-8"]]},template:function(i,n){i&1&&C(0,Zo,6,5)(1,Jo,2,0,"div"),i&2&&u(n.messageUpgrade.assessments!=null&&n.messageUpgrade.assessments.length?0:1)},dependencies:[J,Z,z,ue],encapsulation:2,changeDetection:0})}}return t})();x();var Ko=["backButton"],er=["listButtons"],tr=(t,o)=>o.guid;function nr(t,o){t&1&&g(0,"hr",14)}function ir(t,o){if(t&1){let e=v();l(0,"button",9,1),N("click",function(){let n=E(e).$implicit,r=d(2);return A(r.selectJob(n))}),l(2,"div",10)(3,"div",11),T(4),c(),l(5,"div",12),T(6),c()(),g(7,"icon",13),c(),C(8,nr,1,0,"hr",14)}if(t&2){let e=o.$implicit,i=o.$index,n=o.$count;s(4),O(e.employer),s(2),O(e.title),s(2),u(i!==n-1?8:-1)}}function or(t,o){if(t&1&&(l(0,"div",8)(1,"a",15)(2,"span"),T(3),c()()()),t&2){let e=d(2);s(),b("href",e.messageUpgrade.ctaData.url,L),s(2),O(e.messageUpgrade.ctaData.text)}}function rr(t,o){if(t&1&&(l(0,"ngx-simplebar",6,0)(2,"div",7),I(3,ir,9,3,null,null,tr),c()(),C(5,or,4,2,"div",8)),t&2){let e=d();R("max-height",e.messageUpgrade.ctaData?292:360,"px"),s(3),B(e.messageUpgrade.jobs),s(2),u(e.messageUpgrade.ctaData?5:-1)}}function ar(t,o){if(t&1&&(l(0,"div",8)(1,"a",15)(2,"span"),f(3,4),c()()()),t&2){let e=d(2);s(),b("href",e.selectedJob.link,L)}}function sr(t,o){if(t&1){let e=v();l(0,"div",16)(1,"div",17)(2,"button",18,2),N("click",function(){E(e);let n=d();return A(n.backToList())}),g(4,"icon",19),l(5,"span",20),f(6,3),c()()(),l(7,"ngx-simplebar",21)(8,"div",22),T(9),c(),l(10,"div",23),T(11),c(),g(12,"div",24),w(13,"safeHtml"),c()(),C(14,ar,4,1,"div",8)}if(t&2){let e=d();s(7),R("max-height",e.selectedJob.link?227:295,"px"),s(2),O(e.selectedJob.employer),s(2),O(e.selectedJob.title),s(),b("innerHTML",W(13,6,e.selectedJob.description),Ue),s(2),u(e.selectedJob.link?14:-1)}}var hi=(()=>{class t{constructor(){this.selectedJob=null,this.jobCountPluralMap={"=1":$localize`The jobs listing currently has 1 job listed:`,other:$localize`The jobs listing currently has # jobs listed:`}}selectJob(e){this.selectedJob=e,setTimeout(()=>{this.backButton?.nativeElement.focus()})}backToList(){let e=this.messageUpgrade.jobs.indexOf(this.selectedJob);this.selectedJob=null,setTimeout(()=>{this.listButtons.get(e)?.nativeElement.focus()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-job-opportunities"]],viewQuery:function(i,n){if(i&1&&se(Ko,5)(er,5),i&2){let r;j(r=Q())&&(n.backButton=r.first),j(r=Q())&&(n.listButtons=r)}},inputs:{messageUpgrade:"messageUpgrade"},decls:6,vars:6,consts:()=>{let e;e=$localize`:back to all jobs:Back`;let i;return i=$localize`Apply`,[["jobsListScrollbar",""],["listButtons",""],["backButton",""],e,i,[1,"rounded-double","bg-white","ba","mt-8"],[1,"px-12","py-8","flex-grow"],[1,"d-flex","flex-column"],[1,"px-16","py-12","bt"],["type","button",1,"d-flex","align-items-center","pa-12","hoverable","rounded","w-100","gap-12",3,"click"],[1,"flex-grow"],[1,"text-sm","text-quiet"],[1,"text-bold"],["name","internal-chevron-right-ios",1,"size-16"],["role","separator",1,"mx-8"],["target","_blank",1,"btn","md","primary","w-100",3,"href"],[1,"px-8","pt-8","d-flex","flex-column"],[1,"mb-12"],["type","button",1,"btn","md","link","active",3,"click"],["name","internal-chevron-left-ios",1,"size-16","mr-4"],[1,"text-md"],[1,"px-8","flex-grow","minh-0"],[1,"text-sm","text-quiet","mb-8"],[1,"h3"],[1,"text-md","mt-16",3,"innerHTML"]]},template:function(i,n){i&1&&(l(0,"div"),T(1),w(2,"i18nPlural"),c(),l(3,"div",5),C(4,rr,6,3),C(5,sr,15,8),c()),i&2&&(s(),O(q(2,3,n.messageUpgrade.jobs.length,n.jobCountPluralMap)),s(3),u(n.selectedJob?-1:4),s(),u(n.selectedJob?5:-1))},dependencies:[z,J,Z,ue,Mt],encapsulation:2,changeDetection:0})}}return t})();x();var lr=["backButton"],cr=["listButtons"],_r=(t,o)=>o.key,dr=(t,o)=>o.title+o.startDate;function pr(t,o){if(t&1&&(l(0,"div")(1,"div",26),f(2,5),c(),l(3,"div",27),f(4,6),c(),l(5,"div",28),g(6,"div",29)(7,"div",30)(8,"div",30)(9,"div",30),c()(),g(10,"hr",22)),t&2){let e=d(3);s(4),ot(e.severityName(e.selectedHold.severity)),rt(4),s(),R("gap",2,"px")("height",8,"px"),s(2),X("severity-bg-moderate",e.selectedHold.severity>1),s(),X("severity-bg-high",e.selectedHold.severity>3),s(),X("severity-bg-critical",e.selectedHold.severity>5)}}function Cr(t,o){if(t&1){let e=v();l(0,"div",10)(1,"div",13)(2,"button",14,0),N("click",function(){E(e);let n=d(2);return A(n.deselectAssessment())}),g(4,"icon",15),l(5,"span",16),f(6,2),c()()(),l(7,"div",17)(8,"div",18),g(9,"icon",19),l(10,"div",20),T(11),c()(),l(12,"div",21),T(13),c(),g(14,"hr",22),C(15,pr,11,11),l(16,"div",23)(17,"div",24)(18,"div",25),f(19,3),c(),l(20,"div"),T(21),w(22,"dateFormat"),c()(),l(23,"div",24)(24,"div",25),f(25,4),c(),l(26,"div"),T(27),w(28,"dateFormat"),c()()()()()}if(t&2){let e=d(2);s(9),oe(e.severityIconClass(e.selectedHold.severity)),s(2),O(e.selectedHold.title),s(2),O(e.selectedHold.reason),s(2),u("severity"in e.selectedHold?15:-1),s(6),O(q(22,7,e.selectedHold.startDate,"MMM D, YYYY")),s(6),O(q(28,10,e.selectedHold.endDate,"MMM D, YYYY"))}}function ur(t,o){if(t&1&&(l(0,"div",26)(1,"span"),f(2,7),c(),T(3),c()),t&2){let e=d().$implicit,i=d(4);s(3),F(" ",i.severityName(e.severity)," ")}}function mr(t,o){t&1&&g(0,"hr",36)}function gr(t,o){if(t&1){let e=v();l(0,"button",34,1),N("click",function(){let n=E(e).$implicit,r=d(4);return A(r.selectHold(n))}),g(2,"icon",19),l(3,"div",24)(4,"div",27),T(5),c(),C(6,ur,4,1,"div",26),c(),g(7,"icon",35),c(),C(8,mr,1,0,"hr",36)}if(t&2){let e=o.$implicit,i=o.$index,n=o.$count,r=d(4);s(2),oe(r.severityIconClass(e.severity)),s(3),O(e.title),s(),u(e.severity>=0?6:-1),s(2),u(i!==n-1?8:-1)}}function hr(t,o){if(t&1&&(l(0,"div")(1,"div",33),T(2),w(3,"titlecase"),c(),I(4,gr,9,5,null,null,dr),c()),t&2){let e=o.$implicit;s(2),O(W(3,1,e.key)),s(2),B(e.value)}}function Tr(t,o){if(t&1&&(l(0,"ngx-simplebar",31)(1,"div",32),I(2,hr,6,3,"div",null,_r),w(4,"keyvalue"),c()()),t&2){let e=d(2);R("max-height",286,"px"),s(2),B(W(4,2,e.holdsByCategory))}}function fr(t,o){if(t&1&&(l(0,"div"),T(1),w(2,"i18nPlural"),c(),l(3,"div",9),C(4,Cr,29,13,"div",10)(5,Tr,5,4,"ngx-simplebar",11),c(),l(6,"div",12),T(7),c()),t&2){let e=d();s(),F(" ",q(2,3,e.messageUpgrade.holds.length,e.holdCountPluralMap)," "),s(3),u(e.selectedHold?4:5),s(3),F(" ",e.messageUpgrade.message," ")}}function Or(t,o){t&1&&(l(0,"div"),f(1,8),c())}var Ti=(()=>{class t{constructor(){this.holdsByCategory={},this.holdCountPluralMap={"=1":$localize`You currently have 1 hold:`,other:$localize`:# > 1:You currently have # holds:`}}ngOnInit(){this.holdsByCategory=xe(this.messageUpgrade.holds,"category")}selectHold(e){this.selectedHold=e,setTimeout(()=>{this.backButton?.nativeElement.focus()})}deselectAssessment(){let e=this.messageUpgrade.holds.indexOf(this.selectedHold);this.selectedHold=void 0,setTimeout(()=>{this.listButtons.get(e)?.nativeElement.focus()})}severityName(e){switch(e){case 0:case 1:return $localize`Low`;case 2:case 3:return $localize`Moderate`;case 4:case 5:return $localize`High`;case 6:case 7:return $localize`Critical`}}severityIconClass(e){switch(e){case 0:case 1:return"severity-low";case 2:case 3:return"severity-moderate";case 4:case 5:return"severity-high";case 6:case 7:return"severity-critical"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-holds-and-restrictions"]],viewQuery:function(i,n){if(i&1&&se(lr,5)(cr,5),i&2){let r;j(r=Q())&&(n.backButton=r.first),j(r=Q())&&(n.listButtons=r)}},inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:1,consts:()=>{let e;e=$localize`:back to all holds:Back`;let i;i=$localize`Start Date`;let n;n=$localize`End Date`;let r;r=$localize`Severity`;let a;a=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let p;p=$localize`Severity:`;let _;return _=$localize`Great news! You don't have any holds on your account.`,[["backButton",""],["listButtons",""],e,i,n,r,a,p,_,[1,"rounded-double","bg-white","ba","mt-8"],[1,"px-8","pt-8","d-flex","flex-column"],[1,"px-8","py-16",3,"max-height"],[1,"mt-8"],[1,"mb-12"],["type","button",1,"btn","md","link","active",3,"click"],["name","internal-chevron-left-ios",1,"size-16","mr-4"],[1,"text-md"],[1,"px-8","pb-8"],[1,"d-flex","align-items-center","gap-12"],["name","common-shield-alert",1,"size-24","severity-icon"],[1,"h3"],[1,"mt-16"],["role","separator",1,"my-12"],[1,"d-flex","mb-12"],[1,"flex-grow"],[1,"text-quiet","text-sm"],[1,"text-sm","text-quiet"],[1,"text-bold"],["role","presentation",1,"mt-8","circle","overflow-hidden","d-flex"],[1,"flex-grow","severity-bar","severity-bg-low"],[1,"flex-grow","severity-bar"],[1,"px-8","py-16"],[1,"d-flex","flex-column","gap-16"],[1,"text-bold","px-8"],["type","button",1,"d-flex","align-items-center","pa-12","hoverable","rounded","w-100","gap-12",3,"click"],["name","internal-chevron-right-ios",1,"size-16"],["role","separator",1,"mx-8"]]},template:function(i,n){i&1&&C(0,fr,8,6)(1,Or,2,0,"div"),i&2&&u(n.messageUpgrade.holds!=null&&n.messageUpgrade.holds.length?0:1)},dependencies:[J,Z,z,ue,$n,Et,je],styles:["[_nghost-%COMP%]{--severity-low-color: #ffcf01;--severity-moderate-color: #fd9e05;--severity-high-color: #f66809;--severity-critical-color: #ec000d}.severity-icon.severity-low[_ngcontent-%COMP%]{fill:var(--severity-low-color)}.severity-icon.severity-moderate[_ngcontent-%COMP%]{fill:var(--severity-moderate-color)}.severity-icon.severity-high[_ngcontent-%COMP%]{fill:var(--severity-high-color)}.severity-icon.severity-critical[_ngcontent-%COMP%]{fill:var(--severity-critical-color)}.severity-bar[_ngcontent-%COMP%]{background:var(--n2)}.severity-bar.severity-bg-low[_ngcontent-%COMP%]{background:var(--severity-low-color)}.severity-bar.severity-bg-moderate[_ngcontent-%COMP%]{background:var(--severity-moderate-color)}.severity-bar.severity-bg-high[_ngcontent-%COMP%]{background:var(--severity-high-color)}.severity-bar.severity-bg-critical[_ngcontent-%COMP%]{background:var(--severity-critical-color)}"],changeDetection:0})}}return t})();x();var Oi=t=>({grade:t}),Sr=(t,o)=>o.name,Si=(t,o)=>o.code+o.course;function Er(t,o){if(t&1&&(l(0,"option",10),T(1),c()),t&2){let e=o.$implicit;b("ngValue",e),s(),O(e.name)}}function Ar(t,o){t&1&&fe(0)}function xr(t,o){t&1&&g(0,"hr",15)}function br(t,o){if(t&1&&(ne(0,Ar,1,0,"ng-container",14),C(1,xr,1,0,"hr",15)),t&2){let e=o.$implicit,i=o.$index,n=o.$count;d(3);let r=pe(6);b("ngTemplateOutlet",r)("ngTemplateOutletContext",Ce(3,Oi,e)),s(),u(i!==n-1?1:-1)}}function Nr(t,o){if(t&1&&(l(0,"ngx-simplebar",13),I(1,br,2,5,null,null,Si),c()),t&2){let e=d(2);R("max-height",208,"px"),s(),B(e.selectedTerm.grades)}}function vr(t,o){if(t&1&&(l(0,"div",12)(1,"a",16)(2,"span"),T(3),c()()()),t&2){let e=d(2);s(),b("href",e.messageUpgrade.url,L),s(2),O(e.messageUpgrade.cta)}}function Mr(t,o){if(t&1){let e=v();l(0,"div",6)(1,"div",7)(2,"label",8),f(3,2),c(),l(4,"select",9),Re("ngModelChange",function(n){E(e);let r=d();return Pe(r.selectedTerm,n)||(r.selectedTerm=n),A(n)}),I(5,Er,2,2,"option",10,Sr),c()(),C(7,Nr,3,2,"ngx-simplebar",11),c(),C(8,vr,4,2,"div",12)}if(t&2){let e=d();s(4),Me("ngModel",e.selectedTerm),s(),B(e.groupedByTerm),s(2),u(e.selectedTerm?7:-1),s(),u(e.messageUpgrade.url&&e.messageUpgrade.cta?8:-1)}}function Pr(t,o){t&1&&fe(0)}function Rr(t,o){t&1&&g(0,"hr",15)}function yr(t,o){if(t&1&&(l(0,"div",7),ne(1,Pr,1,0,"ng-container",14),C(2,Rr,1,0,"hr",15),c()),t&2){let e=o.$implicit,i=o.$index,n=o.$count;d(2);let r=pe(6);s(),b("ngTemplateOutlet",r)("ngTemplateOutletContext",Ce(3,Oi,e)),s(),u(i!==n-1?2:-1)}}function Ir(t,o){if(t&1&&(l(0,"ngx-simplebar",17),I(1,yr,3,5,"div",7,Si),c()),t&2){let e=d();R("max-height",347,"px"),s(),B(e.gradesSorted)}}function Br(t,o){if(t&1&&(l(0,"div",20),T(1),w(2,"dateFormat"),c()),t&2){let e=d().grade;s(),F(" ",q(2,1,e.dateRecorded,"MMMM D, YYYY")," ")}}function kr(t,o){t&1&&(l(0,"div",22),f(1,3),c())}function wr(t,o){if(t&1&&(l(0,"div",18)(1,"div",19),T(2),c(),l(3,"div"),C(4,Br,3,4,"div",20),l(5,"div")(6,"span",21),T(7),c(),T(8),c(),C(9,kr,2,0,"div",22),c()()),t&2){let e=o.grade;s(2),F(" ",e.grade," "),s(2),u(e.dateRecorded?4:-1),s(3),O(e.code),s(),F(" - ",e.course," "),s(),u(e.grade==="N/A"||!e.grade?9:-1)}}var Ei=(()=>{class t{constructor(){this.groupedByTerm=[],this.gradesSorted=[]}ngOnInit(){switch(this.messageUpgrade.source){case"term":this.groupedByTerm=Object.entries(xe(this.messageUpgrade.grades,"term")).reduce((e,[i,n])=>(n.sort((r,a)=>r.code.localeCompare(a.code)),e.push({name:i,grades:n}),e),[]),this.selectedTerm=this.groupedByTerm[0];return;case"moodle":this.gradesSorted=this.messageUpgrade.grades.sort((e,i)=>(e.dateRecorded??1/0)-(i.dateRecorded??1/0));return}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-final-grades"]],inputs:{messageUpgrade:"messageUpgrade"},decls:7,vars:1,consts:()=>{let e;e=$localize`Your final grades are:`;let i;i=$localize`:a school term:Term`;let n;return n=$localize`:referring to grade for a class/course: Final grade not yet posted `,[["gradeItem",""],e,i,n,[1,"rounded-double","bg-white","ba","mt-8"],[1,"pa-8",3,"max-height"],[1,"pt-16","px-8"],[1,"px-12"],["for","term-dropdown",1,"form-label","text-sm","text-muted"],["id","term-dropdown",1,"form-control","w-100",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"mt-8","px-12",3,"max-height"],[1,"bt","px-16","pb-16","pt-12"],[1,"mt-8","px-12"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["role","separator"],["target","_blank",1,"btn","md","primary","w-100",3,"href"],[1,"pa-8"],[1,"d-flex","align-items-center","gap-16","py-12"],[1,"circle","size-40","d-grid","place-content-center","text-bold",2,"background","var(--highlight-bg-color)"],[1,"text-sm","text-quiet"],[1,"text-bold","flex-grow"],[1,"text-sm","text-muted"]]},template:function(i,n){if(i&1&&(l(0,"div"),f(1,1),c(),l(2,"div",4),C(3,Mr,9,3)(4,Ir,3,2,"ngx-simplebar",5),c(),ne(5,wr,10,5,"ng-template",null,0,ye)),i&2){let r;s(3),u((r=n.messageUpgrade.source)==="term"?3:r==="moodle"?4:-1)}},dependencies:[J,Z,Ye,xt,bt,At,Xe,qe,ze,je],encapsulation:2,changeDetection:0})}}return t})();x();x();var Ai=(()=>{class t{static ngTemplateContextGuard(e,i){return!0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=ht({type:t,selectors:[["ng-template","typedTemplate",""]],inputs:{type:[0,"typedTemplate","type"]}})}}return t})();var Hr=["backButton"],$r=["listButtons"],yt=t=>({course:t}),Dr=(t,o)=>o.name,Ur=(t,o)=>o.courseNumber,Lr=(t,o)=>o.courseNumber+t,Gr=(t,o)=>o.location,Fr=(t,o)=>o.time;function zr(t,o){t&1&&fe(0)}function Vr(t,o){if(t&1&&ne(0,zr,1,0,"ng-container",15),t&2){let e=d(2),i=pe(3);b("ngTemplateOutlet",i)("ngTemplateOutletContext",Ce(2,yt,e.selectedTermCourse))}}function Xr(t,o){if(t&1&&(l(0,"option",19),T(1),c()),t&2){let e=o.$implicit;b("ngValue",e),s(),O(e.name)}}function qr(t,o){t&1&&g(0,"hr",27)}function Yr(t,o){if(t&1){let e=v();l(0,"button",23,2),N("click",function(){let n=E(e).$implicit,r=d(4);return A(r.selectTermCourse(n))}),l(2,"div",24)(3,"div",25),T(4),c(),l(5,"div"),T(6),c()(),g(7,"icon",26),c(),C(8,qr,1,0,"hr",27)}if(t&2){let e=o.$implicit,i=o.$index,n=o.$count;s(4),O(e.courseNumber),s(2),O(e.courseTitle),s(2),u(i!==n-1?8:-1)}}function jr(t,o){t&1&&(l(0,"div",22),f(1,5),c())}function Qr(t,o){if(t&1&&(l(0,"ngx-simplebar",21),I(1,Yr,9,3,null,null,Ur,!1,jr,2,0,"div",22),c()),t&2){let e=d(3);R("max-height",300,"px"),s(),B(e.selectedTerm.courses)}}function Wr(t,o){if(t&1){let e=v();l(0,"div",14)(1,"div",16)(2,"label",17),f(3,4),c(),l(4,"select",18),Re("ngModelChange",function(n){E(e);let r=d(2);return Pe(r.selectedTerm,n)||(r.selectedTerm=n),A(n)}),I(5,Xr,2,2,"option",19,Dr),c()(),C(7,Qr,4,3,"ngx-simplebar",20),c()}if(t&2){let e=d(2);s(4),Me("ngModel",e.selectedTerm),s(),B(e.groupedByTerm),s(2),u(e.selectedTerm?7:-1)}}function Zr(t,o){if(t&1&&(l(0,"div",12),C(1,Vr,1,4,"ng-container")(2,Wr,8,2,"div",14),c()),t&2){let e=d();s(),u(e.selectedTermCourse?1:2)}}function Jr(t,o){t&1&&fe(0)}function Kr(t,o){if(t&1&&ne(0,Jr,1,0,"ng-container",15),t&2){let e=d(2),i=pe(5);b("ngTemplateOutlet",i)("ngTemplateOutletContext",Ce(2,yt,e.selectedNoTermCourse))}}function ea(t,o){t&1&&g(0,"hr",27)}function ta(t,o){if(t&1){let e=v();l(0,"button",23,2),N("click",function(){let n=E(e).$implicit,r=d(3);return A(r.selectNoTermCourse(n))}),l(2,"div",24)(3,"div",30),T(4),c(),l(5,"div",25),T(6),c()(),g(7,"icon",26),c(),C(8,ea,1,0,"hr",27)}if(t&2){let e=o.$implicit,i=o.$index,n=o.$count;s(4),O(e.courseTitle),s(2),O(e.courseNumber),s(2),u(i!==n-1?8:-1)}}function na(t,o){if(t&1&&(l(0,"ngx-simplebar",29),I(1,ta,9,3,null,null,Lr),c()),t&2){let e=d(2);R("max-height",360,"px"),s(),B(e.noTermCourses)}}function ia(t,o){if(t&1&&(l(0,"div",12),C(1,Kr,1,4,"ng-container")(2,na,3,2,"ngx-simplebar",28),c()),t&2){let e=d();s(),u(e.selectedNoTermCourse?1:2)}}function oa(t,o){t&1&&(l(0,"div",39),g(1,"icon",43),l(2,"div"),T(3),c()()),t&2&&(s(3),O(o))}function ra(t,o){if(t&1&&(l(0,"div",39),g(1,"icon",47),l(2,"div"),T(3),c()()),t&2){let e=o.$implicit;s(3),Ge("",e.days," ",e.time)}}function aa(t,o){t&1&&g(0,"icon",44)}function sa(t,o){t&1&&g(0,"icon",45)}function la(t,o){if(t&1&&(I(0,ra,4,2,"div",39,Fr),l(2,"div",39),C(3,aa,1,0,"icon",44)(4,sa,1,0,"icon",45),l(5,"div"),T(6),c()(),g(7,"hr",46)),t&2){let e=o.$implicit;B(e.times),s(3),u(e.location==="Online"?3:4),s(3),O(e.location)}}function ca(t,o){t&1&&(l(0,"div",48),f(1,8),c(),g(2,"hr",46))}function _a(t,o){if(t&1&&(l(0,"div",41),g(1,"icon",49),l(2,"div"),T(3),c()()),t&2){let e=d().course;s(3),O(e.instructor.name)}}function da(t,o){if(t&1&&(l(0,"div",41),g(1,"icon",50),l(2,"a",51),T(3),c()()),t&2){let e=d().course;s(2),b("href",at("mailto:",e.instructor.email),L),s(),O(e.instructor.email)}}function pa(t,o){t&1&&(l(0,"div",42),f(1,9),c())}function Ca(t,o){if(t&1){let e=v();l(0,"div",31)(1,"div",32)(2,"button",33,3),N("click",function(){E(e);let n=d();return A(n.deselectTermCourse())}),g(4,"icon",34),l(5,"span",35),f(6,6),c()()(),l(7,"ngx-simplebar",36)(8,"div",37),T(9),c(),l(10,"div",38),C(11,oa,4,1,"div",39),I(12,la,8,2,null,null,Gr,!1,ca,3,0),c(),l(15,"div")(16,"div",40),f(17,7),c(),C(18,_a,4,1,"div",41),C(19,da,4,3,"div",41),C(20,pa,2,0,"div",42),c()()()}if(t&2){let e,i=o.course,n=d();s(7),R("max-height",350,"px"),s(2),O(i.courseTitle),s(2),u((e=n.getScheduleDateRange(i))?11:-1,e),s(),B(n.groupEventsByLocation(i.events)),s(6),u(i.instructor!=null&&i.instructor.name?18:-1),s(),u(i.instructor!=null&&i.instructor.email?19:-1),s(),u(!(i.instructor!=null&&i.instructor.name)&&!(i.instructor!=null&&i.instructor.email)?20:-1)}}function ua(t,o){if(t&1&&(l(0,"div",39),g(1,"icon",55),l(2,"span"),T(3),w(4,"titlecase"),c()()),t&2){let e=d().$implicit,i=d().$implicit,n=d(2);s(3),Bn(" ",W(4,3,e.substring(0,2))," ",n.formatMeetingTimeRange(i.beginsAt)," - ",n.formatMeetingTimeRange(i.endsAt)," ")}}function ma(t,o){if(t&1&&C(0,ua,5,5,"div",39),t&2){let e=o.$implicit,i=d().$implicit;u(i.days[e]>0?0:-1)}}function ga(t,o){t&1&&g(0,"hr",54)}function ha(t,o){if(t&1&&(l(0,"div",38),I(1,ma,1,1,null,null,Rn),l(3,"div",39),g(4,"icon",53),l(5,"span"),T(6),c()()(),C(7,ga,1,0,"hr",54)),t&2){let e=o.$implicit,i=o.$index,n=o.$count,r=d(2);s(),B(r.daysOrdered),s(5),Ge("",e.room," (",e.building,")"),s(),u(i!==n-1?7:-1)}}function Ta(t,o){t&1&&(l(0,"div",52),f(1,11),c())}function fa(t,o){if(t&1){let e=v();l(0,"div",31)(1,"div",32)(2,"button",33,3),N("click",function(){E(e);let n=d();return A(n.deselectNoTermCourse())}),g(4,"icon",34),l(5,"span",35),f(6,10),c()()(),l(7,"ngx-simplebar",36)(8,"div",37),T(9),c(),I(10,ha,8,3,null,null,ft,!1,Ta,2,0,"div",52),c()()}if(t&2){let e=o.course;s(7),R("max-height",350,"px"),s(2),O(e.courseTitle),s(),B(e.meetingTimes)}}var xi=(()=>{class t{constructor(){this.groupedByTerm=[],this.noTermCourses=[],this.daysOrdered=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]}ngOnInit(){this.messageUpgrade.withTerms?(this.groupedByTerm=Object.entries(xe(this.messageUpgrade.courses,"term")).reduce((e,[i,n])=>(n.sort((r,a)=>r.courseNumber.localeCompare(a.courseNumber)),e.push({name:i,courses:n}),e),[]),this.selectedTerm=this.groupedByTerm[0]):this.noTermCourses=this.messageUpgrade.courses}selectTermCourse(e){this.selectedTermCourse=e,setTimeout(()=>{this.backButton?.nativeElement.focus()})}selectNoTermCourse(e){this.selectedNoTermCourse=e,setTimeout(()=>{this.backButton?.nativeElement.focus()})}deselectTermCourse(){let e=this.selectedTerm.courses.indexOf(this.selectedTermCourse);this.selectedTermCourse=void 0,setTimeout(()=>{this.listButtons.get(e)?.nativeElement.focus()})}deselectNoTermCourse(){let e=this.noTermCourses.indexOf(this.selectedNoTermCourse);this.selectedNoTermCourse=void 0,setTimeout(()=>{this.listButtons.get(e)?.nativeElement.focus()})}getScheduleDateRange(e){if(!e.date?.start&&!e.date?.end)return"";let i=new Date().getFullYear(),n=p=>{let _=new Date(p);if(isNaN(_.getTime()))return null;let h=_.toLocaleDateString("en-US",{month:"short",day:"numeric"});return _.getFullYear()!==i&&(h+=`, ${_.getFullYear()}`),h},r=e.date.start?n(e.date.start):null,a=e.date.end?n(e.date.end):null;return r&&a?`${r} - ${a}`:r?`Begins ${r}`:a?`Ends ${a}`:""}formatMeetingTime(e){return e.replace(/\sAM/g,"am").replace(/\sPM/g,"pm").replace(/:00/g,"")}groupEventsByLocation(e){let i=(e||[]).filter(r=>r.location&&r.day&&r.time),n=xe(i,"location");return Object.entries(n).map(([r,a])=>{let p=xe(a,"time"),_=Object.entries(p).map(([h,m])=>({time:this.formatMeetingTime(h),days:m.map(S=>S.day[0].toUpperCase()+S.day[1].toLowerCase()).join(" ")}));return{location:r,times:_}})}formatMeetingTimeRange(e){return Ae.fromFormat(e,"HHmm").format("hh:mm A")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-course-schedule"]],viewQuery:function(i,n){if(i&1&&se(Hr,5)($r,5),i&2){let r;j(r=Q())&&(n.backButton=r.first),j(r=Q())&&(n.listButtons=r)}},inputs:{messageUpgrade:"messageUpgrade"},decls:6,vars:7,consts:()=>{let e;e=$localize`Term`;let i;i=$localize` No courses found for this term. `;let n;n=$localize`Back`;let r;r=$localize`Instructor`;let a;a=$localize`No schedule available`;let p;p=$localize`No instructor found`;let _;_=$localize`Back`;let h;return h=$localize` No upcoming meetings in your schedule. `,[["courseDetail",""],["noTermCourseDetail",""],["listButtons",""],["backButton",""],e,i,n,r,a,p,_,h,[1,"rounded-double","bg-white","ba","mt-8"],[3,"typedTemplate"],[1,"pt-16","px-8"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"px-12"],["for","term-dropdown",1,"form-label","text-sm","text-muted"],["id","term-dropdown",1,"form-control","w-100",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"mt-8","pb-8",3,"max-height"],[1,"mt-8","pb-8"],[1,"pa-24","text-center","text-muted"],["type","button",1,"d-flex","align-items-center","pa-12","hoverable","rounded","w-100",3,"click"],[1,"flex-grow"],[1,"text-sm","text-quiet"],["name","internal-chevron-right-ios",1,"size-16"],["role","separator",1,"mx-8"],[1,"pa-8","pb-8",3,"max-height"],[1,"pa-8","pb-8"],[1,"text-bold"],[1,"px-8","pt-8","d-flex","flex-column"],[1,"mb-12"],["type","button",1,"btn","md","link","active",3,"click"],["name","internal-chevron-left-ios",1,"size-16","mr-4"],[1,"text-md"],[1,"px-12","pb-16","flex-grow","minh-0"],[1,"h3","mb-16"],[1,"d-flex","flex-column","gap-8"],[1,"d-flex","align-items-center","gap-16"],[1,"text-quiet","text-sm","mb-8"],[1,"d-flex","align-items-center","gap-16","my-8"],[1,"text-sm"],["name","common-calendar",1,"size-20","text-quiet"],["name","common-laptop",1,"size-20"],["name","common-location",1,"size-20"],["role","separator",1,"my-12"],["name","common-time",1,"size-20"],[1,"text-sm","text-italic","text-quiet"],["name","common-staff",1,"size-20","color-brand"],["name","common-email",1,"size-20","color-brand"],[3,"href"],[1,"pa-24","text-center","text-quiet"],["name","common-location",1,"size-20","text-quiet"],["role","separator",1,"my-16"],["name","common-time",1,"size-20","text-quiet"]]},template:function(i,n){i&1&&(C(0,Zr,3,1,"div",12)(1,ia,3,1,"div",12),ne(2,Ca,21,8,"ng-template",13,0,ye)(4,fa,13,4,"ng-template",13,1,ye)),i&2&&(u(n.messageUpgrade.withTerms?0:1),s(2),b("typedTemplate",Ce(3,yt,n.selectedTermCourse)),s(2),b("typedTemplate",Ce(5,yt,n.selectedNoTermCourse)))},dependencies:[J,Z,Ye,xt,bt,At,Xe,qe,ze,z,Ai,Et],encapsulation:2,changeDetection:0})}}return t})();x();var Oa=(t,o)=>o.courseCode+o.courseName;function Sa(t,o){t&1&&(l(0,"div",1),f(1,0),c())}function Ea(t,o){if(t&1&&(l(0,"a",6)(1,"div",9)(2,"div",10),T(3),c(),l(4,"div",11),T(5),c()(),g(6,"icon",12),c()),t&2){let e=d().$implicit,i=d(2);b("href",e.link,L),ie("aria-label",i.getCourseLinkAriaLabel(e.courseCode,e.courseName)),s(3),O(e.courseCode),s(2),O(e.courseName)}}function Aa(t,o){if(t&1&&(l(0,"div",7)(1,"div",9)(2,"div",10),T(3),c(),l(4,"div",11),T(5),c()(),g(6,"div",13),c()),t&2){let e=d().$implicit;s(3),O(e.courseCode),s(2),O(e.courseName)}}function xa(t,o){t&1&&g(0,"hr",8)}function ba(t,o){if(t&1&&(C(0,Ea,7,4,"a",6)(1,Aa,7,2,"div",7),C(2,xa,1,0,"hr",8)),t&2){let e=o.$implicit,i=o.$index,n=o.$count;u(e.link?0:1),s(2),u(i!==n-1?2:-1)}}function Na(t,o){if(t&1&&(l(0,"div",5)(1,"a",14)(2,"span"),T(3),c()()()),t&2){let e=d(2);s(),b("href",e.messageUpgrade.ctaData.url,L),s(2),O(e.messageUpgrade.ctaData.text)}}function va(t,o){if(t&1&&(l(0,"div"),T(1),w(2,"i18nPlural"),c(),l(3,"div",2)(4,"ngx-simplebar",3)(5,"div",4),I(6,ba,3,2,null,null,Oa),c()(),C(8,Na,4,2,"div",5),c()),t&2){let e=d();s(),O(q(2,4,e.messageUpgrade.courses.length,e.courseCountPluralMap)),s(3),R("max-height",e.messageUpgrade.ctaData?292:360,"px"),s(2),B(e.messageUpgrade.courses),s(2),u(e.messageUpgrade.ctaData?8:-1)}}var bi=(()=>{class t{constructor(){this.courseCountPluralMap={"=1":$localize`You have 1 course:`,other:$localize`You have # courses:`}}getCourseLinkAriaLabel(e,i){return $localize`Open course ${e}:course code: - ${i}:course name:`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-course-list"]],inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:1,consts:()=>{let e;return e=$localize` No courses available. `,[e,[1,"rounded-double","bg-white","ba","mt-8","px-16","py-12","text-center","text-muted"],[1,"rounded-double","bg-white","ba","mt-8"],[1,"px-12","py-8"],[1,"d-flex","flex-column"],[1,"px-16","py-12","bt"],["target","_blank","rel","noopener noreferrer",1,"d-flex","align-items-center","pa-12","hoverable","rounded","w-100","gap-12","link-unstyled",3,"href"],[1,"d-flex","align-items-center","pa-12","rounded","w-100","gap-12"],["role","separator",1,"mx-8"],[1,"d-flex","flex-column","flex-grow"],[1,"text-sm","text-quiet"],[1,"text-bold"],["name","common-open",1,"size-16","text-quiet"],[1,"size-16"],["target","_blank","rel","noopener noreferrer",1,"btn","md","primary","w-100",3,"href"]]},template:function(i,n){i&1&&C(0,Sa,2,0,"div",1)(1,va,9,7),i&2&&u(n.messageUpgrade.courses.length===0?0:1)},dependencies:[J,Z,z,ue],encapsulation:2,changeDetection:0})}}return t})();x();function Ma(t,o){if(t&1&&(ce(0,"div",2)(1,"a",3)(2,"span"),T(3),ae()()()),t&2){let e=d();s(),it("href",e.messageUpgrade.text.helpdeskCtaUrl,L),s(2),O(e.messageUpgrade.text.helpdeskCtaText)}}var Ni=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade-helpdesk"]],inputs:{messageUpgrade:"messageUpgrade"},decls:4,vars:4,consts:[[1,"rounded-double","bg-white","ba","mt-8"],[1,"px-16","py-12",3,"innerHTML"],[1,"px-16","py-12","bt"],["target","_blank","rel","noopener noreferrer",1,"btn","md","primary","w-100",3,"href"]],template:function(i,n){i&1&&(ce(0,"div",0),Le(1,"div",1),w(2,"safeHtml"),C(3,Ma,4,2,"div",2),ae()),i&2&&(s(),it("innerHTML",W(2,2,n.messageUpgrade.text.html),Ue),s(2),u(n.messageUpgrade.text.enableHelpdeskCta&&n.messageUpgrade.text.helpdeskCtaUrl&&n.messageUpgrade.text.helpdeskCtaText?3:-1))},dependencies:[Mt],encapsulation:2,changeDetection:0})}}return t})();function Pa(t,o){}var vi=(()=>{class t{constructor(){this.componentMapping={gpa:{orientation:"horizontal",component:_i},advisors:{orientation:"vertical",component:di},balances:{orientation:"vertical",component:mi},courseCalendar:{orientation:"vertical",component:Ci},upcomingAssessments:{orientation:"vertical",component:gi},iframe:{orientation:"vertical",component:pi},plainText:{orientation:"horizontal",component:ui},jobOpportunities:{orientation:"vertical",component:hi},holdsAndRestrictions:{orientation:"vertical",component:Ti},finalGrades:{orientation:"vertical",component:Ei},courseSchedule:{orientation:"vertical",component:xi},courseList:{orientation:"vertical",component:bi},helpdesk:{orientation:"vertical",component:Ni}}}ngOnInit(){this.createRenderer()}createRenderer(){let e=this.componentMapping[this.messageUpgrade.schema].component,i=this.view.viewContainerRef.createComponent(e);i.instance.messageUpgrade=this.messageUpgrade}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-upgrade"]],viewQuery:function(i,n){if(i&1&&se(jt,7),i&2){let r;j(r=Q())&&(n.view=r.first)}},inputs:{messageUpgrade:"messageUpgrade"},decls:2,vars:2,consts:[[1,"d-flex","gap-8"],["getViewContainer",""]],template:function(i,n){i&1&&(l(0,"div",0),ne(1,Pa,0,0,"ng-template",1),c()),i&2&&X("flex-column",n.componentMapping[n.messageUpgrade.schema].orientation==="vertical")},dependencies:[jt],encapsulation:2,changeDetection:0})}}return t})();x();x();function Ra(t,o){if(t&1&&Le(0,"span",2),t&2){let e=o.$implicit;R("transform",`scaleY(${e})`)}}var ya=3,Ia=24,It=ya/Ia,Wt=4,Mi=(()=>{class t{constructor(){this.levels=$(new Array(Wt).fill(0)),this.mode=$("live"),this.reduceMotion=typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,this.barScales=K(()=>{if(this.mode()==="wave")return new Array(Wt).fill(It);let e=this.levels();return Array.from({length:Wt},(i,n)=>{if(this.reduceMotion)return It;let r=Math.max(0,Math.min(1,e[n]??0));return It+r*(1-It)})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["audio-level-bars"]],inputs:{levels:[1,"levels"],mode:[1,"mode"]},decls:3,vars:2,consts:[["aria-hidden","true",1,"d-flex","align-items-center","justify-content-center","gap-4","size-40","flex-no-shrink"],[1,"bar",3,"transform"],[1,"bar"]],template:function(i,n){i&1&&(ce(0,"div",0),I(1,Ra,1,2,"span",1,ft),ae()),i&2&&(X("wave",n.mode()==="wave"),s(),B(n.barScales()))},styles:["[_nghost-%COMP%]{display:contents}.bar[_ngcontent-%COMP%]{width:3px;height:24px;transform:scaleY(.125);transform-origin:center;border-radius:8px;background-color:var(--color-base);transition:transform 80ms ease-out}.wave[_ngcontent-%COMP%] .bar[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_audio-level-wave 1.3s ease-in-out infinite}.wave[_ngcontent-%COMP%] .bar[_ngcontent-%COMP%]:nth-child(2){animation-delay:-.15s}.wave[_ngcontent-%COMP%] .bar[_ngcontent-%COMP%]:nth-child(3){animation-delay:-.3s}.wave[_ngcontent-%COMP%] .bar[_ngcontent-%COMP%]:nth-child(4){animation-delay:-.45s}@keyframes _ngcontent-%COMP%_audio-level-wave{0%,to{transform:scaleY(.167)}50%{transform:scaleY(.75)}}@media(prefers-reduced-motion:reduce){.bar[_ngcontent-%COMP%]{transition:none;animation:none}}"],changeDetection:0})}}return t})();x();var st=16e3,Ba=55e3,ka=4096,wa=1024,Ha=.05,Ri=[{fromHz:85,toHz:255,gain:1},{fromHz:255,toHz:650,gain:1},{fromHz:650,toHz:1800,gain:1.25},{fromHz:1800,toHz:5e3,gain:1.5}],Pi=Ri.length,lt=class extends Error{constructor(o,e){super(o),this.kind=o,this.originalError=e,this.name="VoiceDictationError"}},Bt=(()=>{class t{constructor(){this.ngZone=Y(gt),this._state=U("inactive"),this._levels=U(new Array(Pi).fill(0),{equal:(e,i)=>e.length===i.length&&e.every((n,r)=>n===i[r])}),this.levels=this._levels.asReadonly(),this._autoStopped=new Ne,this.autoStopped$=this._autoStopped.asObservable(),this.chunks=[],this.inputSampleRate=st}static isSupported(){return typeof window<"u"&&window.isSecureContext&&!!navigator.mediaDevices?.getUserMedia}start(){return ge(this,null,function*(){if(!t.isSupported())throw new lt("unsupported");this.teardown(),this.chunks=[];let e=window.AudioContext??window.webkitAudioContext;this.audioContext=new e,this.inputSampleRate=this.audioContext.sampleRate;let i;try{i=yield navigator.mediaDevices.getUserMedia({audio:!0})}catch(n){throw this.teardown(),new lt(this.classifyGetUserMediaError(n),n)}if(!this.audioContext)throw i.getTracks().forEach(n=>n.stop()),new lt("aborted");this.stream=i,yield this.audioContext.resume(),this.sourceNode=this.audioContext.createMediaStreamSource(i),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=wa,this.analyserNode.smoothingTimeConstant=.7,this.frequencyData=new Uint8Array(this.analyserNode.frequencyBinCount),this.sourceNode.connect(this.analyserNode),this.processorNode=this.audioContext.createScriptProcessor(ka,1,1),this.processorNode.onaudioprocess=n=>{this.chunks.push(new Float32Array(n.inputBuffer.getChannelData(0)))},this.sourceNode.connect(this.processorNode),this.processorNode.connect(this.audioContext.destination),this._state.set("recording"),this.ngZone.runOutsideAngular(()=>this.sampleLevels()),this.autoStopTimer=setTimeout(()=>{this._state()==="recording"&&this.stop().then(n=>this._autoStopped.next(n))},Ba)})}stop(){return ge(this,null,function*(){let e=this.encodeWav();return this.teardown(),this.chunks=[],e})}cancel(){this.teardown(),this.chunks=[]}ngOnDestroy(){this.cancel()}sampleLevels(){let e=this.analyserNode,i=this.frequencyData;if(!e||!i)return;e.getByteFrequencyData(i);let n=this.inputSampleRate/e.fftSize,r=Ri.map(({fromHz:a,toHz:p,gain:_})=>{let h=Math.max(1,Math.round(a/n)),m=Math.min(i.length,Math.round(p/n)),S=0;for(let V=h;Vh?S/(m-h)/255:0;return Math.max(0,Math.min(1,(M-Ha)*_))});this._levels.set(r),this.levelFrameId=requestAnimationFrame(()=>this.sampleLevels())}classifyGetUserMediaError(e){let i=e?.name;return i==="NotAllowedError"||i==="SecurityError"?"permission-denied":i==="NotFoundError"||i==="OverconstrainedError"?"no-device":"unknown"}encodeWav(){let e=this.resample(this.flatten(this.chunks),this.inputSampleRate),i=new ArrayBuffer(44+e.length*2),n=new DataView(i),r=(p,_)=>{for(let h=0;h<_.length;h++)n.setUint8(p+h,_.charCodeAt(h))};r(0,"RIFF"),n.setUint32(4,36+e.length*2,!0),r(8,"WAVE"),r(12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,st,!0),n.setUint32(28,st*2,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),r(36,"data"),n.setUint32(40,e.length*2,!0);let a=44;for(let p=0;pa+p.length,0),n=new Float32Array(i),r=0;for(let a of e)n.set(a,r),r+=a.length;return n}resample(e,i){if(i===st)return e;let n=i/st,r=Math.round(e.length/n),a=new Float32Array(r);if(n>1){for(let p=0;pe.stop()),this.stream=void 0),this.audioContext&&(this.audioContext.close(),this.audioContext=void 0),this._levels.set(new Array(Pi).fill(0)),this._state.set("inactive")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=mt({token:t,factory:t.\u0275fac})}}return t})();var $a=["doneButton"];function Da(t,o){t&1&&(he(0),f(1,1),Te())}function Ua(t,o){t&1&&(he(0),f(1,2),Te())}function La(t,o){if(t&1&&(l(0,"span",3),C(1,Da,2,0,"ng-container")(2,Ua,2,0,"ng-container"),c()),t&2){let e,i=d();s(),u((e=i.state())==="recording"?1:e==="transcribing"?2:-1)}}function Ga(t,o){if(t&1){let e=v();l(0,"button",9),N("click",function(){E(e);let n=d();return A(n.cancelDictation())}),g(1,"icon",10),c(),g(2,"audio-level-bars",11)}if(t&2){let e=d();s(2),b("levels",e.micLevels())}}function Fa(t,o){t&1&&g(0,"audio-level-bars",5)}function za(t,o){if(t&1){let e=v();l(0,"button",12),N("click",function(){E(e);let n=d();return A(n.startDictation())}),g(1,"icon",13),c()}}function Va(t,o){if(t&1){let e=v();l(0,"button",14,0),N("click",function(){E(e);let n=d();return A(n.stopDictation())}),g(2,"icon",15),c()}}function Xa(t,o){if(t&1){let e=v();l(0,"button",16),N("click",function(){E(e);let n=d();return A(n.send.emit())}),g(1,"icon",17),c()}if(t&2){let e=d();b("tooltip",e.sendTooltip())("disabled",e.state()==="transcribing"||!e.canSend())}}var kt=(()=>{class t{constructor(){this.chatbotService=Y(Pt),this.errorService=Y(Nt),this.voiceDictation=Y(Bt),this.disabled=$(!1),this.canSend=$(!1),this.sendTooltip=$(""),this.recordingStart=le(),this.transcript=le(),this.stateChange=le(),this.errorChange=le(),this.send=le(),this.state=U("idle"),this.micSupported=Bt.isSupported(),this.micLevels=this.voiceDictation.levels,this.doneButton=Oe("doneButton"),this.cancelRequest=new Ne,this.voiceDictation.autoStopped$.pipe(Zn()).subscribe(e=>{this.state()==="recording"&&(this.setState("transcribing"),this.transcribeRecording(e))})}setState(e){this.state.set(e),this.stateChange.emit(e)}setError(e){this.errorChange.emit(e)}startDictation(){this.setError(null),this.recordingStart.emit(),this.voiceDictation.start().then(()=>{this.setState("recording"),setTimeout(()=>this.doneButton()?.nativeElement.focus())}).catch(()=>{this.setState("idle"),this.setError("mic")})}stopDictation(){return ge(this,null,function*(){this.state()==="recording"&&(this.setState("transcribing"),this.transcribeRecording(yield this.voiceDictation.stop()))})}cancelDictation(){this.voiceDictation.cancel(),this.setState("idle")}onDictationEscape(e){this.state()!=="idle"&&(e.stopPropagation(),this.abort())}abort(){this.setError(null),this.cancelRequest.next(),this.voiceDictation.cancel(),this.setState("idle")}transcribeRecording(e){let i=localStorage.getItem(Yt.LANG_STORAGE_KEY)||Yt.DEFAULT_LANG;this.chatbotService.transcribeAudio(e,i||void 0).pipe(nt(this.cancelRequest),et(this.errorService.errorHandler({default:()=>this.setError("transcribe")},{returnValue:Ke})),tt(()=>this.setState("idle"))).subscribe(({transcript:n})=>{let r=n.trim();if(!r){this.setError("empty");return}this.transcript.emit(r)})}ngOnDestroy(){this.cancelRequest.complete()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-dictation"]],viewQuery:function(i,n){i&1&&Ot(n.doneButton,$a,5),i&2&&St()},hostBindings:function(i,n){i&1&&N("keydown.escape",function(a){return n.onDictationEscape(a)})},inputs:{disabled:[1,"disabled"],canSend:[1,"canSend"],sendTooltip:[1,"sendTooltip"]},outputs:{recordingStart:"recordingStart",transcript:"transcript",stateChange:"stateChange",errorChange:"errorChange",send:"send"},features:[kn([Bt])],decls:7,vars:5,consts:()=>{let e;e=$localize`Dictate`;let i;i=$localize`Start voice input`;let n;n=$localize`Done`;let r;r=$localize`Stop and transcribe`;let a;a=$localize`Send message`;let p;p=$localize`Listening…`;let _;_=$localize`Transcribing…`;let h;h=$localize`Cancel`;let m;return m=$localize`Cancel voice input`,[["doneButton",""],p,_,[1,"text-quiet","py-8","px-12"],[1,"prompt-actions","d-flex","align-items-center","justify-content-end","gap-8","flex-no-shrink"],["mode","wave"],["type","button","tooltip",e,"aria-label",i,1,"btn","borderless","circle","size-40"],["type","button","tooltip",n,"aria-label",r,1,"btn","primary","circle","size-40","flex-no-shrink"],["type","button","aria-label",a,1,"btn","primary","circle","size-40","flex-no-shrink",3,"tooltip","disabled"],["type","button","tooltip",h,"aria-label",m,1,"btn","secondary","circle","size-40","flex-no-shrink","mr-auto",3,"click"],["name","internal-close",1,"size-20"],[3,"levels"],["type","button","tooltip",e,"aria-label",i,1,"btn","borderless","circle","size-40",3,"click"],["name","internal-mic",1,"size-20"],["type","button","tooltip",n,"aria-label",r,1,"btn","primary","circle","size-40","flex-no-shrink",3,"click"],["name","internal-check",1,"size-20"],["type","button","aria-label",a,1,"btn","primary","circle","size-40","flex-no-shrink",3,"click","tooltip","disabled"],["name","internal-arrow-up",1,"size-20"]]},template:function(i,n){i&1&&(C(0,La,3,1,"span",3),l(1,"div",4),C(2,Ga,3,1),C(3,Fa,1,0,"audio-level-bars",5),C(4,za,2,0,"button",6),C(5,Va,3,0,"button",7)(6,Xa,2,2,"button",8),c()),i&2&&(u(n.state()!=="idle"?0:-1),s(2),u(n.state()==="recording"?2:-1),s(),u(n.state()==="transcribing"?3:-1),s(),u(n.state()==="idle"&&n.micSupported&&!n.disabled()?4:-1),s(),u(n.state()==="recording"?5:6))},dependencies:[Mi,z,Ve],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}}return t})();x();x();function en(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var He=en();function $i(t){He=t}var ke={exec:()=>null};function k(t,o=""){let e=typeof t=="string"?t:t.source,i={replace:(n,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(ee.caret,"$1"),e=e.replace(n,a),i},getRegex:()=>new RegExp(e,o)};return i}var qa=(()=>{try{return!!new RegExp("(?<=1)(?/,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:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,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:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Ya=/^(?:[ \t]*(?:\n|$))+/,ja=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wa=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Di=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ui=k(Di).replace(/bull/g,tn).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Za=k(Di).replace(/bull/g,tn).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ja=/^[^\n]+/,on=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ka=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",on).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),es=k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tn).getRegex(),Ut="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",rn=/|$))/,ts=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",rn).replace("tag",Ut).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Li=k(nn).replace("hr",pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ut).getRegex(),ns=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Li).getRegex(),an={blockquote:ns,code:ja,def:Ka,fences:Qa,heading:Wa,hr:pt,html:ts,lheading:Ui,list:es,newline:Ya,paragraph:Li,table:ke,text:Ja},yi=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ut).getRegex(),is=De(te({},an),{lheading:Za,table:yi,paragraph:k(nn).replace("hr",pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ut).getRegex()}),os=De(te({},an),{html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rn).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ke,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(nn).replace("hr",pt).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Ui).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),rs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,as=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gi=/^( {2,}|\\)\n(?!\s*$)/,ss=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",qa?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),zi=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ps=k(zi,"u").replace(/punct/g,Qe).getRegex(),Cs=k(zi,"u").replace(/punct/g,Fi).getRegex(),Vi="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",us=k(Vi,"gu").replace(/notPunctSpace/g,sn).replace(/punctSpace/g,Lt).replace(/punct/g,Qe).getRegex(),ms=k(Vi,"gu").replace(/notPunctSpace/g,_s).replace(/punctSpace/g,cs).replace(/punct/g,Fi).getRegex(),gs=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,sn).replace(/punctSpace/g,Lt).replace(/punct/g,Qe).getRegex(),hs=k(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qe).getRegex(),Ts="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",fs=k(Ts,"gu").replace(/notPunctSpace/g,sn).replace(/punctSpace/g,Lt).replace(/punct/g,Qe).getRegex(),Os=k(/\\(punct)/,"gu").replace(/punct/g,Qe).getRegex(),Ss=k(/^<(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(),Es=k(rn).replace("(?:-->|$)","-->").getRegex(),As=k("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Es).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ht=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,xs=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ht).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xi=k(/^!?\[(label)\]\[(ref)\]/).replace("label",Ht).replace("ref",on).getRegex(),qi=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",on).getRegex(),bs=k("reflink|nolink(?!\\()","g").replace("reflink",Xi).replace("nolink",qi).getRegex(),Ii=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ln={_backpedal:ke,anyPunctuation:Os,autolink:Ss,blockSkip:ds,br:Gi,code:as,del:ke,delLDelim:ke,delRDelim:ke,emStrongLDelim:ps,emStrongRDelimAst:us,emStrongRDelimUnd:gs,escape:rs,link:xs,nolink:qi,punctuation:ls,reflink:Xi,reflinkSearch:bs,tag:As,text:ss,url:ke},Ns=De(te({},ln),{link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",Ht).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ht).getRegex()}),Zt=De(te({},ln),{emStrongRDelimAst:ms,emStrongLDelim:Cs,delLDelim:hs,delRDelim:fs,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ii).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:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Bi=t=>Ms[t];function me(t,o){if(o){if(ee.escapeTest.test(t))return t.replace(ee.escapeReplace,Bi)}else if(ee.escapeTestNoEncode.test(t))return t.replace(ee.escapeReplaceNoEncode,Bi);return t}function ki(t){try{t=encodeURI(t).replace(ee.percentDecode,"%")}catch(o){return null}return t}function wi(t,o){let e=t.replace(ee.findPipe,(r,a,p)=>{let _=!1,h=a;for(;--h>=0&&p[h]==="\\";)_=!_;return _?"|":" |"}),i=e.split(ee.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length0?-2:-1}function Rs(t,o=0){let e=o,i="";for(let n of t)if(n===" "){let r=4-e%4;i+=" ".repeat(r),e+=r}else i+=n,e++;return i}function Hi(t,o,e,i,n){let r=o.href,a=o.title||null,p=t[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let _={type:t[0].charAt(0)==="!"?"image":"link",raw:e,href:r,title:a,text:p,tokens:i.inlineTokens(p)};return i.state.inLink=!1,_}function ys(t,o,e){let i=t.match(e.other.indentCodeCompensation);if(i===null)return o;let n=i[1];return o.split(` `).map(r=>{let a=r.match(e.other.beginningSpace);if(a===null)return r;let[p]=a;return p.length>=n.length?r.slice(n.length):r}).join(` `)}var $t=class{options;rules;lexer;constructor(t){this.options=t||He}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let e=o[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:o[0],codeBlockStyle:"indented",text:this.options.pedantic?e:_t(e,` `)}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let e=o[0],i=ys(e,o[3]||"",this.rules);return{type:"code",raw:e,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let e=o[2].trim();if(this.rules.other.endingHash.test(e)){let i=_t(e,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(e=i.trim())}return{type:"heading",raw:o[0],depth:o[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:_t(o[0],` `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let e=_t(o[0],` `).split(` `),i="",n="",r=[];for(;e.length>0;){let a=!1,p=[],_;for(_=0;_1,n={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let r=this.rules.other.listItemRegex(e),a=!1;for(;t;){let _=!1,h="",m="";if(!(o=r.exec(t))||this.rules.block.hr.test(t))break;h=o[0],t=t.substring(h.length);let S=Rs(o[2].split(` `,1)[0],o[1].length),M=t.split(` `,1)[0],V=!S.trim(),D=0;if(this.options.pedantic?(D=2,m=S.trimStart()):V?D=o[1].length+1:(D=S.search(this.rules.other.nonSpaceChar),D=D>4?1:D,m=S.slice(D),D+=o[1].length),V&&this.rules.other.blankLine.test(M)&&(h+=M+` `,t=t.substring(M.length+1),_=!0),!_){let re=this.rules.other.nextBulletRegex(D),We=this.rules.other.hrRegex(D),Ze=this.rules.other.fencesBeginRegex(D),Je=this.rules.other.headingBeginRegex(D),Ct=this.rules.other.htmlBeginRegex(D),ut=this.rules.other.blockquoteBeginRegex(D);for(;t;){let $e=t.split(` `,1)[0],Ee;if(M=$e,this.options.pedantic?(M=M.replace(this.rules.other.listReplaceNesting," "),Ee=M):Ee=M.replace(this.rules.other.tabCharGlobal," "),Ze.test(M)||Je.test(M)||Ct.test(M)||ut.test(M)||re.test(M)||We.test(M))break;if(Ee.search(this.rules.other.nonSpaceChar)>=D||!M.trim())m+=` `+Ee.slice(D);else{if(V||S.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Ze.test(S)||Je.test(S)||We.test(S))break;m+=` `+M}V=!M.trim(),h+=$e+` `,t=t.substring($e.length+1),S=Ee.slice(D)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),n.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),n.raw+=h}let p=n.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let _ of n.items){if(this.lexer.state.top=!1,_.tokens=this.lexer.blockTokens(_.text,[]),_.task){if(_.text=_.text.replace(this.rules.other.listReplaceTask,""),_.tokens[0]?.type==="text"||_.tokens[0]?.type==="paragraph"){_.tokens[0].raw=_.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),_.tokens[0].text=_.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(_.raw);if(h){let m={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};_.checked=m.checked,n.loose?_.tokens[0]&&["paragraph","text"].includes(_.tokens[0].type)&&"tokens"in _.tokens[0]&&_.tokens[0].tokens?(_.tokens[0].raw=m.raw+_.tokens[0].raw,_.tokens[0].text=m.raw+_.tokens[0].text,_.tokens[0].tokens.unshift(m)):_.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):_.tokens.unshift(m)}}if(!n.loose){let h=_.tokens.filter(S=>S.type==="space"),m=h.length>0&&h.some(S=>this.rules.other.anyLine.test(S.raw));n.loose=m}}if(n.loose)for(let _ of n.items){_.loose=!0;for(let h of _.tokens)h.type==="text"&&(h.type="paragraph")}return n}}html(t){let o=this.rules.block.html.exec(t);if(o)return{type:"html",block:!0,raw:o[0],pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:o[0]}}def(t){let o=this.rules.block.def.exec(t);if(o){let e=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:e,raw:o[0],href:i,title:n}}}table(t){let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let e=wi(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=o[3]?.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],r={type:"table",raw:o[0],header:[],align:[],rows:[]};if(e.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a({text:p,tokens:this.lexer.inline(p),header:!1,align:r.align[_]})));return r}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let e=o[1].trim();return{type:"heading",raw:o[0],depth:o[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let e=o[1].charAt(o[1].length-1)===` `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:e,tokens:this.lexer.inline(e)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let e=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let r=_t(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=Ps(o[2],"()");if(r===-2)return;if(r>-1){let a=(o[0].indexOf("!")===0?5:4)+o[1].length+r;o[2]=o[2].substring(0,r),o[0]=o[0].substring(0,a).trim(),o[3]=""}}let i=o[2],n="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],n=r[3])}else n=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?i=i.slice(1):i=i.slice(1,-1)),Hi(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let e;if((e=this.rules.inline.reflink.exec(t))||(e=this.rules.inline.nolink.exec(t))){let i=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=o[i.toLowerCase()];if(!n){let r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return Hi(e,n,e[0],this.lexer,this.rules)}}emStrong(t,o,e=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!e||this.rules.inline.punctuation.exec(e))){let n=[...i[0]].length-1,r,a,p=n,_=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,o=o.slice(-1*t.length+n);(i=h.exec(o))!==null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(a=[...r].length,i[3]||i[4]){p+=a;continue}else if((i[5]||i[6])&&n%3&&!((n+a)%3)){_+=a;continue}if(p-=a,p>0)continue;a=Math.min(a,a+p+_);let m=[...i[0]][0].length,S=t.slice(0,n+i.index+m+a);if(Math.min(n,a)%2){let V=S.slice(1,-1);return{type:"em",raw:S,text:V,tokens:this.lexer.inlineTokens(V)}}let M=S.slice(2,-2);return{type:"strong",raw:S,text:M,tokens:this.lexer.inlineTokens(M)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let e=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return i&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:o[0],text:e}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,e=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!e||this.rules.inline.punctuation.exec(e))){let n=[...i[0]].length-1,r,a,p=n,_=this.rules.inline.delRDelim;for(_.lastIndex=0,o=o.slice(-1*t.length+n);(i=_.exec(o))!==null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r||(a=[...r].length,a!==n))continue;if(i[3]||i[4]){p+=a;continue}if(p-=a,p>0)continue;a=Math.min(a,a+p);let h=[...i[0]][0].length,m=t.slice(0,n+i.index+h+a),S=m.slice(n,-n);return{type:"del",raw:m,text:S,tokens:this.lexer.inlineTokens(S)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let e,i;return o[2]==="@"?(e=o[1],i="mailto:"+e):(e=o[1],i=e),{type:"link",raw:o[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(t){let o;if(o=this.rules.inline.url.exec(t)){let e,i;if(o[2]==="@")e=o[0],i="mailto:"+e;else{let n;do n=o[0],o[0]=this.rules.inline._backpedal.exec(o[0])?.[0]??"";while(n!==o[0]);e=o[0],o[1]==="www."?i="http://"+o[0]:i=o[0]}return{type:"link",raw:o[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let e=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:e}}}},_e=class Jt{tokens;options;state;inlineQueue;tokenizer;constructor(o){this.tokens=[],this.tokens.links=Object.create(null),this.options=o||He,this.options.tokenizer=this.options.tokenizer||new $t,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:ee,block:wt.normal,inline:ct.normal};this.options.pedantic?(e.block=wt.pedantic,e.inline=ct.pedantic):this.options.gfm&&(e.block=wt.gfm,this.options.breaks?e.inline=ct.breaks:e.inline=ct.gfm),this.tokenizer.rules=e}static get rules(){return{block:wt,inline:ct}}static lex(o,e){return new Jt(e).lex(o)}static lexInline(o,e){return new Jt(e).inlineTokens(o)}lex(o){o=o.replace(ee.carriageReturn,` `),this.blockTokens(o,this.tokens);for(let e=0;e(n=a.call({lexer:this},o,e))?(o=o.substring(n.raw.length),e.push(n),!0):!1))continue;if(n=this.tokenizer.space(o)){o=o.substring(n.raw.length);let a=e.at(-1);n.raw.length===1&&a!==void 0?a.raw+=` `:e.push(n);continue}if(n=this.tokenizer.code(o)){o=o.substring(n.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+n.raw,a.text+=` `+n.text,this.inlineQueue.at(-1).src=a.text):e.push(n);continue}if(n=this.tokenizer.fences(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(o)){o=o.substring(n.raw.length);let a=e.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+n.raw,a.text+=` `+n.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},e.push(n));continue}if(n=this.tokenizer.table(o)){o=o.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(o)){o=o.substring(n.raw.length),e.push(n);continue}let r=o;if(this.options.extensions?.startBlock){let a=1/0,p=o.slice(1),_;this.options.extensions.startBlock.forEach(h=>{_=h.call({lexer:this},p),typeof _=="number"&&_>=0&&(a=Math.min(a,_))}),a<1/0&&a>=0&&(r=o.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r))){let a=e.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+n.raw,a.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(n),i=r.length!==o.length,o=o.substring(n.raw.length);continue}if(n=this.tokenizer.text(o)){o=o.substring(n.raw.length);let a=e.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+n.raw,a.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):e.push(n);continue}if(o){let a="Infinite loop on byte: "+o.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,e}inline(o,e=[]){return this.inlineQueue.push({src:o,tokens:e}),e}inlineTokens(o,e=[]){this.tokenizer.lexer=this;let i=o,n=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)_.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,n.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)r=n[2]?n[2].length:0,i=i.slice(0,n.index+r)+"["+"a".repeat(n[0].length-r-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,p="";for(;o;){a||(p=""),a=!1;let _;if(this.options.extensions?.inline?.some(m=>(_=m.call({lexer:this},o,e))?(o=o.substring(_.raw.length),e.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let m=e.at(-1);_.type==="text"&&m?.type==="text"?(m.raw+=_.raw,m.text+=_.text):e.push(_);continue}if(_=this.tokenizer.emStrong(o,i,p)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.del(o,i,p)){o=o.substring(_.raw.length),e.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),e.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),e.push(_);continue}let h=o;if(this.options.extensions?.startInline){let m=1/0,S=o.slice(1),M;this.options.extensions.startInline.forEach(V=>{M=V.call({lexer:this},S),typeof M=="number"&&M>=0&&(m=Math.min(m,M))}),m<1/0&&m>=0&&(h=o.substring(0,m+1))}if(_=this.tokenizer.inlineText(h)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(p=_.raw.slice(-1)),a=!0;let m=e.at(-1);m?.type==="text"?(m.raw+=_.raw,m.text+=_.text):e.push(_);continue}if(o){let m="Infinite loop on byte: "+o.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return e}},Dt=class{options;parser;constructor(t){this.options=t||He}space(t){return""}code({text:t,lang:o,escaped:e}){let i=(o||"").match(ee.notSpaceStart)?.[0],n=t.replace(ee.endingNewline,"")+` `;return i?'
'+(e?n:me(n,!0))+`
`:"
"+(e?n:me(n,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`${this.parser.parseInline(t)} `}hr(t){return`
`}list(t){let o=t.ordered,e=t.start,i="";for(let a=0;a `+i+" `}listitem(t){return`
  • ${this.parser.parse(t.tokens)}
  • `}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    `}table(t){let o="",e="";for(let n=0;n${i}`),` `+o+` `+i+`
    `}tablerow({text:t}){return` ${t} `}tablecell(t){let o=this.parser.parseInline(t.tokens),e=t.header?"th":"td";return(t.align?`<${e} align="${t.align}">`:`<${e}>`)+o+` `}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${me(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:o,tokens:e}){let i=this.parser.parseInline(e),n=ki(t);if(n===null)return i;t=n;let r='
    ",r}image({href:t,title:o,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let n=ki(t);if(n===null)return me(e);t=n;let r=`${me(e)}{let a=n[r].flat(1/0);e=e.concat(this.walkTokens(a,o))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,o)))}}return e}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(e=>{let i=te({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let r=o.renderers[n.name];r?o.renderers[n.name]=function(...a){let p=n.renderer.apply(this,a);return p===!1&&(p=r.apply(this,a)),p}:o.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=o[n.level];r?r.unshift(n.tokenizer):o[n.level]=[n.tokenizer],n.start&&(n.level==="block"?o.startBlock?o.startBlock.push(n.start):o.startBlock=[n.start]:n.level==="inline"&&(o.startInline?o.startInline.push(n.start):o.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(o.childTokens[n.name]=n.childTokens)}),i.extensions=o),e.renderer){let n=this.defaults.renderer||new Dt(this.defaults);for(let r in e.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,p=e.renderer[a],_=n[a];n[a]=(...h)=>{let m=p.apply(n,h);return m===!1&&(m=_.apply(n,h)),m||""}}i.renderer=n}if(e.tokenizer){let n=this.defaults.tokenizer||new $t(this.defaults);for(let r in e.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,p=e.tokenizer[a],_=n[a];n[a]=(...h)=>{let m=p.apply(n,h);return m===!1&&(m=_.apply(n,h)),m}}i.tokenizer=n}if(e.hooks){let n=this.defaults.hooks||new dt;for(let r in e.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,p=e.hooks[a],_=n[a];dt.passThroughHooks.has(r)?n[a]=h=>{if(this.defaults.async&&dt.passThroughHooksRespectAsync.has(r))return ge(this,null,function*(){let S=yield p.call(n,h);return _.call(n,S)});let m=p.call(n,h);return _.call(n,m)}:n[a]=(...h)=>{if(this.defaults.async)return ge(this,null,function*(){let S=yield p.apply(n,h);return S===!1&&(S=yield _.apply(n,h)),S});let m=p.apply(n,h);return m===!1&&(m=_.apply(n,h)),m}}i.hooks=n}if(e.walkTokens){let n=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(a){let p=[];return p.push(r.call(this,a)),n&&(p=p.concat(n.call(this,a))),p}}this.defaults=te(te({},this.defaults),i)}),this}setOptions(t){return this.defaults=te(te({},this.defaults),t),this}lexer(t,o){return _e.lex(t,o??this.defaults)}parser(t,o){return de.parse(t,o??this.defaults)}parseMarkdown(t){return(o,e)=>{let i=te({},e),n=te(te({},this.defaults),i),r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return ge(this,null,function*(){let a=n.hooks?yield n.hooks.preprocess(o):o,p=yield(n.hooks?yield n.hooks.provideLexer(t):t?_e.lex:_e.lexInline)(a,n),_=n.hooks?yield n.hooks.processAllTokens(p):p;n.walkTokens&&(yield Promise.all(this.walkTokens(_,n.walkTokens)));let h=yield(n.hooks?yield n.hooks.provideParser(t):t?de.parse:de.parseInline)(_,n);return n.hooks?yield n.hooks.postprocess(h):h}).catch(r);try{n.hooks&&(o=n.hooks.preprocess(o));let a=(n.hooks?n.hooks.provideLexer(t):t?_e.lex:_e.lexInline)(o,n);n.hooks&&(a=n.hooks.processAllTokens(a)),n.walkTokens&&this.walkTokens(a,n.walkTokens);let p=(n.hooks?n.hooks.provideParser(t):t?de.parse:de.parseInline)(a,n);return n.hooks&&(p=n.hooks.postprocess(p)),p}catch(a){return r(a)}}}onError(t,o){return e=>{if(e.message+=` Please report this to https://github.com/markedjs/marked.`,t){let i="

    An error occurred:

    "+me(e.message+"",!0)+"
    ";return o?Promise.resolve(i):i}if(o)return Promise.reject(e);throw e}}},we=new Is;function H(t,o){return we.parse(t,o)}H.options=H.setOptions=function(t){return we.setOptions(t),H.defaults=we.defaults,$i(H.defaults),H};H.getDefaults=en;H.defaults=He;H.use=function(...t){return we.use(...t),H.defaults=we.defaults,$i(H.defaults),H};H.walkTokens=function(t,o){return we.walkTokens(t,o)};H.parseInline=we.parseInline;H.Parser=de;H.parser=de.parse;H.Renderer=Dt;H.TextRenderer=cn;H.Lexer=_e;H.lexer=_e.lex;H.Tokenizer=$t;H.Hooks=dt;H.parse=H;var sd=H.options,ld=H.setOptions,cd=H.use,_d=H.walkTokens,dd=H.parseInline;var pd=de.parse,Cd=_e.lex;var Yi=(()=>{class t{transform(e){return H.parse(e).trim()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Tt({name:"markdown",type:t,pure:!0})}}return t})();x();var ji=(()=>{class t{constructor(){this.isSupported=typeof document<"u"&&typeof document.requestStorageAccess=="function"}requestAccess(){return this.isSupported?document.requestStorageAccess().then(()=>!0,()=>!1):Promise.resolve(!0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=mt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();x();var Qi=(()=>{class t{transform(e){if(!e)return e;let i=document.createElement("div"),n=r=>(i.textContent=r,i.innerHTML);return e.replace(/^(?:\r?\n)+|(?:\r?\n)+$/g,"").split(/(?:\r?\n){2,}/).map(r=>`

    ${r.split(/\r?\n/).map(n).join("
    ")}

    `).join("")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=Tt({name:"plainTextAsHtml",type:t,pure:!0})}}return t})();x();var Gt=1,Bs="8%",be={VERTICAL:"vertical",HORIZONTAL:"horizontal"},Wi=(()=>{class t{constructor(){this.host=Y(Mn).nativeElement,this.ngZone=Y(gt),this.destroyRef=Y(vn),this.scrollFade=$(be.VERTICAL),this.scrollFadeDistance=$(Bs),this.scrollFadeTrailingOffset=$(0),this.update=()=>{this.applyFadeClasses(this.scrollFade()===be.HORIZONTAL?be.HORIZONTAL:be.VERTICAL,this.scrollFadeTrailingOffset())},Hn(()=>{let i=this.scrollFade()===be.HORIZONTAL?be.HORIZONTAL:be.VERTICAL,n=this.scrollFadeTrailingOffset();this.host.style.setProperty("--fade-dist",this.scrollFadeDistance()),this.applyFadeClasses(i,n)});let e;this.ngZone.runOutsideAngular(()=>{this.host.addEventListener("scroll",this.update,{passive:!0}),e=new ResizeObserver(this.update),e.observe(this.host)}),this.destroyRef.onDestroy(()=>{this.host.removeEventListener("scroll",this.update),e?.disconnect()})}applyFadeClasses(e,i){let n=this.host;if(e===be.HORIZONTAL){let r=n.scrollLeft<=Gt,a=n.scrollLeft+n.clientWidth>=n.scrollWidth-Gt;n.classList.toggle("fade-left",!r),n.classList.toggle("fade-right",!a),n.classList.remove("fade-up","fade-down")}else{let r=n.scrollTop<=Gt,a=i>0?n.scrollHeight-i:n.scrollHeight,p=n.scrollTop+n.clientHeight>=a-Gt;n.classList.toggle("fade-up",!r),n.classList.toggle("fade-down",!p),n.classList.remove("fade-left","fade-right")}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=ht({type:t,selectors:[["","scrollFade",""]],hostAttrs:[1,"fade-out"],inputs:{scrollFade:[1,"scrollFade"],scrollFadeDistance:[1,"scrollFadeDistance"],scrollFadeTrailingOffset:[1,"scrollFadeTrailingOffset"]}})}}return t})();var ks=["messageInputEl"],ws=["scrollContainer"],Hs=["scrollFiller"],$s=["topSentinel"],Ji=(t,o,e)=>({item:t,previousItem:o,isLast:e}),Zi=(t,o)=>o.message.timestamp+o.message.content,Ds=(t,o)=>o.label,Us=(t,o)=>o.identity;function Ls(t,o){if(t&1){let e=v();l(0,"button",46),N("click",function(){E(e);let n=d(2);return A(n.closeRequested.emit())}),g(1,"icon",47),c()}}function Gs(t,o){if(t&1){let e=v();l(0,"div",33)(1,"div",39),g(2,"profile-pic",40),c(),l(3,"div",41)(4,"h2",42),f(5,6),c()(),l(6,"button",43),N("click",function(){E(e);let n=d();return A(n.newConversation())}),g(7,"icon",44),l(8,"span"),f(9,7),c()(),C(10,Ls,2,0,"button",45),c()}if(t&2){let e,i=d();s(2),b("manualOverrideSrc",i.chatbotAvatar()),s(3),ot(((e=i.aiChatbotConfig())==null?null:e.branding.chatbot_name)??""),rt(5),s(5),u(i.closable()?10:-1)}}function Fs(t,o){if(t&1){let e=v();l(0,"tabs")(1,"tab-action",48),N("tabOnClick",function(){E(e);let n=d();return A(n.activeTab.set("chatbot"))}),c(),l(2,"tab-action",49),N("tabOnClick",function(){E(e);let n=d();return A(n.activeTab.set("sources"))}),c()()}if(t&2){let e=d();s(),b("active",e.activeTab()==="chatbot")("fullWidth",!0),s(),b("active",e.activeTab()==="sources")("fullWidth",!0)}}function zs(t,o){t&1&&g(0,"loader",36)}function Vs(t,o){t&1&&fe(0)}function Xs(t,o){if(t&1&&ne(0,Vs,1,0,"ng-container",54),t&2){let e=o.$implicit,i=o.$index,n=o.$index,r=o.$count,a=d(2),p=pe(14);b("ngTemplateOutlet",p)("ngTemplateOutletContext",qt(2,Ji,e,a.introMessages()[i-1],n===r-1))}}function qs(t,o){t&1&&fe(0)}function Ys(t,o){if(t&1&&ne(0,qs,1,0,"ng-container",54),t&2){let e=o.$implicit,i=o.$index,n=o.$index,r=o.$count,a=d(2),p=pe(14);b("ngTemplateOutlet",p)("ngTemplateOutletContext",qt(2,Ji,e,a.conversation()[i-1],n===r-1))}}function js(t,o){if(t&1){let e=v();l(0,"div",51)(1,"div",55)(2,"div",56)(3,"div",57),f(4,8),c(),l(5,"button",58),N("click",function(){E(e);let n=d(2);return A(n.onSessionExpiredLogin())}),l(6,"span"),f(7,9),c()()()()()}}function Qs(t,o){t&1&&(l(0,"div",51)(1,"div",55)(2,"div",56)(3,"div",59),g(4,"div",60)(5,"div",60)(6,"div",60),c()()()())}function Ws(t,o){if(t&1&&(l(0,"p",52),yn(1,10),g(2,"span",61),In(),c()),t&2){let e=d(2);s(2),ot(e.chatbotName()),rt(1)}}function Zs(t,o){if(t&1){let e=v();l(0,"div",63)(1,"button",65),N("click",function(){E(e);let n=d(3);return A(n.startRating())}),g(2,"icon",66)(3,"icon",67),l(4,"span"),f(5,11),c()()()}t&2&&(s(4),R("margin-left",8,"px"))}function Js(t,o){t&1&&(l(0,"div",76),f(1,16),c())}function Ks(t,o){if(t&1){let e=v();l(0,"form",68,4),N("ngSubmit",function(){E(e);let n=d(3);return A(n.rateConversation())}),l(2,"div",69)(3,"p",70),f(4,12),c(),l(5,"button",71),N("click",function(){E(e);let n=d(3);return A(n.stopRating())}),g(6,"icon",47),c()(),l(7,"div",72)(8,"button",73),N("click",function(){E(e);let n=d(3);return A(n.ratingData.rating=!0)}),g(9,"icon",66),l(10,"span"),f(11,13),c()(),l(12,"button",73),N("click",function(){E(e);let n=d(3);return A(n.ratingData.rating=!1)}),g(13,"icon",67),l(14,"span"),f(15,14),c()()(),l(16,"textarea",74),Re("ngModelChange",function(n){E(e);let r=d(3);return Pe(r.ratingData.rating_comment,n)||(r.ratingData.rating_comment=n),A(n)}),c(),l(17,"button",75)(18,"span"),f(19,15),c()()(),C(20,Js,2,0,"div",76)}if(t&2){let e=pe(1),i=d(3);R("border-bottom-left-radius",4,"px"),s(8),oe(i.ratingData.rating===!0?"primary":"secondary"),ie("aria-checked",i.ratingData.rating===!0),s(4),oe(i.ratingData.rating===!1?"primary":"secondary"),ie("aria-checked",i.ratingData.rating===!1),s(4),Me("ngModel",i.ratingData.rating_comment),s(),X("loading",i.isSubmittingRating()),b("disabled",e.invalid||i.ratingData.rating===null),s(3),u(i.ratingError()?20:-1)}}function el(t,o){t&1&&(l(0,"div",64),f(1,17),c())}function tl(t,o){if(t&1){let e=v();l(0,"div",62),N("resized",function(){E(e);let n=d(2);return A(n.onRatingResized())}),C(1,Zs,6,2,"div",63)(2,Ks,21,13)(3,el,2,0,"div",64),c()}if(t&2){let e,i=d(2);s(),u((e=i.ratingState())==="available"?1:e==="form-visible"?2:e==="submitted"?3:-1)}}function nl(t,o){if(t&1&&(I(0,Xs,1,6,"ng-container",null,Zi),g(2,"div",50,3),I(4,Ys,1,6,"ng-container",null,Zi),C(6,js,8,0,"div",51),C(7,Qs,7,0,"div",51),C(8,Ws,3,1,"p",52),C(9,tl,4,1,"div",53)),t&2){let e,i=d();B(i.introMessages()),s(4),B(i.conversation()),s(2),u(i.sessionExpired()?6:-1),s(),u(i.waitingForResponse()?7:-1),s(),u(((e=i.conversation().at(-1))==null?null:e.message.author)===i.BotMessageAuthor.CHATBOT?8:-1),s(),u(i.isRatingUiVisible()?9:-1)}}function il(t,o){t&1&&(l(0,"div",77)(1,"div"),g(2,"loader",36),l(3,"div"),f(4,18),c()()())}function ol(t,o){if(t&1&&g(0,"chatbot-source-link",80),t&2){let e=o.$implicit;b("source",e)}}function rl(t,o){if(t&1&&(l(0,"div",78)(1,"div",79),T(2),c(),I(3,ol,1,1,"chatbot-source-link",80,Us),c()),t&2){let e=o.$implicit;s(2),F("",e.label,":"),s(),B(e.sources)}}function al(t,o){if(t&1&&I(0,rl,5,1,"div",78,Ds),t&2){let e=d(2);B(e.sources())}}function sl(t,o){t&1&&g(0,"no-item",81)}function ll(t,o){if(t&1){let e=v();l(0,"no-item",82)(1,"button",83),N("click",function(){E(e);let n=d(3);return A(n.regenerateLastResponse())}),g(2,"icon",84),l(3,"span"),f(4,19),c()()()}}function cl(t,o){if(t&1&&(l(0,"div",77),C(1,sl,1,0,"no-item",81)(2,ll,5,0,"no-item",82),c()),t&2){let e=d(2);s(),u(e.conversationPublicId()?2:1)}}function _l(t,o){if(t&1&&C(0,il,5,0,"div",77)(1,al,2,0)(2,cl,3,1,"div",77),t&2){let e,i=d();u(i.waitingForResponse()?0:(e=i.sources())!=null&&e.length?1:2)}}function dl(t,o){if(t&1){let e=v();l(0,"button",85),N("click",function(){E(e);let n=d();return A(n.regenerateLastResponse())}),g(1,"icon",84),l(2,"span"),T(3),c()()}if(t&2){let e=d();s(3),O(e.regenerateButtonText())}}function pl(t,o){if(t&1){let e=v();l(0,"textarea",95,5),Re("ngModelChange",function(n){E(e);let r=d(2);return Pe(r.messageInput,n)||(r.messageInput=n),A(n)}),N("keydown",function(n){E(e);let r=d(2);return A(r.onMessageKeydown(n))})("input",function(){E(e);let n=d(2);return A(n.dictationError.set(null))}),c()}if(t&2){let e=d(2);b("disabled",e.waitingForResponse()),Me("ngModel",e.messageInput)}}function Cl(t,o){t&1&&(he(0),f(1,20),Te())}function ul(t,o){t&1&&(he(0),f(1,21),Te())}function ml(t,o){t&1&&(l(0,"div",93),f(1,22),c())}function gl(t,o){t&1&&(he(0),f(1,23),Te())}function hl(t,o){t&1&&(he(0),f(1,24),Te())}function Tl(t,o){t&1&&(he(0),f(1,25),Te())}function fl(t,o){if(t&1&&(l(0,"div",94),C(1,gl,2,0,"ng-container")(2,hl,2,0,"ng-container")(3,Tl,2,0,"ng-container"),c()),t&2){let e;s(),u((e=o)==="empty"?1:e==="mic"?2:3)}}function Ol(t,o){if(t&1){let e=v();l(0,"div",86)(1,"button",87),N("keydown.enter",function(n){return n.stopPropagation()})("click",function(){E(e);let n=d();return A(n.smoothScrollToBottom())}),g(2,"icon",88),c(),l(3,"div",89),C(4,pl,2,2,"textarea",90),l(5,"chatbot-dictation",91),N("recordingStart",function(){E(e);let n=d();return A(n.onDictationStart())})("transcript",function(n){E(e);let r=d();return A(r.insertTranscript(n))})("send",function(){E(e);let n=d();return A(n.submit())})("stateChange",function(n){E(e);let r=d();return A(r.onDictationStateChange(n))})("errorChange",function(n){E(e);let r=d();return A(r.dictationError.set(n))}),c()(),l(6,"span",92),C(7,Cl,2,0,"ng-container")(8,ul,2,0,"ng-container"),c()(),C(9,ml,2,0,"div",93),C(10,fl,4,1,"div",94)}if(t&2){let e,i,n=d();s(),X("visible",n.showScrollToBottom()),s(3),u(n.dictationState()==="idle"?4:-1),s(),b("disabled",n.waitingForResponse())("canSend",n.canSendMessage())("sendTooltip",n.sendButtonTooltip()),s(2),u((e=n.dictationState())==="recording"?7:e==="transcribing"?8:-1),s(2),u(n.sendMessageError()?9:-1),s(),u((i=n.dictationError())?10:-1,i)}}function Sl(t,o){t&1&&(l(0,"div"),f(1,26),c())}function El(t,o){if(t&1&&g(0,"chatbot-upgrade",99),t&2){d();let e=Fe(0);b("messageUpgrade",e.upgrade)}}function Al(t,o){t&1&&(l(0,"p",106),f(1,29),c())}function xl(t,o){if(t&1){let e=v();l(0,"p",104),f(1,27),c(),l(2,"button",105),N("click",function(){E(e);let n=d(4);return A(n.continueLogin())}),l(3,"span"),f(4,28),c()(),C(5,Al,2,0,"p",106)}if(t&2){let e=d(4);s(5),u(e.storageAccessDenied()?5:-1)}}function bl(t,o){if(t&1){let e=v();l(0,"button",58),N("click",function(){E(e);let n=d(4);return A(n.login())}),l(1,"span"),f(2,30),c()()}}function Nl(t,o){if(t&1&&C(0,xl,6,1)(1,bl,3,0,"button",103),t&2){let e=d(3);u(e.awaitingLoginReturn()?0:1)}}function vl(t,o){if(t&1&&(g(0,"div",102),w(1,"markdown"),w(2,"plainTextAsHtml"),C(3,Nl,2,1)),t&2){let e=d().item,i=Fe(0),n=d();b("innerHTML",i.author===n.BotMessageAuthor.CHATBOT?W(1,2,i.content):W(2,4,i.content),Ue),s(3),u(e.type==="login"?3:-1)}}function Ml(t,o){t&1&&(l(0,"div"),f(1,31),c())}function Pl(t,o){if(t&1){let e=v();l(0,"chatbot-sources",107),N("resized",function(){E(e);let n=d().isLast,r=Fe(0),a=d();return A(n&&r.author===a.BotMessageAuthor.CHATBOT&&(a.anchoredUserMsgKey()?a.recomputeFillerHeight():a.scrollToBottom()))}),c()}if(t&2){d();let e=Fe(10);b("sources",e)}}function Rl(t,o){if(t&1){let e=v();Vt(0),l(1,"div",96)(2,"div",97)(3,"div",56)(4,"div",98),N("resized",function(){let n=E(e).isLast,r=Fe(0),a=d();return A(n&&r.author===a.BotMessageAuthor.CHATBOT&&(a.anchoredUserMsgKey()?a.recomputeFillerHeight():a.scrollToBottom()))}),C(5,Sl,2,0,"div")(6,El,1,1,"chatbot-upgrade",99)(7,vl,4,6)(8,Ml,2,0,"div"),c(),g(9,"bot-message-answer-type-label",100),c(),Vt(10),C(11,Pl,1,1,"chatbot-sources",101),c()()}if(t&2){let e=o.item,i=o.previousItem,n=d(),r=Xt(e.message);s(),oe(r.author===(i==null?null:i.message.author)?"mt-4":"mt-8"),X("message-own",r.author===n.BotMessageAuthor.USER)("user-text",r.author===n.BotMessageAuthor.USER),ie("data-author",r.author),s(),X("flex-grow",r.author===n.BotMessageAuthor.CHATBOT),s(2),X("text-keep-newlines",r.author===n.BotMessageAuthor.USER),s(),u(r.failed?5:r.author===n.BotMessageAuthor.CHATBOT&&n.isValidUpgrade(r)?6:r.content?7:8),s(4),b("answerType",r.answer_type),s();let a=Xt(n.visibleSources(r));s(),u(a.length&&!n.isSimulation()?11:-1)}}var Cp=(()=>{class t{visibleSources(e){return this.usersService.isAuthenticated()?e.sources:e.sources.filter(i=>!(i.source==="internal"&&(i.object_type==="faq"||i.object_type==="resource")))}constructor(){this.usersService=Y(Wn),this.chatbotService=Y(Pt),this.errorService=Y(Nt),this.cdr=Y(wn),this.storageAccessService=Y(ji),this.originUrl=window.FRONTEND_SERVER??window.location.origin,this.aiChatbotConfig=$.required(),this.displayLoginButtonWhenUnauth=$(!1),this.refreshConfig=le(),this.closable=$(!1),this.closeRequested=le(),this.fullScreen=$(!1),this.isSimulation=$(!1),this.overrideContentConfig=$(),this.hideHeader=$(!1),this.hydrateFromConversation=$(null),this.olderMessages=$(null),this.loadingOlder=$(!1),this.canLoadOlder=$(!1),this.firstTurnComplete=le(),this.loadOlderMessages=le(),this.conversationUpdated=le(),this.conversation=U([]),this.messageInput=U(""),this.isNonTouch=Gn(),this.chatbotTooltip=K(()=>$localize`${this.aiChatbotConfig()?.branding.chatbot_name??"AI Agent"}:name of chatbot: may display inaccurate information if it's not marked as verified.`),this.conversationPublicId=U(null),this.waitingForResponse=U(!1),this.sessionExpired=U(!1),this.canSendMessage=K(()=>this.messageInput().trim().length>0&&!this.waitingForResponse()&&!this.sessionExpired()),this.sendButtonTooltip=K(()=>this.sessionExpired()?$localize`Log in to send`:this.isNonTouch?$localize`:Send (verb) Enter (Keyboard Shortcut):Send (Enter)`:$localize`:Send (verb):Send`),this.dictationState=U("idle"),this.dictationError=U(null),this.currentColorMode=Jn(this.usersService.currentColorMode$),this.chatbotName=K(()=>this.aiChatbotConfig()?.branding.chatbot_name||$localize`AI Agent`),this.chatbotAvatar=K(()=>{let i=this.aiChatbotConfig().branding;return this.currentColorMode()===Ln.DARK?i.avatar_image_dark:i.avatar_image_light}),this.showScrollToBottom=U(!1),this.scrollFillerHeight=U(0),this.anchoredUserMsgKey=U(null),this.anchorScrollTop=0,this.reanchorPending=!1,this.reanchorTimer=null,this.reanchorBaselineHeight=0,this.ratingState=U("available"),this.isSubmittingRating=U(!1),this.ratingError=U(!1),this.sendMessageError=U(!1),this.isRatingUiVisible=K(()=>!!this.conversationPublicId()&&!this.isSimulation()&&this.ratingState()!=="hidden"),this.activeTab=U("chatbot"),this.isRegenerateLastResponseVisible=K(()=>this.isSimulation()&&!!this.conversationPublicId()&&!this.waitingForResponse()),this.regenerateButtonText=K(()=>this.activeTab()==="sources"?$localize`Regenerate`:$localize`Regenerate last response`),this.sources=K(()=>{let n=(this.getLastMessage(Se.CHATBOT)?.message.sources??[]).reduce((r,a)=>{let p;return a.source==="google"?p="web":p=a.object_type,r[p]||(r[p]=[]),r[p].push(a),r},{});return Object.entries(n).map(([r,a])=>({label:si[r],sources:a}))}),this.introMessages=K(()=>{if(this.isSimulation())return[this.createLocalChatbotMessageItem("Use this chat to test my responses with different content sources enabled.")];let i=[this.createLocalChatbotMessageItem(this.aiChatbotConfig().opening_message)];return this.usersService.isAuthenticated()||i.push(this.createLocalChatbotMessageItem(this.aiChatbotConfig().login_message,Ie.OPEN_DOMAIN,this.displayLoginButtonWhenUnauth()?"login":"default")),i}),this.stopPollingForAuth=new Ne,this.cancelPendingRequest=new Ne,this.loginPopup=null,this.awaitingLoginReturn=U(!1),this.storageAccessDenied=U(!1),this.BotMessageAuthor=Se,this.BotMessageAnswerType=Ie,this.messageInputEl=Oe("messageInputEl"),this.dictation=Oe(kt),this.dictationSelection=null,this.transcriptInserted=!1,this.scrollContainer=Oe("scrollContainer"),this.scrollFiller=Oe("scrollFiller"),this.topSentinel=Oe("topSentinel"),this.fetchUntilScrollableDirective=Oe(vt),this.oldScrollHeight=0,this.oldScrollTop=0,this.lastScrollTop=0,this.topSentinelObserver=null,this.onViewportResize=()=>{!this.reanchorPending||!this.keyboardDismissed()||this.scheduleReanchorFire()},window.visualViewport?.addEventListener("resize",this.onViewportResize),ve(()=>{let i=this.hydrateFromConversation();i&&(this.resetConversationState(),this.conversation.set(i.messages.map(n=>({type:"default",message:n}))),this.conversationPublicId.set(i.publicId),i.rating!==null&&this.ratingState.set("hidden"),this.scrollToBottom())}),ve(()=>{let i=this.olderMessages();if(!i||i.length===0)return;let n=this.oldScrollHeight,r=this.oldScrollTop;this.conversation.update(a=>[...i.map(p=>({type:"default",message:p})),...a]),requestAnimationFrame(()=>{let a=this.scrollContainer()?.nativeElement;a&&(a.scrollTop=r+(a.scrollHeight-n),this.lastScrollTop=a.scrollTop)})}),ve(()=>{this.waitingForResponse()||setTimeout(()=>this.messageInputEl()?.nativeElement.focus())});let e=0;ve(()=>{let i=this.conversation().length;e===1&&i===2&&this.firstTurnComplete.emit(this.conversationPublicId()),e=i}),ve(i=>{let n=this.fetchUntilScrollableDirective();if(!n)return;let r=n.scrolled.subscribe(()=>this.onFetchUntilScrollable());i(()=>r.unsubscribe())}),ve(i=>{let n=this.topSentinel(),r=this.scrollContainer();if(!n||!r)return;let a=new IntersectionObserver(([p])=>{if(!p.isIntersecting||!this.canLoadOlder())return;let _=r.nativeElement;this.oldScrollHeight=_.scrollHeight,this.oldScrollTop=_.scrollTop,this.loadOlderMessages.emit()},{root:r.nativeElement});a.observe(n.nativeElement),this.topSentinelObserver=a,i(()=>{a.disconnect(),this.topSentinelObserver=null})})}newConversation(){this.resetConversationState(),this.messageInputEl()?.nativeElement.focus()}resetConversationState(){this.cancelPendingRequest.next(),this.conversation.set([]),this.messageInput.set(""),this.conversationPublicId.set(null),this.waitingForResponse.set(!1),this.ratingState.set("available"),this.ratingError.set(!1),this.sendMessageError.set(!1),this.dictationError.set(null),this.dictation()?.abort(),this.sessionExpired.set(!1),this.showScrollToBottom.set(!1),this.scrollFillerHeight.set(0),this.clearAnchor(),this.lastScrollTop=0}createLocalChatbotMessageItem(e,i=Ie.OPEN_DOMAIN,n="default"){return{type:n,message:{timestamp:new Date().toISOString(),author:Se.CHATBOT,answer_type:i,failed:!1,content:e,sources:[]}}}onMessageKeydown(e){e.key!=="Enter"||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||e.isComposing||e.keyCode===229||!this.isNonTouch||(e.preventDefault(),this.submit())}onDictationStart(){this.transcriptInserted=!1;let e=this.messageInputEl()?.nativeElement;this.dictationSelection=e?{start:e.selectionStart??e.value.length,end:e.selectionEnd??e.value.length}:null}insertTranscript(e){let i=this.messageInput(),n=Math.min(this.dictationSelection?.start??i.length,i.length),r=Math.min(this.dictationSelection?.end??i.length,i.length),a=i.slice(0,n),p=i.slice(r),_=a&&!/\s$/.test(a)?" ":"",h=p&&!/^\s/.test(p)?" ":"";this.messageInput.set(`${a}${_}${e}${h}${p}`),this.transcriptInserted=!0;let m=n+_.length+e.length;setTimeout(()=>{let S=this.messageInputEl()?.nativeElement;S&&(S.focus(),S.setSelectionRange(m,m))})}onDictationStateChange(e){let i=this.dictationState()!=="idle";this.dictationState.set(e),e==="idle"&&i&&!this.transcriptInserted&&setTimeout(()=>this.messageInputEl()?.nativeElement.focus())}submit(){if(!this.canSendMessage())return;let e=this.messageInput().trim();this.messageInput.set(""),this.sendMessageError.set(!1),this.dictationError.set(null),this.dictation()?.abort();let i=new Date().toISOString();this.anchoredUserMsgKey.set(i+e),this.anchorScrollTop=Number.POSITIVE_INFINITY,this.armReanchor(),this.conversation.update(n=>[...n,{type:"default",message:{author:Se.USER,content:e,timestamp:i,failed:!1,sources:[]}}]),this.waitingForResponse.set(!0),this.scrollLastUserMessageToTop(),this.chatbotService.sendMessage(this.conversationPublicId(),{author:Se.USER,content:e,config_content_override:this.overrideContentConfig()},{simulate:this.isSimulation()||void 0}).pipe(nt(this.cancelPendingRequest),et(this.errorService.errorHandler({400:{not_conversation_owner:()=>this.handleSessionExpired(e)},default:()=>{this.sendMessageError.set(!0),this.messageInput.set(e),this.conversation.update(n=>n.slice(0,-1)),this.clearAnchor()}},{returnValue:Ke})),tt(()=>{this.waitingForResponse.set(!1)})).subscribe(n=>{this.conversationPublicId.set(n.conversation_public_id),this.conversation.update(r=>[...r,{type:n.login_prompt?"login":"default",message:n}]),this.cdr.markForCheck(),requestAnimationFrame(()=>this.recomputeFillerHeight())})}onFetchUntilScrollable(){let e=this.scrollContainer()?.nativeElement;!e||e.scrollHeight>e.clientHeight||(this.oldScrollHeight=0,this.oldScrollTop=0,this.loadOlderMessages.emit())}scrollToBottom(){requestAnimationFrame(()=>{let e=this.scrollContainer()?.nativeElement;e&&(e.scrollTop=e.scrollHeight),this.recomputeScrollToBottomVisibility()})}recomputeScrollToBottomVisibility(){let e=this.scrollContainer()?.nativeElement;if(!e){this.showScrollToBottom.set(!1);return}let i=e.scrollTop>this.lastScrollTop;if(this.lastScrollTop=e.scrollTop,i){this.showScrollToBottom.set(!1);return}let n=e.scrollHeight-e.scrollTop-e.clientHeight;this.showScrollToBottom.set(n>e.clientHeight)}armReanchor(){this.isNonTouch||(this.reanchorPending=!0,this.reanchorBaselineHeight=window.visualViewport?.height??0)}keyboardDismissed(){return(window.visualViewport?.height??0)>this.reanchorBaselineHeight+120}scheduleReanchorFire(){this.reanchorTimer&&clearTimeout(this.reanchorTimer),this.reanchorTimer=setTimeout(()=>{this.reanchorTimer=null,this.reanchorPending&&(this.reanchorPending=!1,this.keyboardDismissed()&&this.anchoredUserMsgKey()!==null&&this.scrollLastUserMessageToTop())},150)}disarmReanchor(){this.reanchorPending=!1,this.reanchorTimer&&(clearTimeout(this.reanchorTimer),this.reanchorTimer=null)}clearAnchor(){this.anchoredUserMsgKey.set(null),this.anchorScrollTop=0,this.disarmReanchor()}smoothScrollToBottom(){let e=this.scrollContainer()?.nativeElement;if(!e)return;let i=e.scrollHeight-this.scrollFillerHeight()-e.clientHeight;e.scrollTo({top:Math.max(0,i),behavior:"smooth"})}scrollLastUserMessageToTop(){this.scrollFillerHeight.set(0),requestAnimationFrame(()=>{let e=this.scrollContainer()?.nativeElement;if(!e)return;let i=e.querySelectorAll(`[data-author="${Se.USER}"]`),n=i[i.length-1];if(!n)return;let r=e.getBoundingClientRect(),a=n.getBoundingClientRect(),p=e.clientHeight-a.height;this.scrollFillerHeight.set(Math.max(0,p)),requestAnimationFrame(()=>{let _=n.getBoundingClientRect(),h=parseFloat(getComputedStyle(e).paddingTop)||0,m=Math.max(0,e.scrollTop+(_.top-r.top)-h);this.anchorScrollTop=m;let S=this.messageInputEl()?.nativeElement.offsetHeight??0;this.scrollFillerHeight.set(Math.max(0,e.clientHeight-_.height+S)),e.scrollTo({top:m,behavior:"smooth"})})})}recomputeFillerHeight(){if(this.anchoredUserMsgKey()===null||!isFinite(this.anchorScrollTop))return;let e=this.scrollContainer()?.nativeElement;if(!e)return;let i=this.scrollFiller()?.nativeElement.offsetHeight??0,n=e.scrollHeight-i,r=this.anchorScrollTop+e.clientHeight-n;this.scrollFillerHeight.set(Math.max(0,r))}onRatingResized(){if(this.anchoredUserMsgKey()===null||!isFinite(this.anchorScrollTop))return;let e=this.scrollContainer()?.nativeElement,i=this.scrollFiller()?.nativeElement;!e||!i||e.scrollTop>=this.anchorScrollTop||(this.recomputeFillerHeight(),i.style.height=`${this.scrollFillerHeight()}px`,e.scrollTop=this.anchorScrollTop)}handleSessionExpired(e){this.fullScreen()&&sessionStorage.setItem(ai,JSON.stringify({publicId:this.conversationPublicId(),content:e})),this.messageInput.set(e),this.conversation.update(i=>i.slice(0,-1)),this.clearAnchor(),this.sessionExpired.set(!0)}setDraft(e){this.messageInput.set(e)}onSessionExpiredLogin(){if(this.usersService.clearUserData(),this.fullScreen()){let e=this.conversationPublicId(),i=e?`/agent?conv=${e}`:"/agent";window.location.href=new URL(`/external/login?redirectTo=${encodeURIComponent(i)}`,this.originUrl).href}else this.login()}login(){this.stopPollingForAuth.next(),this.storageAccessDenied.set(!1);let e=new URL("/external/login-success-chatbot",this.originUrl);this.loginPopup=window.open(new URL(`/external/login?redirectTo=${e.href}`,this.originUrl),"_blank"),this.awaitingLoginReturn.set(!0),Nn(500).pipe(nt(this.stopPollingForAuth)).subscribe(()=>{this.loginPopup?.closed&&(this.stopPollingForAuth.next(),this.refetchAndFinishIfAuthed())})}continueLogin(){this.storageAccessService.requestAccess().then(e=>{if(!e){this.storageAccessDenied.set(!0);return}this.storageAccessDenied.set(!1),this.refetchAndFinishIfAuthed().then(i=>{i||(this.stopPollingForAuth.next(),this.loginPopup?.close(),this.loginPopup=null,this.awaitingLoginReturn.set(!1))})})}refetchAndFinishIfAuthed(){return this.usersService.fetchInfo().then(()=>(this.finishLogin(),!0)).catch(()=>!1)}finishLogin(){this.awaitingLoginReturn.set(!1),this.storageAccessDenied.set(!1),this.stopPollingForAuth.next(),this.loginPopup?.close(),this.loginPopup=null,this.sessionExpired.set(!1),this.refreshConfig.emit()}ngOnDestroy(){window.visualViewport?.removeEventListener("resize",this.onViewportResize),this.reanchorTimer&&clearTimeout(this.reanchorTimer),this.cancelPendingRequest.next(),this.cancelPendingRequest.complete(),this.stopPollingForAuth.next(),this.stopPollingForAuth.complete()}onOpen(){this.scrollToBottom();let e=this.topSentinel()?.nativeElement,i=this.topSentinelObserver;e&&i&&(i.unobserve(e),i.observe(e)),setTimeout(()=>{this.messageInputEl()?.nativeElement.focus()}),this.cdr.markForCheck()}askQuestion(e){this.messageInput.set(e),this.submit()}regenerateLastResponse(){let e=this.getLastMessage(Se.USER);if(!e)throw"Tried to regenerate response but no user message found";this.askQuestion(e.message.content)}isValidUpgrade(e){return e.upgrade&&Object.values(Qt).includes(e.upgrade.schema)}startRating(){this.ratingData={rating:null,rating_comment:""},this.ratingError.set(!1),this.ratingState.set("form-visible"),requestAnimationFrame(()=>{this.scrollContainer()?.nativeElement?.querySelector("form.rounded-double")?.scrollIntoView({block:"nearest",behavior:"smooth"})})}stopRating(){this.ratingState.set("available")}rateConversation(){this.isSubmittingRating.set(!0),this.chatbotService.rateConversation(this.conversationPublicId(),this.ratingData).pipe(et(()=>(this.ratingError.set(!0),this.scrollToBottom(),Ke)),tt(()=>{this.isSubmittingRating.set(!1)})).subscribe(e=>{this.ratingState.set("submitted"),this.ratingError.set(!1),this.conversationUpdated.emit(e)})}getLastMessage(e){let i;for(let n=this.conversation().length-1;n>=0;n--){let r=this.conversation()[n];if(r.message.author===e){i=r;break}}return i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=P({type:t,selectors:[["chatbot-core"]],viewQuery:function(i,n){i&1&&Ot(n.messageInputEl,ks,5)(n.dictation,kt,5)(n.scrollContainer,ws,5)(n.scrollFiller,Hs,5)(n.topSentinel,$s,5)(n.fetchUntilScrollableDirective,vt,5),i&2&&St(6)},inputs:{aiChatbotConfig:[1,"aiChatbotConfig"],displayLoginButtonWhenUnauth:[1,"displayLoginButtonWhenUnauth"],closable:[1,"closable"],fullScreen:[1,"fullScreen"],isSimulation:[1,"isSimulation"],overrideContentConfig:[1,"overrideContentConfig"],hideHeader:[1,"hideHeader"],hydrateFromConversation:[1,"hydrateFromConversation"],olderMessages:[1,"olderMessages"],loadingOlder:[1,"loadingOlder"],canLoadOlder:[1,"canLoadOlder"]},outputs:{refreshConfig:"refreshConfig",closeRequested:"closeRequested",firstTurnComplete:"firstTurnComplete",loadOlderMessages:"loadOlderMessages",conversationUpdated:"conversationUpdated"},decls:15,vars:15,consts:()=>{let e;e=$localize`New chat`;let i;i=$localize`Close`;let n;n=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let r;r=$localize`New Chat`;let a;a=$localize`AI Agent Responses`;let p;p=$localize`Content Sources`;let _;_=$localize` Your session has expired. Please log in again. `;let h;h=$localize`Log In`;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:${"\uFFFD0\uFFFD"}:INTERPOLATION: can display inaccurate or harmful information if it's not marked as verified.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let S;S=$localize`Rate this chat`;let M;M=$localize`Cancel rating`;let V;V=$localize`conversation rating`;let D;D=$localize`Tell us more (optional)`;let re;re=$localize` How would you rate this chat? `;let We;We=$localize`:a good rating:Good`;let Ze;Ze=$localize`:a bad rating:Bad`;let Je;Je=$localize`Submit`;let Ct;Ct=$localize` Error encountered while sending feedback `;let ut;ut=$localize` Thanks for your feedback! `;let $e;$e=$localize`Loading content sources...`;let Ee;Ee=$localize`View the list of content sources used by the AI Agent to generate the latest response.`;let _n;_n=$localize`No sources found for the latest query.`;let dn;dn=$localize`Regenerate last response`;let pn;pn=$localize`Scroll to bottom`;let Cn;Cn=$localize`Scroll to bottom`;let Ft;Ft=$localize`Ask anything`;let zt;zt=$localize`Ask anything`;let un;un=$localize`Listening`;let mn;mn=$localize`Transcribing`;let gn;gn=$localize` Error encountered while sending message `;let hn;hn=$localize`We didn't catch that. Please try speaking again.`;let Tn;Tn=$localize`Couldn't access the microphone. Check your browser permissions and try again.`;let fn;fn=$localize`Couldn't transcribe your audio. Please try again.`;let On;On=$localize`I'm sorry. I had an issue. Please try later.`;let Sn;Sn=$localize` Finish signing in in the tab that opened, then come back and select Continue. `;let En;En=$localize`Continue`;let An;An=$localize` We couldn't access your session. Please allow cookies for this site, then select Continue again. `;let xn;xn=$localize`Log In`;let bn;return bn=$localize`I'm sorry. I had an issue. Please try later.`,[["scrollContainer",""],["scrollFiller",""],["messageTemplate",""],["topSentinel",""],["ratingForm","ngForm"],["messageInputEl",""],n,r,_,h,m,S,re,We,Ze,Je,Ct,ut,$e,dn,un,mn,gn,hn,Tn,fn,On,Sn,En,An,xn,bn,[1,"d-flex","flex-column","minh-0","h-100","px-12","px-sm-16","px-md-24"],[1,"d-flex","align-items-center","gap-8","px-8","py-8","bb"],["scrollFade","","scrollFadeDistance","3%",1,"d-flex","flex-column","flex-grow","minh-0","py-8","scroll-y",3,"scroll","touchmove","wheel","scrollFadeTrailingOffset","fetchUntilScrollable","scrollWindow"],[1,"mt-auto"],["padding","icon"],["type","button",1,"btn","sm","link","active","mt-8"],["aria-hidden","true",1,"flex-no-shrink"],[1,"avatar","size-32","circle","flex-no-shrink"],["fallbackIcon","common-chatbot",3,"manualOverrideSrc"],[1,"d-flex","align-items-center","gap-8","flex-grow","minw-0"],[1,"h3","text-truncate","mb-0"],["type","button","aria-label",e,1,"btn","sm","borderless","ml-auto",3,"click"],["name","common-comment-plus",1,"size-20"],["type","button","aria-label",i,1,"btn","sm","borderless"],["type","button","aria-label",i,1,"btn","sm","borderless",3,"click"],["name","internal-close"],["tabTitle",a,1,"flex-grow",3,"tabOnClick","active","fullWidth"],["tabTitle",p,1,"flex-grow",3,"tabOnClick","active","fullWidth"],["aria-hidden","true"],[1,"message","d-flex","align-items-end","mt-8"],[1,"text-sm","text-center","mt-12","mb-0","mx-auto"],[1,"mt-8"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"content","minw-0","flex-grow"],[1,"bubble","pos-rel"],[1,"text-wrap-all","w-100"],["type","button",1,"btn","sm","primary","w-100","mt-8",3,"click"],[1,"typing"],[1,"dot"],[1,"text-quiet"],[1,"mt-8",3,"resized"],[1,"d-flex","justify-content-center"],[1,"text-sm","text-quiet","text-center"],["type","button",1,"btn","sm","link",3,"click"],["name","common-like"],["name","common-dislike"],[1,"rounded-double","bg-n1","px-16","pb-16","pt-12","d-flex","flex-column","gap-16",3,"ngSubmit"],[1,"d-flex","align-items-center","gap-8"],[1,"text-bold","flex-grow"],["type","button","tooltip",M,1,"btn","sm","borderless",3,"click"],["role","radiogroup","aria-label",V,1,"d-grid","grid-cols-2","gap-8"],["type","button","role","radio",1,"btn","sm",3,"click"],["rows","2","placeholder",D,"name","rating_comment",1,"form-control","no-resize",3,"ngModelChange","ngModel"],["type","submit",1,"btn","sm","primary",3,"disabled"],[1,"form-text","is-invalid","mt-0"],[1,"w-100","h-100","d-grid","place-content-center"],[1,"mb-24"],[1,"text-bold"],[1,"mt-4","d-block",3,"source"],["message",Ee],["message",_n],["type","button",1,"btn","sm","link","active",3,"click"],["name","internal-repeat"],["type","button",1,"btn","sm","link","active","mt-8",3,"click"],[1,"pos-rel"],["type","button","tooltip",pn,"aria-label",Cn,1,"scroll-to-bottom-btn","size-40","circle","d-flex","align-items-center","justify-content-center","mb-16",3,"keydown.enter","click"],["name","internal-arrow-down",1,"size-20","text-quiet"],[1,"prompt-input","d-flex","flex-column","align-items-stretch","gap-4","pa-8","mb-16"],["name","messageInput","autocomplete","off","type","text","placeholder",Ft,"aria-label",zt,"textareaAutosize","","rows","1",1,"form-control","no-resize","flex-grow","w-100",3,"disabled","ngModel"],[3,"recordingStart","transcript","send","stateChange","errorChange","disabled","canSend","sendTooltip"],["role","status","aria-live","polite",1,"visually-hidden"],[1,"form-text","is-invalid","mx-8","mt-0","mb-8"],["role","alert",1,"form-text","is-invalid","mx-8","mt-0","mb-8"],["name","messageInput","autocomplete","off","type","text","placeholder",Ft,"aria-label",zt,"textareaAutosize","","rows","1",1,"form-control","no-resize","flex-grow","w-100",3,"ngModelChange","keydown","input","disabled","ngModel"],[1,"message","d-flex","align-items-end"],[1,"content","minw-0"],[1,"text-wrap-all",3,"resized"],[3,"messageUpgrade"],[3,"answerType"],[1,"d-block",3,"sources"],[1,"w-100",3,"innerHTML"],["type","button",1,"btn","sm","primary","w-100","mt-8"],[1,"text-sm","mt-8","mb-8"],["type","button",1,"btn","sm","primary","w-100",3,"click"],["role","alert",1,"form-text","is-invalid","mt-8","mb-0"],[1,"d-block",3,"resized","sources"]]},template:function(i,n){if(i&1&&(l(0,"div",32),C(1,Gs,11,3,"div",33),C(2,Fs,3,4,"tabs"),l(3,"div",34,0),N("scroll",function(){return n.recomputeScrollToBottomVisibility()})("touchmove",function(){return n.disarmReanchor()})("wheel",function(){return n.disarmReanchor()}),g(5,"div",35),C(6,zs,1,0,"loader",36),C(7,nl,10,4)(8,_l,3,1),C(9,dl,4,1,"button",37),g(10,"div",38,1),c(),C(12,Ol,11,9),c(),ne(13,Rl,12,16,"ng-template",null,2,ye)),i&2){let r;s(),u(n.hideHeader()?-1:1),s(),u(n.isSimulation()?2:-1),s(),R("max-height",100,"%"),X("px-16",!n.fullScreen()),b("scrollFadeTrailingOffset",n.scrollFillerHeight())("fetchUntilScrollable",n.conversation().length)("scrollWindow",!1),s(3),u(n.loadingOlder()?6:-1),s(),u((r=n.activeTab())==="chatbot"?7:r==="sources"?8:-1),s(2),u(n.isRegenerateLastResponseVisible()?9:-1),s(),R("height",n.scrollFillerHeight(),"px"),s(2),u(n.activeTab()==="chatbot"?12:-1)}},dependencies:[li,Rt,ci,vi,kt,z,jn,Ye,qn,zn,Xe,Vn,qe,Xn,Fn,Ve,ri,ze,ni,ti,Yn,Qn,vt,Wi,Yi,Qi],styles:[".typing[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_BounceAndFade 1s infinite ease-in-out;background-color:var(--n3-transp);border-radius:50%;height:7px;width:7px;vertical-align:middle;display:inline-block;margin-right:2px}.typing[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.25s}.typing[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.5s}.message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{max-width:100%}.message[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] .bubble[_ngcontent-%COMP%]{padding:12px}.prompt-input[_ngcontent-%COMP%]{background:var(--n1);border:.5px solid var(--border-color-base);border-radius:28px;box-shadow:var(--card-shadow)}.prompt-input[_ngcontent-%COMP%]:has(textarea:focus){border-color:var(--focus-outline-color);box-shadow:0 0 0 1px var(--focus-outline-color),0 3px 10px -4px #01012021}.prompt-input[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]{background:transparent;border:none;min-height:0;max-height:300px}.prompt-input[_ngcontent-%COMP%] textarea.form-control[_ngcontent-%COMP%]:focus{outline:none;box-shadow:none}.scroll-to-bottom-btn[_ngcontent-%COMP%]{position:absolute;left:50%;bottom:100%;transform:translate(-50%);background:var(--n1);border:.5px solid var(--border-color-base);box-shadow:var(--card-shadow);cursor:pointer;opacity:0;visibility:hidden;transition:opacity var(--transition-base-duration) var(--transition-base-timing-function),visibility var(--transition-base-duration) var(--transition-base-timing-function)}.scroll-to-bottom-btn.visible[_ngcontent-%COMP%]{opacity:1;visibility:visible}.scroll-to-bottom-btn[_ngcontent-%COMP%]:focus{outline:none}.is-tabbing[_nghost-%COMP%] .scroll-to-bottom-btn[_ngcontent-%COMP%]:focus, .is-tabbing [_nghost-%COMP%] .scroll-to-bottom-btn[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 2px var(--white),0 0 0 4px var(--focus-outline-color),var(--card-shadow)}@keyframes _ngcontent-%COMP%_BounceAndFade{0%{transform:translateY(0);background-color:var(--n6-transp)}28%{transform:translateY(-7px);background-color:var(--n5-transp)}44%{transform:translateY(0);background-color:var(--n4-transp)}}"],changeDetection:0})}}return t})();export{Se as a,li as b,ci as c,ai as d,ji as e,Wi as f,Cp as g};