1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d9ce9a35-40af-5e6e-817b-7313a26cf3c2")}catch(e){}}(); 3(self.webpackChunk_genomawork_genoma_front_v1=self.webpackChunk_genomawork_genoma_front_v1||[]).push([[4650],{64650:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var o=n(53747),r=n(19526),a=n(65043),s=n(71373),i=n(80234),c=n(7168),u=n(96356),d=n(83119),l=n(60253),m=n(98912),p=n(70579);const h="BAR2";class g extends a.Component{constructor(){super(...arguments),this.state={token:"",jobappid:""},this.initGame=()=>{const e={game_code:h};this.props.dataActions.sendData(this.props.token,"gamesandtests/gamecompleteness/?format=json",JSON.stringify(e),"post")},this.postData=e=>{const t=JSON.stringify({game_code:h,job_application_id:this.state.jobappid,game_outcome:e});return this.setState({gameSubmit:t}),(0,m.l)(this.props.actions.sendGameData,this.state.token,"gamesandtests/gameresponse/",t)}}componentDidMount(){this.props.dataActions.fetchAndReturn(this.props.token,`/api/v1/gamesandtests/gamecompleteness/?format=json&game_code=${h}&job_application_id=${this.props.match.params.jobappid}`,"get").then(e=>{e.body.incompleted_game&&this.props.history.goBack()}),this.setState({jobappid:this.props.match.params.jobappid,token:this.props.token})}render(){return(0,p.jsx)("div",{className:"protected full-height",children:(0,p.jsx)(s.ev,{tour:i.Ay,callbackStart:this.initGame,callback:this.postData,language:d.A.language.split("-")[0],goBack:()=>this.props.history.goBack()})})}}const f=(0,u.Ng)(e=>({gameOutcomeResponse:e.games.gameOutcomeResponse,isSendingGameOutcome:e.games.isSendingGameOutcome,gameOutcomeRecieved:e.games.gameOutcomeRecieved,gameOutcomeError:e.games.gameOutcomeError,data:e.data.data,token:e.auth.token,userID:e.auth.userID}),e=>({actions:(0,c.zH)(o,e),dataActions:(0,c.zH)(r,e),dispatch:e}))((0,l.A)(g))},60253:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(23816),r=n(1206),a=n(64124),s=n(65043),i=n(63574),c=n(98158),u=n(83119),d=n(8738),l=n(70579);const{Text:m}=r.A,p=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];(0,s.useEffect)(()=>{if(n)return e.forEach(e=>o.addEventListener(e,t,r)),()=>e.forEach(e=>o.removeEventListener(e,t,r))},[n])},h=e=>new Promise((t,n)=>{const o=document.createElement("video");o.muted=!0,o.playsInline=!0,o.srcObject=e;const r=()=>n(new Error("canvas capture failed"));o.onerror=r,o.onloadedmetadata=()=>{o.play().then(()=>{const e=document.createElement("canvas");e.width=o.videoWidth,e.height=o.videoHeight;const n=e.getContext("2d");if(!n)return r();n.drawImage(o,0,0),e.toBlob(e=>e?t(e):r(),"image/jpeg",.92)}).catch(r)}}),g=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){var r,g,f;const _=t?n.jobappId:null===(r=n.match)||void 0===r||null===(g=r.params)||void 0===g?void 0:g.jobappid,v=(t?"/CUTE":null===(f=n.match)||void 0===f?void 0:f.path).split("/"),y=v[v.length-1],b=t?n.cuteId:null,{token:A,dataActions:k,dispatch:w,userID:j}=n,[F,x]=(0,s.useState)(!0),[E,T]=(0,s.useState)({}),[R,C]=(0,s.useState)(t),[D,S]=(0,s.useState)(!1),$=(0,s.useRef)(!1),I=(0,s.useRef)(!0),O
3=(0,s.useRef)(!1),B=(0,s.useRef)(null),M=(0,s.useRef)(0),G=(0,s.useRef)(!1),P=e=>{"string"==typeof e&&e.includes("gameresponse")&&(O.current=!0)},L=(0,s.useMemo)(()=>({...k,sendData:function(){const e=arguments.length<=1?void 0:arguments[1];return"string"==typeof e&&e.includes("gamecompleteness")&&C(!0),P(e),k.sendData(...arguments)},fetchAndReturn:function(){return P(arguments.length<=1?void 0:arguments[1]),k.fetchAndReturn(...arguments)}}),[k]),N=(0,s.useMemo)(()=>{const e=n.actions;if(!e)return e;const t=e=>"function"==typeof e?function(){return P(arguments.length<=1?void 0:arguments[1]),e(...arguments)}:e;return{...e,sendGameData:t(e.sendGameData),fetchAndReturn:t(e.fetchAndReturn)}},[n.actions]),z=(0,s.useMemo)(()=>{const e=n.stopAntiCheating;return"function"!=typeof e?e:()=>{O.current=!0,e()}},[n.stopAntiCheating]),H=e=>{const n={game_code:y,cheat_type:e};t&&(n.cute_id=b),O.current||k.fetchAndReturn(A,`/api/v1/gamesandtests/jobapplications/${_}/cheats/`,"POST",n)},U=()=>{G.current||(G.current=!0,H("AUTORD"))},q=async()=>{let e;try{e=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});const t=e.getVideoTracks()[0];let n;try{n="undefined"!=typeof ImageCapture?await new ImageCapture(t).takePhoto():await h(e)}catch{n=await h(e)}return t.stop(),n}catch(t){if(e&&e.getTracks().forEach(e=>e.stop()),$.current)return;$.current=!0,a.A.confirm({icon:(0,l.jsx)(o.A,{style:{color:"#FF4D4F"}}),title:(0,l.jsx)(m,{strong:!0,style:{color:"#FF4D4F"},children:u.A.t("anticheat__camera_error_title")}),content:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[(0,l.jsx)(m,{children:u.A.t("anticheat__camera_error_body_1")}),(0,l.jsx)(m,{children:u.A.t("anticheat__camera_error_body_2")})]}),okText:u.A.t("commons__continue"),cancelText:u.A.t("commons__back"),onCancel:()=>{w((0,c.VC)(`/jobapplication/${_}/`))}})}},W=async e=>{if(await new Promise(e=>{if("visible"===document.visibilityState)return void e();const t=()=>{"visible"===document.visibilityState&&(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t)}),!I.current||O.current)return;const n=await q();if(!n||!I.current)return;const o=`/api/v1/gamesandtests/jobapplications/${_}/screenshots/`,r=new FormData;t?r.append("file",n,`${j}-${y}-${b}-${e}.jpg`):r.append("file",n,`${j}-${y}-${e}.jpg`),r.append("game_code",y),r.append("cute_id",b);try{(await fetch(`${i.A}${o}`,{method:"PATCH",headers:{Authorization:`Token ${A}`},body:r})).ok}catch(e){}},J=e=>{var t,n;return null!==(t=E[e])&&void 0!==t?t:null===(n=E.security)||void 0===n?void 0:n[e]},V=J("automated_response_detection");p(["copy","cut","paste"],e=>e.preventDefault(),J("copy_paste_restriction")),p(["click","pointerdown","keydown","input"],e=>{K(e)&&(M.current+=1,M.current>=2&&U())},V,document,!0),p(["keydown","keyup"],e=>S(e.metaKey),J("screenshot_restriction")),p(["blur"],()=>S(!1),J("screenshot_restriction"),window),p(["blur","focus"],e=>{clearTimeout(B.current),"blur"!==e.type||O.current||(B.current=setTimeout(()=>{!I.current||O.current||document.hasFocus()||H("WINTAB")},1500))},!d.Fr&&J("tab_change_detection"),window),p(["visibilitychange"],()=>{clearTimeout(B.current),"hidden"===document.visibilityState&&(B.current=setTimeout(()=>{I.current&&!O.current&&H("WINTAB")},1500))},d.Fr&&J("tab_change_detection")),p(["fullscreenchange","webkitfullscreenchange"],()=>{document.fullscreenElement||document.webkitFullscreenElement||O.current||setTimeout(()=>{I.current&&!O.current&&H("FULLSC")},500)},!d.Fr&&J("fullscreen_exit_detection"));const K=e=>{if(!1===e.isTrusted)return!0;const t=navigator.userActivation;return"click"===e.type&&Boolean(t)&&!1===t.isActive};return(0,s.useEffect)(()=>()=>{I.current=!1,clearTimeout(B.current)},[]),(0,s.useEffect)(()=>{if(!R||!E.with_screenshot||!E.screenshot_candidate_permission)return;const e=(E.time_estimated?60*E.time_estimated*1e3:48e4)/3,t=Array.from({length:3},(t,n)=>{const o=Math.max(0,n*e+Math.random()*e);return setTimeout(()=>W(n),o)});return()=>t.forEach(clearTimeout)},[E,R]),(0,s.useEffect)(()=>{V&&(()=>{const e=window;return!0===navigator.webdriver||/HeadlessChrome/i.test(navigator.userAgent)||!!(e.__webdriver_evaluate||e.__selenium_evaluate||e.__webdriver_script_function||e.__driver_evaluate||e.__fxdriver_evaluate||e._phantom||e.callPhantom||e.__nightmare||e.domAutomation||e.domAutomationController||e.Cypress)})()&&U()},[V]),(0,s.useEffect)(()=>{!d.Fr&&J("fullscreen_exit_detection")&&R&&(()=>{if(!document.fullscreenEnabled)return;const e=document.documentElement,t=e.requestFullscreen||e.webkitRequestFullscreen||e.msRequestFullscreen;try{const n=null==t?void 0:t.call(e);n&&"function"==typeof n.catch&&n.catch(()=>{})}catch(e){}})()},[E,R]),(0,s.useEffect)(()=>{x(!0),k.fetchAndReturn(A,`/api/v1/gamesandtests/jobapplications/${_}/security/?game_code=${y}`).then(e=>{200===e.status&&T(e.body)}).finally(()=>{x(!1)})},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e,{loading:F,...n,dataActions:L,actions:N,stopAntiC
3heating:z}),D&&(0,l.jsx)("div",{style:{position:"fixed",inset:0,zIndex:2147483647,backgroundColor:"#1F1F1F",display:"flex",alignItems:"center",justifyContent:"center",padding:"2rem",textAlign:"center"},children:(0,l.jsx)(m,{style:{color:"#FFFFFF",fontSize:18},children:u.A.t("anticheat__screenshot_blocked")})})]})}}},98912:(e,t,n)=>{n.d(t,{l:()=>a});var o=n(48193),r=n(83119);const a=function(e,t,n,a){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"post",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:5e3;return new Promise((u,d)=>{let l=0;const m=()=>{e(t,n,a,s).then(e=>{u(e)}).catch(e=>{l<i?(l++,setTimeout(m,c),o.Ay.error(r.A.t("commons__error_game_retry"))):(o.Ay.error(r.A.t("commons__error_game_retry_failed")),d(e))})};m()})}}}]); 4//# sourceMappingURL=4650.bc313b98.chunk.js.map 5//# debugId=d9ce9a35-40af-5e6e-817b-7313a26cf3c2
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.