1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75165],{217613:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/expert/outlieradmin/tools/discourse_tools",function(){return r(543349)}])},186383:function(e,t,r){"use strict";r.d(t,{J7:function(){return useTimer},uI:function(){return useTimerData}});var n=r(667488),i=r(885115),a=r(828966),o=r(663752),s=r(243553),u=r(470111),l=r(168531),d=r(424565),c=r(973647),m=r(975343),g=r(747910),f=r.n(g);let p=i.createContext({}),useTimer=()=>{let e=(0,i.useContext)(p),[t,r,n]=(0,c.Z)("timer",buildDefaultTimerData());return e.getTimerData?e:{getTimerData:t,setTimerData:r,subscribeTimerData:n}},buildDefaultTimerData=()=>({startTime:Date.now(),lastTime:Date.now(),totalTime:0,serverTimeSpent:0}),useTimerData=()=>{let{getTimerData:e,setTimerData:t,subscribeTimerData:r}=useTimer(),n=(0,a.useSyncExternalStore)(r,e);return[n,t]};t.ZP=e=>(0,u.YI)((0,u.MD)(e)((0,u.$s)("withV2Timer")(t=>{var r,a;let u;let[g,w,T]=(0,c.Z)("timer",buildDefaultTimerData());if(t.timerDisabled)return(0,n.jsx)(p.Provider,{value:{getTimerData:g,setTimerData:w,subscribeTimerData:T},children:(0,n.jsx)(e,{ref:t.forwardedRef,...t})});let v=(0,m.ZP)("enable-timer-for-training-attempt",{},!1),D=1e3*(0,s.gLY)(t.type,t.usePageTracker,!f().isNil(t.courseId)),h=t.usePageTracker,I=v&&t.trainingAttemptId,P=t.loggedUserId&&!t.debugMode&&!t.isCorpMode&&(!t.isTestQuestion||t.isScaleStudio)&&!t.isCustomerReviewMode,y=!!t.courseId&&!(null===(r=t.training)||void 0===r?void 0:r.isLoading),E=I||P||h||y,_=new URLSearchParams(window.location.search),k=null!==(a=_.get("qaOperationId"))&&void 0!==a?a:void 0,b=(0,i.useRef)(new Date),S=(0,i.useCallback)(()=>{b.current=new Date},[]),x=f().isNil(t.courseId)?D:12e4,active=()=>!!b.current&&Date.now()-b.current.getTime()<x,R=(0,l.tQ)(),Z=(0,i.useCallback)(async()=>{let e,r;let n=g(),i=new Date(n.startTime).getDay()!==new Date().getDay();if(w({startTime:i?Date.now():n.startTime,lastTime:Date.now(),totalTime:n.totalTime+Date.now()-n.lastTime,serverTimeSpent:n.serverTimeSpent}),!E||(h?(e=R,r="page"):y?(e=t.courseId,r="course"):(e=I?t.trainingAttemptId:t._id,r="tick"),t.isScaleStudio&&t.isTestQuestion&&(e=t.trainingAttemptId),!e))return;let a="internal/timer/".concat(r,"/").concat(e),s={active:active()};h&&(s.pageType=t.pageType);try{let e=await (0,o.ZP)(null,a,{method:"PUT",body:s,query:{project:d.in.projectId,auditBatchId:d.in.auditBatchId,pageUrl:window.location.pathname,qaOperationId:k}});if("tick"===r){let{timeSpent:t,paused:r}=e;w({...n,serverTimeSpent:Number(t),paused:!!r})}}catch(e){}if(t.childIds)for(let e of t.childIds)e&&(0,o.ZP)(null,"internal/timer/".concat(r,"/").concat(e),{method:"PUT",body:s,query:{project:d.in.projectId,auditBatchId:d.in.auditBatchId,pageUrl:window.location.pathname,qaOperationId:k}})},[E,t._id,t.pageType,R,k,g,w]),C=(0,i.useCallback)(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];clearTimeout(u),u=setTimeout(()=>Z.apply(this,t),D)},[Z,D]);return(0,i.useEffect)(()=>{if(!E)return;let handleBeforeUnload=()=>(C(),null);window.addEventListener("mousemove",S),window.addEventListener("keydown",S),window.addEventListener("beforeunload",handleBeforeUnload),Z();let e=window.setInterval(Z,D);return()=>{window.removeEventListener("mousemove",S),window.removeEventListener("keydown",S),window.removeEventListener("beforeunload",handleBeforeUnload),C(),clearInterval(e)}},[Z,C,S,E,D]),(0,n.jsx)(p.Provider,{value:{getTimerData:g,setTimerData:w,subscribeTimerData:T},children:(0,n.jsx)(e,{ref:t.forwardedRef,...t})})})))},865554:function(e,t,r){"use strict";r.d(t,{k:function(){return DataEngineRootServer_getInitialProps}});var n=r(381124),i=r(90272);async function getInitialProps(e){if(!e.user)return;let t=await (0,n.Z)(e,"internal/team/settings"),r=e.user.teamRole===i.TeamRole.Admin?await (0,n.Z)(e,"internal/user/api_keys"):{test:{apiKeys:[]}};return{customerKeys:r,customerTeamSettings:t}}let DataEngineRootServer=()=>null;async function DataEngineRootServer_getInitialProps(e){return await getInitialProps(e)}DataEngineRootServer.getPageConfig=()=>({user:{required:!1}}),DataEngineRootServer.getInitialProps=DataEngineRootServer_getInitialProps},543349:function(e,t,r){"use strict";r.r(t);var n=r(409992);t.default=n.Z},409992:function(e,t,r){"use strict";r.d(t,{R:function(){return f}});
1var n=r(667488),i=r(806049),a=r(186383),o=r(280782),s=r(78631),u=r(481269),l=r(865554),d=r(133434),c=r(221706),m=r(162533);let g="Discourse tools";let DiscourseToolsPage=class DiscourseToolsPage extends m.Z{render(){return(0,n.jsx)(s.aH,{client:u.Ehq,children:(0,n.jsx)(c.g,{title:g,...this.props,children:(0,n.jsx)(o.D,{editable:!1})})})}};DiscourseToolsPage.getInitialProps=l.k;let f={type:i.r8.Global,title:g,description:g,onToolSelect:(e,t)=>(0,d.uk)("/remoadmin/tools/discourse_tools",{},t)};t.Z=(0,a.ZP)(DiscourseToolsPage)},162533:function(e,t,r){"use strict";r.d(t,{Z:function(){return AdminDashboardPage}});var n=r(885115);let AdminDashboardPage=class AdminDashboardPage extends n.Component{static getPageConfig(){return{user:{kinds:["worker","expert"],required:!0}}}}}},function(e){e.O(0,[50954,73795,50515,44147,45439,98010,55,43579,47732,30729,42610,64369,90376,17319,69007,77355,77598,81823,15281,82266,80732,53584,66621,82771,61705,88695,21706,80782,49774,92888,40179],function(){return e(e.s=217613)}),_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.