@timurtekb/tekjobs 0.43.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/app/dist/assets/{index-CHQPdodQ.css → index-CIqEcxvl.css} +1 -1
- package/app/dist/assets/{index-C77HG2Sx.js → index-D9GAewm_.js} +4 -4
- package/app/dist/index.html +2 -2
- package/app/server/index.mjs +2 -0
- package/app/server/mcp.mjs +6 -2
- package/app/server/store.mjs +30 -0
- package/package.json +1 -1
- package/scraper/profile.mjs +1 -1
|
@@ -54,10 +54,10 @@ Error generating stack: `+e.message+`
|
|
|
54
54
|
Defaulting to \`null\`.`}md(Ad,`getInvalidValueError`);var jd=xd,Md=Cd;(0,b.forwardRef)(function({value:e,max:t=100,label:n,showValue:r=!1,size:i=`md`,tone:a=`primary`,className:o,...s},c){let l=(0,b.useId)(),u=e===void 0?void 0:Math.min(100,Math.max(0,e/t*100));return(0,x.jsxs)(`div`,{className:R(`z-progress`,o),"data-size":i,"data-tone":a,children:[(n||r)&&(0,x.jsxs)(`div`,{className:`z-progress__head`,children:[n&&(0,x.jsx)(`span`,{id:l,className:`z-progress__label`,children:n}),r&&u!==void 0&&(0,x.jsxs)(`span`,{className:`z-progress__value`,children:[Math.round(u),`%`]})]}),(0,x.jsx)(jd,{ref:c,className:`z-progress__track`,value:e??null,max:t,"aria-labelledby":n?l:void 0,...s,children:(0,x.jsx)(Md,{className:`z-progress__indicator`,style:u===void 0?void 0:{transform:`translateX(-${100-u}%)`}})})]})});var Nd=Object.defineProperty,Pd=(e,t)=>Nd(e,`name`,{value:t,configurable:!0});function Fd(e,[t,n]){return Math.min(n,Math.max(t,e))}Pd(Fd,`clamp`);var Id=Object.defineProperty,Ld=(e,t)=>Id(e,`name`,{value:t,configurable:!0});function Rd(e){let t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Ld(Rd,`usePrevious`);var zd=Object.defineProperty,Bd=(e,t)=>zd(e,`name`,{value:t,configurable:!0}),Vd=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Hd=b.forwardRef(Bd(function(e,t){return(0,x.jsx)(L.span,{...e,ref:t,style:{...Vd,...e.style}})},`VisuallyHidden`)),Ud=Hd,Wd=Object.defineProperty,q=(e,t)=>Wd(e,`name`,{value:t,configurable:!0}),Gd=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Kd=[` `,`Enter`],qd=`Select`,[Jd,Yd,Xd]=Bi(qd),[Zd,Qd]=T(qd,[Xd,bs]),$d=bs(),[ef,tf]=Zd(qd),[nf,rf]=Zd(qd);function af(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=$d(t),[_,v]=b.useState(null),[y,S]=b.useState(null),[C,w]=b.useState(!1),T=G(l),[E,D]=kt({prop:r,defaultProp:i??!1,onChange:a,caller:qd}),[O,k]=kt({prop:o,defaultProp:s,onChange:c,caller:qd}),A=b.useRef(null),j=b.useRef(O);b.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,k]);let ee=!_||!!m||!!_.closest(`form`),[M,N]=b.useState(new Set),te=bt(),P=Array.from(M).map(e=>e.props.value).join(`;`),F=b.useCallback(e=>{N(t=>new Set(t).add(e))},[]),ne=b.useCallback(e=>{N(t=>{let n=new Set(t);return n.delete(e),n})},[]),re={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:te,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:M,nativeSelectKey:P,isFormControl:ee};return(0,x.jsx)(Is,{...g,children:(0,x.jsx)(ef,{scope:t,...re,children:(0,x.jsx)(Jd.Provider,{scope:t,children:(0,x.jsx)(nf,{scope:t,onNativeOptionAdd:F,onNativeOptionRemove:ne,children:Xf(h)?h(re):n})})})})}q(af,`SelectProvider`);var of=q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,x.jsx)(af,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[n,e?(0,x.jsx)(Yf,{__scopeSelect:t}):null]})})},`Select`),sf=`SelectTrigger`,cf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=$d(n),o=tf(sf,n),s=o.disabled||r,c=P(t,o.onTriggerChange),l=Yd(n),u=b.useRef(`touch`),[d,f,p]=Qf(e=>{let t=l().filter(e=>!e.disabled),n=$f(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=q(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,x.jsx)(Ls,{asChild:!0,...a,children:(0,x.jsx)(L.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Zf(o.value)?``:void 0,...i,ref:c,onClick:U(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:U(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:U(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Gd.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),lf=`SelectValue`,uf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=tf(lf,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=P(t,c.onValueNodeChange);A(()=>{l(u)},[l,u]);let f=Zf(c.value);return(0,x.jsx)(L.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,x.jsx)(b.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),df=b.forwardRef(q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,x.jsx)(L.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[ff,pf]=Zd(`SelectPortal`,{forceMount:void 0}),mf=q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,x.jsx)(ff,{scope:e.__scopeSelect,forceMount:n,children:(0,x.jsx)(gn,{asChild:!0,...r})})},`SelectPortal`),hf=`SelectContent`,gf=b.forwardRef(q(function(e,t){let n=pf(hf,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=tf(hf,e.__scopeSelect),[o,s]=b.useState();return A(()=>{s(new DocumentFragment)},[]),(0,x.jsx)(bn,{present:r||a.open,children:({present:e})=>e?(0,x.jsx)(Sf,{...i,ref:t}):(0,x.jsx)(_f,{...i,fragment:o})})},`SelectContent`)),_f=b.forwardRef(q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?j.createPortal((0,x.jsx)(yf,{scope:n,children:(0,x.jsx)(Jd.Slot,{scope:n,children:(0,x.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),vf=10,[yf,bf]=Zd(hf),xf=re(`SelectContent.RemoveScroll`),Sf=b.forwardRef(q(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=tf(hf,n),[y,S]=b.useState(null),[C,w]=b.useState(null),T=P(t,S),[E,D]=b.useState(null),[O,k]=b.useState(null),A=Yd(n),[j,ee]=b.useState(!1),M=b.useRef(!1);b.useEffect(()=>{if(y)return Yr(y)},[y]),jn();let N=b.useCallback(e=>{let[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[A,C]),te=b.useCallback(()=>N([E,y]),[N,E,y]);b.useEffect(()=>{j&&te()},[j,te]);let{onOpenChange:F,triggerPointerDownPosRef:ne}=v;b.useEffect(()=>{if(y){let e={x:0,y:0},t=q(t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},`handlePointerMove`),n=q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||F(!1),document.removeEventListener(`pointermove`,t),ne.current=null},`handlePointerUp`);return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,F,ne]),b.useEffect(()=>{let e=q(()=>F(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[re,ie]=Qf(e=>{let t=A().filter(e=>!e.disabled),n=$f(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=b.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&(D(e),r&&(M.current=!0))},[v.value]),oe=b.useCallback(()=>y?.focus(),[y]),se=b.useCallback((e,t,n)=>{let r=!M.current&&!n;(v.value!==void 0&&v.value===t||r)&&k(e)},[v.value]),ce=r===`popper`?wf:Cf,le=ce===wf?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,x.jsx)(yf,{scope:n,content:y,viewport:C,onViewportChange:w,itemRefCallback:ae,selectedItem:E,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:te,selectedItemText:O,position:r,isPositioned:j,searchRef:re,children:(0,x.jsx)(Br,{as:xf,allowPinchZoom:!0,children:(0,x.jsx)(nn,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:U(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,x.jsx)(Vt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,x.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>ee(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:U(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Cf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=tf(hf,n),o=bf(hf,n),[s,c]=b.useState(null),[l,u]=b.useState(null),d=P(t,u),f=Yd(n),p=b.useRef(!1),m=b.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=b.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-vf,d=Fd(a,[vf,Math.max(vf,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-vf,d=Fd(a,[vf,Math.max(vf,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-vf*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-vf,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${vf}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);A(()=>y(),[y]);let[S,C]=b.useState();A(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);let w=b.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,x.jsx)(Tf,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:w,children:(0,x.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,x.jsx)(L.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),wf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=vf,...a}=e,o=$d(n);return(0,x.jsx)(Rs,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Tf,Ef]=Zd(hf,{}),Df=`SelectViewport`,Of=b.forwardRef(q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=bf(Df,n),o=Ef(Df,n),s=P(t,a.onViewportChange),c=b.useRef(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,x.jsx)(Jd.Slot,{scope:n,children:(0,x.jsx)(L.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:U(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-vf*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[kf,Af]=Zd(`SelectGroup`),jf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,...r}=e,i=bt();return(0,x.jsx)(kf,{scope:n,id:i,children:(0,x.jsx)(L.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),Mf=`SelectLabel`,Nf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,...r}=e,i=Af(Mf,n);return(0,x.jsx)(L.div,{id:i.id,...r,ref:t})},`SelectLabel`)),Pf=`SelectItem`,[Ff,If]=Zd(Pf),Lf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=tf(Pf,n),c=bf(Pf,n),l=s.value===r,[u,d]=b.useState(a??``),[f,p]=b.useState(!1),m=P(t,k(e=>c.itemRefCallback?.(e,r,i))),h=bt(),g=b.useRef(`touch`),_=q(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,x.jsx)(Ff,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:b.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,x.jsx)(Jd.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,x.jsx)(L.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:U(o.onFocus,()=>p(!0)),onBlur:U(o.onBlur,()=>p(!1)),onClick:U(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:U(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:U(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:U(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:U(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Kd.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Rf=`SelectItemText`,zf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=tf(Rf,n),s=bf(Rf,n),c=If(Rf,n),l=rf(Rf,n),[u,d]=b.useState(null),f=k(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=P(t,d,c.onItemTextChange,f),m=u?.textContent,h=b.useMemo(()=>(0,x.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return A(()=>(g(h),()=>_(h)),[g,_,h]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(L.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Zf(o.value)?j.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Bf=`SelectItemIndicator`,Vf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,...r}=e;return If(Bf,n).isSelected?(0,x.jsx)(L.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Hf=`SelectScrollUpButton`,Uf=b.forwardRef(q(function(e,t){let n=bf(Hf,e.__scopeSelect),r=Ef(Hf,e.__scopeSelect),[i,a]=b.useState(!1),o=P(t,r.onScrollButtonChange);return A(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,x.jsx)(Kf,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Wf=`SelectScrollDownButton`,Gf=b.forwardRef(q(function(e,t){let n=bf(Wf,e.__scopeSelect),r=Ef(Wf,e.__scopeSelect),[i,a]=b.useState(!1),o=P(t,r.onScrollButtonChange);return A(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,x.jsx)(Kf,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Kf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=bf(`SelectScrollButton`,n),o=b.useRef(null),s=Yd(n),c=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),A(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,x.jsx)(L.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:U(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:U(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:U(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),qf=b.forwardRef(q(function(e,t){let{__scopeSelect:n,...r}=e;return(0,x.jsx)(L.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),Jf=`SelectBubbleInput`,Yf=b.forwardRef(q(function({__scopeSelect:e,...t},n){let r=tf(Jf,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=b.useRef(null),m=P(n,p),h=i??``,g=Rd(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return b.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,x.jsxs)(L.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Vd,...t.style},ref:m,defaultValue:h,children:[Zf(i)&&!_?(0,x.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Xf(e){return typeof e==`function`}q(Xf,`isFunction`);function Zf(e){return e===``||e===void 0}q(Zf,`shouldShowPlaceholder`);function Qf(e){let t=k(e),n=b.useRef(``),r=b.useRef(0),i=b.useCallback(e=>{let i=n.current+e;t(i),q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=b.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}q(Qf,`useTypeaheadSearch`);function $f(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ep(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}q($f,`findNextItem`);function ep(e,t){return e.map((n,r)=>e[(t+r)%e.length])}q(ep,`wrapArray`);var tp=(0,b.forwardRef)(function({label:e,description:t,error:n,placeholder:r=`Select`,size:i=`md`,id:a,className:o,children:s,disabled:c,required:l,...u},d){let f=(0,b.useId)(),p=a??f,m=t?`${p}-description`:void 0,h=n?`${p}-error`:void 0,g=!!n;return(0,x.jsxs)(`div`,{className:R(`z-select`,o),"data-size":i,"data-invalid":g||void 0,"data-disabled":c||void 0,children:[e&&(0,x.jsxs)(`label`,{className:`z-select__label`,htmlFor:p,children:[e,l&&(0,x.jsx)(`span`,{className:`z-select__required`,"aria-hidden":`true`,children:` *`})]}),(0,x.jsxs)(of,{disabled:c,required:l,...u,children:[(0,x.jsxs)(cf,{ref:d,id:p,className:`z-select__trigger z-focusable`,"aria-invalid":g||void 0,"aria-describedby":[m,h].filter(Boolean).join(` `)||void 0,children:[(0,x.jsx)(`span`,{className:`z-select__value`,children:(0,x.jsx)(uf,{placeholder:r})}),(0,x.jsx)(df,{className:`z-select__chevron`,"aria-hidden":`true`,children:(0,x.jsx)(H.ChevronDown,{})})]}),(0,x.jsx)(mf,{children:(0,x.jsxs)(gf,{className:`z-select__content`,position:`popper`,sideOffset:4,collisionPadding:8,"data-size":i,children:[(0,x.jsx)(Uf,{className:`z-select__scroll`,"aria-hidden":`true`,children:(0,x.jsx)(np,{up:!0})}),(0,x.jsx)(Of,{className:`z-select__viewport`,children:s}),(0,x.jsx)(Gf,{className:`z-select__scroll`,"aria-hidden":`true`,children:(0,x.jsx)(np,{})})]})})]}),t&&(0,x.jsx)(`p`,{id:m,className:`z-select__description`,children:t}),n&&(0,x.jsx)(`p`,{id:h,className:`z-select__error`,role:`alert`,children:n})]})});function np({up:e=!1}){return e?(0,x.jsx)(H.ChevronUp,{}):(0,x.jsx)(H.ChevronDown,{})}var rp=(0,b.forwardRef)(function({className:e,children:t,...n},r){return(0,x.jsxs)(Lf,{ref:r,className:R(`z-select__item`,e),...n,children:[(0,x.jsx)(zf,{children:t}),(0,x.jsx)(Vf,{className:`z-select__indicator`,"aria-hidden":`true`,children:(0,x.jsx)(H.Check,{strokeWidth:2})})]})}),ip=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(jf,{ref:n,className:R(`z-select__group`,e),...t})}),ap=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Nf,{ref:n,className:R(`z-select__group-label`,e),...t})}),op=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(qf,{ref:n,className:R(`z-select__separator`,e),...t})}),J=Object.assign(tp,{Item:rp,Group:ip,Label:ap,Separator:op}),sp=Object.defineProperty,cp=(e,t)=>sp(e,`name`,{value:t,configurable:!0}),lp=`horizontal`,up=[`horizontal`,`vertical`],dp=b.forwardRef(cp(function(e,t){let{decorative:n,orientation:r=lp,...i}=e,a=fp(r)?r:lp,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,x.jsx)(L.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function fp(e){return up.includes(e)}cp(fp,`isValidOrientation`);var pp=dp;(0,b.forwardRef)(function({orientation:e=`horizontal`,label:t,decorative:n=!0,className:r,...i},a){return t&&e===`horizontal`?(0,x.jsxs)(`div`,{className:R(`z-separator z-separator--labelled`,r),"data-orientation":e,role:n?void 0:`separator`,children:[(0,x.jsx)(pp,{ref:a,className:`z-separator__line`,decorative:!0,...i}),(0,x.jsx)(`span`,{className:`z-separator__label`,children:t}),(0,x.jsx)(pp,{className:`z-separator__line`,decorative:!0})]}):(0,x.jsx)(pp,{ref:a,className:R(`z-separator`,r),orientation:e,decorative:n,...i})});var mp=(0,b.createContext)({side:`right`,size:`md`});function hp({side:e=`right`,size:t=`md`,children:n,...r}){return(0,x.jsx)(mp.Provider,{value:{side:e,size:t},children:(0,x.jsx)(ri,{...r,children:n})})}var gp=ai,_p=wi,vp=(0,b.forwardRef)(function({className:e,children:t,showClose:n=!0,...r},i){let{side:a,size:o}=(0,b.useContext)(mp);return(0,x.jsxs)(li,{children:[(0,x.jsx)(di,{className:`z-sheet__overlay`}),(0,x.jsxs)(hi,{ref:i,className:R(`z-sheet`,e),"data-side":a,"data-size":o,...r,children:[t,n&&(0,x.jsx)(wi,{className:`z-sheet__close z-focusable`,"aria-label":`Close`,children:(0,x.jsx)(H.Close,{})})]})]})}),yp=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(bi,{ref:n,className:R(`z-sheet__title`,e),...t})}),bp=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Si,{ref:n,className:R(`z-sheet__description`,e),...t})}),xp=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(`div`,{ref:n,className:R(`z-sheet__footer`,e),...t})}),Sp=Object.assign(hp,{Trigger:gp,Content:vp,Title:yp,Description:bp,Footer:xp,Close:_p}),Cp=(0,b.forwardRef)(function({values:e,tone:t=`primary`,height:n=32,area:r=!0,className:i,...a},o){let[s,c]=ze(),l=Math.min(...e,0),u=Math.max(...e,1),d={width:c,height:n,top:2,right:1,bottom:2,left:1},f=e.map((t,n)=>[He(d,n,e.length),Ue(d,t,l,u===l?l+1:u)]),p=e[e.length-1],m=e[0],h=p===void 0||m===void 0?`flat`:p>m?`up`:p<m?`down`:`flat`;return(0,x.jsxs)(`span`,{ref:wp(o,s),className:R(`z-sparkline`,i),"data-tone":t,"data-trend":h,...a,children:[(0,x.jsx)(`span`,{className:`z-sr-only`,children:e.length?`${e.length} points, from ${Ke(m)} to ${Ke(p)}`:`no data`}),c>0&&e.length>0&&(0,x.jsx)(`svg`,{className:`z-sparkline__svg`,width:c,height:n,viewBox:`0 0 ${c} ${n}`,"aria-hidden":`true`,children:(0,x.jsxs)(`g`,{"data-tone":t,children:[r&&(0,x.jsx)(`path`,{className:`z-chart__area`,d:Ge(f,n-d.bottom,!0)}),(0,x.jsx)(`path`,{className:`z-chart__line z-sparkline__line`,d:We(f,!0)})]})})]})});function wp(...e){return t=>{for(let n of e)n&&(typeof n==`function`?n(t):n.current=t)}}var Tp=Object.defineProperty,Ep=(e,t)=>Tp(e,`name`,{value:t,configurable:!0}),Dp=`Switch`,[Op,kp]=T(Dp),[Ap,jp]=Op(Dp);function Mp(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=kt({prop:n,defaultProp:i??!1,onChange:c,caller:Dp}),[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useRef(!1),[y,S]=b.useReducer(e=>e+1,0),C={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:S,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,x.jsx)(Ap,{scope:t,...C,children:Bp(d)?d(C):r})}Ep(Mp,`SwitchProvider`);var Np=`SwitchTrigger`,Pp=b.forwardRef(Ep(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=jp(Np,e),g=P(r,u),_=b.useRef(c);return b.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=Ep(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,x.jsx)(L.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Vp(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:U(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),Fp=b.forwardRef(Ep(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,x.jsx)(Mp,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Pp,{...d,ref:t,__scopeSwitch:n}),e&&(0,x.jsx)(zp,{__scopeSwitch:n})]})})},`Switch`)),Ip=`SwitchThumb`,Lp=b.forwardRef(Ep(function(e,t){let{__scopeSwitch:n,...r}=e,i=jp(Ip,n);return(0,x.jsx)(L.span,{"data-state":Vp(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),Rp=`SwitchBubbleInput`,zp=b.forwardRef(Ep(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=jp(Rp,e),g=P(r,h),_=hs(i),v=b.useRef(!1),y=b.useRef(s),S=b.useRef(o);b.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==S.current;S.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let C=b.useRef(s);return(0,x.jsx)(L.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??C.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:U(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Bp(e){return typeof e==`function`}Ep(Bp,`isFunction`);function Vp(e){return e?`checked`:`unchecked`}Ep(Vp,`getState`);var Hp=(0,b.forwardRef)(function({label:e,description:t,size:n=`md`,className:r,id:i,disabled:a,...o},s){let c=(0,b.useId)(),l=i??c,u=t?`${l}-description`:void 0;return(0,x.jsxs)(`div`,{className:R(`z-switch`,r),"data-size":n,"data-disabled":a||void 0,children:[(0,x.jsx)(`span`,{className:`z-switch__box`,children:(0,x.jsx)(Fp,{ref:s,id:l,className:`z-switch__control z-focusable`,disabled:a,"aria-describedby":u,...o,children:(0,x.jsx)(Lp,{className:`z-switch__thumb`})})}),(e||t)&&(0,x.jsxs)(`div`,{className:`z-switch__text`,children:[e&&(0,x.jsx)(`label`,{className:`z-switch__label`,htmlFor:l,children:e}),t&&(0,x.jsx)(`p`,{id:u,className:`z-switch__description`,children:t})]})]})}),Up=(0,b.forwardRef)(function({density:e=`md`,stickyHeader:t=!1,className:n,style:r,...i},a){return(0,x.jsx)(`div`,{className:R(`z-table`,n),style:r,"data-density":e,"data-sticky":t||void 0,children:(0,x.jsx)(`table`,{ref:a,className:`z-table__table`,...i})})}),Wp=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(`thead`,{ref:n,className:R(`z-table__head`,e),...t})}),Gp=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(`tbody`,{ref:n,className:R(`z-table__body`,e),...t})}),Kp=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(`tfoot`,{ref:n,className:R(`z-table__foot`,e),...t})}),qp=(0,b.forwardRef)(function({selected:e,interactive:t,className:n,...r},i){return(0,x.jsx)(`tr`,{ref:i,className:R(`z-table__row`,n),"data-selected":e||void 0,"data-interactive":t||void 0,"aria-selected":e,...r})}),Jp=(0,b.forwardRef)(function({align:e=`start`,numeric:t,className:n,...r},i){return(0,x.jsx)(`td`,{ref:i,className:R(`z-table__cell`,n),"data-align":e,"data-numeric":t||void 0,...r})}),Yp=(0,b.forwardRef)(function({align:e=`start`,numeric:t,className:n,scope:r=`col`,...i},a){return(0,x.jsx)(`th`,{ref:a,className:R(`z-table__cell z-table__cell--head`,n),"data-align":e,"data-numeric":t||void 0,scope:r,...i})}),Y=Object.assign(Up,{Head:Wp,Body:Gp,Foot:Kp,Row:qp,Cell:Jp,HeadCell:Yp}),Xp=(0,b.forwardRef)(function({label:e,description:t,error:n,size:r=`md`,resize:i=`vertical`,font:a=`sans`,rows:o=3,className:s,id:c,disabled:l,readOnly:u,required:d,...f},p){let m=(0,b.useId)(),h=c??m,g=t?`${h}-description`:void 0,_=n?`${h}-error`:void 0,v=!!n;return(0,x.jsxs)(`div`,{className:R(`z-textarea`,s),"data-size":r,"data-resize":i,"data-font":a,"data-invalid":v||void 0,"data-disabled":l||void 0,"data-readonly":u||void 0,children:[e&&(0,x.jsxs)(`label`,{className:`z-textarea__label`,htmlFor:h,children:[e,d&&(0,x.jsx)(`span`,{className:`z-textarea__required`,"aria-hidden":`true`,children:` *`})]}),(0,x.jsx)(`textarea`,{ref:p,id:h,className:`z-textarea__control z-focusable`,rows:o,disabled:l,readOnly:u,required:d,"aria-invalid":v||void 0,"aria-describedby":[g,_].filter(Boolean).join(` `)||void 0,...f}),t&&(0,x.jsx)(`p`,{id:g,className:`z-textarea__description`,children:t}),n&&(0,x.jsx)(`p`,{id:_,className:`z-textarea__error`,role:`alert`,children:n})]})}),Zp=(0,b.forwardRef)(function({label:e,description:t,error:n,size:r=`md`,font:i=`sans`,leadingIcon:a,trailingIcon:o,className:s,id:c,disabled:l,readOnly:u,required:d,...f},p){let m=(0,b.useId)(),h=c??m,g=t?`${h}-description`:void 0,_=n?`${h}-error`:void 0,v=!!n;return(0,x.jsxs)(`div`,{className:R(`z-field`,s),"data-size":r,"data-font":i,"data-invalid":v||void 0,"data-disabled":l||void 0,"data-readonly":u||void 0,children:[e&&(0,x.jsxs)(`label`,{className:`z-field__label`,htmlFor:h,children:[e,d&&(0,x.jsx)(`span`,{className:`z-field__required`,"aria-hidden":`true`,children:` *`})]}),(0,x.jsxs)(`div`,{className:`z-field__control`,children:[a&&(0,x.jsx)(`span`,{className:`z-icon z-field__icon`,"aria-hidden":`true`,children:a}),(0,x.jsx)(`input`,{ref:p,id:h,className:`z-field__input z-focusable`,disabled:l,readOnly:u,required:d,"aria-invalid":v||void 0,"aria-describedby":[g,_].filter(Boolean).join(` `)||void 0,...f}),o&&(0,x.jsx)(`span`,{className:`z-icon z-field__icon`,"aria-hidden":`true`,children:o})]}),t&&(0,x.jsx)(`p`,{id:g,className:`z-field__description`,children:t}),n&&(0,x.jsx)(`p`,{id:_,className:`z-field__error`,role:`alert`,children:n})]})}),Qp=Object.defineProperty,$p=(e,t)=>Qp(e,`name`,{value:t,configurable:!0}),em=`ToastProvider`,[tm,nm,rm]=Bi(`Toast`),[im,am]=T(`Toast`,[rm]),[om,sm]=im(em),cm=$p(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=b.useState(null),[u,d]=b.useState(0),f=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${em}\`. Expected non-empty \`string\`.`),(0,x.jsx)(tm.Provider,{scope:t,children:(0,x.jsx)(om,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:b.useCallback(()=>d(e=>e+1),[]),onToastRemove:b.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),lm=`ToastViewport`,um=[`F8`],dm=`toast.viewportPause`,fm=`toast.viewportResume`,pm=b.forwardRef($p(function(e,t){let{__scopeToast:n,hotkey:r=um,label:i=`Notifications ({hotkey})`,...a}=e,o=sm(lm,n),s=nm(n),c=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=P(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;b.useEffect(()=>{let e=$p(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),b.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=$p(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(dm);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=$p(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(fm);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=$p(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=$p(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=b.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Rm(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return b.useEffect(()=>{let e=d.current;if(e){let t=$p(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);zm(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,x.jsxs)(Xt,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,x.jsx)(hm,{ref:l,onFocusFromOutsideViewport:()=>{zm(h({tabbingDirection:`forwards`}))}}),(0,x.jsx)(tm.Slot,{scope:n,children:(0,x.jsx)(L.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,x.jsx)(hm,{ref:u,onFocusFromOutsideViewport:()=>{zm(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),mm=`ToastFocusProxy`,hm=b.forwardRef($p(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=sm(mm,n);return(0,x.jsx)(Hd,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),gm=`Toast`,_m=`toast.swipeStart`,vm=`toast.swipeMove`,ym=`toast.swipeCancel`,bm=`toast.swipeEnd`,xm=b.forwardRef($p(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=kt({prop:r,defaultProp:i??!0,onChange:a,caller:gm});return(0,x.jsx)(bn,{present:n||s,children:(0,x.jsx)(wm,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:k(e.onPause),onResume:k(e.onResume),onSwipeStart:U(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:U(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:U(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:U(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[Sm,Cm]=im(gm,{onClose(){}}),wm=b.forwardRef($p(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=sm(gm,n),g=nm(n),[_,v]=b.useState(null),y=P(t,v),S=b.useRef(null),C=b.useRef(null),w=i||h.duration,T=b.useRef(0),E=b.useRef(w),D=b.useRef(0),{onToastAdd:O,onToastRemove:A}=h,ee=k(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),M=b.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(D.current),T.current=new Date().getTime(),D.current=window.setTimeout(ee,e))},[ee]);b.useEffect(()=>{let e=h.viewport;if(e){let t=$p(()=>{M(E.current),l?.()},`handleResume`),n=$p(()=>{let e=new Date().getTime()-T.current;E.current-=e,window.clearTimeout(D.current),c?.()},`handlePause`);return e.addEventListener(dm,n),e.addEventListener(fm,t),()=>{e.removeEventListener(dm,n),e.removeEventListener(fm,t)}}},[h.viewport,w,c,l,M]),b.useEffect(()=>{a&&!h.isClosePausedRef.current&&M(w)},[a,w,h.isClosePausedRef,M]),b.useEffect(()=>()=>{window.clearTimeout(D.current)},[]),b.useEffect(()=>(O(),()=>A()),[O,A]);let N=b.useMemo(()=>_?Nm(_):null,[_]);return h.viewport?(0,x.jsxs)(x.Fragment,{children:[N&&(0,x.jsx)(Tm,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:N}),(0,x.jsx)(Sm,{scope:n,onClose:ee,children:j.createPortal((0,x.jsx)(tm.ItemSlot,{scope:n,children:(0,x.jsx)(Yt,{asChild:!0,onEscapeKeyDown:U(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||ee()}),children:(0,x.jsx)(L.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:U(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||ee())}),onPointerDown:U(e.onPointerDown,e=>{e.button===0&&(S.current={x:e.clientX,y:e.clientY})}),onPointerMove:U(e.onPointerMove,e=>{if(!S.current)return;let t=e.clientX-S.current.x,n=e.clientY-S.current.y,r=!!C.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(C.current=l,Pm(vm,d,f,{discrete:!1})):Fm(l,h.swipeDirection,c)?(C.current=l,Pm(_m,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(S.current=null)}),onPointerUp:U(e.onPointerUp,e=>{let t=C.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),C.current=null,S.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Fm(t,h.swipeDirection,h.swipeThreshold)?Pm(bm,p,r,{discrete:!0}):Pm(ym,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),Tm=$p(e=>{let{__scopeToast:t,children:n,...r}=e,i=sm(gm,t),[a,o]=b.useState(!1),[s,c]=b.useState(!1);return Im(()=>o(!0)),b.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,x.jsx)(gn,{asChild:!0,container:i.announcerContainer||void 0,children:(0,x.jsx)(Hd,{...r,children:a&&(0,x.jsxs)(x.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),Em=b.forwardRef($p(function(e,t){let{__scopeToast:n,...r}=e;return(0,x.jsx)(L.div,{...r,ref:t})},`ToastTitle`)),Dm=b.forwardRef($p(function(e,t){let{__scopeToast:n,...r}=e;return(0,x.jsx)(L.div,{...r,ref:t})},`ToastDescription`)),Om=`ToastAction`,km=b.forwardRef($p(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,x.jsx)(Mm,{altText:n,asChild:!0,children:(0,x.jsx)(jm,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Om}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),Am=`ToastClose`,jm=b.forwardRef($p(function(e,t){let{__scopeToast:n,...r}=e,i=Cm(Am,n);return(0,x.jsx)(Mm,{asChild:!0,children:(0,x.jsx)(L.button,{type:`button`,...r,ref:t,onClick:U(e.onClick,i.onClose)})})},`ToastClose`)),Mm=b.forwardRef($p(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,x.jsx)(L.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Nm(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Lm(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Nm(e))}}}),t}$p(Nm,`getAnnounceTextContent`);function Pm(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ye(i,a):i.dispatchEvent(a)}$p(Pm,`handleAndDispatchCustomEvent`);var Fm=$p((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function Im(e=()=>{}){let t=k(e);A(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}$p(Im,`useNextFrame`);function Lm(e){return e.nodeType===e.ELEMENT_NODE}$p(Lm,`isHTMLElement`);function Rm(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:$p(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}$p(Rm,`getTabbableCandidates`);function zm(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}$p(zm,`focusFirst`);var Bm=cm,Vm=pm,Hm=xm,Um=Em,Wm=Dm,Gm=km,Km=jm,qm=1,Jm=[],Ym=3,Xm=new Set;function Zm(){for(let e of Xm)e(Jm)}function X(e){let t=qm++,n={id:t,tone:`neutral`,...e};return Jm=[...Jm,n].slice(-Ym),Zm(),t}X.dismiss=e=>{Jm=e===void 0?[]:Jm.filter(t=>t.id!==e),Zm()};function Qm({position:e=`bottom-right`,duration:t=5e3,max:n=3,className:r,children:i}){let[a,o]=(0,b.useState)(Jm);(0,b.useEffect)(()=>(Xm.add(o),()=>{Xm.delete(o)}),[]),(0,b.useEffect)(()=>{Ym=Math.max(1,n)},[n]);let s=e.endsWith(`right`)?`right`:`left`;return(0,x.jsxs)(Bm,{swipeDirection:s,duration:t,children:[i,a.length>1&&(0,x.jsx)(Hm,{className:`z-toast z-toast--clear`,duration:1/0,onOpenChange:()=>void 0,children:(0,x.jsxs)(Km,{className:`z-toast__clear z-focusable`,"aria-label":`Dismiss all notifications`,onClick:()=>X.dismiss(),children:[`Dismiss all (`,a.length,`)`]})}),a.map(e=>(0,x.jsxs)(Hm,{className:`z-toast`,"data-tone":e.tone,duration:e.duration,onOpenChange:t=>{t||X.dismiss(e.id)},children:[(0,x.jsxs)(`div`,{className:`z-toast__body`,children:[(0,x.jsx)(Um,{className:`z-toast__title`,children:e.title}),e.description&&(0,x.jsx)(Wm,{className:`z-toast__description`,children:e.description})]}),e.action&&(0,x.jsx)(Gm,{className:`z-toast__action z-focusable`,altText:e.action.label,onClick:e.action.onClick,children:e.action.label}),(0,x.jsx)(Km,{className:`z-toast__close z-focusable`,"aria-label":`Dismiss`,children:(0,x.jsx)(H.Close,{})})]},e.id)),(0,x.jsx)(Vm,{className:R(`z-toast__viewport`,r),"data-position":e,label:`Notifications`})]})}var $m={Provider:Qm},eh=Object.defineProperty,th=(e,t)=>eh(e,`name`,{value:t,configurable:!0}),[nh,rh]=T(`Tooltip`,[bs]),ih=bs(),ah=`TooltipProvider`,oh=700,sh=`tooltip.open`,[ch,lh]=nh(ah),uh=th(e=>{let{__scopeTooltip:t,delayDuration:n=oh,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=b.useRef(!0),s=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(ch,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:b.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:b.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),dh=`Tooltip`,[fh,ph]=nh(dh),mh=th(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=lh(dh,e.__scopeTooltip),l=ih(t),[u,d]=b.useState(null),[f,p]=b.useState(void 0),m=bt(),h=b.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=b.useRef(!1),[y,S]=kt({prop:r,defaultProp:i??!1,onChange:th(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(sh))):c.onClose(),a?.(e)},`onChange`),caller:dh}),C=b.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),w=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,S(!0)},[S]),T=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S(!1)},[S]),E=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,S(!0),h.current=0},_)},[_,S]);b.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let D=f??m;return(0,x.jsx)(Is,{...l,children:(0,x.jsx)(fh,{scope:t,contentId:D,setContentId:p,open:y,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:b.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})},`Tooltip`),hh=`TooltipTrigger`,gh=b.forwardRef(th(function(e,t){let{__scopeTooltip:n,...r}=e,i=ph(hh,n),a=lh(hh,n),o=ih(n),s=P(t,b.useRef(null),i.onTriggerChange),c=b.useRef(!1),l=b.useRef(!1),u=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,x.jsx)(Ls,{asChild:!0,...o,children:(0,x.jsx)(L.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:U(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:U(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:U(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:U(e.onBlur,i.onClose),onClick:U(e.onClick,i.onClose)})})},`TooltipTrigger`)),_h=`TooltipPortal`,[vh,yh]=nh(_h,{forceMount:void 0}),bh=th(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=ph(_h,t);return(0,x.jsx)(vh,{scope:t,forceMount:n,children:(0,x.jsx)(bn,{present:n||a.open,children:(0,x.jsx)(gn,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),xh=`TooltipContent`,Sh=b.forwardRef(th(function(e,t){let n=yh(xh,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=ph(xh,e.__scopeTooltip);return(0,x.jsx)(bn,{present:r||o.open,children:o.disableHoverableContent?(0,x.jsx)(Th,{side:i,...a,ref:t}):(0,x.jsx)(Ch,{side:i,...a,ref:t})})},`TooltipContent`)),Ch=b.forwardRef(th(function(e,t){let n=ph(xh,e.__scopeTooltip),r=lh(xh,e.__scopeTooltip),i=b.useRef(null),a=P(t,i),[o,s]=b.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=b.useCallback(()=>{s(null),d(!1)},[d]),p=b.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Oh(r,Dh(r,n.getBoundingClientRect())),a=kh(t.getBoundingClientRect()),o=jh([...i,...a]);s(o),d(!0)},[d]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(c&&u){let e=th(e=>p(e,u),`handleTriggerLeave`),t=th(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),b.useEffect(()=>{if(o){let e=th(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Ah(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,x.jsx)(Th,{...e,ref:a})},`TooltipContentHoverable`)),wh=oe(`TooltipContent`),Th=b.forwardRef(th(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=ph(xh,n),u=ih(n),{onClose:d}=l;b.useEffect(()=>(document.addEventListener(sh,d),()=>document.removeEventListener(sh,d)),[d]),b.useEffect(()=>{if(l.trigger){let e=th(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return A(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,x.jsx)(Vt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,x.jsxs)(Rs,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,x.jsx)(wh,{children:r}),i?(0,x.jsx)(Ud,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Eh=b.forwardRef(th(function(e,t){let{__scopeTooltip:n,...r}=e,i=ih(n);return(0,x.jsx)(zs,{...i,...r,ref:t})},`TooltipArrow`));function Dh(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}th(Dh,`getExitSideFromRect`);function Oh(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}th(Oh,`getPaddedExitPoints`);function kh(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}th(kh,`getPointsFromRect`);function Ah(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}th(Ah,`isPointInPolygon`);function jh(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Mh(t)}th(jh,`getHull`);function Mh(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}th(Mh,`getHullPresorted`);var Nh=uh,Ph=mh,Fh=gh,Ih=bh,Lh=Sh,Rh=Eh;function zh({content:e,children:t,side:n=`top`,delay:r=300,open:i,defaultOpen:a,onOpenChange:o}){return(0,x.jsxs)(Ph,{open:i,defaultOpen:a,onOpenChange:o,delayDuration:r,children:[(0,x.jsx)(Fh,{asChild:!0,children:t}),(0,x.jsx)(Ih,{children:(0,x.jsxs)(Lh,{className:`z-tooltip`,side:n,sideOffset:6,collisionPadding:8,children:[e,(0,x.jsx)(Rh,{className:`z-tooltip__arrow`,width:10,height:5})]})})]})}var Bh=Object.assign(zh,{Provider:Nh}),Vh=Object.defineProperty,Hh=(e,t)=>Vh(e,`name`,{value:t,configurable:!0}),Uh=`Checkbox`,[Wh,Gh]=T(Uh),[Kh,qh]=Wh(Uh);function Jh(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=kt({prop:n,defaultProp:i??!1,onChange:c,caller:Uh}),[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useRef(!1),[y,S]=b.useReducer(e=>e+1,0),C=!m||!!o||!!m.closest(`form`),w={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:S,required:l,defaultChecked:!rg(i)&&i,isFormControl:C,bubbleInput:g,setBubbleInput:_};return(0,x.jsx)(Kh,{scope:t,...w,children:ng(d)?d(w):r})}Hh(Jh,`CheckboxProvider`);var Yh=`CheckboxTrigger`,Xh=b.forwardRef(Hh(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=qh(Yh,e),g=P(i,u),_=b.useRef(c);return b.useEffect(()=>{let e=a?.form;if(e){let t=Hh(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,x.jsx)(L.button,{type:`button`,role:`checkbox`,"aria-checked":rg(c)?`mixed`:c,"aria-required":l,"data-state":ig(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:U(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:U(n,e=>{p(),d(e=>rg(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Zh=b.forwardRef(Hh(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,x.jsx)(Jh,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Xh,{...d,ref:t,__scopeCheckbox:n}),e&&(0,x.jsx)(tg,{__scopeCheckbox:n})]})})},`Checkbox`)),Qh=`CheckboxIndicator`,$h=b.forwardRef(Hh(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=qh(Qh,n);return(0,x.jsx)(bn,{present:r||rg(a.checked)||a.checked===!0,children:(0,x.jsx)(L.span,{"data-state":ig(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),eg=`CheckboxBubbleInput`,tg=b.forwardRef(Hh(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=qh(eg,e),g=P(r,h),_=hs(i),v=b.useRef(!1),y=b.useRef(s),S=b.useRef(o);b.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==S.current;S.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=rg(s),n.call(e,!rg(s)&&s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let C=b.useRef(!rg(s)&&s);return(0,x.jsx)(L.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??C.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:U(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function ng(e){return typeof e==`function`}Hh(ng,`isFunction`);function rg(e){return e===`indeterminate`}Hh(rg,`isIndeterminate`);function ig(e){return rg(e)?`indeterminate`:e?`checked`:`unchecked`}Hh(ig,`getState`),(0,b.forwardRef)(function({label:e,description:t,size:n=`md`,className:r,id:i,disabled:a,...o},s){let c=(0,b.useId)(),l=i??c,u=t?`${l}-description`:void 0;return(0,x.jsxs)(`div`,{className:R(`z-checkbox`,r),"data-size":n,"data-disabled":a||void 0,children:[(0,x.jsx)(`span`,{className:`z-checkbox__box`,children:(0,x.jsx)(Zh,{ref:s,id:l,className:`z-checkbox__control z-focusable`,disabled:a,"aria-describedby":u,...o,children:(0,x.jsx)($h,{className:`z-checkbox__indicator`,forceMount:!0,children:(0,x.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,x.jsx)(`path`,{className:`z-checkbox__check`,d:`M3.5 8.5l3 3 6-7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,x.jsx)(`path`,{className:`z-checkbox__dash`,d:`M4 8h8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})})})}),(e||t)&&(0,x.jsxs)(`div`,{className:`z-checkbox__text`,children:[e&&(0,x.jsx)(`label`,{className:`z-checkbox__label`,htmlFor:l,children:e}),t&&(0,x.jsx)(`p`,{id:u,className:`z-checkbox__description`,children:t})]})]})});var ag=(0,b.forwardRef)(function({code:e,language:t,showCopy:n=!0,wrap:r=!1,className:i,...a},o){let[s,c]=(0,b.useState)(!1),l=async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)}catch{}};return(0,x.jsxs)(`div`,{ref:o,className:R(`z-codeblock`,i),"data-wrap":r||void 0,...a,children:[(t||n)&&(0,x.jsxs)(`div`,{className:`z-codeblock__head`,children:[(0,x.jsx)(`span`,{className:`z-codeblock__language`,children:t??``}),n&&(0,x.jsx)(B,{variant:`ghost`,size:`sm`,className:`z-codeblock__copy`,onClick:l,"aria-live":`polite`,children:s?`Copied`:`Copy`})]}),(0,x.jsx)(`pre`,{className:`z-codeblock__pre`,children:(0,x.jsx)(`code`,{children:e})})]})});function og(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}var sg=e=>/^\s*\|.*\|\s*$/.test(e),cg=e=>/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/.test(e);function lg(e){let t=e.replace(/\r\n/g,`
|
|
55
55
|
`).split(`
|
|
56
56
|
`),n=[],r=0;for(;r<t.length;){let e=t[r];if(e.trim()===``){r++;continue}let i=/^```\s*([\w+-]*)\s*$/.exec(e);if(i){let e=i[1]??``,a=[];for(r++;r<t.length&&!/^```\s*$/.test(t[r]);)a.push(t[r++]);r++,n.push({kind:`code`,language:e,code:a.join(`
|
|
57
|
-
`)});continue}let a=/^(#{1,6})\s+(.*)$/.exec(e);if(a){n.push({kind:`heading`,level:a[1].length,children:ug(a[2])}),r++;continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){n.push({kind:`rule`}),r++;continue}if(sg(e)&&r+1<t.length&&cg(t[r+1])){let i=og(e).map(ug);r+=2;let a=[];for(;r<t.length&&sg(t[r]);)a.push(og(t[r++]).map(ug));n.push({kind:`table`,header:i,rows:a});continue}if(/^>\s?/.test(e)){let e=[];for(;r<t.length&&/^>\s?/.test(t[r]);)e.push(t[r++].replace(/^>\s?/,``));n.push({kind:`quote`,children:ug(e.join(` `))});continue}let o=/^\s*([-*+]|\d+[.)])\s+/.exec(e);if(o){let e=/\d/.test(o[1]),i=[];for(;r<t.length;){let e=/^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(t[r]);if(!e)break;let n=e[2];for(r++;r<t.length&&/^\s{2,}\S/.test(t[r])&&!/^\s*([-*+]|\d+[.)])\s+/.test(t[r]);)n+=` `+t[r++].trim();i.push(ug(n))}n.push({kind:`list`,ordered:e,items:i});continue}let s=[];for(;r<t.length&&t[r].trim()!==``&&!/^```/.test(t[r])&&!/^(#{1,6})\s/.test(t[r])&&!/^\s*([-*+]|\d+[.)])\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!(sg(t[r])&&r+1<t.length&&cg(t[r+1]));)s.push(t[r++].trim());n.push({kind:`paragraph`,children:ug(s.join(` `))})}return n}function ug(e){let t=[],n=e,r=e=>{let n=t[t.length-1];e.kind===`text`&&n?.kind===`text`?n.text+=e.text:t.push(e)};for(;n.length;){let e=/^`([^`]+)`/.exec(n);if(e){r({kind:`code`,text:e[1]}),n=n.slice(e[0].length);continue}let t=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+|\/[^\s)]*|#[^\s)]*)\)/.exec(n);if(t){r({kind:`link`,href:t[2],children:ug(t[1])}),n=n.slice(t[0].length);continue}let i=/^(\*\*|__)(.+?)\1/.exec(n);if(i){r({kind:`strong`,children:ug(i[2])}),n=n.slice(i[0].length);continue}let a=/^(\*|_)([^*_]+?)\1/.exec(n);if(a){r({kind:`em`,children:ug(a[2])}),n=n.slice(a[0].length);continue}let o=n.slice(1).search(/[`*_[]/),s=o===-1?n.length:o+1;r({kind:`text`,text:n.slice(0,s)}),n=n.slice(s)}return t}var dg=(0,b.forwardRef)(function({text:e,streaming:t=!1,className:n,...r},i){let a=lg(e);return(0,x.jsxs)(`div`,{ref:i,className:R(`z-markdown`,n),"data-streaming":t||void 0,...r,children:[a.map((e,n)=>(0,x.jsx)(fg,{block:e,last:n===a.length-1,streaming:t},n)),t&&a.length===0&&(0,x.jsx)(`span`,{className:`z-markdown__cursor`,"aria-hidden":`true`})]})});function fg({block:e,last:t,streaming:n}){let r=t&&n?(0,x.jsx)(`span`,{className:`z-markdown__cursor`,"aria-hidden":`true`}):null;switch(e.kind){case`paragraph`:return(0,x.jsxs)(`p`,{children:[(0,x.jsx)(pg,{nodes:e.children}),r]});case`heading`:{let t=`h${e.level}`;return(0,x.jsxs)(t,{children:[(0,x.jsx)(pg,{nodes:e.children}),r]})}case`list`:{let t=e.ordered?`ol`:`ul`;return(0,x.jsx)(t,{children:e.items.map((t,n)=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(pg,{nodes:t}),n===e.items.length-1?r:null]},n))})}case`code`:return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ag,{code:e.code,language:e.language||void 0}),r]});case`quote`:return(0,x.jsxs)(`blockquote`,{children:[(0,x.jsx)(pg,{nodes:e.children}),r]});case`table`:return(0,x.jsxs)(Y,{density:`sm`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsx)(Y.Row,{children:e.header.map((e,t)=>(0,x.jsx)(Y.HeadCell,{children:(0,x.jsx)(pg,{nodes:e})},t))})}),(0,x.jsx)(Y.Body,{children:e.rows.map((e,t)=>(0,x.jsx)(Y.Row,{children:e.map((e,t)=>(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(pg,{nodes:e})},t))},t))})]});case`rule`:return(0,x.jsx)(`hr`,{})}}function pg({nodes:e}){return e.map((e,t)=>{switch(e.kind){case`text`:return e.text;case`code`:return(0,x.jsx)(`code`,{children:e.text},t);case`strong`:return(0,x.jsx)(`strong`,{children:(0,x.jsx)(pg,{nodes:e.children})},t);case`em`:return(0,x.jsx)(`em`,{children:(0,x.jsx)(pg,{nodes:e.children})},t);case`link`:return(0,x.jsx)(`a`,{href:e.href,target:e.href.startsWith(`http`)?`_blank`:void 0,rel:e.href.startsWith(`http`)?`noreferrer`:void 0,children:(0,x.jsx)(pg,{nodes:e.children})},t)}})}var mg=Object.defineProperty,hg=(e,t)=>mg(e,`name`,{value:t,configurable:!0}),gg=`Tabs`,[_g,vg]=T(gg,[rc]),yg=rc(),[bg,xg]=_g(gg),Sg=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=G(s),[d,f]=kt({prop:r,onChange:i,defaultProp:a??``,caller:gg});return(0,x.jsx)(bg,{scope:n,baseId:bt(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,x.jsx)(L.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Cg=`TabsList`,wg=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=xg(Cg,n),o=yg(n);return(0,x.jsx)(hc,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,x.jsx)(L.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Tg=`TabsTrigger`,Eg=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=xg(Tg,n),s=yg(n),c=kg(o.baseId,r),l=Ag(o.baseId,r),u=r===o.value;return(0,x.jsx)(gc,{asChild:!0,...s,focusable:!i,active:u,children:(0,x.jsx)(L.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:U(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:U(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Dg=`TabsContent`,Og=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=xg(Dg,n),c=kg(s.baseId,r),l=Ag(s.baseId,r),u=r===s.value,d=b.useRef(u);return b.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,x.jsx)(bn,{present:i||u,children:({present:n})=>(0,x.jsx)(L.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function kg(e,t){return`${e}-trigger-${t}`}hg(kg,`makeTriggerId`);function Ag(e,t){return`${e}-content-${t}`}hg(Ag,`makeContentId`);var jg=Sg,Mg=wg,Ng=Eg,Pg=Og,Fg=(0,b.forwardRef)(function({variant:e=`line`,size:t=`md`,className:n,...r},i){return(0,x.jsx)(jg,{ref:i,className:R(`z-tabs`,n),"data-variant":e,"data-size":t,...r})}),Ig=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Mg,{ref:n,className:R(`z-tabs__list`,e),...t})}),Lg=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Ng,{ref:n,className:R(`z-tabs__trigger z-focusable`,e),...t})}),Rg=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Pg,{ref:n,className:R(`z-tabs__content z-focusable`,e),...t})}),Z=Object.assign(Fg,{List:Ig,Trigger:Lg,Content:Rg}),zg=(0,b.forwardRef)(function({variant:e=`text`,width:t,height:n,lines:r=1,className:i,style:a,...o},s){return e===`text`&&r>1?(0,x.jsx)(`span`,{ref:s,className:R(`z-skeleton-lines`,i),"aria-hidden":`true`,style:a,...o,children:Array.from({length:r},(e,n)=>(0,x.jsx)(`span`,{className:`z-skeleton`,"data-variant":`text`,style:{width:n===r-1?`60%`:t}},n))}):(0,x.jsx)(`span`,{ref:s,className:R(`z-skeleton`,i),"data-variant":e,"aria-hidden":`true`,style:{width:t,height:n,...a},...o})}),Bg=(0,b.forwardRef)(function({label:e=`Thinking`,showLabel:t=!1,size:n=`md`,className:r,...i},a){return(0,x.jsxs)(`span`,{ref:a,className:R(`z-loader`,r),"data-size":n,role:`status`,"aria-label":e,...i,children:[(0,x.jsxs)(`span`,{className:`z-loader__dots`,"aria-hidden":`true`,children:[(0,x.jsx)(`span`,{}),(0,x.jsx)(`span`,{}),(0,x.jsx)(`span`,{})]}),t&&(0,x.jsx)(`span`,{className:`z-loader__label`,children:e})]})}),Vg=(0,b.forwardRef)(function({title:e,description:t,icon:n,action:r,size:i=`md`,tone:a=`neutral`,className:o,...s},c){return(0,x.jsxs)(`div`,{ref:c,className:R(`z-empty`,o),"data-size":i,"data-tone":a,...s,children:[n&&(0,x.jsx)(`span`,{className:`z-empty__icon`,"aria-hidden":`true`,children:n}),(0,x.jsx)(`p`,{className:`z-empty__title`,children:e}),t&&(0,x.jsx)(`p`,{className:`z-empty__description`,children:t}),r&&(0,x.jsx)(`div`,{className:`z-empty__action`,children:r})]})});function Hg({columns:e,cards:t,cardId:n,cardColumn:r,renderCard:i,cardLabel:a,onMove:o,density:s=`md`,label:c,className:l}){let[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(``),g=(0,b.useId)(),_=(0,b.useRef)(new Map),v=(0,b.useCallback)(e=>t.filter(t=>r(t)===e),[t,r]),y=(0,b.useCallback)((e,t,r,i)=>{(t!==r||v(t).findIndex(t=>n(t)===e)!==i)&&o?.({cardId:e,from:t,to:r,index:i})},[v,n,o]);(0,b.useEffect)(()=>{u&&_.current.get(u.id)?.focus()},[u,t]);let S=(e,t)=>{u&&(y(u.id,u.column,e,t),d(null),p(null))},C=(t,i,o,s)=>{if(t.target!==t.currentTarget)return;let c=n(i),l=t.key;if(l===` `||l===`Enter`){if(t.preventDefault(),!u)d({id:c,column:r(i),index:s}),h(`${a(i)} lifted. Use the arrow keys to move it, Enter to drop, Escape to cancel.`);else{let t=f??{column:u.column,index:u.index},n=e.find(e=>e.id===t.column);y(u.id,u.column,t.column,t.index),h(`${a(i)} moved to ${typeof n?.title==`string`?n.title:t.column}, position ${t.index+1}.`),d(null),p(null)}return}if(l===`Escape`&&u){t.preventDefault(),h(`${a(i)} put back.`),d(null),p(null);return}if(!u)return;let m=f??{column:u.column,index:u.index},g=e.findIndex(e=>e.id===m.column);if(l===`ArrowLeft`||l===`ArrowRight`){t.preventDefault();let r=e[g+(l===`ArrowRight`?1:-1)];if(!r)return;let i=v(r.id).filter(e=>n(e)!==u.id).length,a=Math.min(m.index,i);p({column:r.id,index:a}),h(`Over ${typeof r.title==`string`?r.title:r.id}, position ${a+1}.`);return}if(l===`ArrowUp`||l===`ArrowDown`){t.preventDefault();let e=v(m.column).filter(e=>n(e)!==u.id).length,r=Math.max(0,Math.min(e,m.index+(l===`ArrowDown`?1:-1)));p({column:m.column,index:r}),h(`Position ${r+1}.`)}};return(0,x.jsxs)(`div`,{className:R(`z-kanban`,l),"data-density":s,role:`group`,"aria-label":c,children:[(0,x.jsx)(`p`,{className:`z-sr-only`,role:`status`,"aria-live":`polite`,children:m}),e.map((e,t)=>{let r=v(e.id),o=f?.column===e.id,s=e.limit!==void 0&&r.length>e.limit;return(0,x.jsxs)(`section`,{className:`z-kanban__column`,"data-over":o||void 0,"aria-labelledby":`${g}-${e.id}`,onDragOver:t=>{u&&(t.preventDefault(),p({column:e.id,index:r.filter(e=>n(e)!==u.id).length}))},onDrop:t=>{t.preventDefault(),S(e.id,f?.column===e.id?f.index:r.length)},children:[(0,x.jsxs)(`header`,{className:`z-kanban__head`,children:[(0,x.jsx)(`h3`,{className:`z-kanban__title`,id:`${g}-${e.id}`,children:e.title}),(0,x.jsx)(z,{size:`sm`,tone:s?`warning`:`neutral`,variant:`outline`,children:e.limit===void 0?r.length:`${r.length}/${e.limit}`})]}),(0,x.jsxs)(`ul`,{className:`z-kanban__list`,children:[r.map((r,s)=>{let c=n(r),l=u?.id===c;return(0,x.jsx)(`li`,{className:`z-kanban__slot`,"data-drop":o&&f?.index===s?``:void 0,children:(0,x.jsx)(`article`,{ref:e=>{e?_.current.set(c,e):_.current.delete(c)},className:`z-kanban__card z-focusable`,tabIndex:0,draggable:!0,"data-lifted":l||void 0,"aria-roledescription":`Draggable card`,"aria-label":a(r),"aria-grabbed":l||void 0,onKeyDown:e=>C(e,r,t,s),onDragStart:()=>d({id:c,column:e.id,index:s}),onDragEnd:()=>{d(null),p(null)},children:i(r)})},c)}),r.length===0&&(0,x.jsx)(`li`,{className:`z-kanban__slot`,"data-drop":o?``:void 0,children:e.empty??(0,x.jsx)(Vg,{size:`sm`,title:`Nothing here`})})]})]},e.id)})]})}function Ug(e,t){return`${e}-option-${t}`}function Wg(e){let{options:t,label:n,description:r,error:i,placeholder:a,size:o=`md`,disabled:s,emptyMessage:c=`No matches`,className:l,id:u}=e,d=e.multiple===!0,f=(0,b.useId)(),p=u??f,m=`${p}-list`,[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(``),[y,S]=(0,b.useState)(0),C=(0,b.useRef)(null),w=(0,b.useRef)(null),T=(0,b.useRef)(null),E=(0,b.useMemo)(()=>{if(d)return e.value??[];let t=e.value;return t?[t]:[]},[d,e]),D=(0,b.useMemo)(()=>new Map(t.map(e=>[e.value,e])),[t]),O=(0,b.useMemo)(()=>{let e=_.trim().toLowerCase();return e?t.filter(t=>t.label.toLowerCase().includes(e)||(t.hint??``).toLowerCase().includes(e)):t},[t,_,d]);(0,b.useEffect)(()=>S(0),[_,h]),(0,b.useEffect)(()=>{if(!h)return;let e=e=>{T.current?.contains(e.target)||g(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[h]),(0,b.useEffect)(()=>{h&&w.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[y,h]);let k=t=>{if(!t.disabled){if(d){let n=E.includes(t.value)?E.filter(e=>e!==t.value):[...E,t.value];e.onValueChange?.(n),v(``),C.current?.focus();return}e.onValueChange?.(t.value),v(``),g(!1)}},A=t=>{d&&(e.onValueChange?.(E.filter(e=>e!==t)),C.current?.focus())},j=e=>{let t=e.key;if(t===`ArrowDown`||t===`ArrowUp`){if(e.preventDefault(),!h){g(!0);return}let n=t===`ArrowDown`?1:-1;for(let e=1;e<=O.length;e++){let t=(y+n*e+O.length*e)%O.length;if(!O[t]?.disabled){S(t);return}}return}if(t===`Enter`&&h){let t=O[y];t&&(e.preventDefault(),k(t));return}if(t===`Escape`){h&&(e.preventDefault(),g(!1));return}t===`Backspace`&&d&&_===``&&E.length&&A(E[E.length-1])},ee=(0,b.useMemo)(()=>{let e=[];for(let t of O){let n=e[e.length-1];n&&n.name===t.group?n.options.push(t):e.push({name:t.group,options:[t]})}return e},[O]),M=-1,N=[r?`${p}-description`:null,i?`${p}-error`:null].filter(Boolean).join(` `)||void 0;return(0,x.jsxs)(`div`,{ref:T,className:R(`z-combobox`,l),"data-size":o,"data-invalid":i?``:void 0,"data-disabled":s||void 0,children:[(0,x.jsx)(`label`,{className:`z-combobox__label`,htmlFor:p,children:n}),(0,x.jsxs)(`div`,{className:`z-combobox__control`,children:[d&&E.map(e=>(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`soft`,className:`z-combobox__chip`,children:[D.get(e)?.label??e,(0,x.jsx)(`button`,{type:`button`,className:`z-combobox__remove z-focusable`,"aria-label":`Remove ${D.get(e)?.label??e}`,onClick:()=>A(e),disabled:s,children:(0,x.jsx)(H.Close,{size:12})})]},e)),(0,x.jsx)(`input`,{ref:C,id:p,className:`z-combobox__input z-focusable`,role:`combobox`,type:`text`,autoComplete:`off`,"aria-expanded":h,"aria-controls":m,"aria-autocomplete":`list`,"aria-activedescendant":h&&O[y]?Ug(p,y):void 0,"aria-describedby":N,"aria-invalid":i?!0:void 0,disabled:s,placeholder:d||!E.length?a:D.get(E[0])?.label,value:_,onChange:e=>{v(e.target.value),g(!0)},onFocus:()=>g(!0),onKeyDown:j}),(0,x.jsx)(`span`,{className:`z-combobox__chevron`,"aria-hidden":`true`,children:(0,x.jsx)(H.ChevronDown,{size:16})})]}),h&&(0,x.jsxs)(`ul`,{ref:w,className:`z-combobox__list`,id:m,role:`listbox`,"aria-label":typeof n==`string`?n:void 0,"aria-multiselectable":d||void 0,children:[ee.map((e,t)=>(0,x.jsxs)(`li`,{className:`z-combobox__group`,role:`presentation`,children:[e.name&&(0,x.jsx)(`p`,{className:`z-combobox__group-name`,children:e.name}),(0,x.jsx)(`ul`,{role:`presentation`,children:e.options.map(e=>{M+=1;let t=M,n=E.includes(e.value);return(0,x.jsxs)(`li`,{id:Ug(p,t),"data-value":e.value,className:`z-combobox__option`,role:`option`,"aria-selected":n,"aria-disabled":e.disabled||void 0,"data-active":t===y,"data-selected":n||void 0,onPointerDown:t=>{t.preventDefault(),k(e)},onPointerEnter:()=>S(t),children:[(0,x.jsx)(`span`,{className:`z-combobox__option-label`,children:e.label}),e.hint&&(0,x.jsx)(`span`,{className:`z-combobox__option-hint`,children:e.hint}),n&&(0,x.jsx)(`span`,{className:`z-combobox__tick`,"aria-hidden":`true`,children:(0,x.jsx)(H.Check,{size:14})})]},e.value)})})]},e.name??`g${t}`)),O.length===0&&(0,x.jsx)(`li`,{className:`z-combobox__empty`,role:`presentation`,children:c})]}),r&&!i&&(0,x.jsx)(`p`,{className:`z-combobox__description`,id:`${p}-description`,children:r}),i&&(0,x.jsx)(`p`,{className:`z-combobox__error`,id:`${p}-error`,children:i})]})}var Gg=[`new`,`reviewing`,`applying`,`ready`,`applied`,`interviewing`,`offer`,`rejected`,`passed`],Kg=[`wrong role shape`,`weak evidence match`,`compensation`,`location or authorisation`,`too managerial`,`too visual`,`too engineering`,`stale or duplicate`,`company`],qg=[`recruiter`,`hiring-manager`,`interviewer`,`referral`,`other`];async function Q(e,t){let n=await fetch(e,{headers:{"content-type":`application/json`},...t}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||`${n.status} ${n.statusText}`);return r}var $={summary:()=>Q(`/api/summary`),jobs:e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&r!==null&&t.set(n,String(r));return Q(`/api/jobs?${t}`)},facets:e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&r!==null&&t.set(n,String(r));return Q(`/api/jobs/facets?${t}`)},job:e=>Q(`/api/jobs/${encodeURIComponent(e)}`),attachPosting:(e,t,n=!1)=>Q(`/api/jobs/${encodeURIComponent(e)}/attach`,{method:`POST`,body:JSON.stringify({url:t,linkOnly:n})}),settings:()=>Q(`/api/settings`),saveSettings:e=>Q(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),resumes:()=>Q(`/api/resumes`),useResume:e=>Q(`/api/resumes/use`,{method:`POST`,body:JSON.stringify({name:e})}),openResume:e=>Q(`/api/resumes/open`,{method:`POST`,body:JSON.stringify({name:e})}),revealJob:e=>Q(`/api/jobs/${encodeURIComponent(e)}/reveal`,{method:`POST`}),importLinks:e=>Q(`/api/jobs/import`,{method:`POST`,body:JSON.stringify({urls:e})}),today:(e=7)=>Q(`/api/today?cap=${e}`),setStatus:(e,t,n)=>Q(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({status:t,reason:n})}),addNote:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({note:t})}),packet:e=>Q(`/api/jobs/${encodeURIComponent(e)}/packet`),coverLetter:e=>Q(`/api/jobs/${encodeURIComponent(e)}/cover-letter`),writeCoverLetter:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/cover-letter`,{method:`POST`,body:JSON.stringify(t)}),tailoredResume:e=>Q(`/api/jobs/${encodeURIComponent(e)}/resume`),writeTailoredResume:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/resume`,{method:`POST`,body:JSON.stringify(t)}),saveTailoredResume:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/resume`,{method:`PUT`,body:JSON.stringify({text:t})}),resumePrintUrl:e=>`/api/jobs/${encodeURIComponent(e)}/resume.html`,saveCoverLetter:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/cover-letter`,{method:`PUT`,body:JSON.stringify({text:t})}),saveApplication:(e,t,n)=>Q(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({application:{field:t,value:n}})}),runs:()=>Q(`/api/runs`),scan:()=>Q(`/api/scan`),startScan:(e=!1,t,n=!1)=>Q(`/api/scan`,{method:`POST`,body:JSON.stringify({dry:e,criteria:t||``,retryFailed:n})}),criteria:()=>Q(`/api/criteria`),saveCriteria:e=>Q(`/api/criteria`,{method:`PUT`,body:JSON.stringify({raw:e})}),outcomes:()=>Q(`/api/outcomes`),views:()=>Q(`/api/views`),defaultViews:()=>Q(`/api/views/defaults`),saveViews:e=>Q(`/api/views`,{method:`PUT`,body:JSON.stringify({views:e})}),mail:()=>Q(`/api/mail`),mailCheck:e=>Q(`/api/mail/check`,{method:`POST`,body:JSON.stringify({sinceDays:e})}),mailConfirm:(e,t)=>Q(`/api/mail/${encodeURIComponent(e)}/confirm`,{method:`POST`,body:JSON.stringify({noteId:t})}),mailConfirmSafe:()=>Q(`/api/mail/confirm-safe`,{method:`POST`}),mailDismiss:e=>Q(`/api/mail/${encodeURIComponent(e)}/dismiss`,{method:`POST`}),previewCriteria:e=>Q(`/api/criteria/preview`,{method:`POST`,body:JSON.stringify({raw:e})}),rescoreNotes:(e=!1)=>Q(`/api/rescore`,{method:`POST`,body:JSON.stringify({dry:e})}),criteriaPresets:()=>Q(`/api/criteria/presets`),criteriaPreset:e=>Q(`/api/criteria/presets/${encodeURIComponent(e)}`),saveCriteriaPreset:(e,t)=>Q(`/api/criteria/presets/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({raw:t})}),deleteCriteriaPreset:e=>Q(`/api/criteria/presets/${encodeURIComponent(e)}`,{method:`DELETE`}),activateCriteriaPreset:e=>Q(`/api/criteria/presets/${encodeURIComponent(e)}/activate`,{method:`POST`}),profileNotes:()=>Q(`/api/profile`),profileSummary:()=>Q(`/api/profile/summary`),saveProfileNote:(e,t)=>Q(`/api/profile`,{method:`PUT`,body:JSON.stringify({note:e,markdown:t})}),snippets:()=>Q(`/api/snippets`),saveSnippets:e=>Q(`/api/snippets`,{method:`PUT`,body:JSON.stringify({items:e})}),people:()=>Q(`/api/people`),person:e=>Q(`/api/people/${encodeURIComponent(e)}`),addPerson:e=>Q(`/api/people`,{method:`POST`,body:JSON.stringify(e)}),attachPerson:(e,t,n,r)=>Q(`/api/people/${encodeURIComponent(e)}/attach`,{method:`POST`,body:JSON.stringify({jobId:t,role:n,context:r})}),logContact:(e,t,n)=>Q(`/api/people/${encodeURIComponent(e)}/log`,{method:`POST`,body:JSON.stringify({text:t,date:n})}),jobPeople:e=>Q(`/api/jobs/${encodeURIComponent(e)}/people`),jobConnections:e=>Q(`/api/jobs/${encodeURIComponent(e)}/connections`),linkedinStatus:()=>Q(`/api/linkedin`),linkedinPreview:(e,t,n)=>Q(`/api/linkedin/preview`,{method:`POST`,body:JSON.stringify({source:e,since:t,everyone:n})}),linkedinImport:(e,t={})=>Q(`/api/linkedin/import`,{method:`POST`,body:JSON.stringify({source:e,...t})}),tools:()=>Q(`/api/tools`),companies:()=>Q(`/api/companies`),addCompany:e=>Q(`/api/companies`,{method:`POST`,body:JSON.stringify(e)}),findBoard:(e,t,n)=>Q(`/api/companies/find?slug=${encodeURIComponent(e)}&ats=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`),moveBoard:e=>Q(`/api/companies/move`,{method:`POST`,body:JSON.stringify(e)}),feeds:()=>Q(`/api/feeds`),onboarding:()=>Q(`/api/onboarding`),initProfile:()=>Q(`/api/onboarding/init`,{method:`POST`,body:`{}`}),importResume:e=>Q(`/api/onboarding/resume`,{method:`POST`,body:JSON.stringify({path:e})})},Jg=e=>`$${Math.round(e/1e3)}k`,Yg=e=>{let t=(e.replace(/\s*[•·].*$/,``).split(/(?<=[a-z])(?=[A-Z])/)[0]??``).replace(/\s+/g,` `).trim();return t.length>30?t.slice(0,29).trimEnd()+`…`:t},Xg=e=>{if(!e)return``;let t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return Number.isFinite(t)?t<=0?`today`:`${t}d ago`:``},Zg={floor:`Floor`,stretch:`Stretch`,below:`Below`,unknown:`Not stated`},Qg={floor:`success`,stretch:`warning`,below:`neutral`,unknown:`neutral`},$g={new:`neutral`,reviewing:`primary`,applying:`primary`,ready:`warning`,applied:`primary`,interviewing:`warning`,offer:`success`,rejected:`danger`,passed:`neutral`};function e_(e){let[t,n]=(0,b.useState)(()=>typeof window<`u`&&window.matchMedia(e).matches);return(0,b.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var t_={name:`TekJobs`,logo:`/brand/tekjobs-avatar-192.png`};function n_({href:e=`/`}){return(0,x.jsxs)(`a`,{className:`brand-mark`,href:e,"aria-label":t_.name,children:[t_.logo&&(0,x.jsx)(`img`,{className:`brand-mark__logo`,src:t_.logo,alt:``}),(0,x.jsxs)(`span`,{"aria-hidden":`true`,children:[`Tek`,(0,x.jsx)(`span`,{className:`brand-mark__accent`,children:`Jobs`})]})]})}function r_(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(!1),u=(0,b.useRef)(null),d=()=>$.snippets().then(r).catch(e=>X({title:`Could not load the copy panel`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{e&&!n&&d()},[e]),(0,b.useEffect)(()=>{e?setTimeout(()=>u.current?.focus(),30):a(``)},[e]);let f=(0,b.useMemo)(()=>{let e=i.trim().toLowerCase(),t=(n?.items??[]).filter(t=>t.value&&(!e||`${t.group} ${t.label} ${t.value}`.toLowerCase().includes(e))),r=new Map;for(let e of t){let t=e.group||`Other`;r.has(t)||r.set(t,[]),r.get(t).push(e)}return[...r.entries()]},[n,i]),p=async e=>{try{await navigator.clipboard.writeText(e.value),s(e.label),setTimeout(()=>s(t=>t===e.label?null:t),1600)}catch(e){X({title:`Could not copy`,description:e.message,tone:`danger`})}},m=f[0]?.[1][0];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(fd,{open:e,onOpenChange:t,size:`lg`,children:[(0,x.jsx)(Bh,{content:`Copy panel`,children:(0,x.jsx)(fd.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,"aria-label":`Copy panel`,leadingIcon:(0,x.jsx)(H.Copy,{})})})}),(0,x.jsx)(fd.Content,{align:`end`,showArrow:!1,children:(0,x.jsxs)(`div`,{className:`copy`,children:[(0,x.jsx)(`form`,{className:`copy__search`,onSubmit:e=>{e.preventDefault(),m&&p(m)},children:(0,x.jsx)(Zp,{ref:u,size:`sm`,"aria-label":`Find a snippet`,placeholder:`Find, then Enter copies the first`,leadingIcon:(0,x.jsx)(H.Search,{}),value:i,onChange:e=>a(e.target.value)})}),n?f.length===0?(0,x.jsx)(`p`,{className:`muted copy__empty`,children:n.items.length===0?`Nothing here yet. Customize adds lines.`:i?`Nothing matches.`:`Every snippet is empty. Customize fills them in.`}):(0,x.jsx)(`div`,{className:`copy__groups`,children:f.map(([e,t])=>(0,x.jsxs)(`div`,{className:`copy__group`,children:[(0,x.jsx)(`div`,{className:`microlabel`,children:e}),t.map(t=>(0,x.jsx)(B,{asChild:!0,variant:`ghost`,tone:`neutral`,size:`sm`,align:`start`,className:`copy__row`,children:(0,x.jsxs)(`button`,{type:`button`,onClick:()=>p(t),title:t.value,children:[(0,x.jsx)(`span`,{className:`copy__label`,children:t.label}),(0,x.jsxs)(`span`,{className:`copy__value num`,children:[o===t.label?`Copied`:t.value.split(`
|
|
57
|
+
`)});continue}let a=/^(#{1,6})\s+(.*)$/.exec(e);if(a){n.push({kind:`heading`,level:a[1].length,children:ug(a[2])}),r++;continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){n.push({kind:`rule`}),r++;continue}if(sg(e)&&r+1<t.length&&cg(t[r+1])){let i=og(e).map(ug);r+=2;let a=[];for(;r<t.length&&sg(t[r]);)a.push(og(t[r++]).map(ug));n.push({kind:`table`,header:i,rows:a});continue}if(/^>\s?/.test(e)){let e=[];for(;r<t.length&&/^>\s?/.test(t[r]);)e.push(t[r++].replace(/^>\s?/,``));n.push({kind:`quote`,children:ug(e.join(` `))});continue}let o=/^\s*([-*+]|\d+[.)])\s+/.exec(e);if(o){let e=/\d/.test(o[1]),i=[];for(;r<t.length;){let e=/^\s*([-*+]|\d+[.)])\s+(.*)$/.exec(t[r]);if(!e)break;let n=e[2];for(r++;r<t.length&&/^\s{2,}\S/.test(t[r])&&!/^\s*([-*+]|\d+[.)])\s+/.test(t[r]);)n+=` `+t[r++].trim();i.push(ug(n))}n.push({kind:`list`,ordered:e,items:i});continue}let s=[];for(;r<t.length&&t[r].trim()!==``&&!/^```/.test(t[r])&&!/^(#{1,6})\s/.test(t[r])&&!/^\s*([-*+]|\d+[.)])\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!(sg(t[r])&&r+1<t.length&&cg(t[r+1]));)s.push(t[r++].trim());n.push({kind:`paragraph`,children:ug(s.join(` `))})}return n}function ug(e){let t=[],n=e,r=e=>{let n=t[t.length-1];e.kind===`text`&&n?.kind===`text`?n.text+=e.text:t.push(e)};for(;n.length;){let e=/^`([^`]+)`/.exec(n);if(e){r({kind:`code`,text:e[1]}),n=n.slice(e[0].length);continue}let t=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+|\/[^\s)]*|#[^\s)]*)\)/.exec(n);if(t){r({kind:`link`,href:t[2],children:ug(t[1])}),n=n.slice(t[0].length);continue}let i=/^(\*\*|__)(.+?)\1/.exec(n);if(i){r({kind:`strong`,children:ug(i[2])}),n=n.slice(i[0].length);continue}let a=/^(\*|_)([^*_]+?)\1/.exec(n);if(a){r({kind:`em`,children:ug(a[2])}),n=n.slice(a[0].length);continue}let o=n.slice(1).search(/[`*_[]/),s=o===-1?n.length:o+1;r({kind:`text`,text:n.slice(0,s)}),n=n.slice(s)}return t}var dg=(0,b.forwardRef)(function({text:e,streaming:t=!1,className:n,...r},i){let a=lg(e);return(0,x.jsxs)(`div`,{ref:i,className:R(`z-markdown`,n),"data-streaming":t||void 0,...r,children:[a.map((e,n)=>(0,x.jsx)(fg,{block:e,last:n===a.length-1,streaming:t},n)),t&&a.length===0&&(0,x.jsx)(`span`,{className:`z-markdown__cursor`,"aria-hidden":`true`})]})});function fg({block:e,last:t,streaming:n}){let r=t&&n?(0,x.jsx)(`span`,{className:`z-markdown__cursor`,"aria-hidden":`true`}):null;switch(e.kind){case`paragraph`:return(0,x.jsxs)(`p`,{children:[(0,x.jsx)(pg,{nodes:e.children}),r]});case`heading`:{let t=`h${e.level}`;return(0,x.jsxs)(t,{children:[(0,x.jsx)(pg,{nodes:e.children}),r]})}case`list`:{let t=e.ordered?`ol`:`ul`;return(0,x.jsx)(t,{children:e.items.map((t,n)=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(pg,{nodes:t}),n===e.items.length-1?r:null]},n))})}case`code`:return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ag,{code:e.code,language:e.language||void 0}),r]});case`quote`:return(0,x.jsxs)(`blockquote`,{children:[(0,x.jsx)(pg,{nodes:e.children}),r]});case`table`:return(0,x.jsxs)(Y,{density:`sm`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsx)(Y.Row,{children:e.header.map((e,t)=>(0,x.jsx)(Y.HeadCell,{children:(0,x.jsx)(pg,{nodes:e})},t))})}),(0,x.jsx)(Y.Body,{children:e.rows.map((e,t)=>(0,x.jsx)(Y.Row,{children:e.map((e,t)=>(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(pg,{nodes:e})},t))},t))})]});case`rule`:return(0,x.jsx)(`hr`,{})}}function pg({nodes:e}){return e.map((e,t)=>{switch(e.kind){case`text`:return e.text;case`code`:return(0,x.jsx)(`code`,{children:e.text},t);case`strong`:return(0,x.jsx)(`strong`,{children:(0,x.jsx)(pg,{nodes:e.children})},t);case`em`:return(0,x.jsx)(`em`,{children:(0,x.jsx)(pg,{nodes:e.children})},t);case`link`:return(0,x.jsx)(`a`,{href:e.href,target:e.href.startsWith(`http`)?`_blank`:void 0,rel:e.href.startsWith(`http`)?`noreferrer`:void 0,children:(0,x.jsx)(pg,{nodes:e.children})},t)}})}var mg=Object.defineProperty,hg=(e,t)=>mg(e,`name`,{value:t,configurable:!0}),gg=`Tabs`,[_g,vg]=T(gg,[rc]),yg=rc(),[bg,xg]=_g(gg),Sg=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=G(s),[d,f]=kt({prop:r,onChange:i,defaultProp:a??``,caller:gg});return(0,x.jsx)(bg,{scope:n,baseId:bt(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,x.jsx)(L.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Cg=`TabsList`,wg=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=xg(Cg,n),o=yg(n);return(0,x.jsx)(hc,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,x.jsx)(L.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Tg=`TabsTrigger`,Eg=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=xg(Tg,n),s=yg(n),c=kg(o.baseId,r),l=Ag(o.baseId,r),u=r===o.value;return(0,x.jsx)(gc,{asChild:!0,...s,focusable:!i,active:u,children:(0,x.jsx)(L.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:U(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:U(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:U(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Dg=`TabsContent`,Og=b.forwardRef(hg(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=xg(Dg,n),c=kg(s.baseId,r),l=Ag(s.baseId,r),u=r===s.value,d=b.useRef(u);return b.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,x.jsx)(bn,{present:i||u,children:({present:n})=>(0,x.jsx)(L.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function kg(e,t){return`${e}-trigger-${t}`}hg(kg,`makeTriggerId`);function Ag(e,t){return`${e}-content-${t}`}hg(Ag,`makeContentId`);var jg=Sg,Mg=wg,Ng=Eg,Pg=Og,Fg=(0,b.forwardRef)(function({variant:e=`line`,size:t=`md`,className:n,...r},i){return(0,x.jsx)(jg,{ref:i,className:R(`z-tabs`,n),"data-variant":e,"data-size":t,...r})}),Ig=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Mg,{ref:n,className:R(`z-tabs__list`,e),...t})}),Lg=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Ng,{ref:n,className:R(`z-tabs__trigger z-focusable`,e),...t})}),Rg=(0,b.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Pg,{ref:n,className:R(`z-tabs__content z-focusable`,e),...t})}),Z=Object.assign(Fg,{List:Ig,Trigger:Lg,Content:Rg}),zg=(0,b.forwardRef)(function({variant:e=`text`,width:t,height:n,lines:r=1,className:i,style:a,...o},s){return e===`text`&&r>1?(0,x.jsx)(`span`,{ref:s,className:R(`z-skeleton-lines`,i),"aria-hidden":`true`,style:a,...o,children:Array.from({length:r},(e,n)=>(0,x.jsx)(`span`,{className:`z-skeleton`,"data-variant":`text`,style:{width:n===r-1?`60%`:t}},n))}):(0,x.jsx)(`span`,{ref:s,className:R(`z-skeleton`,i),"data-variant":e,"aria-hidden":`true`,style:{width:t,height:n,...a},...o})}),Bg=(0,b.forwardRef)(function({label:e=`Thinking`,showLabel:t=!1,size:n=`md`,className:r,...i},a){return(0,x.jsxs)(`span`,{ref:a,className:R(`z-loader`,r),"data-size":n,role:`status`,"aria-label":e,...i,children:[(0,x.jsxs)(`span`,{className:`z-loader__dots`,"aria-hidden":`true`,children:[(0,x.jsx)(`span`,{}),(0,x.jsx)(`span`,{}),(0,x.jsx)(`span`,{})]}),t&&(0,x.jsx)(`span`,{className:`z-loader__label`,children:e})]})}),Vg=(0,b.forwardRef)(function({title:e,description:t,icon:n,action:r,size:i=`md`,tone:a=`neutral`,className:o,...s},c){return(0,x.jsxs)(`div`,{ref:c,className:R(`z-empty`,o),"data-size":i,"data-tone":a,...s,children:[n&&(0,x.jsx)(`span`,{className:`z-empty__icon`,"aria-hidden":`true`,children:n}),(0,x.jsx)(`p`,{className:`z-empty__title`,children:e}),t&&(0,x.jsx)(`p`,{className:`z-empty__description`,children:t}),r&&(0,x.jsx)(`div`,{className:`z-empty__action`,children:r})]})});function Hg({columns:e,cards:t,cardId:n,cardColumn:r,renderCard:i,cardLabel:a,onMove:o,density:s=`md`,label:c,className:l}){let[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(``),g=(0,b.useId)(),_=(0,b.useRef)(new Map),v=(0,b.useCallback)(e=>t.filter(t=>r(t)===e),[t,r]),y=(0,b.useCallback)((e,t,r,i)=>{(t!==r||v(t).findIndex(t=>n(t)===e)!==i)&&o?.({cardId:e,from:t,to:r,index:i})},[v,n,o]);(0,b.useEffect)(()=>{u&&_.current.get(u.id)?.focus()},[u,t]);let S=(e,t)=>{u&&(y(u.id,u.column,e,t),d(null),p(null))},C=(t,i,o,s)=>{if(t.target!==t.currentTarget)return;let c=n(i),l=t.key;if(l===` `||l===`Enter`){if(t.preventDefault(),!u)d({id:c,column:r(i),index:s}),h(`${a(i)} lifted. Use the arrow keys to move it, Enter to drop, Escape to cancel.`);else{let t=f??{column:u.column,index:u.index},n=e.find(e=>e.id===t.column);y(u.id,u.column,t.column,t.index),h(`${a(i)} moved to ${typeof n?.title==`string`?n.title:t.column}, position ${t.index+1}.`),d(null),p(null)}return}if(l===`Escape`&&u){t.preventDefault(),h(`${a(i)} put back.`),d(null),p(null);return}if(!u)return;let m=f??{column:u.column,index:u.index},g=e.findIndex(e=>e.id===m.column);if(l===`ArrowLeft`||l===`ArrowRight`){t.preventDefault();let r=e[g+(l===`ArrowRight`?1:-1)];if(!r)return;let i=v(r.id).filter(e=>n(e)!==u.id).length,a=Math.min(m.index,i);p({column:r.id,index:a}),h(`Over ${typeof r.title==`string`?r.title:r.id}, position ${a+1}.`);return}if(l===`ArrowUp`||l===`ArrowDown`){t.preventDefault();let e=v(m.column).filter(e=>n(e)!==u.id).length,r=Math.max(0,Math.min(e,m.index+(l===`ArrowDown`?1:-1)));p({column:m.column,index:r}),h(`Position ${r+1}.`)}};return(0,x.jsxs)(`div`,{className:R(`z-kanban`,l),"data-density":s,role:`group`,"aria-label":c,children:[(0,x.jsx)(`p`,{className:`z-sr-only`,role:`status`,"aria-live":`polite`,children:m}),e.map((e,t)=>{let r=v(e.id),o=f?.column===e.id,s=e.limit!==void 0&&r.length>e.limit;return(0,x.jsxs)(`section`,{className:`z-kanban__column`,"data-over":o||void 0,"aria-labelledby":`${g}-${e.id}`,onDragOver:t=>{u&&(t.preventDefault(),p({column:e.id,index:r.filter(e=>n(e)!==u.id).length}))},onDrop:t=>{t.preventDefault(),S(e.id,f?.column===e.id?f.index:r.length)},children:[(0,x.jsxs)(`header`,{className:`z-kanban__head`,children:[(0,x.jsx)(`h3`,{className:`z-kanban__title`,id:`${g}-${e.id}`,children:e.title}),(0,x.jsx)(z,{size:`sm`,tone:s?`warning`:`neutral`,variant:`outline`,children:e.limit===void 0?r.length:`${r.length}/${e.limit}`})]}),(0,x.jsxs)(`ul`,{className:`z-kanban__list`,children:[r.map((r,s)=>{let c=n(r),l=u?.id===c;return(0,x.jsx)(`li`,{className:`z-kanban__slot`,"data-drop":o&&f?.index===s?``:void 0,children:(0,x.jsx)(`article`,{ref:e=>{e?_.current.set(c,e):_.current.delete(c)},className:`z-kanban__card z-focusable`,tabIndex:0,draggable:!0,"data-lifted":l||void 0,"aria-roledescription":`Draggable card`,"aria-label":a(r),"aria-grabbed":l||void 0,onKeyDown:e=>C(e,r,t,s),onDragStart:()=>d({id:c,column:e.id,index:s}),onDragEnd:()=>{d(null),p(null)},children:i(r)})},c)}),r.length===0&&(0,x.jsx)(`li`,{className:`z-kanban__slot`,"data-drop":o?``:void 0,children:e.empty??(0,x.jsx)(Vg,{size:`sm`,title:`Nothing here`})})]})]},e.id)})]})}function Ug(e,t){return`${e}-option-${t}`}function Wg(e){let{options:t,label:n,description:r,error:i,placeholder:a,size:o=`md`,disabled:s,emptyMessage:c=`No matches`,className:l,id:u}=e,d=e.multiple===!0,f=(0,b.useId)(),p=u??f,m=`${p}-list`,[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(``),[y,S]=(0,b.useState)(0),C=(0,b.useRef)(null),w=(0,b.useRef)(null),T=(0,b.useRef)(null),E=(0,b.useMemo)(()=>{if(d)return e.value??[];let t=e.value;return t?[t]:[]},[d,e]),D=(0,b.useMemo)(()=>new Map(t.map(e=>[e.value,e])),[t]),O=(0,b.useMemo)(()=>{let e=_.trim().toLowerCase();return e?t.filter(t=>t.label.toLowerCase().includes(e)||(t.hint??``).toLowerCase().includes(e)):t},[t,_,d]);(0,b.useEffect)(()=>S(0),[_,h]),(0,b.useEffect)(()=>{if(!h)return;let e=e=>{T.current?.contains(e.target)||g(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[h]),(0,b.useEffect)(()=>{h&&w.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[y,h]);let k=t=>{if(!t.disabled){if(d){let n=E.includes(t.value)?E.filter(e=>e!==t.value):[...E,t.value];e.onValueChange?.(n),v(``),C.current?.focus();return}e.onValueChange?.(t.value),v(``),g(!1)}},A=t=>{d&&(e.onValueChange?.(E.filter(e=>e!==t)),C.current?.focus())},j=e=>{let t=e.key;if(t===`ArrowDown`||t===`ArrowUp`){if(e.preventDefault(),!h){g(!0);return}let n=t===`ArrowDown`?1:-1;for(let e=1;e<=O.length;e++){let t=(y+n*e+O.length*e)%O.length;if(!O[t]?.disabled){S(t);return}}return}if(t===`Enter`&&h){let t=O[y];t&&(e.preventDefault(),k(t));return}if(t===`Escape`){h&&(e.preventDefault(),g(!1));return}t===`Backspace`&&d&&_===``&&E.length&&A(E[E.length-1])},ee=(0,b.useMemo)(()=>{let e=[];for(let t of O){let n=e[e.length-1];n&&n.name===t.group?n.options.push(t):e.push({name:t.group,options:[t]})}return e},[O]),M=-1,N=[r?`${p}-description`:null,i?`${p}-error`:null].filter(Boolean).join(` `)||void 0;return(0,x.jsxs)(`div`,{ref:T,className:R(`z-combobox`,l),"data-size":o,"data-invalid":i?``:void 0,"data-disabled":s||void 0,children:[(0,x.jsx)(`label`,{className:`z-combobox__label`,htmlFor:p,children:n}),(0,x.jsxs)(`div`,{className:`z-combobox__control`,children:[d&&E.map(e=>(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`soft`,className:`z-combobox__chip`,children:[D.get(e)?.label??e,(0,x.jsx)(`button`,{type:`button`,className:`z-combobox__remove z-focusable`,"aria-label":`Remove ${D.get(e)?.label??e}`,onClick:()=>A(e),disabled:s,children:(0,x.jsx)(H.Close,{size:12})})]},e)),(0,x.jsx)(`input`,{ref:C,id:p,className:`z-combobox__input z-focusable`,role:`combobox`,type:`text`,autoComplete:`off`,"aria-expanded":h,"aria-controls":m,"aria-autocomplete":`list`,"aria-activedescendant":h&&O[y]?Ug(p,y):void 0,"aria-describedby":N,"aria-invalid":i?!0:void 0,disabled:s,placeholder:d||!E.length?a:D.get(E[0])?.label,value:_,onChange:e=>{v(e.target.value),g(!0)},onFocus:()=>g(!0),onKeyDown:j}),(0,x.jsx)(`span`,{className:`z-combobox__chevron`,"aria-hidden":`true`,children:(0,x.jsx)(H.ChevronDown,{size:16})})]}),h&&(0,x.jsxs)(`ul`,{ref:w,className:`z-combobox__list`,id:m,role:`listbox`,"aria-label":typeof n==`string`?n:void 0,"aria-multiselectable":d||void 0,children:[ee.map((e,t)=>(0,x.jsxs)(`li`,{className:`z-combobox__group`,role:`presentation`,children:[e.name&&(0,x.jsx)(`p`,{className:`z-combobox__group-name`,children:e.name}),(0,x.jsx)(`ul`,{role:`presentation`,children:e.options.map(e=>{M+=1;let t=M,n=E.includes(e.value);return(0,x.jsxs)(`li`,{id:Ug(p,t),"data-value":e.value,className:`z-combobox__option`,role:`option`,"aria-selected":n,"aria-disabled":e.disabled||void 0,"data-active":t===y,"data-selected":n||void 0,onPointerDown:t=>{t.preventDefault(),k(e)},onPointerEnter:()=>S(t),children:[(0,x.jsx)(`span`,{className:`z-combobox__option-label`,children:e.label}),e.hint&&(0,x.jsx)(`span`,{className:`z-combobox__option-hint`,children:e.hint}),n&&(0,x.jsx)(`span`,{className:`z-combobox__tick`,"aria-hidden":`true`,children:(0,x.jsx)(H.Check,{size:14})})]},e.value)})})]},e.name??`g${t}`)),O.length===0&&(0,x.jsx)(`li`,{className:`z-combobox__empty`,role:`presentation`,children:c})]}),r&&!i&&(0,x.jsx)(`p`,{className:`z-combobox__description`,id:`${p}-description`,children:r}),i&&(0,x.jsx)(`p`,{className:`z-combobox__error`,id:`${p}-error`,children:i})]})}var Gg=[`new`,`reviewing`,`applying`,`ready`,`applied`,`interviewing`,`offer`,`rejected`,`passed`],Kg=[`wrong role shape`,`weak evidence match`,`compensation`,`location or authorisation`,`too managerial`,`too visual`,`too engineering`,`stale or duplicate`,`company`],qg=[`recruiter`,`hiring-manager`,`interviewer`,`referral`,`other`];async function Q(e,t){let n=await fetch(e,{headers:{"content-type":`application/json`},...t}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error||`${n.status} ${n.statusText}`);return r}var $={summary:()=>Q(`/api/summary`),jobs:e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&r!==null&&t.set(n,String(r));return Q(`/api/jobs?${t}`)},facets:e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&r!==null&&t.set(n,String(r));return Q(`/api/jobs/facets?${t}`)},job:e=>Q(`/api/jobs/${encodeURIComponent(e)}`),attachPosting:(e,t,n=!1)=>Q(`/api/jobs/${encodeURIComponent(e)}/attach`,{method:`POST`,body:JSON.stringify({url:t,linkOnly:n})}),settings:()=>Q(`/api/settings`),saveSettings:e=>Q(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),resumes:()=>Q(`/api/resumes`),useResume:e=>Q(`/api/resumes/use`,{method:`POST`,body:JSON.stringify({name:e})}),openResume:e=>Q(`/api/resumes/open`,{method:`POST`,body:JSON.stringify({name:e})}),revealJob:e=>Q(`/api/jobs/${encodeURIComponent(e)}/reveal`,{method:`POST`}),importLinks:e=>Q(`/api/jobs/import`,{method:`POST`,body:JSON.stringify({urls:e})}),today:(e=7)=>Q(`/api/today?cap=${e}`),setStatus:(e,t,n)=>Q(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({status:t,reason:n})}),addNote:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({note:t})}),packet:e=>Q(`/api/jobs/${encodeURIComponent(e)}/packet`),coverLetter:e=>Q(`/api/jobs/${encodeURIComponent(e)}/cover-letter`),writeCoverLetter:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/cover-letter`,{method:`POST`,body:JSON.stringify(t)}),tailoredResume:e=>Q(`/api/jobs/${encodeURIComponent(e)}/resume`),writeTailoredResume:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/resume`,{method:`POST`,body:JSON.stringify(t)}),saveTailoredResume:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/resume`,{method:`PUT`,body:JSON.stringify({text:t})}),resumePrintUrl:e=>`/api/jobs/${encodeURIComponent(e)}/resume.html`,saveCoverLetter:(e,t)=>Q(`/api/jobs/${encodeURIComponent(e)}/cover-letter`,{method:`PUT`,body:JSON.stringify({text:t})}),saveApplication:(e,t,n)=>Q(`/api/jobs/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({application:{field:t,value:n}})}),runs:()=>Q(`/api/runs`),scan:()=>Q(`/api/scan`),startScan:(e=!1,t,n=!1)=>Q(`/api/scan`,{method:`POST`,body:JSON.stringify({dry:e,criteria:t||``,retryFailed:n})}),criteria:()=>Q(`/api/criteria`),saveCriteria:e=>Q(`/api/criteria`,{method:`PUT`,body:JSON.stringify({raw:e})}),outcomes:()=>Q(`/api/outcomes`),views:()=>Q(`/api/views`),defaultViews:()=>Q(`/api/views/defaults`),saveViews:e=>Q(`/api/views`,{method:`PUT`,body:JSON.stringify({views:e})}),mail:()=>Q(`/api/mail`),mailCheck:e=>Q(`/api/mail/check`,{method:`POST`,body:JSON.stringify({sinceDays:e})}),mailConfirm:(e,t)=>Q(`/api/mail/${encodeURIComponent(e)}/confirm`,{method:`POST`,body:JSON.stringify({noteId:t})}),mailConfirmSafe:()=>Q(`/api/mail/confirm-safe`,{method:`POST`}),mailDismiss:e=>Q(`/api/mail/${encodeURIComponent(e)}/dismiss`,{method:`POST`}),previewCriteria:e=>Q(`/api/criteria/preview`,{method:`POST`,body:JSON.stringify({raw:e})}),rescoreNotes:(e=!1)=>Q(`/api/rescore`,{method:`POST`,body:JSON.stringify({dry:e})}),criteriaPresets:()=>Q(`/api/criteria/presets`),criteriaPreset:e=>Q(`/api/criteria/presets/${encodeURIComponent(e)}`),saveCriteriaPreset:(e,t)=>Q(`/api/criteria/presets/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({raw:t})}),deleteCriteriaPreset:e=>Q(`/api/criteria/presets/${encodeURIComponent(e)}`,{method:`DELETE`}),activateCriteriaPreset:e=>Q(`/api/criteria/presets/${encodeURIComponent(e)}/activate`,{method:`POST`}),profileNotes:()=>Q(`/api/profile`),profileSummary:()=>Q(`/api/profile/summary`),learned:()=>Q(`/api/learned`),saveProfileNote:(e,t)=>Q(`/api/profile`,{method:`PUT`,body:JSON.stringify({note:e,markdown:t})}),snippets:()=>Q(`/api/snippets`),saveSnippets:e=>Q(`/api/snippets`,{method:`PUT`,body:JSON.stringify({items:e})}),people:()=>Q(`/api/people`),person:e=>Q(`/api/people/${encodeURIComponent(e)}`),addPerson:e=>Q(`/api/people`,{method:`POST`,body:JSON.stringify(e)}),attachPerson:(e,t,n,r)=>Q(`/api/people/${encodeURIComponent(e)}/attach`,{method:`POST`,body:JSON.stringify({jobId:t,role:n,context:r})}),logContact:(e,t,n)=>Q(`/api/people/${encodeURIComponent(e)}/log`,{method:`POST`,body:JSON.stringify({text:t,date:n})}),jobPeople:e=>Q(`/api/jobs/${encodeURIComponent(e)}/people`),jobConnections:e=>Q(`/api/jobs/${encodeURIComponent(e)}/connections`),linkedinStatus:()=>Q(`/api/linkedin`),linkedinPreview:(e,t,n)=>Q(`/api/linkedin/preview`,{method:`POST`,body:JSON.stringify({source:e,since:t,everyone:n})}),linkedinImport:(e,t={})=>Q(`/api/linkedin/import`,{method:`POST`,body:JSON.stringify({source:e,...t})}),tools:()=>Q(`/api/tools`),companies:()=>Q(`/api/companies`),addCompany:e=>Q(`/api/companies`,{method:`POST`,body:JSON.stringify(e)}),findBoard:(e,t,n)=>Q(`/api/companies/find?slug=${encodeURIComponent(e)}&ats=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`),moveBoard:e=>Q(`/api/companies/move`,{method:`POST`,body:JSON.stringify(e)}),feeds:()=>Q(`/api/feeds`),onboarding:()=>Q(`/api/onboarding`),initProfile:()=>Q(`/api/onboarding/init`,{method:`POST`,body:`{}`}),importResume:e=>Q(`/api/onboarding/resume`,{method:`POST`,body:JSON.stringify({path:e})})},Jg=e=>`$${Math.round(e/1e3)}k`,Yg=e=>{let t=(e.replace(/\s*[•·].*$/,``).split(/(?<=[a-z])(?=[A-Z])/)[0]??``).replace(/\s+/g,` `).trim();return t.length>30?t.slice(0,29).trimEnd()+`…`:t},Xg=e=>{if(!e)return``;let t=Math.floor((Date.now()-new Date(e).getTime())/864e5);return Number.isFinite(t)?t<=0?`today`:`${t}d ago`:``},Zg={floor:`Floor`,stretch:`Stretch`,below:`Below`,unknown:`Not stated`},Qg={floor:`success`,stretch:`warning`,below:`neutral`,unknown:`neutral`},$g={new:`neutral`,reviewing:`primary`,applying:`primary`,ready:`warning`,applied:`primary`,interviewing:`warning`,offer:`success`,rejected:`danger`,passed:`neutral`};function e_(e){let[t,n]=(0,b.useState)(()=>typeof window<`u`&&window.matchMedia(e).matches);return(0,b.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var t_={name:`TekJobs`,logo:`/brand/tekjobs-avatar-192.png`};function n_({href:e=`/`}){return(0,x.jsxs)(`a`,{className:`brand-mark`,href:e,"aria-label":t_.name,children:[t_.logo&&(0,x.jsx)(`img`,{className:`brand-mark__logo`,src:t_.logo,alt:``}),(0,x.jsxs)(`span`,{"aria-hidden":`true`,children:[`Tek`,(0,x.jsx)(`span`,{className:`brand-mark__accent`,children:`Jobs`})]})]})}function r_(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(!1),u=(0,b.useRef)(null),d=()=>$.snippets().then(r).catch(e=>X({title:`Could not load the copy panel`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{e&&!n&&d()},[e]),(0,b.useEffect)(()=>{e?setTimeout(()=>u.current?.focus(),30):a(``)},[e]);let f=(0,b.useMemo)(()=>{let e=i.trim().toLowerCase(),t=(n?.items??[]).filter(t=>t.value&&(!e||`${t.group} ${t.label} ${t.value}`.toLowerCase().includes(e))),r=new Map;for(let e of t){let t=e.group||`Other`;r.has(t)||r.set(t,[]),r.get(t).push(e)}return[...r.entries()]},[n,i]),p=async e=>{try{await navigator.clipboard.writeText(e.value),s(e.label),setTimeout(()=>s(t=>t===e.label?null:t),1600)}catch(e){X({title:`Could not copy`,description:e.message,tone:`danger`})}},m=f[0]?.[1][0];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(fd,{open:e,onOpenChange:t,size:`lg`,children:[(0,x.jsx)(Bh,{content:`Copy panel`,children:(0,x.jsx)(fd.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,"aria-label":`Copy panel`,leadingIcon:(0,x.jsx)(H.Copy,{})})})}),(0,x.jsx)(fd.Content,{align:`end`,showArrow:!1,children:(0,x.jsxs)(`div`,{className:`copy`,children:[(0,x.jsx)(`form`,{className:`copy__search`,onSubmit:e=>{e.preventDefault(),m&&p(m)},children:(0,x.jsx)(Zp,{ref:u,size:`sm`,"aria-label":`Find a snippet`,placeholder:`Find, then Enter copies the first`,leadingIcon:(0,x.jsx)(H.Search,{}),value:i,onChange:e=>a(e.target.value)})}),n?f.length===0?(0,x.jsx)(`p`,{className:`muted copy__empty`,children:n.items.length===0?`Nothing here yet. Customize adds lines.`:i?`Nothing matches.`:`Every snippet is empty. Customize fills them in.`}):(0,x.jsx)(`div`,{className:`copy__groups`,children:f.map(([e,t])=>(0,x.jsxs)(`div`,{className:`copy__group`,children:[(0,x.jsx)(`div`,{className:`microlabel`,children:e}),t.map(t=>(0,x.jsx)(B,{asChild:!0,variant:`ghost`,tone:`neutral`,size:`sm`,align:`start`,className:`copy__row`,children:(0,x.jsxs)(`button`,{type:`button`,onClick:()=>p(t),title:t.value,children:[(0,x.jsx)(`span`,{className:`copy__label`,children:t.label}),(0,x.jsxs)(`span`,{className:`copy__value num`,children:[o===t.label?`Copied`:t.value.split(`
|
|
58
58
|
`)[0],t.value.includes(`
|
|
59
59
|
`)&&o!==t.label?` …`:``]})]})},`${e}:${t.label}`))]},e))}):(0,x.jsx)(zg,{lines:4}),(0,x.jsxs)(`div`,{className:`copy__foot`,children:[(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,leadingIcon:(0,x.jsx)(H.Edit,{}),onClick:()=>{t(!1),l(!0)},children:`Customize`}),n&&!n.exists&&(0,x.jsx)(`span`,{className:`muted`,children:`Read from your profile until you save once.`})]})]})})]}),c&&n&&(0,x.jsx)(i_,{initial:n.items,path:n.path,onClose:()=>l(!1),onSaved:e=>{r(e),l(!1)}})]})}function i_({initial:e,path:t,onClose:n,onSaved:r}){let[i,a]=(0,b.useState)(e.length?e:[{group:``,label:``,value:``}]),[o,s]=(0,b.useState)(!1),c=(e,t)=>a(n=>n.map((n,r)=>r===e?{...n,...t}:n)),l=(e,t)=>a(n=>{let r=e+t;if(r<0||r>=n.length)return n;let i=[...n];return[i[e],i[r]]=[i[r],i[e]],i}),u=e=>a(t=>t.filter((t,n)=>n!==e));return(0,x.jsx)(Sp,{open:!0,onOpenChange:e=>!e&&n(),side:`right`,size:`md`,children:(0,x.jsx)(Sp.Content,{children:(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(Sp.Title,{children:`Customize the copy panel`}),(0,x.jsxs)(Sp.Description,{children:[`Label is the button, group is its heading, value is what lands on the clipboard. Lines with no label are dropped. Saved to `,(0,x.jsx)(`code`,{className:`mono`,children:t.split(/[\\/]/).slice(-2).join(`/`)}),`, so Obsidian works too.`]}),(0,x.jsx)(`div`,{className:`copy__rows`,children:i.map((e,t)=>(0,x.jsxs)(`div`,{className:`copy__edit`,children:[(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(Zp,{size:`sm`,label:`Label`,value:e.label,onChange:e=>c(t,{label:e.target.value})}),(0,x.jsx)(Zp,{size:`sm`,label:`Group`,value:e.group,onChange:e=>c(t,{group:e.target.value})})]}),(0,x.jsx)(Xp,{label:`Value`,rows:e.value.includes(`
|
|
60
|
-
`)?4:1,value:e.value,onChange:e=>c(t,{value:e.target.value})}),(0,x.jsxs)(`div`,{className:`copy__edit-actions`,children:[(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Move up`,leadingIcon:(0,x.jsx)(H.ArrowUp,{}),disabled:t===0,onClick:()=>l(t,-1)}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Move down`,leadingIcon:(0,x.jsx)(H.ArrowDown,{}),disabled:t===i.length-1,onClick:()=>l(t,1)}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`danger`,"aria-label":`Remove`,leadingIcon:(0,x.jsx)(H.Trash,{}),onClick:()=>u(t)})]})]},t))}),(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`neutral`,leadingIcon:(0,x.jsx)(H.Plus,{}),onClick:()=>a(e=>[...e,{group:e[e.length-1]?.group??``,label:``,value:``}]),children:`Add a line`}),(0,x.jsx)(`span`,{className:`toolbar__spacer`}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,onClick:n,children:`Cancel`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,loading:o,onClick:async()=>{s(!0);try{let e=await $.saveSnippets(i);X({title:`Copy panel saved`,description:`Profile/Snippets.md`,tone:`success`}),r(e)}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}s(!1)},children:`Save`})]})]})})})}var a_=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),o_=a_?`⌘K`:`Ctrl K`,s_=[{page:`onboarding`,label:`Get started`,icon:H.Sparkles},{page:`today`,label:`Today`,icon:H.Star},{page:`overview`,label:`Overview`,icon:H.Home},{page:`jobs`,label:`Jobs`,icon:H.Inbox},{page:`pipeline`,label:`Pipeline`,icon:H.Layers},{page:`mail`,label:`Mail`,icon:H.Mail},{page:`people`,label:`People`,icon:H.Users},{page:`companies`,label:`Sources`,icon:H.Globe},{page:`criteria`,label:`Criteria`,icon:H.Filter},{page:`profile`,label:`Profile`,icon:H.User},{page:`runs`,label:`Runs`,icon:H.Refresh},{page:`agent`,label:`Agent access`,icon:H.Terminal},{page:`settings`,label:`Settings`,icon:H.Settings}],c_={onboarding:`Get started`,today:`Today`,overview:`Overview`,jobs:`Jobs`,pipeline:`Pipeline`,mail:`Mail`,people:`People`,companies:`Sources`,criteria:`Criteria`,profile:`Profile`,runs:`Runs`,agent:`Agent access`,settings:`Settings`},l_=[{title:`Work`,pages:[`today`,`jobs`,`pipeline`,`mail`,`people`]},{title:`Insights`,pages:[`overview`]},{title:`Setup`,pages:[`profile`,`criteria`,`companies`]},{title:`System`,pages:[`runs`,`agent`,`settings`,`onboarding`]}];function u_(e){let t=(e.match(/["“]([^"”]+)["”]/)?.[1]??e.trim().split(/\s+/)[0]??``).trim();return/s$/i.test(t)?`${t}'`:`${t}'s`}function d_({page:e,onNavigate:t,onSearch:n,theme:r,onToggleTheme:i,onboarded:a=!0,counts:o={},lastScan:s=``,who:c=null,children:l}){let[u,d]=(0,b.useState)(!1),f=e_(`(max-width: 40rem)`),[p,m]=(0,b.useState)(``),h=(0,b.useRef)(null);(0,b.useEffect)(()=>{let e=e=>{if(e.key.toLowerCase()!==`k`||!(a_?e.metaKey:e.ctrlKey)||e.altKey||e.shiftKey)return;e.preventDefault();let t=h.current?.querySelector(`input`);t?.focus(),t?.select()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let[g,_]=(0,b.useState)(()=>{try{return localStorage.getItem(`tekjobs.sidebar`)===`collapsed`}catch{return!1}}),v=()=>_(e=>{try{localStorage.setItem(`tekjobs.sidebar`,e?`open`:`collapsed`)}catch{}return!e}),y=e=>{t(e),d(!1)};return(0,x.jsxs)(`div`,{className:`shell${g?` shell--collapsed`:``}${f?` shell--strip`:``}`,children:[(0,x.jsx)(`aside`,{className:`sidebar`,"aria-label":`Primary`,children:(0,x.jsx)(f_,{page:e,onNavigate:y,onboarded:a,counts:o,lastScan:s,who:c,collapsed:g||f,strip:f,onToggleCollapsed:f?void 0:v,tipSide:f?`bottom`:`right`})}),(0,x.jsxs)(`div`,{className:`main`,children:[(0,x.jsxs)(`header`,{className:`topbar`,children:[(0,x.jsxs)(Sp,{open:u,onOpenChange:d,side:`left`,size:`sm`,children:[(0,x.jsx)(Sp.Trigger,{asChild:!0,children:(0,x.jsx)(B,{className:`topbar__menu`,variant:`ghost`,size:`sm`,"aria-label":`Open navigation`,leadingIcon:(0,x.jsx)(H.Menu,{})})}),(0,x.jsxs)(Sp.Content,{children:[(0,x.jsx)(Sp.Title,{children:`Navigation`}),(0,x.jsx)(`div`,{className:`sidebar sidebar--sheet`,children:(0,x.jsx)(f_,{page:e,onNavigate:y,onboarded:a,counts:o,lastScan:s,who:c,collapsed:!1})})]})]}),(0,x.jsx)(`h1`,{className:`topbar__title`,children:c_[e]}),(0,x.jsx)(`form`,{className:`topbar__search`,onSubmit:e=>{e.preventDefault(),n(p.trim())},ref:h,children:(0,x.jsx)(Zp,{size:`sm`,placeholder:`Search company or role`,"aria-label":`Search jobs`,leadingIcon:(0,x.jsx)(H.Search,{}),trailingIcon:(0,x.jsx)(`span`,{className:`num`,children:o_}),value:p,onChange:e=>m(e.target.value)})}),(0,x.jsxs)(`div`,{className:`topbar__actions`,children:[(0,x.jsx)(r_,{}),(0,x.jsx)(Bh,{content:r===`light`?`Switch to dark`:`Switch to light`,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,onClick:i,"aria-label":`Toggle theme`,leadingIcon:r===`light`?(0,x.jsx)(H.Moon,{}):(0,x.jsx)(H.Sun,{})})})]})]}),l]})]})}function f_({page:e,onNavigate:t,onboarded:n,counts:r,lastScan:i,who:a,collapsed:o,strip:s=!1,onToggleCollapsed:c,tipSide:l=`right`}){let u=new Map(s_.map(e=>[e.page,e])),d=n?l_:[{title:`Start`,pages:[`onboarding`]},...l_.map(e=>({...e,pages:e.pages.filter(e=>e!==`onboarding`)}))];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`brand`,children:[(0,x.jsx)(n_,{}),c&&(0,x.jsx)(Bh,{content:o?`Expand the sidebar`:`Collapse the sidebar`,children:(0,x.jsx)(B,{className:`sidebar__collapse`,variant:`ghost`,size:`sm`,tone:`neutral`,"aria-label":o?`Expand the sidebar`:`Collapse the sidebar`,leadingIcon:o?(0,x.jsx)(H.ChevronRight,{}):(0,x.jsx)(H.ChevronLeft,{}),onClick:c})})]}),a&&(()=>{let e=a.name?`${u_(a.name)} search`:`Your search`,t=(a.name||`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return(0,x.jsx)(`div`,{className:o?`sidebar__who sidebar__who--collapsed`:`sidebar__who`,role:`note`,"aria-label":`${e}, profile folder ${a.dir}`,title:a.dir,children:o?(0,x.jsx)(`span`,{className:`sidebar__who-initials num`,"aria-hidden":`true`,children:t}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`sidebar__who-name`,children:e}),(0,x.jsx)(`span`,{className:`sidebar__who-dir num`,children:a.folder})]})})})(),(0,x.jsx)(`nav`,{className:`nav`,"aria-label":`Pages`,children:d.map(n=>(0,x.jsxs)(`div`,{className:`nav__group`,children:[!o&&(0,x.jsx)(`div`,{className:`nav__group-title`,children:n.title}),n.pages.map(e=>u.get(e)).filter(e=>!!e).map(n=>{let i=(0,x.jsx)(B,{className:`nav__item`,align:`start`,variant:e===n.page?`soft`:`ghost`,tone:e===n.page?`primary`:`neutral`,size:`sm`,leadingIcon:(0,x.jsx)(n.icon,{}),trailingIcon:!o&&r[n.page]!=null?(0,x.jsx)(`span`,{className:`nav__count`,children:r[n.page]}):void 0,"aria-current":e===n.page?`page`:void 0,"aria-label":o&&!s?n.label:void 0,onClick:()=>t(n.page),children:o&&!s?null:n.label},n.page);return o&&!s?(0,x.jsx)(Bh,{content:r[n.page]==null?n.label:`${n.label} · ${r[n.page]}`,side:l,children:i},n.page):i})]},n.title))}),!o&&(0,x.jsx)(`div`,{className:`sidebar__foot`,children:(0,x.jsxs)(`div`,{children:[`Notes are the record.`,i&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`br`,{}),(0,x.jsx)(`span`,{className:`num`,children:i})]}),(0,x.jsx)(`br`,{}),(0,x.jsxs)(`span`,{className:`num`,children:[`v`,`0.
|
|
60
|
+
`)?4:1,value:e.value,onChange:e=>c(t,{value:e.target.value})}),(0,x.jsxs)(`div`,{className:`copy__edit-actions`,children:[(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Move up`,leadingIcon:(0,x.jsx)(H.ArrowUp,{}),disabled:t===0,onClick:()=>l(t,-1)}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Move down`,leadingIcon:(0,x.jsx)(H.ArrowDown,{}),disabled:t===i.length-1,onClick:()=>l(t,1)}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`danger`,"aria-label":`Remove`,leadingIcon:(0,x.jsx)(H.Trash,{}),onClick:()=>u(t)})]})]},t))}),(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`neutral`,leadingIcon:(0,x.jsx)(H.Plus,{}),onClick:()=>a(e=>[...e,{group:e[e.length-1]?.group??``,label:``,value:``}]),children:`Add a line`}),(0,x.jsx)(`span`,{className:`toolbar__spacer`}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,onClick:n,children:`Cancel`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,loading:o,onClick:async()=>{s(!0);try{let e=await $.saveSnippets(i);X({title:`Copy panel saved`,description:`Profile/Snippets.md`,tone:`success`}),r(e)}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}s(!1)},children:`Save`})]})]})})})}var a_=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),o_=a_?`⌘K`:`Ctrl K`,s_=[{page:`onboarding`,label:`Get started`,icon:H.Sparkles},{page:`today`,label:`Today`,icon:H.Star},{page:`overview`,label:`Overview`,icon:H.Home},{page:`jobs`,label:`Jobs`,icon:H.Inbox},{page:`pipeline`,label:`Pipeline`,icon:H.Layers},{page:`mail`,label:`Mail`,icon:H.Mail},{page:`people`,label:`People`,icon:H.Users},{page:`companies`,label:`Sources`,icon:H.Globe},{page:`criteria`,label:`Criteria`,icon:H.Filter},{page:`profile`,label:`Profile`,icon:H.User},{page:`runs`,label:`Runs`,icon:H.Refresh},{page:`agent`,label:`Agent access`,icon:H.Terminal},{page:`settings`,label:`Settings`,icon:H.Settings}],c_={onboarding:`Get started`,today:`Today`,overview:`Overview`,jobs:`Jobs`,pipeline:`Pipeline`,mail:`Mail`,people:`People`,companies:`Sources`,criteria:`Criteria`,profile:`Profile`,runs:`Runs`,agent:`Agent access`,settings:`Settings`},l_=[{title:`Work`,pages:[`today`,`jobs`,`pipeline`,`mail`,`people`]},{title:`Insights`,pages:[`overview`]},{title:`Setup`,pages:[`profile`,`criteria`,`companies`]},{title:`System`,pages:[`runs`,`agent`,`settings`,`onboarding`]}];function u_(e){let t=(e.match(/["“]([^"”]+)["”]/)?.[1]??e.trim().split(/\s+/)[0]??``).trim();return/s$/i.test(t)?`${t}'`:`${t}'s`}function d_({page:e,onNavigate:t,onSearch:n,theme:r,onToggleTheme:i,onboarded:a=!0,counts:o={},lastScan:s=``,who:c=null,children:l}){let[u,d]=(0,b.useState)(!1),f=e_(`(max-width: 40rem)`),[p,m]=(0,b.useState)(``),h=(0,b.useRef)(null);(0,b.useEffect)(()=>{let e=e=>{if(e.key.toLowerCase()!==`k`||!(a_?e.metaKey:e.ctrlKey)||e.altKey||e.shiftKey)return;e.preventDefault();let t=h.current?.querySelector(`input`);t?.focus(),t?.select()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let[g,_]=(0,b.useState)(()=>{try{return localStorage.getItem(`tekjobs.sidebar`)===`collapsed`}catch{return!1}}),v=()=>_(e=>{try{localStorage.setItem(`tekjobs.sidebar`,e?`open`:`collapsed`)}catch{}return!e}),y=e=>{t(e),d(!1)};return(0,x.jsxs)(`div`,{className:`shell${g?` shell--collapsed`:``}${f?` shell--strip`:``}`,children:[(0,x.jsx)(`aside`,{className:`sidebar`,"aria-label":`Primary`,children:(0,x.jsx)(f_,{page:e,onNavigate:y,onboarded:a,counts:o,lastScan:s,who:c,collapsed:g||f,strip:f,onToggleCollapsed:f?void 0:v,tipSide:f?`bottom`:`right`})}),(0,x.jsxs)(`div`,{className:`main`,children:[(0,x.jsxs)(`header`,{className:`topbar`,children:[(0,x.jsxs)(Sp,{open:u,onOpenChange:d,side:`left`,size:`sm`,children:[(0,x.jsx)(Sp.Trigger,{asChild:!0,children:(0,x.jsx)(B,{className:`topbar__menu`,variant:`ghost`,size:`sm`,"aria-label":`Open navigation`,leadingIcon:(0,x.jsx)(H.Menu,{})})}),(0,x.jsxs)(Sp.Content,{children:[(0,x.jsx)(Sp.Title,{children:`Navigation`}),(0,x.jsx)(`div`,{className:`sidebar sidebar--sheet`,children:(0,x.jsx)(f_,{page:e,onNavigate:y,onboarded:a,counts:o,lastScan:s,who:c,collapsed:!1})})]})]}),(0,x.jsx)(`h1`,{className:`topbar__title`,children:c_[e]}),(0,x.jsx)(`form`,{className:`topbar__search`,onSubmit:e=>{e.preventDefault(),n(p.trim())},ref:h,children:(0,x.jsx)(Zp,{size:`sm`,placeholder:`Search company or role`,"aria-label":`Search jobs`,leadingIcon:(0,x.jsx)(H.Search,{}),trailingIcon:(0,x.jsx)(`span`,{className:`num`,children:o_}),value:p,onChange:e=>m(e.target.value)})}),(0,x.jsxs)(`div`,{className:`topbar__actions`,children:[(0,x.jsx)(r_,{}),(0,x.jsx)(Bh,{content:r===`light`?`Switch to dark`:`Switch to light`,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,onClick:i,"aria-label":`Toggle theme`,leadingIcon:r===`light`?(0,x.jsx)(H.Moon,{}):(0,x.jsx)(H.Sun,{})})})]})]}),l]})]})}function f_({page:e,onNavigate:t,onboarded:n,counts:r,lastScan:i,who:a,collapsed:o,strip:s=!1,onToggleCollapsed:c,tipSide:l=`right`}){let u=new Map(s_.map(e=>[e.page,e])),d=n?l_:[{title:`Start`,pages:[`onboarding`]},...l_.map(e=>({...e,pages:e.pages.filter(e=>e!==`onboarding`)}))];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`brand`,children:[(0,x.jsx)(n_,{}),c&&(0,x.jsx)(Bh,{content:o?`Expand the sidebar`:`Collapse the sidebar`,children:(0,x.jsx)(B,{className:`sidebar__collapse`,variant:`ghost`,size:`sm`,tone:`neutral`,"aria-label":o?`Expand the sidebar`:`Collapse the sidebar`,leadingIcon:o?(0,x.jsx)(H.ChevronRight,{}):(0,x.jsx)(H.ChevronLeft,{}),onClick:c})})]}),a&&(()=>{let e=a.name?`${u_(a.name)} search`:`Your search`,t=(a.name||`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return(0,x.jsx)(`div`,{className:o?`sidebar__who sidebar__who--collapsed`:`sidebar__who`,role:`note`,"aria-label":`${e}, profile folder ${a.dir}`,title:a.dir,children:o?(0,x.jsx)(`span`,{className:`sidebar__who-initials num`,"aria-hidden":`true`,children:t}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`sidebar__who-name`,children:e}),(0,x.jsx)(`span`,{className:`sidebar__who-dir num`,children:a.folder})]})})})(),(0,x.jsx)(`nav`,{className:`nav`,"aria-label":`Pages`,children:d.map(n=>(0,x.jsxs)(`div`,{className:`nav__group`,children:[!o&&(0,x.jsx)(`div`,{className:`nav__group-title`,children:n.title}),n.pages.map(e=>u.get(e)).filter(e=>!!e).map(n=>{let i=(0,x.jsx)(B,{className:`nav__item`,align:`start`,variant:e===n.page?`soft`:`ghost`,tone:e===n.page?`primary`:`neutral`,size:`sm`,leadingIcon:(0,x.jsx)(n.icon,{}),trailingIcon:!o&&r[n.page]!=null?(0,x.jsx)(`span`,{className:`nav__count`,children:r[n.page]}):void 0,"aria-current":e===n.page?`page`:void 0,"aria-label":o&&!s?n.label:void 0,onClick:()=>t(n.page),children:o&&!s?null:n.label},n.page);return o&&!s?(0,x.jsx)(Bh,{content:r[n.page]==null?n.label:`${n.label} · ${r[n.page]}`,side:l,children:i},n.page):i})]},n.title))}),!o&&(0,x.jsx)(`div`,{className:`sidebar__foot`,children:(0,x.jsxs)(`div`,{children:[`Notes are the record.`,i&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`br`,{}),(0,x.jsx)(`span`,{className:`num`,children:i})]}),(0,x.jsx)(`br`,{}),(0,x.jsxs)(`span`,{className:`num`,children:[`v`,`0.43.0`]}),(0,x.jsx)(`br`,{}),`by `,(0,x.jsx)(`a`,{className:`sidebar__legal`,href:`https://www.timurtek.com`,target:`_blank`,rel:`noreferrer`,children:`timurtek.com`}),(0,x.jsx)(`br`,{}),(0,x.jsx)(`a`,{className:`sidebar__legal`,href:`https://tekjobs.timurtek.com/legal/terms`,target:`_blank`,rel:`noreferrer`,children:`Terms`}),` · `,(0,x.jsx)(`a`,{className:`sidebar__legal`,href:`https://tekjobs.timurtek.com/legal/privacy`,target:`_blank`,rel:`noreferrer`,children:`Privacy`})]})})]})}var p_=`{
|
|
61
61
|
"mcpServers": {
|
|
62
62
|
"tekjobs": {
|
|
63
63
|
"command": "tekjobs",
|
|
@@ -73,5 +73,5 @@ Defaulting to \`null\`.`}md(Ad,`getInvalidValueError`);var jd=xd,Md=Cd;(0,b.forw
|
|
|
73
73
|
`),[s,c]=(0,b.useState)(()=>o(n)),[l,u]=(0,b.useState)(``);return(0,b.useEffect)(()=>{c(o(n)),u(``)},[n]),(0,x.jsx)(Xp,{label:e,description:t,font:`mono`,rows:i,resize:`vertical`,value:s,onChange:e=>c(e.target.value),onBlur:()=>{let e=s.split(`
|
|
74
74
|
`).map(e=>e.trim()).filter(Boolean);if(!r){u(``),a(e);return}let t={};for(let n of e){let e=n.match(/^(.*?)\s*:\s*(-?\d+(?:\.\d+)?)\s*$/);if(!e||!e[1]){u(`"${n}" is not "term: weight".`);return}t[e[1].trim().toLowerCase()]=Number(e[2])}u(``),a(t)},error:l||void 0})}function A_(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(C_),[o,s]=(0,b.useState)([]),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(``),[f,p]=(0,b.useState)(``),[m,h]=(0,b.useState)(null),[g,_]=(0,b.useState)(!1),[v,y]=(0,b.useState)(null),[S,C]=(0,b.useState)(!1),[w,T]=(0,b.useState)(null),E=(0,b.useRef)(null),[D,O]=(0,b.useState)(null),[k,A]=(0,b.useState)(!1),j=(0,b.useMemo)(()=>e?JSON.stringify(e,null,2):``,[e]),ee=e!==null&&j!==n,M=i!==C_;(0,b.useEffect)(()=>{if(E.current&&window.clearTimeout(E.current),!ee||M){T(null);return}return E.current=window.setTimeout(()=>{$.previewCriteria(j).then(T).catch(()=>T(null))},700),()=>{E.current&&window.clearTimeout(E.current)}},[j,ee,M]),(0,b.useEffect)(()=>{if(!ee)return;let e=e=>{e.preventDefault()};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[ee]);let N=()=>$.criteriaPresets().then(s).catch(()=>s([])),te=async e=>{try{let n=e===C_?await $.criteria():await $.criteriaPreset(e);if(!n.parsed)throw Error(`That note's JSON does not parse. Fix it in Obsidian first.`);t(n.parsed),r(JSON.stringify(n.parsed,null,2)),d(JSON.stringify(n.parsed,null,2)),p(``),a(e)}catch(e){X({title:`Could not load criteria`,description:e.message,tone:`danger`})}};(0,b.useEffect)(()=>{te(C_),N()},[]),(0,b.useEffect)(()=>{d(j),p(``)},[j]);let P=e=>t(e),F=async()=>{if(e){l(!0);try{if(M){let e=await $.saveCriteriaPreset(i,j);r(JSON.stringify(e.parsed,null,2)),X({title:`Preset "${i}" saved`,description:`Run a scan with it from here or from Runs; make it active to have the daily scan use it.`,tone:`success`})}else{let e=!!w?.weightsChange,t=w?w.notesAtCurrent:0,n=await $.saveCriteria(j);r(JSON.stringify(n.parsed,null,2)),X({title:`Criteria saved`,description:`Targets/Search Criteria.md updated. The next scan uses it.`,tone:`success`}),O(e&&t>0?{notes:t}:null)}N()}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}l(!1)}},ne=async()=>{if(e&&m?.trim()){l(!0);try{let e=await $.saveCriteriaPreset(m.trim(),j);h(null),await N(),a(e.name),r(JSON.stringify(e.parsed,null,2)),X({title:`Preset "${e.name}" created`,description:e.file,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}l(!1)}},re=async()=>{l(!0);try{await $.activateCriteriaPreset(i),await N(),X({title:`"${i}" is now the active criteria`,description:`Search Criteria.md holds a copy. The daily scan uses it from the next run.`,tone:`success`})}catch(e){X({title:`Could not activate`,description:e.message,tone:`danger`})}l(!1)},ie=async()=>{l(!0);try{await $.deleteCriteriaPreset(i),_(!1),await N(),await te(C_),X({title:`Preset deleted`,tone:`success`})}catch(e){X({title:`Could not delete`,description:e.message,tone:`danger`})}l(!1)},ae=async e=>{try{await $.startScan(e,M?i:void 0),X({title:e?`Dry run started`:`Scan started`,description:`Scoring with ${M?`"${i}"`:`the active criteria`}. Watch it on Runs.`,tone:`success`})}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},oe=async()=>{A(!0);try{let e=await $.rescoreNotes(!1);O(null),X({title:`${e.changed} note${e.changed===1?``:`s`} rescored`,description:`${e.alreadyCurrent} were already at these weights. Each moved note carries the new score, band and reasons, and a status-log line saying so.`,tone:`success`})}catch(e){X({title:`Rescore failed`,description:e.message,tone:`danger`})}A(!1)},se=async()=>{if(w){y(w);return}C(!0);try{y(await $.previewCriteria(j))}catch(e){X({title:`Could not preview`,description:e.message,tone:`danger`})}C(!1)},ce=()=>{try{let e=JSON.parse(u);t(e),p(``)}catch(e){p(e.message)}};if(!e)return(0,x.jsx)(zg,{variant:`rect`,height:`24rem`});let le=e.salary??{},ue={...Object.fromEntries(w_.map(e=>[e,!1])),...e.openSources??{}},de=o.find(e=>e.name===i);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`What the scan looks for and how it scores. Fields write into the JSON in `,M?(0,x.jsxs)(`code`,{children:[`Targets/Criteria/`,i,`.md`]}):(0,x.jsx)(`code`,{children:`Targets/Search Criteria.md`}),`; keys this form does not show are kept as they are.`]})}),(0,x.jsxs)(`div`,{className:`chips`,children:[(0,x.jsxs)(z,{tone:`neutral`,size:`sm`,children:[`bar `,String(e.minScore??`?`)]}),le.minAnnual&&(0,x.jsxs)(z,{tone:`success`,size:`sm`,children:[`floor `,Jg(le.minAnnual)]}),le.stretchAnnual&&(0,x.jsxs)(z,{tone:`warning`,size:`sm`,children:[`stretch `,Jg(le.stretchAnnual)]}),ee&&(0,x.jsx)(z,{tone:`warning`,size:`sm`,children:`unsaved`})]})]}),(0,x.jsxs)(V,{padding:`md`,children:[(0,x.jsxs)(`div`,{className:`toolbar`,children:[(0,x.jsxs)(J,{className:`toolbar__filter toolbar__filter--wide`,size:`sm`,label:`Editing`,value:i,onValueChange:e=>{(!ee||window.confirm(`Discard unsaved changes?`))&&te(e)},children:[(0,x.jsx)(J.Item,{value:C_,children:`Active criteria (daily scan)`}),o.map(e=>(0,x.jsxs)(J.Item,{value:e.name,children:[e.name,e.active?` · same as active`:``]},e.name))]}),(0,x.jsx)(`div`,{className:`toolbar__spacer`}),(0,x.jsxs)(`div`,{className:`toolbar__switch pager__buttons`,children:[M&&(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`danger`,disabled:c,onClick:()=>_(!0),children:`Delete preset`}),M&&(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:c||ee||de?.active,onClick:re,children:de?.active?`Is the active set`:`Make active`}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:c||S,loading:S,onClick:se,children:`Preview impact`}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:c,onClick:()=>h(M?`${i} copy`:``),children:`Save as preset…`}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:c||ee,onClick:()=>ae(!0),children:`Dry run with this`}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:c||ee,onClick:()=>ae(!1),children:`Scan with this`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:!ee||c,loading:c,onClick:F,children:M?`Save preset`:`Save to the vault`})]})]}),M&&de&&(0,x.jsxs)(`p`,{className:`muted`,children:[`Preset · `,de.titles,` title terms · updated `,de.updated,` · `,de.file]}),w&&(0,x.jsxs)(`div`,{className:`impact`,role:`status`,"aria-live":`polite`,children:[(0,x.jsx)(`span`,{className:`microlabel`,children:`If saved`}),(0,x.jsxs)(z,{size:`sm`,tone:w.aboveAfter>=w.aboveBefore?`success`:`warning`,children:[`above the bar `,w.aboveBefore,` → `,w.aboveAfter]}),(0,x.jsxs)(z,{size:`sm`,tone:w.changed?`primary`:`neutral`,children:[w.changed,` of `,w.openNotes,` change score`]}),(0,x.jsxs)(z,{size:`sm`,tone:w.rise.length?`success`:`neutral`,children:[w.rise.length,` rise`]}),(0,x.jsxs)(z,{size:`sm`,tone:w.fall.length?`warning`:`neutral`,children:[w.fall.length,` fall`]}),(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,children:[`top 20: `,w.enterTop20.length,` in, `,w.leaveTop20.length,` out`]}),w.weightsChange&&(0,x.jsx)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:(0,x.jsxs)(`span`,{className:`num`,children:[w.fingerprintBefore,` → `,w.fingerprintAfter]})}),(0,x.jsx)(`span`,{className:`toolbar__spacer`}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,onClick:()=>y(w),children:`Details`})]}),D&&!ee&&(0,x.jsxs)(`div`,{className:`impact impact--after`,children:[(0,x.jsx)(`span`,{className:`microlabel`,children:`Saved`}),(0,x.jsxs)(`span`,{children:[D.notes,` open note`,D.notes===1?` was`:`s were`,` scored under the previous weights. The next scan scores new postings with the new ones; the existing notes keep their scores until you rescore them.`]}),(0,x.jsx)(`span`,{className:`toolbar__spacer`}),(0,x.jsxs)(B,{size:`sm`,variant:`soft`,tone:`primary`,loading:k,disabled:k,onClick:oe,children:[`Rescore `,D.notes,` notes`]}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,disabled:k,onClick:()=>O(null),children:`Later`})]})]}),(0,x.jsxs)(Z,{defaultValue:`fields`,variant:`line`,size:`sm`,children:[(0,x.jsxs)(Z.List,{"aria-label":`Criteria editors`,children:[(0,x.jsx)(Z.Trigger,{value:`fields`,children:`Fields`}),(0,x.jsx)(Z.Trigger,{value:`titles`,children:`Titles and terms`}),(0,x.jsx)(Z.Trigger,{value:`location`,children:`Location and pay`}),(0,x.jsx)(Z.Trigger,{value:`sources`,children:`Sources`}),(0,x.jsx)(Z.Trigger,{value:`json`,children:`JSON (advanced)`})]}),(0,x.jsx)(Z.Content,{value:`fields`,children:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`minScore`],label:`Bar (minScore)`,hint:`A posting needs this many points to become a note.`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`noTitleMatchPenalty`],label:`No title match penalty`,hint:`Taken when the title matches nothing in the title terms.`,onChange:P})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`descCap`],label:`Description points cap`,hint:`Description terms add up to this many points, no more.`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`maxDescriptionChars`],label:`Description characters kept in a note`,onChange:P,step:500})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`titleExtraPer`],label:`Points per extra title match`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`titleExtraCap`],label:`Extra title matches cap`,onChange:P})]}),(0,x.jsx)(`h3`,{children:`Seniority`}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(k_,{label:`Boost (word: points)`,hint:`Words in the title that add. Example: staff: 10`,value:E_(e,[`seniority`,`boost`]),weighted:!0,rows:6,onCommit:t=>P(D_(e,[`seniority`,`boost`],t))}),(0,x.jsx)(k_,{label:`Penalty (word: points)`,hint:`Words in the title that subtract. Example: junior: -40`,value:E_(e,[`seniority`,`penalty`]),weighted:!0,rows:6,onCommit:t=>P(D_(e,[`seniority`,`penalty`],t))})]}),(0,x.jsx)(`h3`,{children:`Recency`}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`recency`,`days2`],label:`Posted within 2 days`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`recency`,`days7`],label:`Within 7 days`,onChange:P})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`recency`,`days30`],label:`Within 30 days`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`recency`,`days90`],label:`Within 90 days`,onChange:P})]}),(0,x.jsx)(`div`,{className:`form__row`,children:(0,x.jsx)(O_,{doc:e,path:[`recency`,`older`],label:`Older than 90 days`,onChange:P})})]})})}),(0,x.jsx)(Z.Content,{value:`titles`,children:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(k_,{label:`Title terms (term: weight)`,hint:`The best single match in the title counts fully; each extra match adds the per-extra points. One per line.`,value:e.titleTerms,weighted:!0,rows:18,onCommit:t=>P(D_(e,[`titleTerms`],t))}),(0,x.jsx)(k_,{label:`Title exclusions (one per line)`,hint:`Any hit in the title drops the posting entirely. Abbreviations are spelled out first, so director catches Sr. Dir.`,value:e.titleExclude,weighted:!1,rows:18,onCommit:t=>P(D_(e,[`titleExclude`],t))})]}),(0,x.jsx)(k_,{label:`Company exclusions (one per line)`,hint:`Any hit in the company name drops the posting entirely: industries, staffing agencies, names. Title words do not catch these.`,value:e.companyExclude??[],weighted:!1,rows:6,onCommit:t=>P(D_(e,[`companyExclude`],t))}),(0,x.jsx)(k_,{label:`Description terms (term: weight)`,hint:`Each term found in the description adds its weight, up to the description cap.`,value:e.descTerms,weighted:!0,rows:14,onCommit:t=>P(D_(e,[`descTerms`],t))})]})})}),(0,x.jsx)(Z.Content,{value:`location`,children:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsx)(`h3`,{children:`Location`}),(0,x.jsx)(Hp,{label:`Remote only`,description:`Anything not remote takes the penalty below, which drops it under the bar.`,checked:!!E_(e,[`location`,`requireRemote`]),onCheckedChange:t=>P(D_(e,[`location`,`requireRemote`],t===!0))}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`location`,`notRemotePenalty`],label:`Not remote penalty`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`location`,`remoteBoost`],label:`Remote boost`,onChange:P})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`location`,`nonUsPenalty`],label:`Non-US penalty`,hint:`Applied when the location names a place in the list below and nothing US.`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`location`,`bayAreaBoost`],label:`Metro boost`,hint:`For the metro terms below. Set to 0 to switch it off.`,onChange:P})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(k_,{label:`Metro terms (one per line)`,hint:`Places that earn the metro boost. The interview seeds these from your location; empty the list for no boost.`,value:E_(e,[`location`,`bayAreaTerms`]),weighted:!1,rows:8,onCommit:t=>P(D_(e,[`location`,`bayAreaTerms`],t))}),(0,x.jsx)(k_,{label:`US terms (one per line)`,hint:`Words that mark a posting as US.`,value:E_(e,[`location`,`usTerms`]),weighted:!1,rows:8,onCommit:t=>P(D_(e,[`location`,`usTerms`],t))})]}),(0,x.jsx)(k_,{label:`Non-US terms (one per line)`,hint:`Places that trigger the non-US penalty. Whole words.`,value:E_(e,[`location`,`nonUsTerms`]),weighted:!1,rows:10,onCommit:t=>P(D_(e,[`location`,`nonUsTerms`],t))}),(0,x.jsx)(`h3`,{children:`Pay`}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`salary`,`minAnnual`],label:`Floor (annual)`,hint:`A stated range that tops out at or above this earns the bonus.`,onChange:P,step:5e3}),(0,x.jsx)(O_,{doc:e,path:[`salary`,`stretchAnnual`],label:`Stretch (annual)`,hint:`Between stretch and floor is the stretch band: kept visible, small penalty.`,onChange:P,step:5e3})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`salary`,`meetsBonus`],label:`Meets floor bonus`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`salary`,`stretchPenalty`],label:`Stretch band penalty`,onChange:P})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(O_,{doc:e,path:[`salary`,`belowPenalty`],label:`Below stretch penalty`,onChange:P}),(0,x.jsx)(O_,{doc:e,path:[`salary`,`abovePer10k`],label:`Points per $10k above floor`,hint:`Capped at ${String(E_(e,[`salary`,`aboveCap`])??`?`)} (aboveCap).`,onChange:P})]})]})})}),(0,x.jsx)(Z.Content,{value:`sources`,children:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsx)(`p`,{className:`muted`,children:`Aggregator feeds with no company slug. Company boards live on the Companies page. Adzuna and USAJOBS also need a free key in the environment.`}),(0,x.jsx)(`div`,{className:`form__row`,children:Object.keys(ue).map(t=>(0,x.jsx)(Hp,{label:T_[t]??t,checked:!!ue[t],onCheckedChange:n=>P(D_(e,[`openSources`,t],n===!0))},t))})]})})}),(0,x.jsx)(Z.Content,{value:`json`,children:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsx)(Xp,{label:`Criteria JSON`,description:`The whole document. Apply to push it into the fields; Save to write it to the vault.`,font:`mono`,rows:28,resize:`vertical`,value:u,onChange:e=>d(e.target.value),error:f||void 0}),(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:u===j,onClick:()=>{d(j),p(``)},children:`Revert`}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:u===j,onClick:ce,children:`Apply to fields`})]})]})})})]}),(0,x.jsx)(W,{open:v!==null,onOpenChange:e=>!e&&y(null),size:`lg`,children:(0,x.jsxs)(W.Content,{children:[(0,x.jsx)(W.Title,{children:`What this set would do to the notes you have`}),(0,x.jsxs)(W.Description,{children:[`Against the active criteria. Covers `,v?.covers,`. Nothing is written by a preview.`,v?.weightsChange?` The weights change (${v.fingerprintBefore} → ${v.fingerprintAfter}); ${v.notesAtCurrent} open notes were scored under the current ones and can be rescored after saving.`:` The weights do not change; only the bar or the sources do.`]}),v&&(0,x.jsxs)(`div`,{className:`preview`,children:[(0,x.jsxs)(`div`,{className:`chips`,children:[(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,children:[v.openNotes,` open notes`]}),(0,x.jsxs)(z,{size:`sm`,tone:v.changed?`primary`:`neutral`,children:[v.changed,` change score`]}),(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,children:[`bar `,v.barBefore,` → `,v.barAfter]}),(0,x.jsxs)(z,{size:`sm`,tone:v.aboveAfter>=v.aboveBefore?`success`:`warning`,children:[`above the bar `,v.aboveBefore,` → `,v.aboveAfter]})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(S_,{title:`Rise above the bar`,rows:v.rise,empty:`Nothing crosses upward.`}),(0,x.jsx)(S_,{title:`Fall below the bar`,rows:v.fall,empty:`Nothing drops out.`})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(S_,{title:`Enter the top 20`,rows:v.enterTop20,empty:`The top 20 keeps its members.`}),(0,x.jsx)(S_,{title:`Leave the top 20`,rows:v.leaveTop20,empty:`The top 20 keeps its members.`})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(S_,{title:`Biggest gains`,rows:v.up,empty:`No note gains points.`}),(0,x.jsx)(S_,{title:`Biggest losses`,rows:v.down,empty:`No note loses points.`})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(x_,{title:`By role family`,rows:v.byKind,barBefore:v.barBefore,barAfter:v.barAfter}),(0,x.jsx)(x_,{title:`By source`,rows:v.bySource,barBefore:v.barBefore,barAfter:v.barAfter})]})]}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,children:`Close`})}),ee&&(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:c,onClick:()=>{y(null),F()},children:M?`Save preset`:`Save to the vault`})]})]})}),(0,x.jsx)(W,{open:m!==null,onOpenChange:e=>!e&&h(null),size:`sm`,children:(0,x.jsxs)(W.Content,{children:[(0,x.jsx)(W.Title,{children:`Save as a preset`}),(0,x.jsx)(W.Description,{children:`A named copy under Targets/Criteria/. The daily scan keeps using the active set until you make this one active.`}),(0,x.jsx)(Zp,{label:`Name`,placeholder:`Wider net, 180k floor`,value:m??``,onChange:e=>h(e.target.value)}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,children:`Cancel`})}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:!m?.trim()||c,loading:c,onClick:ne,children:`Save preset`})]})]})}),(0,x.jsx)(W,{open:g,onOpenChange:_,size:`sm`,children:(0,x.jsxs)(W.Content,{children:[(0,x.jsxs)(W.Title,{children:[`Delete "`,i,`"?`]}),(0,x.jsx)(W.Description,{children:`Removes the note under Targets/Criteria/. The active criteria and every job note stay as they are.`}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,children:`Keep it`})}),(0,x.jsx)(B,{size:`sm`,tone:`danger`,disabled:c,loading:c,onClick:ie,children:`Delete`})]})]})})]})}function j_({job:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)({emphasis:`auto`,length:`standard`,extra:``}),[s,c]=(0,b.useState)(!1),l=(0,b.useRef)(!1),u=(e,t)=>{n(e),t&&i(e.saved?.text??``)};(0,b.useEffect)(()=>{n(null),$.coverLetter(e.id).then(e=>u(e,!0)).catch(e=>X({title:`Could not read the letter`,description:e.message,tone:`danger`}))},[e.id]),(0,b.useEffect)(()=>{if(!t?.running){l.current&&t&&(l.current=!1,u(t,!t.error),t.error||X({title:`Cover letter drafted`,description:`Saved into the note. Read it before you use it.`,tone:`success`}));return}l.current=!0;let r=setInterval(()=>$.coverLetter(e.id).then(e=>n(e)).catch(()=>{}),2500);return()=>clearInterval(r)},[t?.running,e.id]);let d=async()=>{if(!t?.saved||window.confirm(`Write a new letter? It replaces the one saved in this note.`))try{u(await $.writeCoverLetter(e.id,a),!1)}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},f=async()=>{c(!0);try{u(await $.saveCoverLetter(e.id,r),!0),X({title:`Letter saved`,description:`Written into the note and checked against your resume.`,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}c(!1)},p=async()=>{try{await navigator.clipboard.writeText(r),X({title:`Copied`,tone:`success`})}catch{X({title:`Could not copy`,description:`Select the text and copy it by hand.`,tone:`danger`})}};if(!t)return(0,x.jsx)(`div`,{className:`detail`,children:(0,x.jsx)(zg,{lines:6})});let m=t.saved,h=!!m&&r!==m.text;return(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`div`,{className:`letter__options`,children:[(0,x.jsxs)(J,{size:`sm`,label:`Emphasis`,value:a.emphasis,onValueChange:e=>o({...a,emphasis:e}),disabled:t.running,children:[(0,x.jsx)(J.Item,{value:`auto`,children:`Let the posting decide`}),(0,x.jsx)(J.Item,{value:`design-systems`,children:`Design systems first`}),(0,x.jsx)(J.Item,{value:`ai-product`,children:`AI product surfaces first`})]}),(0,x.jsxs)(J,{size:`sm`,label:`Length`,value:a.length,onValueChange:e=>o({...a,length:e}),disabled:t.running,children:[(0,x.jsx)(J.Item,{value:`short`,children:`Short, about 150 words`}),(0,x.jsx)(J.Item,{value:`standard`,children:`Standard, about 220 words`})]})]}),(0,x.jsx)(Zp,{size:`sm`,label:`Anything it should include`,description:`Optional. A person you spoke to, a product of theirs you use, a point to make.`,value:a.extra,onChange:e=>o({...a,extra:e.target.value}),disabled:t.running}),(0,x.jsxs)(`div`,{className:`form__actions form__actions--start`,children:[(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:d,disabled:t.running,leadingIcon:t.running?(0,x.jsx)(Bg,{size:`sm`}):(0,x.jsx)(H.Sparkles,{}),children:t.running?`Writing`:m?`Write a new one`:`Write cover letter`}),m&&(0,x.jsx)(B,{variant:`soft`,size:`sm`,onClick:p,leadingIcon:(0,x.jsx)(H.Copy,{}),children:`Copy`}),h&&(0,x.jsx)(B,{variant:`soft`,tone:`primary`,size:`sm`,onClick:f,loading:s,children:`Save edits`})]}),t.running&&(0,x.jsx)(Bg,{showLabel:!0,label:`${t.runner} is writing from your resume and this posting`,size:`sm`}),t.error&&!t.running&&(0,x.jsx)(Vg,{tone:`danger`,size:`sm`,icon:(0,x.jsx)(H.Warning,{}),title:t.errorKind===`auth`?`${t.runner} is signed out`:t.errorKind===`missing`?`${t.runner} is not installed`:t.errorKind===`outdated`?`${t.runner} is out of date`:`The letter was not written`,description:`${t.error} You can also ask any agent connected to the TekJobs MCP server to write it: "write the cover letter for ${e.company}".`}),!m&&!t.running&&!t.error&&(0,x.jsx)(Vg,{size:`sm`,icon:(0,x.jsx)(H.File,{}),title:`No letter yet`,description:`It is written from your resume and ${e.company}'s posting, and only your resume supplies the facts.`}),m&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Xp,{label:`Cover letter`,rows:16,resize:`vertical`,value:r,onChange:e=>i(e.target.value),description:`Edit freely. Saving checks it against your resume again.`}),(0,x.jsxs)(`div`,{className:`letter__meta`,children:[(0,x.jsxs)(z,{tone:`neutral`,size:`sm`,children:[m.words,` words`]}),m.warnings.length===0?(0,x.jsx)(z,{tone:`success`,size:`sm`,children:`Nothing flagged`}):(0,x.jsxs)(z,{tone:`warning`,size:`sm`,children:[m.warnings.length,` to check`]}),h&&(0,x.jsx)(z,{tone:`primary`,variant:`outline`,size:`sm`,children:`Unsaved edits`})]}),m.warnings.length>0&&(0,x.jsx)(`ul`,{className:`letter__warnings`,children:m.warnings.map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(z,{tone:e.kind===`claim`||e.kind===`placeholder`?`danger`:`warning`,size:`sm`,children:e.kind}),(0,x.jsx)(`span`,{children:e.text})]},e.text))})]}),(0,x.jsx)(`p`,{className:`muted`,children:`The letter is saved under "Cover letter" in the job note. Nothing is sent from here; you paste it where the application asks for it.`})]})}var M_={recruiter:`recruiter`,"hiring-manager":`hiring manager`,interviewer:`interviewer`,referral:`referral`,other:`contact`},N_={recruiter:`primary`,"hiring-manager":`warning`,interviewer:`neutral`,referral:`success`,other:`neutral`},P_=e=>qg.includes(e)?e:`other`;function F_(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(`all`),[o,s]=(0,b.useState)(null),c=()=>$.people().then(t).catch(e=>X({title:`Could not load people`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{c()},[]);let l=(0,b.useMemo)(()=>{let t=n.trim().toLowerCase();return(e??[]).filter(e=>(i===`all`||e.role===i)&&(!t||`${e.name} ${e.company} ${e.email}`.toLowerCase().includes(t)))},[e,n,i]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`toolbar`,children:[(0,x.jsx)(Zp,{className:`toolbar__search`,size:`sm`,label:`Search`,placeholder:`Name, company or email`,value:n,onChange:e=>r(e.target.value)}),(0,x.jsxs)(J,{className:`toolbar__filter`,size:`sm`,label:`Role`,value:i,onValueChange:a,children:[(0,x.jsx)(J.Item,{value:`all`,children:`Everyone`}),qg.map(e=>(0,x.jsx)(J.Item,{value:e,children:M_[e]},e))]}),(0,x.jsx)(`span`,{className:`toolbar__spacer`}),(0,x.jsx)(I_,{onAdded:e=>{c(),s(e.id)}})]}),(0,x.jsx)(V,{padding:`none`,children:e===null?(0,x.jsx)(`div`,{className:`loading`,children:(0,x.jsx)(zg,{lines:6})}):e.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`No people yet`,description:`Confirming an email that a person wrote adds them here, with the thread. Or add someone: a recruiter who reached out, a referral, the hiring manager you met.`}):(0,x.jsxs)(Y,{"aria-label":`People`,density:`md`,stickyHeader:!0,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Name`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Email`}),(0,x.jsx)(Y.HeadCell,{children:`Last contact`}),(0,x.jsx)(Y.HeadCell,{children:`Threads`})]})}),(0,x.jsx)(Y.Body,{children:l.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,selected:o===e.id,onClick:()=>s(e.id),children:[(0,x.jsx)(Y.Cell,{children:e.name}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:N_[P_(e.role)],variant:`soft`,children:M_[P_(e.role)]})}),(0,x.jsx)(Y.Cell,{children:e.company||(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:e.email||`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num`,children:e.lastContact?`${e.lastContact} · ${Xg(e.lastContact)}`:`—`})}),(0,x.jsxs)(Y.Cell,{children:[(0,x.jsx)(`span`,{className:`num`,children:e.threads.length}),e.live>0&&(0,x.jsxs)(`span`,{className:`muted`,children:[` · `,e.live,` live`]})]})]},e.id))})]})}),(0,x.jsxs)(`p`,{className:`muted`,children:[l.length,` of `,e?.length??0,` people. Notes live in `,(0,x.jsx)(`code`,{className:`mono`,children:`People/`}),`; a job note lists its people under `,(0,x.jsx)(`code`,{className:`mono`,children:`## People`}),`.`]}),(0,x.jsx)(B_,{onDone:c}),(0,x.jsx)(L_,{id:o,onClose:()=>s(null),onChanged:c})]})}function I_({onAdded:e,job:t}){let[n,r]=(0,b.useState)(!1),i={name:``,role:`recruiter`,company:t?.company??``,email:``,links:``,about:``},[a,o]=(0,b.useState)(i),[s,c]=(0,b.useState)(!1);return(0,x.jsxs)(W,{open:n,onOpenChange:r,size:`sm`,children:[(0,x.jsx)(W.Trigger,{asChild:!0,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,leadingIcon:(0,x.jsx)(H.Plus,{}),children:`Add a person`})}),(0,x.jsx)(W.Content,{children:(0,x.jsxs)(`form`,{className:`form`,onSubmit:async n=>{n.preventDefault(),c(!0);try{let n=await $.addPerson({...a,jobId:t?.id});r(!1),o(i),X({title:`${n.name} ${n.created===new Date().toISOString().slice(0,10)?`added`:`recognised`}`,description:t?`On ${t.company} - ${t.title}.`:`People/${n.id}.md`,tone:`success`}),e(n)}catch(e){X({title:`Not added`,description:e.message,tone:`danger`})}c(!1)},children:[(0,x.jsx)(W.Title,{children:t?`Someone on ${t.company}`:`Add a person`}),(0,x.jsx)(W.Description,{children:`A note under People/. Someone already there, by email or by name at the same company, is recognised rather than duplicated.`}),(0,x.jsx)(Zp,{label:`Name`,required:!0,value:a.name,onChange:e=>o({...a,name:e.target.value})}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(J,{label:`Role`,value:a.role,onValueChange:e=>o({...a,role:e}),children:qg.map(e=>(0,x.jsx)(J.Item,{value:e,children:M_[e]},e))}),(0,x.jsx)(Zp,{label:`Company`,value:a.company,onChange:e=>o({...a,company:e.target.value})})]}),(0,x.jsx)(Zp,{label:`Email`,type:`email`,value:a.email,onChange:e=>o({...a,email:e.target.value})}),(0,x.jsx)(Zp,{label:`Links`,description:`LinkedIn or anything else, as text.`,value:a.links,onChange:e=>o({...a,links:e.target.value})}),(0,x.jsx)(Zp,{label:`About`,description:`How you know them, in a line.`,value:a.about,onChange:e=>o({...a,about:e.target.value})}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,children:`Cancel`})}),(0,x.jsx)(B,{type:`submit`,tone:`primary`,loading:s,children:`Add`})]})]})})]})}function L_({id:e,onClose:t,onChanged:n}){let[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{i(null),e&&$.person(e).then(i).catch(e=>X({title:`Could not open the note`,description:e.message,tone:`danger`}))},[e]),(0,x.jsx)(Sp,{open:e!==null,onOpenChange:e=>!e&&t(),side:`right`,size:`md`,children:(0,x.jsx)(Sp.Content,{children:r?(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`div`,{className:`sheet-head`,children:[(0,x.jsxs)(`div`,{className:`sheet-head__main`,children:[(0,x.jsxs)(`p`,{className:`sheet-head__meta`,children:[r.company||`no company`,r.created?` · since ${r.created}`:``]}),(0,x.jsx)(Sp.Title,{children:r.name}),(0,x.jsxs)(`div`,{className:`chips`,children:[(0,x.jsx)(z,{size:`sm`,tone:N_[P_(r.role)],variant:`soft`,children:M_[P_(r.role)]}),r.email&&(0,x.jsx)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:(0,x.jsx)(`span`,{className:`num`,children:r.email})}),r.lastContact&&(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:[`last contact `,(0,x.jsx)(`span`,{className:`num`,children:r.lastContact})]})]})]}),(0,x.jsx)(`div`,{className:`sheet-head__side`,children:(0,x.jsxs)(`div`,{className:`sheet-head__links`,children:[r.email&&(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:`mailto:${r.email}`,children:`Write to them ↗`})}),(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:r.obsidianUrl,title:r.path,children:`Open in Obsidian ↗`})})]})})]}),(r.about||r.links)&&(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`About`}),(0,x.jsxs)(`p`,{className:`muted`,children:[r.about,r.links?` ${r.links}`:``]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`Threads`}),r.threads.length===0?(0,x.jsx)(`p`,{className:`muted`,children:`On no job note yet.`}):(0,x.jsx)(`ul`,{className:`people__threads`,children:r.threads.map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(`a`,{className:`people__thread`,href:`#/jobs?q=${encodeURIComponent(e.title.split(` - `)[0]??e.title)}`,children:e.title}),e.status&&(0,x.jsx)(z,{size:`sm`,tone:$g[e.status]??`neutral`,children:e.status}),e.role&&(0,x.jsxs)(`span`,{className:`muted`,children:[` · `,e.role]})]},e.id))})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`Log`}),(0,x.jsx)(dg,{text:r.log||`_Nothing logged yet._`})]}),(0,x.jsx)(Xp,{label:`Log a contact`,rows:3,value:a,onChange:e=>o(e.target.value),placeholder:`A call, a reply, a note to self. Dated today, moves last contact forward. Nothing is sent.`}),(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:async()=>{if(r&&a.trim()){c(!0);try{i(await $.logContact(r.id,a.trim())),o(``),n(),X({title:`Logged`,description:`On People/${r.id}.md; last contact is today.`,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}c(!1)}},disabled:s||!a.trim(),children:`Log it`})})]}):(0,x.jsx)(`div`,{className:`detail`,children:(0,x.jsx)(zg,{lines:5})})})})}function R_({job:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)([]),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(`recruiter`),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(!1),p=()=>$.jobPeople(e.id).then(n).catch(()=>n([]));(0,b.useEffect)(()=>{p(),$.people().then(i).catch(()=>{})},[e.id]);let m=new Set((t??[]).map(e=>e.id)),h=r.filter(e=>!m.has(e.id));return(0,x.jsxs)(`div`,{className:`detail`,children:[t===null?(0,x.jsx)(zg,{lines:3}):t.length===0?(0,x.jsx)(`p`,{className:`muted`,children:`No one on this thread yet. Confirming an email a person wrote adds them; or add someone below.`}):(0,x.jsx)(`ul`,{className:`people__list`,children:t.map((e,t)=>(0,x.jsxs)(`li`,{className:`people__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:e.name}),e.role&&(0,x.jsx)(z,{size:`sm`,tone:N_[P_(e.role)],variant:`soft`,children:M_[P_(e.role)]}),e.context&&(0,x.jsx)(`div`,{className:`reasons__detail`,children:e.context})]}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[e.email&&(0,x.jsx)(`a`,{className:`num muted`,href:`mailto:${e.email}`,children:e.email}),e.id&&(0,x.jsx)(`a`,{className:`muted`,href:`#/people`,title:`People/${e.id}.md`,children:`People ↗`})]})]},`${e.id||e.name}-${t}`))}),(0,x.jsx)(z_,{job:e}),(0,x.jsxs)(`div`,{className:`people__add`,children:[(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsxs)(J,{size:`sm`,label:`Someone already in People`,value:a||`__none__`,onValueChange:e=>o(e===`__none__`?``:e),children:[(0,x.jsx)(J.Item,{value:`__none__`,children:`Pick a person`}),h.map(e=>(0,x.jsxs)(J.Item,{value:e.id,children:[e.name,e.company?` · ${e.company}`:``]},e.id))]}),(0,x.jsx)(J,{size:`sm`,label:`On this thread as`,value:s,onValueChange:e=>c(e),children:qg.map(e=>(0,x.jsx)(J.Item,{value:e,children:M_[e]},e))})]}),(0,x.jsx)(Zp,{size:`sm`,label:`Context`,placeholder:`A few words: reached out on LinkedIn, ran the screen, knows the team.`,value:l,onChange:e=>u(e.target.value)}),(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{size:`sm`,tone:`primary`,variant:`soft`,disabled:!a||d,onClick:async()=>{if(a){f(!0);try{await $.attachPerson(a,e.id,s,l.trim()),o(``),u(``),p(),X({title:`Added to the note`,description:`Under ## People on ${e.company} - ${e.title}.`,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}f(!1)}},children:`Add to this thread`}),(0,x.jsx)(I_,{job:e,onAdded:()=>{p(),$.people().then(i).catch(()=>{})}})]})]})]})}function z_({job:e}){let[t,n]=(0,b.useState)(null);if((0,b.useEffect)(()=>{$.jobConnections(e.id).then(n).catch(()=>n(null))},[e.id]),!t||!t.imported)return null;let r=t.people.slice(0,8);return(0,x.jsxs)(`div`,{className:`connections`,children:[(0,x.jsx)(`h4`,{className:`connections__title`,children:t.count===0?`No connections at ${e.company}`:`${t.count} connection${t.count===1?``:`s`} at ${e.company}`}),r.length>0&&(0,x.jsx)(`ul`,{className:`people__list`,children:r.map(e=>(0,x.jsxs)(`li`,{className:`people__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:e.name}),e.role!==`other`&&(0,x.jsx)(z,{size:`sm`,tone:N_[P_(e.role)],variant:`soft`,children:M_[P_(e.role)]}),e.title&&(0,x.jsx)(`div`,{className:`reasons__detail`,children:e.title})]}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[e.connectedOn&&(0,x.jsxs)(`span`,{className:`num muted`,children:[`since `,e.connectedOn.slice(0,4)]}),e.url&&(0,x.jsx)(`a`,{className:`muted`,href:e.url,target:`_blank`,rel:`noreferrer`,children:`LinkedIn ↗`})]})]},e.url||e.name))}),t.count>r.length&&(0,x.jsxs)(`p`,{className:`muted`,children:[`and `,t.count-r.length,` more.`]}),(0,x.jsxs)(`p`,{className:`muted`,children:[`From your LinkedIn export, imported `,t.imported.slice(0,10),`. A warm introduction beats a cold apply.`]})]})}function B_({onDone:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(`roles`),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)(``),p=()=>$.linkedinStatus().then(n).catch(()=>n({imported:null}));(0,b.useEffect)(()=>{p()},[]);let m=s===`everyone`,h=async()=>{f(`preview`);try{u(await $.linkedinPreview(r.trim(),a||void 0,m))}catch(e){X({title:`Could not read the export`,description:e.message,tone:`danger`})}f(``)},g=async()=>{f(`import`);try{let t=await $.linkedinImport(r.trim(),{since:a||void 0,everyone:m});X({title:`LinkedIn export imported`,description:`${t.people.created} people created, ${t.people.recognised} already there, ${t.people.attached} put on job notes; ${t.counts.connections} connections indexed.`,tone:`success`}),u(null),e(),p()}catch(e){X({title:`Import failed`,description:e.message,tone:`danger`})}f(``)},_=t?.source?t.source.split(/[\\/]/).pop():``;return(0,x.jsx)(V,{children:(0,x.jsxs)(`div`,{className:`linkedin`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h3`,{className:`connections__title`,children:`Bring your LinkedIn history`}),(0,x.jsxs)(`p`,{className:`muted`,children:[`Request the larger archive at `,(0,x.jsx)(`a`,{href:`https://www.linkedin.com/mypreferences/d/download-my-data`,target:`_blank`,rel:`noreferrer`,children:`linkedin.com/mypreferences/d/download-my-data`}),`, download the zip when LinkedIn emails it (a partial in about ten minutes, the complete one within a day), and paste its path here. It is read in place and never copied. It writes, into this profile folder only: who you know at each company (shown on every job) and People notes for the recruiters and hiring managers who wrote.`]}),t?.imported&&t.counts&&(0,x.jsxs)(`p`,{className:`muted`,children:[`Last imported `,t.imported.slice(0,10),_?` from ${_}`:``,`: `,t.counts.connections,` connections, `,t.counts.threads,` conversations and `,t.counts.invitations,` invitations since `,t.since,`.`]})]}),(0,x.jsxs)(`div`,{className:`linkedin__form`,children:[(0,x.jsx)(Zp,{className:`linkedin__path`,size:`sm`,label:`Path to the export`,placeholder:`C:\\Users\\you\\Downloads\\Complete_LinkedInDataExport_2026-09-24.zip`,value:r,onChange:e=>i(e.target.value)}),(0,x.jsx)(Zp,{size:`sm`,type:`date`,label:`Since`,value:a,onChange:e=>o(e.target.value),description:`Default: 90 days ago`}),(0,x.jsxs)(J,{size:`sm`,label:`Write as People`,value:s,onValueChange:e=>c(e),children:[(0,x.jsx)(J.Item,{value:`roles`,children:`Recruiters and hiring managers`}),(0,x.jsx)(J.Item,{value:`everyone`,children:`Everyone who wrote`})]}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,onClick:h,loading:d===`preview`,disabled:!r.trim()||d!==``,children:`Preview`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,onClick:g,loading:d===`import`,disabled:!r.trim()||d!==``,children:`Import`})]}),l&&(0,x.jsxs)(`div`,{className:`linkedin__preview`,children:[(0,x.jsxs)(`p`,{children:[(0,x.jsx)(`strong`,{children:l.self||`You`}),`, `,l.kind===`zip`?`zip`:`folder`,` with `,l.files.length,` files read. `,l.counts.connections,` connections; `,l.counts.threads,` conversations and `,l.counts.invitations,` invitations since `,l.since,`; `,l.counts.applications,` applications (`,l.applicationsSince,` since then); `,l.counts.savedJobs,` saved jobs (`,l.savedJobsSince,` since then).`]}),(0,x.jsxs)(`p`,{children:[`Would write `,(0,x.jsx)(`strong`,{children:l.people.chosen}),` `,m?`people who wrote`:`recruiters and hiring managers`,` of `,l.people.candidates,` senders (`,l.people.onJobNotes,` at companies on your job notes). `,l.warmPaths.jobsWithConnections,` companies on your job notes have connections`,l.warmPaths.top.length?`: ${l.warmPaths.top.slice(0,6).map(e=>`${e.company} (${e.count})`).join(`, `)}`:``,`.`]}),l.people.sample.length>0&&(0,x.jsx)(`ul`,{className:`people__list`,children:l.people.sample.slice(0,6).map(e=>(0,x.jsxs)(`li`,{className:`people__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:e.name}),` `,(0,x.jsx)(z,{size:`sm`,tone:N_[P_(e.role)],variant:`soft`,children:M_[P_(e.role)]}),(e.title||e.company)&&(0,x.jsx)(`div`,{className:`reasons__detail`,children:[e.title,e.company].filter(Boolean).join(` · `)})]}),(0,x.jsx)(`div`,{className:`pager__buttons`,children:(0,x.jsxs)(`span`,{className:`num muted`,children:[e.last,` · `,e.messages,` message`,e.messages===1?``:`s`]})})]},`${e.name}-${e.last}`))})]})]})})}function V_({job:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(`auto`),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(!1),d=(0,b.useRef)(!1),f=(e,t)=>{n(e),t&&i(e.saved?.text??``)};(0,b.useEffect)(()=>{n(null),$.tailoredResume(e.id).then(e=>f(e,!0)).catch(e=>X({title:`Could not read the resume`,description:e.message,tone:`danger`}))},[e.id]),(0,b.useEffect)(()=>{if(!t?.running){d.current&&t&&(d.current=!1,f(t,!t.error),t.error||X({title:`Resume tailored`,description:`Saved into the note. Read the warnings, then print.`,tone:`success`}));return}d.current=!0;let r=setInterval(()=>$.tailoredResume(e.id).then(e=>n(e)).catch(()=>{}),2500);return()=>clearInterval(r)},[t?.running,e.id]);let p=async()=>{if(!t?.saved||window.confirm(`Tailor again? It replaces the version saved in this note.`))try{f(await $.writeTailoredResume(e.id,{emphasis:a,extra:s}),!1)}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},m=async()=>{u(!0);try{f(await $.saveTailoredResume(e.id,r),!0),X({title:`Saved`,description:`Checked against your resume of record again.`,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}u(!1)};if(!t)return(0,x.jsx)(`div`,{className:`detail`,children:(0,x.jsx)(zg,{lines:6})});let h=t.saved,g=!!h&&r!==h.text,_=h?h.warnings.filter(e=>e.kind===`trace`||e.kind===`claim`||e.kind===`header`||e.kind===`date`).length:0;return(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`div`,{className:`letter__options`,children:[(0,x.jsxs)(J,{size:`sm`,label:`Emphasis`,value:a,onValueChange:e=>o(e),disabled:t.running,children:[(0,x.jsx)(J.Item,{value:`auto`,children:`Let the posting decide`}),(0,x.jsx)(J.Item,{value:`design-systems`,children:`Design systems first`}),(0,x.jsx)(J.Item,{value:`ai-product`,children:`AI product surfaces first`})]}),(0,x.jsx)(Zp,{size:`sm`,label:`Anything to bring forward`,description:`Optional. A project, a tool, a role to lead with.`,value:s,onChange:e=>c(e.target.value),disabled:t.running})]}),(0,x.jsxs)(`div`,{className:`form__actions form__actions--start`,children:[(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:p,disabled:t.running,leadingIcon:t.running?(0,x.jsx)(Bg,{size:`sm`}):(0,x.jsx)(H.Sparkles,{}),children:t.running?`Tailoring`:h?`Tailor again`:`Tailor my resume to this posting`}),h&&(0,x.jsx)(B,{asChild:!0,variant:`soft`,size:`sm`,trailingIcon:(0,x.jsx)(H.ExternalLink,{}),children:(0,x.jsx)(`a`,{href:$.resumePrintUrl(e.id),target:`_blank`,rel:`noopener noreferrer`,children:`Print / save as PDF`})}),g&&(0,x.jsx)(B,{variant:`soft`,tone:`primary`,size:`sm`,onClick:m,loading:l,children:`Save edits`})]}),t.running&&(0,x.jsx)(Bg,{showLabel:!0,label:`${t.runner} is reordering your resume for ${e.company}`,size:`sm`}),t.error&&!t.running&&(0,x.jsx)(Vg,{tone:`danger`,size:`sm`,icon:(0,x.jsx)(H.Warning,{}),title:t.errorKind===`auth`?`${t.runner} is signed out`:t.errorKind===`outdated`?`${t.runner} is out of date`:`The resume was not written`,description:t.error}),!h&&!t.running&&!t.error&&(0,x.jsx)(Vg,{size:`sm`,icon:(0,x.jsx)(H.File,{}),title:`Not tailored yet`,description:`Same jobs, dates and numbers as your resume of record. The summary, order and emphasis change for ${e.company}. Nothing is added.`}),h&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`letter__meta`,children:[(0,x.jsxs)(z,{tone:`neutral`,size:`sm`,children:[h.words,` words · `,h.bullets,` bullets`]}),_===0?(0,x.jsx)(z,{tone:`success`,size:`sm`,children:`Every line traces to your resume`}):(0,x.jsxs)(z,{tone:`danger`,size:`sm`,children:[_,` line`,_===1?``:`s`,` not on your resume`]}),h.warnings.length>_&&(0,x.jsxs)(z,{tone:`warning`,size:`sm`,children:[h.warnings.length-_,` style`]}),g&&(0,x.jsx)(z,{tone:`primary`,variant:`outline`,size:`sm`,children:`Unsaved edits`})]}),h.warnings.length>0&&(0,x.jsx)(`ul`,{className:`letter__warnings`,children:h.warnings.map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(z,{tone:e.kind===`style`||e.kind===`length`?`warning`:`danger`,size:`sm`,children:e.kind}),(0,x.jsx)(`span`,{children:e.text})]},e.text))}),(0,x.jsxs)(Z,{defaultValue:`preview`,variant:`pill`,size:`sm`,children:[(0,x.jsxs)(Z.List,{"aria-label":`Resume view`,children:[(0,x.jsx)(Z.Trigger,{value:`preview`,children:`Preview`}),(0,x.jsx)(Z.Trigger,{value:`edit`,children:`Edit`})]}),(0,x.jsx)(Z.Content,{value:`preview`,children:(0,x.jsx)(`div`,{className:`resume-preview`,children:(0,x.jsx)(dg,{text:r})})}),(0,x.jsx)(Z.Content,{value:`edit`,children:(0,x.jsx)(Xp,{label:`Tailored resume (Markdown)`,rows:24,resize:`vertical`,font:`mono`,value:r,onChange:e=>i(e.target.value),description:`Keep the headings. Saving re-runs the trace check.`})})]})]}),(0,x.jsx)(`p`,{className:`muted`,children:`Saved under "Tailored resume" in the job note; the packet's Resume variant field points at it. The PDF you upload comes from the print view.`})]})}var H_=e=>e===`tekjobs`;function U_({label:e=`TekJobs`}){return(0,x.jsxs)(z,{tone:`primary`,variant:`solid`,size:`sm`,title:`Posted on TekJobs by the employer`,children:[(0,x.jsx)(`img`,{className:`posted__glyph`,src:t_.logo,alt:``,width:12,height:12}),e]})}function W_({onAdded:e,onOpen:t}){let[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(null),u=i.split(/\s+/).map(e=>e.trim()).filter(e=>/^https?:\/\//i.test(e));return(0,x.jsxs)(W,{open:n,onOpenChange:e=>{r(e),e||(a(``),l(null))},size:`md`,children:[(0,x.jsx)(W.Trigger,{asChild:!0,children:(0,x.jsx)(B,{size:`sm`,variant:`soft`,leadingIcon:(0,x.jsx)(H.Plus,{}),children:`Add by link`})}),(0,x.jsxs)(W.Content,{children:[(0,x.jsx)(W.Title,{children:`Add postings by link`}),(0,x.jsx)(W.Description,{children:`One link per line. LinkedIn job pages, company careers pages, and Greenhouse, Lever or Ashby postings. Each is read once, scored like the scan does, and written as a note unless it is already here.`}),(0,x.jsx)(Xp,{label:`Links`,rows:5,value:i,onChange:e=>a(e.target.value),placeholder:`https://www.linkedin.com/jobs/view/…
|
|
75
75
|
https://jobs.lever.co/…`,disabled:o}),c&&(0,x.jsx)(`ul`,{className:`import-results`,children:c.map((e,n)=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(z,{size:`sm`,tone:e.ok?e.added?`success`:`neutral`:`danger`,children:e.ok?e.added?`added`:`already here`:`failed`}),e.ok?(0,x.jsxs)(`span`,{className:`import-results__row`,children:[(0,x.jsxs)(`span`,{children:[e.score,` ·`]}),e.id?(0,x.jsxs)(B,{variant:`link`,size:`sm`,tone:`primary`,onClick:()=>{r(!1),t(e.id)},children:[e.company,` — `,e.title]}):(0,x.jsxs)(`span`,{children:[e.company,` — `,e.title]}),e.link&&(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,trailingIcon:(0,x.jsx)(H.ExternalLink,{}),children:(0,x.jsx)(`a`,{href:e.link,target:`_blank`,rel:`noopener noreferrer`,children:`Open posting`})}),e.reason&&(0,x.jsxs)(`span`,{className:`muted`,children:[`(`,e.reason,`)`]}),e.belowMin&&(0,x.jsx)(`span`,{className:`muted`,children:`· below the scan's minimum, written anyway`})]}):(0,x.jsxs)(`span`,{children:[e.error,` (`,e.url,`)`]})]},n))}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:o,children:`Close`})}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:o||u.length===0,loading:o,onClick:async()=>{s(!0);try{let t=await $.importLinks(u);l(t);let n=t.filter(e=>e.added);n.length?(X({title:`${n.length} job${n.length===1?``:`s`} added`,description:n.map(e=>`${e.company}: ${e.title}`).join(` · `),tone:`success`}),e(n[0]?.id??null)):X({title:`Nothing new`,description:`Every link was already here, or could not be read.`,tone:`warning`})}catch(e){X({title:`Import failed`,description:e.message,tone:`danger`})}finally{s(!1)}},children:o?`Reading…`:`Add ${u.length||``}`.trim()})]})]})]})}function G_({job:e,onAttached:t}){let[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(!1),c=e.source===`mail`||e.source===`page`||!e.url||/mail\.google\.com/.test(e.url),l=async(n=!1)=>{s(!0);try{let o=await $.attachPosting(e.id,i.trim(),n);t(o),r(!1),a(``),o.linkOnly?X({title:`${o.company}: link saved`,description:o.warning?`The posting itself could not be read (${o.warning}), so only the link is on the note. Open posting now goes there.`:`Only the link is on the note; nothing else changed.`,tone:`neutral`}):X({title:`${o.company}: posting attached`,description:`Scored ${o.score} from the posting. Status, notes and drafts kept.`,tone:`success`})}catch(e){X({title:`Could not attach`,description:e.message,tone:`danger`})}finally{s(!1)}};return(0,x.jsxs)(W,{open:n,onOpenChange:r,size:`sm`,children:[(0,x.jsx)(W.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:c?`soft`:`ghost`,size:`sm`,leadingIcon:(0,x.jsx)(H.Link,{}),children:c?`Attach posting`:`Replace posting`})}),(0,x.jsxs)(W.Content,{children:[(0,x.jsx)(W.Title,{children:c?`Attach the posting`:`Replace the posting`}),(0,x.jsxs)(W.Description,{children:[c?`This note was created without the posting itself. `:``,`Paste the job's link. Attach reads the posting and replaces the note's facts, score and description; status, notes, packet and drafts stay. Link only just records the link, for a page that cannot be read (LinkedIn, a login wall) or when the note's facts are already right.`]}),(0,x.jsx)(Zp,{label:`Posting link`,placeholder:`https://jobs.ashbyhq.com/… or the company careers page`,value:i,onChange:e=>a(e.target.value),disabled:o}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:o,children:`Cancel`})}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`neutral`,disabled:o||!/^https?:\/\//i.test(i.trim()),onClick:()=>l(!0),children:`Link only`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:o||!/^https?:\/\//i.test(i.trim()),loading:o,onClick:()=>l(!1),children:`Attach`})]})]})]})}var K_=25,q_=[[``,`any time`],[`2`,`2 days`],[`7`,`7 days`],[`14`,`14 days`],[`30`,`30 days`],[`90`,`90 days`]],J_={q:``,location:``,remote:!1,kind:`all`,band:[],status:[],source:[],company:[],minScore:`45`,maxScore:``,payMin:``,payMax:``,payKnown:!1,postedDays:``,foundDays:``},Y_=()=>new URLSearchParams(window.location.hash.split(`?`)[1]??``),X_=[{key:`minScore`,label:`Score at least`},{key:`remote`,label:`Remote only`},{key:`location`,label:`Location`},{key:`kind`,label:`Title`},{key:`band`,label:`Pay band`},{key:`status`,label:`Status`},{key:`source`,label:`Source`},{key:`company`,label:`Company`},{key:`payMin`,label:`Pay at least`},{key:`payMax`,label:`Pay at most`},{key:`payKnown`,label:`Stated pay only`},{key:`postedDays`,label:`Posted within`},{key:`foundDays`,label:`Found within`},{key:`maxScore`,label:`Score at most`}],Z_=(e,t)=>{let n=e[t];return Array.isArray(n)?n.length>0:typeof n==`boolean`?n:t===`minScore`?n!==``&&n!==`0`:n!==J_[t]};function Q_(e){let t=e===void 0?Y_():new URLSearchParams(e),n={...J_,band:[],status:[],source:[],company:[]},r=n;for(let e of Object.keys(J_)){let n=t.get(e);if(n===null)continue;let i=J_[e];r[e]=Array.isArray(i)?n.split(`,`).filter(Boolean):typeof i==`boolean`?n===`1`:n}return n}function $_(e,t,n){let r=new URLSearchParams;for(let t of Object.keys(J_)){let n=e[t];Array.isArray(n)?n.length&&r.set(t,n.join(`,`)):typeof n==`boolean`?n&&r.set(t,`1`):n!==J_[t]&&r.set(t,n)}return t!==`score`&&r.set(`sort`,t),n!==`desc`&&r.set(`dir`,n),r.toString()}function ev(e,t,n){let r=$_(e,t,n);window.history.replaceState(null,``,`#/jobs${r?`?${r}`:``}`)}var tv=e=>({q:e.q,location:e.location,remote:e.remote?1:void 0,kind:e.kind===`all`?void 0:e.kind,band:e.band.join(`,`),status:e.status.join(`,`),source:e.source.join(`,`),company:e.company.join(`,`),minScore:e.minScore===`0`||e.minScore===``?void 0:Number(e.minScore),maxScore:e.maxScore?Number(e.maxScore):void 0,payMin:e.payMin?Number(e.payMin):void 0,payMax:e.payMax?Number(e.payMax):void 0,payKnown:e.payKnown?1:void 0,postedDays:e.postedDays?Number(e.postedDays):void 0,foundDays:e.foundDays?Number(e.foundDays):void 0}),nv=(e,t,n)=>e.map(e=>({value:e,label:n(e),hint:t?String(t[e]??0):void 0})),rv=`tekjobs.jobs.last`,iv=e=>{try{localStorage.setItem(rv,e)}catch{}},av=()=>{let[e,t]=window.location.hash.replace(/^#\/?/,``).split(`?`);if(e!==`jobs`||t)return;let n=``;try{n=localStorage.getItem(rv)??``}catch{}n&&window.history.replaceState(null,``,`#/jobs?${n}`)};function ov({initialQuery:e=``}){e||av();let[t,n]=(0,b.useState)(()=>{let t=Q_();return e?{...t,q:e}:t}),[r,i]=(0,b.useState)(()=>Y_().get(`sort`)||`score`),[a,o]=(0,b.useState)(()=>Y_().get(`dir`)===`asc`?`asc`:`desc`),[s,c]=(0,b.useState)(0),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)(0),[p,m]=(0,b.useState)(null),[h,g]=(0,b.useState)(null),[_,v]=(0,b.useState)(null),y=(0,b.useRef)(null),[S,C]=(0,b.useState)([]),[w,T]=(0,b.useState)([]),[E,D]=(0,b.useState)([]),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(()=>{try{return localStorage.getItem(`tekjobs.jobs.condensed`)===`1`}catch{return!1}}),ee=()=>j(e=>{try{localStorage.setItem(`tekjobs.jobs.condensed`,e?`0`:`1`)}catch{}return!e}),[M,N]=(0,b.useState)(()=>Y_().get(`open`)),[te,P]=(0,b.useState)(0);(0,b.useEffect)(()=>{$.views().then(T).catch(()=>{}),$.defaultViews().then(D).catch(()=>{}),$.facets({}).then(e=>g(e.total)).catch(()=>{}),$.summary().then(e=>{if(!e.minScore)return;let t=String(e.minScore),r=Y_().has(`minScore`);J_.minScore=t,r||n(e=>e.minScore===`45`||e.minScore===``?{...e,minScore:t}:e)}).catch(()=>{})},[]);let F=(e,t)=>{n(n=>({...n,[e]:t})),c(0)},ne=(0,b.useMemo)(()=>tv(t),[t]),re=JSON.stringify(ne),ie=t.remote;(0,b.useEffect)(()=>{e&&F(`q`,e)},[e]),(0,b.useEffect)(()=>{ev(t,r,a),iv($_(t,r,a))},[t,r,a]),(0,b.useEffect)(()=>{let e=()=>{if(window.location.hash.replace(/^#\/?/,``).split(`?`)[0]!==`jobs`)return;av();let e=Q_(),s=Y_().get(`sort`)||`score`,l=Y_().get(`dir`)===`asc`?`asc`:`desc`;$_(e,s,l)!==$_(t,r,a)&&(n(e),i(s),o(l),c(0))};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[t,r,a]),(0,b.useEffect)(()=>{let e=!0;return $.jobs({...ne,sort:r,dir:a,limit:K_,offset:s*K_}).then(t=>{e&&(u(t.rows),f(t.total))}).catch(e=>X({title:`Could not load jobs`,description:e.message,tone:`danger`})),$.facets(ne).then(t=>{e&&m(t)}).catch(()=>{}),()=>{e=!1}},[re,r,a,s,te]);let ae=nv(Gg,p?.status,e=>e),oe=nv([`floor`,`stretch`,`below`,`unknown`],p?.band,e=>Zg[e]),se=nv(Array.from(new Set([...p?.source.link?[`link`]:[],...Object.entries(p?.source??{}).filter(([e])=>e!==`link`).sort((e,t)=>t[1]-e[1]).map(([e])=>e),...t.source])),p?.source,e=>e===`link`?`added by link`:e),ce=nv(Array.from(new Set([...t.company,...Object.entries(p?.company??{}).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e])=>e)])),p?.company,e=>e),le=p?.pay,ue=Math.max(1,Math.ceil(d/K_)),de=Math.min(s,ue-1),fe=e=>{r===e?o(a===`desc`?`asc`:`desc`):(i(e),o(e===`company`||e===`title`?`asc`:`desc`)),c(0)},pe=(e,t,n)=>(0,x.jsx)(Y.HeadCell,{...n,"aria-sort":r===e?a===`desc`?`descending`:`ascending`:void 0,children:(0,x.jsx)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>fe(e),trailingIcon:r===e?a===`desc`?(0,x.jsx)(H.ArrowDown,{}):(0,x.jsx)(H.ArrowUp,{}):void 0,children:(0,x.jsx)(`span`,{className:`col`,children:t})})}),me=e=>u(t=>t&&t.map(t=>t.id===e.id?{...t,status:e.status}:t)),I=e_(`(min-width: 68.75rem)`),he=I&&M!==null,ge=l?l.findIndex(e=>e.id===M):-1,_e=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!l||!_e.current)return;let e=_e.current;_e.current=null;let t=e===`first`?l[0]:l[l.length-1];t&&N(t.id)},[l]);let ve=e=>{if(!l||l.length===0)return;let t=l[0];if(ge<0){t&&N(t.id);return}let n=ge+e,r=l[n];r?N(r.id):n>=l.length&&de<ue-1?(_e.current=`first`,c(de+1)):n<0&&de>0&&(_e.current=`last`,c(de-1))};(0,b.useEffect)(()=>{if(M===null)return;let e=e=>{let t=e.target;e.defaultPrevented||e.metaKey||e.ctrlKey||e.altKey||t&&(/^(input|textarea|select)$/i.test(t.tagName)||t.isContentEditable)||(e.key===`Escape`?N(null):e.key===`j`||e.key===`ArrowDown`?(e.preventDefault(),ve(1)):(e.key===`k`||e.key===`ArrowUp`)&&(e.preventDefault(),ve(-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});let L={pos:ge>=0?de*K_+ge:-1,total:d,prev:()=>ve(-1),next:()=>ve(1)},ye=X_.filter(e=>Z_(t,e.key)).length+ +!!t.q,be=e=>{switch(e){case`location`:return(0,x.jsx)(Zp,{size:`sm`,label:`Location`,description:`Comma-separated, any of; whole words.`,placeholder:`seattle, wa, united states`,value:t.location,onChange:e=>F(`location`,e.target.value),autoFocus:!0});case`remote`:return(0,x.jsx)(Hp,{size:`sm`,label:`Remote only${p?` (${p.remote.remote})`:``}`,checked:t.remote,onCheckedChange:e=>F(`remote`,e===!0)});case`payKnown`:return(0,x.jsx)(Hp,{size:`sm`,label:`Stated pay only`,checked:t.payKnown,onCheckedChange:e=>F(`payKnown`,e===!0)});case`kind`:return(0,x.jsxs)(J,{size:`sm`,label:`Title`,value:t.kind,onValueChange:e=>F(`kind`,e),children:[(0,x.jsx)(J.Item,{value:`all`,children:`All titles`}),(0,x.jsxs)(J.Item,{value:`design-eng`,children:[`Design engineering`,p?` (${p.kind[`design-eng`]??0})`:``]}),(0,x.jsxs)(J.Item,{value:`adjacent`,children:[`Adjacent`,p?` (${p.kind.adjacent??0})`:``]})]});case`band`:return(0,x.jsx)(Wg,{size:`sm`,multiple:!0,label:`Pay band`,placeholder:`All bands`,emptyMessage:`No band by that name.`,options:oe,value:t.band,onValueChange:e=>F(`band`,e)});case`status`:return(0,x.jsx)(Wg,{size:`sm`,multiple:!0,label:`Status`,placeholder:`All statuses`,emptyMessage:`No status by that name.`,options:ae,value:t.status,onValueChange:e=>F(`status`,e)});case`source`:return(0,x.jsx)(Wg,{size:`sm`,multiple:!0,label:`Source`,placeholder:`All sources`,emptyMessage:`No source by that name.`,options:se,value:t.source,onValueChange:e=>F(`source`,e)});case`company`:return(0,x.jsx)(Wg,{size:`sm`,multiple:!0,label:`Company`,placeholder:`Any company`,emptyMessage:`No company in the current results by that name.`,options:ce,value:t.company,onValueChange:e=>F(`company`,e)});case`payMin`:return(0,x.jsx)(Zp,{size:`sm`,type:`number`,step:1e4,label:`Pay at least`,description:le?`Top of the stated range. Stated on ${le.stated} of ${le.stated+le.unstated}.`:void 0,placeholder:`200000`,value:t.payMin,onChange:e=>F(`payMin`,e.target.value),autoFocus:!0});case`payMax`:return(0,x.jsx)(Zp,{size:`sm`,type:`number`,step:1e4,label:`Pay at most`,description:le&&le.stated?`${Jg(le.min)} to ${Jg(le.max)}, median ${Jg(le.median)}.`:void 0,placeholder:`300000`,value:t.payMax,onChange:e=>F(`payMax`,e.target.value),autoFocus:!0});case`minScore`:return(0,x.jsx)(J,{size:`sm`,label:`Score at least`,value:t.minScore||`0`,onValueChange:e=>F(`minScore`,e),children:[`0`,`45`,`60`,`75`,`90`,`100`].map(e=>(0,x.jsx)(J.Item,{value:e,children:e===`0`?`any`:`${e} pts`},e))});case`maxScore`:return(0,x.jsx)(Zp,{size:`sm`,type:`number`,label:`Score at most`,placeholder:`any`,value:t.maxScore,onChange:e=>F(`maxScore`,e.target.value),autoFocus:!0});case`postedDays`:case`foundDays`:return(0,x.jsx)(J,{size:`sm`,label:e===`postedDays`?`Posted within`:`Found within`,value:t[e],onValueChange:t=>F(e,t),children:q_.map(([e,t])=>(0,x.jsx)(J.Item,{value:e,children:t},e||`any`))})}},xe=e=>{let n=t[e];return Array.isArray(n)?e===`band`?n.map(e=>Zg[e]).join(`, `):n.length>2?`${n.slice(0,2).join(`, `)} +${n.length-2}`:n.join(`, `):typeof n==`boolean`?``:e===`kind`?n===`design-eng`?`design engineering`:n===`adjacent`?`adjacent`:``:e===`payMin`||e===`payMax`?n?Jg(Number(n)):``:e===`minScore`||e===`maxScore`?n&&n!==`0`?`${n} pts`:``:e===`postedDays`||e===`foundDays`?n?`${n} days`:``:n},Se=e=>{let t=J_[e];F(e,e===`minScore`?`0`:Array.isArray(t)?[]:t),v(null),C(t=>t.filter(t=>t!==e))},Ce=e=>{e===`remote`||e===`payKnown`?F(e,!0):e===`kind`?F(e,`design-eng`):e===`postedDays`?F(e,`7`):e===`minScore`&&(!t.minScore||t.minScore===`0`)&&F(e,`45`),C(t=>t.includes(e)?t:[...t,e]),v(e)},we=X_.filter(e=>Z_(t,e.key)||_===e.key||S.includes(e.key)),Te=X_.filter(e=>!Z_(t,e.key)&&!S.includes(e.key)),Ee=$_(t,r,a),De=e=>{n(Q_(e.query)),c(0)},Oe=async()=>{let e=(O??``).trim();if(e)try{T(await $.saveViews([...w.filter(t=>t.name!==e),{name:e,query:Ee}])),k(null),X({title:`View "${e}" saved`,description:`Targets/Job Views.md`,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}},ke=async e=>{try{T(await $.saveViews(w.filter(t=>t.name!==e)))}catch(e){X({title:`Not removed`,description:e.message,tone:`danger`})}};return(0,x.jsxs)(`div`,{className:he?`jobs jobs--split`:`jobs`,children:[he?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`aside`,{className:`jobs__list`,"aria-label":`Matches`,children:[(0,x.jsxs)(`div`,{className:`ctools`,children:[(0,x.jsxs)(`div`,{className:`ctools__row`,children:[(0,x.jsx)(Zp,{size:`sm`,"aria-label":`Search`,placeholder:`Search company or role`,value:t.q,onChange:e=>F(`q`,e.target.value)}),(0,x.jsx)(Bh,{content:`Back to the full table (Esc)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Back to the full table`,leadingIcon:(0,x.jsx)(H.Grid,{}),onClick:()=>N(null)})})]}),(0,x.jsxs)(`div`,{className:`ctools__row ctools__meta`,children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`b`,{className:`num`,children:d}),h===null?null:(0,x.jsxs)(x.Fragment,{children:[` of `,h]}),` · `,ye,` filter`,ye===1?``:`s`]}),(0,x.jsx)(`span`,{className:`num`,children:`J K move · Esc close`})]})]}),(0,x.jsxs)(`div`,{className:`clist`,children:[(l??[]).map(e=>(0,x.jsx)(B,{asChild:!0,variant:`ghost`,size:`sm`,align:`start`,className:`clist__item`,children:(0,x.jsxs)(`button`,{type:`button`,"aria-current":e.id===M?`true`:void 0,"data-posted":H_(e.source)||void 0,onClick:()=>N(e.id),children:[(0,x.jsx)(`span`,{className:`clist__score num`,children:e.score}),(0,x.jsxs)(`span`,{className:`clist__text`,children:[(0,x.jsx)(`span`,{className:`clist__role`,children:e.title}),(0,x.jsxs)(`span`,{className:`clist__meta`,children:[e.company,` · `,(0,x.jsx)(`span`,{className:`num${e.payBand===`floor`?` clist__pay--floor`:``}`,children:e.salaryMax?Yg(e.salary):`not stated`}),` · `,Xg(e.posted)||`—`]})]})]})},e.id)),l&&l.length===0&&(0,x.jsx)(`p`,{className:`muted`,children:`Nothing matches these filters.`}),l&&ue>1&&(0,x.jsxs)(`div`,{className:`clist__pager`,children:[(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:de===0,onClick:()=>c(de-1),children:`Previous`}),(0,x.jsxs)(`span`,{className:`muted num`,children:[de+1,` / `,ue]}),(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:de>=ue-1,onClick:()=>c(de+1),children:`Next`})]})]})]}),(0,x.jsx)(`section`,{className:`jobs__detail`,"aria-label":`Job`,children:(0,x.jsx)(lv,{id:M,inline:!0,nav:L,onClose:()=>N(null),onChanged:me})})]}):(0,x.jsxs)(x.Fragment,{children:[!A&&(0,x.jsxs)(`div`,{className:`views`,children:[(0,x.jsx)(Bh,{content:`Hide the views and filters`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Hide the views and filters`,leadingIcon:(0,x.jsx)(H.ChevronUp,{}),onClick:ee})}),(0,x.jsx)(`span`,{className:`views__label`,children:`Views`}),E.map(e=>(0,x.jsx)(`div`,{className:`chip chip--default${e.query===Ee?` chip--current`:``}`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:e.query===Ee?`primary`:`neutral`,title:`From your criteria: ${e.hint}`,onClick:()=>De(e),children:e.name})},`d:${e.name}`)),w.map(e=>(0,x.jsxs)(`div`,{className:`chip${e.query===Ee?` chip--current`:``}`,children:[(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:e.query===Ee?`primary`:`neutral`,onClick:()=>De(e),children:e.name}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Remove the view ${e.name}`,onClick:()=>ke(e.name),children:`×`})]},e.name)),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,leadingIcon:(0,x.jsx)(H.Plus,{}),disabled:!Ee,onClick:()=>k(``),children:`Save current filters as a view`}),(0,x.jsx)(`div`,{className:`toolbar__spacer`})]}),!A&&(0,x.jsxs)(`div`,{className:`filters`,children:[(0,x.jsx)(Zp,{className:`filters__search`,size:`sm`,label:`Search`,placeholder:`company or role`,value:t.q,onChange:e=>F(`q`,e.target.value)}),we.map(e=>{let n=Z_(t,e.key),r=xe(e.key);return(0,x.jsxs)(`div`,{className:`chip${n?` chip--on`:``}`,children:[(0,x.jsxs)(fd,{open:_===e.key,onOpenChange:t=>v(t?e.key:null),size:`sm`,children:[(0,x.jsx)(fd.Trigger,{asChild:!0,children:(0,x.jsxs)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,leadingIcon:(0,x.jsx)(`span`,{className:`chip__dot`,"aria-hidden":`true`}),children:[e.label,r&&(0,x.jsx)(`span`,{className:`chip__value num`,children:r})]})}),(0,x.jsx)(fd.Content,{align:`start`,showArrow:!1,children:(0,x.jsx)(`div`,{className:`chip__editor`,children:be(e.key)})})]}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Remove ${e.label}`,onClick:()=>Se(e.key),children:`×`})]},e.key)}),Te.length>0&&(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,leadingIcon:(0,x.jsx)(H.Plus,{}),trailingIcon:(0,x.jsx)(H.ChevronDown,{}),children:`Filter`})}),(0,x.jsx)(Tu.Content,{align:`start`,onCloseAutoFocus:e=>{y.current&&(y.current=null,e.preventDefault())},children:Te.map(e=>(0,x.jsx)(Tu.Item,{onSelect:()=>{y.current=e.key,Ce(e.key)},children:e.label},e.key))})]}),we.some(e=>Z_(t,e.key)&&e.key!==`minScore`)||t.q?(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,onClick:()=>{n({...J_,band:[],status:[],source:[],company:[]}),c(0)},children:`Clear`}):null,(0,x.jsx)(`div`,{className:`toolbar__spacer`}),(0,x.jsx)(W_,{onAdded:e=>{P(e=>e+1),e&&N(e)},onOpen:e=>N(e)})]}),(0,x.jsxs)(`div`,{className:`filters__summary`,children:[(0,x.jsxs)(`span`,{children:[A&&(0,x.jsx)(Bh,{content:`Show the views and filters (${we.filter(e=>Z_(t,e.key)).length+ +!!t.q} active)`,children:(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`neutral`,"aria-label":`Show the views and filters`,leadingIcon:(0,x.jsx)(H.ChevronDown,{}),onClick:ee})}),(0,x.jsx)(`b`,{className:`num`,children:d}),` of `,(0,x.jsx)(`span`,{className:`num`,children:h??`…`}),` matches`,le&&le.stated>0&&(0,x.jsxs)(x.Fragment,{children:[` · pay stated on `,(0,x.jsx)(`span`,{className:`num`,children:le.stated}),`, median top of range `,(0,x.jsx)(`span`,{className:`num`,children:Jg(le.median)})]})]}),(0,x.jsxs)(`span`,{className:`num filters__query`,children:[`/jobs`,Ee?`?${Ee}`:``]})]}),(0,x.jsx)(W,{open:O!==null,onOpenChange:e=>!e&&k(null),size:`sm`,children:(0,x.jsxs)(W.Content,{children:[(0,x.jsx)(W.Title,{children:`Save these filters as a view`}),(0,x.jsx)(W.Description,{children:`A named link to exactly this filter set, kept in Targets/Job Views.md. Same name replaces the old one.`}),(0,x.jsx)(Zp,{label:`Name`,placeholder:`Design eng at floor`,value:O??``,onChange:e=>k(e.target.value),autoFocus:!0}),(0,x.jsxs)(`p`,{className:`muted num filters__query`,children:[`/jobs?`,Ee]}),(0,x.jsxs)(W.Footer,{children:[(0,x.jsx)(W.Close,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,children:`Cancel`})}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:!O?.trim(),onClick:Oe,children:`Save view`})]})]})}),(0,x.jsx)(V,{padding:`none`,children:(0,x.jsx)(`div`,{className:`jobs-narrow`,children:l===null?(0,x.jsx)(`div`,{className:`loading`,children:(0,x.jsx)(zg,{lines:8})}):(0,x.jsxs)(Y,{"aria-label":`Job matches`,density:`md`,stickyHeader:!0,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[pe(`score`,`Score`,{align:`end`,numeric:!0}),pe(`company`,`Company`),pe(`title`,`Role`),pe(`salaryMax`,`Pay`),(0,x.jsx)(Y.HeadCell,{children:`Location`}),pe(`posted`,`Posted`),(0,x.jsx)(Y.HeadCell,{children:`Status`})]})}),(0,x.jsxs)(Y.Body,{children:[l.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,selected:M===e.id,"data-posted":H_(e.source)||void 0,onClick:()=>N(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(`span`,{className:`num`,children:e.score})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[e.title,e.kind===`design-eng`&&(0,x.jsx)(`small`,{children:`design engineering`}),e.addedBy===`link`&&(0,x.jsx)(`small`,{children:`added by link`})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{tone:Qg[e.payBand],variant:e.payBand===`floor`?`solid`:`soft`,size:`sm`,children:e.salaryMax?Yg(e.salary):Zg[e.payBand]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`where`,children:[(0,x.jsx)(z,{tone:e.remote?`success`:`neutral`,variant:`soft`,size:`sm`,children:e.remote?`remote`:`on-site`}),(0,x.jsx)(`span`,{className:`clamp`,children:e.location})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted num`,children:Xg(e.posted)||`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{tone:$g[e.status],size:`sm`,children:e.status})})]},e.id)),l.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:7,children:(0,x.jsx)(`span`,{className:`muted`,children:`Nothing matches these filters. Loosen one.`})})})]})]})})}),(0,x.jsxs)(`div`,{className:`pager`,children:[(0,x.jsxs)(`span`,{children:[d,` match`,d===1?``:`es`,`, page `,de+1,` of `,ue,ie&&(0,x.jsx)(`span`,{className:`muted`,children:` · on-site and hybrid hidden`})]}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:de===0,onClick:()=>c(de-1),children:`Previous`}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:de>=ue-1,onClick:()=>c(de+1),children:`Next`})]})]})]}),!I&&(0,x.jsx)(cv,{id:M,nav:L,onClose:()=>N(null),onChanged:me})]})}function sv(e){return e.split(`
|
|
76
|
-
`).map(e=>e.replace(/^-\s*/,``).trim()).filter(Boolean).map(e=>{let t=[...e.matchAll(/(?<![\w$])([+-]\d+)\b/g)].reduce((e,t)=>e+Number(t[1]),0),n=e.replace(/(?<![\w$])[+-]\d+\b/g,``).replace(/\(\s*[,\s]*/g,`(`).replace(/[,\s]*\)/g,`)`).replace(/\(\)/g,``).replace(/\s+,/g,`,`).replace(/\s{2,}/g,` `).replace(/\s+:/g,`:`).trim(),r=n.indexOf(`:`),i=(r>=0?n.slice(0,r):n).trim().replace(/[,:]$/,``),a=(r>=0?n.slice(r+1):``).trim();return{label:i.charAt(0).toUpperCase()+i.slice(1),detail:a,points:t}})}function cv(e){return(0,x.jsx)(Sp,{open:e.id!==null,onOpenChange:t=>!t&&e.onClose(),side:`right`,size:`lg`,children:(0,x.jsx)(Sp.Content,{children:(0,x.jsx)(lv,{...e})})})}function lv({id:e,onClose:t,onChanged:n,nav:r,inline:i=!1}){let[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(!1);(0,b.useEffect)(()=>{o(null),e&&$.job(e).then(o).catch(e=>X({title:`Could not open the note`,description:e.message,tone:`danger`}))},[e]);let d=async e=>{if(a){u(!0);try{let t=await $.setStatus(a.id,e);o(t),n(t),X({title:`${a.company}: ${e}`,description:`Written to the note's frontmatter and status log.`,tone:`success`})}catch(e){X({title:`Status not saved`,description:e.message,tone:`danger`})}u(!1)}},f=async()=>{if(a&&s.trim()){u(!0);try{let e=await $.addNote(a.id,s);o(e),c(``),X({title:`Note added`,tone:`success`})}catch(e){X({title:`Note not saved`,description:e.message,tone:`danger`})}u(!1)}},[p,m]=(0,b.useState)(null);(0,b.useEffect)(()=>{Promise.all([$.summary(),$.companies()]).then(([e,t])=>m({ceiling:e.ceiling,bar:e.minScore,boards:t.map(e=>({name:e.name,tier:e.tier,status:e.status}))})).catch(()=>{})},[]);let h=(0,b.useMemo)(()=>a?sv(a.sections.why):[],[a]),g=a&&p?.ceiling?Math.max(0,Math.min(100,Math.round(a.score/p.ceiling*100))):null,_=a&&p?p.boards.find(e=>e.name.toLowerCase()===a.company.toLowerCase()):null,v=a?a.sections.description.replace(/^>.*$/m,``).replace(/[#*_`>]/g,``).replace(/\s+/g,` `).trim().slice(0,320):``,y=async e=>{if(a){u(!0);try{let t=await $.setStatus(a.id,`passed`,e);o(t),n(t),X({title:`${a.company}: passed`,description:e,tone:`neutral`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}u(!1)}},S=r&&(0,x.jsxs)(`div`,{className:`sheet-nav`,children:[(0,x.jsx)(Bh,{content:`Previous (K)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Previous job`,leadingIcon:(0,x.jsx)(H.ChevronUp,{}),disabled:r.pos<=0,onClick:r.prev})}),(0,x.jsx)(Bh,{content:`Next (J)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Next job`,leadingIcon:(0,x.jsx)(H.ChevronDown,{}),disabled:r.pos<0?r.total===0:r.pos>=r.total-1,onClick:r.next})}),(0,x.jsx)(`span`,{className:`sheet-nav__count num`,children:r.pos>=0?`${r.pos+1} of ${r.total}`:`not in this view`}),i&&(0,x.jsx)(Bh,{content:`Close (Esc)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Close`,leadingIcon:(0,x.jsx)(H.Close,{}),onClick:t,className:`sheet-nav__close`})})]});return(0,x.jsx)(x.Fragment,{children:a?(0,x.jsxs)(`div`,{className:`detail`,children:[S,(0,x.jsxs)(`div`,{className:`sheet-head`,children:[(0,x.jsxs)(`div`,{className:`sheet-head__main`,children:[(0,x.jsxs)(`p`,{className:`sheet-head__meta`,children:[a.company,` · `,a.location||`location n/a`,` · `,H_(a.source)?`posted on TekJobs`:a.source,` · found `,Xg(a.found)||a.found]}),i?(0,x.jsx)(`h2`,{className:`sheet-head__title`,children:a.title}):(0,x.jsx)(Sp.Title,{children:a.title}),(0,x.jsxs)(`div`,{className:`chips`,children:[H_(a.source)&&(0,x.jsx)(U_,{label:`Posted on TekJobs`}),(0,x.jsx)(z,{tone:a.payBand===`floor`?`primary`:`neutral`,variant:`soft`,size:`sm`,children:(0,x.jsx)(`span`,{className:`num`,children:a.salaryMax?Yg(a.salary):`pay not stated`})}),a.salaryMax>0&&(0,x.jsx)(z,{tone:`neutral`,variant:`outline`,size:`sm`,children:Zg[a.payBand].toLowerCase()}),(0,x.jsx)(z,{tone:a.remote?`success`:`neutral`,variant:a.remote?`soft`:`outline`,size:`sm`,children:a.remote?`remote`:`on-site`}),(0,x.jsx)(z,{tone:$g[a.status],size:`sm`,children:a.status})]})]}),(0,x.jsxs)(`div`,{className:`sheet-head__side`,children:[(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[a.status===`new`&&(0,x.jsx)(B,{tone:`primary`,size:`sm`,disabled:l,onClick:()=>d(`reviewing`),children:`Shortlist`}),(a.status===`new`||a.status===`reviewing`)&&(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:l,trailingIcon:(0,x.jsx)(H.ChevronDown,{}),children:`Pass`})}),(0,x.jsx)(Tu.Content,{align:`end`,children:Kg.map(e=>(0,x.jsx)(Tu.Item,{onSelect:()=>y(e),children:e},e))})]}),(0,x.jsx)(J,{size:`sm`,label:`Status`,value:a.status,onValueChange:e=>d(e),disabled:l,children:Gg.map(e=>(0,x.jsx)(J.Item,{value:e,children:e},e))})]}),(0,x.jsxs)(`div`,{className:`sheet-head__links`,children:[(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:a.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open posting ↗`})}),(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:a.obsidianUrl,title:a.path,children:`Open in Obsidian ↗`})}),(0,x.jsx)(B,{variant:`link`,size:`sm`,tone:`neutral`,title:a.path,onClick:()=>$.revealJob(a.id).catch(e=>X({title:`Could not show the file`,description:e.message,tone:`danger`})),children:`Show file`}),(0,x.jsx)(G_,{job:a,onAttached:e=>{o(e),n(e)}})]})]})]}),(0,x.jsxs)(Z,{defaultValue:`why`,variant:`line`,size:`sm`,children:[(0,x.jsxs)(Z.List,{"aria-label":`Job note sections`,children:[(0,x.jsx)(Z.Trigger,{value:`why`,children:`Match reasons`}),(0,x.jsx)(Z.Trigger,{value:`description`,children:`Description`}),(0,x.jsx)(Z.Trigger,{value:`application`,children:`Application packet`}),(0,x.jsx)(Z.Trigger,{value:`resume`,children:`Tailored resume`}),(0,x.jsx)(Z.Trigger,{value:`letter`,children:`Cover letter`}),(0,x.jsx)(Z.Trigger,{value:`people`,children:`People`}),(0,x.jsx)(Z.Trigger,{value:`notes`,children:`Notes`})]}),(0,x.jsx)(Z.Content,{value:`why`,children:(0,x.jsxs)(`div`,{className:`split`,children:[(0,x.jsxs)(`div`,{className:`reasons`,children:[(0,x.jsxs)(`div`,{className:`reasons__head`,children:[(0,x.jsxs)(`span`,{className:`muted`,children:[`Scored `,(0,x.jsx)(`span`,{className:`num`,children:a.score}),p?.ceiling?(0,x.jsxs)(x.Fragment,{children:[` of `,(0,x.jsx)(`span`,{className:`num`,children:p.ceiling}),` possible`]}):null,` with the active criteria`,p?.bar?(0,x.jsxs)(x.Fragment,{children:[` (bar `,(0,x.jsx)(`span`,{className:`num`,children:p.bar}),`)`]}):null,`.`]}),g!==null&&(0,x.jsxs)(`span`,{className:`reasons__fit num`,children:[g,(0,x.jsx)(`small`,{children:` fit`})]})]}),h.map((e,t)=>(0,x.jsxs)(`div`,{className:`reasons__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{children:e.label}),e.detail&&(0,x.jsx)(`div`,{className:`reasons__detail`,children:e.detail})]}),(0,x.jsxs)(`span`,{className:`num reasons__pts${e.points<0?` reasons__pts--neg`:``}`,children:[e.points<0?`−`:`+`,Math.abs(e.points)]})]},t)),h.length===0&&(0,x.jsx)(`p`,{className:`muted`,children:`No match reasons recorded.`}),(0,x.jsxs)(`details`,{className:`reasons__log`,children:[(0,x.jsx)(`summary`,{children:`Status log`}),(0,x.jsx)(dg,{text:a.sections.log||`_Nothing yet._`})]})]}),(0,x.jsxs)(`aside`,{className:`split__aside`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`From the posting`}),(0,x.jsx)(`p`,{children:v?`${v}${a.sections.description.length>320?`…`:``}`:`The posting had no description text. Open the posting, or attach one.`})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`Note`}),(0,x.jsxs)(`p`,{className:`num small`,children:[a.path.split(/[\\/]/).slice(-2).join(`/`),(0,x.jsx)(`br`,{}),`status: `,a.status,` · found `,a.found,a.addedBy===`scan`?``:` · added by ${a.addedBy}`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`Board`}),(0,x.jsx)(`p`,{children:_?`Tier ${_.tier} board, last fetch ${_.status||`not yet run`}.`:`${a.source}; not on the watchlist.`})]})]})]})}),(0,x.jsx)(Z.Content,{value:`description`,children:(0,x.jsx)(dg,{text:a.sections.description||`_The posting had no description text. Open the posting._`})}),(0,x.jsx)(Z.Content,{value:`application`,children:(0,x.jsx)(uv,{job:a,onStatus:d,busy:l})}),(0,x.jsx)(Z.Content,{value:`resume`,children:(0,x.jsx)(V_,{job:a})}),(0,x.jsx)(Z.Content,{value:`letter`,children:(0,x.jsx)(j_,{job:a})}),(0,x.jsx)(Z.Content,{value:`people`,children:(0,x.jsx)(R_,{job:a})}),(0,x.jsx)(Z.Content,{value:`notes`,children:(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(dg,{text:a.sections.notes||`_No notes yet._`}),(0,x.jsx)(Xp,{label:`Add a note`,rows:3,value:s,onChange:e=>c(e.target.value),placeholder:`Appended to the note with today's date.`}),(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:f,disabled:l||!s.trim(),children:`Save note`})})]})})]})]}):(0,x.jsxs)(`div`,{className:`detail`,children:[S,(0,x.jsx)(zg,{lines:6})]})})}function uv({job:e,onStatus:t,busy:n}){let[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)({}),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)([]),d=()=>$.packet(e.id).then(e=>{i(e),o(e.values)}).catch(e=>X({title:`Could not read the packet`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{d(),$.resumes().then(e=>u(e.files.map(e=>e.name))).catch(()=>{})},[e.id]);let f=async(t,n)=>{o(e=>({...e,[t]:n})),c(t);try{await $.saveApplication(e.id,t,n),await d(),X({title:`${t} saved`,description:n,tone:`success`})}catch(e){X({title:`${t} not saved`,description:e.message,tone:`danger`})}finally{c(``)}},p=async t=>{if(r&&a[t]!==r.values[t]){c(t);try{await $.saveApplication(e.id,t,a[t]??``),await d(),X({title:`${t} saved`,description:`Written into the note.`,tone:`success`})}catch(e){X({title:`${t} not saved`,description:e.message,tone:`danger`})}finally{c(``)}}};return r?(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`div`,{className:`packet__state`,children:[(0,x.jsxs)(z,{tone:r.ready?`success`:`neutral`,variant:r.ready?`soft`:`outline`,children:[r.filled,` of `,r.total,` filled`]}),r.ready?(0,x.jsx)(`p`,{className:`muted`,children:`Every required field has something in it. Read it before you send it — this says the boxes are full, not that the application is good.`}):(0,x.jsxs)(`p`,{className:`muted`,children:[`Still required: `,r.missing.join(`, `),`.`]})]}),r.ready&&e.status!==`applied`&&(0,x.jsxs)(`div`,{className:`form__actions form__actions--start`,children:[e.status!==`ready`&&(0,x.jsx)(B,{size:`sm`,tone:`primary`,variant:`soft`,disabled:n,onClick:()=>t(`ready`),children:`Mark ready for approval`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:n,onClick:()=>{window.confirm(`Only mark this applied if you have actually sent it to ${e.company}. Nothing here can send an application.`)&&t(`applied`)},children:`I have applied`})]}),r.fields.map(({field:e,hint:t,required:n})=>(0,x.jsxs)(`div`,{className:`packet__field`,children:[(0,x.jsx)(Xp,{label:n?`${e} *`:e,description:t,rows:e===`Tailored summary`||e===`Tailored bullets`||e===`Cover letter`||e===`Outreach message`||e===`Questions`||e===`Risks`?3:1,value:a[e]??``,onChange:t=>o({...a,[e]:t.target.value}),onBlur:()=>p(e),placeholder:n?`Required before this is ready.`:``}),e===`Resume variant`&&l.length>0&&(0,x.jsx)(`div`,{className:`chips`,children:l.map(t=>(0,x.jsx)(B,{size:`sm`,variant:a[e]===t?`soft`:`ghost`,tone:a[e]===t?`primary`:`neutral`,onClick:()=>f(e,t),children:t},t))}),s===e&&(0,x.jsx)(`span`,{className:`muted`,children:`Saving…`})]},e)),(0,x.jsx)(`p`,{className:`muted`,children:`Fields are written into the note's Application section as you leave each one. An agent fills the same fields through the TekJobs MCP server — see Agent access.`})]}):(0,x.jsx)(`div`,{className:`detail`,children:(0,x.jsx)(zg,{lines:6})})}var dv={confirmation:`success`,rejection:`danger`,advance:`primary`,scheduling:`primary`,"info-request":`warning`,outreach:`warning`,other:`neutral`},fv={confirmation:`confirmed`,rejection:`rejected`,advance:`advanced`,scheduling:`scheduling`,"info-request":`asks for more`,outreach:`reached out`,other:`other`};function pv(e,t){let n=e.suggestion;return t?n.action===`status`?`mark it ${n.status}${n.appliedOn?` as of ${n.appliedOn}`:``}`:`add the mail to the note${n.appliedOn?`, set Applied on if empty`:``}`:`create a note for ${e.company} and mark it ${n.status}`}function mv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(gv,{onOpen:t,onChanged:()=>r(e=>e+1)},n),(0,x.jsx)(cv,{id:e,onClose:()=>t(null),onChanged:e=>{}})]})}function hv({onOpen:e}){let[t,n]=(0,b.useState)(null);(0,b.useEffect)(()=>{$.mail().then(n).catch(()=>{})},[]);let r=t?.groups.length??0;return!t||r===0&&!t.running?null:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`mailstrip`,children:[(0,x.jsxs)(`span`,{children:[t.running?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Bg,{size:`sm`}),` Reading the mailbox.`]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`b`,{className:`num`,children:r}),` `,r===1?`email group waits`:`email groups wait`,` for a decision.`]}),t.lastRun&&(0,x.jsxs)(`span`,{className:`muted`,children:[` Last read `,(0,x.jsx)(`span`,{className:`num`,children:t.lastRun.slice(0,16).replace(`T`,` `)}),` UTC.`]})]}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,leadingIcon:(0,x.jsx)(H.Mail,{}),onClick:e,children:`Open Mail`})]})})}function gv({onOpen:e,onChanged:t}){let[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)({}),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(null),u=()=>$.mail().then(r).catch(()=>{});(0,b.useEffect)(()=>{u()},[]),(0,b.useEffect)(()=>{if(!n?.running)return;let e=setInterval(()=>$.mail().then(e=>{r(e),!e.running&&e.error&&X({title:`Mail check failed`,description:e.error,tone:`danger`})}).catch(()=>{}),4e3);return()=>clearInterval(e)},[n?.running]);let d=async()=>{try{r(await $.mailCheck()),X({title:`Reading the mailbox`,description:`Through the local CLI, Gmail read tools only. A few minutes.`,tone:`neutral`})}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},f=async(e,n)=>{s(e.id);try{let a=e.id in i?i[e.id]:e.noteId;r(n===`confirm`?await $.mailConfirm(e.id,a||void 0):await $.mailDismiss(e.id)),n===`confirm`&&(X({title:`${e.company}: ${pv(e,i[e.id]||e.noteId)}`,description:`Written to the note.`,tone:`success`}),t())}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}finally{s(null)}},p=n?.groups??[],m=(n?.items??[]).filter(e=>e.state!==`pending`).sort((e,t)=>(t.resolved?.at??``).localeCompare(e.resolved?.at??``)),h=m.length,[g,_]=(0,b.useState)(!1),v=e=>e.state===`dismissed`?`dismissed`:e.resolved?.action===`create`?`note created, marked ${e.resolved.status}`:e.resolved?.action===`status`?`marked ${e.resolved.status}`:`recorded on the note`,y=p.filter(e=>e.kind===`confirmation`&&e.match===`exact`&&e.noteId).length;return(0,x.jsxs)(`section`,{className:`today__section`,id:`mail-says`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Mail says`}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[n?.lastRun&&(0,x.jsxs)(`span`,{className:`muted`,children:[`last read `,n.lastRun.slice(0,16).replace(`T`,` `),` UTC, `,n.lastSinceDays,` days back`]}),h>0&&(0,x.jsx)(B,{size:`sm`,variant:`ghost`,onClick:()=>_(e=>!e),children:g?`Hide handled`:`${h} handled`}),y>0&&(0,x.jsxs)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:o===`safe`||!!n?.running,loading:o===`safe`,title:`Confirmations whose note matched by exact title: records the mail, marks still-open notes applied as of the mail's date. Rejections, interviews, company-only matches and creates stay one at a time.`,onClick:async()=>{s(`safe`);try{let e=await $.mailConfirmSafe();r(e),X({title:`${e.confirmed} confirmations recorded`,description:`Exact-title matches only. The rest are still listed.`,tone:`success`}),t()}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}finally{s(null)}},children:[`Confirm the exact matches (`,y,`)`]}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:!!n?.running,leadingIcon:n?.running?(0,x.jsx)(Bg,{size:`sm`}):(0,x.jsx)(H.Mail,{}),onClick:d,children:n?.running?`Reading the mailbox`:`Check mail`})]})]}),!n||p.length===0&&!n.running?(0,x.jsx)(V,{padding:`md`,children:(0,x.jsx)(Vg,{size:`sm`,title:n?.lastRun?`Nothing waiting from the mailbox`:`The mailbox has not been read yet`,description:n?.error?n.error:`The morning task reads application emails through your signed-in CLI (Gmail read tools only) and lists what they say about your applications here. You confirm each one. Check mail reads again now.`})}):(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Application emails waiting for a decision`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Date`}),(0,x.jsx)(Y.HeadCell,{children:`Mail says`}),(0,x.jsx)(Y.HeadCell,{children:`Company and role`}),(0,x.jsx)(Y.HeadCell,{children:`Note`}),(0,x.jsx)(Y.HeadCell,{children:`Confirm`})]})}),(0,x.jsxs)(Y.Body,{children:[p.map(t=>{let r=i[t.id]||t.noteId;return(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>l(t),children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:t.date||`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[(0,x.jsxs)(`span`,{className:`chips`,children:[t.kinds.map(e=>(0,x.jsx)(z,{size:`sm`,tone:dv[e],children:fv[e]},e)),t.count>1&&(0,x.jsxs)(`small`,{children:[t.count,` emails`,t.first&&t.first!==t.date?`, ${t.first} to ${t.date}`:``]})]}),(0,x.jsx)(`small`,{title:t.subject,children:t.gist})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[t.company,(0,x.jsx)(`small`,{children:t.role||`role not stated`}),t.person&&(0,x.jsxs)(`small`,{title:`${t.person.email}. Confirming adds them to People and to the note.`,children:[`from `,t.person.name]})]})}),(0,x.jsx)(Y.Cell,{onClick:e=>e.stopPropagation(),children:t.match===`none`?(0,x.jsx)(`span`,{className:`muted`,children:`no note; confirm creates one`}):t.match===`exact`||t.match===`company`&&t.candidates.length<=1?(0,x.jsxs)(`span`,{className:`who__text`,children:[(0,x.jsxs)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>e(t.noteId),children:[t.noteTitle,` · `,t.noteStatus]}),n.items.find(e=>e.id===t.id)?.via===`link`&&(0,x.jsx)(`small`,{children:`matched by the posting link`})]}):(0,x.jsxs)(J,{size:`sm`,label:t.match===`company-other-role`?`Not a role in the vault`:`Which role`,value:r||`__new__`,onValueChange:e=>a(n=>({...n,[t.id]:e===`__new__`?``:e})),children:[(0,x.jsx)(J.Item,{value:`__new__`,children:`New note for this role`}),t.candidates.map(e=>(0,x.jsxs)(J.Item,{value:e.id,children:[e.title,` · `,e.status]},e.id))]})}),(0,x.jsx)(Y.Cell,{onClick:e=>e.stopPropagation(),children:(0,x.jsxs)(`div`,{className:`today__actions`,children:[(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:o===t.id,title:pv(t,r),onClick:()=>f(t,`confirm`),children:r?t.suggestion.action===`record`?`Record`:`Mark ${t.suggestion.status}`:`Create and mark`}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,disabled:o===t.id,onClick:()=>f(t,`dismiss`),children:`Dismiss`})]})})]},t.id)}),n.running&&p.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:5,children:(0,x.jsx)(`span`,{className:`muted`,children:`Reading…`})})})]})]})}),g&&(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Application emails already handled`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Mail date`}),(0,x.jsx)(Y.HeadCell,{children:`Mail said`}),(0,x.jsx)(Y.HeadCell,{children:`Company and role`}),(0,x.jsx)(Y.HeadCell,{children:`Note`}),(0,x.jsx)(Y.HeadCell,{children:`What was done`})]})}),(0,x.jsx)(Y.Body,{children:m.map(t=>(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>l(_v(t)),children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:t.date||`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:dv[t.kind],children:fv[t.kind]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[t.company,(0,x.jsx)(`small`,{children:t.role||`role not stated`})]})}),(0,x.jsx)(Y.Cell,{onClick:e=>e.stopPropagation(),children:t.noteId?(0,x.jsx)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>e(t.noteId),children:t.noteId.replace(/ \([0-9a-f]+\)$/,``)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`muted`,children:[v(t),t.resolved?.at?`, ${t.resolved.at.slice(0,16).replace(`T`,` `)} UTC`:``]})})]},t.id))})]})}),(0,x.jsx)(vv,{group:c,items:n?.items??[],busy:o,onClose:()=>l(null),onOpenNote:e,onAct:async(e,t)=>{await f(e,t),l(null)}})]})}function _v(e){return{id:e.id,ids:[e.id],count:1,company:e.company,role:e.role,kind:e.kind,kinds:[e.kind],date:e.date,first:e.date,gist:e.gist,subject:e.subject,from:e.from,link:e.link,person:e.person??null,match:e.match,noteId:e.noteId,noteTitle:e.noteTitle,noteStatus:e.noteStatus,candidates:e.candidates,suggestion:e.suggestion}}function vv({group:e,items:t,busy:n,onClose:r,onOpenNote:i,onAct:a}){let o=e?t.filter(t=>e.ids.includes(t.id)).sort((e,t)=>(t.date||``).localeCompare(e.date||``)):[],s=o.some(e=>e.state===`pending`);return(0,x.jsx)(Sp,{open:e!==null,onOpenChange:e=>!e&&r(),side:`right`,size:`md`,children:(0,x.jsx)(Sp.Content,{children:e&&(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(`div`,{className:`sheet-head`,children:(0,x.jsxs)(`div`,{className:`sheet-head__main`,children:[(0,x.jsxs)(`p`,{className:`sheet-head__meta`,children:[e.company,e.role?` · ${e.role}`:``]}),(0,x.jsx)(Sp.Title,{children:e.subject||e.gist}),(0,x.jsxs)(`div`,{className:`chips`,children:[e.kinds.map(e=>(0,x.jsx)(z,{size:`sm`,tone:dv[e],children:fv[e]},e)),e.date&&(0,x.jsx)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:(0,x.jsx)(`span`,{className:`num`,children:e.date})}),e.count>1&&(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:[e.count,` emails`]})]})]})}),(0,x.jsx)(`p`,{children:e.gist}),(0,x.jsxs)(`dl`,{className:`mailsheet__facts`,children:[(0,x.jsx)(`dt`,{children:`From`}),(0,x.jsx)(`dd`,{children:e.person?`${e.person.name}${e.person.email?` <${e.person.email}>`:``}`:e.from}),(0,x.jsx)(`dt`,{children:`Note`}),(0,x.jsx)(`dd`,{children:e.noteId?(0,x.jsxs)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>i(e.noteId),children:[e.noteTitle||e.noteId,` · `,e.noteStatus]}):(0,x.jsx)(`span`,{className:`muted`,children:`none yet; confirming creates one`})}),s&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`dt`,{children:`Confirming`}),(0,x.jsx)(`dd`,{children:pv(e,e.noteId)})]})]}),(0,x.jsx)(`h4`,{className:`connections__title`,children:o.length===1?`The email`:`The ${o.length} emails`}),(0,x.jsx)(`ul`,{className:`people__list`,children:o.map(e=>(0,x.jsxs)(`li`,{className:`people__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:e.subject||e.gist}),(0,x.jsxs)(`div`,{className:`reasons__detail`,children:[[e.date,fv[e.kind],e.fromName||e.from].filter(Boolean).join(` · `),e.gist&&e.subject?` · ${e.gist}`:``]})]}),(0,x.jsx)(`div`,{className:`pager__buttons`,children:(0,x.jsx)(B,{asChild:!0,size:`sm`,variant:`ghost`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:e.link,target:`_blank`,rel:`noreferrer`,children:`Open in Gmail ↗`})})})]},e.id))}),(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{asChild:!0,variant:`soft`,children:(0,x.jsx)(`a`,{href:e.link,target:`_blank`,rel:`noreferrer`,children:`Open in Gmail ↗`})}),s&&(0,x.jsx)(B,{tone:`primary`,disabled:n===e.id,onClick:()=>a(e,`confirm`),children:e.noteId?e.suggestion.action===`record`?`Record`:`Mark ${e.suggestion.status}`:`Create and mark`}),s&&(0,x.jsx)(B,{variant:`ghost`,disabled:n===e.id,onClick:()=>a(e,`dismiss`),children:`Dismiss`})]})]})})})}var yv=`Use the tekjobs MCP server. Call onboarding_status, then onboarding_materials, and follow its script: interview me, write my profile, positioning and voice notes with save_profile, set the criteria with set_criteria, run a dry scan, and show me the top matches.`;function bv({onDone:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!1),s=()=>$.onboarding().then(n).catch(e=>X({title:`Server not answering`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{s()},[]);let c=async()=>{o(!0);try{let e=await $.initProfile();X({title:`Profile folder ready`,description:e.made.length?`Created ${e.made.join(`, `)}`:`It already existed; nothing was overwritten.`,tone:`success`}),await s()}catch(e){X({title:`Could not create the folder`,description:e.message,tone:`danger`})}o(!1)},l=async()=>{if(r.trim()){o(!0);try{X({title:`Resume imported`,description:`${(await $.importResume(r.trim())).chars.toLocaleString()} characters of text extracted.`,tone:`success`}),i(``),await s()}catch(e){X({title:`Import failed`,description:e.message,tone:`danger`})}o(!1)}};if(!t)return(0,x.jsx)(zg,{variant:`rect`,height:`20rem`});let u=t.steps.filter(e=>e.done).length,d=t.writing.filter(e=>e.done).length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`Five steps from an empty folder to a daily scan that knows who you are, then three notes the application drafts read. Your profile lives at `,(0,x.jsx)(`code`,{children:t.dir}),`. The scan and the notes stay on this machine; the interview and the drafting send what you choose to the AI client you connect.`]})}),(0,x.jsx)(z,{tone:t.complete?`success`:`primary`,size:`sm`,children:t.complete?`Search ready`:`Search: ${u} of ${t.steps.length}`})]}),(0,x.jsx)(`div`,{className:`steps`,children:t.steps.map((e,t)=>(0,x.jsx)(V,{padding:`md`,variant:e.done?`sunken`:`outlined`,children:(0,x.jsxs)(`div`,{className:`step`,children:[(0,x.jsx)(`div`,{className:`step__mark`,children:e.done?(0,x.jsx)(H.Success,{}):(0,x.jsx)(`span`,{className:`step__n`,children:t+1})}),(0,x.jsxs)(`div`,{className:`step__body`,children:[(0,x.jsx)(`span`,{className:`step__label`,children:e.label}),!e.done&&(0,x.jsx)(`p`,{className:`muted`,children:e.how}),!e.done&&e.id===`folder`&&(0,x.jsx)(`div`,{className:`form__actions form__actions--start`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,loading:a,onClick:c,children:`Create the profile folder`})}),!e.done&&e.id===`resume`&&(0,x.jsxs)(`div`,{className:`step__row`,children:[(0,x.jsx)(Zp,{size:`sm`,label:`Path to your resume`,placeholder:`C:\\Users\\you\\Downloads\\resume.pdf`,description:`PDF, DOCX, Markdown or text. The file is copied into Profile/ and its text extracted.`,value:r,onChange:e=>i(e.target.value)}),(0,x.jsx)(B,{tone:`primary`,size:`sm`,loading:a,disabled:!r.trim(),onClick:l,children:`Import`})]}),!e.done&&e.id===`profile`&&(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`p`,{className:`muted`,children:[`The interview runs in your own AI client, not here. Connect the server once (`,(0,x.jsx)(`code`,{className:`mono`,children:`claude mcp add tekjobs -- tekjobs mcp`}),`; from a clone, opening Claude Code in `,(0,x.jsx)(`code`,{className:`mono`,children:`app/`}),` does it) and paste:`]}),(0,x.jsx)(ag,{code:yv,language:`text`,wrap:!0}),(0,x.jsx)(`p`,{className:`muted`,children:`Codex, Cursor or Claude Desktop work the same way once the tekjobs MCP server is added; see Agent access.`})]}),!e.done&&e.id===`scan`&&(0,x.jsx)(`div`,{className:`form__actions form__actions--start`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:()=>{$.startScan(!1).then(()=>X({title:`Scan started`,description:`Watch it on the Runs screen.`,tone:`success`})).catch(e=>X({title:`Could not start`,description:e.message,tone:`danger`}))},children:`Run the first scan`})})]})]})},e.id))}),(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Application writing`}),(0,x.jsx)(`p`,{className:`muted`,children:`What a tailored resume or a letter is allowed to say comes from these three notes. The interview writes the last two; the import creates the first. Until they exist, drafts fall back to the imported resume text and the Profile page says what is missing.`})]}),(0,x.jsx)(z,{tone:t.writingReady?`success`:`neutral`,size:`sm`,children:t.writingReady?`Writing ready`:`Writing: ${d} of ${t.writing.length}`})]}),(0,x.jsx)(`div`,{className:`steps`,children:t.writing.map(e=>(0,x.jsx)(V,{padding:`md`,variant:e.done?`sunken`:`outlined`,children:(0,x.jsxs)(`div`,{className:`step`,children:[(0,x.jsx)(`div`,{className:`step__mark`,children:e.done?(0,x.jsx)(H.Success,{}):(0,x.jsx)(`span`,{className:`step__n`,children:`·`})}),(0,x.jsxs)(`div`,{className:`step__body`,children:[(0,x.jsx)(`span`,{className:`step__label`,children:e.label}),!e.done&&(0,x.jsx)(`p`,{className:`muted`,children:e.how})]})]})},e.id))}),t.complete&&(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,onClick:e,trailingIcon:(0,x.jsx)(H.ArrowRight,{}),children:`Go to the overview`})})]})}function xv({label:e,value:t,hint:n,tone:r=`neutral`,series:i,onClick:a}){return(0,x.jsx)(V,{padding:`md`,interactive:!!a,onClick:a,children:(0,x.jsxs)(`div`,{className:`stat`,children:[(0,x.jsx)(`span`,{className:`stat__label`,children:e}),(0,x.jsxs)(`div`,{className:`stat__row`,children:[(0,x.jsx)(`span`,{className:`stat__value`,children:t}),i&&i.length>1&&(0,x.jsx)(`div`,{className:`stat__spark`,children:(0,x.jsx)(Cp,{values:i,tone:r===`neutral`?`primary`:r,"aria-label":`${e}, per scan`})})]}),n&&(0,x.jsx)(`div`,{className:`stat__delta`,children:(0,x.jsx)(z,{tone:r,size:`sm`,children:n})})]})})}var Sv=e=>e===null?`—`:`${Math.round(e*100)}%`,Cv={found:`Found`,reviewed:`Reviewed`,shortlisted:`Shortlisted`,applied:`Applied`,interviewing:`Interviewing`,offer:`Offer`},wv={"design-eng":`Design engineering`,adjacent:`Adjacent titles`};function Tv({onNavigate:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(``);if((0,b.useEffect)(()=>{$.summary().then(n).catch(e=>o(e.message)),$.outcomes().then(i).catch(()=>{})},[]),a)return(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`p`,{className:`muted`,children:[`The server is not answering: `,a,`. Start it with `,(0,x.jsx)(`code`,{children:`npm run server`}),`.`]})});if(!t||!r)return(0,x.jsx)(zg,{variant:`rect`,height:`12rem`});let s=[`floor`,`stretch`,`below`,`unknown`],c=[`new`,`reviewing`,`applying`,`applied`,`interviewing`,`offer`,`rejected`,`passed`],l=r.waiting.buckets[14]??0,u=r.thisWeek.followUps.filter(e=>e.inDays<=0).length,d=r.appliedPerWeek;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[(0,x.jsx)(`b`,{children:r.funnel.applied}),` applied, `,(0,x.jsx)(`b`,{children:Sv(r.responseRate)}),` answered, `,(0,x.jsx)(`b`,{children:r.funnel.interviewing}),` interviewing`,l?(0,x.jsxs)(x.Fragment,{children:[`, `,(0,x.jsx)(`b`,{children:l}),` waiting two weeks or more`]}):null,`.`,` `,`The inventory: `,t.open,` open matches across `,t.companies,` boards, floor `,t.floor?Jg(t.floor):`unset`,`, bar `,t.minScore??`unset`,`.`]})}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,onClick:()=>e(`runs`),children:`Runs`})]}),(0,x.jsxs)(`div`,{className:`stats z-stagger`,children:[(0,x.jsx)(xv,{label:`Applied`,value:String(r.funnel.applied),hint:`${r.funnel.shortlisted} shortlisted, ${r.funnel.reviewed} reviewed`,tone:`primary`,onClick:()=>e(`pipeline`)}),(0,x.jsx)(xv,{label:`Response rate`,value:Sv(r.responseRate),hint:r.funnel.applied?`${r.responded} of ${r.funnel.applied} answered, interview or no`:`nothing applied to yet`,tone:r.responseRate&&r.responseRate>0?`success`:`neutral`}),(0,x.jsx)(xv,{label:`Waiting 14 days or more`,value:String(l),hint:`${r.waiting.buckets[7]??0} past 7 days, ${r.waiting.buckets[21]??0} past 21`,tone:(r.waiting.buckets[21]??0)>0?`warning`:`neutral`}),(0,x.jsx)(xv,{label:`Discovery to application`,value:r.medianDaysToApply===null?`—`:`${r.medianDaysToApply}d`,hint:`median, found to applied`})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Funnel`}),(0,x.jsx)(`p`,{children:`Each stage counts everything that reached it, whatever happened after. The rate is the share of the stage before.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Application funnel`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Stage`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Jobs`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Of the stage before`}),(0,x.jsx)(Y.HeadCell,{children:`Share`})]})}),(0,x.jsx)(Y.Body,{children:r.stages.map((e,t)=>{let n=r.stages[0]?.count||1;return(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:Cv[e.stage]??e.stage}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.count}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(`span`,{className:e.rate===null?`muted`:``,children:t===0?`—`:Sv(e.rate)})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`div`,{className:`funnel__bar`,role:`presentation`,children:(0,x.jsx)(`span`,{style:{width:`${Math.max(e.count?2:0,Math.round(e.count/n*100))}%`}})})})]},e.stage)})})]}),(0,x.jsxs)(`p`,{className:`muted panel--pad`,children:[r.passed,` passed on, `,r.rejected,` rejected.`]})]}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`This week`}),(0,x.jsxs)(`p`,{children:[`Follow-ups due in the next seven days`,u?`, ${u} already past`:``,`, and the interviews in progress. Dates come from each note's packet.`]})]})})}),(0,x.jsxs)(Y,{"aria-label":`This week`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{align:`end`,children:`When`})]})}),(0,x.jsxs)(Y.Body,{children:[r.thisWeek.followUps.map(t=>(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>e(`jobs`,t.company),children:[(0,x.jsx)(Y.Cell,{children:t.company}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`clamp`,children:t.title})}),(0,x.jsx)(Y.Cell,{align:`end`,children:(0,x.jsx)(z,{size:`sm`,tone:t.inDays<0?`danger`:t.inDays===0?`warning`:`neutral`,children:t.inDays<0?`follow up, ${-t.inDays}d late`:t.inDays===0?`follow up today`:`follow up in ${t.inDays}d`})})]},t.id)),r.thisWeek.interviewing.map(t=>(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>e(`jobs`,t.company),children:[(0,x.jsx)(Y.Cell,{children:t.company}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`clamp`,children:t.title})}),(0,x.jsx)(Y.Cell,{align:`end`,children:(0,x.jsx)(z,{size:`sm`,tone:`primary`,children:`interviewing`})})]},t.id)),r.thisWeek.followUps.length===0&&r.thisWeek.interviewing.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:3,children:(0,x.jsx)(`span`,{className:`muted`,children:`Nothing due this week. Applied roles get a follow-up date in their packet when you mark them applied.`})})})]})]})]})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Applications per week`}),(0,x.jsx)(`p`,{children:`Sent, by the week of the packet's Applied on date.`})]})}),d.length>0?(0,x.jsx)(Ye,{series:[{name:`Applied`,values:d.map(e=>e.n)}],labels:d.map(e=>e.week.slice(5)),height:180,"aria-label":`Applications per week`}):(0,x.jsx)(`p`,{className:`muted`,children:`Nothing applied to yet.`})]})}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`What answers`}),(0,x.jsx)(`p`,{children:`By role family, then by the board that surfaced the job.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Outcomes by role family`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Role family`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Found`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Applied`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Answered`})]})}),(0,x.jsx)(Y.Body,{children:r.byKind.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:wv[e.kind]??e.kind}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.found}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.applied}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.applied?`${e.responded} (${Sv(e.responded/e.applied)})`:`—`})]},e.kind))})]}),r.bySource.length>0&&(0,x.jsx)(`div`,{className:`chips panel--pad`,children:r.bySource.map(e=>(0,x.jsxs)(z,{size:`sm`,tone:e.responded?`success`:`neutral`,variant:`soft`,children:[e.source,`: `,e.applied,` applied`,e.responded?`, ${e.responded} answered`:``]},e.source))})]})]}),(0,x.jsxs)(`div`,{className:`stats z-stagger`,children:[(0,x.jsx)(xv,{label:`Open matches`,value:String(t.open),hint:`${t.byStatus.new??0} unreviewed`,onClick:()=>e(`jobs`)}),(0,x.jsx)(xv,{label:`Design-engineer roles at the floor`,value:String(t.designEng.floor),hint:`of ${t.designEng.total} with the title`,tone:`success`,onClick:()=>e(`jobs`)}),(0,x.jsx)(xv,{label:`Pay under the floor, above the stretch line`,value:String(t.byBand.stretch??0),hint:`${t.designEng.stretch} design-engineer`,tone:`warning`}),(0,x.jsx)(xv,{label:`Active applications`,value:String(t.active),hint:t.active?`in flight`:`none yet`,tone:t.active?`primary`:`neutral`,onClick:()=>e(`pipeline`)})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Pipeline`}),(0,x.jsx)(`p`,{children:`Every open note by status. Change a status in Jobs or Pipeline; the note is the record.`})]})}),(0,x.jsx)(Ye,{series:[{name:`Jobs`,values:c.map(e=>t.byStatus[e]??0)}],labels:[...c],height:200,"aria-label":`Jobs by status`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Stated pay against the floor`}),(0,x.jsx)(`p`,{children:`Open matches by band.`})]})}),(0,x.jsx)(Ye,{series:[{name:`Matches`,values:s.map(e=>t.byBand[e]??0)}],labels:[`Floor`,`Stretch`,`Below`,`Not stated`],height:200,"aria-label":`Matches by pay band`})]})})]})]})}function Ev({onNavigate:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),l=e_(`(max-width: 52rem)`),u=()=>$.today().then(n).catch(e=>i(e.message));(0,b.useEffect)(()=>{u()},[]);let d=async(e,t,n)=>{c(e.id);try{await $.setStatus(e.id,t,n),X({title:`${e.company}: ${t===`reviewing`?`shortlisted`:`passed`}`,description:n,tone:t===`reviewing`?`success`:`neutral`}),await u()}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}finally{c(null)}},f=e=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:s===e.id,onClick:()=>d(e,`reviewing`),children:`Shortlist`}),(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,disabled:s===e.id,trailingIcon:(0,x.jsx)(H.ChevronDown,{}),children:`Pass`})}),(0,x.jsx)(Tu.Content,{align:`end`,children:Kg.map(t=>(0,x.jsx)(Tu.Item,{onSelect:()=>d(e,`passed`,t),children:t},t))})]})]}),p=e=>e.salaryMax>0?(0,x.jsx)(z,{tone:Qg[e.payBand],size:`sm`,children:Yg(e.salary)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`});if(r)return(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`p`,{className:`muted`,children:[`The server is not answering: `,r,`. Start it with `,(0,x.jsx)(`code`,{children:`tekjobs up`}),`.`]})});if(!t)return(0,x.jsx)(zg,{variant:`rect`,height:`18rem`});let{counts:m,sections:h}=t,g=[...h.preparing,...h.followUps,...h.interviewing];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h1`,{className:`today__date`,children:new Date().toLocaleDateString(`en-US`,{weekday:`long`,day:`numeric`,month:`long`})}),(0,x.jsx)(`p`,{children:h.triage.length===0?`Today's queue is clear. The next scan refills it.`:`${h.triage.length===1?`One`:h.triage.length} to decide on, best fit first. The other ${m.unreviewed-h.triage.length} unreviewed wait in Jobs and do not count against you. Fit is the share of the ${t.ceiling} points this criteria set can award.`})]}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,onClick:()=>e(`jobs`),children:`See all matches`})]}),(0,x.jsxs)(`div`,{className:`today__figures`,children:[(0,x.jsxs)(`div`,{className:`today__figure`,children:[(0,x.jsx)(`b`,{children:m.open}),(0,x.jsx)(`small`,{children:`open`})]}),(0,x.jsxs)(`div`,{className:`today__figure`,children:[(0,x.jsx)(`b`,{children:m.aging}),(0,x.jsx)(`small`,{children:`waiting 2d+`})]}),(0,x.jsxs)(`div`,{className:`today__figure`,children:[(0,x.jsx)(`b`,{"data-tone":m.closedUnreviewed>0?`danger`:void 0,children:m.closedUnreviewed}),(0,x.jsx)(`small`,{children:`closed unseen`})]})]}),(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsxs)(`div`,{className:`today__section-head`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Decide on these`}),(0,x.jsx)(`span`,{className:`today__hint`,children:`shortlist · pass · open sheet`})]}),h.triage.length===0?(0,x.jsx)(V,{padding:`md`,children:(0,x.jsx)(Vg,{size:`sm`,title:`Inbox clear`,description:`Nothing unreviewed is open right now. The next scan will refill this.`})}):l?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`Matches to decide on`,children:h.triage.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(Av,{value:e.fit}),meta:Xg(e.found),badges:e.salaryMax>0?p(e):null,actions:f(e),onOpen:()=>o(e.id)},e.id))}):(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Matches to decide on`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Fit`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Pay`}),(0,x.jsx)(Y.HeadCell,{children:`Found`}),(0,x.jsx)(Y.HeadCell,{children:`Decide`})]})}),(0,x.jsx)(Y.Body,{children:h.triage.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,selected:a===e.id,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(Av,{value:e.fit})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[e.title,e.kind===`design-eng`&&(0,x.jsx)(`small`,{children:`design engineering`})]})}),(0,x.jsx)(Y.Cell,{children:e.salaryMax>0?(0,x.jsx)(z,{tone:Qg[e.payBand],size:`sm`,children:Yg(e.salary)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:Xg(e.found)})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`div`,{className:`today__actions`,onClick:e=>e.stopPropagation(),children:f(e)})})]},e.id))})]})})]}),(0,x.jsx)(hv,{onOpen:()=>e(`mail`)}),h.started.length>0&&(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Already started`}),l?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`Applications with a packet started`,children:h.started.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(Av,{value:e.fit}),badges:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(z,{size:`sm`,tone:`primary`,variant:`soft`,children:[e.packet,` filled`]}),e.salaryMax>0&&p(e),e.closed?(0,x.jsxs)(z,{size:`sm`,tone:`danger`,children:[`closed `,e.closed]}):(0,x.jsx)(z,{size:`sm`,tone:e.status===`ready`?`warning`:`neutral`,children:e.status})]}),onOpen:()=>o(e.id)},e.id))}):(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Applications with a packet started`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Fit`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Packet`}),(0,x.jsx)(Y.HeadCell,{children:`Pay`}),(0,x.jsx)(Y.HeadCell,{children:`Status`})]})}),(0,x.jsx)(Y.Body,{children:h.started.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,selected:a===e.id,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(Av,{value:e.fit})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(z,{size:`sm`,tone:`primary`,variant:`soft`,children:[e.packet,` filled`]})}),(0,x.jsx)(Y.Cell,{children:e.salaryMax>0?(0,x.jsx)(z,{tone:Qg[e.payBand],size:`sm`,children:Yg(e.salary)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:e.closed?(0,x.jsxs)(z,{size:`sm`,tone:`danger`,children:[`closed `,e.closed]}):(0,x.jsx)(z,{size:`sm`,tone:e.status===`ready`?`warning`:`neutral`,children:e.status})})]},e.id))})]})}),(0,x.jsx)(`p`,{className:`muted`,children:`Work you have already put in, wherever it ranks. The fit score knows nothing about a drafted packet, so these would otherwise fall off the bottom of the queue.`})]}),(h.aging.length>0||h.missed.length>0)&&(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Going, and gone`}),(0,x.jsxs)(`div`,{className:`today__cols`,children:[h.aging.length>0&&(0,x.jsxs)(V,{padding:`md`,children:[(0,x.jsx)(`h3`,{className:`today__subheading`,children:`Still open, still unread`}),(0,x.jsx)(`p`,{className:`muted`,children:`Listings here close after two days, at the median.`}),(0,x.jsx)(`ul`,{className:`today__list`,children:h.aging.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsxs)(B,{className:`today__row`,variant:`ghost`,align:`start`,size:`sm`,onClick:()=>o(e.id),children:[(0,x.jsx)(Av,{value:e.fit}),(0,x.jsx)(`span`,{className:`today__row-text`,children:Dv(e.company,e.title,52)}),(0,x.jsxs)(z,{size:`sm`,tone:(e.days??0)>=5?`danger`:`warning`,variant:`outline`,children:[e.days,`d`]})]})},e.id))})]}),h.missed.length>0&&(0,x.jsxs)(V,{padding:`md`,children:[(0,x.jsx)(`h3`,{className:`today__subheading`,children:`Closed before you saw them`}),(0,x.jsxs)(`p`,{className:`muted`,children:[m.closedUnreviewed,` this week. This is what the queue costs when it is skipped.`]}),(0,x.jsx)(`ul`,{className:`today__list`,children:h.missed.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsxs)(B,{className:`today__row`,variant:`ghost`,align:`start`,size:`sm`,onClick:()=>o(e.id),children:[(0,x.jsx)(Av,{value:e.fit}),(0,x.jsx)(`span`,{className:`today__row-text`,children:Dv(e.company,e.title,36)}),(0,x.jsx)(`span`,{className:`muted`,children:e.closed})]})},e.id))})]})]})]}),(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`In flight`}),(0,x.jsx)(V,{padding:g.length&&!l?`none`:`md`,children:g.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`Nothing in flight`,description:`Applications being prepared, follow-ups that are due, and interviews appear here once jobs move past Shortlisted.`,action:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,onClick:()=>e(`pipeline`),children:`Open the pipeline`})}):l?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`In flight`,children:g.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(Av,{value:e.fit}),meta:e.due?`due ${e.due}`:void 0,badges:(0,x.jsx)(z,{size:`sm`,tone:`primary`,children:e.status}),foot:(0,x.jsx)(kv,{contact:e.contact}),onOpen:()=>o(e.id)},e.id))}):(0,x.jsxs)(Y,{"aria-label":`In flight`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Fit`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Status`}),(0,x.jsx)(Y.HeadCell,{children:`Due`}),(0,x.jsx)(Y.HeadCell,{children:`Write to`})]})}),(0,x.jsx)(Y.Body,{children:g.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(Av,{value:e.fit})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:`primary`,children:e.status})}),(0,x.jsx)(Y.Cell,{children:e.due||(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(kv,{contact:e.contact})})]},e.id))})]})})]}),(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsxs)(`div`,{className:`today__section-head`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Waiting on a reply`}),(0,x.jsxs)(`span`,{className:`today__hint`,children:[`applied `,m.waitingDays,`d+ ago, nothing back · `,m.waiting,` in all`]})]}),(0,x.jsx)(V,{padding:h.waiting.length===0||l?`md`:`none`,children:h.waiting.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`Nothing has gone quiet`,description:`Applications with no answer after ${m.waitingDays} days land here, with the person to ask.`}):l?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`Applications waiting on a reply`,children:h.waiting.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(z,{size:`sm`,tone:(e.days??0)>=21?`danger`:`neutral`,variant:`outline`,children:(0,x.jsxs)(`span`,{className:`num`,children:[e.days,`d`]})}),meta:e.appliedOn?`applied ${e.appliedOn}`:void 0,foot:(0,x.jsx)(kv,{contact:e.contact}),onOpen:()=>o(e.id)},e.id))}):(0,x.jsxs)(Y,{"aria-label":`Applications waiting on a reply`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Days`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Applied`}),(0,x.jsx)(Y.HeadCell,{children:`Write to`})]})}),(0,x.jsx)(Y.Body,{children:h.waiting.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(`span`,{className:`num`,"data-tone":(e.days??0)>=21?`danger`:void 0,children:e.days})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:e.appliedOn})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(kv,{contact:e.contact})})]},e.id))})]})})]}),(0,x.jsx)(cv,{id:a,onClose:()=>o(null),onChanged:e=>{u()}})]})}var Dv=(e,t,n=64)=>{let r=`${e} — ${t}`.replace(/\s+/g,` `).trim();return r.length>n?`${r.slice(0,n-1).trimEnd()}…`:r};function Ov({r:e,lead:t,meta:n,badges:r,foot:i,actions:a,onOpen:o}){return(0,x.jsxs)(`li`,{className:`tcard`,"data-posted":H_(e.source)||void 0,children:[(0,x.jsxs)(`div`,{className:`tcard__head`,children:[t,(0,x.jsxs)(`span`,{className:`posted-co tcard__company`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]}),n&&(0,x.jsx)(`span`,{className:`muted tcard__meta`,children:n})]}),(0,x.jsxs)(`div`,{className:`tcard__title`,children:[e.title,e.kind===`design-eng`&&(0,x.jsx)(`small`,{children:`design engineering`})]}),(r||e.location)&&(0,x.jsxs)(`div`,{className:`tcard__badges`,children:[r,e.location&&(0,x.jsxs)(`span`,{className:`muted tcard__loc`,children:[e.remote?`remote · `:``,e.location]})]}),i&&(0,x.jsx)(`div`,{className:`tcard__foot`,children:i}),(0,x.jsxs)(`div`,{className:`tcard__actions`,children:[a,(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,onClick:o,trailingIcon:(0,x.jsx)(H.ArrowRight,{}),children:`Open`})]})]})}function kv({contact:e}){return e?(0,x.jsxs)(`span`,{className:`who__text`,children:[e.email?(0,x.jsxs)(`a`,{className:`people__thread`,href:`mailto:${e.email}`,onClick:e=>e.stopPropagation(),children:[e.name,` ↗`]}):e.name,(0,x.jsxs)(`small`,{children:[e.role||`contact`,e.others>0?` · +${e.others}`:``]})]}):(0,x.jsx)(`span`,{className:`muted`,title:`Open the sheet's People tab to add someone.`,children:`no one on the thread`})}function Av({value:e}){return(0,x.jsx)(z,{size:`sm`,tone:e>=80?`success`:e>=60?`primary`:`neutral`,variant:e>=60?`soft`:`outline`,children:(0,x.jsx)(`span`,{className:`num`,children:e})})}var jv=[{id:`reviewing`,title:`Reviewing`},{id:`applying`,title:`Applying`,limit:5},{id:`ready`,title:`Ready`,limit:5},{id:`applied`,title:`Applied`},{id:`interviewing`,title:`Interviewing`},{id:`offer`,title:`Offer`}],Mv=new Set(jv.map(e=>e.id));function Nv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)([]),o=()=>$.jobs({status:`all`,limit:2e3}).then(e=>t(e.rows)).catch(e=>X({title:`Could not load the board`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{o()},[]);let s=async(n,r)=>{let i=e?.find(e=>e.id===n);if(i&&i.status!==r){t(e=>e&&e.map(e=>e.id===n?{...e,status:r}:e));try{await $.setStatus(n,r),X({title:`${i.company}: ${r}`,tone:`success`})}catch(e){X({title:`Move not saved`,description:e.message,tone:`danger`}),o()}}},c=e=>t(t=>t&&t.map(t=>t.id===e.id?{...t,status:e.status}:t)),l=(0,b.useMemo)(()=>{let t=new Map;for(let n of e??[])Mv.has(n.status)&&t.set(n.company,(t.get(n.company)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({value:e,label:e,hint:`${t} on the board`}))},[e]);if(!e)return(0,x.jsx)(zg,{variant:`rect`,height:`20rem`});let u=new Set(i),d=e.filter(e=>Mv.has(e.status)&&(u.size===0||u.has(e.company))).sort((e,t)=>t.score-e.score),f=e.filter(e=>e.status===`new`).length,p=e.filter(e=>e.status===`rejected`||e.status===`passed`).length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`page__head`,children:(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`Committed work only. Drag a card, or focus one and press Space to lift it, arrows to move it, Enter to drop. Every move is written to the job note.`,f?` ${f} new matches wait on Today, not here.`:``,p?` ${p} closed are not shown.`:``]})})}),(0,x.jsx)(`div`,{className:`toolbar`,children:(0,x.jsx)(Wg,{className:`toolbar__filter toolbar__filter--wide`,size:`sm`,multiple:!0,label:`Companies`,placeholder:i.length?``:`All companies`,description:`Narrow the board to the companies you are actually working.`,emptyMessage:`No company on the board matches that.`,options:l,value:i,onValueChange:a})}),(0,x.jsx)(Hg,{label:`Job pipeline`,columns:jv,cards:d,cardId:e=>e.id,cardColumn:e=>e.status,cardLabel:e=>`${e.title} at ${e.company}`,onMove:e=>s(e.cardId,e.to),renderCard:e=>(0,x.jsxs)(`div`,{className:`kcard`,"data-posted":H_(e.source)||void 0,onClick:()=>r(e.id),children:[(0,x.jsxs)(`div`,{className:`kcard__head`,children:[(0,x.jsxs)(`span`,{className:`kcard__company posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]}),(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,"aria-label":`Move ${e.title}`,leadingIcon:(0,x.jsx)(H.More,{}),onClick:e=>e.stopPropagation()})}),(0,x.jsx)(Tu.Content,{align:`end`,onClick:e=>e.stopPropagation(),children:Gg.filter(t=>t!==e.status).map(t=>(0,x.jsxs)(Tu.Item,{onSelect:()=>s(e.id,t),children:[`Move to `,t]},t))})]})]}),(0,x.jsx)(`span`,{className:`kcard__title`,children:e.title}),(0,x.jsxs)(`div`,{className:`kcard__meta num`,children:[(0,x.jsx)(`span`,{className:`kcard__score`,children:e.score}),e.salaryMax>0&&(0,x.jsx)(`span`,{className:e.payBand===`floor`?`kcard__pay kcard__pay--floor`:`kcard__pay`,children:Yg(e.salary)})]})]})}),(0,x.jsx)(cv,{id:n,onClose:()=>r(null),onChanged:c})]})}var Pv={ok:`success`,warn:`warning`,missing:`danger`,info:`neutral`};function Fv({s:e}){return(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:e.basics.name||`No name yet`}),(0,x.jsx)(`p`,{children:[e.basics.currentRole,e.basics.location].filter(Boolean).join(` · `)||`The Basics section is empty.`})]}),(0,x.jsxs)(`div`,{className:`chips`,children:[(0,x.jsx)(z,{size:`sm`,tone:e.status===`draft`?`warning`:`success`,children:e.status===`draft`?`draft`:`reviewed`}),e.updated&&(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:[`updated `,e.updated]})]})]}),e.summary?(0,x.jsx)(`p`,{children:e.summary}):(0,x.jsx)(`p`,{className:`muted`,children:`The three-sentence summary is still the template. It leads every cover letter.`}),(e.basics.email||e.basics.links.length>0)&&(0,x.jsx)(`p`,{className:`muted mono`,children:[e.basics.email,...e.basics.links].filter(Boolean).join(` · `)})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Needs attention`}),(0,x.jsx)(`p`,{children:`What a reader of these notes would trip on. Each line names the note to fix.`})]}),(0,x.jsx)(z,{size:`sm`,tone:e.attention.length?`warning`:`success`,children:e.attention.length?`${e.attention.length} item${e.attention.length===1?``:`s`}`:`nothing stale`})]}),e.attention.length>0?(0,x.jsx)(`ul`,{className:`summary__list`,children:e.attention.map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(z,{size:`sm`,tone:Pv[e.level],variant:`soft`,children:e.note}),` `,e.text]},e.text))}):(0,x.jsx)(`p`,{className:`muted`,children:`Every field is filled, the resume of record is fresh, and the criteria agree with the profile.`})]})}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Target roles`}),(0,x.jsx)(`p`,{children:`From the profile's table. "In criteria" means a title term the scan scores on matches the title; a title without one is never found by the scan.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Target roles`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Tier`}),(0,x.jsx)(Y.HeadCell,{children:`Title`}),(0,x.jsx)(Y.HeadCell,{children:`In criteria`})]})}),(0,x.jsxs)(Y.Body,{children:[e.targets.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:e.tier===`A`?`primary`:`neutral`,children:e.tier})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:e.term?(0,x.jsxs)(`span`,{className:`muted`,children:[`yes · `,(0,x.jsx)(`span`,{className:`mono`,children:e.term})]}):(0,x.jsx)(z,{size:`sm`,tone:`warning`,variant:`soft`,children:`no title term`})})]},`${e.tier}-${e.title}`)),e.targets.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:3,children:(0,x.jsx)(`span`,{className:`muted`,children:`The Target roles table is empty.`})})})]})]})]}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Constraints against the criteria`}),(0,x.jsx)(`p`,{children:`What the profile says beside what the scan enforces.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Constraints against the criteria`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Constraint`}),(0,x.jsx)(Y.HeadCell,{children:`Profile`}),(0,x.jsx)(Y.HeadCell,{children:`Criteria`}),(0,x.jsx)(Y.HeadCell,{})]})}),(0,x.jsx)(Y.Body,{children:e.constraints.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:e.label}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:e.profile?``:`muted`,children:e.profile||`not set`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:e.criteria?`num`:`muted`,children:e.criteria||`—`})}),(0,x.jsx)(Y.Cell,{children:e.level!==`info`&&(0,x.jsx)(z,{size:`sm`,tone:Pv[e.level],variant:`soft`,children:e.level===`ok`?`agree`:e.level===`warn`?`differ`:`missing`})})]},e.label))})]})]})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Documents`}),(0,x.jsx)(`p`,{children:`The notes and files the drafts are built from, and how fresh each one is.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Documents`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Document`}),(0,x.jsx)(Y.HeadCell,{children:`State`}),(0,x.jsx)(Y.HeadCell,{children:`Where`})]})}),(0,x.jsx)(Y.Body,{children:e.documents.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:e.label}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:Pv[e.level],variant:`soft`,children:e.state})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted mono`,children:e.where})})]},e.label))})]})]}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`What feeds what`}),(0,x.jsx)(`p`,{children:`Which note each thing the app writes is built from. Change the note, and everything after it changes.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`What feeds what`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Produces`}),(0,x.jsx)(Y.HeadCell,{children:`Reads`})]})}),(0,x.jsx)(Y.Body,{children:e.feeds.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:e.produces}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:e.reads})})]},e.produces))})]})]})]}),e.proofPoints.length>0&&(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Proof points`}),(0,x.jsxs)(`p`,{children:[e.proofPoints.length,` on file; the ones without a number are flagged above. Cover letters quote from these and nothing else.`]})]})}),(0,x.jsx)(`ul`,{className:`summary__list`,children:e.proofPoints.map(e=>(0,x.jsxs)(`li`,{children:[e.hasNumber?null:(0,x.jsx)(z,{size:`sm`,tone:`warning`,variant:`soft`,children:`no number`}),` `,e.text]},e.text))})]})})]})}var Iv=e=>e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``);function Lv({note:e,onSaved:t}){let[n,r]=(0,b.useState)(e.markdown),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(e.editable?`edit`:`preview`);(0,b.useEffect)(()=>r(e.markdown),[e.markdown]);let c=n!==e.markdown;return(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{children:e.hint}),(0,x.jsx)(`p`,{className:`muted`,children:(0,x.jsx)(`code`,{children:e.path})})]}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsx)(Z,{value:o,onValueChange:e=>s(e),variant:`pill`,size:`sm`,children:(0,x.jsxs)(Z.List,{"aria-label":`Edit or preview`,children:[(0,x.jsx)(Z.Trigger,{value:`edit`,children:e.editable?`Edit`:`Source`}),(0,x.jsx)(Z.Trigger,{value:`preview`,children:`Preview`})]})}),(0,x.jsx)(B,{asChild:!0,variant:`soft`,size:`sm`,trailingIcon:(0,x.jsx)(H.ExternalLink,{}),children:(0,x.jsx)(`a`,{href:`obsidian://open?path=${encodeURIComponent(e.path)}`,children:`Open in Obsidian`})})]})]}),!e.exists&&(0,x.jsx)(z,{tone:`warning`,size:`sm`,children:`This note does not exist yet; saving creates it.`}),o===`preview`?(0,x.jsx)(`div`,{className:`preview-doc`,children:(0,x.jsx)(dg,{text:Iv(n)||`_Nothing here yet._`})}):(0,x.jsx)(Xp,{label:`${e.title} (Markdown)`,font:`mono`,rows:28,resize:`vertical`,value:n,onChange:e=>r(e.target.value),disabled:!e.editable,description:e.editable?void 0:`Read-only here. Pick a variant below, or edit the resume file and run tekjobs resume sync.`}),e.editable&&(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:!c||i,onClick:()=>r(e.markdown),children:`Discard`}),(0,x.jsx)(B,{tone:`primary`,size:`sm`,disabled:!c||i,loading:i,onClick:async()=>{a(!0);try{let r=await $.saveProfileNote(e.key,n);X({title:`${e.title} saved`,description:r.saved,tone:`success`}),t()}catch(t){X({title:`${e.title} not saved`,description:t.message,tone:`danger`})}a(!1)},children:`Save to the vault`})]})]})})}function Rv({onChanged:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),a=()=>$.resumes().then(n).catch(e=>X({title:`Could not read the resume folder`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{a()},[]);let o=async t=>{i(t);try{let n=await $.useResume(t);X({title:`${t} is the resume of record`,description:`${n.chars} characters into Profile/Resume.md; ${n.added.length} lines new, ${n.removed.length} gone${n.stale.length?`, ${n.stale.length} drafts quote a removed claim`:``}.`,tone:`success`}),a(),e()}catch(e){X({title:`Not switched`,description:e.message,tone:`danger`})}i(``)},s=e=>`${Math.max(1,Math.round(e/1024))} KB`;return(0,x.jsx)(V,{padding:t&&t.files.length?`none`:`md`,children:t?t.files.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`No resume variants yet`,description:`Drop PDF, DOCX, Markdown or text files into ${t.dir}${t.exists?``:` (the folder does not exist yet)`} and they appear here. The folder is set in Settings.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(Y,{"aria-label":`Resume variants`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`File`}),(0,x.jsx)(Y.HeadCell,{children:`Changed`}),(0,x.jsx)(Y.HeadCell,{children:`Size`}),(0,x.jsx)(Y.HeadCell,{children:`Use`})]})}),(0,x.jsx)(Y.Body,{children:t.files.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`chips`,children:[e.name,e.current&&(0,x.jsx)(z,{size:`sm`,tone:`primary`,variant:`soft`,children:`resume of record`})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:e.modified})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:s(e.size)})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,onClick:()=>$.openResume(e.name).catch(e=>X({title:`Could not open`,description:e.message,tone:`danger`})),children:`Open`}),!e.current&&(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:!!r,loading:r===e.name,onClick:()=>o(e.name),children:`Make it the resume of record`})]})})]},e.name))})]}),(0,x.jsxs)(`p`,{className:`muted variants__foot`,children:[`From `,(0,x.jsx)(`code`,{className:`mono`,children:t.dir}),`. Making one the record reads it into Profile/Resume.md, which every tailored resume and letter starts from; the packet's Resume variant field offers these names.`]})]}):(0,x.jsx)(zg,{lines:3})})}function zv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(null),i=()=>($.profileSummary().then(r).catch(()=>{}),$.profileNotes().then(e=>t(e.notes)).catch(e=>X({title:`Could not load the profile`,description:e.message,tone:`danger`})));return(0,b.useEffect)(()=>{i()},[]),e?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`page__head`,children:(0,x.jsx)(`div`,{children:(0,x.jsx)(`p`,{children:`Who you are, how the story is told, and how you write. Cover letters, tailored resumes and application packets read these notes; the scan reads the Criteria page. Saving keeps yesterday's copy beside the note.`})})}),(0,x.jsxs)(Z,{defaultValue:`summary`,variant:`line`,size:`sm`,children:[(0,x.jsxs)(Z.List,{"aria-label":`Profile notes`,children:[(0,x.jsx)(Z.Trigger,{value:`summary`,children:`Summary`}),e.map(e=>(0,x.jsx)(Z.Trigger,{value:e.key,children:e.title},e.key))]}),(0,x.jsx)(Z.Content,{value:`summary`,children:n?(0,x.jsx)(Fv,{s:n}):(0,x.jsx)(zg,{variant:`rect`,height:`12rem`})}),e.map(e=>(0,x.jsx)(Z.Content,{value:e.key,children:(0,x.jsxs)(`div`,{className:`detail`,children:[e.key===`resume`&&(0,x.jsx)(Rv,{onChanged:i}),(0,x.jsx)(Lv,{note:e,onSaved:i})]})},e.key))]})]}):(0,x.jsx)(zg,{variant:`rect`,height:`24rem`})}var Bv=`__active__`,Vv={success:{label:`Success`,tone:`success`},partial:{label:`Partial`,tone:`warning`},failed:{label:`Failed`,tone:`danger`}},Hv=e=>e.dry?`dry run`:e.via===`schedule`?`scheduled`:e.via===`mcp`?`agent`:e.via===`cli`?`manual, CLI`:e.via===`app`?`manual`:``,Uv=e=>{let t=e.match(/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}) UTC$/);if(!t)return``;let n=new Date(`${t[1]}T${t[2]}:00Z`);return Number.isNaN(n.getTime())?``:`${n.toLocaleString()} local`};function Wv(e){if(e.running||e.exitCode===null)return null;if(e.exitCode!==0)return`failed`;let t=(e.output.find(e=>/Boards: \d+\/\d+/.test(e))||``).match(/Boards: (\d+)\/(\d+)/),n=e.output.some(e=>/^- .+?: failed: /.test(e)||/^\s+x /.test(e));return t?Number(t[1])===0&&Number(t[2])>0?`failed`:Number(t[1])===Number(t[2])&&!n?`success`:`partial`:`success`}function Gv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)([]),[o,s]=(0,b.useState)(Bv),[c,l]=(0,b.useState)(null),u=()=>$.runs().then(t).catch(()=>t([]));(0,b.useEffect)(()=>{u(),$.scan().then(r).catch(()=>{}),$.criteriaPresets().then(a).catch(()=>a([]))},[]),(0,b.useEffect)(()=>{if(!n?.running)return;let e=setInterval(()=>$.scan().then(e=>{r(e),e.running||u()}).catch(()=>{}),2e3);return()=>clearInterval(e)},[n?.running]);let d=async(e,t=!1)=>{let n=o===Bv?void 0:o;try{r(await $.startScan(e,n,t)),X({title:t?`Retrying the failed boards`:e?`Dry run started`:`Scan started`,description:t?`Only the boards whose last attempt failed, no feeds.`:`Every board, scored with ${n?`the "${n}" preset`:`the active criteria`}.`,tone:`success`})}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},f=(e??[]).flatMap(e=>e.runs.map((t,n)=>({...t,key:`${e.date}-${n}`})).reverse()),p=f[0],m=!!p&&!p.dry&&p.boardsOk<p.boardsTotal,h=n?Wv(n):null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsx)(`p`,{children:`Each scan fetches every board, scores, and writes new matches to the vault. The morning task runs it with the active criteria; here you can run one now, with the active set or a preset from the Criteria page. Times are UTC; hover one for your clock.`})}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsxs)(J,{size:`sm`,label:`Score with`,value:o,onValueChange:s,disabled:!!n?.running,children:[(0,x.jsx)(J.Item,{value:Bv,children:`Active criteria`}),i.map(e=>(0,x.jsx)(J.Item,{value:e.name,children:e.name},e.name))]}),m&&(0,x.jsx)(Bh,{content:`${p.boardsTotal-p.boardsOk} board${p.boardsTotal-p.boardsOk===1?``:`s`} did not answer last time. Fetch only those; Sources shows each one's health.`,children:(0,x.jsx)(B,{variant:`soft`,tone:`danger`,size:`sm`,disabled:!!n?.running,leadingIcon:(0,x.jsx)(H.Refresh,{}),onClick:()=>d(!1,!0),children:`Retry failed`})}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:!!n?.running,onClick:()=>d(!0),children:`Dry run`}),(0,x.jsx)(B,{tone:`primary`,size:`sm`,disabled:!!n?.running,leadingIcon:n?.running?(0,x.jsx)(Bg,{size:`sm`}):(0,x.jsx)(H.Refresh,{}),onClick:()=>d(!1),children:n?.running?`Scanning`:`Scan now`})]})]}),n&&(n.running||n.output.length>0)&&(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{className:`runs__live`,children:n.running?`Running`:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(z,{tone:Vv[h].tone,size:`sm`,children:Vv[h].label}),` `,(0,x.jsx)(`span`,{children:h===`failed`?`exit code ${n.exitCode}`:`finished`})]}):`Finished`}),(0,x.jsxs)(`p`,{children:[n.startedAt?`Started ${n.startedAt.replace(`T`,` `).slice(0,19)} UTC`:``,n.criteria?` · preset "${n.criteria}"`:``]})]}),n.running&&(0,x.jsx)(Bg,{showLabel:!0,label:`Fetching boards`,size:`sm`})]}),(0,x.jsx)(ag,{code:n.output.slice(-40).join(`
|
|
77
|
-
`)||`…`,language:`text`,showCopy:!1,wrap:!0})]})}),f.length>1&&(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`New matches per scan`}),(0,x.jsx)(`p`,{children:`What each of the last twelve runs added, most recent on the right.`})]})}),(0,x.jsx)(Fi,{series:[{name:`New matches`,values:[...f].slice(0,12).reverse().map(e=>e.newMatches)}],labels:[...f].slice(0,12).reverse().map(e=>e.when.slice(5,16)),area:!0,height:200,"aria-label":`New matches per scan`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Last scan`}),(0,x.jsx)(`p`,{children:p?p.when:``})]}),p&&(0,x.jsx)(z,{tone:Vv[p.outcome].tone,size:`sm`,children:Vv[p.outcome].label})]}),p&&(0,x.jsxs)(`dl`,{className:`detail__grid`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Postings scanned`}),(0,x.jsx)(`dd`,{children:p.scanned.toLocaleString()})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Above the bar`}),(0,x.jsx)(`dd`,{children:p.matched})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`New notes`}),(0,x.jsx)(`dd`,{children:p.dry?`dry run`:p.newMatches})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Closed listings`}),(0,x.jsx)(`dd`,{children:p.dry?`—`:p.closed})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Duration`}),(0,x.jsxs)(`dd`,{children:[p.seconds,`s`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Boards`}),(0,x.jsxs)(`dd`,{children:[p.boardsOk,`/`,p.boardsTotal]})]})]})]})})]}),(0,x.jsx)(V,{padding:`none`,children:e===null?(0,x.jsx)(`div`,{className:`loading`,children:(0,x.jsx)(zg,{lines:6})}):(0,x.jsxs)(Y,{"aria-label":`Scan history`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Outcome`}),(0,x.jsx)(Y.HeadCell,{children:`When`}),(0,x.jsx)(Y.HeadCell,{children:`Boards`}),(0,x.jsx)(Y.HeadCell,{children:`Criteria`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Scanned`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Above bar`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`New`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Closed`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Seconds`})]})}),(0,x.jsxs)(Y.Body,{children:[f.map(e=>{let t=[...e.failed?e.failed.split(/;\s*/).filter(Boolean).map(e=>`board: ${e}`):[],...(e.feedsFailed||[]).map(e=>`feed: ${e}`)],n=t.length>0,r=c===e.key;return[(0,x.jsxs)(Y.Row,{interactive:n,onClick:n?()=>l(r?null:e.key):void 0,"aria-expanded":n?r:void 0,children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`runs__outcome`,children:[(0,x.jsx)(z,{tone:Vv[e.outcome].tone,variant:e.outcome===`success`?`soft`:`solid`,size:`sm`,children:Vv[e.outcome].label}),Hv(e)&&(0,x.jsx)(`small`,{className:`muted`,children:Hv(e)})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num`,title:Uv(e.when),children:e.when})}),(0,x.jsxs)(Y.Cell,{children:[(0,x.jsxs)(`span`,{className:`num`,children:[e.boardsOk,`/`,e.boardsTotal]}),n&&(0,x.jsxs)(`span`,{className:`muted`,children:[` · `,t.length,` problem`,t.length===1?``:`s`,` `,r?`▾`:`▸`]})]}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:e.criteria||`—`})}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.scanned.toLocaleString()}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.matched}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.dry?(0,x.jsx)(`span`,{className:`muted`,children:`—`}):e.newMatches}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.dry?(0,x.jsx)(`span`,{className:`muted`,children:`—`}):e.closed}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.seconds})]},e.key),n&&r?(0,x.jsx)(Y.Row,{children:(0,x.jsxs)(Y.Cell,{colSpan:9,children:[(0,x.jsx)(`ul`,{className:`runs__problems`,children:t.map(e=>(0,x.jsx)(`li`,{className:`mono`,children:e},e))}),(0,x.jsx)(`p`,{className:`muted`,children:`A board that fails once is usually a hiccup; one that fails every run has moved. Sources shows each board's health and last success.`})]})},`${e.key}-problems`):null]}),f.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:9,children:(0,x.jsx)(`span`,{className:`muted`,children:`No scans logged yet.`})})})]})]})})]})}function Kv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)({profile:``,resumeDir:``,llmCommand:``,llmArgs:``,contact:``}),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(!1),c=()=>$.settings().then(e=>{t(e),r({profile:e.profile.configured||e.profile.active,resumeDir:e.resumeDir.configured||e.resumeDir.path,llmCommand:e.llm.command,llmArgs:e.llm.args,contact:e.contact})}).catch(e=>X({title:`Could not read the settings`,description:e.message,tone:`danger`}));return(0,b.useEffect)(()=>{c()},[]),e?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`page__head`,children:(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`Where things live. The profile folder, the writing CLI and the contact are about this computer and sit in `,(0,x.jsx)(`code`,{className:`mono`,children:e.configFile}),`. The resume of record and the variants folder are about this search and sit inside the profile, in `,(0,x.jsx)(`code`,{className:`mono`,children:e.profileSettingsFile}),`, so a second profile never sees them. Everything else is a note in the folder.`]})})}),(0,x.jsxs)(`div`,{className:`detail`,children:[o&&(0,x.jsxs)(z,{tone:`warning`,size:`md`,children:[`The profile folder changed. Restart the server (`,(0,x.jsx)(`code`,{className:`mono`,children:`npm run server`}),`, or the scheduled task's next run) to switch; until then the app keeps reading `,e.profile.active,`.`]}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Profile folder `,(0,x.jsx)(`span`,{className:`muted`,children:`(this computer)`})]}),(0,x.jsxs)(`p`,{className:`muted`,children:[`Your job search: profile, resume, criteria, watchlist, one note per job, logs. Plain markdown; point Obsidian at it. Reading now: `,(0,x.jsx)(`code`,{className:`mono`,children:e.profile.active}),e.profile.fromEnv?` (set by TEKJOBS_PROFILE in the environment, which wins over this file)`:``,`.`]})]}),(0,x.jsx)(Zp,{label:`Folder`,value:n.profile,onChange:e=>r({...n,profile:e.target.value}),description:`Must exist. To start a new profile somewhere, run tekjobs init <dir> instead; it writes the starter notes. Takes effect on the next server start.`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Resume variants folder `,(0,x.jsx)(`span`,{className:`muted`,children:`(this profile)`})]}),(0,x.jsxs)(`p`,{className:`muted`,children:[`PDF, DOCX, Markdown or text files, one per variant. The Profile page lists them and makes any one the resume of record; the packet's Resume variant field offers their names. `,e.resumeDir.exists?``:`This folder does not exist yet; it is optional until you keep more than one resume.`]})]}),(0,x.jsx)(Zp,{label:`Folder`,value:n.resumeDir,onChange:e=>r({...n,resumeDir:e.target.value}),description:`Default: Templates/Resume inside the profile folder. Resume of record now: ${e.resumeSource||`not set. Import one on the Onboarding page, or run tekjobs resume <file>`}.`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Writing CLI `,(0,x.jsx)(`span`,{className:`muted`,children:`(this computer)`})]}),(0,x.jsx)(`p`,{className:`muted`,children:`The local coding CLI that writes letters and tailored resumes and reads the mailbox. It must be signed in on this machine. Claude Code by default; another CLI works if it takes the prompt on stdin and prints the answer.`})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(Zp,{label:`Command`,value:n.llmCommand,onChange:e=>r({...n,llmCommand:e.target.value})}),(0,x.jsx)(Zp,{label:`Arguments`,value:n.llmArgs,onChange:e=>r({...n,llmArgs:e.target.value}),font:`mono`})]})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Contact for scans `,(0,x.jsx)(`span`,{className:`muted`,children:`(this computer)`})]}),(0,x.jsx)(`p`,{className:`muted`,children:`Optional. Added to the user agent on every request the scan makes, so a site can reach the person running it.`})]}),(0,x.jsx)(Zp,{label:`Email`,type:`email`,value:n.contact,onChange:e=>r({...n,contact:e.target.value})})]})}),(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,loading:i,onClick:async()=>{a(!0);try{let e=await $.saveSettings(n);t(e),s(e.restart||o),X({title:`Settings saved`,description:e.configFile,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}a(!1)},children:`Save settings`})})]})]}):(0,x.jsx)(zg,{variant:`rect`,height:`20rem`})}function qv(){let[e,t]=(0,b.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=document.documentElement.dataset.theme;return t===`light`||t===`dark`?t:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`});return(0,b.useEffect)(()=>{document.documentElement.dataset.theme=e},[e]),[e,()=>t(e=>e===`light`?`dark`:`light`)]}function Jv(){let e=()=>{let[e,t]=window.location.hash.replace(/^#\/?/,``).split(`?`);return{page:[`onboarding`,`today`,`overview`,`jobs`,`pipeline`,`mail`,`people`,`companies`,`criteria`,`profile`,`runs`,`agent`,`settings`].includes(e??``)?e:`today`,q:new URLSearchParams(t).get(`q`)??``}},[t,n]=(0,b.useState)(e);return(0,b.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),[t.page,t.q,(e,t)=>{window.location.hash=t?`/${e}?q=${encodeURIComponent(t)}`:`/${e}`}]}function Yv(){let[e,t,n]=Jv(),[r,i]=qv(),[a,o]=(0,b.useState)(!0),[s,c]=(0,b.useState)({}),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(null);return(0,b.useEffect)(()=>{$.onboarding().then(e=>{o(e.complete),!e.complete&&!window.location.hash&&n(`onboarding`)}).catch(()=>{})},[]),(0,b.useEffect)(()=>{$.summary().then(e=>{c(t=>({...t,jobs:e.open,companies:e.companies})),e.lastRun&&u(`Last scan ${e.lastRun.when.slice(11,16)} · ${e.lastRun.boardsOk}/${e.lastRun.boardsTotal} boards`),e.who&&(f(e.who),document.title=e.who.name?`${u_(e.who.name)} search · TekJobs`:`TekJobs`)}).catch(()=>{}),$.today().then(e=>c(t=>({...t,today:e.sections.triage.length}))).catch(()=>{}),$.mail().then(e=>c(t=>({...t,mail:e.groups.length}))).catch(()=>{})},[e]),(0,x.jsx)(Bh.Provider,{children:(0,x.jsx)($m.Provider,{position:`bottom-right`,children:(0,x.jsx)(d_,{page:e,onNavigate:e=>n(e),onSearch:e=>n(`jobs`,e),theme:r,onToggleTheme:i,onboarded:a,counts:s,lastScan:l,who:d,children:(0,x.jsxs)(`div`,{className:`page z-enter-fade`,children:[e===`onboarding`&&(0,x.jsx)(bv,{onDone:()=>n(`overview`)}),e===`today`&&(0,x.jsx)(Ev,{onNavigate:n}),e===`overview`&&(0,x.jsx)(Tv,{onNavigate:n}),e===`jobs`&&(0,x.jsx)(ov,{initialQuery:t}),e===`pipeline`&&(0,x.jsx)(Nv,{}),e===`mail`&&(0,x.jsx)(mv,{}),e===`people`&&(0,x.jsx)(F_,{}),e===`companies`&&(0,x.jsx)(y_,{}),e===`criteria`&&(0,x.jsx)(A_,{}),e===`profile`&&(0,x.jsx)(zv,{}),e===`runs`&&(0,x.jsx)(Gv,{}),e===`agent`&&(0,x.jsx)(m_,{}),e===`settings`&&(0,x.jsx)(Kv,{})]},e)})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(Yv,{})}));
|
|
76
|
+
`).map(e=>e.replace(/^-\s*/,``).trim()).filter(Boolean).map(e=>{let t=[...e.matchAll(/(?<![\w$])([+-]\d+)\b/g)].reduce((e,t)=>e+Number(t[1]),0),n=e.replace(/(?<![\w$])[+-]\d+\b/g,``).replace(/\(\s*[,\s]*/g,`(`).replace(/[,\s]*\)/g,`)`).replace(/\(\)/g,``).replace(/\s+,/g,`,`).replace(/\s{2,}/g,` `).replace(/\s+:/g,`:`).trim(),r=n.indexOf(`:`),i=(r>=0?n.slice(0,r):n).trim().replace(/[,:]$/,``),a=(r>=0?n.slice(r+1):``).trim();return{label:i.charAt(0).toUpperCase()+i.slice(1),detail:a,points:t}})}function cv(e){return(0,x.jsx)(Sp,{open:e.id!==null,onOpenChange:t=>!t&&e.onClose(),side:`right`,size:`lg`,children:(0,x.jsx)(Sp.Content,{children:(0,x.jsx)(lv,{...e})})})}function lv({id:e,onClose:t,onChanged:n,nav:r,inline:i=!1}){let[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(!1);(0,b.useEffect)(()=>{o(null),e&&$.job(e).then(o).catch(e=>X({title:`Could not open the note`,description:e.message,tone:`danger`}))},[e]);let d=async e=>{if(a){u(!0);try{let t=await $.setStatus(a.id,e);o(t),n(t),X({title:`${a.company}: ${e}`,description:`Written to the note's frontmatter and status log.`,tone:`success`})}catch(e){X({title:`Status not saved`,description:e.message,tone:`danger`})}u(!1)}},f=async()=>{if(a&&s.trim()){u(!0);try{let e=await $.addNote(a.id,s);o(e),c(``),X({title:`Note added`,tone:`success`})}catch(e){X({title:`Note not saved`,description:e.message,tone:`danger`})}u(!1)}},[p,m]=(0,b.useState)(null);(0,b.useEffect)(()=>{Promise.all([$.summary(),$.companies()]).then(([e,t])=>m({ceiling:e.ceiling,bar:e.minScore,boards:t.map(e=>({name:e.name,tier:e.tier,status:e.status}))})).catch(()=>{})},[]);let h=(0,b.useMemo)(()=>a?sv(a.sections.why):[],[a]),g=a&&p?.ceiling?Math.max(0,Math.min(100,Math.round(a.score/p.ceiling*100))):null,_=a&&p?p.boards.find(e=>e.name.toLowerCase()===a.company.toLowerCase()):null,v=a?a.sections.description.replace(/^>.*$/m,``).replace(/[#*_`>]/g,``).replace(/\s+/g,` `).trim().slice(0,320):``,y=async e=>{if(a){u(!0);try{let t=await $.setStatus(a.id,`passed`,e);o(t),n(t),X({title:`${a.company}: passed`,description:e,tone:`neutral`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}u(!1)}},S=r&&(0,x.jsxs)(`div`,{className:`sheet-nav`,children:[(0,x.jsx)(Bh,{content:`Previous (K)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Previous job`,leadingIcon:(0,x.jsx)(H.ChevronUp,{}),disabled:r.pos<=0,onClick:r.prev})}),(0,x.jsx)(Bh,{content:`Next (J)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Next job`,leadingIcon:(0,x.jsx)(H.ChevronDown,{}),disabled:r.pos<0?r.total===0:r.pos>=r.total-1,onClick:r.next})}),(0,x.jsx)(`span`,{className:`sheet-nav__count num`,children:r.pos>=0?`${r.pos+1} of ${r.total}`:`not in this view`}),i&&(0,x.jsx)(Bh,{content:`Close (Esc)`,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,"aria-label":`Close`,leadingIcon:(0,x.jsx)(H.Close,{}),onClick:t,className:`sheet-nav__close`})})]});return(0,x.jsx)(x.Fragment,{children:a?(0,x.jsxs)(`div`,{className:`detail`,children:[S,(0,x.jsxs)(`div`,{className:`sheet-head`,children:[(0,x.jsxs)(`div`,{className:`sheet-head__main`,children:[(0,x.jsxs)(`p`,{className:`sheet-head__meta`,children:[a.company,` · `,a.location||`location n/a`,` · `,H_(a.source)?`posted on TekJobs`:a.source,` · found `,Xg(a.found)||a.found]}),i?(0,x.jsx)(`h2`,{className:`sheet-head__title`,children:a.title}):(0,x.jsx)(Sp.Title,{children:a.title}),(0,x.jsxs)(`div`,{className:`chips`,children:[H_(a.source)&&(0,x.jsx)(U_,{label:`Posted on TekJobs`}),(0,x.jsx)(z,{tone:a.payBand===`floor`?`primary`:`neutral`,variant:`soft`,size:`sm`,children:(0,x.jsx)(`span`,{className:`num`,children:a.salaryMax?Yg(a.salary):`pay not stated`})}),a.salaryMax>0&&(0,x.jsx)(z,{tone:`neutral`,variant:`outline`,size:`sm`,children:Zg[a.payBand].toLowerCase()}),(0,x.jsx)(z,{tone:a.remote?`success`:`neutral`,variant:a.remote?`soft`:`outline`,size:`sm`,children:a.remote?`remote`:`on-site`}),(0,x.jsx)(z,{tone:$g[a.status],size:`sm`,children:a.status})]})]}),(0,x.jsxs)(`div`,{className:`sheet-head__side`,children:[(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[a.status===`new`&&(0,x.jsx)(B,{tone:`primary`,size:`sm`,disabled:l,onClick:()=>d(`reviewing`),children:`Shortlist`}),(a.status===`new`||a.status===`reviewing`)&&(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:l,trailingIcon:(0,x.jsx)(H.ChevronDown,{}),children:`Pass`})}),(0,x.jsx)(Tu.Content,{align:`end`,children:Kg.map(e=>(0,x.jsx)(Tu.Item,{onSelect:()=>y(e),children:e},e))})]}),(0,x.jsx)(J,{size:`sm`,label:`Status`,value:a.status,onValueChange:e=>d(e),disabled:l,children:Gg.map(e=>(0,x.jsx)(J.Item,{value:e,children:e},e))})]}),(0,x.jsxs)(`div`,{className:`sheet-head__links`,children:[(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:a.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open posting ↗`})}),(0,x.jsx)(B,{asChild:!0,variant:`link`,size:`sm`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:a.obsidianUrl,title:a.path,children:`Open in Obsidian ↗`})}),(0,x.jsx)(B,{variant:`link`,size:`sm`,tone:`neutral`,title:a.path,onClick:()=>$.revealJob(a.id).catch(e=>X({title:`Could not show the file`,description:e.message,tone:`danger`})),children:`Show file`}),(0,x.jsx)(G_,{job:a,onAttached:e=>{o(e),n(e)}})]})]})]}),(0,x.jsxs)(Z,{defaultValue:`why`,variant:`line`,size:`sm`,children:[(0,x.jsxs)(Z.List,{"aria-label":`Job note sections`,children:[(0,x.jsx)(Z.Trigger,{value:`why`,children:`Match reasons`}),(0,x.jsx)(Z.Trigger,{value:`description`,children:`Description`}),(0,x.jsx)(Z.Trigger,{value:`application`,children:`Application packet`}),(0,x.jsx)(Z.Trigger,{value:`resume`,children:`Tailored resume`}),(0,x.jsx)(Z.Trigger,{value:`letter`,children:`Cover letter`}),(0,x.jsx)(Z.Trigger,{value:`people`,children:`People`}),(0,x.jsx)(Z.Trigger,{value:`notes`,children:`Notes`})]}),(0,x.jsx)(Z.Content,{value:`why`,children:(0,x.jsxs)(`div`,{className:`split`,children:[(0,x.jsxs)(`div`,{className:`reasons`,children:[(0,x.jsxs)(`div`,{className:`reasons__head`,children:[(0,x.jsxs)(`span`,{className:`muted`,children:[`Scored `,(0,x.jsx)(`span`,{className:`num`,children:a.score}),p?.ceiling?(0,x.jsxs)(x.Fragment,{children:[` of `,(0,x.jsx)(`span`,{className:`num`,children:p.ceiling}),` possible`]}):null,` with the active criteria`,p?.bar?(0,x.jsxs)(x.Fragment,{children:[` (bar `,(0,x.jsx)(`span`,{className:`num`,children:p.bar}),`)`]}):null,`.`]}),g!==null&&(0,x.jsxs)(`span`,{className:`reasons__fit num`,children:[g,(0,x.jsx)(`small`,{children:` fit`})]})]}),h.map((e,t)=>(0,x.jsxs)(`div`,{className:`reasons__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{children:e.label}),e.detail&&(0,x.jsx)(`div`,{className:`reasons__detail`,children:e.detail})]}),(0,x.jsxs)(`span`,{className:`num reasons__pts${e.points<0?` reasons__pts--neg`:``}`,children:[e.points<0?`−`:`+`,Math.abs(e.points)]})]},t)),h.length===0&&(0,x.jsx)(`p`,{className:`muted`,children:`No match reasons recorded.`}),(0,x.jsxs)(`details`,{className:`reasons__log`,children:[(0,x.jsx)(`summary`,{children:`Status log`}),(0,x.jsx)(dg,{text:a.sections.log||`_Nothing yet._`})]})]}),(0,x.jsxs)(`aside`,{className:`split__aside`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`From the posting`}),(0,x.jsx)(`p`,{children:v?`${v}${a.sections.description.length>320?`…`:``}`:`The posting had no description text. Open the posting, or attach one.`})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`Note`}),(0,x.jsxs)(`p`,{className:`num small`,children:[a.path.split(/[\\/]/).slice(-2).join(`/`),(0,x.jsx)(`br`,{}),`status: `,a.status,` · found `,a.found,a.addedBy===`scan`?``:` · added by ${a.addedBy}`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`microlabel`,children:`Board`}),(0,x.jsx)(`p`,{children:_?`Tier ${_.tier} board, last fetch ${_.status||`not yet run`}.`:`${a.source}; not on the watchlist.`})]})]})]})}),(0,x.jsx)(Z.Content,{value:`description`,children:(0,x.jsx)(dg,{text:a.sections.description||`_The posting had no description text. Open the posting._`})}),(0,x.jsx)(Z.Content,{value:`application`,children:(0,x.jsx)(uv,{job:a,onStatus:d,busy:l})}),(0,x.jsx)(Z.Content,{value:`resume`,children:(0,x.jsx)(V_,{job:a})}),(0,x.jsx)(Z.Content,{value:`letter`,children:(0,x.jsx)(j_,{job:a})}),(0,x.jsx)(Z.Content,{value:`people`,children:(0,x.jsx)(R_,{job:a})}),(0,x.jsx)(Z.Content,{value:`notes`,children:(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(dg,{text:a.sections.notes||`_No notes yet._`}),(0,x.jsx)(Xp,{label:`Add a note`,rows:3,value:s,onChange:e=>c(e.target.value),placeholder:`Appended to the note with today's date.`}),(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:f,disabled:l||!s.trim(),children:`Save note`})})]})})]})]}):(0,x.jsxs)(`div`,{className:`detail`,children:[S,(0,x.jsx)(zg,{lines:6})]})})}function uv({job:e,onStatus:t,busy:n}){let[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)({}),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)([]),d=()=>$.packet(e.id).then(e=>{i(e),o(e.values)}).catch(e=>X({title:`Could not read the packet`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{d(),$.resumes().then(e=>u(e.files.map(e=>e.name))).catch(()=>{})},[e.id]);let f=async(t,n)=>{o(e=>({...e,[t]:n})),c(t);try{await $.saveApplication(e.id,t,n),await d(),X({title:`${t} saved`,description:n,tone:`success`})}catch(e){X({title:`${t} not saved`,description:e.message,tone:`danger`})}finally{c(``)}},p=async t=>{if(r&&a[t]!==r.values[t]){c(t);try{await $.saveApplication(e.id,t,a[t]??``),await d(),X({title:`${t} saved`,description:`Written into the note.`,tone:`success`})}catch(e){X({title:`${t} not saved`,description:e.message,tone:`danger`})}finally{c(``)}}};return r?(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`div`,{className:`packet__state`,children:[(0,x.jsxs)(z,{tone:r.ready?`success`:`neutral`,variant:r.ready?`soft`:`outline`,children:[r.filled,` of `,r.total,` filled`]}),r.ready?(0,x.jsx)(`p`,{className:`muted`,children:`Every required field has something in it. Read it before you send it — this says the boxes are full, not that the application is good.`}):(0,x.jsxs)(`p`,{className:`muted`,children:[`Still required: `,r.missing.join(`, `),`.`]})]}),r.ready&&e.status!==`applied`&&(0,x.jsxs)(`div`,{className:`form__actions form__actions--start`,children:[e.status!==`ready`&&(0,x.jsx)(B,{size:`sm`,tone:`primary`,variant:`soft`,disabled:n,onClick:()=>t(`ready`),children:`Mark ready for approval`}),(0,x.jsx)(B,{size:`sm`,tone:`primary`,disabled:n,onClick:()=>{window.confirm(`Only mark this applied if you have actually sent it to ${e.company}. Nothing here can send an application.`)&&t(`applied`)},children:`I have applied`})]}),r.fields.map(({field:e,hint:t,required:n})=>(0,x.jsxs)(`div`,{className:`packet__field`,children:[(0,x.jsx)(Xp,{label:n?`${e} *`:e,description:t,rows:e===`Tailored summary`||e===`Tailored bullets`||e===`Cover letter`||e===`Outreach message`||e===`Questions`||e===`Risks`?3:1,value:a[e]??``,onChange:t=>o({...a,[e]:t.target.value}),onBlur:()=>p(e),placeholder:n?`Required before this is ready.`:``}),e===`Resume variant`&&l.length>0&&(0,x.jsx)(`div`,{className:`chips`,children:l.map(t=>(0,x.jsx)(B,{size:`sm`,variant:a[e]===t?`soft`:`ghost`,tone:a[e]===t?`primary`:`neutral`,onClick:()=>f(e,t),children:t},t))}),s===e&&(0,x.jsx)(`span`,{className:`muted`,children:`Saving…`})]},e)),(0,x.jsx)(`p`,{className:`muted`,children:`Fields are written into the note's Application section as you leave each one. An agent fills the same fields through the TekJobs MCP server — see Agent access.`})]}):(0,x.jsx)(`div`,{className:`detail`,children:(0,x.jsx)(zg,{lines:6})})}var dv={confirmation:`success`,rejection:`danger`,advance:`primary`,scheduling:`primary`,"info-request":`warning`,outreach:`warning`,other:`neutral`},fv={confirmation:`confirmed`,rejection:`rejected`,advance:`advanced`,scheduling:`scheduling`,"info-request":`asks for more`,outreach:`reached out`,other:`other`};function pv(e,t){let n=e.suggestion;return t?n.action===`status`?`mark it ${n.status}${n.appliedOn?` as of ${n.appliedOn}`:``}`:`add the mail to the note${n.appliedOn?`, set Applied on if empty`:``}`:`create a note for ${e.company} and mark it ${n.status}`}function mv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(gv,{onOpen:t,onChanged:()=>r(e=>e+1)},n),(0,x.jsx)(cv,{id:e,onClose:()=>t(null),onChanged:e=>{}})]})}function hv({onOpen:e}){let[t,n]=(0,b.useState)(null);(0,b.useEffect)(()=>{$.mail().then(n).catch(()=>{})},[]);let r=t?.groups.length??0;return!t||r===0&&!t.running?null:(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`mailstrip`,children:[(0,x.jsxs)(`span`,{children:[t.running?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Bg,{size:`sm`}),` Reading the mailbox.`]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`b`,{className:`num`,children:r}),` `,r===1?`email group waits`:`email groups wait`,` for a decision.`]}),t.lastRun&&(0,x.jsxs)(`span`,{className:`muted`,children:[` Last read `,(0,x.jsx)(`span`,{className:`num`,children:t.lastRun.slice(0,16).replace(`T`,` `)}),` UTC.`]})]}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,leadingIcon:(0,x.jsx)(H.Mail,{}),onClick:e,children:`Open Mail`})]})})}function gv({onOpen:e,onChanged:t}){let[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)({}),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(null),u=()=>$.mail().then(r).catch(()=>{});(0,b.useEffect)(()=>{u()},[]),(0,b.useEffect)(()=>{if(!n?.running)return;let e=setInterval(()=>$.mail().then(e=>{r(e),!e.running&&e.error&&X({title:`Mail check failed`,description:e.error,tone:`danger`})}).catch(()=>{}),4e3);return()=>clearInterval(e)},[n?.running]);let d=async()=>{try{r(await $.mailCheck()),X({title:`Reading the mailbox`,description:`Through the local CLI, Gmail read tools only. A few minutes.`,tone:`neutral`})}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},f=async(e,n)=>{s(e.id);try{let a=e.id in i?i[e.id]:e.noteId;r(n===`confirm`?await $.mailConfirm(e.id,a||void 0):await $.mailDismiss(e.id)),n===`confirm`&&(X({title:`${e.company}: ${pv(e,i[e.id]||e.noteId)}`,description:`Written to the note.`,tone:`success`}),t())}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}finally{s(null)}},p=n?.groups??[],m=(n?.items??[]).filter(e=>e.state!==`pending`).sort((e,t)=>(t.resolved?.at??``).localeCompare(e.resolved?.at??``)),h=m.length,[g,_]=(0,b.useState)(!1),v=e=>e.state===`dismissed`?`dismissed`:e.resolved?.action===`create`?`note created, marked ${e.resolved.status}`:e.resolved?.action===`status`?`marked ${e.resolved.status}`:`recorded on the note`,y=p.filter(e=>e.kind===`confirmation`&&e.match===`exact`&&e.noteId).length;return(0,x.jsxs)(`section`,{className:`today__section`,id:`mail-says`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Mail says`}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[n?.lastRun&&(0,x.jsxs)(`span`,{className:`muted`,children:[`last read `,n.lastRun.slice(0,16).replace(`T`,` `),` UTC, `,n.lastSinceDays,` days back`]}),h>0&&(0,x.jsx)(B,{size:`sm`,variant:`ghost`,onClick:()=>_(e=>!e),children:g?`Hide handled`:`${h} handled`}),y>0&&(0,x.jsxs)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:o===`safe`||!!n?.running,loading:o===`safe`,title:`Confirmations whose note matched by exact title: records the mail, marks still-open notes applied as of the mail's date. Rejections, interviews, company-only matches and creates stay one at a time.`,onClick:async()=>{s(`safe`);try{let e=await $.mailConfirmSafe();r(e),X({title:`${e.confirmed} confirmations recorded`,description:`Exact-title matches only. The rest are still listed.`,tone:`success`}),t()}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}finally{s(null)}},children:[`Confirm the exact matches (`,y,`)`]}),(0,x.jsx)(B,{size:`sm`,variant:`soft`,disabled:!!n?.running,leadingIcon:n?.running?(0,x.jsx)(Bg,{size:`sm`}):(0,x.jsx)(H.Mail,{}),onClick:d,children:n?.running?`Reading the mailbox`:`Check mail`})]})]}),!n||p.length===0&&!n.running?(0,x.jsx)(V,{padding:`md`,children:(0,x.jsx)(Vg,{size:`sm`,title:n?.lastRun?`Nothing waiting from the mailbox`:`The mailbox has not been read yet`,description:n?.error?n.error:`The morning task reads application emails through your signed-in CLI (Gmail read tools only) and lists what they say about your applications here. You confirm each one. Check mail reads again now.`})}):(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Application emails waiting for a decision`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Date`}),(0,x.jsx)(Y.HeadCell,{children:`Mail says`}),(0,x.jsx)(Y.HeadCell,{children:`Company and role`}),(0,x.jsx)(Y.HeadCell,{children:`Note`}),(0,x.jsx)(Y.HeadCell,{children:`Confirm`})]})}),(0,x.jsxs)(Y.Body,{children:[p.map(t=>{let r=i[t.id]||t.noteId;return(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>l(t),children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:t.date||`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[(0,x.jsxs)(`span`,{className:`chips`,children:[t.kinds.map(e=>(0,x.jsx)(z,{size:`sm`,tone:dv[e],children:fv[e]},e)),t.count>1&&(0,x.jsxs)(`small`,{children:[t.count,` emails`,t.first&&t.first!==t.date?`, ${t.first} to ${t.date}`:``]})]}),(0,x.jsx)(`small`,{title:t.subject,children:t.gist})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[t.company,(0,x.jsx)(`small`,{children:t.role||`role not stated`}),t.person&&(0,x.jsxs)(`small`,{title:`${t.person.email}. Confirming adds them to People and to the note.`,children:[`from `,t.person.name]})]})}),(0,x.jsx)(Y.Cell,{onClick:e=>e.stopPropagation(),children:t.match===`none`?(0,x.jsx)(`span`,{className:`muted`,children:`no note; confirm creates one`}):t.match===`exact`||t.match===`company`&&t.candidates.length<=1?(0,x.jsxs)(`span`,{className:`who__text`,children:[(0,x.jsxs)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>e(t.noteId),children:[t.noteTitle,` · `,t.noteStatus]}),n.items.find(e=>e.id===t.id)?.via===`link`&&(0,x.jsx)(`small`,{children:`matched by the posting link`})]}):(0,x.jsxs)(J,{size:`sm`,label:t.match===`company-other-role`?`Not a role in the vault`:`Which role`,value:r||`__new__`,onValueChange:e=>a(n=>({...n,[t.id]:e===`__new__`?``:e})),children:[(0,x.jsx)(J.Item,{value:`__new__`,children:`New note for this role`}),t.candidates.map(e=>(0,x.jsxs)(J.Item,{value:e.id,children:[e.title,` · `,e.status]},e.id))]})}),(0,x.jsx)(Y.Cell,{onClick:e=>e.stopPropagation(),children:(0,x.jsxs)(`div`,{className:`today__actions`,children:[(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:o===t.id,title:pv(t,r),onClick:()=>f(t,`confirm`),children:r?t.suggestion.action===`record`?`Record`:`Mark ${t.suggestion.status}`:`Create and mark`}),(0,x.jsx)(B,{size:`sm`,variant:`ghost`,disabled:o===t.id,onClick:()=>f(t,`dismiss`),children:`Dismiss`})]})})]},t.id)}),n.running&&p.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:5,children:(0,x.jsx)(`span`,{className:`muted`,children:`Reading…`})})})]})]})}),g&&(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Application emails already handled`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Mail date`}),(0,x.jsx)(Y.HeadCell,{children:`Mail said`}),(0,x.jsx)(Y.HeadCell,{children:`Company and role`}),(0,x.jsx)(Y.HeadCell,{children:`Note`}),(0,x.jsx)(Y.HeadCell,{children:`What was done`})]})}),(0,x.jsx)(Y.Body,{children:m.map(t=>(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>l(_v(t)),children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:t.date||`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:dv[t.kind],children:fv[t.kind]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[t.company,(0,x.jsx)(`small`,{children:t.role||`role not stated`})]})}),(0,x.jsx)(Y.Cell,{onClick:e=>e.stopPropagation(),children:t.noteId?(0,x.jsx)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>e(t.noteId),children:t.noteId.replace(/ \([0-9a-f]+\)$/,``)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`muted`,children:[v(t),t.resolved?.at?`, ${t.resolved.at.slice(0,16).replace(`T`,` `)} UTC`:``]})})]},t.id))})]})}),(0,x.jsx)(vv,{group:c,items:n?.items??[],busy:o,onClose:()=>l(null),onOpenNote:e,onAct:async(e,t)=>{await f(e,t),l(null)}})]})}function _v(e){return{id:e.id,ids:[e.id],count:1,company:e.company,role:e.role,kind:e.kind,kinds:[e.kind],date:e.date,first:e.date,gist:e.gist,subject:e.subject,from:e.from,link:e.link,person:e.person??null,match:e.match,noteId:e.noteId,noteTitle:e.noteTitle,noteStatus:e.noteStatus,candidates:e.candidates,suggestion:e.suggestion}}function vv({group:e,items:t,busy:n,onClose:r,onOpenNote:i,onAct:a}){let o=e?t.filter(t=>e.ids.includes(t.id)).sort((e,t)=>(t.date||``).localeCompare(e.date||``)):[],s=o.some(e=>e.state===`pending`);return(0,x.jsx)(Sp,{open:e!==null,onOpenChange:e=>!e&&r(),side:`right`,size:`md`,children:(0,x.jsx)(Sp.Content,{children:e&&(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(`div`,{className:`sheet-head`,children:(0,x.jsxs)(`div`,{className:`sheet-head__main`,children:[(0,x.jsxs)(`p`,{className:`sheet-head__meta`,children:[e.company,e.role?` · ${e.role}`:``]}),(0,x.jsx)(Sp.Title,{children:e.subject||e.gist}),(0,x.jsxs)(`div`,{className:`chips`,children:[e.kinds.map(e=>(0,x.jsx)(z,{size:`sm`,tone:dv[e],children:fv[e]},e)),e.date&&(0,x.jsx)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:(0,x.jsx)(`span`,{className:`num`,children:e.date})}),e.count>1&&(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:[e.count,` emails`]})]})]})}),(0,x.jsx)(`p`,{children:e.gist}),(0,x.jsxs)(`dl`,{className:`mailsheet__facts`,children:[(0,x.jsx)(`dt`,{children:`From`}),(0,x.jsx)(`dd`,{children:e.person?`${e.person.name}${e.person.email?` <${e.person.email}>`:``}`:e.from}),(0,x.jsx)(`dt`,{children:`Note`}),(0,x.jsx)(`dd`,{children:e.noteId?(0,x.jsxs)(B,{variant:`link`,size:`sm`,tone:`neutral`,onClick:()=>i(e.noteId),children:[e.noteTitle||e.noteId,` · `,e.noteStatus]}):(0,x.jsx)(`span`,{className:`muted`,children:`none yet; confirming creates one`})}),s&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`dt`,{children:`Confirming`}),(0,x.jsx)(`dd`,{children:pv(e,e.noteId)})]})]}),(0,x.jsx)(`h4`,{className:`connections__title`,children:o.length===1?`The email`:`The ${o.length} emails`}),(0,x.jsx)(`ul`,{className:`people__list`,children:o.map(e=>(0,x.jsxs)(`li`,{className:`people__row`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{children:e.subject||e.gist}),(0,x.jsxs)(`div`,{className:`reasons__detail`,children:[[e.date,fv[e.kind],e.fromName||e.from].filter(Boolean).join(` · `),e.gist&&e.subject?` · ${e.gist}`:``]})]}),(0,x.jsx)(`div`,{className:`pager__buttons`,children:(0,x.jsx)(B,{asChild:!0,size:`sm`,variant:`ghost`,tone:`neutral`,children:(0,x.jsx)(`a`,{href:e.link,target:`_blank`,rel:`noreferrer`,children:`Open in Gmail ↗`})})})]},e.id))}),(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{asChild:!0,variant:`soft`,children:(0,x.jsx)(`a`,{href:e.link,target:`_blank`,rel:`noreferrer`,children:`Open in Gmail ↗`})}),s&&(0,x.jsx)(B,{tone:`primary`,disabled:n===e.id,onClick:()=>a(e,`confirm`),children:e.noteId?e.suggestion.action===`record`?`Record`:`Mark ${e.suggestion.status}`:`Create and mark`}),s&&(0,x.jsx)(B,{variant:`ghost`,disabled:n===e.id,onClick:()=>a(e,`dismiss`),children:`Dismiss`})]})]})})})}var yv=`Use the tekjobs MCP server. Call onboarding_status, then onboarding_materials, and follow its script: interview me, write my profile, positioning and voice notes with save_profile, set the criteria with set_criteria, run a dry scan, and show me the top matches.`;function bv({onDone:e,onNavigate:t}){let[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(!1),u=()=>$.onboarding().then(e=>{r(e),e.steps.some(e=>e.id===`profile`&&e.done)&&$.learned().then(a).catch(()=>a(null))}).catch(e=>X({title:`Server not answering`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{u()},[]);let d=async()=>{l(!0);try{let e=await $.initProfile();X({title:`Profile folder ready`,description:e.made.length?`Created ${e.made.join(`, `)}`:`It already existed; nothing was overwritten.`,tone:`success`}),await u()}catch(e){X({title:`Could not create the folder`,description:e.message,tone:`danger`})}l(!1)},f=async()=>{if(o.trim()){l(!0);try{X({title:`Resume imported`,description:`${(await $.importResume(o.trim())).chars.toLocaleString()} characters of text extracted.`,tone:`success`}),s(``),await u()}catch(e){X({title:`Import failed`,description:e.message,tone:`danger`})}l(!1)}};if(!n)return(0,x.jsx)(zg,{variant:`rect`,height:`20rem`});let p=n.steps.filter(e=>e.done).length,m=n.writing.filter(e=>e.done).length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`Five steps from an empty folder to a daily scan that knows who you are, then three notes the application drafts read. Your profile lives at `,(0,x.jsx)(`code`,{children:n.dir}),`. The scan and the notes stay on this machine; the interview and the drafting send what you choose to the AI client you connect.`]})}),(0,x.jsx)(z,{tone:n.complete?`success`:`primary`,size:`sm`,children:n.complete?`Search ready`:`Search: ${p} of ${n.steps.length}`})]}),(0,x.jsx)(`div`,{className:`steps`,children:n.steps.map((e,t)=>(0,x.jsx)(V,{padding:`md`,variant:e.done?`sunken`:`outlined`,children:(0,x.jsxs)(`div`,{className:`step`,children:[(0,x.jsx)(`div`,{className:`step__mark`,children:e.done?(0,x.jsx)(H.Success,{}):(0,x.jsx)(`span`,{className:`step__n`,children:t+1})}),(0,x.jsxs)(`div`,{className:`step__body`,children:[(0,x.jsx)(`span`,{className:`step__label`,children:e.label}),!e.done&&(0,x.jsx)(`p`,{className:`muted`,children:e.how}),!e.done&&e.id===`folder`&&(0,x.jsx)(`div`,{className:`form__actions form__actions--start`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,loading:c,onClick:d,children:`Create the profile folder`})}),!e.done&&e.id===`resume`&&(0,x.jsxs)(`div`,{className:`step__row`,children:[(0,x.jsx)(Zp,{size:`sm`,label:`Path to your resume`,placeholder:`C:\\Users\\you\\Downloads\\resume.pdf`,description:`PDF, DOCX, Markdown or text. The file is copied into Profile/ and its text extracted.`,value:o,onChange:e=>s(e.target.value)}),(0,x.jsx)(B,{tone:`primary`,size:`sm`,loading:c,disabled:!o.trim(),onClick:f,children:`Import`})]}),!e.done&&e.id===`profile`&&(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsxs)(`p`,{className:`muted`,children:[`The interview runs in your own AI client, not here. Connect the server once (`,(0,x.jsx)(`code`,{className:`mono`,children:`claude mcp add tekjobs -- tekjobs mcp`}),`; from a clone, opening Claude Code in `,(0,x.jsx)(`code`,{className:`mono`,children:`app/`}),` does it) and paste:`]}),(0,x.jsx)(ag,{code:yv,language:`text`,wrap:!0}),(0,x.jsx)(`p`,{className:`muted`,children:`Codex, Cursor or Claude Desktop work the same way once the tekjobs MCP server is added; see Agent access.`})]}),!e.done&&e.id===`scan`&&(0,x.jsx)(`div`,{className:`form__actions form__actions--start`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,onClick:()=>{$.startScan(!1).then(()=>X({title:`Scan started`,description:`Watch it on the Runs screen.`,tone:`success`})).catch(e=>X({title:`Could not start`,description:e.message,tone:`danger`}))},children:`Run the first scan`})})]})]})},e.id))}),i&&i.ready&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`What TekJobs learned`}),(0,x.jsx)(`p`,{className:`muted`,children:`From your resume and the interview, in your terms. The scan runs on exactly this; if a line is wrong, change it on the Profile or Criteria page, or ask your AI client to.`})]}),(0,x.jsxs)(`div`,{className:`hero__actions`,children:[t&&(0,x.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>t(`profile`),children:`Profile`}),t&&(0,x.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>t(`criteria`),children:`Criteria`})]})]}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`learned`,children:[(0,x.jsxs)(`div`,{className:`learned__item`,children:[(0,x.jsx)(`span`,{className:`learned__label`,children:`Roles`}),(0,x.jsxs)(`ul`,{className:`learned__list`,children:[i.roles.map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(z,{size:`sm`,tone:e.tier===`A`?`primary`:`neutral`,variant:`soft`,children:e.tier}),` `,e.title,e.term?(0,x.jsxs)(`small`,{className:`muted`,children:[` · found by "`,e.term,`"`]}):(0,x.jsx)(`small`,{className:`learned__warn`,children:` · no title term finds this`})]},`${e.tier}-${e.title}`)),i.roles.length===0&&(0,x.jsx)(`li`,{className:`muted`,children:`No target roles in the profile yet.`})]}),(0,x.jsxs)(`p`,{className:`muted learned__fine`,children:[`Title terms, strongest first: `,i.titleTerms.map(e=>e.term).join(`, `)||`none`,`.`]})]}),(0,x.jsxs)(`div`,{className:`learned__item`,children:[(0,x.jsx)(`span`,{className:`learned__label`,children:`Where`}),(0,x.jsx)(`p`,{children:i.where.profile||`Not stated in the profile.`}),(0,x.jsxs)(`p`,{className:`muted learned__fine`,children:[`The scan: `,i.where.requireRemote?`remote only; anything else drops out`:`remote scores higher; on-site and hybrid stay in`,i.where.metro.length?`, with a bonus for ${i.where.metro.join(`, `)}`:``,`.`]})]}),(0,x.jsxs)(`div`,{className:`learned__item`,children:[(0,x.jsx)(`span`,{className:`learned__label`,children:`Pay`}),(0,x.jsx)(`p`,{children:i.pay.floor?(0,x.jsxs)(x.Fragment,{children:[`Floor `,(0,x.jsxs)(`span`,{className:`num`,children:[`$`,Math.round(i.pay.floor/1e3),`k`]}),i.pay.stretch?(0,x.jsxs)(x.Fragment,{children:[`, would still look down to `,(0,x.jsxs)(`span`,{className:`num`,children:[`$`,Math.round(i.pay.stretch/1e3),`k`]})]}):null,`.`]}):`No floor set; pay does not move the score.`}),i.pay.profile&&(0,x.jsxs)(`p`,{className:`muted learned__fine`,children:[`Profile says: `,i.pay.profile]})]}),(0,x.jsxs)(`div`,{className:`learned__item`,children:[(0,x.jsx)(`span`,{className:`learned__label`,children:`Never`}),(0,x.jsxs)(`p`,{children:[i.exclusions.companies.length?(0,x.jsxs)(x.Fragment,{children:[`Companies matching `,(0,x.jsx)(`span`,{className:`mono`,children:i.exclusions.companies.join(`, `)}),`. `]}):null,i.exclusions.titles.length,` excluded title words`,i.exclusions.titles.length?`, such as ${i.exclusions.titles.slice(0,6).join(`, `)}`:``,`.`]}),i.exclusions.industries&&(0,x.jsxs)(`p`,{className:`muted learned__fine`,children:[`Profile says: `,i.exclusions.industries]})]}),(0,x.jsxs)(`div`,{className:`learned__item`,children:[(0,x.jsx)(`span`,{className:`learned__label`,children:`What letters will lean on`}),(0,x.jsxs)(`ul`,{className:`learned__list`,children:[i.proofPoints.map(e=>(0,x.jsx)(`li`,{children:e},e)),i.proofPoints.length===0&&(0,x.jsx)(`li`,{className:`muted`,children:`No proof points yet; letters fall back to the resume.`})]}),i.keywords.length>0&&(0,x.jsxs)(`p`,{className:`muted learned__fine`,children:[`Keywords the description score reads: `,i.keywords.join(`, `),`.`]})]}),(0,x.jsxs)(`div`,{className:`learned__item`,children:[(0,x.jsx)(`span`,{className:`learned__label`,children:`What remains`}),i.remaining.length===0?(0,x.jsx)(`p`,{children:`Nothing. Search ready and writing ready.`}):(0,x.jsx)(`ul`,{className:`learned__list`,children:i.remaining.map(e=>(0,x.jsx)(`li`,{children:e},e))})]})]})})]}),(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Application writing`}),(0,x.jsx)(`p`,{className:`muted`,children:`What a tailored resume or a letter is allowed to say comes from these three notes. The interview writes the last two; the import creates the first. Until they exist, drafts fall back to the imported resume text and the Profile page says what is missing.`})]}),(0,x.jsx)(z,{tone:n.writingReady?`success`:`neutral`,size:`sm`,children:n.writingReady?`Writing ready`:`Writing: ${m} of ${n.writing.length}`})]}),(0,x.jsx)(`div`,{className:`steps`,children:n.writing.map(e=>(0,x.jsx)(V,{padding:`md`,variant:e.done?`sunken`:`outlined`,children:(0,x.jsxs)(`div`,{className:`step`,children:[(0,x.jsx)(`div`,{className:`step__mark`,children:e.done?(0,x.jsx)(H.Success,{}):(0,x.jsx)(`span`,{className:`step__n`,children:`·`})}),(0,x.jsxs)(`div`,{className:`step__body`,children:[(0,x.jsx)(`span`,{className:`step__label`,children:e.label}),!e.done&&(0,x.jsx)(`p`,{className:`muted`,children:e.how})]})]})},e.id))}),n.complete&&(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,onClick:e,trailingIcon:(0,x.jsx)(H.ArrowRight,{}),children:`Go to the overview`})})]})}function xv({label:e,value:t,hint:n,tone:r=`neutral`,series:i,onClick:a}){return(0,x.jsx)(V,{padding:`md`,interactive:!!a,onClick:a,children:(0,x.jsxs)(`div`,{className:`stat`,children:[(0,x.jsx)(`span`,{className:`stat__label`,children:e}),(0,x.jsxs)(`div`,{className:`stat__row`,children:[(0,x.jsx)(`span`,{className:`stat__value`,children:t}),i&&i.length>1&&(0,x.jsx)(`div`,{className:`stat__spark`,children:(0,x.jsx)(Cp,{values:i,tone:r===`neutral`?`primary`:r,"aria-label":`${e}, per scan`})})]}),n&&(0,x.jsx)(`div`,{className:`stat__delta`,children:(0,x.jsx)(z,{tone:r,size:`sm`,children:n})})]})})}var Sv=e=>e===null?`—`:`${Math.round(e*100)}%`,Cv={found:`Found`,reviewed:`Reviewed`,shortlisted:`Shortlisted`,applied:`Applied`,interviewing:`Interviewing`,offer:`Offer`},wv={"design-eng":`Design engineering`,adjacent:`Adjacent titles`};function Tv({onNavigate:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(``);if((0,b.useEffect)(()=>{$.summary().then(n).catch(e=>o(e.message)),$.outcomes().then(i).catch(()=>{})},[]),a)return(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`p`,{className:`muted`,children:[`The server is not answering: `,a,`. Start it with `,(0,x.jsx)(`code`,{children:`npm run server`}),`.`]})});if(!t||!r)return(0,x.jsx)(zg,{variant:`rect`,height:`12rem`});let s=[`floor`,`stretch`,`below`,`unknown`],c=[`new`,`reviewing`,`applying`,`applied`,`interviewing`,`offer`,`rejected`,`passed`],l=r.waiting.buckets[14]??0,u=r.thisWeek.followUps.filter(e=>e.inDays<=0).length,d=r.appliedPerWeek;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[(0,x.jsx)(`b`,{children:r.funnel.applied}),` applied, `,(0,x.jsx)(`b`,{children:Sv(r.responseRate)}),` answered, `,(0,x.jsx)(`b`,{children:r.funnel.interviewing}),` interviewing`,l?(0,x.jsxs)(x.Fragment,{children:[`, `,(0,x.jsx)(`b`,{children:l}),` waiting two weeks or more`]}):null,`.`,` `,`The inventory: `,t.open,` open matches across `,t.companies,` boards, floor `,t.floor?Jg(t.floor):`unset`,`, bar `,t.minScore??`unset`,`.`]})}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,onClick:()=>e(`runs`),children:`Runs`})]}),(0,x.jsxs)(`div`,{className:`stats z-stagger`,children:[(0,x.jsx)(xv,{label:`Applied`,value:String(r.funnel.applied),hint:`${r.funnel.shortlisted} shortlisted, ${r.funnel.reviewed} reviewed`,tone:`primary`,onClick:()=>e(`pipeline`)}),(0,x.jsx)(xv,{label:`Response rate`,value:Sv(r.responseRate),hint:r.funnel.applied?`${r.responded} of ${r.funnel.applied} answered, interview or no`:`nothing applied to yet`,tone:r.responseRate&&r.responseRate>0?`success`:`neutral`}),(0,x.jsx)(xv,{label:`Waiting 14 days or more`,value:String(l),hint:`${r.waiting.buckets[7]??0} past 7 days, ${r.waiting.buckets[21]??0} past 21`,tone:(r.waiting.buckets[21]??0)>0?`warning`:`neutral`}),(0,x.jsx)(xv,{label:`Discovery to application`,value:r.medianDaysToApply===null?`—`:`${r.medianDaysToApply}d`,hint:`median, found to applied`})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Funnel`}),(0,x.jsx)(`p`,{children:`Each stage counts everything that reached it, whatever happened after. The rate is the share of the stage before.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Application funnel`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Stage`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Jobs`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Of the stage before`}),(0,x.jsx)(Y.HeadCell,{children:`Share`})]})}),(0,x.jsx)(Y.Body,{children:r.stages.map((e,t)=>{let n=r.stages[0]?.count||1;return(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:Cv[e.stage]??e.stage}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.count}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(`span`,{className:e.rate===null?`muted`:``,children:t===0?`—`:Sv(e.rate)})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`div`,{className:`funnel__bar`,role:`presentation`,children:(0,x.jsx)(`span`,{style:{width:`${Math.max(e.count?2:0,Math.round(e.count/n*100))}%`}})})})]},e.stage)})})]}),(0,x.jsxs)(`p`,{className:`muted panel--pad`,children:[r.passed,` passed on, `,r.rejected,` rejected.`]})]}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`This week`}),(0,x.jsxs)(`p`,{children:[`Follow-ups due in the next seven days`,u?`, ${u} already past`:``,`, and the interviews in progress. Dates come from each note's packet.`]})]})})}),(0,x.jsxs)(Y,{"aria-label":`This week`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{align:`end`,children:`When`})]})}),(0,x.jsxs)(Y.Body,{children:[r.thisWeek.followUps.map(t=>(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>e(`jobs`,t.company),children:[(0,x.jsx)(Y.Cell,{children:t.company}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`clamp`,children:t.title})}),(0,x.jsx)(Y.Cell,{align:`end`,children:(0,x.jsx)(z,{size:`sm`,tone:t.inDays<0?`danger`:t.inDays===0?`warning`:`neutral`,children:t.inDays<0?`follow up, ${-t.inDays}d late`:t.inDays===0?`follow up today`:`follow up in ${t.inDays}d`})})]},t.id)),r.thisWeek.interviewing.map(t=>(0,x.jsxs)(Y.Row,{interactive:!0,onClick:()=>e(`jobs`,t.company),children:[(0,x.jsx)(Y.Cell,{children:t.company}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`clamp`,children:t.title})}),(0,x.jsx)(Y.Cell,{align:`end`,children:(0,x.jsx)(z,{size:`sm`,tone:`primary`,children:`interviewing`})})]},t.id)),r.thisWeek.followUps.length===0&&r.thisWeek.interviewing.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:3,children:(0,x.jsx)(`span`,{className:`muted`,children:`Nothing due this week. Applied roles get a follow-up date in their packet when you mark them applied.`})})})]})]})]})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Applications per week`}),(0,x.jsx)(`p`,{children:`Sent, by the week of the packet's Applied on date.`})]})}),d.length>0?(0,x.jsx)(Ye,{series:[{name:`Applied`,values:d.map(e=>e.n)}],labels:d.map(e=>e.week.slice(5)),height:180,"aria-label":`Applications per week`}):(0,x.jsx)(`p`,{className:`muted`,children:`Nothing applied to yet.`})]})}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`What answers`}),(0,x.jsx)(`p`,{children:`By role family, then by the board that surfaced the job.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Outcomes by role family`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Role family`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Found`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Applied`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Answered`})]})}),(0,x.jsx)(Y.Body,{children:r.byKind.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:wv[e.kind]??e.kind}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.found}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.applied}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.applied?`${e.responded} (${Sv(e.responded/e.applied)})`:`—`})]},e.kind))})]}),r.bySource.length>0&&(0,x.jsx)(`div`,{className:`chips panel--pad`,children:r.bySource.map(e=>(0,x.jsxs)(z,{size:`sm`,tone:e.responded?`success`:`neutral`,variant:`soft`,children:[e.source,`: `,e.applied,` applied`,e.responded?`, ${e.responded} answered`:``]},e.source))})]})]}),(0,x.jsxs)(`div`,{className:`stats z-stagger`,children:[(0,x.jsx)(xv,{label:`Open matches`,value:String(t.open),hint:`${t.byStatus.new??0} unreviewed`,onClick:()=>e(`jobs`)}),(0,x.jsx)(xv,{label:`Design-engineer roles at the floor`,value:String(t.designEng.floor),hint:`of ${t.designEng.total} with the title`,tone:`success`,onClick:()=>e(`jobs`)}),(0,x.jsx)(xv,{label:`Pay under the floor, above the stretch line`,value:String(t.byBand.stretch??0),hint:`${t.designEng.stretch} design-engineer`,tone:`warning`}),(0,x.jsx)(xv,{label:`Active applications`,value:String(t.active),hint:t.active?`in flight`:`none yet`,tone:t.active?`primary`:`neutral`,onClick:()=>e(`pipeline`)})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Pipeline`}),(0,x.jsx)(`p`,{children:`Every open note by status. Change a status in Jobs or Pipeline; the note is the record.`})]})}),(0,x.jsx)(Ye,{series:[{name:`Jobs`,values:c.map(e=>t.byStatus[e]??0)}],labels:[...c],height:200,"aria-label":`Jobs by status`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Stated pay against the floor`}),(0,x.jsx)(`p`,{children:`Open matches by band.`})]})}),(0,x.jsx)(Ye,{series:[{name:`Matches`,values:s.map(e=>t.byBand[e]??0)}],labels:[`Floor`,`Stretch`,`Below`,`Not stated`],height:200,"aria-label":`Matches by pay band`})]})})]})]})}function Ev({onNavigate:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),d=e_(`(max-width: 52rem)`),f=()=>$.today().then(n).catch(e=>i(e.message));(0,b.useEffect)(()=>{f(),$.learned().then(u).catch(()=>u(null))},[]);let p=async(e,t,n)=>{c(e.id);try{await $.setStatus(e.id,t,n),X({title:`${e.company}: ${t===`reviewing`?`shortlisted`:`passed`}`,description:n,tone:t===`reviewing`?`success`:`neutral`}),await f()}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}finally{c(null)}},m=e=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:s===e.id,onClick:()=>p(e,`reviewing`),children:`Shortlist`}),(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,disabled:s===e.id,trailingIcon:(0,x.jsx)(H.ChevronDown,{}),children:`Pass`})}),(0,x.jsx)(Tu.Content,{align:`end`,children:Kg.map(t=>(0,x.jsx)(Tu.Item,{onSelect:()=>p(e,`passed`,t),children:t},t))})]})]}),h=e=>e.salaryMax>0?(0,x.jsx)(z,{tone:Qg[e.payBand],size:`sm`,children:Yg(e.salary)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`});if(r)return(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`p`,{className:`muted`,children:[`The server is not answering: `,r,`. Start it with `,(0,x.jsx)(`code`,{children:`tekjobs up`}),`.`]})});if(!t)return(0,x.jsx)(zg,{variant:`rect`,height:`18rem`});let{counts:g,sections:_}=t,v=[..._.preparing,..._.followUps,..._.interviewing];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h1`,{className:`today__date`,children:new Date().toLocaleDateString(`en-US`,{weekday:`long`,day:`numeric`,month:`long`})}),(0,x.jsx)(`p`,{children:_.triage.length===0?`Today's queue is clear. The next scan refills it.`:`${_.triage.length===1?`One`:_.triage.length} to decide on, best fit first. The other ${g.unreviewed-_.triage.length} unreviewed wait in Jobs and do not count against you. Fit is the share of the ${t.ceiling} points this criteria set can award.`}),l&&l.ready&&_.triage.length>0&&(0,x.jsxs)(`p`,{className:`muted`,children:[`They are here because they match your titles (`,l.titleTerms.slice(0,3).map(e=>e.term).join(`, `),`), `,l.where.requireRemote?`your remote-only rule`:`remote scoring higher`,l.pay.floor?`, and your $${Math.round(l.pay.floor/1e3)}k floor`:``,`.`]})]}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,onClick:()=>e(`jobs`),children:`See all matches`})]}),(0,x.jsxs)(`div`,{className:`today__figures`,children:[(0,x.jsxs)(`div`,{className:`today__figure`,children:[(0,x.jsx)(`b`,{children:g.open}),(0,x.jsx)(`small`,{children:`open`})]}),(0,x.jsxs)(`div`,{className:`today__figure`,children:[(0,x.jsx)(`b`,{children:g.aging}),(0,x.jsx)(`small`,{children:`waiting 2d+`})]}),(0,x.jsxs)(`div`,{className:`today__figure`,children:[(0,x.jsx)(`b`,{"data-tone":g.closedUnreviewed>0?`danger`:void 0,children:g.closedUnreviewed}),(0,x.jsx)(`small`,{children:`closed unseen`})]})]}),(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsxs)(`div`,{className:`today__section-head`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Decide on these`}),(0,x.jsx)(`span`,{className:`today__hint`,children:`shortlist · pass · open sheet`})]}),_.triage.length===0?(0,x.jsx)(V,{padding:`md`,children:(0,x.jsx)(Vg,{size:`sm`,title:`Inbox clear`,description:`Nothing unreviewed is open right now. The next scan will refill this.`})}):d?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`Matches to decide on`,children:_.triage.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(Av,{value:e.fit}),meta:Xg(e.found),badges:e.salaryMax>0?h(e):null,actions:m(e),onOpen:()=>o(e.id)},e.id))}):(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Matches to decide on`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Fit`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Pay`}),(0,x.jsx)(Y.HeadCell,{children:`Found`}),(0,x.jsx)(Y.HeadCell,{children:`Decide`})]})}),(0,x.jsx)(Y.Body,{children:_.triage.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,selected:a===e.id,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(Av,{value:e.fit})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`who__text`,children:[e.title,e.kind===`design-eng`&&(0,x.jsx)(`small`,{children:`design engineering`})]})}),(0,x.jsx)(Y.Cell,{children:e.salaryMax>0?(0,x.jsx)(z,{tone:Qg[e.payBand],size:`sm`,children:Yg(e.salary)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:Xg(e.found)})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`div`,{className:`today__actions`,onClick:e=>e.stopPropagation(),children:m(e)})})]},e.id))})]})})]}),(0,x.jsx)(hv,{onOpen:()=>e(`mail`)}),_.started.length>0&&(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Already started`}),d?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`Applications with a packet started`,children:_.started.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(Av,{value:e.fit}),badges:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(z,{size:`sm`,tone:`primary`,variant:`soft`,children:[e.packet,` filled`]}),e.salaryMax>0&&h(e),e.closed?(0,x.jsxs)(z,{size:`sm`,tone:`danger`,children:[`closed `,e.closed]}):(0,x.jsx)(z,{size:`sm`,tone:e.status===`ready`?`warning`:`neutral`,children:e.status})]}),onOpen:()=>o(e.id)},e.id))}):(0,x.jsx)(V,{padding:`none`,children:(0,x.jsxs)(Y,{"aria-label":`Applications with a packet started`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Fit`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Packet`}),(0,x.jsx)(Y.HeadCell,{children:`Pay`}),(0,x.jsx)(Y.HeadCell,{children:`Status`})]})}),(0,x.jsx)(Y.Body,{children:_.started.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,selected:a===e.id,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(Av,{value:e.fit})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(z,{size:`sm`,tone:`primary`,variant:`soft`,children:[e.packet,` filled`]})}),(0,x.jsx)(Y.Cell,{children:e.salaryMax>0?(0,x.jsx)(z,{tone:Qg[e.payBand],size:`sm`,children:Yg(e.salary)}):(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:e.closed?(0,x.jsxs)(z,{size:`sm`,tone:`danger`,children:[`closed `,e.closed]}):(0,x.jsx)(z,{size:`sm`,tone:e.status===`ready`?`warning`:`neutral`,children:e.status})})]},e.id))})]})}),(0,x.jsx)(`p`,{className:`muted`,children:`Work you have already put in, wherever it ranks. The fit score knows nothing about a drafted packet, so these would otherwise fall off the bottom of the queue.`})]}),(_.aging.length>0||_.missed.length>0)&&(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Going, and gone`}),(0,x.jsxs)(`div`,{className:`today__cols`,children:[_.aging.length>0&&(0,x.jsxs)(V,{padding:`md`,children:[(0,x.jsx)(`h3`,{className:`today__subheading`,children:`Still open, still unread`}),(0,x.jsx)(`p`,{className:`muted`,children:`Listings here close after two days, at the median.`}),(0,x.jsx)(`ul`,{className:`today__list`,children:_.aging.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsxs)(B,{className:`today__row`,variant:`ghost`,align:`start`,size:`sm`,onClick:()=>o(e.id),children:[(0,x.jsx)(Av,{value:e.fit}),(0,x.jsx)(`span`,{className:`today__row-text`,children:Dv(e.company,e.title,52)}),(0,x.jsxs)(z,{size:`sm`,tone:(e.days??0)>=5?`danger`:`warning`,variant:`outline`,children:[e.days,`d`]})]})},e.id))})]}),_.missed.length>0&&(0,x.jsxs)(V,{padding:`md`,children:[(0,x.jsx)(`h3`,{className:`today__subheading`,children:`Closed before you saw them`}),(0,x.jsxs)(`p`,{className:`muted`,children:[g.closedUnreviewed,` this week. This is what the queue costs when it is skipped.`]}),(0,x.jsx)(`ul`,{className:`today__list`,children:_.missed.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsxs)(B,{className:`today__row`,variant:`ghost`,align:`start`,size:`sm`,onClick:()=>o(e.id),children:[(0,x.jsx)(Av,{value:e.fit}),(0,x.jsx)(`span`,{className:`today__row-text`,children:Dv(e.company,e.title,36)}),(0,x.jsx)(`span`,{className:`muted`,children:e.closed})]})},e.id))})]})]})]}),(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`In flight`}),(0,x.jsx)(V,{padding:v.length&&!d?`none`:`md`,children:v.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`Nothing in flight`,description:`Applications being prepared, follow-ups that are due, and interviews appear here once jobs move past Shortlisted.`,action:(0,x.jsx)(B,{size:`sm`,variant:`ghost`,onClick:()=>e(`pipeline`),children:`Open the pipeline`})}):d?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`In flight`,children:v.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(Av,{value:e.fit}),meta:e.due?`due ${e.due}`:void 0,badges:(0,x.jsx)(z,{size:`sm`,tone:`primary`,children:e.status}),foot:(0,x.jsx)(kv,{contact:e.contact}),onOpen:()=>o(e.id)},e.id))}):(0,x.jsxs)(Y,{"aria-label":`In flight`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Fit`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Status`}),(0,x.jsx)(Y.HeadCell,{children:`Due`}),(0,x.jsx)(Y.HeadCell,{children:`Write to`})]})}),(0,x.jsx)(Y.Body,{children:v.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(Av,{value:e.fit})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:`primary`,children:e.status})}),(0,x.jsx)(Y.Cell,{children:e.due||(0,x.jsx)(`span`,{className:`muted`,children:`—`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(kv,{contact:e.contact})})]},e.id))})]})})]}),(0,x.jsxs)(`section`,{className:`today__section`,children:[(0,x.jsxs)(`div`,{className:`today__section-head`,children:[(0,x.jsx)(`h2`,{className:`today__heading`,children:`Waiting on a reply`}),(0,x.jsxs)(`span`,{className:`today__hint`,children:[`applied `,g.waitingDays,`d+ ago, nothing back · `,g.waiting,` in all`]})]}),(0,x.jsx)(V,{padding:_.waiting.length===0||d?`md`:`none`,children:_.waiting.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`Nothing has gone quiet`,description:`Applications with no answer after ${g.waitingDays} days land here, with the person to ask.`}):d?(0,x.jsx)(`ul`,{className:`tcards`,"aria-label":`Applications waiting on a reply`,children:_.waiting.map(e=>(0,x.jsx)(Ov,{r:e,lead:(0,x.jsx)(z,{size:`sm`,tone:(e.days??0)>=21?`danger`:`neutral`,variant:`outline`,children:(0,x.jsxs)(`span`,{className:`num`,children:[e.days,`d`]})}),meta:e.appliedOn?`applied ${e.appliedOn}`:void 0,foot:(0,x.jsx)(kv,{contact:e.contact}),onOpen:()=>o(e.id)},e.id))}):(0,x.jsxs)(Y,{"aria-label":`Applications waiting on a reply`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Days`}),(0,x.jsx)(Y.HeadCell,{children:`Company`}),(0,x.jsx)(Y.HeadCell,{children:`Role`}),(0,x.jsx)(Y.HeadCell,{children:`Applied`}),(0,x.jsx)(Y.HeadCell,{children:`Write to`})]})}),(0,x.jsx)(Y.Body,{children:_.waiting.map(e=>(0,x.jsxs)(Y.Row,{interactive:!0,"data-posted":H_(e.source)||void 0,onClick:()=>o(e.id),children:[(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:(0,x.jsx)(`span`,{className:`num`,"data-tone":(e.days??0)>=21?`danger`:void 0,children:e.days})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:e.appliedOn})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(kv,{contact:e.contact})})]},e.id))})]})})]}),(0,x.jsx)(cv,{id:a,onClose:()=>o(null),onChanged:e=>{f()}})]})}var Dv=(e,t,n=64)=>{let r=`${e} — ${t}`.replace(/\s+/g,` `).trim();return r.length>n?`${r.slice(0,n-1).trimEnd()}…`:r};function Ov({r:e,lead:t,meta:n,badges:r,foot:i,actions:a,onOpen:o}){return(0,x.jsxs)(`li`,{className:`tcard`,"data-posted":H_(e.source)||void 0,children:[(0,x.jsxs)(`div`,{className:`tcard__head`,children:[t,(0,x.jsxs)(`span`,{className:`posted-co tcard__company`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]}),n&&(0,x.jsx)(`span`,{className:`muted tcard__meta`,children:n})]}),(0,x.jsxs)(`div`,{className:`tcard__title`,children:[e.title,e.kind===`design-eng`&&(0,x.jsx)(`small`,{children:`design engineering`})]}),(r||e.location)&&(0,x.jsxs)(`div`,{className:`tcard__badges`,children:[r,e.location&&(0,x.jsxs)(`span`,{className:`muted tcard__loc`,children:[e.remote?`remote · `:``,e.location]})]}),i&&(0,x.jsx)(`div`,{className:`tcard__foot`,children:i}),(0,x.jsxs)(`div`,{className:`tcard__actions`,children:[a,(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,onClick:o,trailingIcon:(0,x.jsx)(H.ArrowRight,{}),children:`Open`})]})]})}function kv({contact:e}){return e?(0,x.jsxs)(`span`,{className:`who__text`,children:[e.email?(0,x.jsxs)(`a`,{className:`people__thread`,href:`mailto:${e.email}`,onClick:e=>e.stopPropagation(),children:[e.name,` ↗`]}):e.name,(0,x.jsxs)(`small`,{children:[e.role||`contact`,e.others>0?` · +${e.others}`:``]})]}):(0,x.jsx)(`span`,{className:`muted`,title:`Open the sheet's People tab to add someone.`,children:`no one on the thread`})}function Av({value:e}){return(0,x.jsx)(z,{size:`sm`,tone:e>=80?`success`:e>=60?`primary`:`neutral`,variant:e>=60?`soft`:`outline`,children:(0,x.jsx)(`span`,{className:`num`,children:e})})}var jv=[{id:`reviewing`,title:`Reviewing`},{id:`applying`,title:`Applying`,limit:5},{id:`ready`,title:`Ready`,limit:5},{id:`applied`,title:`Applied`},{id:`interviewing`,title:`Interviewing`},{id:`offer`,title:`Offer`}],Mv=new Set(jv.map(e=>e.id));function Nv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)([]),o=()=>$.jobs({status:`all`,limit:2e3}).then(e=>t(e.rows)).catch(e=>X({title:`Could not load the board`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{o()},[]);let s=async(n,r)=>{let i=e?.find(e=>e.id===n);if(i&&i.status!==r){t(e=>e&&e.map(e=>e.id===n?{...e,status:r}:e));try{await $.setStatus(n,r),X({title:`${i.company}: ${r}`,tone:`success`})}catch(e){X({title:`Move not saved`,description:e.message,tone:`danger`}),o()}}},c=e=>t(t=>t&&t.map(t=>t.id===e.id?{...t,status:e.status}:t)),l=(0,b.useMemo)(()=>{let t=new Map;for(let n of e??[])Mv.has(n.status)&&t.set(n.company,(t.get(n.company)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({value:e,label:e,hint:`${t} on the board`}))},[e]);if(!e)return(0,x.jsx)(zg,{variant:`rect`,height:`20rem`});let u=new Set(i),d=e.filter(e=>Mv.has(e.status)&&(u.size===0||u.has(e.company))).sort((e,t)=>t.score-e.score),f=e.filter(e=>e.status===`new`).length,p=e.filter(e=>e.status===`rejected`||e.status===`passed`).length;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`page__head`,children:(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`Committed work only. Drag a card, or focus one and press Space to lift it, arrows to move it, Enter to drop. Every move is written to the job note.`,f?` ${f} new matches wait on Today, not here.`:``,p?` ${p} closed are not shown.`:``]})})}),(0,x.jsx)(`div`,{className:`toolbar`,children:(0,x.jsx)(Wg,{className:`toolbar__filter toolbar__filter--wide`,size:`sm`,multiple:!0,label:`Companies`,placeholder:i.length?``:`All companies`,description:`Narrow the board to the companies you are actually working.`,emptyMessage:`No company on the board matches that.`,options:l,value:i,onValueChange:a})}),(0,x.jsx)(Hg,{label:`Job pipeline`,columns:jv,cards:d,cardId:e=>e.id,cardColumn:e=>e.status,cardLabel:e=>`${e.title} at ${e.company}`,onMove:e=>s(e.cardId,e.to),renderCard:e=>(0,x.jsxs)(`div`,{className:`kcard`,"data-posted":H_(e.source)||void 0,onClick:()=>r(e.id),children:[(0,x.jsxs)(`div`,{className:`kcard__head`,children:[(0,x.jsxs)(`span`,{className:`kcard__company posted-co`,children:[e.company,H_(e.source)&&(0,x.jsx)(U_,{})]}),(0,x.jsxs)(Tu,{children:[(0,x.jsx)(Tu.Trigger,{asChild:!0,children:(0,x.jsx)(B,{variant:`ghost`,size:`sm`,"aria-label":`Move ${e.title}`,leadingIcon:(0,x.jsx)(H.More,{}),onClick:e=>e.stopPropagation()})}),(0,x.jsx)(Tu.Content,{align:`end`,onClick:e=>e.stopPropagation(),children:Gg.filter(t=>t!==e.status).map(t=>(0,x.jsxs)(Tu.Item,{onSelect:()=>s(e.id,t),children:[`Move to `,t]},t))})]})]}),(0,x.jsx)(`span`,{className:`kcard__title`,children:e.title}),(0,x.jsxs)(`div`,{className:`kcard__meta num`,children:[(0,x.jsx)(`span`,{className:`kcard__score`,children:e.score}),e.salaryMax>0&&(0,x.jsx)(`span`,{className:e.payBand===`floor`?`kcard__pay kcard__pay--floor`:`kcard__pay`,children:Yg(e.salary)})]})]})}),(0,x.jsx)(cv,{id:n,onClose:()=>r(null),onChanged:c})]})}var Pv={ok:`success`,warn:`warning`,missing:`danger`,info:`neutral`};function Fv({s:e}){return(0,x.jsxs)(`div`,{className:`detail`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:e.basics.name||`No name yet`}),(0,x.jsx)(`p`,{children:[e.basics.currentRole,e.basics.location].filter(Boolean).join(` · `)||`The Basics section is empty.`})]}),(0,x.jsxs)(`div`,{className:`chips`,children:[(0,x.jsx)(z,{size:`sm`,tone:e.status===`draft`?`warning`:`success`,children:e.status===`draft`?`draft`:`reviewed`}),e.updated&&(0,x.jsxs)(z,{size:`sm`,tone:`neutral`,variant:`outline`,children:[`updated `,e.updated]})]})]}),e.summary?(0,x.jsx)(`p`,{children:e.summary}):(0,x.jsx)(`p`,{className:`muted`,children:`The three-sentence summary is still the template. It leads every cover letter.`}),(e.basics.email||e.basics.links.length>0)&&(0,x.jsx)(`p`,{className:`muted mono`,children:[e.basics.email,...e.basics.links].filter(Boolean).join(` · `)})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Needs attention`}),(0,x.jsx)(`p`,{children:`What a reader of these notes would trip on. Each line names the note to fix.`})]}),(0,x.jsx)(z,{size:`sm`,tone:e.attention.length?`warning`:`success`,children:e.attention.length?`${e.attention.length} item${e.attention.length===1?``:`s`}`:`nothing stale`})]}),e.attention.length>0?(0,x.jsx)(`ul`,{className:`summary__list`,children:e.attention.map(e=>(0,x.jsxs)(`li`,{children:[(0,x.jsx)(z,{size:`sm`,tone:Pv[e.level],variant:`soft`,children:e.note}),` `,e.text]},e.text))}):(0,x.jsx)(`p`,{className:`muted`,children:`Every field is filled, the resume of record is fresh, and the criteria agree with the profile.`})]})}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Target roles`}),(0,x.jsx)(`p`,{children:`From the profile's table. "In criteria" means a title term the scan scores on matches the title; a title without one is never found by the scan.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Target roles`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Tier`}),(0,x.jsx)(Y.HeadCell,{children:`Title`}),(0,x.jsx)(Y.HeadCell,{children:`In criteria`})]})}),(0,x.jsxs)(Y.Body,{children:[e.targets.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:e.tier===`A`?`primary`:`neutral`,children:e.tier})}),(0,x.jsx)(Y.Cell,{children:e.title}),(0,x.jsx)(Y.Cell,{children:e.term?(0,x.jsxs)(`span`,{className:`muted`,children:[`yes · `,(0,x.jsx)(`span`,{className:`mono`,children:e.term})]}):(0,x.jsx)(z,{size:`sm`,tone:`warning`,variant:`soft`,children:`no title term`})})]},`${e.tier}-${e.title}`)),e.targets.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:3,children:(0,x.jsx)(`span`,{className:`muted`,children:`The Target roles table is empty.`})})})]})]})]}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Constraints against the criteria`}),(0,x.jsx)(`p`,{children:`What the profile says beside what the scan enforces.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Constraints against the criteria`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Constraint`}),(0,x.jsx)(Y.HeadCell,{children:`Profile`}),(0,x.jsx)(Y.HeadCell,{children:`Criteria`}),(0,x.jsx)(Y.HeadCell,{})]})}),(0,x.jsx)(Y.Body,{children:e.constraints.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:e.label}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:e.profile?``:`muted`,children:e.profile||`not set`})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:e.criteria?`num`:`muted`,children:e.criteria||`—`})}),(0,x.jsx)(Y.Cell,{children:e.level!==`info`&&(0,x.jsx)(z,{size:`sm`,tone:Pv[e.level],variant:`soft`,children:e.level===`ok`?`agree`:e.level===`warn`?`differ`:`missing`})})]},e.label))})]})]})]}),(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Documents`}),(0,x.jsx)(`p`,{children:`The notes and files the drafts are built from, and how fresh each one is.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`Documents`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Document`}),(0,x.jsx)(Y.HeadCell,{children:`State`}),(0,x.jsx)(Y.HeadCell,{children:`Where`})]})}),(0,x.jsx)(Y.Body,{children:e.documents.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:e.label}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(z,{size:`sm`,tone:Pv[e.level],variant:`soft`,children:e.state})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted mono`,children:e.where})})]},e.label))})]})]}),(0,x.jsxs)(V,{padding:`none`,children:[(0,x.jsx)(`div`,{className:`panel panel--pad`,children:(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`What feeds what`}),(0,x.jsx)(`p`,{children:`Which note each thing the app writes is built from. Change the note, and everything after it changes.`})]})})}),(0,x.jsxs)(Y,{"aria-label":`What feeds what`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Produces`}),(0,x.jsx)(Y.HeadCell,{children:`Reads`})]})}),(0,x.jsx)(Y.Body,{children:e.feeds.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:e.produces}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:e.reads})})]},e.produces))})]})]})]}),e.proofPoints.length>0&&(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Proof points`}),(0,x.jsxs)(`p`,{children:[e.proofPoints.length,` on file; the ones without a number are flagged above. Cover letters quote from these and nothing else.`]})]})}),(0,x.jsx)(`ul`,{className:`summary__list`,children:e.proofPoints.map(e=>(0,x.jsxs)(`li`,{children:[e.hasNumber?null:(0,x.jsx)(z,{size:`sm`,tone:`warning`,variant:`soft`,children:`no number`}),` `,e.text]},e.text))})]})})]})}var Iv=e=>e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``);function Lv({note:e,onSaved:t}){let[n,r]=(0,b.useState)(e.markdown),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(e.editable?`edit`:`preview`);(0,b.useEffect)(()=>r(e.markdown),[e.markdown]);let c=n!==e.markdown;return(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{children:e.hint}),(0,x.jsx)(`p`,{className:`muted`,children:(0,x.jsx)(`code`,{children:e.path})})]}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsx)(Z,{value:o,onValueChange:e=>s(e),variant:`pill`,size:`sm`,children:(0,x.jsxs)(Z.List,{"aria-label":`Edit or preview`,children:[(0,x.jsx)(Z.Trigger,{value:`edit`,children:e.editable?`Edit`:`Source`}),(0,x.jsx)(Z.Trigger,{value:`preview`,children:`Preview`})]})}),(0,x.jsx)(B,{asChild:!0,variant:`soft`,size:`sm`,trailingIcon:(0,x.jsx)(H.ExternalLink,{}),children:(0,x.jsx)(`a`,{href:`obsidian://open?path=${encodeURIComponent(e.path)}`,children:`Open in Obsidian`})})]})]}),!e.exists&&(0,x.jsx)(z,{tone:`warning`,size:`sm`,children:`This note does not exist yet; saving creates it.`}),o===`preview`?(0,x.jsx)(`div`,{className:`preview-doc`,children:(0,x.jsx)(dg,{text:Iv(n)||`_Nothing here yet._`})}):(0,x.jsx)(Xp,{label:`${e.title} (Markdown)`,font:`mono`,rows:28,resize:`vertical`,value:n,onChange:e=>r(e.target.value),disabled:!e.editable,description:e.editable?void 0:`Read-only here. Pick a variant below, or edit the resume file and run tekjobs resume sync.`}),e.editable&&(0,x.jsxs)(`div`,{className:`form__actions`,children:[(0,x.jsx)(B,{variant:`ghost`,size:`sm`,disabled:!c||i,onClick:()=>r(e.markdown),children:`Discard`}),(0,x.jsx)(B,{tone:`primary`,size:`sm`,disabled:!c||i,loading:i,onClick:async()=>{a(!0);try{let r=await $.saveProfileNote(e.key,n);X({title:`${e.title} saved`,description:r.saved,tone:`success`}),t()}catch(t){X({title:`${e.title} not saved`,description:t.message,tone:`danger`})}a(!1)},children:`Save to the vault`})]})]})})}function Rv({onChanged:e}){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),a=()=>$.resumes().then(n).catch(e=>X({title:`Could not read the resume folder`,description:e.message,tone:`danger`}));(0,b.useEffect)(()=>{a()},[]);let o=async t=>{i(t);try{let n=await $.useResume(t);X({title:`${t} is the resume of record`,description:`${n.chars} characters into Profile/Resume.md; ${n.added.length} lines new, ${n.removed.length} gone${n.stale.length?`, ${n.stale.length} drafts quote a removed claim`:``}.`,tone:`success`}),a(),e()}catch(e){X({title:`Not switched`,description:e.message,tone:`danger`})}i(``)},s=e=>`${Math.max(1,Math.round(e/1024))} KB`;return(0,x.jsx)(V,{padding:t&&t.files.length?`none`:`md`,children:t?t.files.length===0?(0,x.jsx)(Vg,{size:`sm`,title:`No resume variants yet`,description:`Drop PDF, DOCX, Markdown or text files into ${t.dir}${t.exists?``:` (the folder does not exist yet)`} and they appear here. The folder is set in Settings.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(Y,{"aria-label":`Resume variants`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`File`}),(0,x.jsx)(Y.HeadCell,{children:`Changed`}),(0,x.jsx)(Y.HeadCell,{children:`Size`}),(0,x.jsx)(Y.HeadCell,{children:`Use`})]})}),(0,x.jsx)(Y.Body,{children:t.files.map(e=>(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`span`,{className:`chips`,children:[e.name,e.current&&(0,x.jsx)(z,{size:`sm`,tone:`primary`,variant:`soft`,children:`resume of record`})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:e.modified})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num muted`,children:s(e.size)})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsx)(B,{size:`sm`,variant:`ghost`,tone:`neutral`,onClick:()=>$.openResume(e.name).catch(e=>X({title:`Could not open`,description:e.message,tone:`danger`})),children:`Open`}),!e.current&&(0,x.jsx)(B,{size:`sm`,variant:`soft`,tone:`primary`,disabled:!!r,loading:r===e.name,onClick:()=>o(e.name),children:`Make it the resume of record`})]})})]},e.name))})]}),(0,x.jsxs)(`p`,{className:`muted variants__foot`,children:[`From `,(0,x.jsx)(`code`,{className:`mono`,children:t.dir}),`. Making one the record reads it into Profile/Resume.md, which every tailored resume and letter starts from; the packet's Resume variant field offers these names.`]})]}):(0,x.jsx)(zg,{lines:3})})}function zv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(null),i=()=>($.profileSummary().then(r).catch(()=>{}),$.profileNotes().then(e=>t(e.notes)).catch(e=>X({title:`Could not load the profile`,description:e.message,tone:`danger`})));return(0,b.useEffect)(()=>{i()},[]),e?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`page__head`,children:(0,x.jsx)(`div`,{children:(0,x.jsx)(`p`,{children:`Who you are, how the story is told, and how you write. Cover letters, tailored resumes and application packets read these notes; the scan reads the Criteria page. Saving keeps yesterday's copy beside the note.`})})}),(0,x.jsxs)(Z,{defaultValue:`summary`,variant:`line`,size:`sm`,children:[(0,x.jsxs)(Z.List,{"aria-label":`Profile notes`,children:[(0,x.jsx)(Z.Trigger,{value:`summary`,children:`Summary`}),e.map(e=>(0,x.jsx)(Z.Trigger,{value:e.key,children:e.title},e.key))]}),(0,x.jsx)(Z.Content,{value:`summary`,children:n?(0,x.jsx)(Fv,{s:n}):(0,x.jsx)(zg,{variant:`rect`,height:`12rem`})}),e.map(e=>(0,x.jsx)(Z.Content,{value:e.key,children:(0,x.jsxs)(`div`,{className:`detail`,children:[e.key===`resume`&&(0,x.jsx)(Rv,{onChanged:i}),(0,x.jsx)(Lv,{note:e,onSaved:i})]})},e.key))]})]}):(0,x.jsx)(zg,{variant:`rect`,height:`24rem`})}var Bv=`__active__`,Vv={success:{label:`Success`,tone:`success`},partial:{label:`Partial`,tone:`warning`},failed:{label:`Failed`,tone:`danger`}},Hv=e=>e.dry?`dry run`:e.via===`schedule`?`scheduled`:e.via===`mcp`?`agent`:e.via===`cli`?`manual, CLI`:e.via===`app`?`manual`:``,Uv=e=>{let t=e.match(/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}) UTC$/);if(!t)return``;let n=new Date(`${t[1]}T${t[2]}:00Z`);return Number.isNaN(n.getTime())?``:`${n.toLocaleString()} local`};function Wv(e){if(e.running||e.exitCode===null)return null;if(e.exitCode!==0)return`failed`;let t=(e.output.find(e=>/Boards: \d+\/\d+/.test(e))||``).match(/Boards: (\d+)\/(\d+)/),n=e.output.some(e=>/^- .+?: failed: /.test(e)||/^\s+x /.test(e));return t?Number(t[1])===0&&Number(t[2])>0?`failed`:Number(t[1])===Number(t[2])&&!n?`success`:`partial`:`success`}function Gv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(null),[i,a]=(0,b.useState)([]),[o,s]=(0,b.useState)(Bv),[c,l]=(0,b.useState)(null),u=()=>$.runs().then(t).catch(()=>t([]));(0,b.useEffect)(()=>{u(),$.scan().then(r).catch(()=>{}),$.criteriaPresets().then(a).catch(()=>a([]))},[]),(0,b.useEffect)(()=>{if(!n?.running)return;let e=setInterval(()=>$.scan().then(e=>{r(e),e.running||u()}).catch(()=>{}),2e3);return()=>clearInterval(e)},[n?.running]);let d=async(e,t=!1)=>{let n=o===Bv?void 0:o;try{r(await $.startScan(e,n,t)),X({title:t?`Retrying the failed boards`:e?`Dry run started`:`Scan started`,description:t?`Only the boards whose last attempt failed, no feeds.`:`Every board, scored with ${n?`the "${n}" preset`:`the active criteria`}.`,tone:`success`})}catch(e){X({title:`Could not start`,description:e.message,tone:`danger`})}},f=(e??[]).flatMap(e=>e.runs.map((t,n)=>({...t,key:`${e.date}-${n}`})).reverse()),p=f[0],m=!!p&&!p.dry&&p.boardsOk<p.boardsTotal,h=n?Wv(n):null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`page__head`,children:[(0,x.jsx)(`div`,{children:(0,x.jsx)(`p`,{children:`Each scan fetches every board, scores, and writes new matches to the vault. The morning task runs it with the active criteria; here you can run one now, with the active set or a preset from the Criteria page. Times are UTC; hover one for your clock.`})}),(0,x.jsxs)(`div`,{className:`pager__buttons`,children:[(0,x.jsxs)(J,{size:`sm`,label:`Score with`,value:o,onValueChange:s,disabled:!!n?.running,children:[(0,x.jsx)(J.Item,{value:Bv,children:`Active criteria`}),i.map(e=>(0,x.jsx)(J.Item,{value:e.name,children:e.name},e.name))]}),m&&(0,x.jsx)(Bh,{content:`${p.boardsTotal-p.boardsOk} board${p.boardsTotal-p.boardsOk===1?``:`s`} did not answer last time. Fetch only those; Sources shows each one's health.`,children:(0,x.jsx)(B,{variant:`soft`,tone:`danger`,size:`sm`,disabled:!!n?.running,leadingIcon:(0,x.jsx)(H.Refresh,{}),onClick:()=>d(!1,!0),children:`Retry failed`})}),(0,x.jsx)(B,{variant:`soft`,size:`sm`,disabled:!!n?.running,onClick:()=>d(!0),children:`Dry run`}),(0,x.jsx)(B,{tone:`primary`,size:`sm`,disabled:!!n?.running,leadingIcon:n?.running?(0,x.jsx)(Bg,{size:`sm`}):(0,x.jsx)(H.Refresh,{}),onClick:()=>d(!1),children:n?.running?`Scanning`:`Scan now`})]})]}),n&&(n.running||n.output.length>0)&&(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{className:`runs__live`,children:n.running?`Running`:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(z,{tone:Vv[h].tone,size:`sm`,children:Vv[h].label}),` `,(0,x.jsx)(`span`,{children:h===`failed`?`exit code ${n.exitCode}`:`finished`})]}):`Finished`}),(0,x.jsxs)(`p`,{children:[n.startedAt?`Started ${n.startedAt.replace(`T`,` `).slice(0,19)} UTC`:``,n.criteria?` · preset "${n.criteria}"`:``]})]}),n.running&&(0,x.jsx)(Bg,{showLabel:!0,label:`Fetching boards`,size:`sm`})]}),(0,x.jsx)(ag,{code:n.output.slice(-40).join(`
|
|
77
|
+
`)||`…`,language:`text`,showCopy:!1,wrap:!0})]})}),f.length>1&&(0,x.jsxs)(`div`,{className:`charts`,children:[(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsx)(`div`,{className:`panel__head`,children:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`New matches per scan`}),(0,x.jsx)(`p`,{children:`What each of the last twelve runs added, most recent on the right.`})]})}),(0,x.jsx)(Fi,{series:[{name:`New matches`,values:[...f].slice(0,12).reverse().map(e=>e.newMatches)}],labels:[...f].slice(0,12).reverse().map(e=>e.when.slice(5,16)),area:!0,height:200,"aria-label":`New matches per scan`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`panel`,children:[(0,x.jsxs)(`div`,{className:`panel__head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{children:`Last scan`}),(0,x.jsx)(`p`,{children:p?p.when:``})]}),p&&(0,x.jsx)(z,{tone:Vv[p.outcome].tone,size:`sm`,children:Vv[p.outcome].label})]}),p&&(0,x.jsxs)(`dl`,{className:`detail__grid`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Postings scanned`}),(0,x.jsx)(`dd`,{children:p.scanned.toLocaleString()})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Above the bar`}),(0,x.jsx)(`dd`,{children:p.matched})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`New notes`}),(0,x.jsx)(`dd`,{children:p.dry?`dry run`:p.newMatches})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Closed listings`}),(0,x.jsx)(`dd`,{children:p.dry?`—`:p.closed})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Duration`}),(0,x.jsxs)(`dd`,{children:[p.seconds,`s`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`dt`,{children:`Boards`}),(0,x.jsxs)(`dd`,{children:[p.boardsOk,`/`,p.boardsTotal]})]})]})]})})]}),(0,x.jsx)(V,{padding:`none`,children:e===null?(0,x.jsx)(`div`,{className:`loading`,children:(0,x.jsx)(zg,{lines:6})}):(0,x.jsxs)(Y,{"aria-label":`Scan history`,density:`md`,children:[(0,x.jsx)(Y.Head,{children:(0,x.jsxs)(Y.Row,{children:[(0,x.jsx)(Y.HeadCell,{children:`Outcome`}),(0,x.jsx)(Y.HeadCell,{children:`When`}),(0,x.jsx)(Y.HeadCell,{children:`Boards`}),(0,x.jsx)(Y.HeadCell,{children:`Criteria`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Scanned`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Above bar`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`New`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Closed`}),(0,x.jsx)(Y.HeadCell,{align:`end`,numeric:!0,children:`Seconds`})]})}),(0,x.jsxs)(Y.Body,{children:[f.map(e=>{let t=[...e.failed?e.failed.split(/;\s*/).filter(Boolean).map(e=>`board: ${e}`):[],...(e.feedsFailed||[]).map(e=>`feed: ${e}`)],n=t.length>0,r=c===e.key;return[(0,x.jsxs)(Y.Row,{interactive:n,onClick:n?()=>l(r?null:e.key):void 0,"aria-expanded":n?r:void 0,children:[(0,x.jsx)(Y.Cell,{children:(0,x.jsxs)(`div`,{className:`runs__outcome`,children:[(0,x.jsx)(z,{tone:Vv[e.outcome].tone,variant:e.outcome===`success`?`soft`:`solid`,size:`sm`,children:Vv[e.outcome].label}),Hv(e)&&(0,x.jsx)(`small`,{className:`muted`,children:Hv(e)})]})}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`num`,title:Uv(e.when),children:e.when})}),(0,x.jsxs)(Y.Cell,{children:[(0,x.jsxs)(`span`,{className:`num`,children:[e.boardsOk,`/`,e.boardsTotal]}),n&&(0,x.jsxs)(`span`,{className:`muted`,children:[` · `,t.length,` problem`,t.length===1?``:`s`,` `,r?`▾`:`▸`]})]}),(0,x.jsx)(Y.Cell,{children:(0,x.jsx)(`span`,{className:`muted`,children:e.criteria||`—`})}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.scanned.toLocaleString()}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.matched}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.dry?(0,x.jsx)(`span`,{className:`muted`,children:`—`}):e.newMatches}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.dry?(0,x.jsx)(`span`,{className:`muted`,children:`—`}):e.closed}),(0,x.jsx)(Y.Cell,{align:`end`,numeric:!0,children:e.seconds})]},e.key),n&&r?(0,x.jsx)(Y.Row,{children:(0,x.jsxs)(Y.Cell,{colSpan:9,children:[(0,x.jsx)(`ul`,{className:`runs__problems`,children:t.map(e=>(0,x.jsx)(`li`,{className:`mono`,children:e},e))}),(0,x.jsx)(`p`,{className:`muted`,children:`A board that fails once is usually a hiccup; one that fails every run has moved. Sources shows each board's health and last success.`})]})},`${e.key}-problems`):null]}),f.length===0&&(0,x.jsx)(Y.Row,{children:(0,x.jsx)(Y.Cell,{colSpan:9,children:(0,x.jsx)(`span`,{className:`muted`,children:`No scans logged yet.`})})})]})]})})]})}function Kv(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)({profile:``,resumeDir:``,llmCommand:``,llmArgs:``,contact:``}),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(!1),c=()=>$.settings().then(e=>{t(e),r({profile:e.profile.configured||e.profile.active,resumeDir:e.resumeDir.configured||e.resumeDir.path,llmCommand:e.llm.command,llmArgs:e.llm.args,contact:e.contact})}).catch(e=>X({title:`Could not read the settings`,description:e.message,tone:`danger`}));return(0,b.useEffect)(()=>{c()},[]),e?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`page__head`,children:(0,x.jsx)(`div`,{children:(0,x.jsxs)(`p`,{children:[`Where things live. The profile folder, the writing CLI and the contact are about this computer and sit in `,(0,x.jsx)(`code`,{className:`mono`,children:e.configFile}),`. The resume of record and the variants folder are about this search and sit inside the profile, in `,(0,x.jsx)(`code`,{className:`mono`,children:e.profileSettingsFile}),`, so a second profile never sees them. Everything else is a note in the folder.`]})})}),(0,x.jsxs)(`div`,{className:`detail`,children:[o&&(0,x.jsxs)(z,{tone:`warning`,size:`md`,children:[`The profile folder changed. Restart the server (`,(0,x.jsx)(`code`,{className:`mono`,children:`npm run server`}),`, or the scheduled task's next run) to switch; until then the app keeps reading `,e.profile.active,`.`]}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Profile folder `,(0,x.jsx)(`span`,{className:`muted`,children:`(this computer)`})]}),(0,x.jsxs)(`p`,{className:`muted`,children:[`Your job search: profile, resume, criteria, watchlist, one note per job, logs. Plain markdown; point Obsidian at it. Reading now: `,(0,x.jsx)(`code`,{className:`mono`,children:e.profile.active}),e.profile.fromEnv?` (set by TEKJOBS_PROFILE in the environment, which wins over this file)`:``,`.`]})]}),(0,x.jsx)(Zp,{label:`Folder`,value:n.profile,onChange:e=>r({...n,profile:e.target.value}),description:`Must exist. To start a new profile somewhere, run tekjobs init <dir> instead; it writes the starter notes. Takes effect on the next server start.`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Resume variants folder `,(0,x.jsx)(`span`,{className:`muted`,children:`(this profile)`})]}),(0,x.jsxs)(`p`,{className:`muted`,children:[`PDF, DOCX, Markdown or text files, one per variant. The Profile page lists them and makes any one the resume of record; the packet's Resume variant field offers their names. `,e.resumeDir.exists?``:`This folder does not exist yet; it is optional until you keep more than one resume.`]})]}),(0,x.jsx)(Zp,{label:`Folder`,value:n.resumeDir,onChange:e=>r({...n,resumeDir:e.target.value}),description:`Default: Templates/Resume inside the profile folder. Resume of record now: ${e.resumeSource||`not set. Import one on the Onboarding page, or run tekjobs resume <file>`}.`})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Writing CLI `,(0,x.jsx)(`span`,{className:`muted`,children:`(this computer)`})]}),(0,x.jsx)(`p`,{className:`muted`,children:`The local coding CLI that writes letters and tailored resumes and reads the mailbox. It must be signed in on this machine. Claude Code by default; another CLI works if it takes the prompt on stdin and prints the answer.`})]}),(0,x.jsxs)(`div`,{className:`form__row`,children:[(0,x.jsx)(Zp,{label:`Command`,value:n.llmCommand,onChange:e=>r({...n,llmCommand:e.target.value})}),(0,x.jsx)(Zp,{label:`Arguments`,value:n.llmArgs,onChange:e=>r({...n,llmArgs:e.target.value}),font:`mono`})]})]})}),(0,x.jsx)(V,{padding:`md`,children:(0,x.jsxs)(`div`,{className:`form`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h2`,{className:`settings__h`,children:[`Contact for scans `,(0,x.jsx)(`span`,{className:`muted`,children:`(this computer)`})]}),(0,x.jsx)(`p`,{className:`muted`,children:`Optional. Added to the user agent on every request the scan makes, so a site can reach the person running it.`})]}),(0,x.jsx)(Zp,{label:`Email`,type:`email`,value:n.contact,onChange:e=>r({...n,contact:e.target.value})})]})}),(0,x.jsx)(`div`,{className:`form__actions`,children:(0,x.jsx)(B,{tone:`primary`,size:`sm`,loading:i,onClick:async()=>{a(!0);try{let e=await $.saveSettings(n);t(e),s(e.restart||o),X({title:`Settings saved`,description:e.configFile,tone:`success`})}catch(e){X({title:`Not saved`,description:e.message,tone:`danger`})}a(!1)},children:`Save settings`})})]})]}):(0,x.jsx)(zg,{variant:`rect`,height:`20rem`})}function qv(){let[e,t]=(0,b.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`theme`);if(e===`light`||e===`dark`)return e;let t=document.documentElement.dataset.theme;return t===`light`||t===`dark`?t:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`});return(0,b.useEffect)(()=>{document.documentElement.dataset.theme=e},[e]),[e,()=>t(e=>e===`light`?`dark`:`light`)]}function Jv(){let e=()=>{let[e,t]=window.location.hash.replace(/^#\/?/,``).split(`?`);return{page:[`onboarding`,`today`,`overview`,`jobs`,`pipeline`,`mail`,`people`,`companies`,`criteria`,`profile`,`runs`,`agent`,`settings`].includes(e??``)?e:`today`,q:new URLSearchParams(t).get(`q`)??``}},[t,n]=(0,b.useState)(e);return(0,b.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),[t.page,t.q,(e,t)=>{window.location.hash=t?`/${e}?q=${encodeURIComponent(t)}`:`/${e}`}]}function Yv(){let[e,t,n]=Jv(),[r,i]=qv(),[a,o]=(0,b.useState)(!0),[s,c]=(0,b.useState)({}),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(null);return(0,b.useEffect)(()=>{$.onboarding().then(e=>{o(e.complete),!e.complete&&!window.location.hash&&n(`onboarding`)}).catch(()=>{})},[]),(0,b.useEffect)(()=>{$.summary().then(e=>{c(t=>({...t,jobs:e.open,companies:e.companies})),e.lastRun&&u(`Last scan ${e.lastRun.when.slice(11,16)} · ${e.lastRun.boardsOk}/${e.lastRun.boardsTotal} boards`),e.who&&(f(e.who),document.title=e.who.name?`${u_(e.who.name)} search · TekJobs`:`TekJobs`)}).catch(()=>{}),$.today().then(e=>c(t=>({...t,today:e.sections.triage.length}))).catch(()=>{}),$.mail().then(e=>c(t=>({...t,mail:e.groups.length}))).catch(()=>{})},[e]),(0,x.jsx)(Bh.Provider,{children:(0,x.jsx)($m.Provider,{position:`bottom-right`,children:(0,x.jsx)(d_,{page:e,onNavigate:e=>n(e),onSearch:e=>n(`jobs`,e),theme:r,onToggleTheme:i,onboarded:a,counts:s,lastScan:l,who:d,children:(0,x.jsxs)(`div`,{className:`page z-enter-fade`,children:[e===`onboarding`&&(0,x.jsx)(bv,{onDone:()=>n(`overview`),onNavigate:e=>n(e)}),e===`today`&&(0,x.jsx)(Ev,{onNavigate:n}),e===`overview`&&(0,x.jsx)(Tv,{onNavigate:n}),e===`jobs`&&(0,x.jsx)(ov,{initialQuery:t}),e===`pipeline`&&(0,x.jsx)(Nv,{}),e===`mail`&&(0,x.jsx)(mv,{}),e===`people`&&(0,x.jsx)(F_,{}),e===`companies`&&(0,x.jsx)(y_,{}),e===`criteria`&&(0,x.jsx)(A_,{}),e===`profile`&&(0,x.jsx)(zv,{}),e===`runs`&&(0,x.jsx)(Gv,{}),e===`agent`&&(0,x.jsx)(m_,{}),e===`settings`&&(0,x.jsx)(Kv,{})]},e)})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(Yv,{})}));
|