import{i as e}from"./chunk-B3pr0VN8.js";import{n as t,t as n}from"./jsx-runtime-wTfS3W87.js";import{r}from"./chunk-6CSD65Y2-Dj7xjS5D.js";var i=n();function a({to:e}){return(0,i.jsx)(`div`,{className:`he-next-actions`,children:(0,i.jsx)(r,{className:`btn-secondary`,to:e,children:`继续下一步`})})}function o({restoredHint:e,restoredFields:t,runState:n,nextTo:r}){let o=Array.isArray(t)?t:[];return(0,i.jsxs)(i.Fragment,{children:[e?(0,i.jsx)(`div`,{className:`he-restore-tag`,children:e}):null,o.length?(0,i.jsxs)(`div`,{className:`he-restore-fields`,children:[`已回填：`,o.join(`、`)]}):null,n===`done`&&r?(0,i.jsx)(a,{to:r}):null]})}var s=e(t(),1);function c(e=2800){let[t,n]=(0,s.useState)([]),r=(0,s.useCallback)(e=>t.includes(e),[t]);return(0,s.useEffect)(()=>{if(!t.length)return;let r=window.setTimeout(()=>n([]),Math.max(300,Number(e||0)));return()=>window.clearTimeout(r)},[e,t]),{restoredFields:t,setRestoredFields:n,isRestored:r,hasRestored:t.length>0}}export{o as n,c as t};