PageSourceSearch

https://careers.helmetstohardhats.org/_next/static/chunks/pages/employer/trainings/new-18197d1a7de51679.js

js helmetstohardhats.org collected 2026-09-24 10:27:15 UTC 5,588 bytes, 2 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="cc03c48d-45a7-40ca-8298-845b522b8fe3",e._sentryDebugIdIdentifier="sentry-dbid-cc03c48d-45a7-40ca-8298-845b522b8fe3")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2024],{88204:(e,s,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/employer/trainings/new",function(){return i(96468)}])},92311:(e,s,i)=>{"use strict";i.d(s,{A:()=>r});var t=i(37876),n=i(30388),l=i(58667);let a=n.Ay.ul.withConfig({componentId:"sc-2b576b8c-0"})(["margin:0;padding:0;li{list-style-type:none;padding:5px;margin:5px 0;width:fit-content;color:#31708f;border:1px solid #31708f;background-color:#c4ebf3;}"]),r=function(e){let{files:s,setFiles:i}=e;return(0,t.jsx)(a,{children:s.map((e,n)=>(0,t.jsxs)("li",{children:[(0,t.jsx)("i",{style:{padding:"0 ".concat(l.gutterWidth,"px"),cursor:"pointer"},className:"fa fa-angle-up",onClick:()=>(e=>{let t=[...s];e>0&&([t[e-1],t[e]]=[t[e],t[e-1]],i(t))})(n)}),(0,t.jsx)("i",{style:{padding:"0 ".concat(l.gutterWidth,"px"),cursor:"pointer"},className:"fa fa-angle-down",onClick:()=>(e=>{let t=[...s];e<s.length-1&&([t[e+1],t[e]]=[t[e],t[e+1]],i(t))})(n)}),"file"===e.object||e.url||e.viewUrl?(0,t.jsx)("a",{href:e.url||e.viewUrl,target:"_blank",children:e.originalname||e.name}):e.name,(0,t.jsx)("i",{style:{paddingLeft:2*l.gutterWidth,cursor:"pointer"},className:"fa fa-minus-square",onClick:()=>(e=>{let t=[...s];t.splice(e,1),i(t)})(n)})]},e.id||e.name))})}},94318:(e,s,i)=>{"use strict";i.d(s,{A:()=>g});var t=i(37876),n=i(35791),l=i(42556),a=i(22127),r=i(58667),c=i(45300),d=i(14232),o=i(13863),f=i(92311),h=i(40498),u=i(40244);let g=function(e){var s,i,g,p;let{templateVars:m,router:x}=e,j="Manager",y="/employer";/^\/admin\//.test(x.asPath)&&(j="Admin",y="/admin");let{trainingId:b,next:w}=x.query,{training:_}=m,[k,v]=(0,d.useState)(b?{..._,quiz:_.quiz?_.quiz.id:null}:_),N=(0,h.A8)(m,j,k),[P,A]=(0,d.useState)(1),[I,S]=(0,d.useState)({}),[C,E]=(0,d.useState)(),[T,V]=(0,d.useState)(!1),U=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={...k};[...e.target.files].forEach(e=>{e.isNew=!0,e.id=s?e.webkitRelativePath:P.toString(),A(P+1),i.files.push(e),v(i)})},W=(e,s,i)=>{let t={...k},n="boolean"===i?e.target.checked:["image","json","multiselect","list"].includes(i)?e:e.target.value;t[s]=n,"type"===s&&"scorm"===n&&(t.files=t.files.filter(e=>!e.isNew)),v(t)},q=async e=>{e.preventDefault(),E(),S({}),V(!0);let s=(0,h.l)(N,k);if(Object.keys(s).length>0){S(s),E("The form has errors. Please check all required fields are entered."),V(!1);return}let i=b?"".concat(y,"/trainings/").concat(b):"".concat(y,"/trainings"),t=k.files.filter(e=>e.isNew),n={...k,next:w};n.files&&n.files.length>0?n._filePositions=n.files.map(e=>e.id):n._filePositions=[],delete n.files;try{await (0,o.T3)({location:i,method:b?"put":"post",values:n,files:t})}catch(e){E("There was an error when saving the training ".concat("object"==typeof e.message?JSON.stringify(e.message):e.message))}finally{V(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.lZ,{children:(0,t.jsx)(l.mc,{children:(0,t.jsxs)(l.fI,{children:[(0,t.jsx)(l.VP,{children:(0,t.jsx)("h2",{children:b?"Edit":"New Training"})}),(0,t.jsx)(l.VP,{style:{textAlign:"right"},children:(0,t.jsx)(a.$n,{small:!0,secondary:!0,href:"".concat(y,"/trainings"),children:"Back to List"})})]})})}),(0,t.jsx)(l.mc,{style:{paddingTop:r.gutterWidth},children:(0,t.jsx)(c.A,{children:(0,t.jsxs)(a.lV,{onSubmit:q,children:[(0,t.jsxs)(l.fI,{children:[(0,t.jsx)(a.CL,{formInputs:N,formValues:k,onChange:W,errors:I}),"scorm"!==k.type&&(0,t.jsxs)(l.VP,{xs:"100%",children:[(0,t.jsx)(a.JU,{children:"Materials"}),(0,t.jsxs)(a.JU,{small:!0,weak:!0,children:["Accepted file types: .ppt(x), .doc(x), .pdf, .xls(x), .jpg, .png, .gif, .mp4, .mp3 ",(0,t.jsx)("br",{}),"Note: your files might take few moments to finish uploading and converting."]}),k.files&&k.files.length>0&&(0,t.jsx)(f.A,{files:k.files,setFiles:e=>v({...k,files:e})}),(0,t.jsxs)(a.HW,{small:!0,secondary:!0,name:"_files",onChange:e=>U(e),accept:"*",children:[(0,t.jsx)("i",{className:"fa fa-upload"}),"Upload Materials"]})]})]}),"scorm"===k.type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.A,{}),(0,t.jsx)(l.fI,{children:(0,t.jsxs)(l.VP,{children:[(0,t.jsxs)(a.HW,{small:!0,secondary:!0,name:"_scormFiles",onChange:e=>U(e,!0),accept:".zip",children:[(0,t.jsx)("i",{className:"fa fa-upload"}),"Upload Scorm File (ZIP)"]}),"\xa0",(null==(s=k.files)?void 0:s[0])?"Selected file: ".concat(k.files[0].name):(null==(g=k.links)||null==(i=g[0])?void 0:i.path)&&(0,t.jsx)(a.$n,{small:!0,href:k.links[0].path,target:"_blank",children:"See current course file"})]})}),(null==(p=k.files)?void 0:p[0])&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.JU,{children:"Entrypoint (The file that should be used to open the course)"}),(0,t.jsx)(a.pd,{value:k.scormEntrypoint,onChange:e=>W(e,"scormEntrypoint","text")})]}),(0,t.jsx)(u.A,{})]}),(0,t.jsxs)(l.fI,{style:{margin:r.gutterWidth}
1,children:[C&&(0,t.jsx)(l.VP,{xs:"100%",children:(0,t.jsx)(a.Kw,{children:C})}),(0,t.jsx)(l.VP,{xs:"100%",children:(0,t.jsx)(a.$n,{type:"submit",primary:!0,disabled:T,neutral:T,children:"Save Data"})})]})]})})})]})}},96468:(e,s,i)=>{"use strict";i.r(s),i.d(s,{default:()=>t.A});var t=i(94318)}},e=>{e.O(0,[5838,2127,636,6593,8792],()=>e(e.s=88204)),_N_E=e.O()}]);
2//# sourceMappingURL=new-18197d1a7de51679.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.