jobtrack 1.0.9 → 1.0.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jobtrack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Runs the JobTrack API + web UI as one background process with a Windows tray icon",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@fastify/static": "^10.1.3",
|
|
30
|
-
"@jobtrack/api": "^1.0.
|
|
30
|
+
"@jobtrack/api": "^1.0.6",
|
|
31
31
|
"fastify": "^5.12.1",
|
|
32
32
|
"systray": "^1.0.5",
|
|
33
33
|
"tsx": "^4.23.12"
|
package/src/server.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import fastifyStatic from '@fastify/static';
|
|
9
9
|
import type { FastifyInstance } from 'fastify';
|
|
10
10
|
import { buildApp } from '@jobtrack/api/app';
|
|
11
|
-
import { loadConfig, type Config } from '@jobtrack/api/config';
|
|
11
|
+
import { loadConfig, loadEnvFile, type Config } from '@jobtrack/api/config';
|
|
12
12
|
import { createRepos } from '@jobtrack/api/db/create-repos';
|
|
13
13
|
import type { RepoBundle } from '@jobtrack/api/db/repos';
|
|
14
14
|
import { SearchIndex } from '@jobtrack/api/search';
|
|
@@ -25,6 +25,9 @@ export interface RunningServer {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export async function startServer(): Promise<RunningServer> {
|
|
28
|
+
// The file the tray's "Open App Settings" menu item edits — read here, or that menu
|
|
29
|
+
// item is a text editor pointed at nothing.
|
|
30
|
+
loadEnvFile();
|
|
28
31
|
const config = loadConfig();
|
|
29
32
|
const repos = await createRepos(config);
|
|
30
33
|
|
package/vendor/.env.example
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# Copy this file to `.env` and adjust as needed. Every value below is optional — an
|
|
2
2
|
# unmodified `.env` (or no `.env` at all) runs JobTrack on local SQLite at
|
|
3
3
|
# http://127.0.0.1:3001. See README.md "Configuration" for the full write-up.
|
|
4
|
+
#
|
|
5
|
+
# The file is read from the app data directory: this repo's root when running from a clone,
|
|
6
|
+
# %APPDATA%\jobtrack (or ~/.local/share/jobtrack) for an installed `jobtrack` — the same file
|
|
7
|
+
# the tray's "Open App Settings" opens. Anything already set in the real environment wins
|
|
8
|
+
# over what is written here.
|
|
4
9
|
|
|
5
10
|
# sqlite (default), postgres, or mysql — the driver for the implicit "default" target.
|
|
6
11
|
# DB_DRIVER=sqlite
|
|
7
12
|
|
|
8
|
-
# SQLite only
|
|
13
|
+
# SQLite only, and never relative to whatever directory the app was started from. A bare
|
|
14
|
+
# filename (DB_FILE=work.db) is a second database in the same data folder; a relative path
|
|
15
|
+
# is resolved from the app data directory above; an absolute path is used as written.
|
|
9
16
|
# DB_FILE=data/jobtrack.db
|
|
10
17
|
|
|
11
18
|
# Postgres/MySQL only. Required when DB_DRIVER is postgres or mysql.
|
|
@@ -25,5 +32,16 @@
|
|
|
25
32
|
# Any transformers.js feature-extraction model.
|
|
26
33
|
# EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2
|
|
27
34
|
|
|
28
|
-
# Where the ONNX embedding model is cached
|
|
35
|
+
# Where the ONNX embedding model is cached. Relative to the app data directory, as above.
|
|
29
36
|
# MODEL_CACHE_DIR=.models
|
|
37
|
+
|
|
38
|
+
# Extra browser origins allowed to call the API without a token, comma-separated. This
|
|
39
|
+
# app's own UI (the tray's address and the :5173 dev server) is always allowed; everything
|
|
40
|
+
# else — the browser extension included — authenticates with the token below instead.
|
|
41
|
+
# See docs/capture.md.
|
|
42
|
+
# CORS_ORIGINS=http://localhost:4173
|
|
43
|
+
|
|
44
|
+
# The token a browser extension presents. Left unset, JobTrack generates one on first run
|
|
45
|
+
# and keeps it in data/api-token — that is the normal case, and the file is what you paste
|
|
46
|
+
# into the extension's options page. Set it here only to manage the secret yourself.
|
|
47
|
+
# API_TOKEN=
|
|
@@ -377,9 +377,9 @@ html body {
|
|
|
377
377
|
${n}-eye,
|
|
378
378
|
${n}-download,
|
|
379
379
|
${n}-delete
|
|
380
|
-
`]:{zIndex:10,width:r,margin:`0 ${$(e.marginXXS)}`,fontSize:r,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,color:i,"&:hover":{color:i},svg:{verticalAlign:`baseline`}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:`static`,display:`block`,width:`100%`,height:`100%`,objectFit:`contain`},[`${s}-name`]:{display:`none`,textAlign:`center`},[`${s}-file + ${s}-name`]:{position:`absolute`,bottom:e.margin,display:`block`,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:`none`}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}},[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:`50%`}}}},vZ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},yZ=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:{...od(e),[t]:{outline:0,"input[type='file']":{cursor:`pointer`}},[`${t}-select`]:{display:`inline-block`},[`${t}-hidden`]:{display:`none`},[`${t}-disabled`]:{color:n,cursor:`not-allowed`}}}},bZ=gd(`Upload`,e=>{let{fontSizeHeading3:t,marginXS:n,lineWidth:r,pictureCardSize:i,calc:a}=e,o=Ol(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:i});return[yZ(o),pZ(o),gZ(o),_Z(o),mZ(o),hZ(o),vZ(o),vv(o)]},e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55})),xZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z`}}]},name:`paper-clip`,theme:`outlined`}}))());function SZ(){return SZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SZ.apply(this,arguments)}var CZ=_.forwardRef((e,t)=>_.createElement(Zd,SZ({},e,{ref:t,icon:xZ.default}))),wZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z`}}]},name:`picture`,theme:`outlined`}}))());function TZ(){return TZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TZ.apply(this,arguments)}var EZ=_.forwardRef((e,t)=>_.createElement(Zd,TZ({},e,{ref:t,icon:wZ.default})));function DZ(e){return{...e,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e}}function OZ(e,t){let n=jo(t),r=n.findIndex(({uid:t})=>t===e.uid);return r===-1?n.push(e):n[r]=e,n}function kZ(e,t){let n=e.uid===void 0?`name`:`uid`;return t.filter(t=>t[n]===e[n])[0]}function AZ(e,t){let n=e.uid===void 0?`name`:`uid`,r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}var jZ=(e=``)=>{let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]},MZ=e=>e.indexOf(`image/`)===0,NZ=[`.avif`,`.bmp`,`.dpg`,`.gif`,`.heic`,`.heif`,`.ico`,`.jfif`,`.jpg`,`.jpeg`,`.png`,`.svg`,`.tif`,`.tiff`,`.webp`],PZ=e=>{if(e.type&&!e.thumbUrl)return MZ(e.type);let t=e.thumbUrl||e.url||``,n=jZ(t||e.name);return/^data:image\//.test(t)||NZ.includes(n?.toLowerCase()||``)?!0:!(/^data:/.test(t)||n)},FZ=200;function IZ(e){return new Promise(t=>{if(!e.type||!MZ(e.type)){t(``);return}let n=document.createElement(`canvas`);n.width=FZ,n.height=FZ,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${FZ}px; height: ${FZ}px; z-index: 9999; display: none;`,document.body.appendChild(n);let r=n.getContext(`2d`),i=new Image;if(i.onload=()=>{let{width:e,height:a}=i,o=FZ,s=FZ,c=0,l=0;e>a?(s=FZ/e*a,l=-(s-o)/2):(o=FZ/a*e,c=-(o-s)/2),r.drawImage(i,c,l,o,s);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(i.src),t(u)},i.crossOrigin=`anonymous`,e.type.startsWith(`image/svg+xml`)){let t=new FileReader;t.onload=()=>{t.result&&typeof t.result==`string`&&(i.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith(`image/gif`)){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var LZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`download`,theme:`outlined`}}))());function RZ(){return RZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RZ.apply(this,arguments)}var zZ=_.forwardRef((e,t)=>_.createElement(Zd,RZ({},e,{ref:t,icon:LZ.default}))),BZ=_.forwardRef(({prefixCls:e,className:t,style:n,classNames:r,styles:i,locale:a,listType:o,file:s,items:c,progress:l,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:p,showPreviewIcon:m,showRemoveIcon:h,showDownloadIcon:g,previewIcon:v,removeIcon:y,downloadIcon:b,extra:x,onPreview:S,onDownload:C,onClose:w},T)=>{let{status:E}=s,[D,O]=_.useState(E);_.useEffect(()=>{E!==`removed`&&O(E)},[E]);let[k,A]=fi(!1);_.useEffect(()=>{A(!0,{ms:300})},[]);let j=u(s),M=_.createElement(`div`,{className:`${e}-icon`},j);if(o===`picture`||o===`picture-card`||o===`picture-circle`){if(D===`uploading`||!s.thumbUrl&&!s.url){let t=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:D!==`uploading`});M=_.createElement(`div`,{className:t},j)}else{let t=p?.(s)?_.createElement(`img`,{src:s.thumbUrl||s.url,alt:s.name,className:`${e}-list-item-image`,crossOrigin:s.crossOrigin}):j,n=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(s)});M=_.createElement(`a`,{className:n,onClick:e=>S(s,e),href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`},t)}}let N=Q(`${e}-list-item`,`${e}-list-item-${D}`,r?.item),P=typeof s.linkProps==`string`?JSON.parse(s.linkProps):s.linkProps,F=(up(h)?h(s):h)?d((up(y)?y(s):y)||_.createElement($Y,null),()=>w(s),e,a.removeFile,!0):null,I=(up(g)?g(s):g)&&D===`done`?d((up(b)?b(s):b)||_.createElement(zZ,null),()=>C(s),e,a.downloadFile):null,L=o!==`picture-card`&&o!==`picture-circle`&&_.createElement(`span`,{key:`download-delete`,className:Q(`${e}-list-item-actions`,{picture:o===`picture`})},I,F),R=up(x)?x(s):x,z=R&&_.createElement(`span`,{className:`${e}-list-item-extra`},R),B=Q(`${e}-list-item-name`),V=s.url?_.createElement(`a`,{key:`view`,target:`_blank`,rel:`noopener noreferrer`,className:B,title:s.name,...P,href:s.url,onClick:e=>S(s,e)},s.name,z):_.createElement(`span`,{key:`view`,role:`button`,tabIndex:0,className:B,onClick:e=>S(s,e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(s,e))},title:s.name},s.name,z),H=(up(m)?m(s):m)&&(s.url||s.thumbUrl)?_.createElement(`a`,{href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>S(s,e),title:a.previewFile,"aria-label":a.previewFile||void 0},up(v)?v(s):v||_.createElement(dV,null)):null,U=(o===`picture-card`||o===`picture-circle`)&&D!==`uploading`&&_.createElement(`span`,{className:`${e}-list-item-actions`},H,D===`done`&&I,F),{getPrefixCls:W}=_.useContext(Po),ee=W(),G=_.createElement(`div`,{className:N,style:i?.item},M,V,L,U,k&&_.createElement(ip,{motionName:`${ee}-fade`,visible:D===`uploading`,motionDeadline:2e3},({className:t})=>{let n=`percent`in s?_.createElement(wU,{type:`line`,percent:s.percent,"aria-label":s[`aria-label`],"aria-labelledby":s[`aria-labelledby`],...l}):null;return _.createElement(`div`,{className:Q(`${e}-list-item-progress`,t)},n)})),K=s.response&&typeof s.response==`string`?s.response:s.error?.statusText||s.error?.message||a.uploadError,q=D===`error`?_.createElement(bD,{title:K,getPopupContainer:e=>e.parentNode},G):G;return _.createElement(`div`,{className:Q(`${e}-list-item-container`,t),style:n,ref:T},f?f(q,s,c,{download:C.bind(null,s),preview:S.bind(null,s),remove:w.bind(null,s)}):q)}),VZ=_.forwardRef((e,t)=>{let{listType:n=`text`,previewFile:r=IZ,onPreview:i,onDownload:a,onRemove:o,locale:s,iconRender:c,isImageUrl:l=PZ,prefixCls:u,items:d=[],showPreviewIcon:f=!0,showRemoveIcon:p=!0,showDownloadIcon:m=!1,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,progress:b={size:[-1,2],showInfo:!1},appendAction:x,appendActionVisible:S=!0,itemRender:C,disabled:w,classNames:T,styles:E}=e,[,D]=Eg(),[O,k]=_.useState(!1),A=[`picture-card`,`picture-circle`].includes(n);_.useEffect(()=>{n.startsWith(`picture`)&&(d||[]).forEach(e=>{!(e.originFileObj instanceof File||e.originFileObj instanceof Blob)||e.thumbUrl!==void 0||(e.thumbUrl=``,r?.(e.originFileObj).then(t=>{e.thumbUrl=t||``,D()}))})},[n,d,r]),_.useEffect(()=>{k(!0)},[]);let j=(e,t)=>{if(i)return t?.preventDefault(),i(e)},M=e=>{up(a)?a(e):e.url&&window.open(e.url,`_blank`,`noopener`)},N=e=>{o?.(e)},P=e=>{if(c)return c(e,n);let t=e.status===`uploading`;if(n.startsWith(`picture`)){let r=n===`picture`?_.createElement(gg,null):s.uploading,i=l?.(e)?_.createElement(EZ,null):_.createElement(Sq,null);return t?r:i}return t?_.createElement(gg,null):_.createElement(CZ,null)},F=(e,t,n,r,i)=>{let a={type:`text`,size:`small`,title:r,"aria-label":r||void 0,onClick:n=>{t(),_.isValidElement(e)&&e.props.onClick?.(n)},className:`${n}-list-item-action`,disabled:i?w:!1};return _.isValidElement(e)?_.createElement(zy,{...a,icon:fh(e,{...e.props,onClick:()=>{}})}):_.createElement(zy,{...a},_.createElement(`span`,null,e))};_.useImperativeHandle(t,()=>({handlePreview:j,handleDownload:M}));let{getPrefixCls:I}=_.useContext(Po),L=I(`upload`,u),R=I(),z=Q(`${L}-list`,`${L}-list-${n}`,T?.list),B=_.useMemo(()=>La(B_(R),[`onAppearEnd`,`onEnterEnd`,`onLeaveEnd`]),[R]),V={...A?{}:B,motionDeadline:2e3,motionName:`${L}-${A?`animate-inline`:`animate`}`,keys:jo(d.map(e=>({key:e.uid,file:e}))),motionAppear:O};return _.createElement(`div`,{className:z,style:E?.list},_.createElement(rp,{...V,component:!1},({key:e,file:t,className:r,style:i})=>_.createElement(BZ,{key:e,locale:s,prefixCls:L,className:r,style:i,classNames:T,styles:E,file:t,items:d,progress:b,listType:n,isImgUrl:l,showPreviewIcon:f,showRemoveIcon:p,showDownloadIcon:m,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,iconRender:P,actionIconRender:F,itemRender:C,onPreview:j,onDownload:M,onClose:N})),x&&_.createElement(ip,{...V,visible:S,forceRender:!0},({className:e,style:t})=>fh(x,n=>({className:Q(n.className,e),style:{...t,pointerEvents:e?`none`:void 0,...n.style}}))))}),HZ=`__LIST_IGNORE_${Date.now()}__`,UZ=_.forwardRef((e,t)=>{let n=Lo(`upload`),{fileList:r,defaultFileList:i,onRemove:a,showUploadList:o=!0,listType:s=`text`,onPreview:c,onDownload:l,onChange:u,onDrop:d,previewFile:f,disabled:p,locale:m,iconRender:h,isImageUrl:g,progress:v,prefixCls:y,className:b,type:x=`select`,children:S,style:C,itemRender:w,maxCount:T,data:E={},multiple:D=!1,hasControlInside:O=!0,action:k=``,accept:A,supportServerRender:j=!0,rootClassName:M,styles:N,classNames:P}=e,F=_.useContext(_h),I=p??F,L=e.customRequest||n.customRequest,R=n.progress||v?{...n.progress,...v}:void 0,z=_g(A,n.accept,``),[B,V]=ai(i,r),H=B||[],U=$r(()=>H),[W,ee]=_.useState(`drop`),G=_.useRef(null),K=_.useRef(null);_.useMemo(()=>{let e=Date.now();(r||[]).forEach((t,n)=>{!t.uid&&!Object.isFrozen(t)&&(t.uid=`__AUTO__${e}_${n}__`)})},[r]);let q=(e,t,n)=>{let r=jo(t),i=!1;T===1?r=r.slice(-1):T&&(i=r.length>T,r=r.slice(0,T)),(0,ro.flushSync)(()=>{V(r)});let a={file:e,fileList:r};n&&(a.event=n),(!i||e.status===`removed`||r.some(t=>t.uid===e.uid))&&(0,ro.flushSync)(()=>{u?.(a)})},J=async(t,n)=>{let{beforeUpload:r}=e,i=t;if(r){let e=await r(t,n);if(e===!1)return!1;if(delete t[HZ],e===HZ)return Object.defineProperty(t,HZ,{value:!0,configurable:!0}),!1;lp(e)&&(i=e)}return i},te=e=>{let t=e.filter(e=>!e.file[HZ]);if(!t.length)return;let n=t.map(e=>DZ(e.file)),r=jo(H);n.forEach(e=>{r=OZ(e,r)}),n.forEach((e,n)=>{let i=e;if(t[n].parsedFile)e.status=`uploading`;else{let{originFileObj:t}=e,n;try{n=new File([t],t.name,{type:t.type})}catch{n=new Blob([t],{type:t.type}),n.name=t.name,n.lastModifiedDate=new Date,n.lastModified=new Date().getTime()}n.uid=e.uid,i=n}q(i,r)})},Y=(e,t,n)=>{try{typeof e==`string`&&(e=JSON.parse(e))}catch{}if(!kZ(t,H))return;let r=DZ(t);r.status=`done`,r.percent=100,r.response=e,r.xhr=n;let i=OZ(r,H);q(r,i)},ne=(e,t)=>{if(!kZ(t,H))return;let n=DZ(t);n.status=`uploading`,n.percent=e.percent;let r=OZ(n,H);q(n,r,e)},X=(e,t,n)=>{if(!kZ(n,H))return;let r=DZ(n);r.error=e,r.response=t,r.status=`error`;let i=OZ(r,H);q(r,i)},re=e=>{let t;Promise.resolve(up(a)?a(e):a).then(n=>{if(n===!1)return;let r=U(),i=AZ(e,r);i&&(t={...e,status:`removed`},r.forEach(e=>{let n=t.uid===void 0?`name`:`uid`;e[n]===t[n]&&!Object.isFrozen(e)&&(e.status=`removed`)}),G.current?.abort(t),q(t,i))})},ie=e=>{ee(e.type),e.type===`drop`&&d?.(e)};_.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:Y,onProgress:ne,onError:X,fileList:H,upload:G.current,nativeElement:K.current}));let{getPrefixCls:ae,direction:oe,className:se,style:ce,classNames:le,styles:ue}=Lo(`upload`),de=ae(`upload`,y),fe={...e,listType:s,showUploadList:o,type:x,multiple:D,hasControlInside:O,supportServerRender:j,disabled:I},pe=Sp(ce,`trigger`),me=Sp(C,`trigger`),[he,ge]=wp([le,P],[ue,pe,N,me],{props:fe}),_e={onBatchStart:te,onError:X,onProgress:ne,onSuccess:Y,...e,customRequest:L,data:E,multiple:D,action:k,accept:z,supportServerRender:j,prefixCls:de,disabled:I,beforeUpload:J,onChange:void 0,hasControlInside:O};delete _e.className,delete _e.style,(!S||I)&&delete _e.id;let ve=`${de}-wrapper`,[ye,be]=bZ(de,ve),[xe]=cm(`Upload`,tm.Upload),{showRemoveIcon:Se,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,extra:Oe}=typeof o==`boolean`?{}:o,ke=Se===void 0?!I:Se,Ae=(e,t)=>o?_.createElement(VZ,{classNames:he,styles:ge,prefixCls:de,listType:s,items:H,previewFile:f,onPreview:c,onDownload:l,onRemove:re,showRemoveIcon:ke,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,iconRender:h,extra:Oe,locale:{...xe,...m},isImageUrl:g,progress:R,appendAction:e,appendActionVisible:t,itemRender:w,disabled:I}):e,je=Q(ve,b,M,ye,be,se,he.root,{[`${de}-rtl`]:oe===`rtl`,[`${de}-picture-card-wrapper`]:s===`picture-card`,[`${de}-picture-circle-wrapper`]:s===`picture-circle`}),Me={...ge.root};if(x===`drag`){let e=Q(ye,de,`${de}-drag`,{[`${de}-drag-uploading`]:H.some(e=>e.status===`uploading`),[`${de}-drag-hover`]:W===`dragover`,[`${de}-disabled`]:I,[`${de}-rtl`]:oe===`rtl`},he.trigger);return _.createElement(`span`,{className:je,ref:K,style:Me},_.createElement(`div`,{className:e,style:ge.trigger,onDrop:ie,onDragOver:ie,onDragLeave:ie},_.createElement(fZ,{..._e,ref:G,className:`${de}-btn`},_.createElement(`div`,{className:`${de}-drag-container`},S))),Ae())}let Ne=Q(de,`${de}-select`,{[`${de}-disabled`]:I,[`${de}-hidden`]:!S},he.trigger),Pe=_.createElement(`div`,{className:Ne,style:ge.trigger},_.createElement(fZ,{..._e,ref:G}));return s===`picture-card`||s===`picture-circle`?_.createElement(`span`,{className:je,ref:K,style:Me},Ae(Pe,!!S)):_.createElement(`span`,{className:je,ref:K,style:Me},Pe,Ae())}),WZ=_.forwardRef((e,t)=>{let{style:n,height:r,hasControlInside:i=!1,children:a,...o}=e,s={...n,height:r};return _.createElement(UZ,{ref:t,hasControlInside:i,...o,style:s,type:`drag`},a)}),GZ=UZ;GZ.Dragger=WZ,GZ.LIST_IGNORE=HZ;var KZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`}}))());function qZ(){return qZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qZ.apply(this,arguments)}var JZ=_.forwardRef((e,t)=>_.createElement(Zd,qZ({},e,{ref:t,icon:KZ.default}))),YZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z`}}]},name:`bulb`,theme:`outlined`}}))());function XZ(){return XZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XZ.apply(this,arguments)}var ZZ=_.forwardRef((e,t)=>_.createElement(Zd,XZ({},e,{ref:t,icon:YZ.default}))),QZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z`}}]},name:`dashboard`,theme:`outlined`}}))());function $Z(){return $Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$Z.apply(this,arguments)}var eQ=_.forwardRef((e,t)=>_.createElement(Zd,$Z({},e,{ref:t,icon:QZ.default}))),tQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`database`,theme:`outlined`}}))());function nQ(){return nQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nQ.apply(this,arguments)}var rQ=_.forwardRef((e,t)=>_.createElement(Zd,nQ({},e,{ref:t,icon:tQ.default}))),iQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z`}}]},name:`experiment`,theme:`outlined`}}))());function aQ(){return aQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aQ.apply(this,arguments)}var oQ=_.forwardRef((e,t)=>_.createElement(Zd,aQ({},e,{ref:t,icon:iQ.default}))),sQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z`}}]},name:`filter`,theme:`outlined`}}))());function cQ(){return cQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cQ.apply(this,arguments)}var lQ=_.forwardRef((e,t)=>_.createElement(Zd,cQ({},e,{ref:t,icon:sQ.default}))),uQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z`}}]},name:`inbox`,theme:`outlined`}}))());function dQ(){return dQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dQ.apply(this,arguments)}var fQ=_.forwardRef((e,t)=>_.createElement(Zd,dQ({},e,{ref:t,icon:uQ.default}))),pQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}},{tag:`path`,attrs:{d:`M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z`}}]},name:`info-circle`,theme:`outlined`}}))());function mQ(){return mQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mQ.apply(this,arguments)}var hQ=_.forwardRef((e,t)=>_.createElement(Zd,mQ({},e,{ref:t,icon:pQ.default}))),gQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z`}}]},name:`link`,theme:`outlined`}}))());function _Q(){return _Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_Q.apply(this,arguments)}var vQ=_.forwardRef((e,t)=>_.createElement(Zd,_Q({},e,{ref:t,icon:gQ.default}))),yQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z`}}]},name:`moon`,theme:`outlined`}}))());function bQ(){return bQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bQ.apply(this,arguments)}var xQ=_.forwardRef((e,t)=>_.createElement(Zd,bQ({},e,{ref:t,icon:yQ.default}))),SQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM492 400h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zM340 368a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`profile`,theme:`outlined`}}))());function CQ(){return CQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CQ.apply(this,arguments)}var wQ=_.forwardRef((e,t)=>_.createElement(Zd,CQ({},e,{ref:t,icon:SQ.default}))),TQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z`}}]},name:`pushpin`,theme:`filled`}}))());function EQ(){return EQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EQ.apply(this,arguments)}var DQ=_.forwardRef((e,t)=>_.createElement(Zd,EQ({},e,{ref:t,icon:TQ.default}))),OQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z`}}]},name:`rollback`,theme:`outlined`}}))());function kQ(){return kQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kQ.apply(this,arguments)}var AQ=_.forwardRef((e,t)=>_.createElement(Zd,kQ({},e,{ref:t,icon:OQ.default}))),jQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z`}}]},name:`safety-certificate`,theme:`outlined`}}))());function MQ(){return MQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MQ.apply(this,arguments)}var NQ=_.forwardRef((e,t)=>_.createElement(Zd,MQ({},e,{ref:t,icon:jQ.default}))),PQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z`}}]},name:`setting`,theme:`outlined`}}))());function FQ(){return FQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FQ.apply(this,arguments)}var IQ=_.forwardRef((e,t)=>_.createElement(Zd,FQ({},e,{ref:t,icon:PQ.default}))),LQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0014.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0015.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 01512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 01-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z`}}]},name:`shop`,theme:`outlined`}}))());function RQ(){return RQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RQ.apply(this,arguments)}var zQ=_.forwardRef((e,t)=>_.createElement(Zd,RQ({},e,{ref:t,icon:LQ.default}))),BQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z`}}]},name:`sun`,theme:`outlined`}}))());function VQ(){return VQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VQ.apply(this,arguments)}var HQ=_.forwardRef((e,t)=>_.createElement(Zd,VQ({},e,{ref:t,icon:BQ.default}))),UQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z`}}]},name:`thunderbolt`,theme:`outlined`}}))());function WQ(){return WQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WQ.apply(this,arguments)}var GQ=_.forwardRef((e,t)=>_.createElement(Zd,WQ({},e,{ref:t,icon:UQ.default}))),KQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`upload`,theme:`outlined`}}))());function qQ(){return qQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qQ.apply(this,arguments)}var JQ=_.forwardRef((e,t)=>_.createElement(Zd,qQ({},e,{ref:t,icon:KQ.default}))),YQ=[`applied`,`screening`,`interview`,`offer`,`rejected`,`withdrawn`,`ghosted`],XQ=[`applied`,`screening`,`interview`,`offer`];function ZQ(e){let t=XQ.indexOf(e);return t===-1||t===XQ.length-1?null:XQ[t+1]??null}var QQ={applied:`blue`,screening:`cyan`,interview:`gold`,offer:`green`,rejected:`red`,withdrawn:`default`,ghosted:`purple`},$Q={applied:`Applied`,screening:`Screening`,interview:`Interview`,offer:`Offer`,rejected:`Rejected`,withdrawn:`Withdrawn`,ghosted:`Ghosted`},e$=[`remote`,`hybrid`,`onsite`,`unspecified`],t$={remote:`Remote`,hybrid:`Hybrid`,onsite:`On-site`,unspecified:`Unspecified`},n$=[`company`,`application`],r$=[`company`,`application`,`standalone`],i$=[`company`,`application`,`both`],a$=/^(\d{4})-(\d{2})-(\d{2})$/;function o$(e){let t=a$.exec(e);if(!t)throw Error(`Not a YYYY-MM-DD date: ${JSON.stringify(e)}`);let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(Date.UTC(n,r-1,i));if(a.getUTCFullYear()!==n||a.getUTCMonth()!==r-1||a.getUTCDate()!==i)throw Error(`Not a real calendar date: ${e}`);return a}function s$(e){let t=typeof e==`string`?o$(e):e;return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1}}function c$(e=new Date){return`${String(e.getFullYear()).padStart(4,`0`)}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var l$=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function u$(e){return l$[e-1]??`Month ${e}`}var d$;function f$(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var p$=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},m$=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(d$=globalThis).__zod_globalConfig??(d$.__zod_globalConfig={});var h$=globalThis.__zod_globalConfig;function g$(e){return e&&Object.assign(h$,e),h$}function _$(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function v$(e,t){return typeof t==`bigint`?t.toString():t}function y$(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function b$(e){return e==null}function x$(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function S$(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var C$=Symbol(`evaluating`);function w$(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==C$)return r===void 0&&(r=C$,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function T$(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function E$(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function D$(e){return JSON.stringify(e)}function O$(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var k$=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function A$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var j$=y$(()=>{if(h$.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function M$(e){if(A$(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return A$(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function N$(e){return M$(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var P$=new Set([`string`,`number`,`symbol`]);function F$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function I$(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function L$(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function R$(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var z$={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function B$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return I$(e,E$(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return T$(this,`shape`,e),e},checks:[]}))}function V$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return I$(e,E$(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return T$(this,`shape`,r),r},checks:[]}))}function H$(e,t){if(!M$(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return I$(e,E$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return T$(this,`shape`,n),n}}))}function U$(e,t){if(!M$(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return I$(e,E$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return T$(this,`shape`,n),n}}))}function W$(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return I$(e,E$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return T$(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function G$(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return I$(t,E$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return T$(this,`shape`,i),i},checks:[]}))}function K$(e,t,n){return I$(t,E$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return T$(this,`shape`,i),i}}))}function q$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function J$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Y$(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function X$(e){return typeof e==`string`?e:e?.message}function Z$(e,t,n){let r=e.message?e.message:X$(e.inst?._zod.def?.error?.(e))??X$(t?.error?.(e))??X$(n.customError?.(e))??X$(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Q$(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function $$(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var e1=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,v$,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},t1=f$(`$ZodError`,e1),n1=f$(`$ZodError`,e1,{Parent:Error});function r1(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function i1(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var a1=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new p$;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Z$(e,a,g$())));throw k$(t,i?.callee),t}return o.value},o1=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Z$(e,a,g$())));throw k$(t,i?.callee),t}return o.value},s1=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new p$;return a.issues.length?{success:!1,error:new(e??t1)(a.issues.map(e=>Z$(e,i,g$())))}:{success:!0,data:a.value}},c1=s1(n1),l1=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Z$(e,i,g$())))}:{success:!0,data:a.value}},u1=l1(n1),d1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return a1(e)(t,n,i)},f1=e=>(t,n,r)=>a1(e)(t,n,r),p1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return o1(e)(t,n,i)},m1=e=>async(t,n,r)=>o1(e)(t,n,r),h1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return s1(e)(t,n,i)},g1=e=>(t,n,r)=>s1(e)(t,n,r),_1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return l1(e)(t,n,i)},v1=e=>async(t,n,r)=>l1(e)(t,n,r),y1=/^[cC][0-9a-z]{6,}$/,b1=/^[0-9a-z]+$/,x1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,S1=/^[0-9a-vA-V]{20}$/,C1=/^[A-Za-z0-9]{27}$/,w1=/^[a-zA-Z0-9_-]{21}$/,T1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,E1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,D1=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,O1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,k1=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function A1(){return new RegExp(k1,`u`)}var j1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,M1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,N1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,P1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,I1=/^[A-Za-z0-9_-]*$/,L1=/^https?$/,R1=/^\+[1-9]\d{6,14}$/,z1=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,B1=RegExp(`^${z1}$`);function V1(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function H1(e){return RegExp(`^${V1(e)}$`)}function U1(e){let t=V1({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${z1}T(?:${r})$`)}var W1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},G1=/^-?\d+$/,K1=/^-?\d+(?:\.\d+)?$/,q1=/^(?:true|false)$/i,J1=/^[^A-Z]*$/,Y1=/^[^a-z]*$/,X1=f$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Z1={number:`number`,bigint:`bigint`,object:`date`},Q1=f$(`$ZodCheckLessThan`,(e,t)=>{X1.init(e,t);let n=Z1[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$1=f$(`$ZodCheckGreaterThan`,(e,t)=>{X1.init(e,t);let n=Z1[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),e0=f$(`$ZodCheckMultipleOf`,(e,t)=>{X1.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):S$(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),t0=f$(`$ZodCheckNumberFormat`,(e,t)=>{X1.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=z$[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=G1)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),n0=f$(`$ZodCheckMaxLength`,(e,t)=>{var n;X1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!b$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Q$(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),r0=f$(`$ZodCheckMinLength`,(e,t)=>{var n;X1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!b$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Q$(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),i0=f$(`$ZodCheckLengthEquals`,(e,t)=>{var n;X1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!b$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Q$(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),a0=f$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;X1.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),o0=f$(`$ZodCheckRegex`,(e,t)=>{a0.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),s0=f$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=J1,a0.init(e,t)}),c0=f$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Y1,a0.init(e,t)}),l0=f$(`$ZodCheckIncludes`,(e,t)=>{X1.init(e,t);let n=F$(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),u0=f$(`$ZodCheckStartsWith`,(e,t)=>{X1.init(e,t);let n=RegExp(`^${F$(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),d0=f$(`$ZodCheckEndsWith`,(e,t)=>{X1.init(e,t);let n=RegExp(`.*${F$(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),f0=f$(`$ZodCheckOverwrite`,(e,t)=>{X1.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),p0=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
380
|
+
`]:{zIndex:10,width:r,margin:`0 ${$(e.marginXXS)}`,fontSize:r,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,color:i,"&:hover":{color:i},svg:{verticalAlign:`baseline`}}},[`${s}-thumbnail, ${s}-thumbnail img`]:{position:`static`,display:`block`,width:`100%`,height:`100%`,objectFit:`contain`},[`${s}-name`]:{display:`none`,textAlign:`center`},[`${s}-file + ${s}-name`]:{position:`absolute`,bottom:e.margin,display:`block`,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`},[`${s}-uploading`]:{[`&${s}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:`none`}},[`${s}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${$(a(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}},[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:`50%`}}}},vZ=e=>{let{componentCls:t}=e;return{[`${t}-rtl`]:{direction:`rtl`}}},yZ=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:{...od(e),[t]:{outline:0,"input[type='file']":{cursor:`pointer`}},[`${t}-select`]:{display:`inline-block`},[`${t}-hidden`]:{display:`none`},[`${t}-disabled`]:{color:n,cursor:`not-allowed`}}}},bZ=gd(`Upload`,e=>{let{fontSizeHeading3:t,marginXS:n,lineWidth:r,pictureCardSize:i,calc:a}=e,o=Ol(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:i});return[yZ(o),pZ(o),gZ(o),_Z(o),mZ(o),hZ(o),vZ(o),vv(o)]},e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55})),xZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z`}}]},name:`paper-clip`,theme:`outlined`}}))());function SZ(){return SZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SZ.apply(this,arguments)}var CZ=_.forwardRef((e,t)=>_.createElement(Zd,SZ({},e,{ref:t,icon:xZ.default}))),wZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z`}}]},name:`picture`,theme:`outlined`}}))());function TZ(){return TZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TZ.apply(this,arguments)}var EZ=_.forwardRef((e,t)=>_.createElement(Zd,TZ({},e,{ref:t,icon:wZ.default})));function DZ(e){return{...e,lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e}}function OZ(e,t){let n=jo(t),r=n.findIndex(({uid:t})=>t===e.uid);return r===-1?n.push(e):n[r]=e,n}function kZ(e,t){let n=e.uid===void 0?`name`:`uid`;return t.filter(t=>t[n]===e[n])[0]}function AZ(e,t){let n=e.uid===void 0?`name`:`uid`,r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}var jZ=(e=``)=>{let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]},MZ=e=>e.indexOf(`image/`)===0,NZ=[`.avif`,`.bmp`,`.dpg`,`.gif`,`.heic`,`.heif`,`.ico`,`.jfif`,`.jpg`,`.jpeg`,`.png`,`.svg`,`.tif`,`.tiff`,`.webp`],PZ=e=>{if(e.type&&!e.thumbUrl)return MZ(e.type);let t=e.thumbUrl||e.url||``,n=jZ(t||e.name);return/^data:image\//.test(t)||NZ.includes(n?.toLowerCase()||``)?!0:!(/^data:/.test(t)||n)},FZ=200;function IZ(e){return new Promise(t=>{if(!e.type||!MZ(e.type)){t(``);return}let n=document.createElement(`canvas`);n.width=FZ,n.height=FZ,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${FZ}px; height: ${FZ}px; z-index: 9999; display: none;`,document.body.appendChild(n);let r=n.getContext(`2d`),i=new Image;if(i.onload=()=>{let{width:e,height:a}=i,o=FZ,s=FZ,c=0,l=0;e>a?(s=FZ/e*a,l=-(s-o)/2):(o=FZ/a*e,c=-(o-s)/2),r.drawImage(i,c,l,o,s);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(i.src),t(u)},i.crossOrigin=`anonymous`,e.type.startsWith(`image/svg+xml`)){let t=new FileReader;t.onload=()=>{t.result&&typeof t.result==`string`&&(i.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith(`image/gif`)){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var LZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`download`,theme:`outlined`}}))());function RZ(){return RZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RZ.apply(this,arguments)}var zZ=_.forwardRef((e,t)=>_.createElement(Zd,RZ({},e,{ref:t,icon:LZ.default}))),BZ=_.forwardRef(({prefixCls:e,className:t,style:n,classNames:r,styles:i,locale:a,listType:o,file:s,items:c,progress:l,iconRender:u,actionIconRender:d,itemRender:f,isImgUrl:p,showPreviewIcon:m,showRemoveIcon:h,showDownloadIcon:g,previewIcon:v,removeIcon:y,downloadIcon:b,extra:x,onPreview:S,onDownload:C,onClose:w},T)=>{let{status:E}=s,[D,O]=_.useState(E);_.useEffect(()=>{E!==`removed`&&O(E)},[E]);let[k,A]=fi(!1);_.useEffect(()=>{A(!0,{ms:300})},[]);let j=u(s),M=_.createElement(`div`,{className:`${e}-icon`},j);if(o===`picture`||o===`picture-card`||o===`picture-circle`){if(D===`uploading`||!s.thumbUrl&&!s.url){let t=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:D!==`uploading`});M=_.createElement(`div`,{className:t},j)}else{let t=p?.(s)?_.createElement(`img`,{src:s.thumbUrl||s.url,alt:s.name,className:`${e}-list-item-image`,crossOrigin:s.crossOrigin}):j,n=Q(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(s)});M=_.createElement(`a`,{className:n,onClick:e=>S(s,e),href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`},t)}}let N=Q(`${e}-list-item`,`${e}-list-item-${D}`,r?.item),P=typeof s.linkProps==`string`?JSON.parse(s.linkProps):s.linkProps,F=(up(h)?h(s):h)?d((up(y)?y(s):y)||_.createElement($Y,null),()=>w(s),e,a.removeFile,!0):null,I=(up(g)?g(s):g)&&D===`done`?d((up(b)?b(s):b)||_.createElement(zZ,null),()=>C(s),e,a.downloadFile):null,L=o!==`picture-card`&&o!==`picture-circle`&&_.createElement(`span`,{key:`download-delete`,className:Q(`${e}-list-item-actions`,{picture:o===`picture`})},I,F),R=up(x)?x(s):x,z=R&&_.createElement(`span`,{className:`${e}-list-item-extra`},R),B=Q(`${e}-list-item-name`),V=s.url?_.createElement(`a`,{key:`view`,target:`_blank`,rel:`noopener noreferrer`,className:B,title:s.name,...P,href:s.url,onClick:e=>S(s,e)},s.name,z):_.createElement(`span`,{key:`view`,role:`button`,tabIndex:0,className:B,onClick:e=>S(s,e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(s,e))},title:s.name},s.name,z),H=(up(m)?m(s):m)&&(s.url||s.thumbUrl)?_.createElement(`a`,{href:s.url||s.thumbUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>S(s,e),title:a.previewFile,"aria-label":a.previewFile||void 0},up(v)?v(s):v||_.createElement(dV,null)):null,U=(o===`picture-card`||o===`picture-circle`)&&D!==`uploading`&&_.createElement(`span`,{className:`${e}-list-item-actions`},H,D===`done`&&I,F),{getPrefixCls:W}=_.useContext(Po),ee=W(),G=_.createElement(`div`,{className:N,style:i?.item},M,V,L,U,k&&_.createElement(ip,{motionName:`${ee}-fade`,visible:D===`uploading`,motionDeadline:2e3},({className:t})=>{let n=`percent`in s?_.createElement(wU,{type:`line`,percent:s.percent,"aria-label":s[`aria-label`],"aria-labelledby":s[`aria-labelledby`],...l}):null;return _.createElement(`div`,{className:Q(`${e}-list-item-progress`,t)},n)})),K=s.response&&typeof s.response==`string`?s.response:s.error?.statusText||s.error?.message||a.uploadError,q=D===`error`?_.createElement(bD,{title:K,getPopupContainer:e=>e.parentNode},G):G;return _.createElement(`div`,{className:Q(`${e}-list-item-container`,t),style:n,ref:T},f?f(q,s,c,{download:C.bind(null,s),preview:S.bind(null,s),remove:w.bind(null,s)}):q)}),VZ=_.forwardRef((e,t)=>{let{listType:n=`text`,previewFile:r=IZ,onPreview:i,onDownload:a,onRemove:o,locale:s,iconRender:c,isImageUrl:l=PZ,prefixCls:u,items:d=[],showPreviewIcon:f=!0,showRemoveIcon:p=!0,showDownloadIcon:m=!1,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,progress:b={size:[-1,2],showInfo:!1},appendAction:x,appendActionVisible:S=!0,itemRender:C,disabled:w,classNames:T,styles:E}=e,[,D]=Eg(),[O,k]=_.useState(!1),A=[`picture-card`,`picture-circle`].includes(n);_.useEffect(()=>{n.startsWith(`picture`)&&(d||[]).forEach(e=>{!(e.originFileObj instanceof File||e.originFileObj instanceof Blob)||e.thumbUrl!==void 0||(e.thumbUrl=``,r?.(e.originFileObj).then(t=>{e.thumbUrl=t||``,D()}))})},[n,d,r]),_.useEffect(()=>{k(!0)},[]);let j=(e,t)=>{if(i)return t?.preventDefault(),i(e)},M=e=>{up(a)?a(e):e.url&&window.open(e.url,`_blank`,`noopener`)},N=e=>{o?.(e)},P=e=>{if(c)return c(e,n);let t=e.status===`uploading`;if(n.startsWith(`picture`)){let r=n===`picture`?_.createElement(gg,null):s.uploading,i=l?.(e)?_.createElement(EZ,null):_.createElement(Sq,null);return t?r:i}return t?_.createElement(gg,null):_.createElement(CZ,null)},F=(e,t,n,r,i)=>{let a={type:`text`,size:`small`,title:r,"aria-label":r||void 0,onClick:n=>{t(),_.isValidElement(e)&&e.props.onClick?.(n)},className:`${n}-list-item-action`,disabled:i?w:!1};return _.isValidElement(e)?_.createElement(zy,{...a,icon:fh(e,{...e.props,onClick:()=>{}})}):_.createElement(zy,{...a},_.createElement(`span`,null,e))};_.useImperativeHandle(t,()=>({handlePreview:j,handleDownload:M}));let{getPrefixCls:I}=_.useContext(Po),L=I(`upload`,u),R=I(),z=Q(`${L}-list`,`${L}-list-${n}`,T?.list),B=_.useMemo(()=>La(B_(R),[`onAppearEnd`,`onEnterEnd`,`onLeaveEnd`]),[R]),V={...A?{}:B,motionDeadline:2e3,motionName:`${L}-${A?`animate-inline`:`animate`}`,keys:jo(d.map(e=>({key:e.uid,file:e}))),motionAppear:O};return _.createElement(`div`,{className:z,style:E?.list},_.createElement(rp,{...V,component:!1},({key:e,file:t,className:r,style:i})=>_.createElement(BZ,{key:e,locale:s,prefixCls:L,className:r,style:i,classNames:T,styles:E,file:t,items:d,progress:b,listType:n,isImgUrl:l,showPreviewIcon:f,showRemoveIcon:p,showDownloadIcon:m,removeIcon:h,previewIcon:g,downloadIcon:v,extra:y,iconRender:P,actionIconRender:F,itemRender:C,onPreview:j,onDownload:M,onClose:N})),x&&_.createElement(ip,{...V,visible:S,forceRender:!0},({className:e,style:t})=>fh(x,n=>({className:Q(n.className,e),style:{...t,pointerEvents:e?`none`:void 0,...n.style}}))))}),HZ=`__LIST_IGNORE_${Date.now()}__`,UZ=_.forwardRef((e,t)=>{let n=Lo(`upload`),{fileList:r,defaultFileList:i,onRemove:a,showUploadList:o=!0,listType:s=`text`,onPreview:c,onDownload:l,onChange:u,onDrop:d,previewFile:f,disabled:p,locale:m,iconRender:h,isImageUrl:g,progress:v,prefixCls:y,className:b,type:x=`select`,children:S,style:C,itemRender:w,maxCount:T,data:E={},multiple:D=!1,hasControlInside:O=!0,action:k=``,accept:A,supportServerRender:j=!0,rootClassName:M,styles:N,classNames:P}=e,F=_.useContext(_h),I=p??F,L=e.customRequest||n.customRequest,R=n.progress||v?{...n.progress,...v}:void 0,z=_g(A,n.accept,``),[B,V]=ai(i,r),H=B||[],U=$r(()=>H),[W,ee]=_.useState(`drop`),G=_.useRef(null),K=_.useRef(null);_.useMemo(()=>{let e=Date.now();(r||[]).forEach((t,n)=>{!t.uid&&!Object.isFrozen(t)&&(t.uid=`__AUTO__${e}_${n}__`)})},[r]);let q=(e,t,n)=>{let r=jo(t),i=!1;T===1?r=r.slice(-1):T&&(i=r.length>T,r=r.slice(0,T)),(0,ro.flushSync)(()=>{V(r)});let a={file:e,fileList:r};n&&(a.event=n),(!i||e.status===`removed`||r.some(t=>t.uid===e.uid))&&(0,ro.flushSync)(()=>{u?.(a)})},J=async(t,n)=>{let{beforeUpload:r}=e,i=t;if(r){let e=await r(t,n);if(e===!1)return!1;if(delete t[HZ],e===HZ)return Object.defineProperty(t,HZ,{value:!0,configurable:!0}),!1;lp(e)&&(i=e)}return i},te=e=>{let t=e.filter(e=>!e.file[HZ]);if(!t.length)return;let n=t.map(e=>DZ(e.file)),r=jo(H);n.forEach(e=>{r=OZ(e,r)}),n.forEach((e,n)=>{let i=e;if(t[n].parsedFile)e.status=`uploading`;else{let{originFileObj:t}=e,n;try{n=new File([t],t.name,{type:t.type})}catch{n=new Blob([t],{type:t.type}),n.name=t.name,n.lastModifiedDate=new Date,n.lastModified=new Date().getTime()}n.uid=e.uid,i=n}q(i,r)})},Y=(e,t,n)=>{try{typeof e==`string`&&(e=JSON.parse(e))}catch{}if(!kZ(t,H))return;let r=DZ(t);r.status=`done`,r.percent=100,r.response=e,r.xhr=n;let i=OZ(r,H);q(r,i)},ne=(e,t)=>{if(!kZ(t,H))return;let n=DZ(t);n.status=`uploading`,n.percent=e.percent;let r=OZ(n,H);q(n,r,e)},X=(e,t,n)=>{if(!kZ(n,H))return;let r=DZ(n);r.error=e,r.response=t,r.status=`error`;let i=OZ(r,H);q(r,i)},re=e=>{let t;Promise.resolve(up(a)?a(e):a).then(n=>{if(n===!1)return;let r=U(),i=AZ(e,r);i&&(t={...e,status:`removed`},r.forEach(e=>{let n=t.uid===void 0?`name`:`uid`;e[n]===t[n]&&!Object.isFrozen(e)&&(e.status=`removed`)}),G.current?.abort(t),q(t,i))})},ie=e=>{ee(e.type),e.type===`drop`&&d?.(e)};_.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:Y,onProgress:ne,onError:X,fileList:H,upload:G.current,nativeElement:K.current}));let{getPrefixCls:ae,direction:oe,className:se,style:ce,classNames:le,styles:ue}=Lo(`upload`),de=ae(`upload`,y),fe={...e,listType:s,showUploadList:o,type:x,multiple:D,hasControlInside:O,supportServerRender:j,disabled:I},pe=Sp(ce,`trigger`),me=Sp(C,`trigger`),[he,ge]=wp([le,P],[ue,pe,N,me],{props:fe}),_e={onBatchStart:te,onError:X,onProgress:ne,onSuccess:Y,...e,customRequest:L,data:E,multiple:D,action:k,accept:z,supportServerRender:j,prefixCls:de,disabled:I,beforeUpload:J,onChange:void 0,hasControlInside:O};delete _e.className,delete _e.style,(!S||I)&&delete _e.id;let ve=`${de}-wrapper`,[ye,be]=bZ(de,ve),[xe]=cm(`Upload`,tm.Upload),{showRemoveIcon:Se,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,extra:Oe}=typeof o==`boolean`?{}:o,ke=Se===void 0?!I:Se,Ae=(e,t)=>o?_.createElement(VZ,{classNames:he,styles:ge,prefixCls:de,listType:s,items:H,previewFile:f,onPreview:c,onDownload:l,onRemove:re,showRemoveIcon:ke,showPreviewIcon:Ce,showDownloadIcon:we,removeIcon:Te,previewIcon:Ee,downloadIcon:De,iconRender:h,extra:Oe,locale:{...xe,...m},isImageUrl:g,progress:R,appendAction:e,appendActionVisible:t,itemRender:w,disabled:I}):e,je=Q(ve,b,M,ye,be,se,he.root,{[`${de}-rtl`]:oe===`rtl`,[`${de}-picture-card-wrapper`]:s===`picture-card`,[`${de}-picture-circle-wrapper`]:s===`picture-circle`}),Me={...ge.root};if(x===`drag`){let e=Q(ye,de,`${de}-drag`,{[`${de}-drag-uploading`]:H.some(e=>e.status===`uploading`),[`${de}-drag-hover`]:W===`dragover`,[`${de}-disabled`]:I,[`${de}-rtl`]:oe===`rtl`},he.trigger);return _.createElement(`span`,{className:je,ref:K,style:Me},_.createElement(`div`,{className:e,style:ge.trigger,onDrop:ie,onDragOver:ie,onDragLeave:ie},_.createElement(fZ,{..._e,ref:G,className:`${de}-btn`},_.createElement(`div`,{className:`${de}-drag-container`},S))),Ae())}let Ne=Q(de,`${de}-select`,{[`${de}-disabled`]:I,[`${de}-hidden`]:!S},he.trigger),Pe=_.createElement(`div`,{className:Ne,style:ge.trigger},_.createElement(fZ,{..._e,ref:G}));return s===`picture-card`||s===`picture-circle`?_.createElement(`span`,{className:je,ref:K,style:Me},Ae(Pe,!!S)):_.createElement(`span`,{className:je,ref:K,style:Me},Pe,Ae())}),WZ=_.forwardRef((e,t)=>{let{style:n,height:r,hasControlInside:i=!1,children:a,...o}=e,s={...n,height:r};return _.createElement(UZ,{ref:t,hasControlInside:i,...o,style:s,type:`drag`},a)}),GZ=UZ;GZ.Dragger=WZ,GZ.LIST_IGNORE=HZ;var KZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`}}))());function qZ(){return qZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qZ.apply(this,arguments)}var JZ=_.forwardRef((e,t)=>_.createElement(Zd,qZ({},e,{ref:t,icon:KZ.default}))),YZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z`}}]},name:`bulb`,theme:`outlined`}}))());function XZ(){return XZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XZ.apply(this,arguments)}var ZZ=_.forwardRef((e,t)=>_.createElement(Zd,XZ({},e,{ref:t,icon:YZ.default}))),QZ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 385.6a446.7 446.7 0 00-96-142.4 446.7 446.7 0 00-142.4-96C631.1 123.8 572.5 112 512 112s-119.1 11.8-174.4 35.2a446.7 446.7 0 00-142.4 96 446.7 446.7 0 00-96 142.4C75.8 440.9 64 499.5 64 560c0 132.7 58.3 257.7 159.9 343.1l1.7 1.4c5.8 4.8 13.1 7.5 20.6 7.5h531.7c7.5 0 14.8-2.7 20.6-7.5l1.7-1.4C901.7 817.7 960 692.7 960 560c0-60.5-11.9-119.1-35.2-174.4zM761.4 836H262.6A371.12 371.12 0 01140 560c0-99.4 38.7-192.8 109-263 70.3-70.3 163.7-109 263-109 99.4 0 192.8 38.7 263 109 70.3 70.3 109 163.7 109 263 0 105.6-44.5 205.5-122.6 276zM623.5 421.5a8.03 8.03 0 00-11.3 0L527.7 506c-18.7-5-39.4-.2-54.1 14.5a55.95 55.95 0 000 79.2 55.95 55.95 0 0079.2 0 55.87 55.87 0 0014.5-54.1l84.5-84.5c3.1-3.1 3.1-8.2 0-11.3l-28.3-28.3zM490 320h44c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8h-44c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8zm260 218v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8zm12.7-197.2l-31.1-31.1a8.03 8.03 0 00-11.3 0l-56.6 56.6a8.03 8.03 0 000 11.3l31.1 31.1c3.1 3.1 8.2 3.1 11.3 0l56.6-56.6c3.1-3.1 3.1-8.2 0-11.3zm-458.6-31.1a8.03 8.03 0 00-11.3 0l-31.1 31.1a8.03 8.03 0 000 11.3l56.6 56.6c3.1 3.1 8.2 3.1 11.3 0l31.1-31.1c3.1-3.1 3.1-8.2 0-11.3l-56.6-56.6zM262 530h-80c-4.4 0-8 3.6-8 8v44c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8v-44c0-4.4-3.6-8-8-8z`}}]},name:`dashboard`,theme:`outlined`}}))());function $Z(){return $Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$Z.apply(this,arguments)}var eQ=_.forwardRef((e,t)=>_.createElement(Zd,$Z({},e,{ref:t,icon:QZ.default}))),tQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`database`,theme:`outlined`}}))());function nQ(){return nQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nQ.apply(this,arguments)}var rQ=_.forwardRef((e,t)=>_.createElement(Zd,nQ({},e,{ref:t,icon:tQ.default}))),iQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z`}}]},name:`experiment`,theme:`outlined`}}))());function aQ(){return aQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aQ.apply(this,arguments)}var oQ=_.forwardRef((e,t)=>_.createElement(Zd,aQ({},e,{ref:t,icon:iQ.default}))),sQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z`}}]},name:`filter`,theme:`outlined`}}))());function cQ(){return cQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cQ.apply(this,arguments)}var lQ=_.forwardRef((e,t)=>_.createElement(Zd,cQ({},e,{ref:t,icon:sQ.default}))),uQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z`}}]},name:`import`,theme:`outlined`}}))());function dQ(){return dQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dQ.apply(this,arguments)}var fQ=_.forwardRef((e,t)=>_.createElement(Zd,dQ({},e,{ref:t,icon:uQ.default}))),pQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z`}}]},name:`inbox`,theme:`outlined`}}))());function mQ(){return mQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mQ.apply(this,arguments)}var hQ=_.forwardRef((e,t)=>_.createElement(Zd,mQ({},e,{ref:t,icon:pQ.default}))),gQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z`}},{tag:`path`,attrs:{d:`M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z`}}]},name:`info-circle`,theme:`outlined`}}))());function _Q(){return _Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_Q.apply(this,arguments)}var vQ=_.forwardRef((e,t)=>_.createElement(Zd,_Q({},e,{ref:t,icon:gQ.default}))),yQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z`}}]},name:`link`,theme:`outlined`}}))());function bQ(){return bQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bQ.apply(this,arguments)}var xQ=_.forwardRef((e,t)=>_.createElement(Zd,bQ({},e,{ref:t,icon:yQ.default}))),SQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z`}}]},name:`moon`,theme:`outlined`}}))());function CQ(){return CQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CQ.apply(this,arguments)}var wQ=_.forwardRef((e,t)=>_.createElement(Zd,CQ({},e,{ref:t,icon:SQ.default}))),TQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM492 400h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm0 144h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H492c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zM340 368a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0zm0 144a40 40 0 1080 0 40 40 0 10-80 0z`}}]},name:`profile`,theme:`outlined`}}))());function EQ(){return EQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EQ.apply(this,arguments)}var DQ=_.forwardRef((e,t)=>_.createElement(Zd,EQ({},e,{ref:t,icon:TQ.default}))),OQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3-15.4 12.3-16.6 35.4-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8z`}}]},name:`pushpin`,theme:`filled`}}))());function kQ(){return kQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kQ.apply(this,arguments)}var AQ=_.forwardRef((e,t)=>_.createElement(Zd,kQ({},e,{ref:t,icon:OQ.default}))),jQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z`}}]},name:`rollback`,theme:`outlined`}}))());function MQ(){return MQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MQ.apply(this,arguments)}var NQ=_.forwardRef((e,t)=>_.createElement(Zd,MQ({},e,{ref:t,icon:jQ.default}))),PQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z`}}]},name:`safety-certificate`,theme:`outlined`}}))());function FQ(){return FQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FQ.apply(this,arguments)}var IQ=_.forwardRef((e,t)=>_.createElement(Zd,FQ({},e,{ref:t,icon:PQ.default}))),LQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z`}}]},name:`setting`,theme:`outlined`}}))());function RQ(){return RQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RQ.apply(this,arguments)}var zQ=_.forwardRef((e,t)=>_.createElement(Zd,RQ({},e,{ref:t,icon:LQ.default}))),BQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0014.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0015.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0038.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 01512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 01-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z`}}]},name:`shop`,theme:`outlined`}}))());function VQ(){return VQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VQ.apply(this,arguments)}var HQ=_.forwardRef((e,t)=>_.createElement(Zd,VQ({},e,{ref:t,icon:BQ.default}))),UQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z`}}]},name:`sun`,theme:`outlined`}}))());function WQ(){return WQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WQ.apply(this,arguments)}var GQ=_.forwardRef((e,t)=>_.createElement(Zd,WQ({},e,{ref:t,icon:UQ.default}))),KQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z`}}]},name:`thunderbolt`,theme:`outlined`}}))());function qQ(){return qQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qQ.apply(this,arguments)}var JQ=_.forwardRef((e,t)=>_.createElement(Zd,qQ({},e,{ref:t,icon:KQ.default}))),YQ=c(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z`}}]},name:`upload`,theme:`outlined`}}))());function XQ(){return XQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XQ.apply(this,arguments)}var ZQ=_.forwardRef((e,t)=>_.createElement(Zd,XQ({},e,{ref:t,icon:YQ.default}))),QQ=[`applied`,`screening`,`interview`,`offer`,`rejected`,`withdrawn`,`ghosted`],$Q=[`applied`,`screening`,`interview`,`offer`];function e$(e){let t=$Q.indexOf(e);return t===-1||t===$Q.length-1?null:$Q[t+1]??null}var t$={applied:`blue`,screening:`cyan`,interview:`gold`,offer:`green`,rejected:`red`,withdrawn:`default`,ghosted:`purple`},n$={applied:`Applied`,screening:`Screening`,interview:`Interview`,offer:`Offer`,rejected:`Rejected`,withdrawn:`Withdrawn`,ghosted:`Ghosted`},r$=[`remote`,`hybrid`,`onsite`,`unspecified`],i$={remote:`Remote`,hybrid:`Hybrid`,onsite:`On-site`,unspecified:`Unspecified`},a$=[`company`,`application`],o$=[`company`,`application`,`standalone`],s$=[`company`,`application`,`both`],c$=/^(\d{4})-(\d{2})-(\d{2})$/;function l$(e){let t=c$.exec(e);if(!t)throw Error(`Not a YYYY-MM-DD date: ${JSON.stringify(e)}`);let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(Date.UTC(n,r-1,i));if(a.getUTCFullYear()!==n||a.getUTCMonth()!==r-1||a.getUTCDate()!==i)throw Error(`Not a real calendar date: ${e}`);return a}function u$(e){let t=typeof e==`string`?l$(e):e;return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1}}function d$(e=new Date){return`${String(e.getFullYear()).padStart(4,`0`)}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}var f$=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`];function p$(e){return f$[e-1]??`Month ${e}`}var m$;function h$(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var g$=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},_$=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(m$=globalThis).__zod_globalConfig??(m$.__zod_globalConfig={});var v$=globalThis.__zod_globalConfig;function y$(e){return e&&Object.assign(v$,e),v$}function b$(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function x$(e,t){return typeof t==`bigint`?t.toString():t}function S$(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function C$(e){return e==null}function w$(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function T$(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var E$=Symbol(`evaluating`);function D$(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E$)return r===void 0&&(r=E$,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function O$(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function k$(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function A$(e){return JSON.stringify(e)}function j$(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var M$=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function N$(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var P$=S$(()=>{if(v$.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function F$(e){if(N$(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return N$(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function I$(e){return F$(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var L$=new Set([`string`,`number`,`symbol`]);function R$(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function z$(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function B$(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function V$(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var H$={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function U$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return z$(e,k$(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return O$(this,`shape`,e),e},checks:[]}))}function W$(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return z$(e,k$(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return O$(this,`shape`,r),r},checks:[]}))}function G$(e,t){if(!F$(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return z$(e,k$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return O$(this,`shape`,n),n}}))}function K$(e,t){if(!F$(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return z$(e,k$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return O$(this,`shape`,n),n}}))}function q$(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return z$(e,k$(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return O$(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function J$(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return z$(t,k$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return O$(this,`shape`,i),i},checks:[]}))}function Y$(e,t,n){return z$(t,k$(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return O$(this,`shape`,i),i}}))}function X$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Z$(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Q$(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function $$(e){return typeof e==`string`?e:e?.message}function e1(e,t,n){let r=e.message?e.message:$$(e.inst?._zod.def?.error?.(e))??$$(t?.error?.(e))??$$(n.customError?.(e))??$$(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function t1(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function n1(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var r1=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,x$,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},i1=h$(`$ZodError`,r1),a1=h$(`$ZodError`,r1,{Parent:Error});function o1(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function s1(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var c1=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new g$;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>e1(e,a,y$())));throw M$(t,i?.callee),t}return o.value},l1=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>e1(e,a,y$())));throw M$(t,i?.callee),t}return o.value},u1=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new g$;return a.issues.length?{success:!1,error:new(e??i1)(a.issues.map(e=>e1(e,i,y$())))}:{success:!0,data:a.value}},d1=u1(a1),f1=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>e1(e,i,y$())))}:{success:!0,data:a.value}},p1=f1(a1),m1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return c1(e)(t,n,i)},h1=e=>(t,n,r)=>c1(e)(t,n,r),g1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return l1(e)(t,n,i)},_1=e=>async(t,n,r)=>l1(e)(t,n,r),v1=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return u1(e)(t,n,i)},y1=e=>(t,n,r)=>u1(e)(t,n,r),b1=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return f1(e)(t,n,i)},x1=e=>async(t,n,r)=>f1(e)(t,n,r),S1=/^[cC][0-9a-z]{6,}$/,C1=/^[0-9a-z]+$/,w1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,T1=/^[0-9a-vA-V]{20}$/,E1=/^[A-Za-z0-9]{27}$/,D1=/^[a-zA-Z0-9_-]{21}$/,O1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,k1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,A1=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,j1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,M1=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function N1(){return new RegExp(M1,`u`)}var P1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,F1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,I1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,L1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,R1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,z1=/^[A-Za-z0-9_-]*$/,B1=/^https?$/,V1=/^\+[1-9]\d{6,14}$/,H1=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,U1=RegExp(`^${H1}$`);function W1(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function G1(e){return RegExp(`^${W1(e)}$`)}function K1(e){let t=W1({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${H1}T(?:${r})$`)}var q1=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},J1=/^-?\d+$/,Y1=/^-?\d+(?:\.\d+)?$/,X1=/^(?:true|false)$/i,Z1=/^[^A-Z]*$/,Q1=/^[^a-z]*$/,$1=h$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),e0={number:`number`,bigint:`bigint`,object:`date`},t0=h$(`$ZodCheckLessThan`,(e,t)=>{$1.init(e,t);let n=e0[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),n0=h$(`$ZodCheckGreaterThan`,(e,t)=>{$1.init(e,t);let n=e0[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),r0=h$(`$ZodCheckMultipleOf`,(e,t)=>{$1.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):T$(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),i0=h$(`$ZodCheckNumberFormat`,(e,t)=>{$1.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=H$[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=J1)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),a0=h$(`$ZodCheckMaxLength`,(e,t)=>{var n;$1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!C$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=t1(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),o0=h$(`$ZodCheckMinLength`,(e,t)=>{var n;$1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!C$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=t1(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),s0=h$(`$ZodCheckLengthEquals`,(e,t)=>{var n;$1.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!C$(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=t1(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),c0=h$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;$1.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),l0=h$(`$ZodCheckRegex`,(e,t)=>{c0.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),u0=h$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Z1,c0.init(e,t)}),d0=h$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Q1,c0.init(e,t)}),f0=h$(`$ZodCheckIncludes`,(e,t)=>{$1.init(e,t);let n=R$(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),p0=h$(`$ZodCheckStartsWith`,(e,t)=>{$1.init(e,t);let n=RegExp(`^${R$(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),m0=h$(`$ZodCheckEndsWith`,(e,t)=>{$1.init(e,t);let n=RegExp(`.*${R$(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),h0=h$(`$ZodCheckOverwrite`,(e,t)=>{$1.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),g0=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
381
381
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
382
|
-
`))}},
|
|
382
|
+
`))}},_0={major:4,minor:4,patch:3},v0=h$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_0;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=X$(e),i;for(let a of t){if(a._zod.def.when){if(Z$(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new g$;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=X$(e,t))});else{if(e.issues.length===t)continue;r||=X$(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(X$(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new g$;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new g$;return o.then(e=>t(e,r,a))}return t(o,r,a)}}D$(e,`~standard`,()=>({validate:t=>{try{let n=d1(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return p1(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),y0=h$(`$ZodString`,(e,t)=>{v0.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??q1(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),b0=h$(`$ZodStringFormat`,(e,t)=>{c0.init(e,t),y0.init(e,t)}),x0=h$(`$ZodGUID`,(e,t)=>{t.pattern??=k1,b0.init(e,t)}),S0=h$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=A1(e)}else t.pattern??=A1();b0.init(e,t)}),C0=h$(`$ZodEmail`,(e,t)=>{t.pattern??=j1,b0.init(e,t)}),w0=h$(`$ZodURL`,(e,t)=>{b0.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===B1.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),T0=h$(`$ZodEmoji`,(e,t)=>{t.pattern??=N1(),b0.init(e,t)}),E0=h$(`$ZodNanoID`,(e,t)=>{t.pattern??=D1,b0.init(e,t)}),D0=h$(`$ZodCUID`,(e,t)=>{t.pattern??=S1,b0.init(e,t)}),O0=h$(`$ZodCUID2`,(e,t)=>{t.pattern??=C1,b0.init(e,t)}),k0=h$(`$ZodULID`,(e,t)=>{t.pattern??=w1,b0.init(e,t)}),A0=h$(`$ZodXID`,(e,t)=>{t.pattern??=T1,b0.init(e,t)}),j0=h$(`$ZodKSUID`,(e,t)=>{t.pattern??=E1,b0.init(e,t)}),M0=h$(`$ZodISODateTime`,(e,t)=>{t.pattern??=K1(t),b0.init(e,t)}),N0=h$(`$ZodISODate`,(e,t)=>{t.pattern??=U1,b0.init(e,t)}),P0=h$(`$ZodISOTime`,(e,t)=>{t.pattern??=G1(t),b0.init(e,t)}),F0=h$(`$ZodISODuration`,(e,t)=>{t.pattern??=O1,b0.init(e,t)}),I0=h$(`$ZodIPv4`,(e,t)=>{t.pattern??=P1,b0.init(e,t),e._zod.bag.format=`ipv4`}),L0=h$(`$ZodIPv6`,(e,t)=>{t.pattern??=F1,b0.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),R0=h$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=I1,b0.init(e,t)}),z0=h$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=L1,b0.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function B0(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var V0=h$(`$ZodBase64`,(e,t)=>{t.pattern??=R1,b0.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{B0(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function H0(e){if(!z1.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return B0(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var U0=h$(`$ZodBase64URL`,(e,t)=>{t.pattern??=z1,b0.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{H0(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),W0=h$(`$ZodE164`,(e,t)=>{t.pattern??=V1,b0.init(e,t)});function G0(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var K0=h$(`$ZodJWT`,(e,t)=>{b0.init(e,t),e._zod.check=n=>{G0(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),q0=h$(`$ZodNumber`,(e,t)=>{v0.init(e,t),e._zod.pattern=e._zod.bag.pattern??Y1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),J0=h$(`$ZodNumberFormat`,(e,t)=>{i0.init(e,t),q0.init(e,t)}),Y0=h$(`$ZodBoolean`,(e,t)=>{v0.init(e,t),e._zod.pattern=X1,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),X0=h$(`$ZodUnknown`,(e,t)=>{v0.init(e,t),e._zod.parse=e=>e}),Z0=h$(`$ZodNever`,(e,t)=>{v0.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Q0(e,t,n){e.issues.length&&t.issues.push(...Q$(n,e.issues)),t.value[n]=e.value}var $0=h$(`$ZodArray`,(e,t)=>{v0.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Q0(t,n,e))):Q0(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function e2(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Q$(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function t2(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=V$(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function n2(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>e2(e,n,i,t,u,d))):e2(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var r2=h$(`$ZodObject`,(e,t)=>{if(v0.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=S$(()=>t2(t));D$(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=N$,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>e2(n,t,e,s,r,i))):e2(a,t,e,s,r,i)}return i?n2(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),i2=h$(`$ZodObjectJIT`,(e,t)=>{r2.init(e,t);let n=e._zod.parse,r=S$(()=>t2(t)),i=e=>{let t=new g0([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=A$(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=A$(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
383
383
|
if (${n}.issues.length) {
|
|
384
384
|
if (${o} in input) {
|
|
385
385
|
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
@@ -438,7 +438,9 @@ html body {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=A$,s=!h$.jitless,c=s&&j$.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?$0([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function n2(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!q$(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Z$(e,r,g$())))}),t)}var r2=f$(`$ZodUnion`,(e,t)=>{h0.init(e,t),w$(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),w$(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),w$(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),w$(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>x$(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>n2(t,r,e,i)):n2(o,r,e,i)}}),i2=f$(`$ZodIntersection`,(e,t)=>{h0.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>o2(e,t,n)):o2(e,i,a)}});function a2(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(M$(e)&&M$(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=a2(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=a2(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function o2(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),q$(e))return e;let o=a2(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var s2=f$(`$ZodEnum`,(e,t)=>{h0.init(e,t);let n=_$(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>P$.has(typeof e)).map(e=>typeof e==`string`?F$(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),c2=f$(`$ZodTransform`,(e,t)=>{h0.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new m$(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new p$;return n.value=i,n.fallback=!0,n}});function l2(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var u2=f$(`$ZodOptional`,(e,t)=>{h0.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,w$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),w$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${x$(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>l2(e,r)):l2(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),d2=f$(`$ZodExactOptional`,(e,t)=>{u2.init(e,t),w$(e._zod,`values`,()=>t.innerType._zod.values),w$(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),f2=f$(`$ZodNullable`,(e,t)=>{h0.init(e,t),w$(e._zod,`optin`,()=>t.innerType._zod.optin),w$(e._zod,`optout`,()=>t.innerType._zod.optout),w$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${x$(e.source)}|null)$`):void 0}),w$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),p2=f$(`$ZodDefault`,(e,t)=>{h0.init(e,t),e._zod.optin=`optional`,w$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>m2(e,t)):m2(r,t)}});function m2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var h2=f$(`$ZodPrefault`,(e,t)=>{h0.init(e,t),e._zod.optin=`optional`,w$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),g2=f$(`$ZodNonOptional`,(e,t)=>{h0.init(e,t),w$(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>_2(t,e)):_2(i,e)}});function _2(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var v2=f$(`$ZodCatch`,(e,t)=>{h0.init(e,t),e._zod.optin=`optional`,w$(e._zod,`optout`,()=>t.innerType._zod.optout),w$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Z$(e,n,g$()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Z$(e,n,g$()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),y2=f$(`$ZodPipe`,(e,t)=>{h0.init(e,t),w$(e._zod,`values`,()=>t.in._zod.values),w$(e._zod,`optin`,()=>t.in._zod.optin),w$(e._zod,`optout`,()=>t.out._zod.optout),w$(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>b2(e,t.in,n)):b2(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>b2(e,t.out,n)):b2(r,t.out,n)}});function b2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var x2=f$(`$ZodPreprocess`,(e,t)=>{y2.init(e,t)}),S2=f$(`$ZodReadonly`,(e,t)=>{h0.init(e,t),w$(e._zod,`propValues`,()=>t.innerType._zod.propValues),w$(e._zod,`values`,()=>t.innerType._zod.values),w$(e._zod,`optin`,()=>t.innerType?._zod?.optin),w$(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(C2):C2(r)}});function C2(e){return e.value=Object.freeze(e.value),e}var w2=f$(`$ZodCustom`,(e,t)=>{X1.init(e,t),h0.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>T2(t,n,r,e));T2(i,n,r,e)}});function T2(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push($$(e))}}var E2,D2=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function O2(){return new D2}(E2=globalThis).__zod_globalRegistry??(E2.__zod_globalRegistry=O2());var k2=globalThis.__zod_globalRegistry;function A2(e,t){return new e({type:`string`,...L$(t)})}function j2(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...L$(t)})}function M2(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...L$(t)})}function N2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...L$(t)})}function P2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...L$(t)})}function F2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...L$(t)})}function I2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...L$(t)})}function L2(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...L$(t)})}function R2(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...L$(t)})}function z2(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...L$(t)})}function B2(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...L$(t)})}function V2(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...L$(t)})}function H2(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...L$(t)})}function U2(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...L$(t)})}function W2(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...L$(t)})}function G2(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...L$(t)})}function K2(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...L$(t)})}function q2(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...L$(t)})}function J2(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...L$(t)})}function Y2(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...L$(t)})}function X2(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...L$(t)})}function Z2(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...L$(t)})}function Q2(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...L$(t)})}function $2(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...L$(t)})}function e4(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...L$(t)})}function t4(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...L$(t)})}function n4(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...L$(t)})}function r4(e,t){return new e({type:`number`,checks:[],...L$(t)})}function i4(e,t){return new e({type:`number`,coerce:!0,checks:[],...L$(t)})}function a4(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...L$(t)})}function o4(e,t){return new e({type:`boolean`,...L$(t)})}function s4(e){return new e({type:`unknown`})}function c4(e,t){return new e({type:`never`,...L$(t)})}function l4(e,t){return new Q1({check:`less_than`,...L$(t),value:e,inclusive:!1})}function u4(e,t){return new Q1({check:`less_than`,...L$(t),value:e,inclusive:!0})}function d4(e,t){return new $1({check:`greater_than`,...L$(t),value:e,inclusive:!1})}function f4(e,t){return new $1({check:`greater_than`,...L$(t),value:e,inclusive:!0})}function p4(e,t){return new e0({check:`multiple_of`,...L$(t),value:e})}function m4(e,t){return new n0({check:`max_length`,...L$(t),maximum:e})}function h4(e,t){return new r0({check:`min_length`,...L$(t),minimum:e})}function g4(e,t){return new i0({check:`length_equals`,...L$(t),length:e})}function _4(e,t){return new o0({check:`string_format`,format:`regex`,...L$(t),pattern:e})}function v4(e){return new s0({check:`string_format`,format:`lowercase`,...L$(e)})}function y4(e){return new c0({check:`string_format`,format:`uppercase`,...L$(e)})}function b4(e,t){return new l0({check:`string_format`,format:`includes`,...L$(t),includes:e})}function x4(e,t){return new u0({check:`string_format`,format:`starts_with`,...L$(t),prefix:e})}function S4(e,t){return new d0({check:`string_format`,format:`ends_with`,...L$(t),suffix:e})}function C4(e){return new f0({check:`overwrite`,tx:e})}function w4(e){return C4(t=>t.normalize(e))}function T4(){return C4(e=>e.trim())}function E4(){return C4(e=>e.toLowerCase())}function D4(){return C4(e=>e.toUpperCase())}function O4(){return C4(e=>O$(e))}function k4(e,t,n){return new e({type:`array`,element:t,...L$(n)})}function A4(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...L$(n)})}function j4(e,t){let n=M4(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push($$(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push($$(r))}},e(t.value,t)),t);return n}function M4(e,t){let n=new X1({check:`custom`,...L$(t)});return n._zod.check=e,n}function N4(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??k2,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function P4(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,P4(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&L4(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function F4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
441
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=N$,s=!v$.jitless,c=s&&P$.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?n2([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function a2(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!X$(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>e1(e,r,y$())))}),t)}var o2=h$(`$ZodUnion`,(e,t)=>{v0.init(e,t),D$(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),D$(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),D$(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),D$(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>w$(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>a2(t,r,e,i)):a2(o,r,e,i)}}),s2=h$(`$ZodIntersection`,(e,t)=>{v0.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>l2(e,t,n)):l2(e,i,a)}});function c2(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(F$(e)&&F$(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=c2(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=c2(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function l2(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),X$(e))return e;let o=c2(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var u2=h$(`$ZodEnum`,(e,t)=>{v0.init(e,t);let n=b$(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>L$.has(typeof e)).map(e=>typeof e==`string`?R$(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),d2=h$(`$ZodTransform`,(e,t)=>{v0.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new _$(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new g$;return n.value=i,n.fallback=!0,n}});function f2(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var p2=h$(`$ZodOptional`,(e,t)=>{v0.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,D$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${w$(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>f2(e,r)):f2(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),m2=h$(`$ZodExactOptional`,(e,t)=>{p2.init(e,t),D$(e._zod,`values`,()=>t.innerType._zod.values),D$(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),h2=h$(`$ZodNullable`,(e,t)=>{v0.init(e,t),D$(e._zod,`optin`,()=>t.innerType._zod.optin),D$(e._zod,`optout`,()=>t.innerType._zod.optout),D$(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${w$(e.source)}|null)$`):void 0}),D$(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),g2=h$(`$ZodDefault`,(e,t)=>{v0.init(e,t),e._zod.optin=`optional`,D$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>_2(e,t)):_2(r,t)}});function _2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var v2=h$(`$ZodPrefault`,(e,t)=>{v0.init(e,t),e._zod.optin=`optional`,D$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),y2=h$(`$ZodNonOptional`,(e,t)=>{v0.init(e,t),D$(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>b2(t,e)):b2(i,e)}});function b2(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var x2=h$(`$ZodCatch`,(e,t)=>{v0.init(e,t),e._zod.optin=`optional`,D$(e._zod,`optout`,()=>t.innerType._zod.optout),D$(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>e1(e,n,y$()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>e1(e,n,y$()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),S2=h$(`$ZodPipe`,(e,t)=>{v0.init(e,t),D$(e._zod,`values`,()=>t.in._zod.values),D$(e._zod,`optin`,()=>t.in._zod.optin),D$(e._zod,`optout`,()=>t.out._zod.optout),D$(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>C2(e,t.in,n)):C2(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>C2(e,t.out,n)):C2(r,t.out,n)}});function C2(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var w2=h$(`$ZodPreprocess`,(e,t)=>{S2.init(e,t)}),T2=h$(`$ZodReadonly`,(e,t)=>{v0.init(e,t),D$(e._zod,`propValues`,()=>t.innerType._zod.propValues),D$(e._zod,`values`,()=>t.innerType._zod.values),D$(e._zod,`optin`,()=>t.innerType?._zod?.optin),D$(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(E2):E2(r)}});function E2(e){return e.value=Object.freeze(e.value),e}var D2=h$(`$ZodCustom`,(e,t)=>{$1.init(e,t),v0.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>O2(t,n,r,e));O2(i,n,r,e)}});function O2(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(n1(e))}}var k2,A2=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function j2(){return new A2}(k2=globalThis).__zod_globalRegistry??(k2.__zod_globalRegistry=j2());var M2=globalThis.__zod_globalRegistry;function N2(e,t){return new e({type:`string`,...B$(t)})}function P2(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B$(t)})}function F2(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B$(t)})}function I2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B$(t)})}function L2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B$(t)})}function R2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B$(t)})}function z2(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B$(t)})}function B2(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B$(t)})}function V2(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B$(t)})}function H2(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B$(t)})}function U2(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B$(t)})}function W2(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B$(t)})}function G2(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B$(t)})}function K2(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B$(t)})}function q2(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B$(t)})}function J2(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B$(t)})}function Y2(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B$(t)})}function X2(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B$(t)})}function Z2(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B$(t)})}function Q2(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B$(t)})}function $2(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B$(t)})}function e4(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B$(t)})}function t4(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B$(t)})}function n4(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B$(t)})}function r4(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B$(t)})}function i4(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B$(t)})}function a4(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B$(t)})}function o4(e,t){return new e({type:`number`,checks:[],...B$(t)})}function s4(e,t){return new e({type:`number`,coerce:!0,checks:[],...B$(t)})}function c4(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B$(t)})}function l4(e,t){return new e({type:`boolean`,...B$(t)})}function u4(e){return new e({type:`unknown`})}function d4(e,t){return new e({type:`never`,...B$(t)})}function f4(e,t){return new t0({check:`less_than`,...B$(t),value:e,inclusive:!1})}function p4(e,t){return new t0({check:`less_than`,...B$(t),value:e,inclusive:!0})}function m4(e,t){return new n0({check:`greater_than`,...B$(t),value:e,inclusive:!1})}function h4(e,t){return new n0({check:`greater_than`,...B$(t),value:e,inclusive:!0})}function g4(e,t){return new r0({check:`multiple_of`,...B$(t),value:e})}function _4(e,t){return new a0({check:`max_length`,...B$(t),maximum:e})}function v4(e,t){return new o0({check:`min_length`,...B$(t),minimum:e})}function y4(e,t){return new s0({check:`length_equals`,...B$(t),length:e})}function b4(e,t){return new l0({check:`string_format`,format:`regex`,...B$(t),pattern:e})}function x4(e){return new u0({check:`string_format`,format:`lowercase`,...B$(e)})}function S4(e){return new d0({check:`string_format`,format:`uppercase`,...B$(e)})}function C4(e,t){return new f0({check:`string_format`,format:`includes`,...B$(t),includes:e})}function w4(e,t){return new p0({check:`string_format`,format:`starts_with`,...B$(t),prefix:e})}function T4(e,t){return new m0({check:`string_format`,format:`ends_with`,...B$(t),suffix:e})}function E4(e){return new h0({check:`overwrite`,tx:e})}function D4(e){return E4(t=>t.normalize(e))}function O4(){return E4(e=>e.trim())}function k4(){return E4(e=>e.toLowerCase())}function A4(){return E4(e=>e.toUpperCase())}function j4(){return E4(e=>j$(e))}function M4(e,t,n){return new e({type:`array`,element:t,...B$(n)})}function N4(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B$(n)})}function P4(e,t){let n=F4(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(n1(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(n1(r))}},e(t.value,t)),t);return n}function F4(e,t){let n=new $1({check:`custom`,...B$(t)});return n._zod.check=e,n}function I4(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??M2,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function L4(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,L4(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&B4(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function R4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
442
442
|
|
|
443
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function I4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:z4(t,`input`,e.processors),output:z4(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L4(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return L4(r.element,n);if(r.type===`set`)return L4(r.valueType,n);if(r.type===`lazy`)return L4(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return L4(r.innerType,n);if(r.type===`intersection`)return L4(r.left,n)||L4(r.right,n);if(r.type===`record`||r.type===`map`)return L4(r.keyType,n)||L4(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:L4(r.in,n)||L4(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L4(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L4(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L4(e,n))return!0;return!!(r.rest&&L4(r.rest,n))}return!1}var R4=(e,t={})=>n=>{let r=N4({...n,processors:t});return P4(e,r),F4(r,e),I4(r,e)},z4=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=N4({...i??{},target:a,io:t,processors:n});return P4(e,o),F4(o,e),I4(o,e)},B4={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},V4=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=B4[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},H4=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},U4=(e,t,n,r)=>{n.type=`boolean`},W4=(e,t,n,r)=>{n.not={}},G4=(e,t,n,r)=>{let i=e._zod.def,a=_$(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},K4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},q4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},J4=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=P4(a.element,t,{...r,path:[...r.path,`items`]})},Y4=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=P4(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=P4(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},X4=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>P4(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Z4=(e,t,n,r)=>{let i=e._zod.def,a=P4(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=P4(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Q4=(e,t,n,r)=>{let i=e._zod.def,a=P4(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},$4=(e,t,n,r)=>{let i=e._zod.def;P4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},e3=(e,t,n,r)=>{let i=e._zod.def;P4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},t3=(e,t,n,r)=>{let i=e._zod.def;P4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},n3=(e,t,n,r)=>{let i=e._zod.def;P4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},r3=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;P4(o,t,r);let s=t.seen.get(e);s.ref=o},i3=(e,t,n,r)=>{let i=e._zod.def;P4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},a3=(e,t,n,r)=>{let i=e._zod.def;P4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},o3=f$(`ZodISODateTime`,(e,t)=>{k0.init(e,t),N3.init(e,t)});function s3(e){return $2(o3,e)}var c3=f$(`ZodISODate`,(e,t)=>{A0.init(e,t),N3.init(e,t)});function l3(e){return e4(c3,e)}var u3=f$(`ZodISOTime`,(e,t)=>{j0.init(e,t),N3.init(e,t)});function d3(e){return t4(u3,e)}var f3=f$(`ZodISODuration`,(e,t)=>{M0.init(e,t),N3.init(e,t)});function p3(e){return n4(f3,e)}var m3=f$(`ZodError`,(e,t)=>{t1.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>i1(e,t)},flatten:{value:t=>r1(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,v$,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,v$,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),h3=a1(m3),g3=o1(m3),_3=s1(m3),v3=l1(m3),y3=d1(m3),b3=f1(m3),x3=p1(m3),S3=m1(m3),C3=h1(m3),w3=g1(m3),T3=_1(m3),E3=v1(m3),D3=new WeakMap;function O3(e,t,n){let r=Object.getPrototypeOf(e),i=D3.get(r);if(i||(i=new Set,D3.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var k3=f$(`ZodType`,(e,t)=>(h0.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:z4(e,`input`),output:z4(e,`output`)}}),e.toJSONSchema=R4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>h3(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>_3(e,t,n),e.parseAsync=async(t,n)=>g3(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>v3(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>y3(e,t,n),e.decode=(t,n)=>b3(e,t,n),e.encodeAsync=async(t,n)=>x3(e,t,n),e.decodeAsync=async(t,n)=>S3(e,t,n),e.safeEncode=(t,n)=>C3(e,t,n),e.safeDecode=(t,n)=>w3(e,t,n),e.safeEncodeAsync=async(t,n)=>T3(e,t,n),e.safeDecodeAsync=async(t,n)=>E3(e,t,n),O3(e,`ZodType`,{check(...e){let t=this.def;return this.clone(E$(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return I$(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(H6(e,t))},superRefine(e,t){return this.check(U6(e,t))},overwrite(e){return this.check(C4(e))},optional(){return C6(this)},exactOptional(){return T6(this)},nullable(){return D6(this)},nullish(){return C6(D6(this))},nonoptional(e){return N6(this,e)},array(){return d6(this)},or(e){return h6([this,e])},and(e){return _6(this,e)},transform(e){return L6(this,x6(e))},default(e){return k6(this,e)},prefault(e){return j6(this,e)},catch(e){return F6(this,e)},pipe(e){return L6(this,e)},readonly(){return B6(this)},describe(e){let t=this.clone();return k2.add(t,{description:e}),t},meta(...e){if(e.length===0)return k2.get(this);let t=this.clone();return k2.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return k2.get(e)?.description},configurable:!0}),e)),A3=f$(`_ZodString`,(e,t)=>{g0.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>V4(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,O3(e,`_ZodString`,{regex(...e){return this.check(_4(...e))},includes(...e){return this.check(b4(...e))},startsWith(...e){return this.check(x4(...e))},endsWith(...e){return this.check(S4(...e))},min(...e){return this.check(h4(...e))},max(...e){return this.check(m4(...e))},length(...e){return this.check(g4(...e))},nonempty(...e){return this.check(h4(1,...e))},lowercase(e){return this.check(v4(e))},uppercase(e){return this.check(y4(e))},trim(){return this.check(T4())},normalize(...e){return this.check(w4(...e))},toLowerCase(){return this.check(E4())},toUpperCase(){return this.check(D4())},slugify(){return this.check(O4())}})}),j3=f$(`ZodString`,(e,t)=>{g0.init(e,t),A3.init(e,t),e.email=t=>e.check(j2(P3,t)),e.url=t=>e.check(L2(R3,t)),e.jwt=t=>e.check(Q2($3,t)),e.emoji=t=>e.check(R2(z3,t)),e.guid=t=>e.check(M2(F3,t)),e.uuid=t=>e.check(N2(I3,t)),e.uuidv4=t=>e.check(P2(I3,t)),e.uuidv6=t=>e.check(F2(I3,t)),e.uuidv7=t=>e.check(I2(I3,t)),e.nanoid=t=>e.check(z2(B3,t)),e.guid=t=>e.check(M2(F3,t)),e.cuid=t=>e.check(B2(V3,t)),e.cuid2=t=>e.check(V2(H3,t)),e.ulid=t=>e.check(H2(U3,t)),e.base64=t=>e.check(Y2(X3,t)),e.base64url=t=>e.check(X2(Z3,t)),e.xid=t=>e.check(U2(W3,t)),e.ksuid=t=>e.check(W2(G3,t)),e.ipv4=t=>e.check(G2(K3,t)),e.ipv6=t=>e.check(K2(q3,t)),e.cidrv4=t=>e.check(q2(J3,t)),e.cidrv6=t=>e.check(J2(Y3,t)),e.e164=t=>e.check(Z2(Q3,t)),e.datetime=t=>e.check(s3(t)),e.date=t=>e.check(l3(t)),e.time=t=>e.check(d3(t)),e.duration=t=>e.check(p3(t))});function M3(e){return A2(j3,e)}var N3=f$(`ZodStringFormat`,(e,t)=>{_0.init(e,t),A3.init(e,t)}),P3=f$(`ZodEmail`,(e,t)=>{b0.init(e,t),N3.init(e,t)}),F3=f$(`ZodGUID`,(e,t)=>{v0.init(e,t),N3.init(e,t)}),I3=f$(`ZodUUID`,(e,t)=>{y0.init(e,t),N3.init(e,t)});function L3(e){return N2(I3,e)}var R3=f$(`ZodURL`,(e,t)=>{x0.init(e,t),N3.init(e,t)}),z3=f$(`ZodEmoji`,(e,t)=>{S0.init(e,t),N3.init(e,t)}),B3=f$(`ZodNanoID`,(e,t)=>{C0.init(e,t),N3.init(e,t)}),V3=f$(`ZodCUID`,(e,t)=>{w0.init(e,t),N3.init(e,t)}),H3=f$(`ZodCUID2`,(e,t)=>{T0.init(e,t),N3.init(e,t)}),U3=f$(`ZodULID`,(e,t)=>{E0.init(e,t),N3.init(e,t)}),W3=f$(`ZodXID`,(e,t)=>{D0.init(e,t),N3.init(e,t)}),G3=f$(`ZodKSUID`,(e,t)=>{O0.init(e,t),N3.init(e,t)}),K3=f$(`ZodIPv4`,(e,t)=>{N0.init(e,t),N3.init(e,t)}),q3=f$(`ZodIPv6`,(e,t)=>{P0.init(e,t),N3.init(e,t)}),J3=f$(`ZodCIDRv4`,(e,t)=>{F0.init(e,t),N3.init(e,t)}),Y3=f$(`ZodCIDRv6`,(e,t)=>{I0.init(e,t),N3.init(e,t)}),X3=f$(`ZodBase64`,(e,t)=>{R0.init(e,t),N3.init(e,t)}),Z3=f$(`ZodBase64URL`,(e,t)=>{B0.init(e,t),N3.init(e,t)}),Q3=f$(`ZodE164`,(e,t)=>{V0.init(e,t),N3.init(e,t)}),$3=f$(`ZodJWT`,(e,t)=>{U0.init(e,t),N3.init(e,t)}),e6=f$(`ZodNumber`,(e,t)=>{W0.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>H4(e,t,n,r),O3(e,`ZodNumber`,{gt(e,t){return this.check(d4(e,t))},gte(e,t){return this.check(f4(e,t))},min(e,t){return this.check(f4(e,t))},lt(e,t){return this.check(l4(e,t))},lte(e,t){return this.check(u4(e,t))},max(e,t){return this.check(u4(e,t))},int(e){return this.check(r6(e))},safe(e){return this.check(r6(e))},positive(e){return this.check(d4(0,e))},nonnegative(e){return this.check(f4(0,e))},negative(e){return this.check(l4(0,e))},nonpositive(e){return this.check(u4(0,e))},multipleOf(e,t){return this.check(p4(e,t))},step(e,t){return this.check(p4(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function t6(e){return r4(e6,e)}var n6=f$(`ZodNumberFormat`,(e,t)=>{G0.init(e,t),e6.init(e,t)});function r6(e){return a4(n6,e)}var i6=f$(`ZodBoolean`,(e,t)=>{K0.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>U4(e,t,n,r)});function a6(e){return o4(i6,e)}var o6=f$(`ZodUnknown`,(e,t)=>{q0.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function s6(){return s4(o6)}var c6=f$(`ZodNever`,(e,t)=>{J0.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>W4(e,t,n,r)});function l6(e){return c4(c6,e)}var u6=f$(`ZodArray`,(e,t)=>{X0.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>J4(e,t,n,r),e.element=t.element,O3(e,`ZodArray`,{min(e,t){return this.check(h4(e,t))},nonempty(e){return this.check(h4(1,e))},max(e,t){return this.check(m4(e,t))},length(e,t){return this.check(g4(e,t))},unwrap(){return this.element}})});function d6(e,t){return k4(u6,e,t)}var f6=f$(`ZodObject`,(e,t)=>{t2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y4(e,t,n,r),w$(e,`shape`,()=>t.shape),O3(e,`ZodObject`,{keyof(){return y6(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:s6()})},loose(){return this.clone({...this._zod.def,catchall:s6()})},strict(){return this.clone({...this._zod.def,catchall:l6()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return H$(this,e)},safeExtend(e){return U$(this,e)},merge(e){return W$(this,e)},pick(e){return B$(this,e)},omit(e){return V$(this,e)},partial(...e){return G$(S6,this,e[0])},required(...e){return K$(M6,this,e[0])}})});function p6(e,t){return new f6({type:`object`,shape:e??{},...L$(t)})}var m6=f$(`ZodUnion`,(e,t)=>{r2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>X4(e,t,n,r),e.options=t.options});function h6(e,t){return new m6({type:`union`,options:e,...L$(t)})}var g6=f$(`ZodIntersection`,(e,t)=>{i2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Z4(e,t,n,r)});function _6(e,t){return new g6({type:`intersection`,left:e,right:t})}var v6=f$(`ZodEnum`,(e,t)=>{s2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G4(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new v6({...t,checks:[],...L$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new v6({...t,checks:[],...L$(r),entries:i})}});function y6(e,t){return new v6({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L$(t)})}var b6=f$(`ZodTransform`,(e,t)=>{c2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>q4(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new m$(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push($$(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push($$(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function x6(e){return new b6({type:`transform`,transform:e})}var S6=f$(`ZodOptional`,(e,t)=>{u2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>a3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function C6(e){return new S6({type:`optional`,innerType:e})}var w6=f$(`ZodExactOptional`,(e,t)=>{d2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>a3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function T6(e){return new w6({type:`optional`,innerType:e})}var E6=f$(`ZodNullable`,(e,t)=>{f2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Q4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function D6(e){return new E6({type:`nullable`,innerType:e})}var O6=f$(`ZodDefault`,(e,t)=>{p2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>e3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function k6(e,t){return new O6({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():N$(t)}})}var A6=f$(`ZodPrefault`,(e,t)=>{h2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>t3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function j6(e,t){return new A6({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():N$(t)}})}var M6=f$(`ZodNonOptional`,(e,t)=>{g2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$4(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function N6(e,t){return new M6({type:`nonoptional`,innerType:e,...L$(t)})}var P6=f$(`ZodCatch`,(e,t)=>{v2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function F6(e,t){return new P6({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var I6=f$(`ZodPipe`,(e,t)=>{y2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>r3(e,t,n,r),e.in=t.in,e.out=t.out});function L6(e,t){return new I6({type:`pipe`,in:e,out:t})}var R6=f$(`ZodPreprocess`,(e,t)=>{I6.init(e,t),x2.init(e,t)}),z6=f$(`ZodReadonly`,(e,t)=>{S2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function B6(e){return new z6({type:`readonly`,innerType:e})}var V6=f$(`ZodCustom`,(e,t)=>{w2.init(e,t),k3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>K4(e,t,n,r)});function H6(e,t={}){return A4(V6,e,t)}function U6(e,t){return j4(e,t)}function W6(e,t){return new R6({type:`pipe`,in:x6(e),out:t})}function G6(e){return i4(e6,e)}var K6=M3().regex(/^\d{4}-\d{2}-\d{2}$/,`Expected a YYYY-MM-DD date`),q6=e=>M3().trim().max(e).nullish().transform(e=>e==null||e===``?null:e),J6=y6(YQ),Y6=y6(e$),X6=y6(r$),Z6=y6(i$);y6(n$);var Q6=d6(M3().trim().min(1).max(60)).max(30);p6({companyName:M3().trim().min(1,`Company is required`).max(200),jobTitle:M3().trim().min(1,`Job title is required`).max(200),appliedOn:K6,status:J6.default(`applied`),jobUrl:q6(2e3),location:q6(200),workMode:Y6.default(`unspecified`),sourceName:q6(120),salaryMin:t6().int().nonnegative().nullish().transform(e=>e??null),salaryMax:t6().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:q6(8),followUpOn:K6.nullish().transform(e=>e??null),tags:Q6.default([]),notes:q6(2e4)}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),p6({companyName:M3().trim().min(1).max(200).optional(),jobTitle:M3().trim().min(1).max(200).optional(),appliedOn:K6.optional(),status:J6.optional(),statusComment:M3().trim().max(2e3).nullish(),jobUrl:q6(2e3).optional(),location:q6(200).optional(),workMode:Y6.optional(),sourceName:q6(120).optional(),salaryMin:t6().int().nonnegative().nullish(),salaryMax:t6().int().nonnegative().nullish(),salaryCurrency:q6(8).optional(),followUpOn:K6.nullish(),archived:a6().optional(),tags:Q6.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),p6({status:J6,occurredOn:K6.optional(),comment:M3().trim().max(2e3).nullish().transform(e=>e??null)});var $6=e=>W6(e=>{if(e==null)return;let t=(Array.isArray(e)?e.map(String):String(e).split(`,`)).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0},d6(e).optional()),e8=p6({q:M3().trim().max(300).optional(),year:G6().int().min(1970).max(2200).optional(),month:G6().int().min(1).max(12).optional(),status:$6(J6),workMode:$6(Y6),tags:$6(M3()),companyId:L3().optional(),source:M3().trim().max(120).optional(),from:K6.optional(),to:K6.optional(),archived:y6([`true`,`false`,`all`]).default(`false`).transform(e=>e===`all`?`all`:e===`true`),followUpDue:y6([`true`,`false`]).optional().transform(e=>e===`true`),sort:y6([`appliedOn`,`company`,`jobTitle`,`status`,`createdAt`]).default(`appliedOn`),direction:y6([`asc`,`desc`]).default(`desc`),limit:G6().int().min(1).max(200).default(50),cursor:M3().optional()});p6({company:M3().trim().min(1).max(200),title:M3().trim().max(200).optional().default(``),excludeId:L3().optional()}),p6({q:M3().trim().min(1).max(300),limit:G6().int().min(1).max(100).default(25),types:$6(y6([`application`,`company`,`note`]))}),e8.extend({format:y6([`csv`,`xlsx`]).default(`csv`)}),p6({name:M3().trim().min(1).max(200),website:q6(2e3),location:q6(200),tags:Q6.default([])}),p6({name:M3().trim().min(1).max(200).optional(),website:q6(2e3).optional(),location:q6(200).optional(),archived:a6().optional(),tags:Q6.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),p6({title:M3().trim().min(1).max(200),body:M3().max(5e4).default(``),targetType:X6.default(`standalone`),targetId:L3().nullish().transform(e=>e??null),pinned:a6().default(!1)}),p6({title:M3().trim().min(1).max(200).optional(),body:M3().max(5e4).optional(),targetType:X6.optional(),targetId:L3().nullish(),pinned:a6().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),p6({name:M3().trim().min(1).max(60),color:q6(30),scope:Z6.default(`both`)}),p6({companyName:M3().trim().min(1,`Company is required`).max(200),jobTitle:M3().trim().min(1,`Job title is required`).max(200),jobUrl:q6(2e3),location:q6(200),workMode:Y6.default(`unspecified`),sourceName:q6(120),salaryMin:t6().int().nonnegative().nullish().transform(e=>e??null),salaryMax:t6().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:q6(8),notes:q6(2e4),savedOn:K6.optional()}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),p6({companyName:M3().trim().min(1).max(200).optional(),jobTitle:M3().trim().min(1).max(200).optional(),jobUrl:q6(2e3).optional(),location:q6(200).optional(),workMode:Y6.optional(),sourceName:q6(120).optional(),salaryMin:t6().int().nonnegative().nullish(),salaryMax:t6().int().nonnegative().nullish(),salaryCurrency:q6(8).optional(),notes:q6(2e4).optional(),savedOn:K6.optional(),archived:a6().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),p6({appliedOn:K6.optional(),status:J6.optional(),tags:Q6.optional()}),p6({target:M3().min(1)});function t8(e){return e===`exact`}var n8=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}get fieldErrors(){return Array.isArray(this.details)?this.details:[]}};async function r8(e,t){let n=await fetch(e,{...t,headers:{...t?.body?{"Content-Type":`application/json`}:{},...t?.headers}});if(n.status===204)return;let r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new n8(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}function i8(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null&&r!==``){if(Array.isArray(r)){if(r.length===0)continue;t.set(n,r.join(`,`))}else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}var a8={csv:`text/csv`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`};async function o8(e,t,n){let r=await fetch(`/api/import${i8({format:t,mode:n})}`,{method:`POST`,headers:{"Content-Type":a8[t]},body:e}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok)throw new n8(r.status,a?.error??`unknown`,a?.message??r.statusText,a?.details);return a}async function s8(e,t){let n=await fetch(`/api/backup/import${i8({mode:t})}`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e}),r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new n8(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}var c8={listApplications:e=>r8(`/api/applications${i8(e)}`),getApplication:e=>r8(`/api/applications/${e}`),periods:()=>r8(`/api/applications/periods`),checkDuplicates:e=>r8(`/api/applications/check${i8(e)}`),createApplication:e=>r8(`/api/applications`,{method:`POST`,body:JSON.stringify(e)}),updateApplication:(e,t)=>r8(`/api/applications/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),changeStatus:(e,t)=>r8(`/api/applications/${e}/status`,{method:`POST`,body:JSON.stringify(t)}),deleteApplication:e=>r8(`/api/applications/${e}`,{method:`DELETE`}),listCompanies:(e={})=>r8(`/api/companies${i8(e)}`),suggestCompanies:e=>r8(`/api/companies/suggest${i8({q:e})}`),getCompany:e=>r8(`/api/companies/${e}`),updateCompany:(e,t)=>r8(`/api/companies/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),listTags:()=>r8(`/api/tags`),listNotes:(e={})=>r8(`/api/notes${i8(e)}`),createNote:e=>r8(`/api/notes`,{method:`POST`,body:JSON.stringify(e)}),updateNote:(e,t)=>r8(`/api/notes/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteNote:e=>r8(`/api/notes/${e}`,{method:`DELETE`}),dashboard:()=>r8(`/api/dashboard`),search:(e,t)=>r8(`/api/search${i8({q:e,types:t,limit:25})}`),exportUrl:(e,t)=>`/api/export${i8({...e,format:t})}`,previewImport:(e,t)=>o8(e,t,`preview`),commitImport:(e,t)=>o8(e,t,`commit`),listOpenings:(e={})=>r8(`/api/openings${i8(e)}`),getOpening:e=>r8(`/api/openings/${e}`),createOpening:e=>r8(`/api/openings`,{method:`POST`,body:JSON.stringify(e)}),updateOpening:(e,t)=>r8(`/api/openings/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteOpening:e=>r8(`/api/openings/${e}`,{method:`DELETE`}),convertOpening:(e,t)=>r8(`/api/openings/${e}/convert`,{method:`POST`,body:JSON.stringify(t)}),getDbTargets:()=>r8(`/api/db/targets`),switchDb:e=>r8(`/api/db/switch`,{method:`POST`,body:JSON.stringify({target:e})}),backupExportUrl:`/api/backup/export`,previewBackup:e=>s8(e,`preview`),commitBackup:e=>s8(e,`commit`),getDataStatus:()=>r8(`/api/backup/status`),clearDatabase:()=>r8(`/api/backup/clear`,{method:`POST`}),seedDatabase:()=>r8(`/api/backup/seed`,{method:`POST`}),getMeta:()=>r8(`/api/meta`)},l8=class extends Error{name=`RepoError`;cause;constructor(e,t){super(e),t?.cause!==void 0&&(this.cause=t.cause)}},u8=class extends l8{name=`SchemaError`},d8=new Set([`string`,`number`,`integer`,`boolean`,`date`,`json`]);function f8(e){let t=Object.keys(e);if(t.length===0)throw new u8(`A schema must define at least one field`);let n={},r={},i={},a;for(let o of t){let t=e[o];if(!d8.has(t.type))throw new u8(`Field "${o}" has unknown type ${JSON.stringify(t.type)}. Expected one of: ${[...d8].join(`, `)}`);let s=t.column??o;if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new u8(`Field "${o}" maps to column ${JSON.stringify(s)}, which is not a plain identifier. Column names must match /^[A-Za-z_][A-Za-z0-9_]*$/ because repolayer never quotes-and-interpolates arbitrary text into SQL.`);if(s in r)throw new u8(`Fields "${r[s]}" and "${o}" both map to column "${s}"`);if(t.primaryKey){if(a!==void 0)throw new u8(`Schema declares two primary keys ("${a}" and "${o}"). repolayer supports single-column primary keys only.`);if(t.nullable)throw new u8(`Primary key "${o}" cannot be nullable`);a=o}n[o]=s,r[s]=o,i[o]=t.type}if(a===void 0)throw new u8("Schema has no primary key. Mark exactly one field with `primaryKey: true`.");return Object.freeze({fields:e,primaryKey:a,columns:Object.freeze(n),fieldsByColumn:Object.freeze(r),fieldNames:Object.freeze(t),types:Object.freeze(i)})}var p8={createdAt:{type:`date`,column:`created_at`},updatedAt:{type:`date`,column:`updated_at`}};f8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},website:{type:`string`,nullable:!0},location:{type:`string`,nullable:!0},archived:{type:`boolean`},...p8}),f8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},titleKey:{type:`string`,column:`title_key`},appliedOn:{type:`date`,column:`applied_on`},periodYear:{type:`integer`,column:`period_year`},periodMonth:{type:`integer`,column:`period_month`},status:{type:`string`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},followUpOn:{type:`date`,nullable:!0,column:`follow_up_on`},archived:{type:`boolean`},...p8}),f8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},color:{type:`string`,nullable:!0},scope:{type:`string`},...p8}),f8({id:{type:`string`,primaryKey:!0},tagId:{type:`string`,column:`tag_id`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},...p8}),f8({id:{type:`string`,primaryKey:!0},title:{type:`string`},body:{type:`string`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,nullable:!0,column:`target_id`},pinned:{type:`boolean`},...p8}),f8({id:{type:`string`,primaryKey:!0},applicationId:{type:`string`,column:`application_id`},fromStatus:{type:`string`,nullable:!0,column:`from_status`},toStatus:{type:`string`,column:`to_status`},occurredOn:{type:`date`,column:`occurred_on`},commentText:{type:`string`,nullable:!0,column:`comment_text`},...p8}),f8({id:{type:`string`,primaryKey:!0},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},model:{type:`string`},dim:{type:`integer`},embedding:{type:`json`},textHash:{type:`string`,column:`text_hash`},...p8}),f8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},notes:{type:`string`,nullable:!0},savedOn:{type:`date`,column:`saved_on`},archived:{type:`boolean`},convertedApplicationId:{type:`string`,nullable:!0,column:`converted_application_id`},...p8}),[{header:`Position`,value:e=>e.jobTitle,width:34},{header:`Company`,value:e=>e.company.name,width:28},{header:`Date`,value:e=>e.appliedOn,width:13},{header:`Status`,value:e=>$Q[e.status],width:13},{header:`Notes`,value:e=>e.notesText,width:70,wrap:!0}].map(e=>e.header),new Map(Object.entries($Q).map(([e,t])=>[t.toLowerCase(),e]));var m8=c8,h8={applications:e=>[`applications`,e],application:e=>[`application`,e],periods:()=>[`periods`],companies:e=>[`companies`,e],company:e=>[`company`,e],companySuggest:e=>[`company-suggest`,e],tags:()=>[`tags`],notes:e=>[`notes`,e],dashboard:()=>[`dashboard`],duplicates:e=>[`duplicates`,e],search:e=>[`search`,e],openings:e=>[`openings`,e],opening:e=>[`opening`,e],dbTargets:()=>[`db-targets`],dataStatus:()=>[`data-status`],meta:()=>[`meta`]};function g8(e){e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`company`]}),e.invalidateQueries({queryKey:[`tags`]}),e.invalidateQueries({queryKey:[`duplicates`]}),e.invalidateQueries({queryKey:[`search`]})}function _8(e){return Xr({queryKey:h8.applications(e),queryFn:()=>m8.listApplications(e),placeholderData:e=>e})}function v8(e){return Qr({queryKey:h8.applications(e),queryFn:({pageParam:t})=>m8.listApplications(t?{...e,cursor:t}:e),initialPageParam:null,getNextPageParam:e=>e.hasMore?e.cursor:null,placeholderData:e=>e})}function y8(e){return Xr({queryKey:h8.application(e??``),queryFn:()=>m8.getApplication(e),enabled:!!e})}function b8(){return Xr({queryKey:h8.periods(),queryFn:()=>m8.periods()})}function x8(){return Xr({queryKey:h8.dashboard(),queryFn:()=>m8.dashboard()})}function S8(){return Xr({queryKey:h8.tags(),queryFn:()=>m8.listTags()})}function C8(e={}){return Xr({queryKey:h8.companies(e),queryFn:()=>m8.listCompanies(e)})}function w8(e){return Xr({queryKey:h8.company(e??``),queryFn:()=>m8.getCompany(e),enabled:!!e})}function T8(e={}){return Xr({queryKey:h8.notes(e),queryFn:()=>m8.listNotes(e)})}function E8(e){let{enabled:t=!0,...n}=e;return Xr({queryKey:h8.duplicates(n),queryFn:()=>m8.checkDuplicates(n),enabled:t&&n.company.trim().length>1,staleTime:5e3})}function D8(e){return Xr({queryKey:h8.companySuggest(e),queryFn:()=>m8.suggestCompanies(e),enabled:e.trim().length>0,staleTime:3e4})}function O8(){let e=Tn();return Zr({mutationFn:e=>m8.createApplication(e),onSuccess:()=>g8(e)})}function k8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>m8.updateApplication(e,t),onSuccess:()=>g8(e)})}function A8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>m8.changeStatus(e,t),onSuccess:()=>g8(e)})}function j8(){let e=Tn();return Zr({mutationFn:e=>m8.deleteApplication(e),onSuccess:()=>g8(e)})}function M8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>m8.updateCompany(e,t),onSuccess:()=>g8(e)})}function N8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>e?m8.updateNote(e,t):m8.createNote(t),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`search`]})}})}function P8(){let e=Tn();return Zr({mutationFn:e=>m8.deleteNote(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]})}})}function F8(e={}){return Xr({queryKey:h8.openings(e),queryFn:()=>m8.listOpenings(e)})}function I8(e){e.invalidateQueries({queryKey:[`openings`]}),e.invalidateQueries({queryKey:[`opening`]})}function L8(){let e=Tn();return Zr({mutationFn:e=>m8.createOpening(e),onSuccess:()=>I8(e)})}function R8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>m8.updateOpening(e,t),onSuccess:()=>I8(e)})}function z8(){let e=Tn();return Zr({mutationFn:e=>m8.deleteOpening(e),onSuccess:()=>I8(e)})}function B8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>m8.convertOpening(e,t),onSuccess:()=>{I8(e),e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`search`]})}})}function V8(){return Xr({queryKey:h8.dbTargets(),queryFn:()=>m8.getDbTargets()})}function H8(){return Zr({mutationFn:e=>m8.switchDb(e)})}function U8(){return Xr({queryKey:h8.dataStatus(),queryFn:()=>m8.getDataStatus()})}function W8(){let e=Tn();return Zr({mutationFn:()=>m8.clearDatabase(),onSuccess:()=>void e.invalidateQueries()})}function G8(){let e=Tn();return Zr({mutationFn:()=>m8.seedDatabase(),onSuccess:()=>void e.invalidateQueries()})}function K8(){return Xr({queryKey:h8.meta(),queryFn:()=>m8.getMeta(),staleTime:1/0})}function q8({status:e}){return(0,Z.jsx)(MY,{color:QQ[e],children:$Q[e]})}function J8(e,t=300){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Y8={exact:`error`,similar:`warning`,company:`info`,none:`success`};function X8({check:e,loading:t}){if(t&&!e)return(0,Z.jsx)(Fp,{type:`info`,showIcon:!0,message:`Checking your history…`,style:{marginBottom:16}});if(!e)return null;if(e.verdict===`none`)return(0,Z.jsx)(Fp,{type:`success`,showIcon:!0,message:`No history with this company`,description:`This looks like a company you haven't applied to before.`,style:{marginBottom:16}});let n=e.company?.name??`this company`;return(0,Z.jsx)(Fp,{type:Y8[e.verdict],showIcon:!0,style:{marginBottom:16},message:Z8(e.verdict,n,e.priorCount),description:(0,Z.jsxs)(Rz,{direction:`vertical`,size:6,style:{width:`100%`},children:[e.matches.length>0?e.matches.slice(0,5).map(e=>(0,Z.jsx)(Q8,{match:e},e.id)):(0,Z.jsx)($X.Text,{type:`secondary`,children:`None of them were for this role, but it is worth a look before you apply again.`}),!e.semanticUsed&&e.matches.length>0&&(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Matched on wording only — semantic matching is still warming up.`})]})})}function Z8(e,t,n){let r=n===1?`once`:`${n} times`;switch(e){case`exact`:return`You have already applied for this exact role at ${t}`;case`similar`:return`You have applied for a very similar role at ${t}`;default:return`You have applied to ${t} ${r} before`}}function Q8({match:e}){let t=Math.round(Math.max(e.titleSimilarity,e.semanticSimilarity??0)*100);return(0,Z.jsxs)(Rz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),(0,Z.jsx)($X.Text,{type:`secondary`,children:e.appliedOn}),(0,Z.jsx)(MY,{color:QQ[e.status],children:$Q[e.status]}),e.matchKind===`exact`?(0,Z.jsx)(MY,{color:`red`,children:`exact title`}):(0,Z.jsxs)(MY,{children:[t,`% similar`]})]})}function $8({onStartApplication:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),a=J8(t,350),{data:o,isFetching:s}=E8({company:a,title:J8(r,350)}),c=a.trim().length>1;return(0,Z.jsx)(wF,{title:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(NQ,{}),(0,Z.jsx)(`span`,{children:`Check before you apply`})]}),extra:e&&(0,Z.jsx)(Gk,{type:`link`,onClick:e,children:`New application`}),children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)(WU,{gutter:12,children:[(0,Z.jsx)(BI,{xs:24,sm:12,children:(0,Z.jsx)(xV,{placeholder:`Company`,value:t,onChange:e=>n(e.target.value),allowClear:!0})}),(0,Z.jsx)(BI,{xs:24,sm:12,children:(0,Z.jsx)(xV,{placeholder:`Job title (optional)`,value:r,onChange:e=>i(e.target.value),allowClear:!0})})]}),c?(0,Z.jsx)(X8,{check:o,loading:s}):(0,Z.jsx)($X.Text,{type:`secondary`,children:`Type a company name to see whether you have been here before.`})]})})}function e5({open:e,onClose:t,application:n}){let[r]=JB.useForm(),{message:i,modal:a}=LC.useApp(),o=!!n,s=O8(),c=k8(),{data:l}=S8(),u=JB.useWatch(`companyName`,r)??``,d=JB.useWatch(`jobTitle`,r)??``,f=J8(u,300),p=J8(d,300),m=o&&u.trim()===(n?.company.name??``).trim()&&d.trim()===(n?.jobTitle??``).trim(),{data:h}=D8(f),{data:g,isFetching:v}=E8({company:f,title:p,...n?{excludeId:n.id}:{},enabled:e&&!m});(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,appliedOn:(0,$k.default)(n.appliedOn),status:n.status,jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,followUpOn:n.followUpOn?(0,$k.default)(n.followUpOn):null,tags:n.tags.map(e=>e.name)}):(r.resetFields(),r.setFieldsValue({appliedOn:(0,$k.default)(),status:`applied`,workMode:`unspecified`,tags:[]})))},[e,n,r]);let y=(0,_.useMemo)(()=>(h?.companies??[]).map(e=>({value:e.name,label:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(`span`,{children:e.name}),e.applicationCount>0&&(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[e.applicationCount,` application`,e.applicationCount===1?``:`s`]})]})})),[h]),b=(0,_.useMemo)(()=>(l?.tags??[]).map(e=>({value:e.name,label:e.name})),[l]),[x,S]=(0,_.useState)(!1);async function C(e){if(g&&t8(g.verdict)&&!o&&!await new Promise(e=>{a.confirm({title:`You have applied for this exact role before`,content:(0,Z.jsxs)(Rz,{direction:`vertical`,children:[(0,Z.jsxs)($X.Text,{children:[g.matches[0]?.jobTitle,` at `,g.company?.name,` on`,` `,g.matches[0]?.appliedOn,`.`]}),(0,Z.jsx)($X.Text,{type:`secondary`,children:`Save this as a new application anyway?`})]}),okText:`Save anyway`,cancelText:`Go back`,onOk:()=>e(!0),onCancel:()=>e(!1)})}))return;let l={companyName:e.companyName,jobTitle:e.jobTitle,appliedOn:e.appliedOn.format(`YYYY-MM-DD`),status:e.status,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,followUpOn:e.followUpOn?e.followUpOn.format(`YYYY-MM-DD`):null,tags:e.tags??[],...o?{}:{notes:e.notes??null}};S(!0);try{n?(await c.mutateAsync({id:n.id,body:l}),i.success(`Application updated`)):(await s.mutateAsync(l),i.success(`Application saved`)),t()}catch(e){e instanceof n8&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}finally{S(!1)}}return(0,Z.jsxs)(kz,{title:o?`Edit application`:`New application`,open:e,onClose:t,width:640,destroyOnHidden:!0,extra:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Gk,{type:`primary`,loading:x,onClick:()=>r.submit(),children:o?`Save changes`:`Save application`})]}),children:[!m&&(0,Z.jsx)(X8,{check:g,loading:v}),(0,Z.jsxs)(JB,{form:r,layout:`vertical`,onFinish:C,requiredMark:`optional`,children:[(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(LE,{options:y,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(xV,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(AE,{options:YQ.map(e=>({value:e,label:$Q[e]}))})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`followUpOn`,label:`Follow up on`,children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`,allowClear:!0})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(AE,{options:e$.map(e=>({value:e,label:t$[e]}))})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(xV,{placeholder:`Stockholm`})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(xV,{placeholder:`LinkedIn, referral…`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(xV,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(JB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(xV,{placeholder:`https://…`})}),(0,Z.jsx)(JB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(AE,{mode:`tags`,options:b,placeholder:`fintech, remote-ok, dream-job…`,tokenSeparators:[`,`]})}),!o&&(0,Z.jsx)(JB.Item,{name:`notes`,label:`Notes`,help:`Saved as a note linked to this application. Searchable.`,children:(0,Z.jsx)(xV.TextArea,{rows:4,placeholder:`Anything worth remembering…`})})]})]})}var t5={dark:{bgBase:`#0d1117`,bgRaised:`#161b22`,bgSunken:`#010409`,border:`#30363d`,borderStrong:`#444c56`,textPrimary:`#e6edf3`,textMuted:`#8b949e`,textFaint:`#6e7681`,accent:`#58a6ff`,success:`#3fb950`,danger:`#f85149`,warning:`#d29922`},light:{bgBase:`#ffffff`,bgRaised:`#ffffff`,bgSunken:`#f6f8fa`,border:`#d0d7de`,borderStrong:`#afb8c1`,textPrimary:`#1f2328`,textMuted:`#656d76`,textFaint:`#8c959f`,accent:`#0969da`,success:`#1a7f37`,danger:`#d1242f`,warning:`#9a6700`}},n5={bgBase:`var(--jt-bg-base)`,bgRaised:`var(--jt-bg-raised)`,bgSunken:`var(--jt-bg-sunken)`,border:`var(--jt-border)`,borderStrong:`var(--jt-border-strong)`,textPrimary:`var(--jt-text-primary)`,textMuted:`var(--jt-text-muted)`,textFaint:`var(--jt-text-faint)`,accent:`var(--jt-accent)`,success:`var(--jt-success)`,danger:`var(--jt-danger)`,warning:`var(--jt-warning)`};function r5(e){let t=t5[e];return{algorithm:e===`dark`?HY.darkAlgorithm:HY.defaultAlgorithm,token:{colorBgBase:t.bgBase,colorBgContainer:t.bgRaised,colorBgElevated:t.bgRaised,colorBgLayout:t.bgBase,colorBorder:t.border,colorBorderSecondary:t.border,colorText:t.textPrimary,colorTextSecondary:t.textMuted,colorTextTertiary:t.textFaint,colorPrimary:t.accent,colorLink:t.accent,colorSuccess:t.success,colorError:t.danger,colorWarning:t.warning,borderRadius:8,fontSize:14},components:{Layout:{siderBg:t.bgSunken,headerBg:t.bgSunken,bodyBg:t.bgBase}}}}function i5(){let{data:e,isLoading:t}=x8(),[n,r]=(0,_.useState)(!1),i=s$(c$());if(t||!e)return(0,Z.jsx)(DS,{active:!0,paragraph:{rows:8}});let{stats:a,followUps:o,recentActivity:s}=e;return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`Total applications`,value:a.total})})}),(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`Still active`,value:a.active,valueStyle:{color:n5.accent}})})}),(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`${u$(i.month)} ${i.year}`,value:a.thisMonth,suffix:a.thisMonth===1?`application`:`applications`})})}),(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)($X.Text,{type:`secondary`,children:`Response rate`}),(0,Z.jsx)(wU,{percent:Math.round(a.responseRate*100),size:`small`,strokeColor:n5.accent}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Anything past “applied” counts as a reply`})]})})})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:24,lg:14,children:(0,Z.jsx)($8,{onStartApplication:()=>r(!0)})}),(0,Z.jsx)(BI,{xs:24,lg:10,children:(0,Z.jsx)(wF,{title:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(VR,{}),(0,Z.jsx)(`span`,{children:`Needs a follow-up`})]}),styles:{body:{maxHeight:320,overflowY:`auto`}},children:o.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`Nothing due — all caught up`}):(0,Z.jsx)(LH,{size:`small`,dataSource:o,renderItem:e=>(0,Z.jsxs)(LH.Item,{children:[(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),description:(0,Z.jsxs)(eB,{justify:`space-between`,wrap:!0,gap:8,children:[(0,Z.jsx)(`span`,{children:e.company.name}),(0,Z.jsxs)($X.Text,{type:`danger`,children:[`due `,e.followUpOn]})]})}),(0,Z.jsx)(q8,{status:e.status})]})})})})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:24,lg:12,children:(0,Z.jsx)(wF,{title:`Pipeline`,children:(0,Z.jsx)(Rz,{direction:`vertical`,size:10,style:{width:`100%`},children:Object.entries(a.byStatus).sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,Z.jsxs)(eB,{align:`center`,gap:12,children:[(0,Z.jsx)(`div`,{style:{width:100},children:(0,Z.jsx)(q8,{status:e})}),(0,Z.jsx)(wU,{percent:a.total>0?Math.round(t/a.total*100):0,format:()=>t,size:`small`,style:{flex:1,marginBottom:0}})]},e))})})}),(0,Z.jsx)(BI,{xs:24,lg:12,children:(0,Z.jsx)(wF,{title:`Recent activity`,styles:{body:{maxHeight:360,overflowY:`auto`}},children:s.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No status changes yet`}):(0,Z.jsx)(XY,{items:s.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsxs)($X.Text,{children:[(0,Z.jsx)(dn,{to:`/applications/${e.applicationId}`,children:e.jobTitle}),` at `,e.companyName]}),(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[e.fromStatus?`${$Q[e.fromStatus]} → ${$Q[e.toStatus]}`:`Applied (${$Q[e.toStatus]})`,` `,`· `,e.occurredOn]})]})}))})})})]}),(0,Z.jsx)(e5,{open:n,onClose:()=>r(!1)})]})}function a5({periods:e,year:t,month:n,onSelect:r}){let i=(0,_.useMemo)(()=>e.map(e=>({key:`y:${e.year}`,title:(0,Z.jsx)(o5,{label:String(e.year),count:e.count,strong:!0}),children:(e.months??[]).map(e=>({key:`m:${e.year}:${e.month}`,title:(0,Z.jsx)(o5,{label:u$(e.month),count:e.count})}))})),[e]),a=(0,_.useMemo)(()=>t&&n?[`m:${t}:${n}`]:t?[`y:${t}`]:[],[t,n]),o=(0,_.useMemo)(()=>{let n=e[0],r=n?[`y:${n.year}`]:[];return t&&!r.includes(`y:${t}`)&&r.push(`y:${t}`),r},[e,t]);return e.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No applications yet`}):(0,Z.jsx)(sJ,{treeData:i,selectedKeys:a,defaultExpandedKeys:o,blockNode:!0,onSelect:e=>{let t=String(e[0]??``);if(t.startsWith(`m:`)){let[,e,n]=t.split(`:`);r({year:Number(e),month:Number(n)})}else t.startsWith(`y:`)?r({year:Number(t.slice(2))}):r({})}})}function o5({label:e,count:t,strong:n}){return(0,Z.jsxs)(`span`,{style:{display:`flex`,justifyContent:`space-between`,gap:12},children:[(0,Z.jsx)($X.Text,{strong:n,children:e}),(0,Z.jsx)($X.Text,{type:`secondary`,children:t})]})}var s5={new:`green`,duplicate:`default`,error:`red`},c5={new:`New`,duplicate:`Duplicate — skipped`,error:`Error`};function l5({open:e,onClose:t}){let n=Tn(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(`csv`),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null);function h(){i(null),c(null),u(null),m(null)}function g(){h(),t()}let v=e=>{let t=e.name.toLowerCase().endsWith(`.xlsx`)?`xlsx`:`csv`;return i(e),o(t),m(null),f(!0),m8.previewImport(e,t).then(c).catch(e=>m(e instanceof Error?e.message:`Could not read that file`)).finally(()=>f(!1)),!1};async function y(){if(r){f(!0),m(null);try{let e=await m8.commitImport(r,a);if(u(e),e.created>0)for(let e of[`applications`,`application`,`periods`,`dashboard`,`companies`,`company`,`search`])n.invalidateQueries({queryKey:[e]})}catch(e){m(e instanceof Error?e.message:`Import failed`)}finally{f(!1)}}}return(0,Z.jsx)(VH,{title:`Import applications`,open:e,onCancel:g,width:800,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,children:`CSV or .xlsx with the same columns Export produces: Position, Company, Date, Status, Notes. Rows that exactly match an application you have already logged are skipped automatically.`}),(0,Z.jsxs)(GZ.Dragger,{accept:`.csv,.xlsx`,maxCount:1,showUploadList:!1,beforeUpload:v,disabled:d,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(fQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a CSV or Excel file here`})]})]}),p&&(0,Z.jsx)(Fp,{type:`error`,showIcon:!0,message:p}),s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Rz,{wrap:!0,children:[(0,Z.jsxs)(MY,{color:`green`,children:[s.totals.new,` new`]}),(0,Z.jsxs)(MY,{children:[s.totals.duplicate,` duplicate — will be skipped`]}),s.totals.error>0&&(0,Z.jsxs)(MY,{color:`red`,children:[s.totals.error,` error`]})]}),s.fileErrors.map(e=>(0,Z.jsx)(Fp,{type:`warning`,showIcon:!0,message:e},e)),(0,Z.jsx)(yY,{size:`small`,rowKey:`rowNumber`,columns:[{title:`Row`,dataIndex:`rowNumber`,width:60},{title:`Position`,dataIndex:`jobTitle`,ellipsis:!0},{title:`Company`,dataIndex:`companyName`,ellipsis:!0},{title:`Date`,dataIndex:`appliedOn`,width:110},{title:`Status`,dataIndex:`status`,width:110,render:e=>e?$Q[e]:`—`},{title:`Result`,dataIndex:`verdict`,width:200,render:(e,t)=>(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(MY,{color:s5[e],children:c5[e]}),t.errors.length>0&&(0,Z.jsx)($X.Text,{type:`danger`,style:{fontSize:12},children:t.errors.join(`; `)})]})}],dataSource:s.rows,pagination:{pageSize:10},scroll:{y:320}}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:h,children:`Choose a different file`}),(0,Z.jsxs)(Gk,{type:`primary`,loading:d,disabled:s.totals.new===0,onClick:y,children:[`Import `,s.totals.new,` application`,s.totals.new===1?``:`s`]})]})]}),l&&(0,Z.jsx)(UU,{status:l.failed>0?`warning`:`success`,title:`Imported ${l.created} application${l.created===1?``:`s`}`,subTitle:`${l.skipped} duplicate row${l.skipped===1?``:`s`} skipped`+(l.failed>0?`, ${l.failed} row${l.failed===1?``:`s`} failed`:``),extra:(0,Z.jsx)(Gk,{type:`primary`,onClick:g,children:`Done`})})]})})}function u5(){let e=Xe(),[t,n]=_n(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),s=(0,_.useMemo)(()=>{let e={};for(let n of[`q`,`source`,`sort`,`direction`,`from`,`to`]){let r=t.get(n);r&&(e[n]=r)}for(let n of[`year`,`month`]){let r=t.get(n);r&&(e[n]=Number(r))}for(let n of[`status`,`workMode`,`tags`]){let r=t.get(n);r&&(e[n]=r.split(`,`))}return e},[t]),{data:c,isLoading:l,isFetching:u,hasNextPage:d,fetchNextPage:f,isFetchingNextPage:p}=v8(s),{data:m}=b8(),{data:h}=S8(),g=c?.pages??[],v=(0,_.useMemo)(()=>g.flatMap(e=>e.items),[g]),y=g[0];function b(e){let r=new URLSearchParams(t);for(let[t,n]of Object.entries(e))n==null||n===``||Array.isArray(n)&&n.length===0?r.delete(t):r.set(t,Array.isArray(n)?n.join(`,`):String(n));n(r,{replace:!0})}let x=[{title:`Applied`,dataIndex:`appliedOn`,width:118,sorter:!1,render:e=>(0,Z.jsx)($X.Text,{children:e})},{title:`Company`,key:`company`,width:190,render:(t,n)=>(0,Z.jsx)(Gk,{type:`link`,style:{padding:0,height:`auto`},onClick:t=>{t.stopPropagation(),e(`/companies/${n.company.id}`)},children:n.company.name})},{title:`Job title`,dataIndex:`jobTitle`,render:(e,t)=>(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e}),t.location&&(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[t.location,` · `,t$[t.workMode]]})]})},{title:`Status`,dataIndex:`status`,width:116,render:(e,t)=>(0,Z.jsx)(q8,{status:t.status})},{title:`Tags`,key:`tags`,width:210,render:(e,t)=>(0,Z.jsx)(Rz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(MY,{color:e.color??void 0,style:{marginInlineEnd:0},children:e.name},e.id))})},{title:`Source`,dataIndex:`sourceName`,width:120,render:e=>e??(0,Z.jsx)($X.Text,{type:`secondary`,children:`—`})}],S=t.get(`from`),C=t.get(`to`),w=S&&C?[(0,$k.default)(S),(0,$k.default)(C)]:null,T=(0,$k.default)(),E=[{label:`Today`,value:[T,T]},{label:`Yesterday`,value:[T.subtract(1,`day`),T.subtract(1,`day`)]},{label:`This week`,value:[T.startOf(`week`),T.endOf(`week`)]},{label:`This month`,value:[T.startOf(`month`),T.endOf(`month`)]},{label:`Last 7 days`,value:[T.subtract(6,`day`),T]},{label:`Last 30 days`,value:[T.subtract(29,`day`),T]}];function D(e){if(!e||!e[0]||!e[1]){b({from:``,to:``});return}b({from:e[0].format(`YYYY-MM-DD`),to:e[1].format(`YYYY-MM-DD`)})}let O=t.get(`year`)?Number(t.get(`year`)):void 0,k=t.get(`month`)?Number(t.get(`month`)):void 0,A=O&&k?`${u$(k)} ${O}`:O?String(O):`All applications`;return(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{xs:24,md:6,lg:5,children:(0,Z.jsx)(wF,{size:`small`,title:`By period`,extra:(O||k)&&(0,Z.jsx)(Gk,{size:`small`,type:`link`,onClick:()=>b({year:``,month:``}),children:`Clear`}),styles:{body:{maxHeight:`calc(100vh - 220px)`,overflowY:`auto`}},children:(0,Z.jsx)(a5,{periods:m?.periods??[],year:O,month:k,onSelect:e=>b({year:e.year??``,month:e.month??``})})})}),(0,Z.jsx)(BI,{xs:24,md:18,lg:19,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:A}),(0,Z.jsx)($X.Text,{type:`secondary`,children:y?v.length<y.total?`Showing ${v.length} of ${y.total} applications`:`${y.total} application${y.total===1?``:`s`}`:`Loading…`})]}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Bz,{menu:{items:[{key:`csv`,label:`Export as CSV`},{key:`xlsx`,label:`Export as Excel (.xlsx)`}],onClick:({key:e})=>{window.location.href=m8.exportUrl(s,e)}},children:(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(zZ,{}),children:`Export`})}),(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(JQ,{}),onClick:()=>o(!0),children:`Import`}),(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>i(!0),children:`New application`})]})]}),(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsx)(xV,{allowClear:!0,size:`large`,prefix:(0,Z.jsx)(TE,{}),placeholder:`Search by meaning — try “server-side developer” or “remote fintech”`,defaultValue:t.get(`q`)??``,onChange:e=>{e.target.value===``&&b({q:``})},onPressEnter:e=>b({q:e.target.value})}),(0,Z.jsxs)(eB,{gap:8,wrap:!0,children:[(0,Z.jsx)(KR.RangePicker,{allowClear:!0,value:w,presets:E,format:`YYYY-MM-DD`,onChange:e=>D(e)}),(0,Z.jsx)(AE,{mode:`multiple`,allowClear:!0,placeholder:`Status`,style:{minWidth:180},suffixIcon:(0,Z.jsx)(lQ,{}),value:t.get(`status`)?.split(`,`)??[],onChange:e=>b({status:e}),options:YQ.map(e=>({value:e,label:$Q[e]}))}),(0,Z.jsx)(AE,{mode:`multiple`,allowClear:!0,placeholder:`Work mode`,style:{minWidth:160},value:t.get(`workMode`)?.split(`,`)??[],onChange:e=>b({workMode:e}),options:e$.map(e=>({value:e,label:t$[e]}))}),(0,Z.jsx)(AE,{mode:`multiple`,allowClear:!0,placeholder:`Tags`,style:{minWidth:200},value:t.get(`tags`)?.split(`,`)??[],onChange:e=>b({tags:e}),options:(h?.tags??[]).map(e=>({value:e.name,label:e.name}))}),(0,Z.jsx)(AE,{style:{minWidth:170},value:t.get(`sort`)??`appliedOn`,onChange:e=>b({sort:e}),options:[{value:`appliedOn`,label:`Sort: date applied`},{value:`company`,label:`Sort: company`},{value:`jobTitle`,label:`Sort: job title`},{value:`status`,label:`Sort: status`}]}),(0,Z.jsx)(AE,{style:{width:130},value:t.get(`direction`)??`desc`,onChange:e=>b({direction:e}),options:[{value:`desc`,label:`Newest first`},{value:`asc`,label:`Oldest first`}]})]}),y?.searched&&!y.semanticReady&&(0,Z.jsx)(Fp,{type:`info`,showIcon:!0,icon:(0,Z.jsx)(GQ,{}),message:`Results will improve shortly — the semantic model is still loading.`})]})}),(0,Z.jsx)(yY,{rowKey:`id`,columns:x,dataSource:v,loading:l||u&&!p,pagination:!1,onRow:t=>({onClick:()=>e(`/applications/${t.id}`),style:{cursor:`pointer`}}),locale:{emptyText:(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:t.get(`q`)?`Nothing matched “${t.get(`q`)}”`:`No applications for this filter`})},footer:d?()=>(0,Z.jsx)(eB,{justify:`center`,children:(0,Z.jsx)(bD,{title:`Adds the next page to the list`,children:(0,Z.jsx)(Gk,{loading:p,onClick:()=>void f(),children:`Load more`})})}):void 0})]})}),(0,Z.jsx)(e5,{open:r,onClose:()=>i(!1)}),(0,Z.jsx)(l5,{open:a,onClose:()=>o(!1)})]})}function d5({open:e,note:t,onClose:n,target:r}){let[i]=JB.useForm(),{message:a}=LC.useApp(),o=N8();return(0,Z.jsx)(VH,{open:e,title:t?`Edit note`:`New note`,okText:`Save`,destroyOnHidden:!0,onCancel:n,afterOpenChange:e=>{e&&(t?i.setFieldsValue({title:t.title,body:t.body,targetType:t.targetType,targetId:t.targetId,pinned:t.pinned}):(i.resetFields(),i.setFieldsValue({targetType:r?r.type:`standalone`,targetId:r?r.id:null,pinned:!1,body:``})))},onOk:async()=>{let e=await i.validateFields();await o.mutateAsync({...t?{id:t.id}:{},body:{title:e.title,body:e.body??``,targetType:e.targetType,targetId:e.targetType===`standalone`?null:e.targetId??null,pinned:e.pinned??!1}}),a.success(t?`Note updated`:`Note saved`),n()},children:(0,Z.jsxs)(JB,{form:i,layout:`vertical`,children:[(0,Z.jsx)(JB.Item,{name:`title`,label:`Title`,rules:[{required:!0,message:`Title is required`}],children:(0,Z.jsx)(xV,{placeholder:`Interview prep, salary research…`})}),(0,Z.jsx)(JB.Item,{name:`body`,label:`Note`,children:(0,Z.jsx)(xV.TextArea,{rows:8,placeholder:`Anything worth keeping`})}),r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(JB.Item,{name:`targetType`,hidden:!0,children:(0,Z.jsx)(xV,{})}),(0,Z.jsx)(JB.Item,{name:`targetId`,hidden:!0,children:(0,Z.jsx)(xV,{})}),(0,Z.jsxs)($X.Paragraph,{type:`secondary`,style:{marginBottom:16},children:[`Attached to `,r.label]})]}):(0,Z.jsx)(f5,{form:i}),(0,Z.jsx)(JB.Item,{name:`pinned`,label:`Pinned`,valuePropName:`checked`,children:(0,Z.jsx)(eG,{})})]})})}function f5({form:e}){let t=JB.useWatch(`targetType`,e)??`standalone`,{data:n}=C8(),{data:r}=_8({limit:200}),i=(0,_.useMemo)(()=>t===`company`?(n?.companies??[]).map(e=>({value:e.id,label:e.name})):t===`application`?(r?.items??[]).map(e=>({value:e.id,label:`${e.jobTitle} — ${e.company.name}`})):[],[t,n,r]);return(0,Z.jsxs)(eB,{gap:12,children:[(0,Z.jsx)(JB.Item,{name:`targetType`,label:`Attach to`,style:{flex:1},children:(0,Z.jsx)(AE,{options:[{value:`standalone`,label:`Nothing in particular`},{value:`company`,label:`A company`},{value:`application`,label:`An application`}],onChange:()=>e.setFieldValue(`targetId`,null)})}),t!==`standalone`&&(0,Z.jsx)(JB.Item,{name:`targetId`,label:t===`company`?`Company`:`Application`,style:{flex:2},rules:[{required:!0,message:`Pick what this note is about`}],children:(0,Z.jsx)(AE,{showSearch:!0,optionFilterProp:`label`,options:i})})]})}function p5(){let{id:e}=Qe(),t=Xe(),{message:n}=LC.useApp(),{data:r,isLoading:i}=y8(e),a=A8(),o=j8(),s=P8(),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(DS,{active:!0,paragraph:{rows:10}});let m=ZQ(r.status);async function h(t){e&&(await a.mutateAsync({id:e,body:{status:t,comment:null}}),n.success(`Moved to ${$Q[t]}`))}return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`flex-start`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Gk,{type:`link`,icon:(0,Z.jsx)(JZ,{}),style:{padding:0},onClick:()=>t(`/applications`),children:`Back to applications`}),(0,Z.jsx)($X.Title,{level:3,style:{margin:0},children:r.jobTitle}),(0,Z.jsxs)(Rz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/companies/${r.company.id}`,children:r.company.name}),(0,Z.jsxs)($X.Text,{type:`secondary`,children:[`applied `,r.appliedOn]}),(0,Z.jsx)(q8,{status:r.status})]})]}),(0,Z.jsxs)(Rz,{wrap:!0,children:[m&&(0,Z.jsxs)(Gk,{type:`primary`,onClick:()=>void h(m),children:[`Move to `,$Q[m]]}),(0,Z.jsx)(AE,{style:{width:150},value:r.status,onChange:e=>void h(e),options:YQ.map(e=>({value:e,label:$Q[e]}))}),(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(nX,{}),onClick:()=>l(!0),children:`Edit`}),(0,Z.jsx)(GH,{title:`Delete this application?`,description:`Its notes and status history go too. This cannot be undone.`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{e&&(await o.mutateAsync(e),n.success(`Application deleted`),t(`/applications`))},children:(0,Z.jsx)(Gk,{danger:!0,icon:(0,Z.jsx)($Y,{})})})]})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:24,lg:14,children:(0,Z.jsx)(wF,{title:`Details`,children:(0,Z.jsxs)(oz,{column:{xs:1,sm:2},size:`small`,bordered:!0,children:[(0,Z.jsx)(oz.Item,{label:`Company`,children:r.company.name}),(0,Z.jsx)(oz.Item,{label:`Applied on`,children:r.appliedOn}),(0,Z.jsx)(oz.Item,{label:`Location`,children:r.location??`—`}),(0,Z.jsx)(oz.Item,{label:`Work mode`,children:t$[r.workMode]}),(0,Z.jsx)(oz.Item,{label:`Source`,children:r.sourceName??`—`}),(0,Z.jsx)(oz.Item,{label:`Follow up`,children:r.followUpOn??`—`}),(0,Z.jsx)(oz.Item,{label:`Salary`,span:2,children:r.salaryMin||r.salaryMax?`${r.salaryMin?.toLocaleString()??`?`} – ${r.salaryMax?.toLocaleString()??`?`} ${r.salaryCurrency??``}`:`—`}),(0,Z.jsx)(oz.Item,{label:`Posting`,span:2,children:r.jobUrl?(0,Z.jsx)(`a`,{href:r.jobUrl,target:`_blank`,rel:`noreferrer`,children:(0,Z.jsxs)(Rz,{size:4,children:[(0,Z.jsx)(vQ,{}),r.jobUrl]})}):`—`}),(0,Z.jsx)(oz.Item,{label:`Tags`,span:2,children:r.tags.length>0?(0,Z.jsx)(Rz,{size:4,wrap:!0,children:r.tags.map(e=>(0,Z.jsx)(MY,{children:e.name},e.id))}):`—`})]})})}),(0,Z.jsx)(BI,{xs:24,lg:10,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(wF,{title:`Status history`,children:r.statusEvents.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No changes recorded`}):(0,Z.jsx)(XY,{items:r.statusEvents.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e.fromStatus?`${$Q[e.fromStatus]} → ${$Q[e.toStatus]}`:`Applied`}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:e.occurredOn}),e.comment&&(0,Z.jsx)($X.Text,{children:e.comment})]})}))})}),(0,Z.jsx)(wF,{title:`Notes (${r.notes.length})`,extra:(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(fP,{}),onClick:()=>p(!0),children:`Add note`}),children:r.notes.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No notes yet`}):(0,Z.jsx)(LH,{size:`small`,dataSource:r.notes,renderItem:e=>(0,Z.jsx)(LH.Item,{actions:[(0,Z.jsx)(Gk,{type:`text`,icon:(0,Z.jsx)(nX,{}),onClick:()=>d(e)},`edit`),(0,Z.jsx)(GH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await s.mutateAsync(e.id),n.success(`Note deleted`)},children:(0,Z.jsx)(Gk,{type:`text`,danger:!0,icon:(0,Z.jsx)($Y,{})})},`delete`)],children:(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsxs)(Rz,{size:8,children:[e.pinned&&(0,Z.jsx)(DQ,{style:{color:`#faad14`}}),(0,Z.jsx)($X.Text,{strong:!0,children:e.title})]}),description:(0,Z.jsx)($X.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:4,expandable:!0,symbol:`more`},children:e.body})})})})})]})})]}),(0,Z.jsx)(e5,{open:c,onClose:()=>l(!1),application:r}),(0,Z.jsx)(d5,{open:f||u!==null,note:u,target:{type:`application`,id:r.id,label:r.jobTitle},onClose:()=>{p(!1),d(null)}})]})}var m5=25;function h5(){let e=Xe(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(m5),a=J8(t,300),{data:o,isLoading:s}=C8(a?{q:a}:{});return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Companies`}),(0,Z.jsx)(xV,{allowClear:!0,prefix:(0,Z.jsx)(TE,{}),placeholder:`Find a company`,style:{maxWidth:320},value:t,onChange:e=>n(e.target.value)})]}),(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsx)(yY,{rowKey:`id`,size:`middle`,loading:s,columns:[{title:`Company`,dataIndex:`name`,render:(e,t)=>(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e}),t.website&&(0,Z.jsx)($X.Link,{href:t.website,target:`_blank`,style:{fontSize:12},children:t.website.replace(/^https?:\/\//,``)})]}),sorter:(e,t)=>e.name.localeCompare(t.name)},{title:`Applications`,dataIndex:`applicationCount`,width:140,align:`right`,sorter:(e,t)=>e.applicationCount-t.applicationCount,defaultSortOrder:`descend`,render:e=>(0,Z.jsx)($X.Text,{strong:e>2,type:e>2?`warning`:void 0,children:e})},{title:`Active`,dataIndex:`activeCount`,width:90,align:`right`},{title:`Last applied`,dataIndex:`lastAppliedOn`,width:130,sorter:(e,t)=>(e.lastAppliedOn??``).localeCompare(t.lastAppliedOn??``),render:e=>e??(0,Z.jsx)($X.Text,{type:`secondary`,children:`—`})},{title:`Tags`,key:`tags`,width:260,render:(e,t)=>(0,Z.jsx)(Rz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(MY,{style:{marginInlineEnd:0},children:e.name},e.id))})}],dataSource:o?.companies??[],pagination:{pageSize:r,showSizeChanger:!0,onChange:(e,t)=>i(t),hideOnSinglePage:r===m5},onRow:t=>({onClick:()=>e(`/companies/${t.id}`),style:{cursor:`pointer`}})})})]})}function g5(){let{id:e}=Qe(),t=Xe(),{message:n}=LC.useApp(),{data:r,isLoading:i}=w8(e),{data:a}=T8(e?{targetType:`company`,targetId:e}:{}),{data:o}=S8(),s=M8(),c=P8(),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(DS,{active:!0,paragraph:{rows:8}});let{company:p,applications:m}=r,h=m.filter(e=>[`applied`,`screening`,`interview`].includes(e.status)).length;return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Gk,{type:`link`,icon:(0,Z.jsx)(JZ,{}),style:{padding:0},onClick:()=>t(`/companies`),children:`Back to companies`}),(0,Z.jsx)($X.Title,{level:3,style:{margin:0},children:p.name}),p.website&&(0,Z.jsx)($X.Link,{href:p.website,target:`_blank`,children:p.website})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`Applications`,value:m.length})})}),(0,Z.jsx)(BI,{xs:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`Still active`,value:h,valueStyle:{color:n5.accent}})})}),(0,Z.jsx)(BI,{xs:24,md:12,children:(0,Z.jsx)(wF,{children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)($X.Text,{type:`secondary`,children:`Company tags`}),(0,Z.jsx)(AE,{mode:`tags`,style:{width:`100%`},placeholder:`fintech, remote-first…`,value:p.tags.map(e=>e.name),options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),onChange:t=>{e&&s.mutate({id:e,body:{tags:t}})}})]})})})]}),(0,Z.jsx)(wF,{title:`Application history`,children:(0,Z.jsx)(yY,{rowKey:`id`,size:`middle`,columns:[{title:`Applied`,dataIndex:`appliedOn`,width:120},{title:`Job title`,dataIndex:`jobTitle`,render:e=>(0,Z.jsx)($X.Text,{strong:!0,children:e})},{title:`Status`,dataIndex:`status`,width:120,render:(e,t)=>(0,Z.jsx)(q8,{status:t.status})},{title:`Source`,dataIndex:`sourceName`,width:130}],dataSource:m,pagination:!1,onRow:e=>({onClick:()=>t(`/applications/${e.id}`),style:{cursor:`pointer`}})})}),(0,Z.jsx)(wF,{title:`Notes about ${p.name}`,extra:(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(fP,{}),onClick:()=>f(!0),children:`Add note`}),children:(a?.notes??[]).length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No notes about this company`}):(0,Z.jsx)(LH,{dataSource:a?.notes??[],renderItem:e=>(0,Z.jsx)(LH.Item,{actions:[(0,Z.jsx)(Gk,{type:`text`,icon:(0,Z.jsx)(nX,{}),onClick:()=>u(e)},`edit`),(0,Z.jsx)(GH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await c.mutateAsync(e.id),n.success(`Note deleted`)},children:(0,Z.jsx)(Gk,{type:`text`,danger:!0,icon:(0,Z.jsx)($Y,{})})},`delete`)],children:(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsxs)(Rz,{size:8,children:[e.pinned&&(0,Z.jsx)(DQ,{style:{color:`#faad14`}}),(0,Z.jsx)($X.Text,{strong:!0,children:e.title})]}),description:(0,Z.jsx)($X.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},children:e.body})})})})}),(0,Z.jsx)(d5,{open:d||l!==null,note:l,target:{type:`company`,id:p.id,label:p.name},onClose:()=>{f(!1),u(null)}})]})}function _5(){let{message:e}=LC.useApp(),[t,n]=(0,_.useState)(`all`),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),{data:l,isLoading:u}=T8(t===`all`?{}:{targetType:t}),d=P8(),f=l?.notes??[],p=(0,_.useMemo)(()=>{let e=r.trim().toLowerCase();return e?f.filter(t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.targetLabel?.toLowerCase().includes(e)??!1)):f},[f,r]);return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Notes`}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(eL,{value:t,onChange:e=>n(e),options:[{label:`All`,value:`all`},{label:`Standalone`,value:`standalone`},{label:`Companies`,value:`company`},{label:`Applications`,value:`application`}]}),(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>c(!0),children:`New note`})]})]}),(0,Z.jsx)(xV,{allowClear:!0,prefix:(0,Z.jsx)(TE,{}),placeholder:`Search notes by title, body, or what they're attached to`,value:r,onChange:e=>i(e.target.value)}),(0,Z.jsx)(wF,{size:`small`,loading:u,children:p.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:r?`Nothing matched “${r}”`:`No notes here yet`}):(0,Z.jsx)(LH,{dataSource:p,renderItem:t=>(0,Z.jsx)(LH.Item,{actions:[(0,Z.jsx)(Gk,{type:`text`,icon:(0,Z.jsx)(nX,{}),onClick:()=>o(t)},`edit`),(0,Z.jsx)(GH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await d.mutateAsync(t.id),e.success(`Note deleted`)},children:(0,Z.jsx)(Gk,{type:`text`,danger:!0,icon:(0,Z.jsx)($Y,{})})},`delete`)],children:(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsxs)(Rz,{size:8,wrap:!0,children:[t.pinned&&(0,Z.jsx)(DQ,{style:{color:`#faad14`}}),(0,Z.jsx)($X.Text,{strong:!0,children:t.title}),(0,Z.jsx)(v5,{note:t})]}),description:(0,Z.jsx)($X.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:3,expandable:!0,symbol:`more`},children:t.body})})})})}),(0,Z.jsx)(d5,{open:s||a!==null,note:a,onClose:()=>{c(!1),o(null)}})]})}function v5({note:e}){if(e.targetType===`standalone`)return(0,Z.jsx)(MY,{children:`general`});if(!e.targetId)return(0,Z.jsx)(MY,{children:`unlinked`});let t=e.targetType===`company`?`/companies/${e.targetId}`:`/applications/${e.targetId}`;return(0,Z.jsx)(dn,{to:t,children:(0,Z.jsxs)(MY,{color:`blue`,children:[e.targetType,`: `,e.targetLabel??`view`]})})}function y5({open:e,onClose:t,opening:n}){let[r]=JB.useForm(),{message:i}=LC.useApp(),a=!!n,o=L8(),s=R8(),{data:c}=D8(JB.useWatch(`companyName`,r)??``);(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,savedOn:(0,$k.default)(n.savedOn),jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,notes:n.notes??void 0}):(r.resetFields(),r.setFieldsValue({savedOn:(0,$k.default)(),workMode:`unspecified`})))},[e,n,r]);let l=(0,_.useMemo)(()=>(c?.companies??[]).map(e=>({value:e.name})),[c]);async function u(e){let c={companyName:e.companyName,jobTitle:e.jobTitle,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,notes:e.notes??null,...a?{}:{savedOn:e.savedOn.format(`YYYY-MM-DD`)}};try{n?(await s.mutateAsync({id:n.id,body:c}),i.success(`Opening updated`)):(await o.mutateAsync(c),i.success(`Opening saved`)),t()}catch(e){e instanceof n8&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}}return(0,Z.jsxs)(kz,{title:a?`Edit opening`:`Save opening for later`,open:e,onClose:t,width:560,destroyOnHidden:!0,extra:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Gk,{type:`primary`,loading:o.isPending||s.isPending,onClick:()=>r.submit(),children:a?`Save changes`:`Save opening`})]}),children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,children:`For a role you found but are not ready to apply to yet — no status, no tags, just enough to find it again. Convert it into a real application when you are ready.`}),(0,Z.jsxs)(JB,{form:r,layout:`vertical`,onFinish:u,requiredMark:`optional`,children:[(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(LE,{options:l,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(xV,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`savedOn`,label:`Found on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`,disabled:a})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(AE,{options:e$.map(e=>({value:e,label:t$[e]}))})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(xV,{placeholder:`Stockholm`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(xV,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(JB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(xV,{placeholder:`LinkedIn, referral…`})}),(0,Z.jsx)(JB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(xV,{placeholder:`https://…`})}),(0,Z.jsx)(JB.Item,{name:`notes`,label:`Notes`,children:(0,Z.jsx)(xV.TextArea,{rows:4,placeholder:`Why this looked interesting, what you're missing to apply…`})})]})]})}function b5(){let e=Xe(),{message:t}=LC.useApp(),[n,r]=(0,_.useState)(`active`),{data:i,isLoading:a}=F8(n===`archived`?{archived:!0}:{}),{data:o}=S8(),s=z8(),c=B8(),l=R8(),u=(0,_.useMemo)(()=>{let e=i?.openings??[];return n===`archived`?e.filter(e=>e.archived):e},[i,n]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(void 0),[h,g]=(0,_.useState)(null),[v]=JB.useForm();function y(e){g(e),v.setFieldsValue({appliedOn:(0,$k.default)(),status:`applied`,tags:[]})}async function b(n){if(h)try{let r=await c.mutateAsync({id:h.id,body:{appliedOn:n.appliedOn.format(`YYYY-MM-DD`),status:n.status,tags:n.tags??[]}});t.success(`Converted to an application`),g(null),e(`/applications/${r.id}`)}catch(e){t.error(e instanceof Error?e.message:`Could not convert`)}}async function x(e){try{await l.mutateAsync({id:e.id,body:{archived:!1}}),t.success(`Opening restored`)}catch(e){t.error(e instanceof Error?e.message:`Could not restore`)}}let S=[{title:`Company`,dataIndex:[`company`,`name`]},{title:`Job title`,dataIndex:`jobTitle`},{title:`Found on`,dataIndex:`savedOn`,width:120},{title:`Location`,key:`location`,render:(e,t)=>[t.location,t$[t.workMode]].filter(Boolean).join(` · `)||(0,Z.jsx)($X.Text,{type:`secondary`,children:`—`})},{title:`Source`,dataIndex:`sourceName`,render:e=>e??`—`}],C=e=>e.jobUrl&&(0,Z.jsx)(bD,{title:`Open job posting`,children:(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(vQ,{}),href:e.jobUrl,target:`_blank`,rel:`noreferrer`})}),w=e=>(0,Z.jsx)(GH,{title:`Delete this opening?`,description:`This removes it for good and cannot be undone.`,onConfirm:()=>s.mutate(e.id),okText:`Delete`,okButtonProps:{danger:!0},children:(0,Z.jsx)(Gk,{size:`small`,danger:!0,children:`Delete`})}),T=[...S,{title:``,key:`actions`,width:260,render:(e,t)=>(0,Z.jsxs)(Rz,{onClick:e=>e.stopPropagation(),children:[C(t),(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(ZB,{}),onClick:()=>y(t),children:`Convert`}),(0,Z.jsx)(Gk,{size:`small`,onClick:()=>{m(t),f(!0)},children:`Edit`}),w(t)]})}],E=[...S,{title:`Archived because`,key:`reason`,width:160,render:(e,t)=>t.convertedApplicationId?(0,Z.jsx)(dn,{to:`/applications/${t.convertedApplicationId}`,children:(0,Z.jsx)(MY,{color:`blue`,children:`Converted`})}):(0,Z.jsx)(MY,{children:`Archived by hand`})},{title:``,key:`actions`,width:220,render:(e,t)=>(0,Z.jsxs)(Rz,{onClick:e=>e.stopPropagation(),children:[C(t),(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(AQ,{}),loading:l.isPending,onClick:()=>x(t),children:`Restore`}),w(t)]})}];return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Job openings`}),(0,Z.jsx)($X.Text,{type:`secondary`,children:n===`active`?`Saved for later — convert one to a real application when you're ready to apply.`:`Openings that were converted into an application or archived by hand.`})]}),(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>{m(void 0),f(!0)},children:`Save opening for later`})]}),(0,Z.jsx)(eL,{value:n,onChange:r,options:[{label:`Active`,value:`active`},{label:`Archived`,value:`archived`}]}),(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsx)(yY,{rowKey:`id`,columns:n===`archived`?E:T,dataSource:u,loading:a,pagination:!1,locale:{emptyText:(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:n===`active`?`Nothing saved yet — use “Save opening for later” for a role you're not ready to apply to.`:`No archived openings.`})}})}),(0,Z.jsx)(y5,{open:d,onClose:()=>f(!1),opening:p}),(0,Z.jsx)(VH,{title:h?`Convert "${h.jobTitle}" at ${h.company.name}`:``,open:!!h,onCancel:()=>g(null),onOk:()=>v.submit(),okText:`Create application`,confirmLoading:c.isPending,children:(0,Z.jsxs)(JB,{form:v,layout:`vertical`,onFinish:b,children:[(0,Z.jsx)(JB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0}],children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`})}),(0,Z.jsx)(JB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(AE,{options:YQ.map(e=>({value:e,label:$Q[e]}))})}),(0,Z.jsx)(JB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(AE,{mode:`tags`,options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),placeholder:`fintech, remote-ok…`,tokenSeparators:[`,`]})})]})})]})}var x5={companies:`Companies`,applications:`Applications`,tags:`Tags`,tagLinks:`Tag links`,notes:`Notes`,statusEvents:`Status events`,jobOpenings:`Job openings`};function S5({counts:e}){return(0,Z.jsx)(oz,{size:`small`,column:2,bordered:!0,children:Object.entries(e).map(([e,t])=>(0,Z.jsx)(oz.Item,{label:x5[e]??e,children:t},e))})}function C5(){let{message:e}=LC.useApp(),{data:t,isLoading:n}=V8(),r=H8(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current&&clearInterval(c.current)},[]);function l(t){VH.confirm({title:`Switch to "${t}"?`,content:"The server restarts to connect to the new target. This page will reconnect and reload automatically once it is back — under `npm run dev`, that may require restarting it by hand.",okText:`Switch and restart`,onOk:async()=>{try{await r.mutateAsync(t)}catch(t){e.error(t instanceof Error?t.message:`Could not switch database`);return}s(!0),c.current=setInterval(()=>{m8.getDbTargets().then(()=>{c.current&&clearInterval(c.current),window.location.reload()}).catch(()=>{})},500)}})}if(o)return(0,Z.jsx)(wF,{title:`Database`,children:(0,Z.jsx)(UU,{icon:(0,Z.jsx)(DU,{spin:!0}),title:`Reconnecting…`,subTitle:`Waiting for the server to come back up.`})});let u=t?.targets??[];return(0,Z.jsx)(wF,{title:`Database`,loading:n,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)($X.Paragraph,{type:`secondary`,style:{marginBottom:0},children:[`Connection settings live in `,(0,Z.jsx)(`code`,{children:`.env`}),` and are never shown or editable here.`,u.length<=1&&` Only one target is configured, so there is nothing to switch between.`]}),(0,Z.jsx)(oz,{size:`small`,column:1,bordered:!0,children:(0,Z.jsx)(oz.Item,{label:`Active target`,children:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(rQ,{}),t?.active,` (`,u.find(e=>e.name===t?.active)?.driver,`)`]})})}),u.length>1&&(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(AE,{style:{width:220},value:i??t?.active,options:u.map(e=>({value:e.name,label:`${e.name} (${e.driver})`})),onChange:a}),(0,Z.jsx)(Gk,{type:`primary`,disabled:!i||i===t?.active,loading:r.isPending,onClick:()=>i&&l(i),children:`Switch`})]})]})})}function w5(){let{message:e}=LC.useApp(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);function p(){n(null),i(null),o(null),u(null)}function m(){p(),f(!1)}let h=e=>(n(e),u(null),c(!0),m8.previewBackup(e).then(i).catch(e=>u(e instanceof Error?e.message:`Could not read that file`)).finally(()=>c(!1)),!1);function g(){t&&VH.confirm({title:`Replace all data in the active database?`,content:`Every table is wiped and recreated from this backup. This cannot be undone.`,okText:`Restore`,okButtonProps:{danger:!0},onOk:async()=>{c(!0),u(null);try{let e=await m8.commitBackup(t);o(e)}catch(t){e.error(t instanceof Error?t.message:`Restore failed`)}finally{c(!1)}}})}return(0,Z.jsxs)(wF,{title:`Backup & restore`,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`A full-fidelity snapshot of every table — every field, every relation, driver-agnostic. Not the same as the CSV/Excel export elsewhere in the app, which is a lossy report meant for people to read. This file is scrambled (gzip + obfuscation) so it isn't plain, readable JSON at rest — that's an obfuscation step, not encryption, and does not protect the personal data inside from anyone who actually wants it.`}),(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(rQ,{}),onClick:()=>{window.location.href=m8.backupExportUrl},children:`Export backup`}),(0,Z.jsx)(Gk,{onClick:()=>f(!0),children:`Restore from backup…`})]}),(0,Z.jsx)(VH,{title:`Restore from backup`,open:d,onCancel:m,width:600,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!r&&!a&&(0,Z.jsxs)(GZ.Dragger,{accept:`.jtbak`,maxCount:1,showUploadList:!1,beforeUpload:h,disabled:s,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(fQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a JobTrack backup file (.jtbak) here`})]}),l&&(0,Z.jsx)(Fp,{type:`error`,showIcon:!0,message:l}),r&&!a&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)($X.Text,{type:`secondary`,children:[`Backup taken `,new Date(r.exportedAt).toLocaleString(),`. Restoring will replace everything currently in the active database with:`]}),(0,Z.jsx)(S5,{counts:r.counts}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:p,children:`Choose a different file`}),(0,Z.jsx)(Gk,{type:`primary`,danger:!0,loading:s,onClick:g,children:`Restore`})]})]}),a&&(0,Z.jsx)(UU,{status:`success`,title:`Restore complete`,extra:(0,Z.jsxs)(Rz,{direction:`vertical`,style:{width:`100%`},children:[(0,Z.jsx)(S5,{counts:a.counts}),(0,Z.jsx)(Gk,{type:`primary`,onClick:()=>window.location.reload(),children:`Reload`})]})})]})})]})}var T5=`CLEAR`;function E5(){let{message:e}=LC.useApp(),{data:t,isLoading:n}=U8(),r=W8(),i=G8(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``);function l(){o(!1),c(``)}function u(){r.mutate(void 0,{onSuccess:()=>{e.success(`Database cleared`),l()},onError:t=>e.error(t instanceof Error?t.message:`Could not clear the database`)})}function d(){i.mutate(void 0,{onSuccess:t=>e.success(`Seeded ${t.applications} applications and ${t.companies} companies`),onError:t=>e.error(t instanceof Error?t.message:`Could not seed the database`)})}let f=t?.counts??{};return(0,Z.jsxs)(wF,{title:`Reset & demo data`,loading:n,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`Wipe everything in the active database, or — only while it's empty — fill it with a realistic multi-year demo dataset to explore the app with.`}),!t?.empty&&(0,Z.jsx)(S5,{counts:f}),(0,Z.jsxs)(Rz,{wrap:!0,children:[t?.empty&&(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(oQ,{}),loading:i.isPending,onClick:d,children:`Seed with demo data`}),(0,Z.jsx)(Gk,{danger:!0,disabled:t?.empty,onClick:()=>o(!0),children:`Clear database…`})]})]}),(0,Z.jsx)(VH,{title:`Clear the active database?`,open:a,onCancel:l,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(Fp,{type:`warning`,showIcon:!0,message:`This permanently deletes every row below. There is no undo — export a backup first if you might want this data again.`}),(0,Z.jsx)(S5,{counts:f}),(0,Z.jsxs)($X.Text,{children:[`Type `,(0,Z.jsx)($X.Text,{code:!0,children:T5}),` to confirm.`]}),(0,Z.jsx)(xV,{value:s,onChange:e=>c(e.target.value),placeholder:T5,onPressEnter:()=>s===T5&&u()}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:l,children:`Cancel`}),(0,Z.jsx)(Gk,{danger:!0,type:`primary`,disabled:s!==T5,loading:r.isPending,onClick:u,children:`Clear database`})]})]})})]})}function D5(){let{data:e,isLoading:t}=K8(),n=e?`${e.name} ${e.version}`:``;return(0,Z.jsx)(wF,{title:`About`,loading:t,children:(0,Z.jsxs)(oz,{size:`small`,column:1,bordered:!0,children:[(0,Z.jsx)(oz.Item,{label:`Running`,children:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(hQ,{}),(0,Z.jsxs)($X.Text,{copyable:{text:n},children:[(0,Z.jsx)(`code`,{children:e?.name}),` `,e?.version]})]})}),(0,Z.jsx)(oz.Item,{label:`Database driver`,children:e?.driver})]})})}function O5(){return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Settings`}),(0,Z.jsx)(C5,{}),(0,Z.jsx)(w5,{}),(0,Z.jsx)(E5,{}),(0,Z.jsx)(D5,{})]})}var k5=`jobtrack.theme`,A5=[{key:`/dashboard`,icon:(0,Z.jsx)(eQ,{}),label:(0,Z.jsx)(dn,{to:`/dashboard`,children:`Dashboard`})},{key:`/applications`,icon:(0,Z.jsx)(wQ,{}),label:(0,Z.jsx)(dn,{to:`/applications`,children:`Applications`})},{key:`/openings`,icon:(0,Z.jsx)(ZZ,{}),label:(0,Z.jsx)(dn,{to:`/openings`,children:`Openings`})},{key:`/companies`,icon:(0,Z.jsx)(zQ,{}),label:(0,Z.jsx)(dn,{to:`/companies`,children:`Companies`})},{key:`/notes`,icon:(0,Z.jsx)(rB,{}),label:(0,Z.jsx)(dn,{to:`/notes`,children:`Notes`})},{key:`/settings`,icon:(0,Z.jsx)(IQ,{}),label:(0,Z.jsx)(dn,{to:`/settings`,children:`Settings`})}],j5=[{key:`light`,icon:(0,Z.jsx)(HQ,{}),label:`Light`},{key:`dark`,icon:(0,Z.jsx)(xQ,{}),label:`Dark`}];function M5(){let[e,t]=(0,_.useState)(()=>{try{let e=localStorage.getItem(k5);if(e)return e===`dark`}catch{}return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1});(0,_.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e?`dark`:`light`);try{localStorage.setItem(k5,e?`dark`:`light`)}catch{}},[e]);let n=qe(),r=(0,_.useMemo)(()=>{let e=A5.find(e=>n.pathname.startsWith(e.key));return e?[e.key]:[`/dashboard`]},[n.pathname]);return(0,Z.jsx)(Lh,{theme:r5(e?`dark`:`light`),children:(0,Z.jsx)(LC,{children:(0,Z.jsxs)(AV,{style:{minHeight:`100vh`},children:[(0,Z.jsxs)(AV.Header,{style:{display:`flex`,alignItems:`center`,gap:24,paddingInline:24,borderBottom:`1px solid ${n5.border}`,position:`sticky`,top:0,zIndex:10},children:[(0,Z.jsxs)($X.Title,{level:4,style:{margin:0,whiteSpace:`nowrap`},children:[`Job`,(0,Z.jsx)(`span`,{style:{color:n5.accent},children:`Track`})]}),(0,Z.jsx)(zk,{mode:`horizontal`,selectedKeys:r,items:A5,style:{flex:1,minWidth:0,borderBottom:`none`}}),(0,Z.jsx)(Bz,{trigger:[`click`],menu:{items:j5,selectable:!0,selectedKeys:[e?`dark`:`light`],onClick:({key:e})=>t(e===`dark`)},children:(0,Z.jsx)(Gk,{icon:e?(0,Z.jsx)(xQ,{}):(0,Z.jsx)(HQ,{}),"aria-label":`Theme settings`,children:`Theme`})})]}),(0,Z.jsx)(AV.Content,{style:{padding:24},children:(0,Z.jsxs)(Ct,{children:[(0,Z.jsx)(xt,{path:`/`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})}),(0,Z.jsx)(xt,{path:`/dashboard`,element:(0,Z.jsx)(i5,{})}),(0,Z.jsx)(xt,{path:`/applications`,element:(0,Z.jsx)(u5,{})}),(0,Z.jsx)(xt,{path:`/applications/:id`,element:(0,Z.jsx)(p5,{})}),(0,Z.jsx)(xt,{path:`/openings`,element:(0,Z.jsx)(b5,{})}),(0,Z.jsx)(xt,{path:`/companies`,element:(0,Z.jsx)(h5,{})}),(0,Z.jsx)(xt,{path:`/companies/:id`,element:(0,Z.jsx)(g5,{})}),(0,Z.jsx)(xt,{path:`/notes`,element:(0,Z.jsx)(_5,{})}),(0,Z.jsx)(xt,{path:`/settings`,element:(0,Z.jsx)(O5,{})}),(0,Z.jsx)(xt,{path:`*`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})})]})})]})})})}var N5=new Lr({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});(0,v.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(En,{client:N5,children:(0,Z.jsx)(un,{children:(0,Z.jsx)(M5,{})})})}));
|
|
444
|
-
|
|
443
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function z4(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:H4(t,`input`,e.processors),output:H4(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function B4(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return B4(r.element,n);if(r.type===`set`)return B4(r.valueType,n);if(r.type===`lazy`)return B4(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return B4(r.innerType,n);if(r.type===`intersection`)return B4(r.left,n)||B4(r.right,n);if(r.type===`record`||r.type===`map`)return B4(r.keyType,n)||B4(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:B4(r.in,n)||B4(r.out,n);if(r.type===`object`){for(let e in r.shape)if(B4(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(B4(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(B4(e,n))return!0;return!!(r.rest&&B4(r.rest,n))}return!1}var V4=(e,t={})=>n=>{let r=I4({...n,processors:t});return L4(e,r),R4(r,e),z4(r,e)},H4=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=I4({...i??{},target:a,io:t,processors:n});return L4(e,o),R4(o,e),z4(o,e)},U4={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},W4=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=U4[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},G4=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},K4=(e,t,n,r)=>{n.type=`boolean`},q4=(e,t,n,r)=>{n.not={}},J4=(e,t,n,r)=>{let i=e._zod.def,a=b$(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Y4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},X4=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Z4=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=L4(a.element,t,{...r,path:[...r.path,`items`]})},Q4=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=L4(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=L4(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},$4=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>L4(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},e3=(e,t,n,r)=>{let i=e._zod.def,a=L4(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=L4(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},t3=(e,t,n,r)=>{let i=e._zod.def,a=L4(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},n3=(e,t,n,r)=>{let i=e._zod.def;L4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},r3=(e,t,n,r)=>{let i=e._zod.def;L4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},i3=(e,t,n,r)=>{let i=e._zod.def;L4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},a3=(e,t,n,r)=>{let i=e._zod.def;L4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},o3=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;L4(o,t,r);let s=t.seen.get(e);s.ref=o},s3=(e,t,n,r)=>{let i=e._zod.def;L4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},c3=(e,t,n,r)=>{let i=e._zod.def;L4(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},l3=h$(`ZodISODateTime`,(e,t)=>{M0.init(e,t),I3.init(e,t)});function u3(e){return n4(l3,e)}var d3=h$(`ZodISODate`,(e,t)=>{N0.init(e,t),I3.init(e,t)});function f3(e){return r4(d3,e)}var p3=h$(`ZodISOTime`,(e,t)=>{P0.init(e,t),I3.init(e,t)});function m3(e){return i4(p3,e)}var h3=h$(`ZodISODuration`,(e,t)=>{F0.init(e,t),I3.init(e,t)});function g3(e){return a4(h3,e)}var _3=h$(`ZodError`,(e,t)=>{i1.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>s1(e,t)},flatten:{value:t=>o1(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,x$,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,x$,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),v3=c1(_3),y3=l1(_3),b3=u1(_3),x3=f1(_3),S3=m1(_3),C3=h1(_3),w3=g1(_3),T3=_1(_3),E3=v1(_3),D3=y1(_3),O3=b1(_3),k3=x1(_3),A3=new WeakMap;function j3(e,t,n){let r=Object.getPrototypeOf(e),i=A3.get(r);if(i||(i=new Set,A3.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var M3=h$(`ZodType`,(e,t)=>(v0.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:H4(e,`input`),output:H4(e,`output`)}}),e.toJSONSchema=V4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>v3(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>b3(e,t,n),e.parseAsync=async(t,n)=>y3(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>x3(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>S3(e,t,n),e.decode=(t,n)=>C3(e,t,n),e.encodeAsync=async(t,n)=>w3(e,t,n),e.decodeAsync=async(t,n)=>T3(e,t,n),e.safeEncode=(t,n)=>E3(e,t,n),e.safeDecode=(t,n)=>D3(e,t,n),e.safeEncodeAsync=async(t,n)=>O3(e,t,n),e.safeDecodeAsync=async(t,n)=>k3(e,t,n),j3(e,`ZodType`,{check(...e){let t=this.def;return this.clone(k$(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return z$(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(G6(e,t))},superRefine(e,t){return this.check(K6(e,t))},overwrite(e){return this.check(E4(e))},optional(){return E6(this)},exactOptional(){return O6(this)},nullable(){return A6(this)},nullish(){return E6(A6(this))},nonoptional(e){return I6(this,e)},array(){return m6(this)},or(e){return v6([this,e])},and(e){return b6(this,e)},transform(e){return B6(this,w6(e))},default(e){return M6(this,e)},prefault(e){return P6(this,e)},catch(e){return R6(this,e)},pipe(e){return B6(this,e)},readonly(){return U6(this)},describe(e){let t=this.clone();return M2.add(t,{description:e}),t},meta(...e){if(e.length===0)return M2.get(this);let t=this.clone();return M2.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return M2.get(e)?.description},configurable:!0}),e)),N3=h$(`_ZodString`,(e,t)=>{y0.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>W4(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,j3(e,`_ZodString`,{regex(...e){return this.check(b4(...e))},includes(...e){return this.check(C4(...e))},startsWith(...e){return this.check(w4(...e))},endsWith(...e){return this.check(T4(...e))},min(...e){return this.check(v4(...e))},max(...e){return this.check(_4(...e))},length(...e){return this.check(y4(...e))},nonempty(...e){return this.check(v4(1,...e))},lowercase(e){return this.check(x4(e))},uppercase(e){return this.check(S4(e))},trim(){return this.check(O4())},normalize(...e){return this.check(D4(...e))},toLowerCase(){return this.check(k4())},toUpperCase(){return this.check(A4())},slugify(){return this.check(j4())}})}),P3=h$(`ZodString`,(e,t)=>{y0.init(e,t),N3.init(e,t),e.email=t=>e.check(P2(L3,t)),e.url=t=>e.check(B2(V3,t)),e.jwt=t=>e.check(t4(n6,t)),e.emoji=t=>e.check(V2(H3,t)),e.guid=t=>e.check(F2(R3,t)),e.uuid=t=>e.check(I2(z3,t)),e.uuidv4=t=>e.check(L2(z3,t)),e.uuidv6=t=>e.check(R2(z3,t)),e.uuidv7=t=>e.check(z2(z3,t)),e.nanoid=t=>e.check(H2(U3,t)),e.guid=t=>e.check(F2(R3,t)),e.cuid=t=>e.check(U2(W3,t)),e.cuid2=t=>e.check(W2(G3,t)),e.ulid=t=>e.check(G2(K3,t)),e.base64=t=>e.check(Q2($3,t)),e.base64url=t=>e.check($2(e6,t)),e.xid=t=>e.check(K2(q3,t)),e.ksuid=t=>e.check(q2(J3,t)),e.ipv4=t=>e.check(J2(Y3,t)),e.ipv6=t=>e.check(Y2(X3,t)),e.cidrv4=t=>e.check(X2(Z3,t)),e.cidrv6=t=>e.check(Z2(Q3,t)),e.e164=t=>e.check(e4(t6,t)),e.datetime=t=>e.check(u3(t)),e.date=t=>e.check(f3(t)),e.time=t=>e.check(m3(t)),e.duration=t=>e.check(g3(t))});function F3(e){return N2(P3,e)}var I3=h$(`ZodStringFormat`,(e,t)=>{b0.init(e,t),N3.init(e,t)}),L3=h$(`ZodEmail`,(e,t)=>{C0.init(e,t),I3.init(e,t)}),R3=h$(`ZodGUID`,(e,t)=>{x0.init(e,t),I3.init(e,t)}),z3=h$(`ZodUUID`,(e,t)=>{S0.init(e,t),I3.init(e,t)});function B3(e){return I2(z3,e)}var V3=h$(`ZodURL`,(e,t)=>{w0.init(e,t),I3.init(e,t)}),H3=h$(`ZodEmoji`,(e,t)=>{T0.init(e,t),I3.init(e,t)}),U3=h$(`ZodNanoID`,(e,t)=>{E0.init(e,t),I3.init(e,t)}),W3=h$(`ZodCUID`,(e,t)=>{D0.init(e,t),I3.init(e,t)}),G3=h$(`ZodCUID2`,(e,t)=>{O0.init(e,t),I3.init(e,t)}),K3=h$(`ZodULID`,(e,t)=>{k0.init(e,t),I3.init(e,t)}),q3=h$(`ZodXID`,(e,t)=>{A0.init(e,t),I3.init(e,t)}),J3=h$(`ZodKSUID`,(e,t)=>{j0.init(e,t),I3.init(e,t)}),Y3=h$(`ZodIPv4`,(e,t)=>{I0.init(e,t),I3.init(e,t)}),X3=h$(`ZodIPv6`,(e,t)=>{L0.init(e,t),I3.init(e,t)}),Z3=h$(`ZodCIDRv4`,(e,t)=>{R0.init(e,t),I3.init(e,t)}),Q3=h$(`ZodCIDRv6`,(e,t)=>{z0.init(e,t),I3.init(e,t)}),$3=h$(`ZodBase64`,(e,t)=>{V0.init(e,t),I3.init(e,t)}),e6=h$(`ZodBase64URL`,(e,t)=>{U0.init(e,t),I3.init(e,t)}),t6=h$(`ZodE164`,(e,t)=>{W0.init(e,t),I3.init(e,t)}),n6=h$(`ZodJWT`,(e,t)=>{K0.init(e,t),I3.init(e,t)}),r6=h$(`ZodNumber`,(e,t)=>{q0.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>G4(e,t,n,r),j3(e,`ZodNumber`,{gt(e,t){return this.check(m4(e,t))},gte(e,t){return this.check(h4(e,t))},min(e,t){return this.check(h4(e,t))},lt(e,t){return this.check(f4(e,t))},lte(e,t){return this.check(p4(e,t))},max(e,t){return this.check(p4(e,t))},int(e){return this.check(o6(e))},safe(e){return this.check(o6(e))},positive(e){return this.check(m4(0,e))},nonnegative(e){return this.check(h4(0,e))},negative(e){return this.check(f4(0,e))},nonpositive(e){return this.check(p4(0,e))},multipleOf(e,t){return this.check(g4(e,t))},step(e,t){return this.check(g4(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function i6(e){return o4(r6,e)}var a6=h$(`ZodNumberFormat`,(e,t)=>{J0.init(e,t),r6.init(e,t)});function o6(e){return c4(a6,e)}var s6=h$(`ZodBoolean`,(e,t)=>{Y0.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>K4(e,t,n,r)});function c6(e){return l4(s6,e)}var l6=h$(`ZodUnknown`,(e,t)=>{X0.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function u6(){return u4(l6)}var d6=h$(`ZodNever`,(e,t)=>{Z0.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>q4(e,t,n,r)});function f6(e){return d4(d6,e)}var p6=h$(`ZodArray`,(e,t)=>{$0.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Z4(e,t,n,r),e.element=t.element,j3(e,`ZodArray`,{min(e,t){return this.check(v4(e,t))},nonempty(e){return this.check(v4(1,e))},max(e,t){return this.check(_4(e,t))},length(e,t){return this.check(y4(e,t))},unwrap(){return this.element}})});function m6(e,t){return M4(p6,e,t)}var h6=h$(`ZodObject`,(e,t)=>{i2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Q4(e,t,n,r),D$(e,`shape`,()=>t.shape),j3(e,`ZodObject`,{keyof(){return S6(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:u6()})},loose(){return this.clone({...this._zod.def,catchall:u6()})},strict(){return this.clone({...this._zod.def,catchall:f6()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return G$(this,e)},safeExtend(e){return K$(this,e)},merge(e){return q$(this,e)},pick(e){return U$(this,e)},omit(e){return W$(this,e)},partial(...e){return J$(T6,this,e[0])},required(...e){return Y$(F6,this,e[0])}})});function g6(e,t){return new h6({type:`object`,shape:e??{},...B$(t)})}var _6=h$(`ZodUnion`,(e,t)=>{o2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$4(e,t,n,r),e.options=t.options});function v6(e,t){return new _6({type:`union`,options:e,...B$(t)})}var y6=h$(`ZodIntersection`,(e,t)=>{s2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>e3(e,t,n,r)});function b6(e,t){return new y6({type:`intersection`,left:e,right:t})}var x6=h$(`ZodEnum`,(e,t)=>{u2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>J4(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new x6({...t,checks:[],...B$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new x6({...t,checks:[],...B$(r),entries:i})}});function S6(e,t){return new x6({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...B$(t)})}var C6=h$(`ZodTransform`,(e,t)=>{d2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>X4(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new _$(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(n1(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(n1(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function w6(e){return new C6({type:`transform`,transform:e})}var T6=h$(`ZodOptional`,(e,t)=>{p2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>c3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function E6(e){return new T6({type:`optional`,innerType:e})}var D6=h$(`ZodExactOptional`,(e,t)=>{m2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>c3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function O6(e){return new D6({type:`optional`,innerType:e})}var k6=h$(`ZodNullable`,(e,t)=>{h2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>t3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function A6(e){return new k6({type:`nullable`,innerType:e})}var j6=h$(`ZodDefault`,(e,t)=>{g2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>r3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function M6(e,t){return new j6({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():I$(t)}})}var N6=h$(`ZodPrefault`,(e,t)=>{v2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>i3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function P6(e,t){return new N6({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():I$(t)}})}var F6=h$(`ZodNonOptional`,(e,t)=>{y2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>n3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function I6(e,t){return new F6({type:`nonoptional`,innerType:e,...B$(t)})}var L6=h$(`ZodCatch`,(e,t)=>{x2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>a3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function R6(e,t){return new L6({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var z6=h$(`ZodPipe`,(e,t)=>{S2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>o3(e,t,n,r),e.in=t.in,e.out=t.out});function B6(e,t){return new z6({type:`pipe`,in:e,out:t})}var V6=h$(`ZodPreprocess`,(e,t)=>{z6.init(e,t),w2.init(e,t)}),H6=h$(`ZodReadonly`,(e,t)=>{T2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>s3(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function U6(e){return new H6({type:`readonly`,innerType:e})}var W6=h$(`ZodCustom`,(e,t)=>{D2.init(e,t),M3.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Y4(e,t,n,r)});function G6(e,t={}){return N4(W6,e,t)}function K6(e,t){return P4(e,t)}function q6(e,t){return new V6({type:`pipe`,in:w6(e),out:t})}function J6(e){return s4(r6,e)}var Y6=F3().regex(/^\d{4}-\d{2}-\d{2}$/,`Expected a YYYY-MM-DD date`),X6=e=>F3().trim().max(e).nullish().transform(e=>e==null||e===``?null:e),Z6=S6(QQ),Q6=S6(r$),$6=S6(o$),e8=S6(s$);S6(a$);var t8=m6(F3().trim().min(1).max(60)).max(30);g6({companyName:F3().trim().min(1,`Company is required`).max(200),jobTitle:F3().trim().min(1,`Job title is required`).max(200),appliedOn:Y6,status:Z6.default(`applied`),jobUrl:X6(2e3),location:X6(200),workMode:Q6.default(`unspecified`),sourceName:X6(120),salaryMin:i6().int().nonnegative().nullish().transform(e=>e??null),salaryMax:i6().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:X6(8),followUpOn:Y6.nullish().transform(e=>e??null),tags:t8.default([]),notes:X6(2e4)}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),g6({companyName:F3().trim().min(1).max(200).optional(),jobTitle:F3().trim().min(1).max(200).optional(),appliedOn:Y6.optional(),status:Z6.optional(),statusComment:F3().trim().max(2e3).nullish(),jobUrl:X6(2e3).optional(),location:X6(200).optional(),workMode:Q6.optional(),sourceName:X6(120).optional(),salaryMin:i6().int().nonnegative().nullish(),salaryMax:i6().int().nonnegative().nullish(),salaryCurrency:X6(8).optional(),followUpOn:Y6.nullish(),archived:c6().optional(),tags:t8.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),g6({status:Z6,occurredOn:Y6.optional(),comment:F3().trim().max(2e3).nullish().transform(e=>e??null)});var n8=e=>q6(e=>{if(e==null)return;let t=(Array.isArray(e)?e.map(String):String(e).split(`,`)).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0},m6(e).optional()),r8=g6({q:F3().trim().max(300).optional(),year:J6().int().min(1970).max(2200).optional(),month:J6().int().min(1).max(12).optional(),status:n8(Z6),workMode:n8(Q6),tags:n8(F3()),companyId:B3().optional(),source:F3().trim().max(120).optional(),from:Y6.optional(),to:Y6.optional(),archived:S6([`true`,`false`,`all`]).default(`false`).transform(e=>e===`all`?`all`:e===`true`),followUpDue:S6([`true`,`false`]).optional().transform(e=>e===`true`),sort:S6([`appliedOn`,`company`,`jobTitle`,`status`,`createdAt`]).default(`appliedOn`),direction:S6([`asc`,`desc`]).default(`desc`),limit:J6().int().min(1).max(200).default(50),cursor:F3().optional()});g6({company:F3().trim().min(1).max(200),title:F3().trim().max(200).optional().default(``),excludeId:B3().optional()}),g6({q:F3().trim().min(1).max(300),limit:J6().int().min(1).max(100).default(25),types:n8(S6([`application`,`company`,`note`]))}),r8.extend({format:S6([`csv`,`xlsx`]).default(`csv`)}),g6({name:F3().trim().min(1).max(200),website:X6(2e3),location:X6(200),tags:t8.default([])}),g6({name:F3().trim().min(1).max(200).optional(),website:X6(2e3).optional(),location:X6(200).optional(),archived:c6().optional(),tags:t8.optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),g6({title:F3().trim().min(1).max(200),body:F3().max(5e4).default(``),targetType:$6.default(`standalone`),targetId:B3().nullish().transform(e=>e??null),pinned:c6().default(!1)}),g6({title:F3().trim().min(1).max(200).optional(),body:F3().max(5e4).optional(),targetType:$6.optional(),targetId:B3().nullish(),pinned:c6().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),g6({name:F3().trim().min(1).max(60),color:X6(30),scope:e8.default(`both`)}),g6({companyName:F3().trim().min(1,`Company is required`).max(200),jobTitle:F3().trim().min(1,`Job title is required`).max(200),jobUrl:X6(2e3),location:X6(200),workMode:Q6.default(`unspecified`),sourceName:X6(120),salaryMin:i6().int().nonnegative().nullish().transform(e=>e??null),salaryMax:i6().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:X6(8),notes:X6(2e4),savedOn:Y6.optional()}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),g6({companyName:F3().trim().min(1).max(200).optional(),jobTitle:F3().trim().min(1).max(200).optional(),jobUrl:X6(2e3).optional(),location:X6(200).optional(),workMode:Q6.optional(),sourceName:X6(120).optional(),salaryMin:i6().int().nonnegative().nullish(),salaryMax:i6().int().nonnegative().nullish(),salaryCurrency:X6(8).optional(),notes:X6(2e4).optional(),savedOn:Y6.optional(),archived:c6().optional()}).refine(e=>Object.keys(e).length>0,{message:`Nothing to update`}),g6({appliedOn:Y6.optional(),status:Z6.optional(),tags:t8.optional()}),g6({url:F3().trim().min(1).max(2e3)}),g6({text:F3().min(1).max(2e5),url:X6(2e3).optional()}),g6({companyName:F3().trim().min(1,`Company is required`).max(200),jobTitle:F3().trim().min(1,`Job title is required`).max(200),jobUrl:X6(2e3),location:X6(200),workMode:Q6.default(`unspecified`),sourceName:X6(120),salaryMin:i6().int().nonnegative().nullish().transform(e=>e??null),salaryMax:i6().int().nonnegative().nullish().transform(e=>e??null),salaryCurrency:X6(8),notes:X6(2e4)}).refine(e=>e.salaryMin===null||e.salaryMax===null||e.salaryMin<=e.salaryMax,{message:`Minimum salary cannot exceed the maximum`,path:[`salaryMin`]}),g6({target:F3().min(1)});function i8(e){return e===`exact`}var a8=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.details=r}get fieldErrors(){return Array.isArray(this.details)?this.details:[]}};async function o8(e,t){let n=await fetch(e,{...t,headers:{...t?.body?{"Content-Type":`application/json`}:{},...t?.headers}});if(n.status===204)return;let r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new a8(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}function s8(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!=null&&r!==``){if(Array.isArray(r)){if(r.length===0)continue;t.set(n,r.join(`,`))}else t.set(n,String(r))}let n=t.toString();return n?`?${n}`:``}var c8={csv:`text/csv`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`};async function l8(e,t,n){let r=await fetch(`/api/import${s8({format:t,mode:n})}`,{method:`POST`,headers:{"Content-Type":c8[t]},body:e}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok)throw new a8(r.status,a?.error??`unknown`,a?.message??r.statusText,a?.details);return a}async function u8(e,t){let n=await fetch(`/api/backup/import${s8({mode:t})}`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e}),r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok)throw new a8(n.status,i?.error??`unknown`,i?.message??n.statusText,i?.details);return i}var d8={listApplications:e=>o8(`/api/applications${s8(e)}`),getApplication:e=>o8(`/api/applications/${e}`),periods:()=>o8(`/api/applications/periods`),checkDuplicates:e=>o8(`/api/applications/check${s8(e)}`),createApplication:e=>o8(`/api/applications`,{method:`POST`,body:JSON.stringify(e)}),updateApplication:(e,t)=>o8(`/api/applications/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),changeStatus:(e,t)=>o8(`/api/applications/${e}/status`,{method:`POST`,body:JSON.stringify(t)}),deleteApplication:e=>o8(`/api/applications/${e}`,{method:`DELETE`}),listCompanies:(e={})=>o8(`/api/companies${s8(e)}`),suggestCompanies:e=>o8(`/api/companies/suggest${s8({q:e})}`),getCompany:e=>o8(`/api/companies/${e}`),updateCompany:(e,t)=>o8(`/api/companies/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),listTags:()=>o8(`/api/tags`),listNotes:(e={})=>o8(`/api/notes${s8(e)}`),createNote:e=>o8(`/api/notes`,{method:`POST`,body:JSON.stringify(e)}),updateNote:(e,t)=>o8(`/api/notes/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteNote:e=>o8(`/api/notes/${e}`,{method:`DELETE`}),dashboard:()=>o8(`/api/dashboard`),search:(e,t)=>o8(`/api/search${s8({q:e,types:t,limit:25})}`),exportUrl:(e,t)=>`/api/export${s8({...e,format:t})}`,previewImport:(e,t)=>l8(e,t,`preview`),commitImport:(e,t)=>l8(e,t,`commit`),listOpenings:(e={})=>o8(`/api/openings${s8(e)}`),getOpening:e=>o8(`/api/openings/${e}`),createOpening:e=>o8(`/api/openings`,{method:`POST`,body:JSON.stringify(e)}),updateOpening:(e,t)=>o8(`/api/openings/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteOpening:e=>o8(`/api/openings/${e}`,{method:`DELETE`}),convertOpening:(e,t)=>o8(`/api/openings/${e}/convert`,{method:`POST`,body:JSON.stringify(t)}),ingestUrl:e=>o8(`/api/ingest/url`,{method:`POST`,body:JSON.stringify({url:e})}),ingestText:(e,t)=>o8(`/api/ingest/text`,{method:`POST`,body:JSON.stringify({text:e,url:t??null})}),clipPosting:e=>o8(`/api/ingest/clip`,{method:`POST`,body:JSON.stringify(e)}),getDbTargets:()=>o8(`/api/db/targets`),switchDb:e=>o8(`/api/db/switch`,{method:`POST`,body:JSON.stringify({target:e})}),backupExportUrl:`/api/backup/export`,previewBackup:e=>u8(e,`preview`),commitBackup:e=>u8(e,`commit`),getDataStatus:()=>o8(`/api/backup/status`),clearDatabase:()=>o8(`/api/backup/clear`,{method:`POST`}),seedDatabase:()=>o8(`/api/backup/seed`,{method:`POST`}),getMeta:()=>o8(`/api/meta`)},f8=class extends Error{name=`RepoError`;cause;constructor(e,t){super(e),t?.cause!==void 0&&(this.cause=t.cause)}},p8=class extends f8{name=`SchemaError`},m8=new Set([`string`,`number`,`integer`,`boolean`,`date`,`json`]);function h8(e){let t=Object.keys(e);if(t.length===0)throw new p8(`A schema must define at least one field`);let n={},r={},i={},a;for(let o of t){let t=e[o];if(!m8.has(t.type))throw new p8(`Field "${o}" has unknown type ${JSON.stringify(t.type)}. Expected one of: ${[...m8].join(`, `)}`);let s=t.column??o;if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(s))throw new p8(`Field "${o}" maps to column ${JSON.stringify(s)}, which is not a plain identifier. Column names must match /^[A-Za-z_][A-Za-z0-9_]*$/ because repolayer never quotes-and-interpolates arbitrary text into SQL.`);if(s in r)throw new p8(`Fields "${r[s]}" and "${o}" both map to column "${s}"`);if(t.primaryKey){if(a!==void 0)throw new p8(`Schema declares two primary keys ("${a}" and "${o}"). repolayer supports single-column primary keys only.`);if(t.nullable)throw new p8(`Primary key "${o}" cannot be nullable`);a=o}n[o]=s,r[s]=o,i[o]=t.type}if(a===void 0)throw new p8("Schema has no primary key. Mark exactly one field with `primaryKey: true`.");return Object.freeze({fields:e,primaryKey:a,columns:Object.freeze(n),fieldsByColumn:Object.freeze(r),fieldNames:Object.freeze(t),types:Object.freeze(i)})}var g8={createdAt:{type:`date`,column:`created_at`},updatedAt:{type:`date`,column:`updated_at`}};h8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},website:{type:`string`,nullable:!0},location:{type:`string`,nullable:!0},archived:{type:`boolean`},...g8}),h8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},titleKey:{type:`string`,column:`title_key`},appliedOn:{type:`date`,column:`applied_on`},periodYear:{type:`integer`,column:`period_year`},periodMonth:{type:`integer`,column:`period_month`},status:{type:`string`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},followUpOn:{type:`date`,nullable:!0,column:`follow_up_on`},archived:{type:`boolean`},...g8}),h8({id:{type:`string`,primaryKey:!0},name:{type:`string`},nameKey:{type:`string`,unique:!0,column:`name_key`},color:{type:`string`,nullable:!0},scope:{type:`string`},...g8}),h8({id:{type:`string`,primaryKey:!0},tagId:{type:`string`,column:`tag_id`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},...g8}),h8({id:{type:`string`,primaryKey:!0},title:{type:`string`},body:{type:`string`},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,nullable:!0,column:`target_id`},pinned:{type:`boolean`},...g8}),h8({id:{type:`string`,primaryKey:!0},applicationId:{type:`string`,column:`application_id`},fromStatus:{type:`string`,nullable:!0,column:`from_status`},toStatus:{type:`string`,column:`to_status`},occurredOn:{type:`date`,column:`occurred_on`},commentText:{type:`string`,nullable:!0,column:`comment_text`},...g8}),h8({id:{type:`string`,primaryKey:!0},targetType:{type:`string`,column:`target_type`},targetId:{type:`string`,column:`target_id`},model:{type:`string`},dim:{type:`integer`},embedding:{type:`json`},textHash:{type:`string`,column:`text_hash`},...g8}),h8({id:{type:`string`,primaryKey:!0},companyId:{type:`string`,column:`company_id`},jobTitle:{type:`string`,column:`job_title`},jobUrl:{type:`string`,nullable:!0,column:`job_url`},location:{type:`string`,nullable:!0},workMode:{type:`string`,column:`work_mode`},sourceName:{type:`string`,nullable:!0,column:`source_name`},salaryMin:{type:`integer`,nullable:!0,column:`salary_min`},salaryMax:{type:`integer`,nullable:!0,column:`salary_max`},salaryCurrency:{type:`string`,nullable:!0,column:`salary_currency`},notes:{type:`string`,nullable:!0},savedOn:{type:`date`,column:`saved_on`},archived:{type:`boolean`},convertedApplicationId:{type:`string`,nullable:!0,column:`converted_application_id`},...g8}),[{header:`Position`,value:e=>e.jobTitle,width:34},{header:`Company`,value:e=>e.company.name,width:28},{header:`Date`,value:e=>e.appliedOn,width:13},{header:`Status`,value:e=>n$[e.status],width:13},{header:`Notes`,value:e=>e.notesText,width:70,wrap:!0}].map(e=>e.header),new Map(Object.entries(n$).map(([e,t])=>[t.toLowerCase(),e]));var _8=d8,v8={applications:e=>[`applications`,e],application:e=>[`application`,e],periods:()=>[`periods`],companies:e=>[`companies`,e],company:e=>[`company`,e],companySuggest:e=>[`company-suggest`,e],tags:()=>[`tags`],notes:e=>[`notes`,e],dashboard:()=>[`dashboard`],duplicates:e=>[`duplicates`,e],search:e=>[`search`,e],openings:e=>[`openings`,e],opening:e=>[`opening`,e],dbTargets:()=>[`db-targets`],dataStatus:()=>[`data-status`],meta:()=>[`meta`]};function y8(e){e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`company`]}),e.invalidateQueries({queryKey:[`tags`]}),e.invalidateQueries({queryKey:[`duplicates`]}),e.invalidateQueries({queryKey:[`search`]})}function b8(e){return Xr({queryKey:v8.applications(e),queryFn:()=>_8.listApplications(e),placeholderData:e=>e})}function x8(e){return Qr({queryKey:v8.applications(e),queryFn:({pageParam:t})=>_8.listApplications(t?{...e,cursor:t}:e),initialPageParam:null,getNextPageParam:e=>e.hasMore?e.cursor:null,placeholderData:e=>e})}function S8(e){return Xr({queryKey:v8.application(e??``),queryFn:()=>_8.getApplication(e),enabled:!!e})}function C8(){return Xr({queryKey:v8.periods(),queryFn:()=>_8.periods()})}function w8(){return Xr({queryKey:v8.dashboard(),queryFn:()=>_8.dashboard()})}function T8(){return Xr({queryKey:v8.tags(),queryFn:()=>_8.listTags()})}function E8(e={}){return Xr({queryKey:v8.companies(e),queryFn:()=>_8.listCompanies(e)})}function D8(e){return Xr({queryKey:v8.company(e??``),queryFn:()=>_8.getCompany(e),enabled:!!e})}function O8(e={}){return Xr({queryKey:v8.notes(e),queryFn:()=>_8.listNotes(e)})}function k8(e){let{enabled:t=!0,...n}=e;return Xr({queryKey:v8.duplicates(n),queryFn:()=>_8.checkDuplicates(n),enabled:t&&n.company.trim().length>1,staleTime:5e3})}function A8(e){return Xr({queryKey:v8.companySuggest(e),queryFn:()=>_8.suggestCompanies(e),enabled:e.trim().length>0,staleTime:3e4})}function j8(){let e=Tn();return Zr({mutationFn:e=>_8.createApplication(e),onSuccess:()=>y8(e)})}function M8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>_8.updateApplication(e,t),onSuccess:()=>y8(e)})}function N8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>_8.changeStatus(e,t),onSuccess:()=>y8(e)})}function P8(){let e=Tn();return Zr({mutationFn:e=>_8.deleteApplication(e),onSuccess:()=>y8(e)})}function F8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>_8.updateCompany(e,t),onSuccess:()=>y8(e)})}function I8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>e?_8.updateNote(e,t):_8.createNote(t),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`search`]})}})}function L8(){let e=Tn();return Zr({mutationFn:e=>_8.deleteNote(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`notes`]}),e.invalidateQueries({queryKey:[`application`]})}})}function R8(e={}){return Xr({queryKey:v8.openings(e),queryFn:()=>_8.listOpenings(e)})}function z8(e){e.invalidateQueries({queryKey:[`openings`]}),e.invalidateQueries({queryKey:[`opening`]})}function B8(){let e=Tn();return Zr({mutationFn:e=>_8.createOpening(e),onSuccess:()=>z8(e)})}function V8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>_8.updateOpening(e,t),onSuccess:()=>z8(e)})}function H8(){let e=Tn();return Zr({mutationFn:e=>_8.deleteOpening(e),onSuccess:()=>z8(e)})}function U8(){let e=Tn();return Zr({mutationFn:({id:e,body:t})=>_8.convertOpening(e,t),onSuccess:()=>{z8(e),e.invalidateQueries({queryKey:[`applications`]}),e.invalidateQueries({queryKey:[`application`]}),e.invalidateQueries({queryKey:[`periods`]}),e.invalidateQueries({queryKey:[`dashboard`]}),e.invalidateQueries({queryKey:[`companies`]}),e.invalidateQueries({queryKey:[`search`]})}})}function W8(){return Xr({queryKey:v8.dbTargets(),queryFn:()=>_8.getDbTargets()})}function G8(){return Zr({mutationFn:e=>_8.switchDb(e)})}function K8(){return Xr({queryKey:v8.dataStatus(),queryFn:()=>_8.getDataStatus()})}function q8(){let e=Tn();return Zr({mutationFn:()=>_8.clearDatabase(),onSuccess:()=>void e.invalidateQueries()})}function J8(){let e=Tn();return Zr({mutationFn:()=>_8.seedDatabase(),onSuccess:()=>void e.invalidateQueries()})}function Y8(){return Xr({queryKey:v8.meta(),queryFn:()=>_8.getMeta(),staleTime:1/0})}function X8({status:e}){return(0,Z.jsx)(MY,{color:t$[e],children:n$[e]})}function Z8(e,t=300){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var Q8={exact:`error`,similar:`warning`,company:`info`,none:`success`};function $8({check:e,loading:t}){if(t&&!e)return(0,Z.jsx)(Fp,{type:`info`,showIcon:!0,message:`Checking your history…`,style:{marginBottom:16}});if(!e)return null;if(e.verdict===`none`)return(0,Z.jsx)(Fp,{type:`success`,showIcon:!0,message:`No history with this company`,description:`This looks like a company you haven't applied to before.`,style:{marginBottom:16}});let n=e.company?.name??`this company`;return(0,Z.jsx)(Fp,{type:Q8[e.verdict],showIcon:!0,style:{marginBottom:16},message:e5(e.verdict,n,e.priorCount),description:(0,Z.jsxs)(Rz,{direction:`vertical`,size:6,style:{width:`100%`},children:[e.matches.length>0?e.matches.slice(0,5).map(e=>(0,Z.jsx)(t5,{match:e},e.id)):(0,Z.jsx)($X.Text,{type:`secondary`,children:`None of them were for this role, but it is worth a look before you apply again.`}),!e.semanticUsed&&e.matches.length>0&&(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Matched on wording only — semantic matching is still warming up.`})]})})}function e5(e,t,n){let r=n===1?`once`:`${n} times`;switch(e){case`exact`:return`You have already applied for this exact role at ${t}`;case`similar`:return`You have applied for a very similar role at ${t}`;default:return`You have applied to ${t} ${r} before`}}function t5({match:e}){let t=Math.round(Math.max(e.titleSimilarity,e.semanticSimilarity??0)*100);return(0,Z.jsxs)(Rz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),(0,Z.jsx)($X.Text,{type:`secondary`,children:e.appliedOn}),(0,Z.jsx)(MY,{color:t$[e.status],children:n$[e.status]}),e.matchKind===`exact`?(0,Z.jsx)(MY,{color:`red`,children:`exact title`}):(0,Z.jsxs)(MY,{children:[t,`% similar`]})]})}function n5({onStartApplication:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),a=Z8(t,350),{data:o,isFetching:s}=k8({company:a,title:Z8(r,350)}),c=a.trim().length>1;return(0,Z.jsx)(wF,{title:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(IQ,{}),(0,Z.jsx)(`span`,{children:`Check before you apply`})]}),extra:e&&(0,Z.jsx)(Gk,{type:`link`,onClick:e,children:`New application`}),children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)(WU,{gutter:12,children:[(0,Z.jsx)(BI,{xs:24,sm:12,children:(0,Z.jsx)(xV,{placeholder:`Company`,value:t,onChange:e=>n(e.target.value),allowClear:!0})}),(0,Z.jsx)(BI,{xs:24,sm:12,children:(0,Z.jsx)(xV,{placeholder:`Job title (optional)`,value:r,onChange:e=>i(e.target.value),allowClear:!0})})]}),c?(0,Z.jsx)($8,{check:o,loading:s}):(0,Z.jsx)($X.Text,{type:`secondary`,children:`Type a company name to see whether you have been here before.`})]})})}function r5({open:e,onClose:t,application:n}){let[r]=JB.useForm(),{message:i,modal:a}=LC.useApp(),o=!!n,s=j8(),c=M8(),{data:l}=T8(),u=JB.useWatch(`companyName`,r)??``,d=JB.useWatch(`jobTitle`,r)??``,f=Z8(u,300),p=Z8(d,300),m=o&&u.trim()===(n?.company.name??``).trim()&&d.trim()===(n?.jobTitle??``).trim(),{data:h}=A8(f),{data:g,isFetching:v}=k8({company:f,title:p,...n?{excludeId:n.id}:{},enabled:e&&!m});(0,_.useEffect)(()=>{e&&(n?r.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,appliedOn:(0,$k.default)(n.appliedOn),status:n.status,jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,followUpOn:n.followUpOn?(0,$k.default)(n.followUpOn):null,tags:n.tags.map(e=>e.name)}):(r.resetFields(),r.setFieldsValue({appliedOn:(0,$k.default)(),status:`applied`,workMode:`unspecified`,tags:[]})))},[e,n,r]);let y=(0,_.useMemo)(()=>(h?.companies??[]).map(e=>({value:e.name,label:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(`span`,{children:e.name}),e.applicationCount>0&&(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[e.applicationCount,` application`,e.applicationCount===1?``:`s`]})]})})),[h]),b=(0,_.useMemo)(()=>(l?.tags??[]).map(e=>({value:e.name,label:e.name})),[l]),[x,S]=(0,_.useState)(!1);async function C(e){if(g&&i8(g.verdict)&&!o&&!await new Promise(e=>{a.confirm({title:`You have applied for this exact role before`,content:(0,Z.jsxs)(Rz,{direction:`vertical`,children:[(0,Z.jsxs)($X.Text,{children:[g.matches[0]?.jobTitle,` at `,g.company?.name,` on`,` `,g.matches[0]?.appliedOn,`.`]}),(0,Z.jsx)($X.Text,{type:`secondary`,children:`Save this as a new application anyway?`})]}),okText:`Save anyway`,cancelText:`Go back`,onOk:()=>e(!0),onCancel:()=>e(!1)})}))return;let l={companyName:e.companyName,jobTitle:e.jobTitle,appliedOn:e.appliedOn.format(`YYYY-MM-DD`),status:e.status,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,followUpOn:e.followUpOn?e.followUpOn.format(`YYYY-MM-DD`):null,tags:e.tags??[],...o?{}:{notes:e.notes??null}};S(!0);try{n?(await c.mutateAsync({id:n.id,body:l}),i.success(`Application updated`)):(await s.mutateAsync(l),i.success(`Application saved`)),t()}catch(e){e instanceof a8&&e.fieldErrors.length>0?(r.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),i.error(`Please check the highlighted fields`)):i.error(e instanceof Error?e.message:`Could not save`)}finally{S(!1)}}return(0,Z.jsxs)(kz,{title:o?`Edit application`:`New application`,open:e,onClose:t,width:640,destroyOnHidden:!0,extra:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Gk,{type:`primary`,loading:x,onClick:()=>r.submit(),children:o?`Save changes`:`Save application`})]}),children:[!m&&(0,Z.jsx)($8,{check:g,loading:v}),(0,Z.jsxs)(JB,{form:r,layout:`vertical`,onFinish:C,requiredMark:`optional`,children:[(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(LE,{options:y,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(xV,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(AE,{options:QQ.map(e=>({value:e,label:n$[e]}))})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`followUpOn`,label:`Follow up on`,children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`,allowClear:!0})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(AE,{options:r$.map(e=>({value:e,label:i$[e]}))})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(xV,{placeholder:`Stockholm`})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(xV,{placeholder:`LinkedIn, referral…`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(xV,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(JB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(xV,{placeholder:`https://…`})}),(0,Z.jsx)(JB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(AE,{mode:`tags`,options:b,placeholder:`fintech, remote-ok, dream-job…`,tokenSeparators:[`,`]})}),!o&&(0,Z.jsx)(JB.Item,{name:`notes`,label:`Notes`,help:`Saved as a note linked to this application. Searchable.`,children:(0,Z.jsx)(xV.TextArea,{rows:4,placeholder:`Anything worth remembering…`})})]})]})}var i5={dark:{bgBase:`#0d1117`,bgRaised:`#161b22`,bgSunken:`#010409`,border:`#30363d`,borderStrong:`#444c56`,textPrimary:`#e6edf3`,textMuted:`#8b949e`,textFaint:`#6e7681`,accent:`#58a6ff`,success:`#3fb950`,danger:`#f85149`,warning:`#d29922`},light:{bgBase:`#ffffff`,bgRaised:`#ffffff`,bgSunken:`#f6f8fa`,border:`#d0d7de`,borderStrong:`#afb8c1`,textPrimary:`#1f2328`,textMuted:`#656d76`,textFaint:`#8c959f`,accent:`#0969da`,success:`#1a7f37`,danger:`#d1242f`,warning:`#9a6700`}},a5={bgBase:`var(--jt-bg-base)`,bgRaised:`var(--jt-bg-raised)`,bgSunken:`var(--jt-bg-sunken)`,border:`var(--jt-border)`,borderStrong:`var(--jt-border-strong)`,textPrimary:`var(--jt-text-primary)`,textMuted:`var(--jt-text-muted)`,textFaint:`var(--jt-text-faint)`,accent:`var(--jt-accent)`,success:`var(--jt-success)`,danger:`var(--jt-danger)`,warning:`var(--jt-warning)`};function o5(e){let t=i5[e];return{algorithm:e===`dark`?HY.darkAlgorithm:HY.defaultAlgorithm,token:{colorBgBase:t.bgBase,colorBgContainer:t.bgRaised,colorBgElevated:t.bgRaised,colorBgLayout:t.bgBase,colorBorder:t.border,colorBorderSecondary:t.border,colorText:t.textPrimary,colorTextSecondary:t.textMuted,colorTextTertiary:t.textFaint,colorPrimary:t.accent,colorLink:t.accent,colorSuccess:t.success,colorError:t.danger,colorWarning:t.warning,borderRadius:8,fontSize:14},components:{Layout:{siderBg:t.bgSunken,headerBg:t.bgSunken,bodyBg:t.bgBase}}}}function s5(e){return`${p$(e.month).slice(0,3)} ${e.year}`}function c5({points:e,height:t=140}){let[n,r]=(0,_.useState)(null);if(e.length===0)return null;let i=Math.max(...e.map(e=>e.count),1),a=e.reduce((e,t)=>e+t.count,0),o=n===null?null:e[n];return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`baseline`,style:{marginBottom:8},children:[(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:o?`${s5(o)}: ${o.count} application${o.count===1?``:`s`}`:`${a} application${a===1?``:`s`} over ${e.length} months`}),(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[`peak `,i]})]}),(0,Z.jsxs)(`svg`,{viewBox:`0 0 ${e.length*10} 100`,preserveAspectRatio:`none`,role:`img`,"aria-label":`Applications per month, ${s5(e[0])} to ${s5(e.at(-1))}. Peak ${i} in one month, ${a} in total.`,style:{display:`block`,width:`100%`,height:t},onMouseLeave:()=>r(null),children:[(0,Z.jsx)(`title`,{children:`Applications per month`}),e.map((e,t)=>{let a=e.count===0?0:Math.max(e.count/i*100,2);return(0,Z.jsxs)(`g`,{onMouseEnter:()=>r(t),children:[(0,Z.jsx)(`rect`,{x:t*10,y:`0`,width:10,height:100,fill:`transparent`}),(0,Z.jsx)(`rect`,{x:t*10+3/2,y:100-a,width:7,height:Math.max(a,1),rx:`1`,fill:e.count===0?a5.border:a5.accent,opacity:n===null||n===t?1:.45})]},`${e.year}-${e.month}`)})]}),(0,Z.jsx)(eB,{justify:`space-between`,style:{marginTop:6},children:[e[0],e[Math.floor(e.length/2)],e.at(-1)].map((e,t)=>(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:11},children:s5(e)},t))})]})}var l5=[.45,.6,.78,1];function u5({stages:e}){let t=e[0]?.count??0;return(0,Z.jsxs)(Rz,{direction:`vertical`,size:10,style:{width:`100%`},children:[e.map((e,n)=>{let r=t>0?e.count/t:0;return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`baseline`,marginBottom:4,gap:8},children:[(0,Z.jsx)($X.Text,{style:{fontSize:13},children:n$[e.status]}),(0,Z.jsxs)(Rz,{size:8,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e.count}),e.conversion!==null&&(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[Math.round(e.conversion*100),`% of previous`]})]})]}),(0,Z.jsxs)(`svg`,{viewBox:`0 0 100 6`,preserveAspectRatio:`none`,role:`img`,"aria-label":`${n$[e.status]}: ${e.count} applications ever reached this stage`,style:{display:`block`,width:`100%`,height:10},children:[(0,Z.jsx)(`title`,{children:`${n$[e.status]}: ${e.count}`}),(0,Z.jsx)(`rect`,{x:`0`,y:`0`,width:`100`,height:`6`,rx:`1.5`,fill:a5.bgSunken}),r>0&&(0,Z.jsx)(`rect`,{x:`0`,y:`0`,width:Math.max(r*100,1),height:`6`,rx:`1.5`,fill:a5.accent,opacity:l5[n]??1})]})]},e.status)}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Counted from your status history — an application that interviewed and was then turned down still counts at every stage it reached.`})]})}function d5({values:e,label:t,height:n=28}){if(e.length<2)return null;let r=Math.max(...e,1),i=100/(e.length-1),a=e.map((e,t)=>`${(t*i).toFixed(2)},${(100-e/r*100).toFixed(2)}`).join(` `),o=`0,100 ${a} 100,100`;return(0,Z.jsxs)(`svg`,{viewBox:`0 0 100 100`,preserveAspectRatio:`none`,role:`img`,"aria-label":t,style:{display:`block`,width:`100%`,height:n},children:[(0,Z.jsx)(`title`,{children:t}),(0,Z.jsx)(`polygon`,{points:o,fill:a5.accent,opacity:.12}),(0,Z.jsx)(`polyline`,{points:a,fill:`none`,stroke:a5.accent,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})]})}function f5(){let{data:e,isLoading:t}=w8(),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(`follow-ups`),o=u$(d$());if(t||!e)return(0,Z.jsx)(DS,{active:!0,paragraph:{rows:8}});let{stats:s,followUps:c,recentActivity:l,funnel:u,volume:d,stale:f}=e;if(s.total===0)return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wF,{children:(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,children:[(0,Z.jsx)($X.Text,{strong:!0,children:`No applications yet`}),(0,Z.jsx)($X.Text,{type:`secondary`,children:`Add the first one, or bring in a spreadsheet you already keep.`})]}),children:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>r(!0),children:`New application`}),(0,Z.jsx)(dn,{to:`/applications`,children:(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(ZQ,{}),children:`Import`})})]})})}),(0,Z.jsx)(r5,{open:n,onClose:()=>r(!1)})]});let p=d.slice(-12),m=d.slice(-13,-1),h=m.length>0?m.reduce((e,t)=>e+t.count,0)/m.length:0,g=s.thisMonth-h,v=i===`follow-ups`?c.length:f.length;return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsx)(nW,{title:`Total applications`,value:s.total})})}),(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsx)(nW,{title:`Still active`,value:s.active,valueStyle:{color:a5.accent}})})}),(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsxs)(wF,{size:`small`,children:[(0,Z.jsx)(nW,{title:`${p$(o.month)} ${o.year}`,value:s.thisMonth}),(0,Z.jsx)(d5,{values:p.map(e=>e.count),label:`Applications in each of the last ${p.length} months: ${p.map(e=>e.count).join(`, `)}`}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:h===0?`first month on record`:`${g>=0?`+`:``}${g.toFixed(1)} vs your monthly average`})]})}),(0,Z.jsx)(BI,{xs:12,sm:12,md:6,children:(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)($X.Text,{type:`secondary`,children:`Response rate`}),(0,Z.jsx)(wU,{percent:Math.round(s.responseRate*100),size:`small`,strokeColor:a5.accent}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Anything past “applied” counts as a reply`})]})})})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:24,lg:14,children:(0,Z.jsx)(n5,{onStartApplication:()=>r(!0)})}),(0,Z.jsx)(BI,{xs:24,lg:10,children:(0,Z.jsx)(wF,{title:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(VR,{}),(0,Z.jsx)(`span`,{children:`Needs attention`})]}),extra:(0,Z.jsx)(eL,{size:`small`,value:i,onChange:e=>a(e),options:[{label:`Follow-ups (${c.length})`,value:`follow-ups`},{label:`Gone quiet (${f.length})`,value:`quiet`}]}),styles:{body:{maxHeight:320,overflowY:`auto`}},children:v===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:i===`follow-ups`?`Nothing due — all caught up`:`Nothing has gone quiet`}):i===`follow-ups`?(0,Z.jsx)(LH,{size:`small`,dataSource:c,renderItem:e=>(0,Z.jsxs)(LH.Item,{children:[(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),description:(0,Z.jsxs)(eB,{justify:`space-between`,wrap:!0,gap:8,children:[(0,Z.jsx)(`span`,{children:e.company.name}),(0,Z.jsxs)($X.Text,{type:`danger`,children:[`due `,e.followUpOn]})]})}),(0,Z.jsx)(X8,{status:e.status})]})}):(0,Z.jsx)(LH,{size:`small`,dataSource:f,header:(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Still live, no follow-up date, and nothing has moved.`}),renderItem:e=>(0,Z.jsxs)(LH.Item,{children:[(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsx)(dn,{to:`/applications/${e.id}`,children:e.jobTitle}),description:(0,Z.jsxs)(eB,{justify:`space-between`,wrap:!0,gap:8,children:[(0,Z.jsx)(`span`,{children:e.company.name}),(0,Z.jsxs)($X.Text,{type:`warning`,children:[`silent `,e.silentDays,` days`]})]})}),(0,Z.jsx)(X8,{status:e.status})]})})})})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:24,lg:12,children:(0,Z.jsx)(wF,{title:`Pipeline`,size:`small`,children:(0,Z.jsx)(u5,{stages:u})})}),(0,Z.jsx)(BI,{xs:24,lg:12,children:(0,Z.jsx)(wF,{title:`Applications over time`,size:`small`,children:(0,Z.jsx)(c5,{points:d})})})]}),(0,Z.jsx)(wF,{title:`Recent activity`,size:`small`,styles:{body:{maxHeight:360,overflowY:`auto`}},children:l.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No status changes yet`}):(0,Z.jsx)(XY,{items:l.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsxs)($X.Text,{children:[(0,Z.jsx)(dn,{to:`/applications/${e.applicationId}`,children:e.jobTitle}),` at `,e.companyName]}),(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[e.fromStatus?`${n$[e.fromStatus]} → ${n$[e.toStatus]}`:`Applied (${n$[e.toStatus]})`,` `,`· `,e.occurredOn]})]})}))})}),(0,Z.jsx)(r5,{open:n,onClose:()=>r(!1)})]})}function p5({periods:e,year:t,month:n,onSelect:r}){let i=(0,_.useMemo)(()=>e.map(e=>({key:`y:${e.year}`,title:(0,Z.jsx)(m5,{label:String(e.year),count:e.count,strong:!0}),children:(e.months??[]).map(e=>({key:`m:${e.year}:${e.month}`,title:(0,Z.jsx)(m5,{label:p$(e.month),count:e.count})}))})),[e]),a=(0,_.useMemo)(()=>t&&n?[`m:${t}:${n}`]:t?[`y:${t}`]:[],[t,n]),o=(0,_.useMemo)(()=>{let n=e[0],r=n?[`y:${n.year}`]:[];return t&&!r.includes(`y:${t}`)&&r.push(`y:${t}`),r},[e,t]);return e.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No applications yet`}):(0,Z.jsx)(sJ,{treeData:i,selectedKeys:a,defaultExpandedKeys:o,blockNode:!0,onSelect:e=>{let t=String(e[0]??``);if(t.startsWith(`m:`)){let[,e,n]=t.split(`:`);r({year:Number(e),month:Number(n)})}else t.startsWith(`y:`)?r({year:Number(t.slice(2))}):r({})}})}function m5({label:e,count:t,strong:n}){return(0,Z.jsxs)(`span`,{style:{display:`flex`,justifyContent:`space-between`,gap:12},children:[(0,Z.jsx)($X.Text,{strong:n,children:e}),(0,Z.jsx)($X.Text,{type:`secondary`,children:t})]})}var h5={new:`green`,duplicate:`default`,error:`red`},g5={new:`New`,duplicate:`Duplicate — skipped`,error:`Error`};function _5({open:e,onClose:t}){let n=Tn(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(`csv`),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null);function h(){i(null),c(null),u(null),m(null)}function g(){h(),t()}let v=e=>{let t=e.name.toLowerCase().endsWith(`.xlsx`)?`xlsx`:`csv`;return i(e),o(t),m(null),f(!0),_8.previewImport(e,t).then(c).catch(e=>m(e instanceof Error?e.message:`Could not read that file`)).finally(()=>f(!1)),!1};async function y(){if(r){f(!0),m(null);try{let e=await _8.commitImport(r,a);if(u(e),e.created>0)for(let e of[`applications`,`application`,`periods`,`dashboard`,`companies`,`company`,`search`])n.invalidateQueries({queryKey:[e]})}catch(e){m(e instanceof Error?e.message:`Import failed`)}finally{f(!1)}}}return(0,Z.jsx)(VH,{title:`Import applications`,open:e,onCancel:g,width:800,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,children:`CSV or .xlsx with the same columns Export produces: Position, Company, Date, Status, Notes. Rows that exactly match an application you have already logged are skipped automatically.`}),(0,Z.jsxs)(GZ.Dragger,{accept:`.csv,.xlsx`,maxCount:1,showUploadList:!1,beforeUpload:v,disabled:d,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(hQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a CSV or Excel file here`})]})]}),p&&(0,Z.jsx)(Fp,{type:`error`,showIcon:!0,message:p}),s&&!l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Rz,{wrap:!0,children:[(0,Z.jsxs)(MY,{color:`green`,children:[s.totals.new,` new`]}),(0,Z.jsxs)(MY,{children:[s.totals.duplicate,` duplicate — will be skipped`]}),s.totals.error>0&&(0,Z.jsxs)(MY,{color:`red`,children:[s.totals.error,` error`]})]}),s.fileErrors.map(e=>(0,Z.jsx)(Fp,{type:`warning`,showIcon:!0,message:e},e)),(0,Z.jsx)(yY,{size:`small`,rowKey:`rowNumber`,columns:[{title:`Row`,dataIndex:`rowNumber`,width:60},{title:`Position`,dataIndex:`jobTitle`,ellipsis:!0},{title:`Company`,dataIndex:`companyName`,ellipsis:!0},{title:`Date`,dataIndex:`appliedOn`,width:110},{title:`Status`,dataIndex:`status`,width:110,render:e=>e?n$[e]:`—`},{title:`Result`,dataIndex:`verdict`,width:200,render:(e,t)=>(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)(MY,{color:h5[e],children:g5[e]}),t.errors.length>0&&(0,Z.jsx)($X.Text,{type:`danger`,style:{fontSize:12},children:t.errors.join(`; `)})]})}],dataSource:s.rows,pagination:{pageSize:10},scroll:{y:320}}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:h,children:`Choose a different file`}),(0,Z.jsxs)(Gk,{type:`primary`,loading:d,disabled:s.totals.new===0,onClick:y,children:[`Import `,s.totals.new,` application`,s.totals.new===1?``:`s`]})]})]}),l&&(0,Z.jsx)(UU,{status:l.failed>0?`warning`:`success`,title:`Imported ${l.created} application${l.created===1?``:`s`}`,subTitle:`${l.skipped} duplicate row${l.skipped===1?``:`s`} skipped`+(l.failed>0?`, ${l.failed} row${l.failed===1?``:`s`} failed`:``),extra:(0,Z.jsx)(Gk,{type:`primary`,onClick:g,children:`Done`})})]})})}function v5(){let e=Xe(),[t,n]=_n(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),s=(0,_.useMemo)(()=>{let e={};for(let n of[`q`,`source`,`sort`,`direction`,`from`,`to`]){let r=t.get(n);r&&(e[n]=r)}for(let n of[`year`,`month`]){let r=t.get(n);r&&(e[n]=Number(r))}for(let n of[`status`,`workMode`,`tags`]){let r=t.get(n);r&&(e[n]=r.split(`,`))}return e},[t]),{data:c,isLoading:l,isFetching:u,hasNextPage:d,fetchNextPage:f,isFetchingNextPage:p}=x8(s),{data:m}=C8(),{data:h}=T8(),g=c?.pages??[],v=(0,_.useMemo)(()=>g.flatMap(e=>e.items),[g]),y=g[0];function b(e){let r=new URLSearchParams(t);for(let[t,n]of Object.entries(e))n==null||n===``||Array.isArray(n)&&n.length===0?r.delete(t):r.set(t,Array.isArray(n)?n.join(`,`):String(n));n(r,{replace:!0})}let x=[{title:`Applied`,dataIndex:`appliedOn`,width:118,sorter:!1,render:e=>(0,Z.jsx)($X.Text,{children:e})},{title:`Company`,key:`company`,width:190,render:(t,n)=>(0,Z.jsx)(Gk,{type:`link`,style:{padding:0,height:`auto`},onClick:t=>{t.stopPropagation(),e(`/companies/${n.company.id}`)},children:n.company.name})},{title:`Job title`,dataIndex:`jobTitle`,render:(e,t)=>(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e}),t.location&&(0,Z.jsxs)($X.Text,{type:`secondary`,style:{fontSize:12},children:[t.location,` · `,i$[t.workMode]]})]})},{title:`Status`,dataIndex:`status`,width:116,render:(e,t)=>(0,Z.jsx)(X8,{status:t.status})},{title:`Tags`,key:`tags`,width:210,render:(e,t)=>(0,Z.jsx)(Rz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(MY,{color:e.color??void 0,style:{marginInlineEnd:0},children:e.name},e.id))})},{title:`Source`,dataIndex:`sourceName`,width:120,render:e=>e??(0,Z.jsx)($X.Text,{type:`secondary`,children:`—`})}],S=t.get(`from`),C=t.get(`to`),w=S&&C?[(0,$k.default)(S),(0,$k.default)(C)]:null,T=(0,$k.default)(),E=[{label:`Today`,value:[T,T]},{label:`Yesterday`,value:[T.subtract(1,`day`),T.subtract(1,`day`)]},{label:`This week`,value:[T.startOf(`week`),T.endOf(`week`)]},{label:`This month`,value:[T.startOf(`month`),T.endOf(`month`)]},{label:`Last 7 days`,value:[T.subtract(6,`day`),T]},{label:`Last 30 days`,value:[T.subtract(29,`day`),T]}];function D(e){if(!e||!e[0]||!e[1]){b({from:``,to:``});return}b({from:e[0].format(`YYYY-MM-DD`),to:e[1].format(`YYYY-MM-DD`)})}let O=t.get(`year`)?Number(t.get(`year`)):void 0,k=t.get(`month`)?Number(t.get(`month`)):void 0,A=O&&k?`${p$(k)} ${O}`:O?String(O):`All applications`;return(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{xs:24,md:6,lg:5,children:(0,Z.jsx)(wF,{size:`small`,title:`By period`,extra:(O||k)&&(0,Z.jsx)(Gk,{size:`small`,type:`link`,onClick:()=>b({year:``,month:``}),children:`Clear`}),styles:{body:{maxHeight:`calc(100vh - 220px)`,overflowY:`auto`}},children:(0,Z.jsx)(p5,{periods:m?.periods??[],year:O,month:k,onSelect:e=>b({year:e.year??``,month:e.month??``})})})}),(0,Z.jsx)(BI,{xs:24,md:18,lg:19,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:A}),(0,Z.jsx)($X.Text,{type:`secondary`,children:y?v.length<y.total?`Showing ${v.length} of ${y.total} applications`:`${y.total} application${y.total===1?``:`s`}`:`Loading…`})]}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Bz,{menu:{items:[{key:`csv`,label:`Export as CSV`},{key:`xlsx`,label:`Export as Excel (.xlsx)`}],onClick:({key:e})=>{window.location.href=_8.exportUrl(s,e)}},children:(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(zZ,{}),children:`Export`})}),(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(ZQ,{}),onClick:()=>o(!0),children:`Import`}),(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>i(!0),children:`New application`})]})]}),(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsx)(xV,{allowClear:!0,size:`large`,prefix:(0,Z.jsx)(TE,{}),placeholder:`Search by meaning — try “server-side developer” or “remote fintech”`,defaultValue:t.get(`q`)??``,onChange:e=>{e.target.value===``&&b({q:``})},onPressEnter:e=>b({q:e.target.value})}),(0,Z.jsxs)(eB,{gap:8,wrap:!0,children:[(0,Z.jsx)(KR.RangePicker,{allowClear:!0,value:w,presets:E,format:`YYYY-MM-DD`,onChange:e=>D(e)}),(0,Z.jsx)(AE,{mode:`multiple`,allowClear:!0,placeholder:`Status`,style:{minWidth:180},suffixIcon:(0,Z.jsx)(lQ,{}),value:t.get(`status`)?.split(`,`)??[],onChange:e=>b({status:e}),options:QQ.map(e=>({value:e,label:n$[e]}))}),(0,Z.jsx)(AE,{mode:`multiple`,allowClear:!0,placeholder:`Work mode`,style:{minWidth:160},value:t.get(`workMode`)?.split(`,`)??[],onChange:e=>b({workMode:e}),options:r$.map(e=>({value:e,label:i$[e]}))}),(0,Z.jsx)(AE,{mode:`multiple`,allowClear:!0,placeholder:`Tags`,style:{minWidth:200},value:t.get(`tags`)?.split(`,`)??[],onChange:e=>b({tags:e}),options:(h?.tags??[]).map(e=>({value:e.name,label:e.name}))}),(0,Z.jsx)(AE,{style:{minWidth:170},value:t.get(`sort`)??`appliedOn`,onChange:e=>b({sort:e}),options:[{value:`appliedOn`,label:`Sort: date applied`},{value:`company`,label:`Sort: company`},{value:`jobTitle`,label:`Sort: job title`},{value:`status`,label:`Sort: status`}]}),(0,Z.jsx)(AE,{style:{width:130},value:t.get(`direction`)??`desc`,onChange:e=>b({direction:e}),options:[{value:`desc`,label:`Newest first`},{value:`asc`,label:`Oldest first`}]})]}),y?.searched&&!y.semanticReady&&(0,Z.jsx)(Fp,{type:`info`,showIcon:!0,icon:(0,Z.jsx)(JQ,{}),message:`Results will improve shortly — the semantic model is still loading.`})]})}),(0,Z.jsx)(yY,{rowKey:`id`,columns:x,dataSource:v,loading:l||u&&!p,pagination:!1,onRow:t=>({onClick:()=>e(`/applications/${t.id}`),style:{cursor:`pointer`}}),locale:{emptyText:(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:t.get(`q`)?`Nothing matched “${t.get(`q`)}”`:`No applications for this filter`})},footer:d?()=>(0,Z.jsx)(eB,{justify:`center`,children:(0,Z.jsx)(bD,{title:`Adds the next page to the list`,children:(0,Z.jsx)(Gk,{loading:p,onClick:()=>void f(),children:`Load more`})})}):void 0})]})}),(0,Z.jsx)(r5,{open:r,onClose:()=>i(!1)}),(0,Z.jsx)(_5,{open:a,onClose:()=>o(!1)})]})}function y5({open:e,note:t,onClose:n,target:r}){let[i]=JB.useForm(),{message:a}=LC.useApp(),o=I8();return(0,Z.jsx)(VH,{open:e,title:t?`Edit note`:`New note`,okText:`Save`,destroyOnHidden:!0,onCancel:n,afterOpenChange:e=>{e&&(t?i.setFieldsValue({title:t.title,body:t.body,targetType:t.targetType,targetId:t.targetId,pinned:t.pinned}):(i.resetFields(),i.setFieldsValue({targetType:r?r.type:`standalone`,targetId:r?r.id:null,pinned:!1,body:``})))},onOk:async()=>{let e=await i.validateFields();await o.mutateAsync({...t?{id:t.id}:{},body:{title:e.title,body:e.body??``,targetType:e.targetType,targetId:e.targetType===`standalone`?null:e.targetId??null,pinned:e.pinned??!1}}),a.success(t?`Note updated`:`Note saved`),n()},children:(0,Z.jsxs)(JB,{form:i,layout:`vertical`,children:[(0,Z.jsx)(JB.Item,{name:`title`,label:`Title`,rules:[{required:!0,message:`Title is required`}],children:(0,Z.jsx)(xV,{placeholder:`Interview prep, salary research…`})}),(0,Z.jsx)(JB.Item,{name:`body`,label:`Note`,children:(0,Z.jsx)(xV.TextArea,{rows:8,placeholder:`Anything worth keeping`})}),r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(JB.Item,{name:`targetType`,hidden:!0,children:(0,Z.jsx)(xV,{})}),(0,Z.jsx)(JB.Item,{name:`targetId`,hidden:!0,children:(0,Z.jsx)(xV,{})}),(0,Z.jsxs)($X.Paragraph,{type:`secondary`,style:{marginBottom:16},children:[`Attached to `,r.label]})]}):(0,Z.jsx)(b5,{form:i}),(0,Z.jsx)(JB.Item,{name:`pinned`,label:`Pinned`,valuePropName:`checked`,children:(0,Z.jsx)(eG,{})})]})})}function b5({form:e}){let t=JB.useWatch(`targetType`,e)??`standalone`,{data:n}=E8(),{data:r}=b8({limit:200}),i=(0,_.useMemo)(()=>t===`company`?(n?.companies??[]).map(e=>({value:e.id,label:e.name})):t===`application`?(r?.items??[]).map(e=>({value:e.id,label:`${e.jobTitle} — ${e.company.name}`})):[],[t,n,r]);return(0,Z.jsxs)(eB,{gap:12,children:[(0,Z.jsx)(JB.Item,{name:`targetType`,label:`Attach to`,style:{flex:1},children:(0,Z.jsx)(AE,{options:[{value:`standalone`,label:`Nothing in particular`},{value:`company`,label:`A company`},{value:`application`,label:`An application`}],onChange:()=>e.setFieldValue(`targetId`,null)})}),t!==`standalone`&&(0,Z.jsx)(JB.Item,{name:`targetId`,label:t===`company`?`Company`:`Application`,style:{flex:2},rules:[{required:!0,message:`Pick what this note is about`}],children:(0,Z.jsx)(AE,{showSearch:!0,optionFilterProp:`label`,options:i})})]})}function x5(){let{id:e}=Qe(),t=Xe(),{message:n}=LC.useApp(),{data:r,isLoading:i}=S8(e),a=N8(),o=P8(),s=L8(),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(DS,{active:!0,paragraph:{rows:10}});let m=e$(r.status);async function h(t){e&&(await a.mutateAsync({id:e,body:{status:t,comment:null}}),n.success(`Moved to ${n$[t]}`))}return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`flex-start`,wrap:!0,gap:12,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Gk,{type:`link`,icon:(0,Z.jsx)(JZ,{}),style:{padding:0},onClick:()=>t(`/applications`),children:`Back to applications`}),(0,Z.jsx)($X.Title,{level:3,style:{margin:0},children:r.jobTitle}),(0,Z.jsxs)(Rz,{size:8,wrap:!0,children:[(0,Z.jsx)(dn,{to:`/companies/${r.company.id}`,children:r.company.name}),(0,Z.jsxs)($X.Text,{type:`secondary`,children:[`applied `,r.appliedOn]}),(0,Z.jsx)(X8,{status:r.status})]})]}),(0,Z.jsxs)(Rz,{wrap:!0,children:[m&&(0,Z.jsxs)(Gk,{type:`primary`,onClick:()=>void h(m),children:[`Move to `,n$[m]]}),(0,Z.jsx)(AE,{style:{width:150},value:r.status,onChange:e=>void h(e),options:QQ.map(e=>({value:e,label:n$[e]}))}),(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(nX,{}),onClick:()=>l(!0),children:`Edit`}),(0,Z.jsx)(GH,{title:`Delete this application?`,description:`Its notes and status history go too. This cannot be undone.`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{e&&(await o.mutateAsync(e),n.success(`Application deleted`),t(`/applications`))},children:(0,Z.jsx)(Gk,{danger:!0,icon:(0,Z.jsx)($Y,{})})})]})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:24,lg:14,children:(0,Z.jsx)(wF,{title:`Details`,children:(0,Z.jsxs)(oz,{column:{xs:1,sm:2},size:`small`,bordered:!0,children:[(0,Z.jsx)(oz.Item,{label:`Company`,children:r.company.name}),(0,Z.jsx)(oz.Item,{label:`Applied on`,children:r.appliedOn}),(0,Z.jsx)(oz.Item,{label:`Location`,children:r.location??`—`}),(0,Z.jsx)(oz.Item,{label:`Work mode`,children:i$[r.workMode]}),(0,Z.jsx)(oz.Item,{label:`Source`,children:r.sourceName??`—`}),(0,Z.jsx)(oz.Item,{label:`Follow up`,children:r.followUpOn??`—`}),(0,Z.jsx)(oz.Item,{label:`Salary`,span:2,children:r.salaryMin||r.salaryMax?`${r.salaryMin?.toLocaleString()??`?`} – ${r.salaryMax?.toLocaleString()??`?`} ${r.salaryCurrency??``}`:`—`}),(0,Z.jsx)(oz.Item,{label:`Posting`,span:2,children:r.jobUrl?(0,Z.jsx)(`a`,{href:r.jobUrl,target:`_blank`,rel:`noreferrer`,children:(0,Z.jsxs)(Rz,{size:4,children:[(0,Z.jsx)(xQ,{}),r.jobUrl]})}):`—`}),(0,Z.jsx)(oz.Item,{label:`Tags`,span:2,children:r.tags.length>0?(0,Z.jsx)(Rz,{size:4,wrap:!0,children:r.tags.map(e=>(0,Z.jsx)(MY,{children:e.name},e.id))}):`—`})]})})}),(0,Z.jsx)(BI,{xs:24,lg:10,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(wF,{title:`Status history`,children:r.statusEvents.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No changes recorded`}):(0,Z.jsx)(XY,{items:r.statusEvents.map(e=>({color:e.toStatus===`offer`?`green`:e.toStatus===`rejected`?`red`:`blue`,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e.fromStatus?`${n$[e.fromStatus]} → ${n$[e.toStatus]}`:`Applied`}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:e.occurredOn}),e.comment&&(0,Z.jsx)($X.Text,{children:e.comment})]})}))})}),(0,Z.jsx)(wF,{title:`Notes (${r.notes.length})`,extra:(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(fP,{}),onClick:()=>p(!0),children:`Add note`}),children:r.notes.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No notes yet`}):(0,Z.jsx)(LH,{size:`small`,dataSource:r.notes,renderItem:e=>(0,Z.jsx)(LH.Item,{actions:[(0,Z.jsx)(Gk,{type:`text`,icon:(0,Z.jsx)(nX,{}),onClick:()=>d(e)},`edit`),(0,Z.jsx)(GH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await s.mutateAsync(e.id),n.success(`Note deleted`)},children:(0,Z.jsx)(Gk,{type:`text`,danger:!0,icon:(0,Z.jsx)($Y,{})})},`delete`)],children:(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsxs)(Rz,{size:8,children:[e.pinned&&(0,Z.jsx)(AQ,{style:{color:`#faad14`}}),(0,Z.jsx)($X.Text,{strong:!0,children:e.title})]}),description:(0,Z.jsx)($X.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:4,expandable:!0,symbol:`more`},children:e.body})})})})})]})})]}),(0,Z.jsx)(r5,{open:c,onClose:()=>l(!1),application:r}),(0,Z.jsx)(y5,{open:f||u!==null,note:u,target:{type:`application`,id:r.id,label:r.jobTitle},onClose:()=>{p(!1),d(null)}})]})}var S5=25;function C5(){let e=Xe(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(S5),a=Z8(t,300),{data:o,isLoading:s}=E8(a?{q:a}:{});return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Companies`}),(0,Z.jsx)(xV,{allowClear:!0,prefix:(0,Z.jsx)(TE,{}),placeholder:`Find a company`,style:{maxWidth:320},value:t,onChange:e=>n(e.target.value)})]}),(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsx)(yY,{rowKey:`id`,size:`middle`,loading:s,columns:[{title:`Company`,dataIndex:`name`,render:(e,t)=>(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Text,{strong:!0,children:e}),t.website&&(0,Z.jsx)($X.Link,{href:t.website,target:`_blank`,style:{fontSize:12},children:t.website.replace(/^https?:\/\//,``)})]}),sorter:(e,t)=>e.name.localeCompare(t.name)},{title:`Applications`,dataIndex:`applicationCount`,width:140,align:`right`,sorter:(e,t)=>e.applicationCount-t.applicationCount,defaultSortOrder:`descend`,render:e=>(0,Z.jsx)($X.Text,{strong:e>2,type:e>2?`warning`:void 0,children:e})},{title:`Active`,dataIndex:`activeCount`,width:90,align:`right`},{title:`Last applied`,dataIndex:`lastAppliedOn`,width:130,sorter:(e,t)=>(e.lastAppliedOn??``).localeCompare(t.lastAppliedOn??``),render:e=>e??(0,Z.jsx)($X.Text,{type:`secondary`,children:`—`})},{title:`Tags`,key:`tags`,width:260,render:(e,t)=>(0,Z.jsx)(Rz,{size:4,wrap:!0,children:t.tags.map(e=>(0,Z.jsx)(MY,{style:{marginInlineEnd:0},children:e.name},e.id))})}],dataSource:o?.companies??[],pagination:{pageSize:r,showSizeChanger:!0,onChange:(e,t)=>i(t),hideOnSinglePage:r===S5},onRow:t=>({onClick:()=>e(`/companies/${t.id}`),style:{cursor:`pointer`}})})})]})}function w5(){let{id:e}=Qe(),t=Xe(),{message:n}=LC.useApp(),{data:r,isLoading:i}=D8(e),{data:a}=O8(e?{targetType:`company`,targetId:e}:{}),{data:o}=T8(),s=F8(),c=L8(),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);if(i||!r)return(0,Z.jsx)(DS,{active:!0,paragraph:{rows:8}});let{company:p,applications:m}=r,h=m.filter(e=>[`applied`,`screening`,`interview`].includes(e.status)).length;return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,children:[(0,Z.jsx)(Gk,{type:`link`,icon:(0,Z.jsx)(JZ,{}),style:{padding:0},onClick:()=>t(`/companies`),children:`Back to companies`}),(0,Z.jsx)($X.Title,{level:3,style:{margin:0},children:p.name}),p.website&&(0,Z.jsx)($X.Link,{href:p.website,target:`_blank`,children:p.website})]}),(0,Z.jsxs)(WU,{gutter:[16,16],children:[(0,Z.jsx)(BI,{xs:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`Applications`,value:m.length})})}),(0,Z.jsx)(BI,{xs:12,md:6,children:(0,Z.jsx)(wF,{children:(0,Z.jsx)(nW,{title:`Still active`,value:h,valueStyle:{color:a5.accent}})})}),(0,Z.jsx)(BI,{xs:24,md:12,children:(0,Z.jsx)(wF,{children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:4,style:{width:`100%`},children:[(0,Z.jsx)($X.Text,{type:`secondary`,children:`Company tags`}),(0,Z.jsx)(AE,{mode:`tags`,style:{width:`100%`},placeholder:`fintech, remote-first…`,value:p.tags.map(e=>e.name),options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),onChange:t=>{e&&s.mutate({id:e,body:{tags:t}})}})]})})})]}),(0,Z.jsx)(wF,{title:`Application history`,children:(0,Z.jsx)(yY,{rowKey:`id`,size:`middle`,columns:[{title:`Applied`,dataIndex:`appliedOn`,width:120},{title:`Job title`,dataIndex:`jobTitle`,render:e=>(0,Z.jsx)($X.Text,{strong:!0,children:e})},{title:`Status`,dataIndex:`status`,width:120,render:(e,t)=>(0,Z.jsx)(X8,{status:t.status})},{title:`Source`,dataIndex:`sourceName`,width:130}],dataSource:m,pagination:!1,onRow:e=>({onClick:()=>t(`/applications/${e.id}`),style:{cursor:`pointer`}})})}),(0,Z.jsx)(wF,{title:`Notes about ${p.name}`,extra:(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(fP,{}),onClick:()=>f(!0),children:`Add note`}),children:(a?.notes??[]).length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:`No notes about this company`}):(0,Z.jsx)(LH,{dataSource:a?.notes??[],renderItem:e=>(0,Z.jsx)(LH.Item,{actions:[(0,Z.jsx)(Gk,{type:`text`,icon:(0,Z.jsx)(nX,{}),onClick:()=>u(e)},`edit`),(0,Z.jsx)(GH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await c.mutateAsync(e.id),n.success(`Note deleted`)},children:(0,Z.jsx)(Gk,{type:`text`,danger:!0,icon:(0,Z.jsx)($Y,{})})},`delete`)],children:(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsxs)(Rz,{size:8,children:[e.pinned&&(0,Z.jsx)(AQ,{style:{color:`#faad14`}}),(0,Z.jsx)($X.Text,{strong:!0,children:e.title})]}),description:(0,Z.jsx)($X.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},children:e.body})})})})}),(0,Z.jsx)(y5,{open:d||l!==null,note:l,target:{type:`company`,id:p.id,label:p.name},onClose:()=>{f(!1),u(null)}})]})}function T5(){let{message:e}=LC.useApp(),[t,n]=(0,_.useState)(`all`),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),{data:l,isLoading:u}=O8(t===`all`?{}:{targetType:t}),d=L8(),f=l?.notes??[],p=(0,_.useMemo)(()=>{let e=r.trim().toLowerCase();return e?f.filter(t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.targetLabel?.toLowerCase().includes(e)??!1)):f},[f,r]);return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,wrap:!0,gap:12,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Notes`}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(eL,{value:t,onChange:e=>n(e),options:[{label:`All`,value:`all`},{label:`Standalone`,value:`standalone`},{label:`Companies`,value:`company`},{label:`Applications`,value:`application`}]}),(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>c(!0),children:`New note`})]})]}),(0,Z.jsx)(xV,{allowClear:!0,prefix:(0,Z.jsx)(TE,{}),placeholder:`Search notes by title, body, or what they're attached to`,value:r,onChange:e=>i(e.target.value)}),(0,Z.jsx)(wF,{size:`small`,loading:u,children:p.length===0?(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:r?`Nothing matched “${r}”`:`No notes here yet`}):(0,Z.jsx)(LH,{dataSource:p,renderItem:t=>(0,Z.jsx)(LH.Item,{actions:[(0,Z.jsx)(Gk,{type:`text`,icon:(0,Z.jsx)(nX,{}),onClick:()=>o(t)},`edit`),(0,Z.jsx)(GH,{title:`Delete this note?`,okText:`Delete`,okButtonProps:{danger:!0},onConfirm:async()=>{await d.mutateAsync(t.id),e.success(`Note deleted`)},children:(0,Z.jsx)(Gk,{type:`text`,danger:!0,icon:(0,Z.jsx)($Y,{})})},`delete`)],children:(0,Z.jsx)(LH.Item.Meta,{title:(0,Z.jsxs)(Rz,{size:8,wrap:!0,children:[t.pinned&&(0,Z.jsx)(AQ,{style:{color:`#faad14`}}),(0,Z.jsx)($X.Text,{strong:!0,children:t.title}),(0,Z.jsx)(E5,{note:t})]}),description:(0,Z.jsx)($X.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},ellipsis:{rows:3,expandable:!0,symbol:`more`},children:t.body})})})})}),(0,Z.jsx)(y5,{open:s||a!==null,note:a,onClose:()=>{c(!1),o(null)}})]})}function E5({note:e}){if(e.targetType===`standalone`)return(0,Z.jsx)(MY,{children:`general`});if(!e.targetId)return(0,Z.jsx)(MY,{children:`unlinked`});let t=e.targetType===`company`?`/companies/${e.targetId}`:`/applications/${e.targetId}`;return(0,Z.jsx)(dn,{to:t,children:(0,Z.jsxs)(MY,{color:`blue`,children:[e.targetType,`: `,e.targetLabel??`view`]})})}function D5({open:e,onClose:t,opening:n,draft:r}){let[i]=JB.useForm(),{message:a}=LC.useApp(),o=!!n,s=B8(),c=V8(),{data:l}=A8(JB.useWatch(`companyName`,i)??``);(0,_.useEffect)(()=>{e&&(n?i.setFieldsValue({companyName:n.company.name,jobTitle:n.jobTitle,savedOn:(0,$k.default)(n.savedOn),jobUrl:n.jobUrl??void 0,location:n.location??void 0,workMode:n.workMode,sourceName:n.sourceName??void 0,salaryMin:n.salaryMin,salaryMax:n.salaryMax,salaryCurrency:n.salaryCurrency??void 0,notes:n.notes??void 0}):(i.resetFields(),i.setFieldsValue({savedOn:(0,$k.default)(),workMode:r?.workMode??`unspecified`,...r?{companyName:r.companyName,jobTitle:r.jobTitle,jobUrl:r.jobUrl??void 0,location:r.location??void 0,sourceName:r.sourceName??void 0,salaryMin:r.salaryMin,salaryMax:r.salaryMax,salaryCurrency:r.salaryCurrency??void 0,notes:r.notes??void 0}:{}})))},[e,n,r,i]);let u=(0,_.useMemo)(()=>(l?.companies??[]).map(e=>({value:e.name})),[l]);async function d(e){let r={companyName:e.companyName,jobTitle:e.jobTitle,jobUrl:e.jobUrl??null,location:e.location??null,workMode:e.workMode,sourceName:e.sourceName??null,salaryMin:e.salaryMin??null,salaryMax:e.salaryMax??null,salaryCurrency:e.salaryCurrency??null,notes:e.notes??null,...o?{}:{savedOn:e.savedOn.format(`YYYY-MM-DD`)}};try{n?(await c.mutateAsync({id:n.id,body:r}),a.success(`Opening updated`)):(await s.mutateAsync(r),a.success(`Opening saved`)),t()}catch(e){e instanceof a8&&e.fieldErrors.length>0?(i.setFields(e.fieldErrors.map(e=>({name:e.path.split(`.`),errors:[e.message]}))),a.error(`Please check the highlighted fields`)):a.error(e instanceof Error?e.message:`Could not save`)}}return(0,Z.jsxs)(kz,{title:o?`Edit opening`:`Save opening for later`,open:e,onClose:t,width:560,destroyOnHidden:!0,extra:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:t,children:`Cancel`}),(0,Z.jsx)(Gk,{type:`primary`,loading:s.isPending||c.isPending,onClick:()=>i.submit(),children:o?`Save changes`:`Save opening`})]}),children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,children:r&&!o?`Read from the posting — check it over before saving. Anything the parser could not find is blank rather than guessed.`:`For a role you found but are not ready to apply to yet — no status, no tags, just enough to find it again. Convert it into a real application when you are ready.`}),(0,Z.jsxs)(JB,{form:i,layout:`vertical`,onFinish:d,requiredMark:`optional`,children:[(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`companyName`,label:`Company`,rules:[{required:!0,message:`Company is required`}],children:(0,Z.jsx)(LE,{options:u,placeholder:`Start typing — existing companies appear`,filterOption:!1,allowClear:!0})})}),(0,Z.jsx)(BI,{span:12,children:(0,Z.jsx)(JB.Item,{name:`jobTitle`,label:`Job title`,rules:[{required:!0,message:`Job title is required`}],children:(0,Z.jsx)(xV,{placeholder:`Backend Engineer`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`savedOn`,label:`Found on`,rules:[{required:!0,message:`Date is required`}],children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`,disabled:o})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`workMode`,label:`Work mode`,children:(0,Z.jsx)(AE,{options:r$.map(e=>({value:e,label:i$[e]}))})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`location`,label:`Location`,children:(0,Z.jsx)(xV,{placeholder:`Stockholm`})})})]}),(0,Z.jsxs)(WU,{gutter:16,children:[(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMin`,label:`Salary from`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryMax`,label:`Salary to`,children:(0,Z.jsx)(VL,{style:{width:`100%`},min:0,step:1e4})})}),(0,Z.jsx)(BI,{span:8,children:(0,Z.jsx)(JB.Item,{name:`salaryCurrency`,label:`Currency`,children:(0,Z.jsx)(xV,{placeholder:`SEK`,maxLength:8})})})]}),(0,Z.jsx)(JB.Item,{name:`sourceName`,label:`Source`,children:(0,Z.jsx)(xV,{placeholder:`LinkedIn, referral…`})}),(0,Z.jsx)(JB.Item,{name:`jobUrl`,label:`Job posting URL`,children:(0,Z.jsx)(xV,{placeholder:`https://…`})}),(0,Z.jsx)(JB.Item,{name:`notes`,label:`Notes`,children:(0,Z.jsx)(xV.TextArea,{rows:4,placeholder:`Why this looked interesting, what you're missing to apply…`})})]})]})}var O5=!1;function k5({open:e,onClose:t,onUse:n}){let[r,i]=(0,_.useState)(`link`),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null);function h(){o(``),c(``),f(null),m(null),u(!1)}function g(){h(),t()}async function v(e){u(!0),f(null),m(null);try{let t=await e();(t.draft.companyName.trim()===``||t.draft.jobTitle.trim()===``)&&f(`Could not make out the company and job title. Open the form and fill them in, or paste more of the posting.`),m(t)}catch(e){f(e instanceof Error?e.message:`Could not read that posting`),e instanceof a8&&e.code===`ingest_blocked`&&i(`text`)}finally{u(!1)}}let y=p?.draft;return(0,Z.jsxs)(VH,{open:e,onCancel:g,title:`Save from a posting`,width:640,destroyOnHidden:!0,footer:(0,Z.jsxs)(eB,{justify:`end`,gap:8,children:[(0,Z.jsx)(Gk,{onClick:g,children:`Cancel`}),(0,Z.jsx)(Gk,{type:`primary`,disabled:!y,onClick:()=>{y&&(n(y),h())},children:`Review and save`})]}),children:[(0,Z.jsx)(uF,{activeKey:r,onChange:e=>{i(e),f(null),m(null)},items:[{key:`link`,label:(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(xQ,{}),` Paste a link`]}),disabled:O5,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsx)(xV.Search,{placeholder:`https://boards.greenhouse.io/…`,value:a,enterButton:`Read`,loading:l,onChange:e=>o(e.target.value),onSearch:e=>e.trim()&&void v(()=>_8.ingestUrl(e.trim()))}),(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Works on most company career pages and applicant tracking systems. LinkedIn and Indeed block automated readers — for those, copy the posting and use the other tab.`})]})},{key:`text`,label:(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(rB,{}),` Paste the text`]}),children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsx)(xV.TextArea,{rows:8,value:s,placeholder:`Backend Engineer at Spotify
|
|
444
|
+
Stockholm — hybrid
|
|
445
|
+
Salary: SEK 55 000 - 70 000`,onChange:e=>c(e.target.value)}),(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,gap:12,wrap:!0,children:[(0,Z.jsx)($X.Text,{type:`secondary`,style:{fontSize:12},children:`Everything you paste is kept as the opening's note, so nothing is lost to a wrong guess.`}),(0,Z.jsx)(Gk,{loading:l,disabled:s.trim()===``,onClick:()=>void v(()=>_8.ingestText(s,a.trim()||void 0)),children:`Read`})]})]})}]}),d&&(0,Z.jsx)(Fp,{type:`warning`,showIcon:!0,message:d,style:{marginTop:12}}),y&&(0,Z.jsxs)(Rz,{direction:`vertical`,size:8,style:{width:`100%`,marginTop:16},children:[(0,Z.jsxs)($X.Text,{strong:!0,children:[y.jobTitle||`Untitled role`,y.companyName?` at ${y.companyName}`:``]}),(0,Z.jsx)($X.Text,{type:`secondary`,children:[y.location,y.sourceName].filter(Boolean).join(` · `)||`No location found`}),(0,Z.jsx)($8,{check:p?.duplicate})]})]})}function A5(){let e=Xe(),{message:t}=LC.useApp(),[n,r]=(0,_.useState)(`active`),{data:i,isLoading:a}=R8(n===`archived`?{archived:!0}:{}),{data:o}=T8(),s=H8(),c=U8(),l=V8(),u=(0,_.useMemo)(()=>{let e=i?.openings??[];return n===`archived`?e.filter(e=>e.archived):e},[i,n]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(void 0),[v,y]=(0,_.useState)(void 0),[b,x]=(0,_.useState)(null),[S]=JB.useForm();function C(e){x(e),S.setFieldsValue({appliedOn:(0,$k.default)(),status:`applied`,tags:[]})}async function w(n){if(b)try{let r=await c.mutateAsync({id:b.id,body:{appliedOn:n.appliedOn.format(`YYYY-MM-DD`),status:n.status,tags:n.tags??[]}});t.success(`Converted to an application`),x(null),e(`/applications/${r.id}`)}catch(e){t.error(e instanceof Error?e.message:`Could not convert`)}}async function T(e){try{await l.mutateAsync({id:e.id,body:{archived:!1}}),t.success(`Opening restored`)}catch(e){t.error(e instanceof Error?e.message:`Could not restore`)}}let E=[{title:`Company`,dataIndex:[`company`,`name`]},{title:`Job title`,dataIndex:`jobTitle`},{title:`Found on`,dataIndex:`savedOn`,width:120},{title:`Location`,key:`location`,render:(e,t)=>[t.location,i$[t.workMode]].filter(Boolean).join(` · `)||(0,Z.jsx)($X.Text,{type:`secondary`,children:`—`})},{title:`Source`,dataIndex:`sourceName`,render:e=>e??`—`}],D=e=>e.jobUrl&&(0,Z.jsx)(bD,{title:`Open job posting`,children:(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(xQ,{}),href:e.jobUrl,target:`_blank`,rel:`noreferrer`})}),O=e=>(0,Z.jsx)(GH,{title:`Delete this opening?`,description:`This removes it for good and cannot be undone.`,onConfirm:()=>s.mutate(e.id),okText:`Delete`,okButtonProps:{danger:!0},children:(0,Z.jsx)(Gk,{size:`small`,danger:!0,children:`Delete`})}),k=[...E,{title:``,key:`actions`,width:260,render:(e,t)=>(0,Z.jsxs)(Rz,{onClick:e=>e.stopPropagation(),children:[D(t),(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(ZB,{}),onClick:()=>C(t),children:`Convert`}),(0,Z.jsx)(Gk,{size:`small`,onClick:()=>{y(t),g(void 0),f(!0)},children:`Edit`}),O(t)]})}],A=[...E,{title:`Archived because`,key:`reason`,width:160,render:(e,t)=>t.convertedApplicationId?(0,Z.jsx)(dn,{to:`/applications/${t.convertedApplicationId}`,children:(0,Z.jsx)(MY,{color:`blue`,children:`Converted`})}):(0,Z.jsx)(MY,{children:`Archived by hand`})},{title:``,key:`actions`,width:220,render:(e,t)=>(0,Z.jsxs)(Rz,{onClick:e=>e.stopPropagation(),children:[D(t),(0,Z.jsx)(Gk,{size:`small`,icon:(0,Z.jsx)(NQ,{}),loading:l.isPending,onClick:()=>T(t),children:`Restore`}),O(t)]})}];return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsxs)(eB,{justify:`space-between`,align:`center`,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:0,children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Job openings`}),(0,Z.jsx)($X.Text,{type:`secondary`,children:n===`active`?`Saved for later — convert one to a real application when you're ready to apply.`:`Openings that were converted into an application or archived by hand.`})]}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(fQ,{}),onClick:()=>m(!0),children:`Save from posting`}),(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(fP,{}),onClick:()=>{y(void 0),g(void 0),f(!0)},children:`Save opening for later`})]})]}),(0,Z.jsx)(eL,{value:n,onChange:r,options:[{label:`Active`,value:`active`},{label:`Archived`,value:`archived`}]}),(0,Z.jsx)(wF,{size:`small`,children:(0,Z.jsx)(yY,{rowKey:`id`,columns:n===`archived`?A:k,dataSource:u,loading:a,pagination:!1,locale:{emptyText:(0,Z.jsx)($T,{image:$T.PRESENTED_IMAGE_SIMPLE,description:n===`active`?`Nothing saved yet — use “Save opening for later” for a role you're not ready to apply to.`:`No archived openings.`})}})}),(0,Z.jsx)(D5,{open:d,onClose:()=>{f(!1),g(void 0)},opening:v,draft:h}),(0,Z.jsx)(k5,{open:p,onClose:()=>m(!1),onUse:e=>{m(!1),y(void 0),g(e),f(!0)}}),(0,Z.jsx)(VH,{title:b?`Convert "${b.jobTitle}" at ${b.company.name}`:``,open:!!b,onCancel:()=>x(null),onOk:()=>S.submit(),okText:`Create application`,confirmLoading:c.isPending,children:(0,Z.jsxs)(JB,{form:S,layout:`vertical`,onFinish:w,children:[(0,Z.jsx)(JB.Item,{name:`appliedOn`,label:`Applied on`,rules:[{required:!0}],children:(0,Z.jsx)(KR,{style:{width:`100%`},format:`YYYY-MM-DD`})}),(0,Z.jsx)(JB.Item,{name:`status`,label:`Status`,children:(0,Z.jsx)(AE,{options:QQ.map(e=>({value:e,label:n$[e]}))})}),(0,Z.jsx)(JB.Item,{name:`tags`,label:`Tags`,children:(0,Z.jsx)(AE,{mode:`tags`,options:(o?.tags??[]).map(e=>({value:e.name,label:e.name})),placeholder:`fintech, remote-ok…`,tokenSeparators:[`,`]})})]})})]})}var j5={companies:`Companies`,applications:`Applications`,tags:`Tags`,tagLinks:`Tag links`,notes:`Notes`,statusEvents:`Status events`,jobOpenings:`Job openings`};function M5({counts:e}){return(0,Z.jsx)(oz,{size:`small`,column:2,bordered:!0,children:Object.entries(e).map(([e,t])=>(0,Z.jsx)(oz.Item,{label:j5[e]??e,children:t},e))})}function N5(){let{message:e}=LC.useApp(),{data:t,isLoading:n}=W8(),r=G8(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{c.current&&clearInterval(c.current)},[]);function l(t){VH.confirm({title:`Switch to "${t}"?`,content:"The server restarts to connect to the new target. This page will reconnect and reload automatically once it is back — under `npm run dev`, that may require restarting it by hand.",okText:`Switch and restart`,onOk:async()=>{try{await r.mutateAsync(t)}catch(t){e.error(t instanceof Error?t.message:`Could not switch database`);return}s(!0),c.current=setInterval(()=>{_8.getDbTargets().then(()=>{c.current&&clearInterval(c.current),window.location.reload()}).catch(()=>{})},500)}})}if(o)return(0,Z.jsx)(wF,{title:`Database`,children:(0,Z.jsx)(UU,{icon:(0,Z.jsx)(DU,{spin:!0}),title:`Reconnecting…`,subTitle:`Waiting for the server to come back up.`})});let u=t?.targets??[];return(0,Z.jsx)(wF,{title:`Database`,loading:n,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Z.jsxs)($X.Paragraph,{type:`secondary`,style:{marginBottom:0},children:[`Connection settings live in `,(0,Z.jsx)(`code`,{children:`.env`}),` and are never shown or editable here.`,u.length<=1&&` Only one target is configured, so there is nothing to switch between.`]}),(0,Z.jsx)(oz,{size:`small`,column:1,bordered:!0,children:(0,Z.jsx)(oz.Item,{label:`Active target`,children:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(rQ,{}),t?.active,` (`,u.find(e=>e.name===t?.active)?.driver,`)`]})})}),u.length>1&&(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(AE,{style:{width:220},value:i??t?.active,options:u.map(e=>({value:e.name,label:`${e.name} (${e.driver})`})),onChange:a}),(0,Z.jsx)(Gk,{type:`primary`,disabled:!i||i===t?.active,loading:r.isPending,onClick:()=>i&&l(i),children:`Switch`})]})]})})}function P5(){let{message:e}=LC.useApp(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1);function p(){n(null),i(null),o(null),u(null)}function m(){p(),f(!1)}let h=e=>(n(e),u(null),c(!0),_8.previewBackup(e).then(i).catch(e=>u(e instanceof Error?e.message:`Could not read that file`)).finally(()=>c(!1)),!1);function g(){t&&VH.confirm({title:`Replace all data in the active database?`,content:`Every table is wiped and recreated from this backup. This cannot be undone.`,okText:`Restore`,okButtonProps:{danger:!0},onOk:async()=>{c(!0),u(null);try{let e=await _8.commitBackup(t);o(e)}catch(t){e.error(t instanceof Error?t.message:`Restore failed`)}finally{c(!1)}}})}return(0,Z.jsxs)(wF,{title:`Backup & restore`,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`A full-fidelity snapshot of every table — every field, every relation, driver-agnostic. Not the same as the CSV/Excel export elsewhere in the app, which is a lossy report meant for people to read. This file is scrambled (gzip + obfuscation) so it isn't plain, readable JSON at rest — that's an obfuscation step, not encryption, and does not protect the personal data inside from anyone who actually wants it.`}),(0,Z.jsx)(Gk,{icon:(0,Z.jsx)(rQ,{}),onClick:()=>{window.location.href=_8.backupExportUrl},children:`Export backup`}),(0,Z.jsx)(Gk,{onClick:()=>f(!0),children:`Restore from backup…`})]}),(0,Z.jsx)(VH,{title:`Restore from backup`,open:d,onCancel:m,width:600,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[!r&&!a&&(0,Z.jsxs)(GZ.Dragger,{accept:`.jtbak`,maxCount:1,showUploadList:!1,beforeUpload:h,disabled:s,children:[(0,Z.jsx)(`p`,{className:`ant-upload-drag-icon`,children:(0,Z.jsx)(hQ,{})}),(0,Z.jsx)(`p`,{className:`ant-upload-text`,children:`Click or drag a JobTrack backup file (.jtbak) here`})]}),l&&(0,Z.jsx)(Fp,{type:`error`,showIcon:!0,message:l}),r&&!a&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)($X.Text,{type:`secondary`,children:[`Backup taken `,new Date(r.exportedAt).toLocaleString(),`. Restoring will replace everything currently in the active database with:`]}),(0,Z.jsx)(M5,{counts:r.counts}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:p,children:`Choose a different file`}),(0,Z.jsx)(Gk,{type:`primary`,danger:!0,loading:s,onClick:g,children:`Restore`})]})]}),a&&(0,Z.jsx)(UU,{status:`success`,title:`Restore complete`,extra:(0,Z.jsxs)(Rz,{direction:`vertical`,style:{width:`100%`},children:[(0,Z.jsx)(M5,{counts:a.counts}),(0,Z.jsx)(Gk,{type:`primary`,onClick:()=>window.location.reload(),children:`Reload`})]})})]})})]})}var F5=`CLEAR`;function I5(){let{message:e}=LC.useApp(),{data:t,isLoading:n}=K8(),r=q8(),i=J8(),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(``);function l(){o(!1),c(``)}function u(){r.mutate(void 0,{onSuccess:()=>{e.success(`Database cleared`),l()},onError:t=>e.error(t instanceof Error?t.message:`Could not clear the database`)})}function d(){i.mutate(void 0,{onSuccess:t=>e.success(`Seeded ${t.applications} applications and ${t.companies} companies`),onError:t=>e.error(t instanceof Error?t.message:`Could not seed the database`)})}let f=t?.counts??{};return(0,Z.jsxs)(wF,{title:`Reset & demo data`,loading:n,children:[(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)($X.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`Wipe everything in the active database, or — only while it's empty — fill it with a realistic multi-year demo dataset to explore the app with.`}),!t?.empty&&(0,Z.jsx)(M5,{counts:f}),(0,Z.jsxs)(Rz,{wrap:!0,children:[t?.empty&&(0,Z.jsx)(Gk,{type:`primary`,icon:(0,Z.jsx)(oQ,{}),loading:i.isPending,onClick:d,children:`Seed with demo data`}),(0,Z.jsx)(Gk,{danger:!0,disabled:t?.empty,onClick:()=>o(!0),children:`Clear database…`})]})]}),(0,Z.jsx)(VH,{title:`Clear the active database?`,open:a,onCancel:l,footer:null,destroyOnHidden:!0,children:(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)(Fp,{type:`warning`,showIcon:!0,message:`This permanently deletes every row below. There is no undo — export a backup first if you might want this data again.`}),(0,Z.jsx)(M5,{counts:f}),(0,Z.jsxs)($X.Text,{children:[`Type `,(0,Z.jsx)($X.Text,{code:!0,children:F5}),` to confirm.`]}),(0,Z.jsx)(xV,{value:s,onChange:e=>c(e.target.value),placeholder:F5,onPressEnter:()=>s===F5&&u()}),(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(Gk,{onClick:l,children:`Cancel`}),(0,Z.jsx)(Gk,{danger:!0,type:`primary`,disabled:s!==F5,loading:r.isPending,onClick:u,children:`Clear database`})]})]})})]})}function L5(){let{data:e,isLoading:t}=Y8(),n=e?`${e.name} ${e.version}`:``;return(0,Z.jsx)(wF,{title:`About`,loading:t,children:(0,Z.jsxs)(oz,{size:`small`,column:1,bordered:!0,children:[(0,Z.jsx)(oz.Item,{label:`Running`,children:(0,Z.jsxs)(Rz,{children:[(0,Z.jsx)(vQ,{}),(0,Z.jsxs)($X.Text,{copyable:{text:n},children:[(0,Z.jsx)(`code`,{children:e?.name}),` `,e?.version]})]})}),(0,Z.jsx)(oz.Item,{label:`Database driver`,children:e?.driver})]})})}function R5(){return(0,Z.jsxs)(Rz,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Z.jsx)($X.Title,{level:4,style:{margin:0},children:`Settings`}),(0,Z.jsx)(N5,{}),(0,Z.jsx)(P5,{}),(0,Z.jsx)(I5,{}),(0,Z.jsx)(L5,{})]})}var z5=`jobtrack.theme`,B5=[{key:`/dashboard`,icon:(0,Z.jsx)(eQ,{}),label:(0,Z.jsx)(dn,{to:`/dashboard`,children:`Dashboard`})},{key:`/applications`,icon:(0,Z.jsx)(DQ,{}),label:(0,Z.jsx)(dn,{to:`/applications`,children:`Applications`})},{key:`/openings`,icon:(0,Z.jsx)(ZZ,{}),label:(0,Z.jsx)(dn,{to:`/openings`,children:`Openings`})},{key:`/companies`,icon:(0,Z.jsx)(HQ,{}),label:(0,Z.jsx)(dn,{to:`/companies`,children:`Companies`})},{key:`/notes`,icon:(0,Z.jsx)(rB,{}),label:(0,Z.jsx)(dn,{to:`/notes`,children:`Notes`})},{key:`/settings`,icon:(0,Z.jsx)(zQ,{}),label:(0,Z.jsx)(dn,{to:`/settings`,children:`Settings`})}],V5=[{key:`light`,icon:(0,Z.jsx)(GQ,{}),label:`Light`},{key:`dark`,icon:(0,Z.jsx)(wQ,{}),label:`Dark`}];function H5(){let[e,t]=(0,_.useState)(()=>{try{let e=localStorage.getItem(z5);if(e)return e===`dark`}catch{}return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1});(0,_.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e?`dark`:`light`);try{localStorage.setItem(z5,e?`dark`:`light`)}catch{}},[e]);let n=qe(),r=(0,_.useMemo)(()=>{let e=B5.find(e=>n.pathname.startsWith(e.key));return e?[e.key]:[`/dashboard`]},[n.pathname]);return(0,Z.jsx)(Lh,{theme:o5(e?`dark`:`light`),children:(0,Z.jsx)(LC,{children:(0,Z.jsxs)(AV,{style:{minHeight:`100vh`},children:[(0,Z.jsxs)(AV.Header,{style:{display:`flex`,alignItems:`center`,gap:24,paddingInline:24,borderBottom:`1px solid ${a5.border}`,position:`sticky`,top:0,zIndex:10},children:[(0,Z.jsxs)($X.Title,{level:4,style:{margin:0,whiteSpace:`nowrap`},children:[`Job`,(0,Z.jsx)(`span`,{style:{color:a5.accent},children:`Track`})]}),(0,Z.jsx)(zk,{mode:`horizontal`,selectedKeys:r,items:B5,style:{flex:1,minWidth:0,borderBottom:`none`}}),(0,Z.jsx)(Bz,{trigger:[`click`],menu:{items:V5,selectable:!0,selectedKeys:[e?`dark`:`light`],onClick:({key:e})=>t(e===`dark`)},children:(0,Z.jsx)(Gk,{icon:e?(0,Z.jsx)(wQ,{}):(0,Z.jsx)(GQ,{}),"aria-label":`Theme settings`,children:`Theme`})})]}),(0,Z.jsx)(AV.Content,{style:{padding:24},children:(0,Z.jsxs)(Ct,{children:[(0,Z.jsx)(xt,{path:`/`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})}),(0,Z.jsx)(xt,{path:`/dashboard`,element:(0,Z.jsx)(f5,{})}),(0,Z.jsx)(xt,{path:`/applications`,element:(0,Z.jsx)(v5,{})}),(0,Z.jsx)(xt,{path:`/applications/:id`,element:(0,Z.jsx)(x5,{})}),(0,Z.jsx)(xt,{path:`/openings`,element:(0,Z.jsx)(A5,{})}),(0,Z.jsx)(xt,{path:`/companies`,element:(0,Z.jsx)(C5,{})}),(0,Z.jsx)(xt,{path:`/companies/:id`,element:(0,Z.jsx)(w5,{})}),(0,Z.jsx)(xt,{path:`/notes`,element:(0,Z.jsx)(T5,{})}),(0,Z.jsx)(xt,{path:`/settings`,element:(0,Z.jsx)(R5,{})}),(0,Z.jsx)(xt,{path:`*`,element:(0,Z.jsx)(bt,{to:`/dashboard`,replace:!0})})]})})]})})})}var U5=new Lr({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}});(0,v.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(En,{client:U5,children:(0,Z.jsx)(un,{children:(0,Z.jsx)(H5,{})})})}));
|
|
446
|
+
//# sourceMappingURL=index-Di70alMJ.js.map
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<meta name="description" content="Track job applications, spot the ones you have already applied for, and search them by meaning." />
|
|
20
20
|
<title>JobTrack</title>
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/assets/index-Di70alMJ.js"></script>
|
|
22
22
|
<link rel="stylesheet" crossorigin href="/assets/index-CRnClsEb.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body>
|