1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./useRouter-H68mIy1c.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{rn as r,t as i}from"./go-UodXtyq4.js";import{c as a,m as o}from"./forms-Dy_syy6h.js";var s=e(t(),1),c=n(),l=`mt-1.5 h-12 w-full rounded-xl border border-line bg-mist px-4 text-sm outline-none focus:border-fg focus:bg-bg`;function u({value:e,onChange:t}){let n=o(e),u=(0,s.useRef)(n),f=(0,s.useRef)(t);u.current=n,f.current=t;let[p,m]=(0,s.useState)(``),h=(0,s.useRef)(n.inn);function g(e){t(o({...n,...e}))}(0,s.useEffect)(()=>{if(h.current===n.inn)return;h.current=n.inn;let e=n.inn;if(!a(e)){m(``);return}let t=!0,s=window.setTimeout(()=>{r(e).then(n=>{if(!t||n.inn&&n.inn!==e||(m(n.message||``),!n.found&&n.taxKind!==`self_employed`))return;let r=u.current;f.current(o({...r,taxKind:n.taxKind||r.taxKind,inn:e,legalName:n.legalName||r.legalName,ogrn:n.taxKind===`self_employed`?``:n.ogrn||r.ogrn,kpp:n.taxKind===`ooo`?n.kpp:``,address:n.taxKind===`ooo`?n.address:r.address}))}).catch(e=>{t&&m(e instanceof i&&e.message?e.message:`РееÑÑÑ Ð½Ðµ оÑвеÑил. ÐÐ¾Ð»Ñ Ð¼Ð¾Ð¶Ð½Ð¾ заполниÑÑ Ð²ÑÑÑнÑÑ.`)})},400);return()=>{t=!1,window.clearTimeout(s)}},[n.inn]);let _=n.taxKind!==`ooo`;return(0,c.jsxs)(`div`,{className:`space-y-3`,children:[(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`СÑаÑÑÑ`,(0,c.jsxs)(`select`,{value:n.taxKind,onChange:e=>g({taxKind:e.target.value}),className:l,children:[(0,c.jsx)(`option`,{value:`self_employed`,children:`СамозанÑÑÑй`}),(0,c.jsx)(`option`,{value:`ie`,children:`ÐÐ`}),(0,c.jsx)(`option`,{value:`ooo`,children:`ÐÐÐ`})]})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[_?`ФÐРкак в докÑменÑаÑ
`:`Ðолное название`,(0,c.jsx)(`input`,{value:n.legalName,onChange:e=>g({legalName:e.target.value}),placeholder:_?`Ðван ÐеÑÑов`:`ÐÐР«РомаÑка»`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ÐÐÐ`,(0,c.jsx)(`input`,{value:n.inn,onChange:e=>g({inn:e.target.value.replace(/\D/g,``).slice(0,12)}),inputMode:`numeric`,required:!0,placeholder:`10 или 12 ÑиÑÑ`,className:l}),p?(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:p}):null]}),n.taxKind===`ooo`?(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ÐÐÐ`,(0,c.jsx)(`input`,{value:n.kpp,onChange:e=>g({kpp:e.target.value.replace(/\D/g,``).slice(0,9)}),inputMode:`numeric`,placeholder:`9 ÑиÑÑ`,className:l})]}):null,n.taxKind===`self_employed`?null:(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[n.taxKind===`ie`?`ÐÐÐ ÐÐÐ`:`ÐÐÐ Ð`,(0,c.jsx)(`input`,{value:n.ogrn,onChange:e=>g({ogrn:e.target.value.replace(/\D/g,``).slice(0,n.taxKind===`ie`?15:13)}),inputMode:`numeric`,className:l})]}),n.taxKind===`self_employed`?(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:`Ðалог на пÑоÑеÑÑионалÑнÑй доÑ
од, без ÐÐС. Чек гоÑÑÑ Ð¿ÐµÑаÑÐ°ÐµÑ Ð¿Ð»Ð¾Ñадка, а доÑ
од вÑÑ Ñавно нÑжно пÑовеÑÑи в «Ðой налог».`}):(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Ðалог`,(0,c.jsxs)(`select`,{value:n.taxSystem,onChange:e=>g({taxSystem:e.target.value}),className:l,children:[(0,c.jsx)(`option`,{value:`usn_income`,children:`УСÐ, доÑ
одÑ`}),(0,c.jsx)(`option`,{value:`usn_income_outcome`,children:`УСÐ, доÑ
Ð¾Ð´Ñ Ð¼Ð¸Ð½ÑÑ ÑаÑÑ
одÑ`}),n.taxKind===`ie`?(0,c.jsx)(`option`,{value:`patent`,children:`ÐаÑенÑ`}):null,n.taxKind===`ie`?(0,c.jsx)(`option`,{value:`npd`,children:`ÐÐÐ, ÑамозанÑÑÑй ÐÐ`}):null,(0,c.jsx)(`option`,{value:`osn`,children:`ÐСÐ, Ñ ÐÐС`})]})]}),n.taxKind===`ie`&&n.taxSystem===`npd`?(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:`Ð Ñеке бÑÐ´ÐµÑ Â«Ðл и ваÑе имÑ, без ÐÐС. ÐоÑ
од по ÐÐÐ Ñакже пÑоводиÑÑÑ Ð² «Ðой налог».`}):null,n.taxSystem===`usn_income`||n.taxSystem===`usn_income_outcome`?(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ÐÐС в Ñеке`,(0,c.jsxs)(`select`,{value:n.vat,onChange:e=>g({vat:e.target.value}),className:l,children:[(0,c.jsx)(`option`,{value:`none`,children:`Ðез ÐÐС`}),(0,c.jsx)(`option`,{value:`5`,children:`ÐÐС 5%`}),(0,c.jsx)(`option`,{value:`7`,children:`ÐÐС 7%`})]})]}):null,n.taxSystem===`osn`?(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:`Ð Ñеке бÑÐ´ÐµÑ ÐÐС 22%.`}):null,n.taxKind===`ooo`?(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ЮÑидиÑеÑкий адÑеÑ`,(0,c.jsx)(`input`,{value:n.address,onChange:e=>g({address:e.target.value}),required:!0,placeholder:`Ðак в ÐÐРЮÐ`,className:l}),(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:`ÐÑÐ´ÐµÑ Ð²Ð¸Ð´ÐµÐ½ гоÑÑÑм на ÑÑÑаниÑе оÑганизаÑоÑа.`})]}):(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ÐдÑеÑ`,(0,c.jsx)(`input`,{value:n.address,onChange:e=>g({address:e.target.value}),placeholder:`ÐеобÑзаÑелÑно`,className:l}),(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:`ТолÑко в ваÑем кабинеÑе. Ðа ÑайÑе его Ð
1½Ðµ показÑваем.`})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ТелеÑон Ð´Ð»Ñ Ñека`,(0,c.jsx)(`input`,{value:n.phone,onChange:e=>g({phone:e.target.value}),inputMode:`tel`,required:!0,placeholder:`+7 900 000-00-00`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`РаÑÑÑÑнÑй ÑÑÑÑ`,(0,c.jsx)(`input`,{value:n.account,onChange:e=>g({account:e.target.value.replace(/\D/g,``).slice(0,20)}),inputMode:`numeric`,required:!0,placeholder:`20 ÑиÑÑ`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`ÐÐÐ`,(0,c.jsx)(`input`,{value:n.bik,onChange:e=>g({bik:e.target.value.replace(/\D/g,``).slice(0,9)}),inputMode:`numeric`,required:!0,placeholder:`9 ÑиÑÑ`,className:l})]}),(0,c.jsxs)(`label`,{className:`block text-sm font-semibold`,children:[`Ðанк`,(0,c.jsx)(`input`,{value:n.bankName,onChange:e=>g({bankName:e.target.value}),required:!0,placeholder:`ТÐанк`,className:l}),(0,c.jsx)(`span`,{className:`mt-1 block text-xs font-normal text-muted`,children:`СÑда пеÑеводим 85%. ÐÑи даннÑе Ð²Ð¸Ð´Ð½Ñ ÑолÑко в кабинеÑе.`})]}),(0,c.jsx)(`p`,{className:`text-sm text-muted`,children:d(n)})]})}function d(e){let t=e.legalName.trim();return`Ð Ñеке гоÑÑÑ: Ð°Ð³ÐµÐ½Ñ ÐÐР«ÐÐЧÐÐЧ». ÐоÑÑавÑик â ${e.taxKind===`ie`&&t&&!t.toUpperCase().startsWith(`ÐÐ `)?`ÐÐ ${t}`:t||`Ð¸Ð¼Ñ Ð¿Ð¾ÑÑавÑика`}, ÐÐÐ ${e.inn||`ÐÐÐ`}, ${e.phone||`ÑелеÑон`}, ${e.vat===`22`?`ÐÐС 22%`:e.vat===`5`?`ÐÐС 5%`:e.vat===`7`?`ÐÐС 7%`:`без ÐÐС`}.`}export{u as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.