1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6953],{1430:(e,t,n)=>{n.r(t),n.d(t,{buildWizardDraftPayload:()=>d,clearWizardDraftSyncMeta:()=>m,flushWizardDraftSync:()=>j,hydrateWizardFromServer:()=>s,readLocalWizardStep:()=>h,scheduleWizardDraftSync:()=>g,syncWizardDraftToServer:()=>w});var i=n(32537),a=n(82757),r=n(47608),o=n(99534),c=n(8801);let l=null;function d(e){var t;let n=(0,r.Wp)(),i=(0,a.ZP)();return{details:n,jd:i.jd,rubric:i.rubric,rubricJdKey:null!=(t=i.rubricJdKey)?t:null,interviewer:i.interviewer,wizardStep:null!=e?e:window.location.pathname,updatedAt:new Date().toISOString(),jdChatMessages:i.jdChatMessages,userEditedFields:i.userEditedFields}}function s(e,t){var n,i,c,l,d,s,p,h,m;if(!e)return!1;let w=(0,r.Wp)(),g=null==t?void 0:t.projectId,j=!!(g&&w.projectDbId===g),v=j&&w.projectDbId?localStorage.getItem(u):null,S=null!=(c=e.updatedAt)?c:null,b=(0,a.ZP)().jd,C=(0,o.KR)(null!=(l=e.jd)?l:null),T=(0,o.KR)(b),W=j&&v&&S&&new Date(v).getTime()>new Date(S).getTime();return(!W||!T)&&(!W||!!T||!!C)&&(e.details?(0,r.BQ)({...w,...e.details,...g?{projectDbId:g}:{}}):g&&(0,r.BQ)({projectDbId:g}),(0,a.Qo)({jd:null!=(d=e.jd)?d:T?b:null,rubric:(null==(n=e.rubric)?void 0:n.length)?e.rubric:(0,a.ZP)().rubric,rubricJdKey:null!=(s=e.rubricJdKey)?s:(null==(i=e.rubric)?void 0:i.length)?(0,a.ZP)().rubricJdKey:null,interviewer:null!=(p=e.interviewer)?p:(0,a.ZP)().interviewer,details:{...(0,r.Wp)(),...e.details},jdChatMessages:null!=(h=e.jdChatMessages)?h:(0,a.ZP)().jdChatMessages,userEditedFields:null!=(m=e.userEditedFields)?m:(0,a.ZP)().userEditedFields}),S&&f(S),e.wizardStep&&y(e.wizardStep),!0)}let u="yeesh-wizard-draft-updated-at",p="yeesh-wizard-draft-step";function f(e){localStorage.setItem(u,e)}function h(){return localStorage.getItem(p)}function y(e){e&&localStorage.setItem(p,e)}function m(){localStorage.removeItem(u),localStorage.removeItem(p),(0,c.markWizardClientHydrated)(null)}async function w(e,t){var n,a;let o=d(t),c=(0,r.Wp)();await (0,i.o8)(e,{wizardDraft:o,title:c.title,tag:c.priority,location:null==(n=o.jd)?void 0:n.location,notes:c.notes,rubric:o.rubric,interviewer:null!=(a=o.interviewer)?a:void 0,isStealth:c.isStealth,companyRevealStage:c.companyRevealStage,roleType:c.roleType}),o.updatedAt&&f(o.updatedAt),y(o.wizardStep)}function g(e){let t=(0,r.Wp)().projectDbId;if(!t||!(0,c.isWizardClientHydrated)(t))return;let n=null!=e?e:window.location.pathname;y(n),l&&clearTimeout(l),l=setTimeout(()=>{(0,c.isWizardClientHydrated)(t)&&(0,r.Wp)().projectDbId===t&&w(t,n).catch(()=>{})},900)}function j(e){let t=(0,r.Wp)().projectDbId;if(!t||!(0,c.isWizardClientHydrated)(t))return;l&&(clearTimeout(l),l=null);let n=null!=e?e:window.location.pathname;y(n),w(t,n).catch(()=>void 0)}},8801:(e,t,n)=>{n.r(t),n.d(t,{getCachedWizardProject:()=>l,invalidateWizardProjectCache:()=>s,isWizardClientHydrated:()=>c,loadWizardProject:()=>p,markWizardClientHydrated:()=>o,prefetchWizardProject:()=>f,setCachedWizardProject:()=>d});let i=new Map,a=new Map,r=null;function o(e){r=e}function c(e){return r===e}function l(e){let t=i.get(e);return!t||Date.now()-t.fetchedAt>6e4?null:t.data}function d(e,t){i.set(e,{data:t,fetchedAt:Date.now()})}function s(e){if(e){i.delete(e),a.delete(e),r===e&&(r=null);return}i.clear(),a.clear(),r=null}async function u(e){let t=await fetch("/api/projects/".concat(encodeURIComponent(e)),{credentials:"include"});if(!t.ok)throw Error("Failed to load draft");return await t.json()}async function p(e,t){if(!(null==t?void 0:t.force)){let t=l(e);if(t)return t}let n=a.get(e);if(n&&!(null==t?void 0:t.force))return n;let i=u(e).then(t=>(d(e,t),t)).finally(()=>{a.delete(e)});return a.set(e,i),i}function f(e){e&&(l(e)||a.has(e)||p(e).catch(()=>void 0))}},28044:(e,t,n)=>{n.d(t,{e:()=>i});function i(e,t){let[n,i]=e.split("?"),a=new URLSearchParams(null!=i?i:"");(null==t?void 0:t.live)&&a.set("live","1"),(null==t?void 0:t.projectId)&&a.set("projectId",t.projectId),(null==t?void 0:t.resume)?a.set("resume","1"):a.delete("resume");let r=a.toString();return r?"".concat(n,"?").concat(r):n}},32537:(e,t,n)=>{n.d(t,{$3:()=>v,Dd:()=>p,Ef:()=>C,Gt:()=>b,IR:()=>d,Pg:()=>T,QH:()=>l,S2:()=>m,_n:()=>s,a$:()=>h,bz:()=>y,d6:()=>u,ig:()=>P,kf:()=>I,m2:()=>S,m4:()=>D,n8:()=>f,o8:()=>z,p_:()=>j,ql:()=>W,rQ:()=>c,vL:()=>w});var i=n(79395),a=n(53670),r=n(59770);async function o(e){let t=await e.json();if(!e.ok){var n;throw Error(null!=(n=t.error)?n:"Request failed (".concat(e.status,")"))}return t}async function c(e){return(0,i.Z2)(a._.authMe,async()=>{let e=await fetch("/api/auth/me",{credentials:"include"});if(503===e.status)throw Error("Database is not configured. Set DATABASE_URL in .env.local.");return(await o(e)).user},{ttlMs:a.U.auth,force:null==e?void 0:e.force})}async function l(e){var t;let n=await fetch("/api/auth/magic-link",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{message:null!=(t=(await o(n)).message)?t:"Check your email for a sign-in link."}}async function d(e){let t=await fetch("/api/auth/password",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return(await o(t)).user}async function s(){await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}async function u(e){let t=await fetch("/api/onboarding/account-type",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountType:e})});return(await o(t)).user}async function p(e){return o(await fetch("/api/onboarding",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountType:"company",companyName:e.companyName,roleTitle:e.roleTitle})}))}async function f(e){return o(await fetch("/api/onboarding",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountType:"agency",agencyName:e.agencyName,clientCompany:e.clientCompany,roleType:e.roleType,roleTitle:e.roleTitle})}))}async function h(e){return o(await fetch("/api/onboarding",{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}))}async function y(e){return o(await fetch("/api/onboarding/corpus-prefill",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}))}async function m(e){return h({overview:"",mission:"",culture:"",industry:"",complete:!1,skipCorpus:!0,clientCompanyId:null==e?void 0:e.clientCompanyId})}async function w(){return o(await fetch("/api/onboarding/finish",{method:"POST",credentials:"include"}))}async function g(){return o(await fetch("/api/projects",{credentials:"include"}))}async function j(e){return(0,i.Z2)(a._.projectsBundle,g,{ttlMs:a.U.projects,force:null==e?void 0:e.force})}async function v(){return o(await fetch("/api/clients",{credentials:"include"}))}async function S(e){let t=await fetch("/api/clients",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await o(t);return(0,r.Mx)(),n}async function b(e,t){let n=await fetch("/api/clients/".concat(encodeURIComponent(e)),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await o(n);return(0,r.Mx)(),i}async function C(e){return o(await fetch("/api/projects/".concat(encodeURIComponent(e),"/corpus"),{credentials:"include"}))}async function T(e){let t=await fetch("/api/projects",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,publish:!0})}),n=await o(t);return(0,r.Mx)(),n}async function W(e,t){let n=await fetch("/api/projects/".concat(e),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await o(n);return P(i.project),i}async function z(e,t){let n=await fetch("/api/projects/".concat(e),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await o(n);return P(i.project),i}async function D(e){let t=await fetch("/api/projects/".concat(e),{method:"DELETE",credentials:"include"});await o(t),(0,r.Mx)(),(0,i.gm)(a._.project(e))}async function I(e,t){return(0,i.Z2)(a._.project(e),async()=>o(await fetch("/api/projects/".concat(e),{credentials:"include"})),{ttlMs:a.U.projects,force:null==t?void 0:t.force})}function P(e){(0,i.fb)(a._.project(e.id),{project:e}),(0,i.gm)(a._.projectsBundle)}},47608:(e,t,n)=>{n.d(t,{BQ:()=>l,DC:()=>o,Wp:()=>c,oC:()=>d});var i=n(9087),a=n(26480);let r="yeesh-new-role-draft";
1function o(){(0,i.bi)(r),n.e(1562).then(n.bind(n,1430)).then(e=>e.clearWizardDraftSyncMeta())}function c(){try{(0,i.sI)();let e=(0,i.TQ)(r);if(!e)return a.U;return{...a.U,...JSON.parse(e)}}catch(e){return a.U}}function l(e){let t={...c(),...e};return(0,i.gF)(r,JSON.stringify(t)),n.e(1562).then(n.bind(n,1430)).then(e=>e.scheduleWizardDraftSync()),t}function d(e){return e?new Date(e+"T12:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}):""}},53670:(e,t,n)=>{n.d(t,{U:()=>a,_:()=>i});let i={authMe:"auth:me",projectsBundle:"projects:bundle",project:e=>"projects:item:".concat(e),actionItemsOpenCount:"action-items:count:open",actionItemsList:e=>"action-items:list:".concat(e),notificationsUnread:"notifications:count:unread",notificationsList:"notifications:list",liveRoomCalls:e=>"live-room:".concat(null!=e?e:"all"),teamMembers:"team:members"},a={auth:12e4,projects:3e5,badges:6e4,notificationsList:6e4,actionItemsList:6e4,liveRoom:15e3,team:12e4}},59770:(e,t,n)=>{n.d(t,{Jf:()=>s,Mx:()=>o,Pp:()=>r,Un:()=>d,iB:()=>l,mK:()=>c});var i=n(79395),a=n(53670);let r="yeesh-shell-badges-invalidated";function o(){(0,i.gm)("projects")}function c(){(0,i.gm)(a._.authMe)}function l(){(0,i.gm)("notifications")}function d(){(0,i.gm)("action-items")}function s(){window.dispatchEvent(new CustomEvent(r))}},79395:(e,t,n)=>{n.d(t,{Bm:()=>s,F6:()=>c,Z2:()=>r,fb:()=>l,gm:()=>d,qK:()=>o});let i=new Map,a=new Map;async function r(e,t,n){var r;let o=null!=(r=null==n?void 0:n.ttlMs)?r:3e5;if(!(null==n?void 0:n.force)){let t=i.get(e);if(t&&Date.now()-t.fetchedAt<o)return t.value}let c=a.get(e);if(c&&!(null==n?void 0:n.force))return c;let l=t().then(t=>(i.set(e,{value:t,fetchedAt:Date.now()}),a.delete(e),t)).catch(t=>{throw a.delete(e),t});return a.set(e,l),l}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=i.get(e);return!n||Date.now()-n.fetchedAt>t?null:n.value}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=i.get(e);return!(!n||Date.now()-n.fetchedAt>t)}function l(e,t){i.set(e,{value:t,fetchedAt:Date.now()})}function d(e){for(let t of i.keys())(t===e||t.startsWith("".concat(e,":"))||t.startsWith(e))&&i.delete(t);for(let t of a.keys())(t===e||t.startsWith("".concat(e,":"))||t.startsWith(e))&&a.delete(t)}function s(){i.clear(),a.clear()}},99534:(e,t,n)=>{n.d(t,{EX:()=>d,KR:()=>c,Mn:()=>r,ot:()=>a,rf:()=>o,tA:()=>l,vI:()=>s});var i=n(28044);let a="/projects/new/jd",r="/projects/new/details",o="/projects/new/publish";function c(e){var t,n,i;return!!e&&!!((null==(t=e.fullPreview)?void 0:t.trim())||(null==(n=e.gist)?void 0:n.trim())||(null==(i=e.title)?void 0:i.trim())||Array.isArray(e.requirements)&&e.requirements.length>0)}function l(e){if(e.wizardStep){let t=function(e){var t;if(!e)return a;let n=(null==(t=e.split("?")[0])?void 0:t.replace(/\/$/,""))||"";return n===o||n.startsWith("/projects/new/rubric")||n.startsWith("/projects/new/interviewer")||n.startsWith("/projects/new/publish")?o:n.startsWith("/projects/new/details")?r:a}(e.wizardStep);return(t===o||t===r)&&!1===e.hasJd?a:t}return e.hasJd?r:a}function d(e){let t=l({wizardStep:e.wizardStep,hasJd:e.hasJd});return(0,i.e)(t,{projectId:e.projectId,live:e.live,resume:!0})}function s(e){return e.isDraft?d({projectId:e.id,wizardStep:e.wizardStep,hasJd:e.wizardHasJd}):"/projects/".concat(e.id,"/sourcing")}}}]);
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.