PageSourceSearch

https://snich.ai/assets/TasksPage-8378a659.js

js snich.ai collected 2026-10-05 15:07:44 UTC 31,131 bytes, 1 lines download raw bytes

1import{r,j as e,a as hs,b as ps,L as xs}from"./vendor-react-72e4a099.js";import{u as es,f as ss,B as y,F as le,T as Be,I as ce,b as re,S as fs,M as ye,d as gs,g as js}from"./Toast-43ee7788.js";import{b as de,C as Ne,E as be,a as Ke,T as He}from"./Display-48adcc24.js";import{S as vs,C as Qe}from"./Controls-5a18fd37.js";import{e as X}from"./api-d8a57490.js";import{a as ys,k as qe,h as M,p as Ns,f as bs,o as ns}from"./format-5039f022.js";import{u as Cs,r as J,f as Ss}from"./buildLifecycle-a44b0e05.js";import{a as Y,m as we,p as ws,r as I,T as D,i as Ge,d as ks}from"./api-9e8c3e2c.js";import{U as Oe}from"./user-plus-d862ebc6.js";import{L as ke}from"./list-checks-f8235a5c.js";import{useCanToggle as $s,openTasksToSend as Es}from"./SummaryPage-db7c3504.js";import{u as Ts}from"./useRecording-3d0f0f27.js";import{U as Ms}from"./user-x-facc2ce7.js";import{P as Ds}from"./pen-line-729408c9.js";import{F as Is}from"./file-text-e7c68864.js";import{E as oe}from"./external-link-63c5a0ce.js";import{T as Je}from"./trash-2-7a739e24.js";import{S as As}from"./settings-2-0eb2aee0.js";import{S as Ce}from"./send-ef7332d3.js";import{C as Ie}from"./check-check-9685683e.js";import{P as Ve}from"./plus-39793e81.js";import{C as Xe}from"./check-083433f7.js";import{T as Os}from"./triangle-alert-cdc85d96.js";import{C as Ls}from"./calendar-days-6829c81b.js";import{P as Ye}from"./play-3580deb4.js";import{E as Us}from"./ellipsis-bbf71637.js";import"./createLucideIcon-581cd729.js";import"./eye-5711d0dd.js";import"./x-b9f3d093.js";import"./circle-check-63b159d4.js";import"./circle-alert-67975319.js";import"./chevron-down-888c3b30.js";import"./copy-34f4069e.js";import"./RecordingStage-10de7910.js";/* empty css                   */import"./pause-2cb080c5.js";import"./captions-4aebb0bb.js";import"./volume-x-8aea9e1c.js";import"./volume-2-a1e941cc.js";import"./minimize-f9a54b0a.js";import"./maximize-edcb58d4.js";import"./film-0ba9e353.js";import"./sparkles-e0558c3e.js";import"./refresh-cw-98362cea.js";const Fs=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Se="__none",V="__other";function Le(t,o){return o.find(p=>t.assigneeUserId&&p.userId===t.assigneeUserId||t.assigneeEmail&&p.email&&p.email.toLowerCase()===t.assigneeEmail.toLowerCase()||t.assignee&&p.name===t.assignee)||null}function Ps({open:t,onClose:o,roomId:p,task:a,people:u,durationSeconds:x,focus:$,onSaved:R}){const me=es(),[f,Z]=r.useState(""),[ee,se]=r.useState(""),[b,A]=r.useState(Se),[v,O]=r.useState(""),[W,_]=r.useState(""),[E,C]=r.useState(""),[S,Q]=r.useState(""),[T,ne]=r.useState({}),[ue,ae]=r.useState(!1);r.useEffect(()=>{if(!t)return;ne({}),Z((a==null?void 0:a.title)||""),se((a==null?void 0:a.description)||""),C((a==null?void 0:a.dueIso)||""),Q((a==null?void 0:a.sourceOffsetMs)!==null&&(a==null?void 0:a.sourceOffsetMs)!==void 0?Y(a.sourceOffsetMs):"");const i=a?Le(a,u):null;$==="assignee"&&a&&!(i!=null&&i.email||a.assigneeEmail)?(A(V),O(a.assignee||(i==null?void 0:i.name)||""),_("")):i?(A(i.key),O(""),_("")):a&&(a.assignee||a.assigneeEmail)?(A(V),O(a.assignee||""),_(a.assigneeEmail||"")):(A(Se),O(""),_(""))},[t,a,u,$]);const $e=r.useMemo(()=>[...u.map(i=>({value:i.key,label:i.name,description:i.email||"почта не указана",icon:e.jsx(de,{name:i.name,src:we(i.avatarUrl),size:24})})),{value:V,label:"Другой человек",description:"Укажите имя и почту",icon:e.jsx(Oe,{className:"sn-i"})},{value:Se,label:"Без ответственного"}],[u]),B=async i=>{i==null||i.preventDefault();const g={},K=f.replace(/\s+/g," ").trim();K||(g.title="Опишите задачу");let L=null;if(S.trim()&&(L=ws(S.trim().replace(/\s/g,"")),L===null||/^\d+$/.test(S.trim())?g.moment="Время в формате мм:сс, например 18:20":x>0&&L>x*1e3&&(g.moment=`Запись длится ${Y(x*1e3)}`)),b===V&&(!v.trim()&&!W.trim()?g.other="Укажите имя или почту":W.trim()&&!Fs.test(W.trim())&&(g.other="Проверьте адрес почты")),ne(g),Object.keys(g).length)return;const U={title:K,description:ee.trim()||null,dueDate:E||null,sourceOffsetMs:L};if(b===Se)Object.assign(U,{assignee:null,assigneeEmail:null,assigneeUserId:null});else if(b===V){const j=W.trim().toLowerCase();Object.assign(U,{assignee:v.trim()||j.split("@")[0],assigneeEmail:j||null,assigneeUserId:null})}else{const j=u.find(w=>w.key===b);j&&Object.assign(U,{assignee:j.name,assigneeEmail:j.email||null,assigneeUserId:j.userId})}ae(!0);try{const j=a?await I.updateTask(p,a.id,U):await I.createTask(p,U);R(j,!a),me.success(a?"Задача сохранена":"Задача добавлена"),o()}catch(j){me.error(X(j,"Не удалось сохранить задачу"))}finally{ae(!1)}},he=u.find(i=>i.key===b);return e.jsx(ss,{className:"sn-rec-scope",open:t,onClose:o,title:a?"Задача":"Новая задача",subtitle:a?void 0:"Появится в итогах, и ответственный получит её в письме.",icon:e.jsx(ke,{className:"sn-i"}),width:560,footer:e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{flex:1}}),e.jsx(y,{variant:"quiet",onClick:o,disabled:ue,children:"Отмена"}),e.jsx(y,{variant:"primary",onClick:()=>B(),loading:ue,children:a?"Сохранить":"Добавить задачу"})]}),children:e.jsxs("form",{onSubmit:B,style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsx(le,{label:"Задача",htmlFor:"task-title",error:T.title,children:e.jsx(Be,{id:"task-title",rows:2,maxLength:500,value:f,invali
1d:!!T.title,placeholder:"Например, подготовить тексты лендинга",onChange:i=>Z(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&(i.preventDefault(),B())},"data-autofocus":$!=="assignee"?!0:void 0})}),e.jsx(le,{label:"Ответственный",error:T.other,hint:he&&!he.email?"Без почты письмо с задачей не уйдёт — выберите «Другой человек» и укажите адрес.":void 0,children:e.jsx(vs,{value:b,onChange:A,options:$e,ariaLabel:"Ответственный",width:"100%",menuWidth:420})}),b===V&&e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",gap:10},children:[e.jsx(ce,{value:v,onChange:i=>O(i.target.value),placeholder:"Имя","aria-label":"Имя ответственного",maxLength:120}),e.jsx(ce,{value:W,onChange:i=>_(i.target.value),placeholder:"почта@компания.ru",type:"email","aria-label":"Почта ответственного",invalid:!!T.other,maxLength:200,"data-autofocus":$==="assignee"?!0:void 0})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr)",gap:12},children:[e.jsx(le,{label:"Срок",htmlFor:"task-due",children:e.jsx(ce,{id:"task-due",type:"date",value:E,onChange:i=>C(i.target.value)})}),e.jsx(le,{label:"Момент в записи",htmlFor:"task-moment",error:T.moment,hint:T.moment?void 0:"мм:сс — откроется в расшифровке",children:e.jsx(ce,{id:"task-moment",value:S,placeholder:"18:20",inputMode:"numeric",onChange:i=>Q(i.target.value),invalid:!!T.moment,maxLength:8})})]}),e.jsx(le,{label:"Подробности",htmlFor:"task-desc",aside:"необязательно",children:e.jsx(Be,{id:"task-desc",rows:3,maxLength:4e3,value:ee,onChange:i=>se(i.target.value),placeholder:"Что именно сделать, ссылки"})}),(a==null?void 0:a.sourceQuote)&&e.jsx("div",{className:"sn-rec-note",style:{fontSize:13},children:e.jsx("span",{children:`Из разговора: «${a.sourceQuote}»`})})]})})}const zs=["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],Rs=["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"];function Ze(t){const o=ks(t);if(!o||!t.dueIso)return o;const[p,a,u]=t.dueIso.split("-").map(Number),x=new Date(p,a-1,u),$=["вс","пн","вт","ср","чт","пт","сб"][x.getDay()],R=["янв","фев","мар","апр","мая","июн","июл","авг","сент","окт","нояб","дек"];return o.tone==="red"?{text:`просрочено · ${u} ${R[a-1]}`,tone:"red"}:{text:`до ${$}, ${u} ${R[a-1]}`,tone:o.tone==="amber"?"amber":"gray"}}function Ws(t,o){if(!t)return o?`Срок — ${o}`:"Без срока";const[p,a,u]=t.split("-").map(Number),x=new Date(p,a-1,u);return`Срок — ${zs[x.getDay()]}, ${u} ${Rs[a-1]}`}function Ae(t){const o=new Date;return o.setDate(o.getDate()+t),ns(o)}function _s(){const t=new Date,o=(5-t.getDay()+7)%7||7;return t.setDate(t.getDate()+o),ns(t)}function Ln(){var _e;const{roomId:t,detail:o,patch:p}=Ts(),{user:a}=Cs(),u=es(),x=hs(),[$,R]=ps(),me=$s(),[f,Z]=r.useState(null),[ee,se]=r.useState(null),[b,A]=r.useState("all"),[v,O]=r.useState(null),[W,_]=r.useState(null),[E,C]=r.useState(null),[S,Q]=r.useState(null),[T,ne]=r.useState(null),[ue,ae]=r.useState(!1),[$e,B]=r.useState(!1),[he,i]=r.useState(null),[g,K]=r.useState(null),[L,U]=r.useState(!1),j=re(),[w,as]=r.useState(null),pe=re(),[F,ts]=r.useState(null),te=re(),[xe,is]=r.useState(null),fe=re(),ge=re(),m=(f==null?void 0:f.canManage)??o.permissions.canManage,ie=o.room.workspaceId,Ee=r.useCallback(async()=>{try{Z(await I.tasks(t)),se(null)}catch(s){se(X(s,"Не удалось загрузить задачи"))}},[t]),q=r.useCallback(async()=>{try{O(await I.sendPreview(t))}catch{O(null)}},[t]);r.useEffect(()=>{Ee()},[Ee]),r.useEffect(()=>{m&&q()},[m,q]),r.useEffect(()=>{!m||!ie||I.integrations(ie).then(s=>i(s.filter(n=>D[n.provider]&&n.status==="connected"))).catch(()=>i([]))},[m,ie]),r.useEffect(()=>{if($.get("new")&&m){C({task:null});const s=new URLSearchParams($);s.delete("new"),R(s,{replace:!0})}},[$,R,m]);const G=r.useCallback((s,n={})=>{Z(l=>l&&{...l,tasks:s(l.tasks),...n.sentAt!==void 0?{sentAt:n.sentAt}:{},...n.sentCount!==void 0?{sentCount:n.sentCount}:{}}),p(l=>{const h=s(l.tasks);return{...l,tasks:h,counts:{...l.counts,tasks:h.length},summary:l.summary&&n.sentAt!==void 0?{...l.summary,tasksSentAt:n.sentAt,tasksSentCount:n.sentCount??l.summary.tasksSentCount}:l.summary}})},[p]),Te=s=>{G(n=>n.map(l=>l.id===s.id?s:l)),m&&q()},je=async(s,n,l)=>{ne(s.id);try{const h=await I.updateTask(t,s.id,n);return Te(h),l&&u.success(l),h}catch(h){return u.error(X(h,"Не удалось сохранить задачу")),null}finally{ne(null)}},ls=async s=>{const n=s.done?"accepted":"done";G(h=>h.map(c=>c.id===s.id?{...c,done:!s.done,status:n}:c)),await je(s,{status:n})||G(h=>h.map(c=>c.id===s.id?s:c))},Ue=s=>!!(a&&(s.assigneeUserId&&Number(s.assigneeUserId)===Number(a.id)||s.assigneeEmail&&a.email&&s.assigneeEmail.toLowerCase()===a.email.toLowerCase())),N=(f==null?void 0:f.tasks)||[],Me={all:N.length,mine:N.filter(Ue).length,overdue:N.filter(s=>Ge(s)).length},Fe=b==="mine"?N.filter(Ue):b==="overdue"?N.filter(s=>Ge(s)):N,Pe=Es(N),rs=!!(f!=null&&f.sentAt)||N.some(s=>s.emailSentAt),ze=m&&rs,Re=async(s=!1)=>{ae(!0);try{const n=await I.sendTasks(t,s?{resend:!0}:{}),l=new Set(n.sent.map(c=>c.email.toLowerCase()));G(c=>c.map(d=>d.assigneeEmail&&l.has(d.assigneeEmail.toLowerCase())&&!d.done&&(s||!d.emailSentAt)?{...d,emailSentAt:n.sentAt}:d),{sentAt:n.sentAt,sentCount:n.sent.length}),q();const h=n.sent.length;u.success(e.jsxs("span",{children:[e.jsx("b",{children:"Задачи отправлены"}),e.jsx("br",{}),`${M(h,"участник получил","участника получили","участников получили")} письма со своими задачами и ссылками Ð
1½Ð° моменты записи.`,n.skipped.length>0&&` Без почты: ${n.skipped.map(c=>c.name).join(", ")}.`]}),{duration:8e3,action:{label:"Вернуться к итогам",onClick:()=>x(J.recording(t))}})}catch(n){u.error(X(n,"Не удалось отправить задачи"))}finally{ae(!1),B(!1)}},os=async()=>{if(!g||!ie)return;U(!0);const{provider:s}=g;let n=0;const l=[];for(const c of g.tasks)try{const d=await I.exportTask(ie,s,{id:c.id,title:c.title,description:c.description||void 0,assignee:c.assignee||void 0,dueDate:c.dueIso||void 0,priority:"medium",meetingTitle:o.room.title,roomId:t,sourceUrl:Ss(c.sourceOffsetMs!==null?`${J.recordingTranscript(t)}?t=${c.sourceOffsetMs}`:J.recordingTasks(t)),sourceTimestamp:c.sourceOffsetMs!==null?Y(c.sourceOffsetMs):void 0,sourceQuote:c.sourceQuote||void 0});if(!d.success){l.push(d.message||c.title);continue}const us=await I.updateTask(t,c.id,{externalLink:{provider:s,url:d.externalUrl||null,id:d.externalId||null}});Te(us),n+=1}catch(d){l.push(X(d,c.title))}U(!1),K(null);const h=D[s]||s;n&&u.success(`${M(n,"задача выгружена","задачи выгружены","задач выгружено")} в ${h}`),l.length&&u.error(`${h}: ${l[0]}${l.length>1?` (и ещё ${l.length-1})`:""}`)},De=(s,n)=>{const l=n?[n]:N.filter(h=>!h.done&&!h.external.some(c=>c.provider===s));if(!l.length){u.show(`Все открытые задачи уже в ${D[s]}`);return}K({provider:s,tasks:l})};if(ee&&!f)return e.jsx(Ne,{pad:!0,children:e.jsx(be,{icon:e.jsx(ke,{className:"sn-i sn-i-24"}),title:"Не удалось загрузить задачи",action:e.jsx(y,{variant:"quiet",onClick:()=>Ee(),children:"Повторить"}),children:ee})});if(!f)return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},"aria-busy":"true",children:[e.jsx(Ke,{height:44,width:420,radius:12}),e.jsx(Ke,{height:380,radius:18})]});if(o.summaryHidden)return e.jsx(Ne,{pad:!0,children:e.jsx(be,{icon:e.jsx(ke,{className:"sn-i sn-i-24"}),title:"Задачи скрыты",children:"Организатор не показывает итоги и задачи этой записи."})});const ve=f.people,P=he||[],cs=P.length?`Экспорт в ${P.map(s=>D[s.provider]).join(" / ")}`:"Экспорт в Битрикс24 / Трекер",ds=F?[{type:"label",label:"Участники встречи"},...ve.map(s=>{var n;return{label:s.name,description:s.email||"почта не указана",icon:e.jsx(de,{name:s.name,src:we(s.avatarUrl),size:22}),checked:((n=Le(F,ve))==null?void 0:n.key)===s.key,onSelect:()=>je(F,{assignee:s.name,assigneeEmail:s.email||null,assigneeUserId:s.userId})}}),{type:"separator"},{label:"Другой человек…",icon:e.jsx(Oe,{className:"sn-i"}),onSelect:()=>C({task:F,focus:"assignee"})},...F.assignee||F.assigneeEmail?[{label:"Без ответственного",icon:e.jsx(Ms,{className:"sn-i"}),onSelect:()=>je(F,{assignee:null,assigneeEmail:null,assigneeUserId:null})}]:[]]:[],ms=w?[...m?[{label:"Изменить",icon:e.jsx(Ds,{className:"sn-i"}),onSelect:()=>C({task:w})}]:[],...w.sourceOffsetMs!==null?[{label:"Открыть в расшифровке",icon:e.jsx(Is,{className:"sn-i"}),onSelect:()=>x(`${J.recordingTranscript(t)}?t=${w.sourceOffsetMs}`)}]:[],...w.external.filter(s=>s.url).map(s=>({label:`Открыть в ${D[s.provider]||s.provider}`,icon:e.jsx(oe,{className:"sn-i"}),href:s.url})),...m?P.map(s=>({label:`Выгрузить в ${D[s.provider]}`,icon:e.jsx(oe,{className:"sn-i"}),description:w.external.some(n=>n.provider===s.provider)?"уже выгружена — создадим ещё раз":void 0,onSelect:()=>De(s.provider,w)})):[],...m?[{type:"separator"},{label:"Удалить задачу",icon:e.jsx(Je,{className:"sn-i"}),danger:!0,onSelect:()=>Q(w)}]:[]]:[],z=(v==null?void 0:v.recipients)||[],k=z.find(s=>
1s.key===W)||z[0]||null,H=f.sentAt,We=!!H&&z.length>0&&z.every(s=>s.unsent===0);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},role:"region","aria-label":"Задачи",children:[e.jsxs("div",{className:"sn-rec-tasks-top",children:[e.jsx(fs,{value:b,onChange:A,ariaLabel:"Какие задачи показать",options:[{value:"all",label:e.jsxs(e.Fragment,{children:["Все ",e.jsx("span",{className:"sn-mono sn-faint",children:Me.all})]})},{value:"mine",label:e.jsxs(e.Fragment,{children:["Мои ",e.jsx("span",{className:"sn-mono sn-faint",children:Me.mine})]})},{value:"overdue",label:e.jsxs(e.Fragment,{children:["Просроченные ",e.jsx("span",{className:"sn-mono sn-faint",children:Me.overdue})]})}]}),e.jsx("div",{className:"sn-rec-spacer"}),m&&N.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(y,{variant:"quiet",icon:e.jsx(oe,{className:"sn-i"}),onClick:s=>{P.length===1?De(P[0].provider):fe.toggle(s)},"aria-haspopup":P.length===1?void 0:"menu",children:cs}),e.jsx(ye,{open:fe.open,onClose:fe.close,anchor:fe.anchor,width:320,items:P.length?P.map(s=>({label:D[s.provider],description:s.displayName||"Открытые задачи станут задачами в трекере",icon:e.jsx(oe,{className:"sn-i"}),onSelect:()=>De(s.provider)})):[{type:"label",label:"Трекер не подключён"},{label:"Подключить Битрикс24 или Jira",description:"Настройки → Интеграции. После подключения задачи выгружаются одной кнопкой.",icon:e.jsx(As,{className:"sn-i"}),onSelect:()=>x(J.settingsIntegrations())}]}),Pe.length>0?e.jsx(y,{variant:"primary",icon:e.jsx(Ce,{className:"sn-i"}),loading:ue,onClick:()=>Re(!1),children:H?`Отправить новые · ${Pe.length}`:"Отправить задачи участникам"}):H?e.jsxs(e.Fragment,{children:[e.jsx(y,{variant:"quiet",icon:e.jsx(Ie,{className:"sn-i",style:{color:"var(--sn-green)"}}),onClick:ge.toggle,"aria-haspopup":"menu",children:e.jsxs("span",{style:{color:"var(--sn-green)"},children:["Отправлено в ",e.jsx("span",{className:"sn-mono",children:ys(H)})]})}),e.jsx(ye,{open:ge.open,onClose:ge.close,anchor:ge.anchor,width:300,header:e.jsx("div",{className:"sn-hint",style:{padding:"10px 12px 6px"},children:`Письма ушли ${qe(H).toLowerCase()}`}),items:[{label:"Отправить всем ещё раз",icon:e.jsx(Ce,{className:"sn-i"}),description:"Каждый получит письмо со всеми своими открытыми задачами",onSelect:()=>B(!0)}]})]}):e.jsx(y,{variant:"primary",icon:e.jsx(Ce,{className:"sn-i"}),disabled:!0,title:"Назначьте ответственных с почтой",children:"Отправить задачи участникам"})]})]}),e.jsxs(Ne,{className:"sn-rec-tasks-card",children:[N.length===0?e.jsx(be,{icon:e.jsx(ke,{className:"sn-i sn-i-24"}),title:"Задач пока нет",action:m?e.jsx(y,{variant:"primary",icon:e.jsx(Ve,{className:"sn-i"}),onClick:()=>C({task:null}),children:"Добавить задачу"}):void 0,children:(_e=o.summary)!=null&&_e.hasContent?"AI не нашёл в разговоре задач с ответственными. Добавьте их вручную — каждый получит письмо.":"Когда AI соберёт итоги, здесь появятся задачи из разговора. Можно добавить и вручную."}):Fe.length===0?e.jsx(be,{compact:!0,icon:e.jsx(Xe,{className:"sn-i"}),title:b==="mine"?"На вас задач нет":"Просроченных задач нет",children:e.jsx(y,{variant:"text",size:"sm",onClick:()=>A("all"),children:"Показать все задачи"})}):e.jsx("div",{className:"sn-rec-table-wrap",children:e.jsxs("table",{className:"sn-rec-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{width:40},children:e.jsx("span",{className:"sn-sr",children:"Готово"})}),e.jsx("th",{children:"Задача"}),e.jsx("th",{style:{width:210},children:"Ответственный"}),e.jsx("th",{style:{width:160},children:"Срок"}),e.jsx("th",{style:{width:124},children:"Из записи"}),ze&&e.jsx("th",{style:{width:130},children:"Письмо"}),e.jsx("th",{style:{width:52},children:e.jsx("span",{className:"sn-sr",children:"Действия"})})]})}),e.jsx("tbody",{children:Fe.map(s=>{const n=s.done?null:Ze(s),l=me(s,m),h=Le(s,ve),c=!s.done&&(s.assignee||h)&&!s.assigneeEmail;return e.jsxs("tr",{className:s.done?"is-done":void 0,"aria-busy":T===s.id||void 0,children:[e.jsx("td",{className:"c-check",children:e.jsx("input",{type:"checkbox",className:"sn-check",checked:s.done,disabled:!l||T===s.id,onChange:()=>ls(s),"aria-label":s.done?`Вернуть в работу: ${s.title}`:`Отметить выполненной: ${s.title}`})}),e.jsxs("td",{className:"c-title",children:[m?e.jsx("button",{type:"button",className:"sn-rec-task-open",onClick:()=>C({task:s}),children:e.jsx("span",{className:"sn-rec-task-title",children:s.title})}):e.jsx("span",{className:"sn-rec-task-title",children:s.title}),s.external.length>0&&e.jsx("span",{className:"sn-rec-task-ext",children:s.external.map(d=>d.url?e.jsx("a",{href:d.url,target:"_blank",rel:"noreferrer",children:`${D[d.provider]||d.provider} ↗`},d.provider):e.jsx("span",{children:`В ${D[d.provider]||d.provider}`},d.provider))})]}),e.jsx("td",{className:"c-who",children:e.jsx("button",{type:"button",className:"sn-rec-cell-btn",disabled:!m,"aria-haspopup":m?"menu":void 0,"aria-label":m?`Ответственный: ${s.assignee||"не назначен"}. Изменить`:void 0,onClick:d=>{ts(s),pe.toggle(d)},children:s.assignee||s.assigneeEmail?e.jsxs(e.Fragment,{children:[e.jsx(de,{name:s.assignee||s.assigneeEmail,src:we(s.assigneeAvatarUrl||(h==null?void 0:h.avatarUrl)),size:24}),e.jsx("span",{className:"sn-ellipsis",children:s.assignee||s.assigneeEmail}),c&&m&&e.jsx(Os,{className:"sn-i sn-i-14",style:{color:"var(--sn-amber)"},"aria-label":"нет почты"})]}):e.jsx("span",{className:"sn-faint",children:m?"Назначить":"Не назначен"})})}),e.jsx("td",{className:"c-due",children:s.done?e.jsx(He,{tone:"green",icon:e.jsx(Xe,{className:"sn-i sn-i-14"}),children:"Готово"}):e.jsx("button",{type:"button",className:"sn-rec-cell-btn is-tag",disabled:!m,"aria-label":m?`Срок: ${n?n.text:"не указан"}. Изменить`:void 0,onClick:d=>{is(s),te.toggle(d)},children:n?e.jsx(He,{tone:n.tone,icon:e.jsx(Ls,{className:"sn-i sn-i-14"}),children:n.text}):e.jsx("span",{className:"sn-faint",children:m?"Указать срок":"Без срока"})})}),e.jsx("td",{className:"c-moment",children:s.sourceOffsetMs!==null?e.jsxs(xs,{className:"sn-rec-moment",to:`${J.recordingTranscript(t)}?t=${s.sourceOffsetMs}`,"aria-label":`Открыть момент ${Y(s.sourceOffsetMs)} в записи`,children:[e.jsx(Ye,{className:"sn-i sn-i-14",fill:"
1currentColor"}),Y(s.sourceOffsetMs)]}):e.jsx("span",{className:"sn-faint",children:"—"})}),ze&&e.jsx("td",{className:"c-mail",children:s.done?e.jsx("span",{className:"sn-faint",style:{fontSize:13},children:"не нужно"}):s.emailSentAt?e.jsxs("span",{className:"sn-rec-mail-state is-sent",children:[e.jsx(Ie,{className:"sn-i sn-i-14"}),"Отправлено"]}):s.assigneeEmail?e.jsx("span",{className:"sn-faint",style:{fontSize:13},children:"не отправлено"}):e.jsx("span",{className:"sn-rec-mail-state is-warn",children:"нет почты"})}),e.jsx("td",{className:"c-menu",children:e.jsx(gs,{label:`Действия с задачей «${s.title}»`,size:"sm",onClick:d=>{as(s),j.toggle(d)},"aria-haspopup":"menu",children:e.jsx(Us,{className:"sn-i"})})})]},s.id)})})]})}),N.length>0&&e.jsxs("div",{className:"sn-rec-table-foot",children:[m&&e.jsx(y,{variant:"text",size:"sm",icon:e.jsx(Ve,{className:"sn-i"}),onClick:()=>C({task:null}),children:"Добавить задачу"}),e.jsx("div",{className:"sn-rec-spacer"}),f.aiCount>0&&e.jsx("span",{className:"sn-hint",children:`AI нашёл ${M(f.aiCount,"задачу","задачи","задач")} в расшифровке · проверьте сроки и ответственных`})]})]}),m&&v&&(z.length>0||v.withoutEmail.length>0)&&e.jsxs(Ne,{className:"sn-rec-mail",children:[e.jsxs("div",{className:"sn-rec-mail-side",children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:17,fontWeight:600},children:We?"Письма отправлены":"Кто получит письмо"}),e.jsx("div",{className:"sn-hint",children:We&&H?`${qe(H)} · ${M(f.sentCount||z.length,"человек","человека","человек")}`:"Только те, у кого есть открытые задачи"})]}),e.jsxs("div",{className:"sn-rec-mail-people",role:"list",children:[z.map(s=>e.jsxs("button",{type:"button",role:"listitem",className:"sn-rec-mail-person","aria-pressed":(k==null?void 0:k.key)===s.key,onClick:()=>_(s.key),title:`Показать письмо для ${s.name}`,children:[e.jsx(de,{name:s.name,src:we(s.avatarUrl),size:28}),e.jsx("span",{className:"sn-ellipsis",style:{flex:1,textAlign:"left"},children:s.name}),s.unsent===0&&s.lastSentAt?e.jsx(Ie,{className:"sn-i",style:{color:"var(--sn-green)"},"aria-label":"отправлено"}):e.jsx("span",{className:"sn-hint",children:s.lastSentAt?`новых ${s.unsent}`:M(s.tasks.length,"задача","задачи","задач")})]},s.key)),v.withoutEmail.map(s=>{const n=N.find(l=>!l.done&&l.assignee===s.name&&!l.assigneeEmail);return e.jsxs("div",{className:"sn-rec-mail-person is-muted",role:"listitem",children:[e.jsx(de,{name:s.name,size:28}),e.jsx("span",{className:"sn-ellipsis",style:{flex:1},children:s.name}),n?e.jsx(y,{variant:"text",size:"xs",onClick:()=>C({task:n,focus:"assignee"}),children:"Указать почту"}):e.jsx("span",{className:"sn-hint",children:"нет почты"})]},s.name)})]}),v.unassigned>0&&e.jsx("div",{className:"sn-hint",children:`${M(v.unassigned,"задача","задачи","задач")} без ответственного — ${Ns(v.unassigned,"её","их","их")} никто не получит.`})]}),e.jsxs("div",{className:"sn-rec-mail-preview",children:[e.jsxs("div",{children:[e.jsx("span",{className:"sn-eyebrow",children:"Так выглядит письмо"}),k&&e.jsx("span",{className:"sn-hint",children:` · пример для ${k.name}`})]}),k?e.jsxs("div",{className:"sn-rec-mail-card","aria-label":`Письмо для ${k.name}`,children:[e.jsxs("div",{className:"sn-hint",style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("b",{style:{color:"var(--sn-ink)"},children:"snich.ai"})," · итоги встречи"]}),e.jsx("div",{style:{fontSize:17,fontWeight:600},children:`«${o.room.title}»: у вас ${M(k.tasks.length,"задача","задачи","задач")}`}),e.jsx("div",{className:"sn-muted",children:`${bs(k.name)}, по итогам встречи «${o.room.title}» на вас ${M(k.tasks.length,"задача","задачи","задач")}.`}),k.tasks.map(s=>e.jsxs("div",{className:"sn-rec-mail-task",children:[e.jsxs("div",{style:{minWidth:0,flex:1},children:[e.jsx("div",{style:{fontWeight:600},children:s.title}),e.jsx("div",{className:"sn-hint",children:Ws(s.dueIso,s.dueDate)})]}),s.sourceOffsetMs!==null&&e.jsxs("span",{className:"sn-rec-mail-moment",children:[e.jsx(Ye,{className:"sn-i sn-i-14",fill:"
1currentColor"}),"Момент ",e.jsx("span",{className:"sn-mono",children:Y(s.sourceOffsetMs)})]})]},s.id)),v.short.length>0&&e.jsx("div",{className:"sn-muted",children:`Коротко о встрече: ${v.short.slice(0,3).join("; ")}.`}),e.jsx("div",{className:"sn-hint",children:"В письме — кнопки «Открыть задачи» и «Смотреть запись встречи»."})]}):e.jsxs("div",{className:"sn-rec-note",children:[e.jsx(Oe,{className:"sn-i"}),e.jsx("span",{children:"Укажите почту ответственным — тогда здесь появится письмо, которое они получат."})]})]})]}),e.jsx(ye,{open:j.open&&!!w,onClose:j.close,anchor:j.anchor,items:ms,width:280}),e.jsx(ye,{open:pe.open&&!!F,onClose:pe.close,anchor:pe.anchor,items:ds,width:300,placement:"bottom-start"}),e.jsx(js,{open:te.open&&!!xe,onClose:te.close,anchor:te.anchor,width:280,placement:"bottom-start",children:xe&&e.jsx(Bs,{value:xe.dueIso,onPick:s=>{te.close(),je(xe,{dueDate:s})}})}),e.jsx(Ps,{open:!!E,onClose:()=>C(null),roomId:t,task:(E==null?void 0:E.task)||null,focus:E==null?void 0:E.focus,people:ve,durationSeconds:o.durationSeconds,onSaved:(s,n)=>{n?G(l=>[...l,s]):Te(s),m&&q()}}),e.jsx(Qe,{open:!!S,onClose:()=>Q(null),onConfirm:async()=>{if(S)try{await I.removeTask(t,S.id),G(s=>s.filter(n=>n.id!==S.id)),q(),u.success("Задача удалена"),Q(null)}catch(s){u.error(X(s,"Не удалось удалить задачу"))}},title:"Удалить задачу?",description:S?`«${S.title}» пропадёт из итогов. Письма, которые уже ушли, останутся у получателей.`:void 0,icon:e.jsx(Je,{className:"sn-i"}),confirmLabel:"Удалить"}),e.jsx(Qe,{open:$e,onClose:()=>B(!1),onConfirm:()=>Re(!0),tone:"primary",icon:e.jsx(Ce,{className:"sn-i"}),title:"Отправить письма ещё раз?",description:`${M(z.filter(s=>s.tasks.length).length,"человек получит","человека получат","человек получат")} письмо со всеми своими открытыми задачами.`,confirmLabel:"Отправить"}),e.jsx(ss,{className:"sn-rec-scope",open:!!g,onClose:()=>L?void 0:K(null),title:g?`Выгрузить в ${D[g.provider]}?`:"",subtitle:"В трекере появятся задачи со сроком и ссылкой на момент записи.",icon:e.jsx(oe,{className:"sn-i"}),width:520,footer:e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{flex:1}}),e.jsx(y,{variant:"quiet",onClick:()=>K(null),disabled:L,children:"Отмена"}),e.jsx(y,{variant:"primary",loading:L,onClick:os,children:g?`Выгрузить ${M(g.tasks.length,"задачу","задачи","задач")}`:"Выгрузить"})]}),children:g&&e.jsx("ul",{className:"sn-rec-export-list",children:g.tasks.map(s=>{var n;return e.jsxs("li",{children:[e.jsx("span",{className:"sn-ellipsis",style:{flex:1},children:s.title}),e.jsx("span",{className:"sn-hint",children:[s.assignee,s.dueIso?(n=Ze(s))==null?void 0:n.text:null].filter(Boolean).join(" · ")})]},s.id)})})})]})}function Bs({value:t,onPick:o}){const[p,a]=r.useState(t||""),u=r.useMemo(()=>[{label:"Сегодня",value:Ae(0)},{label:"Завтра",value:Ae(1)},{label:"К пятнице",value:_s()},{label:"Через неделю",value:Ae(7)}],[]);return e.jsxs("div",{style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[e.jsxs("form",{style:{display:"flex",gap:8},onSubmit:x=>{x.preventDefault(),p&&o(p)},children:[e.jsx(ce,{type:"date",value:p,onChange:x=>a(x.target.value),"aria-label":"Срок",inputSize:"sm","data-autofocus":!0}),e.jsx(y,{variant:"primary",size:"sm",type:"submit",disabled:!p||p===t,children:"ОК"})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:u.map(x=>e.jsx("button",{type:"button",className:"sn-pill","aria-pressed":x.value===t,onClick:()=>o(x.value),children:x.label},x.label))}),t&&e.jsx(y,{variant:"text",size:"sm",onClick:()=>o(null),style:{alignSelf:"flex-start"},children:"Убрать срок"})]})}
1export{Ln as default};

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.