PageSourceSearch

https://schoolhouse.world/_next/static/chunks/pages/admin/policy-violations/[id]-b043727869e1748d.js

js schoolhouse.world collected 2026-09-24 09:11:28 UTC 16,960 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9523],{2579:(e,t,i)=>{"use strict";i.d(t,{$c:()=>v,Jn:()=>k,O_:()=>g,Vh:()=>w,at:()=>h,uc:()=>b,uo:()=>A});var n=i(81618),o=i(93968),s=i(16229),l=i(57396),r=i(89435),a=i(25644),c=i(14232),u=i(13485),d=i(39893);let[h,p,m,f]=(0,u.D)();function b(e){let{defaultIndex:t,onChange:i,index:o,isManual:s,isLazy:l,lazyBehavior:r="unmount",orientation:a="horizontal",direction:u="ltr",...d}=e,[h,p]=(0,c.useState)(t??0),[f,b]=(0,n.i)({defaultValue:t??0,value:o,onChange:i});(0,c.useEffect)(()=>{null!=o&&p(o)},[o]);let g=m(),y=(0,c.useId)(),v=e.id??y;return{id:`tabs-${v}`,selectedIndex:f,focusedIndex:h,setSelectedIndex:b,setFocusedIndex:p,isManual:s,isLazy:l,lazyBehavior:r,orientation:a,descendants:g,direction:u,htmlProps:d}}let[g,y]=(0,s.q)({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function v(e){let{focusedIndex:t,orientation:i,direction:n}=y(),o=p(),s=(0,c.useCallback)(e=>{let s=()=>{let e=o.nextEnabled(t);e&&e.node?.focus()},l=()=>{let e=o.prevEnabled(t);e&&e.node?.focus()},r="horizontal"===i,a="vertical"===i,c={["ltr"===n?"ArrowLeft":"ArrowRight"]:()=>r&&l(),["ltr"===n?"ArrowRight":"ArrowLeft"]:()=>r&&s(),ArrowDown:()=>a&&s(),ArrowUp:()=>a&&l(),Home:()=>{let e=o.firstEnabled();e&&e.node?.focus()},End:()=>{let e=o.lastEnabled();e&&e.node?.focus()}}[e.key];c&&(e.preventDefault(),c(e))},[o,t,i,n]);return{...e,role:"tablist","aria-orientation":i,onKeyDown:(0,l.H)(e.onKeyDown,s)}}function w(e){let{isDisabled:t=!1,isFocusable:i=!1,...n}=e,{setSelectedIndex:s,isManual:r,id:a,setFocusedIndex:c,selectedIndex:u}=y(),{index:h,register:p}=f({disabled:t&&!i}),m=h===u;return{...(0,d.I)({...n,ref:(0,o.Px)(p,e.ref),isDisabled:t,isFocusable:i,onClick:(0,l.H)(e.onClick,()=>{s(h)})}),id:$(a,h),role:"tab",tabIndex:m?0:-1,type:"button","aria-selected":m,"aria-controls":S(a,h),onFocus:t?void 0:(0,l.H)(e.onFocus,()=>{c(h);let e=t&&i;r||e||s(h)})}}let[x,_]=(0,s.q)({});function A(e){let{id:t,selectedIndex:i}=y(),n=(0,r.a)(e.children).map((e,n)=>(0,c.createElement)(x,{key:e.key??n,value:{isSelected:n===i,id:S(t,n),tabId:$(t,n),selectedIndex:i}},e));return{...e,children:n}}function k(e){let{children:t,...i}=e,{isLazy:n,lazyBehavior:o}=y(),{isSelected:s,id:l,tabId:r}=_(),u=(0,c.useRef)(!1);s&&(u.current=!0);let d=(0,a.q)({wasSelected:u.current,isSelected:s,enabled:n,mode:o});return{tabIndex:0,...i,children:d?t:null,role:"tabpanel","aria-labelledby":r,hidden:!s,id:l}}function $(e,t){return`${e}--tab-${t}`}function S(e,t){return`${e}--tabpanel-${t}`}},8818:(e,t,i)=>{"use strict";i.d(t,{A:()=>P});var n=i(18153),o=i(73156),s=i(76032),l=i(2791),r=i(91921),a=i(84940),c=i(24836),u=i(65576),d=i(99776),h=i(12899),p=i(22279),m=i(58522),f=i(32985),b=i(97491),g=i(55978),y=i(69445),v=i(12647),w=i(44517),x=i(52276),_=i(97460),A=i(14232),k=i(41954),$=i(46304),S=i(46860),C=i(24294);function N(e,t){let i=0;for(let n of Object.keys(e)){let o=C.T[n];o.isPositive===t&&(i+=o.multiplier*e[n])}return Math.round(i)}function Y({definition:e,submetric:t,displayName:i}){let a=e.isPositive?"success.fg":"error.fg";return(0,n.Y)(o.m,{hasArrow:!0,placement:"right",label:e.tooltip(i,t),children:(0,n.FD)(s.B,{direction:"row",alignItems:"center",justifyContent:"space-between",paddingY:"4px",children:[(0,n.FD)(s.B,{direction:"row",gap:"8px",alignItems:"center",children:[(0,n.FD)(l.vw,{fontWeight:"bold",width:"28px",display:"flex",justifyContent:"center",paddingX:"4px",size:"sm",color:"fg.muted",userSelect:"none",children:["x ",e.multiplier]}),(0,n.Y)(_.g,{icon:e.icon,color:(0,k.A)(a),width:"15px"}),(0,n.Y)(r.E,{fontWeight:"bold",color:a,children:t})]}),(0,n.Y)(_.g,{icon:w.iW_,color:(0,k.A)("fg.muted"),width:"15px"})]})})}function T({trustSubmetrics:e,isPositive:t,displayName:i}){return(0,n.Y)(n.FK,{children:Object.keys(e).filter(e=>C.T[e].isPositive===t).map(t=>(0,n.Y)(Y,{definition:C.T[t],submetric:e[t],displayName:i},t))})}function D({trustMetric:e,isPositive:t}){let i=t?"success.fg":"error.fg";return(0,n.FD)(a.o,{fontWeight:"bold",color:i,_selected:{color:i,borderBottomWidth:"2px",borderBottomColor:i},cursor:"pointer",children:[t?"+":"-",e]})}function P({userReference:e,hideUserId:t=!1}){let{id:i,displayName:l,trustSubmetrics:a=null}=e,{isOpen:w,onClose:C,onToggle:Y}=(0,c.j)(),[q,E]=(0,A.useState)(0),F=(0,n.FD)(S.A,{href:(0,$.hTK)(`user/${i}`),width:"max-content",children:[l,t?null:` (#${i})`]});if(null==a)return F;let j=N(a,!0),B=N(a,!1),R=e=>()=>{E(+!e),Y()};return(0,n.FD)(s.B,{direction:"row",alignItems:"center",gap:"12px",children:[F,(0,n.FD)(u.A,{isOpen:w,onClose:C,children:[(0,n.Y)(d.W,{children:(0,n.FD)(s.B,{direction:"row",cursor:"pointer",gap:"0px",children:[(0,n.FD)(r.E,{onClick:R(!0),paddingRight:"8px",fontWeight:"bold",color:"success.fg",children:["+",j]}),(0,n.FD)(r.E,{onClick:R(!1),fontWeight:"bold",color:"error.fg",children:["-",B]})]})}),(0,n.FD)(h.h,{width:"200px",children:[(0,n.Y)(p.R,{}),(0,n.Y)(m.e,{marginTop:"8px",paddingBottom:"0px",children:(0,n.FD)(f.t,{isFitted:!0,index:q,onCh
1ange:e=>E(e),children:[(0,n.FD)(b.w,{children:[(0,n.Y)(D,{trustMetric:j,isPositive:!0}),(0,n.Y)(D,{trustMetric:B,isPositive:!1})]}),(0,n.FD)(g.T,{cursor:"default",children:[(0,n.Y)(y.K,{padding:"8px",children:(0,n.Y)(T,{trustSubmetrics:a,isPositive:!0,displayName:l})}),(0,n.Y)(y.K,{padding:"8px",children:(0,n.Y)(T,{trustSubmetrics:a,isPositive:!1,displayName:l})})]})]})}),(0,n.Y)(v.q,{})]})]}),(0,n.Y)(o.m,{label:"These metrics are experimental. Users with a significant positive score should still be investigated!",placement:"right",hasArrow:!0,children:(0,n.Y)(_.g,{icon:x.QJT,width:"15px",color:(0,k.A)("gray.fg"),cursor:"pointer"})})]})}},12647:(e,t,i)=>{"use strict";i.d(t,{q:()=>r});var n=i(37876),o=i(75255),s=i(29637),l=i(90479);let r=(0,i(11842).R)(function(e,t){let{onClose:i}=(0,s.C_)(),r=(0,s.jm)();return(0,n.jsx)(l.J,{size:"sm",onClick:i,className:(0,o.cx)("chakra-popover__close-btn",e.className),__css:r.closeButton,ref:t,...e})});r.displayName="PopoverCloseButton"},16542:(e,t,i)=>{"use strict";function n({type:e,body:t}){return null==e||null==t?null:{type:e,body:t}}i.d(t,{A:()=>n})},18144:(e,t,i)=>{"use strict";i.d(t,{A:()=>m});var n=i(18153),o=i(2791),s=i(76032),l=i(10929),r=i(14232),a=i(48369),c=i(52038),u=i(46862),d=i(65956);let h="hide-author";function p({label:e,onSelect:t}){return(0,n.Y)(o.vw,{colorScheme:"blue",cursor:"pointer",onClick:t,children:e})}function m({userDisplayName:e,initialValues:t=null,onSubmit:i,showModal:o,onClose:f,templates:b}){let g=null!=t,[y,v]=(0,r.useState)(0),[w,x]=(0,r.useState)(null),_=(0,r.useCallback)(e=>{var t;x((t=e.content,(0,a.A)(t)?t:{serialization_method:"plain_text",content:t})),v(e=>e+1)},[]),A=w??t?.content??void 0,k=r.useMemo(()=>[{label:"What message would you like to send this user?",sublabel:"This message will be displayed to users the next time they log onto Schoolhouse, as a  blocking modal.",type:"rich-text",initialValue:A,name:"content",required:!0,size:6},{label:"What acknowledgment text would you like this user to submit?",sublabel:"If provided, users will have to type this in before acknowledging the message. If you don't want users to acknowledge, you can leave this blank.",type:"text",initialValue:null==t?"I understand":t.acknowledgmentText,name:"acknowledgment_text",required:!1,size:6},...g?[]:[{label:"Would you like to hide your name?",type:"multi-checkbox",name:"hide_author",options:[{value:h,label:`Hide my name from this message. It will appear as coming from ${c.CP}, and the recipient will be offered support chat instead of a DM with me.`}],required:!1,size:6}]],[A,t,g]),$=(0,r.useCallback)(()=>{x(null),v(0),f()},[f]),S=(0,r.useCallback)(async e=>{let t=`${e.acknowledgment_text}`.trim();await i({content:e.content,acknowledgmentText:0===t.length?null:t,hideAuthor:Array.isArray(e.hide_author)&&e.hide_author.some(e=>e===h)}),$()},[i,$]);return(0,n.Y)(d.A,{size:"2xl",open:o,onClose:$,title:g?`Edit User Admin Message for ${e}`:`Send User Admin Message to ${e}`,body:()=>(0,n.FD)(s.B,{direction:"column",spacing:"24px",children:[b.length>0?(0,n.Y)(l.B,{spacing:"8px",children:b.map(e=>(0,n.Y)(l.Q,{children:(0,n.Y)(p,{label:e.label,onSelect:()=>_(e)})},e.label))}):null,(0,n.Y)(u.A,{name:`Admin${g?"Edit":"Send"}UserMessage`,blocks:k,onSubmit:S},y)]})})}},22279:(e,t,i)=>{"use strict";i.d(t,{R:()=>a});var n=i(37876),o=i(75255),s=i(29637),l=i(85696);let r=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function a(e){let{bg:t,bgColor:i,backgroundColor:a,shadow:c,boxShadow:u,shadowColor:d,...h}=e,{getArrowProps:p,getArrowInnerProps:m}=(0,s.C_)(),f=(0,s.jm)();return(0,n.jsx)(l.B.div,{...p(),className:"chakra-popover__arrow-positioner",children:(0,n.jsx)(l.B.div,{className:(0,o.cx)("chakra-popover__arrow",e.className),...m(h),__css:{"--popper-arrow-shadow-color":r("colors",d),"--popper-arrow-bg":r("colors",t??i??a),"--popper-arrow-shadow":r("shadows",c??u),...f.arrow}})})}a.displayName="PopoverArrow"},24294:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});var n=i(44517),o=i(52276),s=i(19515),l=i(55720);let r={"academic-sessions-hosted":{isPositive:!0,multiplier:1,icon:n.ZQp,tooltip:(e,t)=>`${e} has hosted ${(0,s.td)(t,"academic session")}.`,query:l.Ay.countAcademicSessionsHosted},"minutes-spoken-in-academic-sessions":{isPositive:!0,multiplier:1,icon:n.TOj,tooltip:(e,t)=>`${e} has spoken for ${(0,s.td)(t,"minute")} as a learner in academic sessions.`,query:l.Ay.countMinutesSpokenInAcademicSessions},"unique-tutors-rated":{isPositive:!0,multiplier:1,icon:n.yy,tooltip:(e,t)=>`${e} has given ${(0,s.td)(t,"unique tutor")} a rating after their session.`,query:l.Ay.countUniqueTutorsRated},"unique-learners-with-positive-rating":{isPositive:!0,multiplier:1,icon:n.Qpm,tooltip:(e,t)=>`${(0,s.td)(t," unique learner")} ${1===t?"has":"have"} given ${e} a positive rating after a session they hosted.`,query:l.Ay.countUniqueLearnersWithPositiveRating},"unique-certifications":{isPositive:!0,multiplier:1,icon:n.Zsp,tooltip:(e,t)=>`${e} has earned ${(0,s.td)(t,"certification")}.`,query:l.Ay.countCertifications},"yellow-content-flags":{isPositive:!1,multiplier:1,icon:n.s6x,tooltip:(e,t)=>`${(0,s.td)(t,"piece")} of content from ${e} ${1===t?"has":"have"} been assigned a yellow flag.`,query:e=>l.Ay.countContentFlags(e,"yellow")},"red-content-flags":{isPositive:!1,multiplier:2,icon:o.s6x,tooltip:(e,t)=>`${(0,s.td)(t,"piece")} of content from ${e} ${1===t?"has":"have"} been assigned a red flag.`,query:e=>l.Ay.countContentFlags(e,"red")},"policy-violations-low":{isPositive:!1,multiplier:1,icon:n.xGW,tooltip:(e,t)=>`${e} has been the subject of ${(0,s.td)(t,"policy violation")} with a low urgency.`,query:e=>l.Ay.countPolicyViolations(e,["low"])},"policy-violations-med-or-higher":{isPositive:!1,multiplier:5,icon:o.xGW,tooltip:(e,t)=>`${e} has been the subject of ${(0,s.td)(t,"policy violation")} with an urgency of medium or higher.`,query:e=>l.Ay.countPolicyViolations(e,["medium","high"])},"silent-academic-sessions":{isPositive:!1,multiplier:1,icon:n.R3,tooltip:(e,t)=>`${e} has not spoken or typed in the chat for the whole time in ${(0,s.td)(t,"session")}.`,query:l.Ay.countAcademicSessionsWithNoTalkOrChat}}},32985:(e,t,i)=>{"use strict";i.d(t,{e:()=>p,t:()=>m});var n=i(37876),o=i(29185),s=i(16229),l=i(75255),r=i(14232),a=i(2579),c=i(11842),u=i(66394),d=i(85696);let[h,p]=(0,s.q)({name:"TabsStylesContext",errorMessage:"useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Tabs />\" "}),m=(0,c.R)(function(e,t){let i=(0,u.o)("Tabs",e),{children:s,className:c,...p}=(0,o.M)(e),{htmlProps:m,descendants:f,...b}=(0,a.uc)(p),g=(0,r.useMemo)(()=>b,[b]),{isFitted:y,...v}=m,w={position:"relative",...i.root};return(0,n.jsx)(a.at,{value:f,children:(0,n.jsx)(a.O_,{value:g,children:(0,n.jsx)(h,{value:i,children:(0,n.jsx)(d.B.div,{className:(0,l.cx)("chakra-tabs",c),ref:t,...v,__css:w,children:s})})})})});m.displayName="Tabs"},37012:(e,t,i)=>{"use strict";i.d(t,{A:()=>p});var n=i(18153),o=i(50485),s=i(38890),l=i(44517),r=i(97460),a=i(14232),c=i(9496),u=i(41130),d=i(47808),h=i(18144);function p({userId:e,userDisplayName:t,safetyReportId:i=null,showIconButton:m=!1,associateSession:f,templates:b,variant:g}){let y=(0,u._)(),[v,w]=a.useState(!1),x=(0,a.useCallback)(async({content:t,acknowledgmentText:n,hideAuthor:o})=>{await c.Vf.admin_createUserAdminMessage({safetyReportId:i,recipientUserId:e,acknowledgmentText:n,hideAuthor:o,content:t,associateSession:f}),y({title:`Successfully sent message to User#${e}`,status:"success"}),w(!1)},[e,y,i,f]);return(0,n.FD)(n.FK,{children:[(0,n.Y)(h.A,{showModal:v,onClose:()=>w(!1),onSubmit:x,userDisplayName:t,templates:b}),m?(0,n.Y)(d.A,{content:"Send admin message",children:(0,n.Y)(o.K,{variant:"icon-outline","aria-label":"Send admin message",onClick:()=>
1w(!0),icon:(0,n.Y)(r.g,{icon:l._6d})})}):(0,n.Y)(s.$,{variant:g,onClick:()=>w(!0),children:"Send Admin Message"})]})}},48944:(e,t,i)=>{"use strict";i.d(t,{o:()=>o});var n=i(24294);function o(e,t){let i={};return Object.keys(n.T).forEach(o=>{i[o]=Math.round(e(n.T[o].query(t))??0)}),i}},54982:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__N_SSP:()=>k,default:()=>$});var n=i(18153),o=i(42720),s=i(38890),l=i(76032),r=i(82736),a=i(2791),c=i(44517),u=i(97460),d=i(89099),h=i(38009),p=i(75737),m=i(54443),f=i(6662),b=i(61110),g=i(46304),y=i(7645),v=i(38085),w=i(6433),x=i(49783),_=i(46860);let A=(0,b.A)(function(){let e=(0,d.useRouter)(),t=(0,m.I)(),i=Number.parseInt(`${e.query.id}`,10)??0,b=t.one(h.A.where({id:i,include:[{association:"User",required:!1},{association:"Dispute",required:!1}]})),A=t(p.A.getUserAdminMessageTemplates())??[],k=(0,v.s)(b),{type:$,escalatedAt:S,resolvedAt:C}=k;return(0,n.Y)(x.A,{title:`Policy Violation #${i}`,children:(0,n.FD)(o.m,{children:[(0,n.Y)(_.A,{href:(0,g.hTK)("policy-violations"),children:(0,n.Y)(s.$,{variant:"ghost",leftIcon:(0,n.Y)(u.g,{icon:c.Wzs}),children:"Back to Policy Violations"})}),(0,n.FD)(l.B,{direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},py:"16px",mb:"32px",spacing:"16px",children:[(0,n.FD)(r.D,{size:"2xl",children:["Policy Violation #",i]}),(0,n.Y)(a.vw,{colorScheme:"gray",children:f.vr[$]}),null!=S?(0,n.Y)(y.A,{status:null!=C?"resolved":"escalated"}):null]}),(0,n.Y)(w.A,{details:k,templates:A})]})})},{userRoles:["admin:safety"]});var k=!0;let $=A},55978:(e,t,i)=>{"use strict";i.d(t,{T:()=>c});var n=i(37876),o=i(75255),s=i(32985),l=i(2579),r=i(11842),a=i(85696);let c=(0,r.R)(function(e,t){let i=(0,l.uo)(e),r=(0,s.e)();return(0,n.jsx)(a.B.div,{...i,width:"100%",ref:t,className:(0,o.cx)("chakra-tabs__tab-panels",e.className),__css:r.tabpanels})});c.displayName="TabPanels"},58522:(e,t,i)=>{"use strict";i.d(t,{e:()=>a});var n=i(37876),o=i(75255),s=i(29637),l=i(11842),r=i(85696);let a=(0,l.R)(function(e,t){let{getBodyProps:i}=(0,s.C_)(),l=(0,s.jm)();return(0,n.jsx)(r.B.div,{...i(e,t),className:(0,o.cx)("chakra-popover__body",e.className),__css:l.body})});a.displayName="PopoverBody"},61110:(e,t,i)=>{"use strict";i.d(t,{A:()=>o});var n=i(16425);function o(e,t){return null!=t.userRoles&&t.userRoles.forEach(e=>{if(!e.startsWith("admin:"))throw Error("Cannot expose admin page to non-admins!")}),(0,n.A)(e,{authScopes:t.authScopes,userRoles:t.userRoles,onboardingUsers:"disallowed"})}},69445:(e,t,i)=>{"use strict";i.d(t,{K:()=>c});var n=i(37876),o=i(75255),s=i(32985),l=i(2579),r=i(11842),a=i(85696);let c=(0,r.R)(function(e,t){let i=(0,l.Jn)({...e,ref:t}),r=(0,s.e)();return(0,n.jsx)(a.B.div,{outline:"0",...i,className:(0,o.cx)("chakra-tabs__tab-panel",e.className),__css:r.tabpanel})});c.displayName="TabPanel"},83426:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/policy-violations/[id]",function(){return i(54982)}])},84940:(e,t,i)=>{"use strict";i.d(t,{o:()=>u});var n=i(37876),o=i(67118),s=i(75255),l=i(32985),r=i(2579),a=i(11842),c=i(85696);let u=(0,a.R)(function(e,t){let i=(0,l.e)(),a=(0,r.Vh)({...e,ref:t}),u=(0,o.H2)({outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...i.tab});return(0,n.jsx)(c.B.button,{...a,className:(0,s.cx)("chakra-tabs__tab",e.className),__css:u})});u.displayName="Tab"},85637:(e,t,i)=>{"use strict";i.d(t,{$:()=>l});var n=i(30786),o=i(7574),s=i(16542);function l({type:e,body:t}){let i=(0,s.A)({type:e,body:t});return null==i?o.Z:"embed-v1"===i.type?"assessment"===i.body.embed?(0,n.A)(e=>e.text("[EMBEDDED ASSESSMENT]",{italic:!0})):(0,n.A)(e=>e.text("[EMBEDDED RESOURCE]",{italic:!0})):i.body}},97491:(e,t,i)=>{"use strict";i.d(t,{w:()=>u});var n=i(37876),o=i(67118),s=i(75255),l=i(32985),r=i(2579),a=i(11842),c=i(85696);let u=(0,a.R)(function(e,t){let i=(0,r.$c)({...e,ref:t}),a=(0,l.e)(),u=(0,o.H2)({display:"flex",...a.tablist});return(0,n.jsx)(c.B.div,{...i,className:(0,s.cx)("chakra-tabs__tablist",e.className),__css:u})});u.displayName="TabList"}},e=>{e.O(0,[6425,1349,636,6593,8792],()=>e(e.s=83426)),_N_E=e.O()}]);
2//# sourceMappingURL=[id]-b043727869e1748d.js.map

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.