PageSourceSearch

https://steppo.ru/assets/folder-CJztHxYc.js

js steppo.ru collected 2026-10-08 22:34:31 UTC 14,886 bytes, 1 lines download raw bytes

1import{r as e,j as s,d as i,u as n}from"./react-vendor-DJDEZQgo.js";import{c as o}from"./index-DMsyrwY3.js";import{P as r,r as t,a,W as l,b as d,s as c,c as p,F as x,d as h,e as m,w as u,f as j,g,h as f,i as b,I as w,j as y,k as v,l as S,V as C,m as k,n as M,o as z}from"./VirtualizedInstructionGrid-D1G7FK7a.js";import{i as F,u as I,F as $,D as L,n as _,o as A,p as W,q as D,t as R,v as T,w as O,x as P,y as E,z as H,C as N,E as B,G,H as V,J as U,K,L as q,N as Q,O as Y,P as J,Q as X,R as Z,S as ee,T as se,U as ie,V as ne,W as oe,X as re,Y as te,Z as ae,_ as le,$ as de,a0 as ce,a1 as pe,a2 as xe,a3 as he,a4 as me,a5 as ue,a6 as je,a7 as ge,a8 as fe,a9 as be}from"./index-CpSz5HRc.js";import{a as we}from"./index.esm-IcPZOCMN.js";import{C as ye,D as ve,G as Se}from"./api-CPiT7-aR.js";import{c as Ce}from"./clipboard-uOAnoYcX.js";import{u as ke}from"./PublicFolderHeaderContext-D8FnrhPW.js";import{d as Me}from"./DockTooltip-BYnLbIff.js";import{H as ze,u as Fe,V as Ie,b as $e}from"./createLucideIcon-CsK1bMTG.js";import{c as Le,I as _e,b as Ae,T as We,B as De}from"./toastOptions-C9sKTk_P.js";import{S as Re}from"./skeleton-iR163uRi.js";import{q as Te,T as Oe,n as Pe,l as Ee,o as He,k as Ne,G as Be,m as Ge}from"./licenseContext-my7rfzFX.js";import{S as Ve}from"./skeleton-circle-BHaMxfuz.js";import"./lodash-LFlzvllK.js";import"./index-Dn-O8Fmn.js";import"./index-C7vS4FZV.js";import"./editorPageNotionLayout-CNMg_kbb.js";import"./image-CeffXirS.js";import"./plus-Ub9KwXRr.js";import"./layers-D8S1Re__.js";import"./index-vlBp10Qt.js";import"./chart-column-DvKRFWTI.js";import"./yandexMetrika-m_4Niw9W.js";import"./assertThisInitialized-PUtynf78.js";import"./users-IyG-ybWO.js";import"./objectDestructuringEmpty-BTcOajHj.js";import"./index-LHLcHDc2.js";import"./index-Dl5ceR2Z.js";import"./index-Dg62e69K.js";import"./index-CxtYbnAM.js";import"./menu-divider-CqJR_Z2c.js";import"./format-BPo9NAoA.js";import"./preload-helper-CKSfOHJ6.js";import"./index-BG-9wiPx.js";import"./companyHelpers-BHkC0xo-.js";import"./file-text-mJ7r21LW.js";function Ue({isMobile:i,viewMode:n,onViewModeChange:o,onCopyLink:t}){const a=e.useMemo(()=>s.jsxs(ze,{spacing:"8px",children:[i?s.jsx(Le,{label:"Скопировать ссылку",...Me,children:s.jsx(_e,{"aria-label":"Скопировать ссылку",icon:s.jsx(F,{}),size:"sm",variant:"outline",borderRadius:"8px",bg:"white",_hover:{bg:"gray.50"},onClick:t})}):s.jsx(Ae,{variant:"outline",size:"sm",boxShadow:"sm",leftIcon:s.jsx(F,{}),borderRadius:"8px",bg:"white",_hover:{bg:"gray.50"},onClick:t,children:"Скопировать ссылку"}),s.jsx(r,{value:n,onChange:o})]}),[i,n,o,t]);return ke(a,[a]),null}const Ke={user:be,calendar:fe,folder:ge,database:je,desktop:ue,branch:me,"chart-line":he,camera:xe,home:pe,inbox:ce,invoice:de,laptop:le,layers:ae,idea:te,link:F,lock:re,message:oe,phone:ne,money:ie,attachment:se,briefcase:ee,building:Z,tags:X,"address-card":J,marker:Y,play:Q,smile:q,share:K,"user-plus":U,stopwatch:V,"map-pin":G,trash:B,group:N,clock:H,rocket:E,plane:P,key:O,globe:T,fingerprint:R,gantt:D,glasses:W,donation:A,handshake:_};function qe(e,s){return`${"REGULATION"===e.instructionType?`/p/public-page/${e.uuid}`:`/public/${e.uuid}`}?fi=${s}`}function Qe({instruction:i,folderId:n,isMobile:o,onNavigate:r}){const t=I(),[a,l]=e.useState(!1),[d,c]=e.useState(!1),[p,x]=e.useState(null),h=Ke[null==i?void 0:i.avatar];e.useEffect(()=>{if(!i)return;const e="Desctop Capture"===i.url?"https://s3.regru.cloud/steppo.bucket/desktop/steppo/icons/icon-desctop.png":`https://www.google.com/s2/favicons?domain=${i.url}&sz=256&drop_404_icon=true`;x(e)},[i]);const m=()=>{};return s.jsx(z,{inst:i,isMobile:o,isDragging:!1,hover:a,isMenuOpen:d,setIsMenuOpen:c,avatar:p,IconComponent:h,currentCompanyRole:"reader",onClick:()=>r(i),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),handleOpenInNewWindow:()=>{window.open(qe(i,n),"_blank")},handlePublishClick:async()=>{const e=`${window.location.origin}${qe(i,n)}`;try{await Ce(e),t({title:"Ссылка на документ скопирована",status:"success",duration:2e3,isClosable:!0})}catch{t({title:"Не удалось скопировать ссылку",status:"error",duration:2e3,isClosable:!0})}},handlePublish:m,handleCopy:m,handleDelete:m,handleShowInfo:m,handlePublicAccess:m,handleGlobalAccess:m,handleNoneAccess:m,isCopying:!1,hideDiscussionsBadge:!0})}const Ye=()=>s.jsxs(Ee,{children:[s.jsx(Ge,{children:s.jsxs(ze,{spacing:3,children:[s.jsx(Ve,{minW:"16px",minH:"16px"}),s.jsx(Re,{height:"16px",width:"200px"})]})}),s.jsx(Ge,{children:s.jsx(Re,{height:"16px",width:"80px"})}),s.jsx(Ge,{children:s.jsx(Re,{height:"16px",width:"100px"})}),s.jsx(Ge,{children:s.jsx(Ve,{size:"6"})})]}),Je={md:"18px minmax(0, 1fr) 104px 28px",lg:"18px minmax(0, 1fr) 104px minmax(0, 140px) 28px"},Xe=({isMobile:e=!1})=>e?s.jsxs(ze,{spacing:3,align:"center",py:2,px:4,w:"100%",children:[s.jsx(Ve,{size:"5"}),s.jsx(Re,{height:"14px",flex:"1"}),s.jsx(Re,{height:"12px",width:"52px",flexShrink:0}),s.jsx(Re,{boxSize:"24px",borderRadius:"full",flexShrink:0})]}):s.jsxs(Se,{templateColumns:Je,gap:3,alignItems:"center",py:2.5,px:4,w:"100%",display:{base:"none",md:"grid"},children:[s.jsx(Ve,{size:"5"}),s.jsx(Re,{height:"14px",minW:0}),s.jsx(Re,{height:"12px",width:"72px",justifySelf:"end"}),s.jsx(Re,{height:"12px",width:"80px",display:{base:"none",lg:"block"}}),s.jsx(Re,{boxSize:"28px",borderRadius:"full"})]}),Ze=()=>{var r,z;const{folderId:_}=i(),A=n(),W=I(),[D,R]=e.useState(!0),[T,O]=e.useState(!1),[P,E]=e.useState(null),[H,N]=e.useState(null),[B,G]=e.useState(null),[V,U]=e.useState(null),[K,q]=e.useState(null),[Q,Y]=e.useState(t),[J,X]=e.useState(a),[Z,ee]=e.useState(null),[se]=Fe(l),[ie]=Fe(d),[ne]=Fe("(max-width: 840px)"),oe=g(ne,ie,se),re=k(ne,ie,se),te=e.useMemo(()=>c(H||[],J),[H,J]),ae=async(e,s)=>{s.stopPropagation();const i=`${window.location.origin}${qe(e,_)}`;try{await Ce(i),W({title:"Ссылка на документ скопирована",status:"success",duration:2e3,isClosable:!0})}catch(n){W({title:"Не удалось скопировать ссылку",status:"error",duration:2e3,isClosable:!0})}},le=e=>{A(`/public-folder/${e.id}`)},de=e=>{A(qe(e,_))},ce=e=>new Date(e).toLocaleDateString("ru-RU",{day:"2-digit",month:"2-digit",year:"numeric"}),pe=((null==P?void 0:P.length)??0)>
10&&0===((null==H?void 0:H.length)??0),xe=pe||D,he=()=>Q===m.LIST?me():Q===m.COMPACT?s.jsx(De,{w:"100%",px:ne?"1rem":void 0,children:s.jsx(De,{w:"100%",border:"1px solid",borderColor:"gray.200",borderRadius:"12px",bg:"white",overflow:"hidden",children:Array.from({length:10}).map((e,i)=>s.jsx(Xe,{isMobile:ne},`compact-skeleton-${i}`))})}):((e=!1)=>s.jsxs(De,{w:"100%",px:ne?"1rem":void 0,children:[s.jsx(Se,{templateColumns:oe,gap:6,w:"100%",alignItems:"stretch",pb:e?0:"20px",children:Array.from({length:3}).map((i,n)=>s.jsx(Be,{display:"flex",children:e?s.jsx(f,{}):s.jsx(b,{})},`folder-skeleton-${n}`))}),!e&&s.jsxs(s.Fragment,{children:[s.jsx(L,{my:"20px"}),s.jsx(Se,{templateColumns:oe,gap:6,w:"100%",alignItems:"stretch",pb:"24px",children:Array.from({length:6}).map((e,i)=>s.jsx(Be,{opacity:.65,display:"flex",children:s.jsx(w,{})},`instruction-skeleton-${i}`))})]})]}))(xe),me=()=>s.jsx(Te,{w:"100%",children:s.jsxs(Oe,{variant:"simple",size:"md",fontSize:"1rem",children:[s.jsx(Pe,{children:s.jsxs(Ee,{children:[s.jsx(He,{children:"Название"}),s.jsx(He,{children:"Дата создания"}),s.jsx(He,{children:"Автор"}),s.jsx(He,{w:"50px"})]})}),s.jsx(Ne,{children:Array.from({length:8}).map((e,i)=>s.jsx(Ye,{},`table-skeleton-${i}`))})]})});if(e.useEffect(()=>{_&&(async()=>{const e=!V;e&&R(!0),q(null);try{const e=await ve(_);e?(E(e.childFolders||[]),N(e.instructions||[]),G(e.path||[]),U(e)):(q("Папка не найдена или нет доступа"),E([]),N([]),G([]),U(null))}catch(s){q("Ошибка при загрузке папки")}finally{e&&R(!1)}})()},[_]),D)return s.jsxs(Ie,{spacing:"1rem",align:"start",w:"100%",opacity:.6,children:[s.jsx(Re,{h:"28.8px",width:"300px",my:"1rem",px:ne?"1rem":void 0}),he()]});if(K)return s.jsx(ye,{w:"100%",minH:"50vh",children:s.jsx(We,{color:"red.500",children:K})});const ue=(e,i,n=!1)=>s.jsx(De,{as:"button",type:"button","aria-label":"Скопировать ссылку на документ",borderRadius:"99px",bg:n?"white":"gray.100",border:n?"1px solid":void 0,borderColor:n?"gray.200":void 0,w:n?"24px":"28px",h:n?"24px":"28px",minW:n?"24px":"28px",display:"flex",alignItems:"center",justifyContent:"center",opacity:Z===i||n?1:0,_hover:{bg:n?"gray.50":"gray.200"},transition:"all .15s ease-in-out",onClick:s=>ae(e,s),flexShrink:0,children:s.jsx(F,{fontSize:n?".65rem":".7rem"})}),je=()=>{const e=[...(P||[]).map(e=>({kind:"folder",item:e})),...(te||[]).map(e=>({kind:"instruction",item:e}))];return s.jsx(De,{w:"100%",px:ne?"1rem":void 0,children:s.jsx(De,{w:"100%",border:"1px solid",borderColor:"gray.200",borderRadius:"12px",bg:"white",overflow:"hidden",children:e.map((i,n)=>ne?((e,i,n)=>{const r="folder"===e.kind,t=e.item,a=r?`folder-${t.id}`:`instruction-${t.id}`;return s.jsxs(ze,{spacing:3,align:"center",px:4,py:2,minH:"40px",cursor:"pointer",borderBottom:i<n-1?"1px solid":void 0,borderColor:"gray.100",_hover:{bg:"#FFFFFF"},_active:{bg:"gray.100"},onClick:()=>r?le(t):de(t),onMouseEnter:()=>ee(a),onMouseLeave:()=>ee(null),children:[r?s.jsx(ye,{w:"18px",h:"18px",flexShrink:0,children:s.jsx(o,{fontSize:"1rem",opacity:.75})}):s.jsx(M,{inst:t,iconMap:Ke,compact:!0}),s.jsx(De,{flex:"1",minW:0,children:r?s.jsx(We,{fontSize:"sm",fontWeight:"500",noOfLines:1,children:t.name}):s.jsx(y,{inst:t,iconMap:Ke,compact:!0,includeIcon:!1,fontSize:"sm",noOfLines:1,isMobile:ne,hideDiscussionsBadge:!0})}),s.jsx(We,{fontSize:"xs",color:"gray.500",flexShrink:0,whiteSpace:"nowrap",children:(l=t.createdAt,new Date(l).toLocaleDateString("ru-RU",{day:"2-digit",month:"short"}))}),r?s.jsx(We,{color:"gray.400",fontSize:"sm",lineHeight:1,flexShrink:0,"aria-hidden":!0,children:"›"}):ue(t,a,!0)]},a);var l})(i,n,e.length):((e,i,n)=>{var r;const t="folder"===e.kind,a=e.item,l=t?`folder-${a.id}`:`instruction-${a.id}`;return s.jsxs(Se,{templateColumns:Je,gap:3,alignItems:"center",px:4,py:2.5,cursor:"pointer",borderBottom:i<n-1?"1px solid":void 0,borderColor:"gray.100",_hover:{bg:"#FFFFFF"},onClick:()=>t?le(a):de(a),onMouseEnter:()=>ee(l),onMouseLeave:()=>ee(null),children:[t?s.jsx(ye,{w:"18px",h:"18px",flexShrink:0,children:s.jsx(o,{fontSize:"1rem",opacity:.75})}):s.jsx(M,{inst:a,iconMap:Ke,compact:!0}),t?s.jsx(We,{fontSize:"sm",fontWeight:"500",noOfLines:1,minW:0,children:a.name}):s.jsx(y,{inst:a,iconMap:Ke,compact:!0,includeIcon:!1,fontSize:"sm",noOfLines:1,isMobile:ne,hideDiscussionsBadge:!0}),s.jsx(We,{fontSize:"xs",color:"gray.500",textAlign:"right",whiteSpace:"nowrap",children:ce(a.createdAt)}),s.jsx(We,{fontSize:"xs",color:"gray.500",display:{base:"none",lg:"block"},noOfLines:1,children:t?"—":(null==(r=a.author)?void 0:r.name)||"Неизвестно"}),t?s.jsx(De,{w:"28px",h:"28px",flexShrink:0,"aria-hidden":!0}):ue(a,l,!1)]},l)})(i,n,e.length))})})},ge=`${(null==V?void 0:V.name)||"Папка"} — Steppo`,fe=(null==(r=null==V?void 0:V.description)?void 0:r.trim())||`Публичная папка с инструкциями «${(null==V?void 0:V.name)||"Steppo"}»`;return s.jsxs(Ie,{spacing:"1rem",align:"start",w:"100%",maxW:p,mx:"auto",children:[s.jsxs(we,{children:[s.jsx("title",{children:ge}),s.jsx("meta",{name:"description",content:fe}),s.jsx("meta",{name:"robots",content:"index,follow"})]}),s.jsx(Ue,{isMobile:ne,viewMode:Q,onViewModeChange:e=>{Y(e),u(e)},onCopyLink:async()=>{try{await Ce(window.location.href),W({title:"Ссылка скопирована",status:"success",duration:2e3,isClosable:!0})}catch(e){W({title:"Не удалось скопировать ссылку",status:"error",duration:2e3,isClosable:!0})}}}),s.jsxs(Ie,{spacing:2,align:"start",w:"100%",mt:"1rem",mb:"1rem",px:ne?"1rem":void 0,children:[s.jsxs($,{w:"100%",align:"flex-start",ga
1p:3,children:[s.jsx($e,{as:"h1",m:0,flex:"1",minW:0,fontSize:"2xl",fontWeight:"900",children:(null==V?void 0:V.name)||"Название папки"}),s.jsx(x,{value:J,onChange:e=>{X(e),j(e)},isMobile:ne})]}),(null==(z=null==V?void 0:V.description)?void 0:z.trim())&&s.jsx(We,{m:0,w:"100%",wordBreak:"break-word",whiteSpace:"normal",fontSize:".875rem",fontWeight:"500",color:"gray.700",children:V.description.trim()})]}),Q===m.LIST?s.jsx(Te,{w:"100%",children:s.jsxs(Oe,{variant:"simple",size:"md",fontSize:"1rem",children:[s.jsx(Pe,{children:s.jsxs(Ee,{children:[s.jsx(He,{children:"Название"}),s.jsx(He,{children:"Дата создания"}),s.jsx(He,{children:"Автор"}),s.jsx(He,{w:"50px"})]})}),s.jsxs(Ne,{children:[P&&P.map(e=>s.jsxs(Ee,{_hover:{bg:"#FFFFFF"},cursor:"pointer",onClick:()=>le(e),onMouseEnter:()=>ee(`folder-${e.id}`),onMouseLeave:()=>ee(null),children:[s.jsx(Ge,{children:s.jsxs(ze,{spacing:3,children:[s.jsx(ye,{minH:"30px",minW:"30px",children:s.jsx(o,{fontSize:"1rem",opacity:".75"})}),s.jsx(We,{fontWeight:"500",children:e.name})]})}),s.jsx(Ge,{children:ce(e.createdAt)}),s.jsx(Ge,{children:"—"}),s.jsx(Ge,{})]},`folder-${e.id}`)),te&&te.map(e=>{var i;return s.jsxs(Ee,{_hover:{bg:"#FFFFFF"},cursor:"pointer",onClick:()=>de(e),position:"relative",onMouseEnter:()=>ee(`instruction-${e.id}`),onMouseLeave:()=>ee(null),children:[s.jsx(Ge,{children:s.jsx(y,{inst:e,iconMap:Ke,isMobile:ne,hideDiscussionsBadge:!0})}),s.jsx(Ge,{children:ce(e.createdAt)}),s.jsx(Ge,{children:(null==(i=e.author)?void 0:i.name)||"Неизвестно"}),s.jsx(Ge,{children:s.jsx(De,{borderRadius:"99px",bg:"gray.100",p:"6px",opacity:Z===`instruction-${e.id}`||ne?1:0,_hover:{bg:"gray.200"},_active:{transform:"scale(1.1)",bg:"gray.300"},transition:"all .15s ease-in-out",onClick:s=>ae(e,s),cursor:"pointer",children:s.jsx(F,{fontSize:".8rem"})})})]},`instruction-${e.id}`)})]})]})}):Q===m.COMPACT?je():s.jsxs(De,{w:"100%",px:ne?"1rem":void 0,children:[P&&P.length>0&&s.jsx(Se,{templateColumns:oe,gap:6,w:"100%",alignItems:"stretch",pb:0,children:P.map(e=>{var i,n;return s.jsx(Be,{display:"flex",children:pe?s.jsx(v,{folderName:e.name,description:e.description,documentTotal:(null==(i=e._count)?void 0:i.instructions)||0,previewInstructions:e.previewInstructions||[],onClick:()=>le(e)}):s.jsx(S,{folderName:e.name,documentTotal:(null==(n=e._count)?void 0:n.instructions)||0,onClick:()=>le(e)})},e.id)})}),P&&P.length>0&&H&&H.length>0&&s.jsx(L,{my:"20px"}),H&&H.length>0&&s.jsx(De,{w:"100%",pb:"24px",children:s.jsx(C,{items:te,gridTemplateColumns:oe,columnCount:re,renderItem:e=>s.jsx(Qe,{instruction:e,folderId:_,isMobile:ne,onNavigate:de})})})]}),(!P||0===P.length)&&(!H||0===H.length)&&s.jsx(De,{w:"100%",pb:"24px",display:"flex",justifyContent:"center",px:ne?"1rem":void 0,children:s.jsx(h,{showAction:!1,showCreateFolder:!1})})]})};export{Ze 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.