1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[730,994,4658,7387],{8032:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return r}});let r=a(21776)._(a(62544)).default.createContext(null)},13548:()=>{},23694:(e,t,a)=>{"use strict";a.d(t,{S:()=>i});var r=a(84108),s=a(62544),n=a(6608),l=a(39772),o=a(54382);function i(e){let{tabs:t,isLoading:a,search:i,searchResults:c,refresh:d,applyLastMessage:u}=(0,r.RL)(),{subscribeLastMessage:h,subscribeUsersTyping:m}=(0,l._Q)(),p=(0,r.TA)();(0,s.useEffect)(()=>{let e=()=>void d();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[d]);let{mutate:f,cache:g}=(0,n.iX)();(0,s.useEffect)(()=>{let t,a=h(a=>{let s=u(a,{openChatId:e,selfId:p}),n=a.chat?`chat/${a.chat}`:null;(n&&g.get(n)?.data&&f(n,e=>e&&{...e,messages:(0,r.xz)(e.messages??[],a)},{revalidate:!1}),clearTimeout(t),s)?t=setTimeout(()=>void d(),1500):d()});return()=>{clearTimeout(t),a()}},[u,g,e,f,d,p,h]);let[x,v]=(0,s.useState)({}),b=(0,s.useRef)({});(0,s.useEffect)(()=>{let e=b.current,t=t=>{clearTimeout(e[t]),delete e[t],v(e=>{if(!(t in e))return e;let a={...e};return delete a[t],a})},a=m(a=>{if(!a?.chat)return;let r=a.chat;a.typing?(v(e=>({...e,[r]:`${a.user||"Someone"} is typing`})),clearTimeout(e[r]),e[r]=setTimeout(()=>t(r),6e3)):t(r)});return()=>{for(let t of(a(),Object.keys(e)))clearTimeout(e[t]);b.current={}}},[m]);let y=(e,t)=>e.map(e=>({row:x[e.id]?{...e,typingLabel:x[e.id]}:e,tab:t})),j=(e,t)=>(0,r.DD)(e.row,t.row);return{sections:[{key:"marketplace",label:"Marketplace",icon:o.p.marketplace,rows:[...y(t.consumer,"consumer"),...y(t.provider,"provider")].sort(j)},{key:"team",label:"My Team",icon:o.p.team,rows:y(t.team,"team").sort(j)},{key:"classroom",label:"Classroom",icon:o.p.classroom,rows:y(t.classroom,"classroom").sort(j)},{key:"staff",label:"Staff",icon:o.p.staff,rows:y(t.staff,"staff").sort(j)}],isLoading:a,search:i,searchResults:c,refresh:d}}},26473:()=>{},29027:(e,t,a)=>{"use strict";var r=a(34544);function s(){}function n(){}n.resetWarningCache=s,e.exports=function(){function e(e,t,a,s,n,l){if(l!==r){var o=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n,resetWarningCache:s};return a.PropTypes=a,a}},29675:()=>{},29882:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>c});var r=a(10940),s=a(38740),n=a.n(s),l=a(98883),o=a(39968),i=a(35687);let c=function(){let{classroomId:e,classroomTitle:t}=(0,i.L)();return(0,r.jsxs)(o.e,{breadcrumbSuffix:[{label:"Classrooms",href:"/network-admin/classrooms"},{label:t,href:`/network-admin/classrooms/${e}`},{label:"Insights"}],children:[(0,r.jsx)(n(),{children:(0,r.jsxs)("title",{children:["Insights \xb7 ",t," | KANU"]})}),(0,r.jsxs)("h1",{className:"sr-only",children:["Insights \xb7 ",t]}),(0,r.jsx)(l.i,{classroomId:e})]})}},34544:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},34872:(e,t,a)=>{"use strict";a.d(t,{Mz:()=>G,Rp:()=>B,UC:()=>K,ZL:()=>z,bL:()=>V,bm:()=>Q,i3:()=>X,l9:()=>W});var r=a(62544),s=a(41375),n=a(67237),l=a(39717),o=a(21048),i=a(67722),c=a(85378),d=a(6896),u=a(36413),h=a(37959),m=a(61678),p=a(48776),f=a(58159),g=a(76496),x=a(15207),v=a(17971),b=a(10940),y="Popover",[j,_]=(0,l.A)(y,[u.Bk]),w=(0,u.Bk)(),[N,k]=j(y),C=e=>{let{__scopePopover:t,children:a,open:s,defaultOpen:n,onOpenChange:l,modal:o=!1}=e,i=w(t),c=r.useRef(null),[h,m]=r.useState(!1),[p,f]=(0,g.i)({prop:s,defaultProp:n??!1,onChange:l,caller:y});return(0,b.jsx)(u.bL,{...i,children:(0,b.jsx)(N,{scope:t,contentId:(0,d.B)(),triggerRef:c,open:p,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:o,children:a})})};C.displayName=y;var R="PopoverAnchor",A=r.forwardRef((e,t)=>
1{let{__scopePopover:a,...s}=e,n=k(R,a),l=w(a),{onCustomAnchorAdd:o,onCustomAnchorRemove:i}=n;return r.useEffect(()=>(o(),()=>i()),[o,i]),(0,b.jsx)(u.Mz,{...l,...s,ref:t})});A.displayName=R;var T="PopoverTrigger",I=r.forwardRef((e,t)=>{let{__scopePopover:a,...r}=e,l=k(T,a),o=w(a),i=(0,n.s)(t,l.triggerRef),c=(0,b.jsx)(p.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Y(l.open),...r,ref:i,onClick:(0,s.mK)(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?c:(0,b.jsx)(u.Mz,{asChild:!0,...o,children:c})});I.displayName=T;var S="PopoverPortal",[E,O]=j(S,{forceMount:void 0}),P=e=>{let{__scopePopover:t,forceMount:a,children:r,container:s}=e,n=k(S,t);return(0,b.jsx)(E,{scope:t,forceMount:a,children:(0,b.jsx)(m.C,{present:a||n.open,children:(0,b.jsx)(h.Z,{asChild:!0,container:s,children:r})})})};P.displayName=S;var $="PopoverContent",L=r.forwardRef((e,t)=>{let a=O($,e.__scopePopover),{forceMount:r=a.forceMount,...s}=e,n=k($,e.__scopePopover);return(0,b.jsx)(m.C,{present:r||n.open,children:n.modal?(0,b.jsx)(M,{...s,ref:t}):(0,b.jsx)(q,{...s,ref:t})})});L.displayName=$;var D=(0,f.TL)("PopoverContent.RemoveScroll"),M=r.forwardRef((e,t)=>{let a=k($,e.__scopePopover),l=r.useRef(null),o=(0,n.s)(t,l),i=r.useRef(!1);return r.useEffect(()=>{let e=l.current;if(e)return(0,x.Eq)(e)},[]),(0,b.jsx)(v.A,{as:D,allowPinchZoom:!0,children:(0,b.jsx)(U,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||a.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;i.current=2===t.button||a},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,t)=>{let a=k($,e.__scopePopover),s=r.useRef(!1),n=r.useRef(!1);return(0,b.jsx)(U,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||a.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;a.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),U=r.forwardRef((e,t)=>{let{__scopePopover:a,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:n,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:p,...f}=e,g=k($,a),x=w(a);return(0,i.Oh)(),(0,b.jsx)(c.n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:n,children:(0,b.jsx)(o.qW,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,b.jsx)(u.UC,{"data-state":Y(g.open),role:"dialog",id:g.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),F="PopoverClose",H=r.forwardRef((e,t)=>{let{__scopePopover:a,...r}=e,n=k(F,a);return(0,b.jsx)(p.sG.button,{type:"button",...r,ref:t,onClick:(0,s.mK)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=F;var B=r.forwardRef((e,t)=>{let{__scopePopover:a,...r}=e,s=w(a);return(0,b.jsx)(u.i3,{...s,...r,ref:t})});function Y(e){return e?"open":"closed"}B.displayName="PopoverArrow";var V=C,G=A,W=I,z=P,K=L,Q=H,X=B},35681:e=>{e.exports={empty:"not-logged-in_empty__2_uZ3",empty_image:"not-logged-in_empty_image__dPx8j",empty_title:"not-logged-in_empty_title__jU94e",empty_message:"not-logged-in_empty_message__VLBGf"}},35687:(e,t,a)=>{"use strict";a.d(t,{L:()=>r.Q});var r=a(68686)},39968:(e,t,a)=>{"use strict";a.d(t,{e:()=>y});var r=a(10940),s=a(62544),n=a(43652),l=a(27965),o=a(69789),i=a(76255),c=a(7684),d=a(35295),u=a(20788),h=a(58704),m=a(93176),p=a(21818),f=a(11461),g=a(99994),x=a(50316);let v=({networkName:e,collapsed:t,onToggle:a})=>{let s=(0,d.useRouter)(),{isLoading:n,classrooms:l}=(0,h.O)(),o=s.asPath.split("?")[0],i="string"==typeof s.query.classroomId?s.query.classroomId:void 0;return(0,r.jsxs)(x.n,{collapsed:t,onToggle:a,children:[(0,r.jsx)(p.m,{label:"Network",entityName:e,entityHref:"/network-admin",activeHref:s.pathname,links:[{label:"Training",href:"/network-admin/training",icon:u.z7B},{label:"People",href:"/network-admin/people",icon:u.SrR}]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(g.H,{label:"Products",activeHref:s.pathname,items:[{label:"Marketplace",href:"/network-admin/marketplace",icon:u.$H1},{label:"Competitions",href:"/network-admin/competitions",icon:u.pyc}]}),(0,r.jsx)(f.y,{label:"Classrooms",groupHeader:{href:"/network-admin/classrooms",icon:u.Tb7},activeItemId:i,activeHref:o,items:n?[]:(0,m.c)(l,"/network-admin/classrooms")})]})]})};function b({breadcrumbSuffix:e,trailingBadge:t,actions:a,children:o}){let{networkAdmin:d}=(0,n.F)(),u=d?.networkName??"Your Network",{collapsed:h,onToggle:m}
1=(0,l.X)("network-admin-sidebar-collapsed"),[p,f]=(0,s.useState)(!1);return(0,r.jsxs)(c.N,{sidebar:(0,r.jsx)(v,{networkName:u,collapsed:h,onToggle:m}),breadcrumbs:[{label:u},...e],trailingBadge:t,extraActions:a,onMessagesClick:()=>f(!0),children:[o,p&&(0,r.jsx)(i._u,{onClose:()=>f(!1)})]})}let y=e=>(0,r.jsx)(o.n,{children:(0,r.jsx)(n.L,{children:(0,r.jsx)(b,{...e})})})},41795:(e,t,a)=>{"use strict";a.d(t,{pE:()=>n,Ic:()=>d,hE:()=>u});var r,s,n,l,o=a(88073);(r=n||(n={})).CONSUMER_CHAT="consumerChat",r.PROVIDER_CHAT="providerChat",r.TEAM_CHAT="teamChat",r.CLASSROOM_CHAT="classroomChat",r.STAFF_CHAT="staffChat",r.PROVIDER_REQUEST="providerRequest",r.PROVIDER_ORDER_STATUS="providerOrderStatus",r.CONSUMER_REQUEST="consumerRequest",r.REQUEST_HISTORY="requestHistory",r.PROVIDER_REQUEST_HISTORY="providerRequestHistory",r.CONSUMER_REQUEST_HISTORY="consumerRequestHistory",r.NOTIFICATION="notification",r.CLASSROOM="classroom",r.BADGE="badge",r.VOYAGE_PROGRESS_NOTIFICATION="voyageProgressNotification",r.LEARNING_NAVBAR_VOYAGE="learningNavBarVoyage",r.LEARNING_NAVBAR_LEADERBOARD="learningNavBarLeaderboard",r.LEARNING_NAVBAR_NOTEPAD="learningNavBarNotepad",r.LEARNING_NAVBAR_BADGE="learningNavBarBadge",r.EDUCATOR_DASHBOARD_CLASSROOM_STUDENTS="educatorDashboardClassroomStudents",r.EDUCATOR_DASHBOARD_CLASSROOM_ACTIVITY="educatorDashboardClassroomActivity",r.EDUCATOR_DASHBOARD_CLASSROOM_GRADES="educatorDashboardClassroomGrades",(s=l||(l={})).JOIN="joinDotIndicator",s.LEAVE="leaveDotIndicator",s.LISTEN="listenDotIndicator",s.LOG="log",s.TRIGGER_EMIT_INDICATOR="triggerEmitIndicator";var i=a(32569);(0,i.Ik)({type:(0,i.vP)(["text","picture"]),content:(0,i.lq)((0,i.Yj)()),photos:(0,i.lq)((0,i.YO)((0,i.Yj)())),quote:(0,i.lq)((0,i.Yj)())}),(0,i.Ik)({placement:(0,i.vP)(Object.values(n))}),(0,i.Ik)({placements:(0,i.YO)((0,i.vP)(Object.values(n)))}),(0,i.Ik)({placements:(0,i.YO)((0,i.vP)(Object.values(n))),modelId:(0,i.Yj)(),milestoneId:(0,i.lq)((0,i.Yj)()),moduleId:(0,i.lq)((0,i.Yj)()),studentId:(0,i.lq)((0,i.Yj)()),businessId:(0,i.lq)((0,i.Yj)()),notepadId:(0,i.lq)((0,i.Yj)())}),(0,i.Ik)({placement:(0,i.vP)(Object.values(n)),modelId:(0,i.Yj)()}),(0,i.Ik)({token:(0,i.Yj)()});var c=a(82887);let d=async e=>{if((0,o.hasCookie)("accessToken"))return await (0,c.Ay)().post("dot-indicator/unmark-all-placements",e)},u=async e=>{if((0,o.hasCookie)("accessToken"))return await (0,c.Ay)().post("dot-indicator/unmark-many-placements",e)}},43652:(e,t,a)=>{"use strict";a.d(t,{F:()=>d,L:()=>c});var r=a(10940),s=a(62544),n=a(21072),l=a(25298),o=a(82887);let i=(0,s.createContext)({networkAdmin:null,isLoading:!1,error:void 0}),c=({children:e})=>{let{data:t,isLoading:a,error:s}=(0,n.Ay)("users/me/navigation",o.hS,{revalidateOnFocus:!1}),c=t?.role===l.tz.NETWORK_ADMIN?{networkId:t.network?._id,networkName:t.network?.title,moduleZero:t.moduleZero,moduleZeroRedirectId:t.voyageRedirect?.moduleZeroId,moduleZeroRedirectStepId:t.voyageRedirect?.stepId}:null;return(0,r.jsx)(i.Provider,{value:{networkAdmin:c,isLoading:a,error:s},children:e})},d=()=>(0,s.useContext)(i)},45269:(e,t,a)=>{"use strict";a.d(t,{Q:()=>s});var r=a(62544);function s(){let[e,t]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let a=()=>{let a=window.innerHeight-(e.height+e.offsetTop);t(a>80?Math.round(a):0)};return a(),e.addEventListener("resize",a),e.addEventListener("scroll",a),()=>{e.removeEventListener("resize",a),e.removeEventListener("scroll",a)}},[]),e}},49481:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={default:function(){return c},noSSR:function(){return i}};for(var s in r)Object.defineProperty(t,s,{enumerable:!0,get:r[s]});let n=a(21776);a(10940),a(62544);let l=n._(a(66366));function o(e){return{default:e?.default||e}}function i(e,t){return delete t.webpack,delete t.modules,e(t)}function c(e,t){let a=l.default,r={loading:({error:e,isLoading:t,pastDelay:a})=>null};e instanceof Promise?r.loader=()=>e:"function"==typeof e?r.loader=e:"object"==typeof e&&(r={...r,...e});let s=(r={...r,...t}).loader;return(r.loadableGenerated&&(r={...r,...r.loadableGenerated},delete r.loadableGenerated),"boolean"!=typeof r.ssr||r.ssr)?a({...r,loader:()=>null!=s?s().then(o):Promise.resolve(o(()=>null))}):(delete r.webpack,delete r.modules,i(a,r))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esMo
1dule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53950:()=>{},54382:(e,t,a)=>{"use strict";a.d(t,{Y:()=>o,p:()=>l});var r=a(10940),s=a(61913),n=a(62544);let l={marketplace:(0,r.jsx)(function(){return(0,r.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M3 9.5 4.5 4h15L21 9.5M3 9.5h18M3 9.5v10h18v-10M3 9.5a2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 3 0",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},{}),team:(0,r.jsx)(function(){return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"9",cy:"8",r:"3.2",stroke:"currentColor",strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0M16 5.5a3 3 0 0 1 0 5.6M17.5 19a5.4 5.4 0 0 0-2-4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})},{}),classroom:(0,r.jsx)(function(){return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M12 4 2 8.5 12 13l10-4.5L12 4Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6 10.5V16c0 1.4 2.7 2.5 6 2.5s6-1.1 6-2.5v-5.5M20 8.5V15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{}),staff:(0,r.jsx)(function(){return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M5 20V6.5L12 3l7 3.5V20",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M9 20v-5h6v5M9 11h.01M15 11h.01M12 11h.01",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{})};function o({sections:e,hrefFor:t,selectedId:a,onSelect:l,linkComponent:i,onSearch:c,searchResults:d,hrefForSearch:u,isLoading:h}){let[m,p]=(0,n.useState)(""),[f,g]=(0,n.useState)({}),x=m.trim().length>0;(0,n.useEffect)(()=>{let e=m.trim();if(!e)return void c("");let t=setTimeout(()=>c(e),1e3);return()=>clearTimeout(t)},[m,c]);let v=(e,t)=>e.map(({row:e,tab:n})=>(0,r.jsx)(s.gG,{item:e,href:t({row:e,tab:n}),linkComponent:i,selected:a===e.id,onSelect:l},`${n}-${e.id}`));return(0,r.jsxs)("div",{className:"flex flex-col h-full min-h-0 bg-white",children:[(0,r.jsx)("div",{className:"px-4 pt-4 pb-3",children:(0,r.jsx)("h2",{className:"text-lg font-bold text-black1 tracking-[0.4px]",children:"Message"})}),(0,r.jsx)("div",{className:"px-4 pb-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-softgrey1 px-3 py-2",children:[(0,r.jsx)("img",{src:"/assets/icon/search.svg",alt:"","aria-hidden":"true",className:"w-4 h-4"}),(0,r.jsx)("input",{className:"flex-1 bg-transparent text-sm outline-none placeholder:text-placeholder",type:"text",placeholder:"Search","aria-label":"Search conversations",value:m,onChange:e=>p(e.target.value),"data-e2e":"chats-search"})]})}),(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto pb-4",children:h?(0,r.jsx)("div",{role:"status",className:"px-4 py-3 text-sm text-text","data-e2e":"chats-loading",children:"Loading conversationsâ¦"}):x?d?0===d.users.length&&0===d.messages.length?(0,r.jsx)("div",{role:"status",className:"px-4 py-6 text-sm text-text","data-e2e":"chats-empty",children:"Nothing found!"}):(0,r.jsxs)(r.Fragment,{children:[d.users.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"px-4 pt-2 pb-1 text-xs font-bold text-placeholder",children:"Users"}),v(d.users.map(e=>({row:e,tab:"team"})),({row:e})=>u(e.id))]}),d.messages.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"px-4 pt-2 pb-1 text-xs font-bold text-placeholder",children:"Messages"}),v(d.messages.map(e=>({row:e,tab:"team"})),({row:e})=>u(e.id))]})]}):(0,r.jsx)("div",{role:"status",className:"px-4 py-3 text-sm text-text","data-e2e":"chats-loading",children:"Searchingâ¦"}):e.every(e=>0===e.rows.length)?(0,r.jsx)("div",{role:"status",className:"px-4 py-6 text-sm text-text","data-e2e":"chats-empty",children:"No conversation yet"}):e.filter(e=>e.rows.length>0).map(e=>{let a=f[e.key],s=e.rows.reduce((e,{row:t})=>e+(t.unread??0),0);return(0,r.jsxs)("section",{children:[(0,r.jsxs)("button",{type:"button",className:"flex w-full items-center gap-3 px-4 py-2.5 text-left text-black1 hover:bg-softgrey2","aria-expanded":!a,"aria-label":s>0?`${e.label}, ${s} unread`:e.label,"data-e2e":`chats-section-${e.key}`,onClick:()=>g(t=>({...t,[e.key]:!t[e.key]})),children:[(0,r.jsx)("span",{className:"text-text",children:e.icon}),(0,r.jsx)("span",{className:"flex-1 text-sm font-semibold tracking-[0.4px]",children:e.label}),s>0&&(0,r.jsx)("span",{"aria-hidden":"true",className:"min-w-[20px] rounded-full bg-red px-1.5 text-center text-xs font-bold leading-5 text-white",children:s}),(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:`transition-transform ${a?"":"rotate-180"}`,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),!a&&v(e.rows,t)]},e.key)})})]})}},55445:(e,t,a)=>{"use strict";a.d(t,{f:()=>l});var r=a(21072),s=a(82887);let n=e=>(0,s.Ay)().get(e).then(e=>e.data),l=e=>{let{data:t,isLoading:a,error:s}=(0,r.Ay)(e&&"[slug]"!==e?`admin/classroom/${e}`:null,n,{revalidateOnFocus:!1});return{isLoading:a,data:t??void 0,statistic:t?.statistic??void 0,classroom:t?.classroom??void 0,error:s}}},58704:(e,t,a)=>{"use strict";a.d(t,{O:()=>n});var r=a(21072),s=a(82887);let n=()=>{let{data:e,isLoading:t,error:a,mutate:n}=(0,r.Ay)("admin/classrooms",s.hS,{revalidateOnFocus:!0,revalidateIfStale:!0});return{isLoading:t,data:e,classrooms:e?e.classrooms:[],error:a,mutate:n}}},61682:(e,t,a)=>{"use strict";a.d(t,{w:()=>u});var r=a(10940),s=a(88997),n=a(5529),l=a(13222),o=a(11230),i=a.n(o),c=a(62544),d=a(20788);let u=({children:e,navigation:t,disabledDismiss:a,onClose:o})=>{let[u,h]=(0,c.useState)(t?.page??0),m=(0,c.useRef)(null);return(0,r.jsx)(s.Ay,{open:!0,onClose:(e,t)=>{a&&"backdropClick"===t?m.current.focus():o()},anchor:"right",elevation:0,PaperProps:{sx:{backgroundColor:"transparent",maxWidth:"100vw"}},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.2)"}}},children:(0,r.jsxs)("div",{className:"flex flex-row",role:"region","aria-label":t?.name??"Detail panel",children:[(0,r.jsxs)("div",{className:"p-2 gap-1 flex flex-col items-end relative",children:[(0,r.jsx)(n.A,{title:"Close",placement:"left",arrow:!0,children:(0,r.jsx)(l.A,{ref:m,"aria-label":"Close",onClick:o,className:"focus:animate-breathing",children:(0,r.jsx)(d.bsq,{className:"size-9 cursor-pointer"})})}),t&&t.totalPages>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.A,{title:`Next ${t.name}`,placement:"left",arrow:!0,children:(0,r.jsx)("span",{className:"",children:(0,r.jsx)(l.A,{"aria-label":`Next ${t.name}`,onClick:()=>
1{if(u<t?.totalPages-1){let e=u+1;h(e),t?.onPageChanged(e)}},disabled:u===t?.totalPages-1,children:(0,r.jsx)(d.Td3,{className:i()("size-9",u===t.totalPages-1?"fill-grey2 cursor-not-allowed":"fill-teallight cursor-pointer")})})})}),(0,r.jsx)(n.A,{title:`Prev ${t.name}`,placement:"left",arrow:!0,children:(0,r.jsx)("span",{children:(0,r.jsx)(l.A,{"aria-label":`Previous ${t.name}`,onClick:()=>{if(u>0){let e=u-1;h(e),t?.onPageChanged(e)}},disabled:0===u,children:(0,r.jsx)(d.XTR,{className:i()("size-9",0===u?"fill-grey2 cursor-not-allowed":"fill-teallight cursor-pointer")})})})})]})]}),e]})})}},61913:(e,t,a)=>{"use strict";a.d(t,{u6:()=>c,RB:()=>u,gG:()=>o});var r=a(10940),s=a(62544);function n(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function l({href:e,children:t,...a}){return(0,r.jsx)("a",{href:e,...a,children:t})}function o({item:e,href:t,linkComponent:a=l,selected:s,onSelect:n}){let i=n?a=>{a.defaultPrevented||0!==a.button||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),n(e.id,t))}:void 0;return(0,r.jsxs)(a,{href:t,onClick:i,className:`dialog-item${s?" dialog-item--selected":""}`,"aria-current":s?"true":void 0,"data-e2e":"chat-list-item",children:[(0,r.jsx)("div",{className:"dialog-item__photo",children:e.photoUrl?(0,r.jsx)("img",{src:e.photoUrl,alt:""}):null}),(0,r.jsxs)("div",{className:"dialog-item__body",children:[e.requestReferenceId?(0,r.jsxs)("span",{className:"dialog-item__meta","data-e2e":"chat-request-id",children:["ID: ",e.requestReferenceId]}):null,(0,r.jsxs)("div",{className:"dialog-item__row",children:[(0,r.jsx)("span",{className:"dialog-item__name",children:e.name}),(0,r.jsx)("span",{className:"dialog-item__time",children:function(e,t=new Date){if(!e)return"";let a=new Date(e);return Number.isNaN(a.getTime())?"":a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()?a.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):a.getFullYear()===t.getFullYear()?a.toLocaleDateString([],{day:"numeric",month:"short"}):a.toLocaleDateString([],{day:"numeric",month:"short",year:"numeric"})}(e.timestamp)})]}),e.businessName?(0,r.jsx)("span",{className:"dialog-item__meta","data-e2e":"chat-row-business",children:e.businessName}):null,(0,r.jsxs)("div",{className:"dialog-item__row",children:[e.typingLabel?(0,r.jsx)("span",{className:"dialog-item__last dialog-item__last--typing","data-e2e":"chat-row-typing",children:e.typingLabel}):(0,r.jsx)("span",{className:"dialog-item__last",children:e.lastMessage||"Tap to start conversation"}),e.unread?(0,r.jsx)("span",{className:"dialog-item__unread",children:e.unread}):null]})]})]})}function i({images:e,index:t,onClose:a}){let[n,l]=(0,s.useState)(t),o=e.length-1;return(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&a(),"ArrowLeft"===e.key&&l(e=>e>0?e-1:e),"ArrowRight"===e.key&&l(e=>e<o?e+1:e)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a,o]),(0,r.jsxs)("div",{className:"chat-gallery",role:"dialog","aria-modal":"true","data-e2e":"chat-gallery",onClick:a,children:[(0,r.jsx)("img",{className:"chat-gallery__img",src:e[n],alt:"",onClick:e=>e.stopPropagation()}),(0,r.jsxs)("div",{className:"chat-gallery__controls",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("span",{className:"chat-gallery__counter",children:[n+1," of ",e.length]}),(0,r.jsxs)("div",{className:"chat-gallery__nav",children:[(0,r.jsx)("button",{type:"button","aria-label":"Previous photo",disabled:0===n,onClick:()=>l(e=>e>0?e-1:e),children:"â¹"}),(0,r.jsx)("button",{type:"button","aria-label":"Next photo",disabled:n===o,onClick:()=>l(e=>e<o?e+1:e),children:"âº"}),(0,r.jsx)("button",{type:"button",className:"chat-gallery__close","aria-label":"Close","data-e2e":"chat-gallery-close",onClick:a,children:"\xd7"})]})]})]})}function c({message:e}){return(0,r.jsx)("div",{className:"chat-thread-placeholder","data-e2e":"chat-thread-placeholder",children:(0,r.jsx)("p",{children:e??"Select a conversation to start messaging"})})}function d({message:e,onOpenPhoto:t,onReply:a,onRetry:s}
1){let n=["message",e.isMine?"message--mine":"",e.pending?"message--pending":"",e.failed?"message--failed":""].filter(Boolean).join(" ");return(0,r.jsxs)("div",{className:n,"data-e2e":"chat-message",children:[e.isMine?null:(0,r.jsx)("div",{className:"message__avatar",children:(0,r.jsx)("img",{src:e.avatarUrl||"/assets/default/user.svg",alt:""})}),(0,r.jsxs)("div",{className:"message__content",children:[(0,r.jsx)("span",{className:"message__time",children:function(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}(e.timestamp)}),e.quote?(0,r.jsxs)("div",{className:"message__quote","data-e2e":"chat-message-quote",children:[e.quote.author?(0,r.jsx)("span",{className:"message__quote-author",children:e.quote.author}):null,(0,r.jsx)("span",{className:"message__quote-text",children:e.quote.text})]}):null,e.text?(0,r.jsx)("p",{className:"message__text","data-e2e":"chat-message-text",children:e.text}):null,e.photos&&e.photos.length>0?(0,r.jsx)("div",{className:"message__photos","data-e2e":"chat-message-photos",children:e.photos.slice(0,4).map((a,s)=>(0,r.jsxs)("button",{type:"button",className:"message__photo","aria-label":"Open photo",onClick:()=>t?.(e.photos??[],s),children:[(0,r.jsx)("img",{src:a,alt:""}),3===s&&e.photos&&e.photos.length>4?(0,r.jsxs)("span",{className:"message__photo-more",children:["+",e.photos.length-4]}):null]},s))}):null,e.failed?(0,r.jsxs)("span",{className:"message__status message__status--failed",children:["Not sent",s?(0,r.jsx)("button",{type:"button",className:"message__retry","data-e2e":"chat-message-retry",onClick:()=>s(e.id),children:"Try again"}):null]}):null]}),!a||e.pending||e.failed?null:(0,r.jsx)("button",{type:"button",className:"message__reply","aria-label":"Reply","data-e2e":"chat-message-reply",onClick:()=>a(e.id),children:"â©"})]})}function u({title:e,subtitle:t,requestId:a,onRequestClick:l,typingLabel:o,messages:c,isLoading:h,isRefreshing:m,isSending:p,onSend:f,onType:g,onAttachFiles:x,attachments:v,onRemoveAttachment:b,replyTo:y,onReplyTo:j,onRetryMessage:_,onCancelReply:w,onBack:N,keyboardInset:k=0}){let[C,R]=(0,s.useState)(""),A=v??[],T=A.some(e=>void 0!==e.progress&&!e.failed),I=(C.trim().length>0||A.length>0)&&!p&&!T,[S,E]=(0,s.useState)(null),O=(0,s.useRef)(null),P=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=P.current;if(!e)return;let t=()=>{e.scrollTop=e.scrollHeight};t();let a=Array.from(e.querySelectorAll("img"));return a.forEach(e=>{e.complete||e.addEventListener("load",t,{once:!0})}),()=>a.forEach(e=>e.removeEventListener("load",t))},[c,k]);let $=()=>{I&&(f(C.trim()),R(""))};return(0,r.jsxs)("div",{className:"chat-thread",children:[(0,r.jsxs)("div",{className:"chat-thread__header",children:[N?(0,r.jsx)("button",{type:"button",className:"chat-thread__back","aria-label":"Back",onClick:N,children:(0,r.jsx)("img",{src:"/assets/icon/chevron-left.svg",alt:"","aria-hidden":"true"})}):null,(0,r.jsxs)("div",{className:"chat-thread__heading",children:[(0,r.jsx)("p",{className:"chat-thread__name","data-e2e":"chat-thread-name",children:e}),o?(0,r.jsxs)("p",{className:"chat-thread__typing","data-e2e":"chat-typing",children:[o,(0,r.jsxs)("span",{className:"chat-thread__typing-dots","aria-hidden":"true",children:[(0,r.jsx)("span",{className:"chat-thread__typing-dot"}),(0,r.jsx)("span",{className:"chat-thread__typing-dot"}),(0,r.jsx)("span",{className:"chat-thread__typing-dot"})]})]}):t?(0,r.jsx)("p",{className:"chat-thread__role",children:t}):null]})]}),a?(0,r.jsxs)("button",{type:"button",className:"chat-thread__banner","data-e2e":"chat-request-banner",onClick:l,children:[(0,r.jsx)("img",{src:"/assets/navigation-tabs/checklist-active.svg",alt:"","aria-hidden":"true"}),(0,r.jsxs)("span",{className:"chat-thread__banner-text",children:[(0,r.jsx)("span",{className:"chat-thread__banner-title",children:"Tap to check your Request"}),(0,r.jsxs)("span",{className:"chat-thread__banner-id",children:["ID: ",a]})]})]}):null,m?(0,r.jsxs)("div",{className:"chat-thread__refreshing",role:"status","data-e2e":"chat-thread-refreshing",children:[(0,r.jsx)("span",{className:"chat-thread__refreshing-bar","aria-hidden":"true"}),(0,r.jsx)("span",{className:"chat-thread__sr-only",children:"Checking for new messages"})]}):null,(0,r.jsxs)("div",{className:"chat-thread__messages",ref:P,"data-e2e":"chat-thread-messages",children:[c.map((e,t)=>{let a=n(e.timestamp)!==n(c[t-1]?.timestamp);return(0,r.jsxs)(s.Fragment,{children:[a&&e.timestamp?(0,r.jsx)("div",{className:"chat-thread__day","data-e2e":"chat-thread-day",children:(0,r.jsx)("span",{className:"chat-thread__day-label",children:function(e,t=new Date){if(!e)return"";let a=new Date(e);if(Number.isNaN(a.getTime()))return"";if(n(e)===n(t.toISOString()))return"Today";let r=new Date(t);return(r.setDate(t.getDate()-1),n(e)===n(r.toISOString()))?"Yesterday":a.getFullYear()===t.getFullYear()?a.toLocaleDateString([],{day:"numeric",month:"short"}):a.toLocaleDateString([],{day:"numeric",month:"short",year:"numeric"})}(e.timestamp)})}):null,(0,r.jsx)(d,{message:e,onOpenPhoto:(e,t)=>E({images:e,index:t}),onReply:j,onRetry:_})]},e.id)}),h||0!==c.length?null:(0,r.jsx)("div",{className:"chat-thread__empty","data-e2e":"chat-thread-empty",children:(0,r.jsx)("span",{children:"No messages yet. Say hello!"})})]}),(0,r.jsxs)("div",{className:"chat-thread__footer",style:k?{paddingBottom:k+12}:void 0,children:[y?(0,r.jsxs)("div",{className:"chat-thread__reply","data-e2e":"chat-reply-preview",children:[(0,r.jsxs)("div",{className:"chat-thread__reply-body",children:[y.author?(0,r.jsx)("span",{className:"chat-thread__reply-author",children:y.author}):null,(0,r.jsx)("span",{className:"chat-thread__reply-text",children:y.preview})]}),(0,r.jsx)("button",{type:"button",className:"chat-thread__reply-cancel","aria-label":"Cancel reply",onClick:w,children:"\xd7"})]}):null,A.length?(0,r.jsx)("div",{className:"chat-thread__attachments","data-e2e":"chat-attachments",children:A.map(e=>(0,r.jsxs)("div",{className:`chat-thread__thumb${e.failed?" chat-thread__thumb--failed":""}`,"data-e2e":"chat-attachment",children:[(0,r.jsx)("img",{src:e.previewUrl,alt:""}),void 0===e.progress||e.failed?null:(0,r.jsx)("span",{className:"chat-thread__thumb-progress",role:"progressbar","aria-valuenow":e.progress,"aria-label":"Uploading photo",children:(0,r.jsx)("span",{style:{width:`${e.progress}%`}})}),e.failed?(0,r.jsx)("span",{className:"chat-thread__thumb-failed",children:"Failed"}):null,(0,r.jsx)("button",{type:"button",className:"chat-thread__thumb-remove","aria-label":"Remove photo",onClick:()=>b?.(e.id),children:"\xd7"})]},e.id))}):null,(0,r.jsxs)("div",{className:"chat-thread__compose-row",children:[x?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:O,type:"file",accept:"image/png,image/jpeg",multiple:!0,hidden:!0,"data-e2e":"chat-attach-input",onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&x(t),e.target.value=""}}),(0,r.jsx)("button",{type:"button",className:"chat-thread__attach","aria-label":"Attach photo",onClick:()=>O.current?.click(),children:(0,r.jsx)("img",{src:"/assets/icon/attachment.svg",alt:"","aria-hidden":"true"})})]}):null,(0,r.jsxs)("div",{className:"chat-thread__composer",children:[(0,r.jsx)("textarea",{className:"chat-thread__input","aria-label":"Message",placeholder:"Type a message",rows:1,value:C,onChange:e=>{R(e.target.value),g?.()},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),$())},"data-e2e":"chat-input"}),(0,r.jsx)("button",{type:"button",className:"chat-thread__send","aria-label":"Send",disabled:!I,onClick:$,"data-e2e":"chat-send",children:p?(0,r.jsx)("span",{className:"chat-thread__send-spinner","aria-hidden":"true"}):(0,r.jsx)("img",{src:"/assets/icon/send.svg",alt:"","aria-hidden":"true"})})]})]})]}),S?(0,r.jsx)(i,{images:S.images,index:S.index,onClose:()=>E(null)}):null]})}a(26473),a(94445),a(13548),a(90354),a(29675),a(53950)},62612:(e,t,a)=>{"use strict";a.d(t,{E:()=>o});
1var r=a(88073),s=a(21072),n=a(82887);let l=e=>(0,n.Ay)().get(e).then(e=>e.data),o=()=>{let e=(0,r.hasCookie)("accessToken"),{data:t,error:a,isLoading:n}=(0,s.Ay)(e?"notification?page=0&limit=20":null,l);return{items:t??[],error:a,isLoading:n,isLoggedIn:e}}},66366:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h}});let r=a(21776)._(a(62544)),s=a(8032),n=[],l=[],o=!1;function i(e){let t=e(),a={loading:!0,loaded:null,error:null};return a.promise=t.then(e=>(a.loading=!1,a.loaded=e,e)).catch(e=>{throw a.loading=!1,a.error=e,e}),a}class c{constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}}function d(e){return function(e,t){let a=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),n=null;function i(){if(!n){let t=new c(e,a);n={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return n.promise()}if(!o){let e=a.webpack&&1?a.webpack():a.modules;e&&l.push(t=>{for(let a of e)if(t.includes(a))return i()})}function d(e,t){let l;i(),(l=r.default.useContext(s.LoadableContext))&&Array.isArray(a.modules)&&a.modules.forEach(e=>{l(e)});let o=r.default.useSyncExternalStore(n.subscribe,n.getCurrentValue,n.getCurrentValue);return r.default.useImperativeHandle(t,()=>({retry:n.retry}),[]),r.default.useMemo(()=>{var t;return o.loading||o.error?r.default.createElement(a.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:n.retry}):o.loaded?r.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null},[e,o])}return d.preload=()=>i(),d.displayName="LoadableComponent",r.default.forwardRef(d)}(i,e)}function u(e,t){let a=[];for(;e.length;){let r=e.pop();a.push(r(t))}return Promise.all(a).then(()=>{if(e.length)return u(e,t)})}d.preloadAll=()=>new Promise((e,t)=>{u(n).then(e,t)}),d.preloadReady=(e=[])=>new Promise(t=>{let a=()=>(o=!0,t());u(l,e).then(a,a)}),window.__NEXT_PRELOADREADY=d.preloadReady;let h=d},67387:(e,t,a)=>{"use strict";a.d(t,{X8:()=>g,d3:()=>y});var r=a(10940),s=a(61913),n=a(84108),l=a(45269),o=a(90122),i=a.n(o),c=a(35295),d=a(62544),u=a(20788),h=a(41795),m=a(69789),p=a(54382),f=a(23694);function g(e){return"consumer"===e?"provider":"provider"===e?"consumer":"classroom"===e?"classroom":"team"}function x({chatId:e,type:t}){let a=(0,c.useRouter)(),{title:o,subtitle:i,request:u,messages:m,isLoading:p,isRefreshing:f,isSending:g,sendMessage:v,retrySend:b,typingLabel:y,notifyTyping:j,attachments:_,attachFiles:w,removeAttachment:N,replyTo:k,startReply:C,cancelReply:R,error:A}=(0,n.UU)(e,t),T=(0,l.Q)();return((0,d.useEffect)(()=>{(0,h.hE)({placements:"classroom"===t?[h.pE.CLASSROOM_CHAT]:[h.pE.CONSUMER_CHAT,h.pE.PROVIDER_CHAT,h.pE.TEAM_CHAT],modelId:e})},[e,t]),!A||m.length||p)?(0,r.jsx)(s.RB,{title:o,subtitle:i,requestId:u?.requestId,onRequestClick:u?()=>a.push(u.requestUrl):void 0,typingLabel:y,messages:m,isLoading:p,isRefreshing:f,isSending:g,onSend:v,onType:j,onAttachFiles:w,attachments:_,onRemoveAttachment:N,replyTo:k,onReplyTo:C,onRetryMessage:b,onCancelReply:R,onBack:()=>window.history.length>1?a.back():a.push("/chat"),keyboardInset:T}):(0,r.jsx)(s.u6,{message:"This conversation could not be opened."})}let v={student:"/student",admin:"/admin",networkAdmin:"/network-admin",coordinator:"/coordinator"};function b({chatId:e,type:t}){let a=(0,c.useRouter)(),l=function(e){var t;if(e.backHref&&(t=e.backHref).startsWith("/")&&!t.startsWith("//")&&!t.startsWith("/\\"))return{href:e.backHref,label:"Back to dashboard"};let a=e.from?v[e.from]:void 0;return a?{href:a,label:"Back to dashboard"}:{href:"/marketplace",label:"Explore Marketplace"}}({from:a.query.from,backHref:a.query.backHref}),{sections:o,isLoading:d,search:h,searchResults:m}=(0,f.S)(e),y=(0,n._h)(),j=a.query.from,_=e=>j?`${e}&from=${j}`:e,w=(0,r.jsx)(p.Y,{sections:o,hrefFor:({row:e,tab:t})=>_(`/chat/${e.id}?type=${g(t)}`),hrefForSearch:e=>_(`/chat/${e}?type=team`),onSearch:h,searchResults:m,isLoading:d,linkComponent:y,selectedId:e,onSelect:(e,t)=>
1a.push(t)});return(0,r.jsxs)("div",{className:"flex flex-col h-[100dvh] overflow-hidden bg-webapp",children:[(0,r.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-1/2 focus:-translate-x-1/2 focus:z-[100] focus:px-4 focus:py-2 focus:bg-white focus:text-green focus:rounded-lg focus:shadow-lg focus:outline-none",children:"Skip to main content"}),(0,r.jsxs)("header",{className:"flex flex-none items-center gap-4 border-b border-softgrey1 bg-white px-4 py-3",children:[(0,r.jsx)(i(),{href:"/","aria-label":"KANU home",className:"flex shrink-0 items-center",children:(0,r.jsx)(u.VTb,{className:"h-6 w-auto"})}),(0,r.jsx)("h1",{className:"min-w-0 truncate text-sm font-bold tracking-[0.4px] text-black1",children:"Inbox"}),(0,r.jsx)(i(),{href:l.href,className:"ml-auto shrink-0 whitespace-nowrap rounded-full border border-softgrey1 px-3 py-1.5 text-sm font-semibold text-black1 hover:bg-softgrey2",children:l.label})]}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 desktop:grid desktop:grid-cols-[360px_1fr] desktop:gap-4 desktop:p-4",children:[(0,r.jsx)("aside",{"aria-label":"Conversations",className:`min-h-0 h-full overflow-hidden rounded-2xl bg-white ${e?"hidden desktop:block":"block"}`,children:w}),(0,r.jsx)("main",{id:"main-content",tabIndex:-1,className:`min-h-0 h-full overflow-hidden rounded-2xl bg-white outline-none ${e?"block":"hidden desktop:block"}`,children:e?(0,r.jsx)("div",{className:"kanu-chat-thread h-full",children:(0,r.jsx)(x,{chatId:e,type:t},e)}):(0,r.jsx)(s.u6,{})})]})]})}function y(e){return(0,r.jsx)(m.n,{children:(0,r.jsx)(b,{...e})})}},68686:(e,t,a)=>{"use strict";a.d(t,{Q:()=>n});var r=a(35295),s=a(55445);function n(){let e=(0,r.useRouter)(),t="string"==typeof e.query.classroomId?e.query.classroomId:"",{classroom:a,isLoading:n}=(0,s.f)(t);return{classroomId:t,classroomTitle:a?.abbreviation??a?.name??"Classroom",isLoading:n}}},69789:(e,t,a)=>{"use strict";a.d(t,{n:()=>f});var r=a(10940),s=a(88063),n=a(88073),l=a(90122),o=a.n(l),i=a(62544),c=a(82887),d=a(15755),u=a(49007);function h({href:e,children:t,...a}){return(0,r.jsx)(o(),{href:e,...a,children:t})}let m={async get(e){let t=await (0,c.Qg)(e);return t?.data??t},async post(e,t){let a=await (0,c.I9)(e,t);return a?.data??a}},p={requestUrl:(e,t)=>`/requests/${e}s/${t}`};function f({children:e}){let{data:t}=(0,d.J)(),a=t?._id??null,l=(0,i.useCallback)(()=>(0,n.getCookie)("accessToken")??null,[]),o=(0,i.useCallback)(()=>a,[a]),c=(0,i.useMemo)(u.N,[]);return(0,r.jsx)(s.g,{http:m,getToken:l,getUserId:o,wsBaseUrl:c,routes:p,linkComponent:h,children:e})}},76255:(e,t,a)=>{"use strict";a.d(t,{_u:()=>p});var r=a(10940),s=a(61913),n=a(84108),l=a(62544),o=a(61682),i=a(69789),c=a(96246),d=a(54382),u=a(67387),h=a(23694);function m(){let[e,t]=(0,l.useState)(),{sections:a,isLoading:o,search:i,searchResults:m}=(0,h.S)(e?.chatId),p=(0,n._h)(),f=(0,r.jsx)(d.Y,{sections:a,hrefFor:({row:e,tab:t})=>`/chat/${e.id}?type=${(0,u.X8)(t)}`,hrefForSearch:e=>`/chat/${e}?type=team`,onSearch:i,searchResults:m,isLoading:o,linkComponent:p,selectedId:e?.chatId,onSelect:(e,a)=>t({chatId:e,type:new URLSearchParams(a.split("?")[1]).get("type")??void 0})});return(0,r.jsxs)("div",{className:"flex w-[860px] max-w-[100vw] h-screen overflow-hidden bg-white",children:[(0,r.jsx)("div",{className:"w-[340px] shrink-0 h-full overflow-hidden border-r border-softgrey1",children:f}),(0,r.jsx)("div",{className:"flex-1 h-full overflow-hidden",children:e?(0,r.jsx)(c.q,{chatId:e.chatId,type:e.type,onClose:()=>t(void 0)},e.chatId):(0,r.jsx)(s.u6,{})})]})}function p({onClose:e}){return(0,r.jsx)(o.w,{onClose:e,children:(0,r.jsx)(i.n,{children:(0,r.jsx)(m,{})})})}},77117:(e,t,a)=>{e.exports=a(29027)()},84108:(e,t,a)=>{"use strict";a.d(t,{DD:()=>u,xz:()=>_,_h:()=>k,UU:()=>N,RL:()=>m,TA:()=>l});var r=a(62544),s=a(21072),n=a(88063);function l(){let{getUserId:e}=(0,n.q)(),[t,a]=(0,r.useState)(()=>{let t=e();return"string"==typeof t?t:null});return(0,r.useEffect)(()=>{let t=!0;return Promise.resolve(e()).then(e=>{t&&a(e??null)}),()=>{t=!1}},[e]),t}function o(e){return`${e?.firstName??""} ${e?.lastName??""}`.trim()}function i(e){return"products"===e.businessType?e.businessLogoUrl||e.businessPhotoUrl||void 0:e.businessPhotoUrl??void 0}function c(e,t){let a=e.chat??{}
1,r=a.group??[],s=r.map(o).filter(Boolean).join(", "),n={id:a._id??"",requestReferenceId:a.requestReferenceId,lastMessage:e.lastMessage?.content,timestamp:e.lastMessage?.createdAt,unread:e.unreadMessage,participantIds:r.map(e=>e._id).filter(e=>!!e),participants:r.filter(e=>!!e._id).map(e=>({id:e._id,name:o(e)})),classroomId:a.classroomId,ecosystemId:a.ecosystemId};if("provider"===t){let e=r[1],t=o(e);return{...n,name:t||(a.businessName?`${a.businessName} team`:s||"Chat"),photoUrl:e?.photoUrl??void 0,businessName:a.businessName}}return"team"===t?{...n,name:a.businessName?`${a.businessName} team`:s||"Chat",photoUrl:i(a)}:"classroom"===t||"staff"===t?{...n,name:s||"Chat"}:{...n,name:a.businessName||s||"Chat",photoUrl:i(a)}}let d={consumer:[],provider:[],team:[],classroom:[],staff:[]};function u(e,t){return new Date(t.timestamp??0).getTime()-new Date(e.timestamp??0).getTime()}function h(e,t){return t?e.map(e=>{let a=e.participants?.find(e=>e.id!==t&&e.name);return a&&a.name!==e.name?{...e,name:a.name}:e}):e}function m(){let{http:e}=(0,n.q)(),{data:t,error:a,isLoading:o,mutate:i}=(0,s.Ay)("chat",async t=>{let a=await e.get(t);return{consumer:(a?.preparedConsumer??[]).map(e=>c(e,"consumer")),provider:(a?.preparedProvider??[]).map(e=>c(e,"provider")),team:(a?.preparedTeam??[]).map(e=>c(e,"team")),classroom:(a?.preparedClassroom??[]).map(e=>c(e,"classroom")),staff:(a?.preparedStaff??[]).map(e=>c(e,"staff"))}}),u=l(),m=t??d,p=(0,r.useMemo)(()=>0===m.classroom.length&&0===m.staff.length?m:{...m,classroom:h(m.classroom,u),staff:h(m.staff,u)},[m,u]),f=(0,r.useRef)(p);f.current=p;let g=(0,r.useCallback)((e,t)=>{let a=function(e,t,a){let r=t?.chat;if(!r)return null;let s="object"==typeof t.owner&&null!==t.owner?String(t.owner._id??""):String(t.owner??""),n=(!a?.selfId||s!==a.selfId)&&r!==a?.openChatId,l=!1,o={};for(let a of["consumer","provider","team","classroom","staff"]){let s=e[a],i=s.findIndex(e=>e.id===r);if(-1===i){o[a]=s;continue}l=!0;let c={...s[i],lastMessage:t.content??s[i].lastMessage,timestamp:t.createdAt??s[i].timestamp,unread:n?(s[i].unread??0)+1:s[i].unread};o[a]=[c,...s.slice(0,i),...s.slice(i+1)]}return l?o:null}(f.current,e,t);return a&&i(a,{revalidate:!1}),null!==a},[i]),[x,v]=(0,r.useState)(null),b=(0,r.useRef)(0),y=(0,r.useRef)(""),j=(0,r.useCallback)(async t=>{let a=t.trim();y.current=a;let r=++b.current;if(v(null),a)try{let t=await e.get(`chat/find/messages?searchText=${encodeURIComponent(a)}`);if(r!==b.current)return;let s=new Map;for(let e of[...f.current.consumer,...f.current.provider,...f.current.team,...f.current.classroom,...f.current.staff])s.has(e.id)||s.set(e.id,e.name);v({users:(t?.users??[]).map(e=>c(e,"team")),messages:(t?.messages??[]).map(e=>({id:e.chat??"",name:s.get(e.chat??"")??"Chat",lastMessage:e.content,timestamp:e.createdAt}))})}catch{r===b.current&&v({users:[],messages:[]})}},[e]),_=(0,r.useCallback)(()=>y.current?j(y.current):Promise.resolve(),[j]);return{tabs:p,error:a,isLoading:o,refresh:i,applyLastMessage:g,search:j,searchResults:x,refreshSearch:_}}var p=a(6608),f=a(24767);function g(e){return e?.toLowerCase()||void 0}function x(e){return`${e?.firstName??""} ${e?.lastName??""}`.trim()}function v(e){return e._id??(null!=e.id?String(e.id):void 0)}function b(e){return"string"==typeof e.owner?e.owner:e.owner?._id}function y(e){return"string"==typeof e.owner?void 0:e.owner}function j(e){return"string"==typeof e.quote?e.quote:e.quote?._id}function _(e,t){let a=v(t);if(a&&e.some(e=>v(e)===a))return e.map(e=>v(e)===a?{...e,pending:!1}:e);let r=b(t),s=e.findIndex(e=>e.pending&&!e._id&&e.content===t.content&&b(e)===r&&void 0!==r);return -1!==s?e.map((e,a)=>a===s?{...e,_id:t._id,pending:!1}:e):[...e,t]}function w(e){return(e.photos??[]).map(e=>"string"==typeof e?e:e.webviewPath||e.s3Url).filter(e=>!!e)}function N(e,t,a){var o;let i,c,{http:d,routes:u}=(0,n.q)(),h=l(),m=a?`?guestIdentifier=${encodeURIComponent(a)}`:"",N=e?`chat/${e}${m}`:null,k=(0,r.useRef)(!1),{data:C,error:R,isLoading:A,isValidating:T,mutate:I}=(0,s.Ay)(N,async e=>{let t=await d.get(e);return{messages:t?.message??[],chat:t?.chat??{},businessName:t?.business?.businessName,request:t?.request,viewerId:t?.viewerId}},a&&!h?{refreshInterval:12e3,isPaused:()=>k.current}:void 0),S=h??C?.viewerId??null,[E,O]=(0,r.useState)(!1),[P,$]=(0,r.useState)(null),L=function(e,t){let{http:a}=(0,n.q)(),[s,l]=(0,r.useState)([]),o=(0,r.useRef)(new Map),i=(0,r.useRef)([]);(0,r.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e)},[]);let c=(0,r.useCallback)(r=>{for(let s of r){let r=`${s.name}-${s.size}-${i.current.length}-${Math.random().toString(36).slice(2)}`,n=URL.createObjectURL(s);i.current.push(n),l(e=>[...e,{id:r,previewUrl:n,progress:0}]),(async()=>{try{let n=function(e){let t=e.name.includes(".")?e.name.split(".").pop():void 0,a=`${Date.now()}-${Math.random().toString(36).slice(2,14)}`;return t?`${a}.${t}`:a}(s),{presigned:i}=await a.post("upload-credential",{path:e?`chat/${e}
1`:"chat",...t&&e?{chatId:e,guestIdentifier:t}:{}}),c=await function(e,t,a,r){let{url:s,key:n,...l}=e,o=new FormData;for(let[e,t]of(o.append("key",n),Object.entries(l)))o.append(e,t);return o.append("file",t,a),new Promise((e,t)=>{let l=new XMLHttpRequest;l.open("POST",s),l.timeout=6e4,l.upload.onprogress=e=>{e.lengthComputable&&r(Math.round(e.loaded/e.total*100))},l.onload=()=>{let r,o,i;return l.status>=200&&l.status<300?e((o=(r=n.includes("${filename}")?n.replace("${filename}",a):n).startsWith("/")?r.slice(1):r,i=s.endsWith("/")?s:`${s}/`,`${i}${o}`)):t(Error(`S3 upload failed (${l.status})`))},l.onerror=()=>t(Error("S3 upload failed")),l.ontimeout=()=>t(Error("S3 upload timed out")),l.send(o)})}(i,s,n,e=>l(t=>t.map(t=>t.id===r?{...t,progress:e}:t)));o.current.set(r,c),l(e=>e.map(e=>e.id===r?{id:e.id,previewUrl:e.previewUrl}:e))}catch{l(e=>e.map(e=>e.id===r?{...e,progress:void 0,failed:!0}:e))}})()}},[a,e,t]),d=(0,r.useCallback)(e=>{o.current.delete(e),l(t=>{let a=t.find(t=>t.id===e);return a&&(URL.revokeObjectURL(a.previewUrl),i.current=i.current.filter(e=>e!==a.previewUrl)),t.filter(t=>t.id!==e)})},[]),u=(0,r.useCallback)(()=>{let e=s.filter(e=>o.current.has(e.id)),t=e.map(e=>o.current.get(e.id));for(let t of e)URL.revokeObjectURL(t.previewUrl),o.current.delete(t.id);let a=new Set(e.map(e=>e.previewUrl));return i.current=i.current.filter(e=>!a.has(e)),l(t=>t.filter(t=>!e.some(e=>e.id===t.id))),t},[s]),h=s.filter(e=>o.current.has(e.id)).length;return{attachments:s,add:c,remove:d,takeUrls:u,readyCount:h}}(e,a);(0,r.useEffect)(()=>{$(null)},[e]);let{mutate:D,cache:M}=(0,p.iX)();(0,r.useEffect)(()=>{if(!e||!M.get("chat")?.data)return;let t=(t=[])=>t.map(t=>t.id===e?{...t,unread:0}:t);D("chat",e=>e&&{consumer:t(e.consumer),provider:t(e.provider),team:t(e.team),classroom:t(e.classroom),staff:t(e.staff)},{revalidate:!1})},[e,D,M]);let q=(0,r.useMemo)(()=>{let e=(C?.messages??[]).slice().sort((e,t)=>new Date(e.createdAt??0).getTime()-new Date(t.createdAt??0).getTime()),t=new Map;for(let a of e)a._id&&t.set(a._id,a);return e.map((e,a)=>{let r,s;return r=e._id??(null!=e.id?String(e.id):void 0)??`idx-${a}`,s=j(e)?t.get(j(e)):void 0,{id:r,text:e.content??"",timestamp:e.createdAt,isMine:!!S&&b(e)===S,avatarUrl:y(e)?.photoUrl??void 0,author:x(y(e))||void 0,photos:w(e),pending:e.pending,failed:e.failed,quote:s?{author:x(y(s))||void 0,text:s.content||(w(s).length?"Photo":"")}:void 0}})},[C,S]),{typing:U,notifyTyping:F,stopTyping:H}=function(e,t){let{userId:a}=t,{getToken:s,wsBaseUrl:l}=(0,n.q)(),o=(0,r.useRef)(null),[i,c]=(0,r.useState)(null),d=(0,r.useRef)(!1),u=(0,r.useRef)(void 0),h=(0,r.useRef)(t.onMessage);h.current=t.onMessage;let m=(0,r.useRef)(t.onReconnect);m.current=t.onReconnect;let p=(0,r.useRef)(t.userId);p.current=t.userId;let g=(0,r.useRef)(s);g.current=s;let x=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!e)return;let t=!1;x.current=null;let a=new f.$({baseUrl:l,getToken:()=>g.current(),namespace:"message",onReconnect:r=>{if(t)return;let s=p.current??void 0;x.current=s??null,a.emit("enter-chat-room",{chatId:e,owner:s}),a.emit("read-message",{chatId:e,owner:s}),r&&m.current?.()}});return o.current=a,a.on("message",e=>h.current(e)),a.on("users-typing",e=>{c(e?.typing?e:null)}),a.connect().catch(()=>{}),()=>{t=!0,clearTimeout(u.current),d.current&&(d.current=!1,a.emit("is-typing",{chatId:e,owner:p.current??void 0,typing:!1})),a.emit("leave-chat-room",{chatId:e,owner:p.current??void 0}),a.disconnect(),o.current=null}},[e,l]),(0,r.useEffect)(()=>{e&&a&&x.current!==a&&(x.current=a,o.current?.emit("enter-chat-room",{chatId:e,owner:a}),o.current?.emit("read-message",{chatId:e,owner:a}))},[e,a]);let v=(0,r.useCallback)(t=>{o.current?.emit("is-typing",{chatId:e,owner:p.current??void 0,typing:t})},[e]);return{typing:i,notifyTyping:(0,r.useCallback)(()=>{d.current||(d.current=!0,v(!0)),clearTimeout(u.current),u.current=setTimeout(()=>{d.current=!1,v(!1)},600)},[v]),stopTyping:(0,r.useCallback)(()=>{clearTimeout(u.current),d.current&&(d.current=!1,v(!1))},[v])}}(e,{userId:S,onMessage:(0,r.useCallback)(e=>{e&&I(t=>{let a=t??{messages:[],chat:{}};return{...a,messages:_(a.messages,e)}},{revalidate:!1})},[I]),onReconnect:()=>void I()}),B=(0,r.useCallback)(async(t,a)=>{O(!0),k.current=!0;try{let r=await d.post(`chat/${e}${m}`,{type:a.type,content:a.content??"",...a.photos?.length?{photos:a.photos}:{},...a.quote?{quote:a.quote}:{}}),s=r?.created?.message;await I(e=>{var a;let r;return{...e??{chat:{}},messages:(a=(e?.messages??[]).map(e=>e.id===t?{...e,_id:s?._id,pending:!1}:e),r=new Set,a.filter(e=>
1!e._id||!r.has(e._id)&&(r.add(e._id),!0)))}},{revalidate:!1})}catch{await I(e=>({...e??{chat:{}},messages:(e?.messages??[]).map(e=>e.id===t?{...e,pending:!1,failed:!0}:e)}),{revalidate:!1})}finally{k.current=!1,O(!1)}},[e,m,d,I]),Y=(0,r.useCallback)(async t=>{let a=t.trim();if(!e||!a&&!L.readyCount)return;let r=L.takeUrls();H();let s=P?.id;$(null);let n=`tmp-${Date.now()}`,l={id:n,content:a,owner:{_id:S??void 0},createdAt:new Date().toISOString(),type:r.length?"picture":"text",photos:r,quote:s,pending:!0};await I(e=>({...e??{chat:{}},messages:[...e?.messages??[],l]}),{revalidate:!1}),await B(n,{type:r.length?"picture":"text",content:a,photos:r,quote:s})},[e,S,I,H,P,L,B]),V=(0,r.useCallback)(async e=>{let t=(C?.messages??[]).find(t=>v(t)===e&&t.failed&&!t.pending);t&&(await I(t=>({...t??{chat:{}},messages:(t?.messages??[]).map(t=>v(t)===e?{...t,pending:!0,failed:!1}:t)}),{revalidate:!1}),await B(e,{type:t.type??(w(t).length?"picture":"text"),content:t.content,photos:w(t),quote:j(t)}))},[C,I,B]),G=(0,r.useCallback)(e=>{let t=q.find(t=>t.id===e);t&&$({id:e,author:t.isMine?"You":t.author,preview:t.text||(t.photos?.length?"Photo":"")})},[q]),W=U?.typing?`${U.user||"Someone"} is typing`:void 0;return{title:C?(c=(i=C.chat.group??[]).filter(e=>e._id!==S).map(x).filter(Boolean).join(", "),"consumer"===g(t)?x(i[1])||c||C.businessName||"Chat":C.businessName||c||"Chat"):"",subtitle:(o=g(t))?o.charAt(0).toUpperCase()+o.slice(1):void 0,request:C?function(e,t,a){if("provider"!==g(t)||!e?._id)return;let r="service"===e.type||"product"===e.type?e.type:void 0;if(!r)return;let s=a.requestUrl(r,e._id);if(s)return{requestId:e.referenceId||e._id,requestUrl:s}}(C.request,t,u):void 0,messages:q,isLoading:A,isRefreshing:T&&!A&&!!C,isSending:E,error:R,sendMessage:Y,retrySend:V,typingLabel:W,notifyTyping:F,attachments:L.attachments,attachFiles:L.add,removeAttachment:L.remove,replyTo:P,startReply:G,cancelReply:(0,r.useCallback)(()=>$(null),[])}}function k(){return(0,n.q)().linkComponent}},84437:(e,t,a)=>{"use strict";a.d(t,{f:()=>o});let r=(e,t)=>`/student/experience/${e}/${t}`,s=[{pattern:/^\/voyage\/([^/]+)\/badges\/?$/,to:e=>r(e,"todo")},{pattern:/^\/voyage\/([^/]+)\/milestones\/?$/,to:e=>r(e,"todo")},{pattern:/^\/voyage\/([^/]+)\/leaderboard\/?$/,to:e=>r(e,"leaderboard")},{pattern:/^\/voyage\/([^/]+)\/chatbot(?:\/.*)?$/,to:e=>r(e,"voyage")}],n={"/account/badges":"/student/badges","/account/classrooms":"/student"},l=[{prefix:"/roadmap/chatbot",to:"/student"}];function o(e){let t=e,a="";try{let r=new URL(e);t=r.pathname,a=r.search}catch{let r=e.indexOf("?");-1!==r&&(t=e.slice(0,r),a=e.slice(r))}t.startsWith("/")||(t=`/${t}`);let r=t.length>1?t.replace(/\/+$/,""):t,o=n[r];if(o)return`${o}${a}`;for(let{prefix:e,to:t}of l)if(r===e||r.startsWith(`${e}/`))return`${t}${a}`;for(let{pattern:e,to:t}of s){let s=r.match(e)?.[1];if(s)return`${t(s)}${a}`}return`${t}${a}`}},88063:(e,t,a)=>{"use strict";a.d(t,{g:()=>n,q:()=>l});var r=a(62544);let s=(0,r.createContext)(null);function n({children:e,http:t,getToken:a,getUserId:l,wsBaseUrl:o,routes:i,linkComponent:c}){let d=(0,r.useMemo)(()=>({http:t,getToken:a,getUserId:l,wsBaseUrl:o,routes:i,linkComponent:c}),[t,a,l,o,i,c]);return(0,r.createElement)(s.Provider,{value:d},e)}function l(){let e=(0,r.useContext)(s);if(!e)throw Error("Messaging runtime used outside a <MessagingUiProvider>. Wrap the chat screens in one and pass the app's http, token, user-id, ws and route adapters.");return e}},89552:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/network-admin/classrooms/[classroomId]/insights",function(){return a(29882)}])},90354:()=>{},93176:(e,t,a)=>{"use strict";a.d(t,{c:()=>n});var r=a(10940),s=a(20788);function n(e,t){return e.map(e=>({id:e._id,label:e.abbreviation??e.name,href:`${t}/${e._id}`,subLinks:[{label:"Activity",href:`${t}/${e._id}/activity`,icon:(0,r.jsx)(s.p3o,{className:"fill-black1"})},{label:"Students",href:`${t}/${e._id}/students`,icon:(0,r.jsx)(s.hjP,{className:"fill-black1"})},{label:"Grades",href:`${t}/${e._id}/grades`,icon:(0,r.jsx)(s.WfV,{className:"fill-black1"})},{label:"Insights",href:`${t}/${e._id}/insights`,icon:(0,r.jsx)(s.YCQ,{className:"fill-black1"})}]}))}},94445:()=>{},96246:(e,t,a)=>{"use strict";a.d(t,{I:()=>h,q:()=>u});var r=a(10940),s=a(61913),n=a(84108),l=a(45269),o=a(62544),i=a(61682),c=a(41795),d=a(69789);function u({chatId:e,type:t,guestIdentifier:a,onClose:i}){let{title:d,subtitle:h,request:m,messages:p,isLoading:f,isRefreshing:g,isSending:x,sendMessage:v,retrySend:b,typingLabel:y,notifyTyping:j,attachments:_,attachFiles:w,removeAttachment:N,replyTo:k,startReply:C,cancelReply:R,error:A}=(0,n.UU)(e,t,a),T=(0,l.Q)();return((0,o.useEffect)(()=>{(0,c.hE)({placements:"classroom"===t?[c.pE.CLASSROOM_CHAT]:"staff"===t?[c.pE.STAFF_CHAT]:[c.pE.CONSUMER_CHAT,c.pE.PROVIDER_CHAT,c.pE.TEAM_CHAT],modelId:e})},[e,t]),!A||p.length||f)?(0,r.jsx)(s.RB,{title:d,subtitle:h,requestId:m?.requestId,onRequestClick:void 0,typingLabel:y,messages:p,isLoading:f,isRefreshing:g,isSending:x,onSend:v,onType:j,onAttachFiles:w,attachments:_,onRemoveAttachment:N,replyTo:k,onReplyTo:C,onRetryMessage:b,onCancelReply:R,onBack:i,keyboardInset:T}):(0,r.jsx)(s.u6,{message:"This conversation could not be opened."})}let h=({chatId:e,type:t,guestIdentifier:a,onClose:s})=>(0,r.jsx)(i.w,{onClose:s,children:(0,r.jsx)("div",{className:"w-screen max-w-[480px] h-screen flex flex-col bg-white overflow-hidden",children:(0,r.jsx)(d.n,{children:(0,r.jsx)(u,{chatId:e,type:t,guestIdentifier:a,onClose:s},e)})})})},96947:(e,t,a)=>{e.exports=a(49481)},97518:(e,t,a)=>{"use strict";a.d(t,{p:()=>T});var r,s=a(10940),n=a(11610),l=a(32209),o=a(62544),i=a(20788),c=a(39772),d=a(40784),u=a(63540),h=a(29229),m=a(11230),p=a.n(m),f=a(51304),g=a.n(f),x=a(87439),v=a.n(x),b=((r={}).booking="static/notifications/booking.svg",r.warning="static/notifications/warning.svg",r.reminder="static/notifications/reminder.svg",r.team="static/notifications/team.svg",r.performance="static/notifications/performance.svg",r.chat="static/notifications/chat.svg",r.rating="static/notifications/star.svg",r.time="static/notifications/time.svg",r.extraCost="static/notifications/money.svg",r.cancel="static/notifications/cancel.
1svg",r.badge="static/notifications/badge.svg",r),y=a(62612),j=a(78859),_=a(52827),w=a(35681),N=a.n(w);let k=()=>(0,s.jsxs)("div",{className:N().empty,children:[(0,s.jsx)("div",{className:N().empty_image,children:(0,s.jsx)(v(),{src:"/static/empty-order.svg",alt:"",width:0,height:0,style:{width:"100%",height:"100%"}})}),(0,s.jsx)("span",{className:N().empty_title,children:"Not logged in"}),(0,s.jsx)("span",{className:N().empty_message,children:"Login to see notifications and stay connected with Kanu."}),(0,s.jsx)(_.$,{href:"/login",variant:"contained",color:"primary",sx:{width:"180px"},children:"Login"}),(0,s.jsx)(_.$,{href:"/register",variant:"outlined",color:"primary",sx:{width:"180px"},children:"Register"})]}),C=()=>(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center w-full min-h-[300px] gap-2 mb-8",children:[(0,s.jsx)("div",{className:"w-28 max-w-28 mb-4",children:(0,s.jsx)(v(),{src:"/static/notification-empty.svg",alt:"",width:0,height:0,style:{width:"100%",height:"100%"}})}),(0,s.jsx)("span",{className:"text-2xl text-center text-black2",children:"You donât have any notifications right now"}),(0,s.jsx)("span",{className:"text-base text-center text-black3",children:"Find your school to get started"})]});var R=a(84437);let A=()=>{let{items:e,isLoading:t,isLoggedIn:a}=(0,y.E)(),r=()=>{(0,j.$F)("notification_open")};return(0,s.jsx)("div",{className:"flex flex-col w-full",children:t?(0,s.jsx)("div",{className:"flex flex-col py-4 overflow-auto",children:[0,1,2].map((e,t)=>({index:t+1})).map(e=>(0,s.jsxs)("div",{className:"flex items-center cursor-pointer p-2 gap-4 hover:bg-softgrey2 rounded-md",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-12 min-w-12 bg-aeroteal rounded-full",children:(0,s.jsx)(h.A,{variant:"circular",width:48,height:48})}),(0,s.jsxs)("div",{className:"flex flex-col flex-1 gap-1 pt-2 pb-4 border-b border-softgrey1 line-clamp-1 overflow-hidden",children:[(0,s.jsx)(h.A,{variant:"rounded",width:0,height:14}),(0,s.jsx)(h.A,{variant:"rounded",width:"40%",height:12})]})]},e.index))}):(0,s.jsx)("div",{className:"flex flex-col py-4 overflow-auto",children:a?e.length>0?e.map(e=>{let t;return(0,s.jsx)("a",{href:(t=e.urlArgs,(0,R.f)(t)),onClick:r,children:(0,s.jsxs)("div",{className:"flex items-center cursor-pointer p-2 gap-4 hover:bg-softgrey2 hover:rounded-md",children:[(0,s.jsx)("div",{className:p()("flex items-center justify-center size-12 min-w-12 bg-aeroteal rounded-full",{"bg-softgrey1":e.read}),children:(0,s.jsx)(v(),{src:b[e.type],alt:e.title,width:24,height:24})}),(0,s.jsxs)("div",{className:"flex flex-col flex-1 gap-1 pt-2 pb-4 border-b border-softgrey1 line-clamp-1 overflow-hidden",children:[(0,s.jsx)("span",{className:"text-sm font-bold text-black2",children:e.title}),(0,s.jsx)("span",{className:"text-xs font-bold text-black3",children:g()(g()(e.time).utc(!0)).from(g().utc())})]})]})},e._id)}):(0,s.jsx)(C,{}):(0,s.jsx)(k,{})})})},T=()=>{let e=(0,n.A)("(min-width:1180px)"),{placements:t}=(0,c._Q)(),a=t?.notification?.length??0,[r,h]=(0,o.useState)(null),m=e=>h(e.currentTarget),p=()=>h(null);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{role:"button",tabIndex:0,"aria-label":"Notifications","aria-expanded":!!r,"aria-controls":"notification-popover","aria-haspopup":"dialog",className:"cursor-pointer",onClick:m,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&m(e)},children:(0,s.jsx)(l.A,{color:"error",variant:"dot",invisible:0===a,children:(0,s.jsx)(i.Hec,{className:"size-4 xxs:size-6"})})}),e?(0,s.jsx)(u.M,{id:"notification-popover",open:r,onClose:p,transformOriginHorizontal:"center",width:"376px",title:"Notifications",headerIcon:(0,s.jsx)(i.Hec,{}),children:(0,s.jsx)(A,{})}):(0,s.jsx)(d.I,{open:!!r,onClose:p,title:"Notifications",children:(0,s.jsx)(A,{})})]})}},98883:(e,t,a)=>{"use strict";a.d(t,{i:()=>m});var r=a(10940),s=a(78642),n=a(96947),l=a.n(n),o=a(62544),i=a(21072),c=a(82887),d=a(13627),u=a(57882);let h=l()(()=>a.e(5332).then(a.bind(a,65332)),{loadableGenerated:{webpack:()=>[65332]},ssr:!1}),m=({classroomId:e})=>{let[t,a]=(0,o.useState)(Date.now()),n=(0,o.useMemo)(()=>e?`admin/classroom/${e}/insight`:null,[e]),{data:l,isLoading:m,error:p,mutate:f}=(0,i.Ay)(n,c.hS,{revalidateOnFocus:!1}),g=(0,o.useCallback)(async()=>{await f(),a(Date.now())},[f]);return m?(0,r.jsx)(s.A,{className:"flex justify-center items-center h-full",children:(0,r.jsx)(h,{value:100})}):p?(0,r.jsx)("div",{children:"Error loading insights. Please try again."}):l?(0,r.jsx)(d.d.Provider,{value:{insights:l,isLoading:m,reloadInsights:g,lastReloadTime:t},children:(0,r.jsx)(u.A,{})}):(0,r.jsx)("div",{children:"No insights available."})}},99994:(e,t,a)=>{"use strict";a.d(t,{H:()=>d});var r=a(10940),s=a(90122),n=a.n(s),l=a(64052),o=a(56152),i=a(81448);function c(e,t){return e===t||e?.startsWith(`${t}/`)}let d=({label:e,items:t,activeHref:a})=>(0,i.h)()?(0,r.jsx)("div",{className:"flex flex-col gap-1 items-center w-full",children:t.map(e=>{let t=c(a,e.href);return(0,r.jsx)(o.rK,{content:e.label,side:"right",sideOffset:8,delayDuration:0,
1children:(0,r.jsx)(n(),{href:e.href,"aria-label":e.label,className:(0,l.cn)("flex items-center justify-center p-2 rounded-lg",t?"bg-softgrey2":"hover:bg-softgrey2"),children:(0,r.jsx)(e.icon,{className:"size-5 shrink-0 fill-black1"})})},e.href)})}):(0,r.jsxs)("div",{className:"flex flex-col items-start w-full",children:[(0,r.jsx)("div",{className:"flex items-center p-2 rounded-lg w-full",children:(0,r.jsx)("p",{className:"flex-1 text-sm font-semibold text-gray-700",children:e})}),(0,r.jsx)("div",{className:"flex flex-col gap-1 items-start w-full",children:t.map(e=>{let t=c(a,e.href);return(0,r.jsxs)(n(),{href:e.href,className:(0,l.cn)("flex gap-2 items-center p-2 rounded-lg w-full",t?"bg-softgrey2":"hover:bg-softgrey2"),children:[(0,r.jsx)(e.icon,{className:"size-5 shrink-0 fill-black1"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-black1",children:e.label})]},e.href)})})]})}},e=>{e.O(0,[4906,122,5302,7267,7536,4465,1359,1250,8357,9229,1772,3460,3234,5754,438,4308,2224,2543,5529,7595,8997,2395,7752,2903,9362,6506,7882,636,6593,8792],()=>e(e.s=89552)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.