4 lines
69 KiB
JavaScript
4 lines
69 KiB
JavaScript
var _n=Object.defineProperty;var mn=(n,e,t)=>e in n?_n(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ve=(n,e,t)=>mn(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))l(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(i){if(i.ep)return;i.ep=!0;const r=t(i);fetch(i.href,r)}})();function J(){}function tl(n){return n()}function ut(){return Object.create(null)}function re(n){n.forEach(tl)}function ll(n){return typeof n=="function"}function Me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Fe;function Oe(n,e){return n===e?!0:(Fe||(Fe=document.createElement("a")),Fe.href=e,n===Fe.href)}function kn(n){return Object.keys(n).length===0}function vn(n){return n??""}function a(n,e){n.appendChild(e)}function b(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function fe(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function f(n){return document.createElement(n)}function K(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function I(n){return document.createTextNode(n)}function j(){return I(" ")}function de(){return I("")}function F(n,e,t,l){return n.addEventListener(e,t,l),()=>n.removeEventListener(e,t,l)}function me(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function qe(n){return function(e){e.target===this&&n.call(this,e)}}function o(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function nl(n){return n===""?null:+n}function bn(n){return Array.from(n.childNodes)}function U(n,e){e=""+e,n.data!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function at(n,e,t){for(let l=0;l<n.options.length;l+=1){const i=n.options[l];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function hn(n){const e=n.querySelector(":checked");return e&&e.__value}function We(n,e,t){n.classList.toggle(e,!!t)}function wn(n,e,{bubbles:t=!1,cancelable:l=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:l})}let De;function Se(n){De=n}function Ge(){if(!De)throw new Error("Function called outside component initialization");return De}function il(n){Ge().$$.on_mount.push(n)}function sl(n){Ge().$$.on_destroy.push(n)}function Ue(){const n=Ge();return(e,t,{cancelable:l=!1}={})=>{const i=n.$$.callbacks[e];if(i){const r=wn(e,t,{cancelable:l});return i.slice().forEach(s=>{s.call(n,r)}),!r.defaultPrevented}return!0}}function gn(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(l=>l.call(this,e))}const ge=[],ft=[];let ye=[];const dt=[],yn=Promise.resolve();let Ke=!1;function jn(){Ke||(Ke=!0,yn.then(rl))}function Ie(n){ye.push(n)}const Re=new Set;let we=0;function rl(){if(we!==0)return;const n=De;do{try{for(;we<ge.length;){const e=ge[we];we++,Se(e),Cn(e.$$)}}catch(e){throw ge.length=0,we=0,e}for(Se(null),ge.length=0,we=0;ft.length;)ft.pop()();for(let e=0;e<ye.length;e+=1){const t=ye[e];Re.has(t)||(Re.add(t),t())}ye.length=0}while(ge.length);for(;dt.length;)dt.pop()();Ke=!1,Re.clear(),Se(n)}function Cn(n){if(n.fragment!==null){n.update(),re(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ie)}}function Sn(n){const e=[],t=[];ye.forEach(l=>n.indexOf(l)===-1?e.push(l):t.push(l)),t.forEach(l=>l()),ye=e}const Le=new Set;let _e;function ke(){_e={r:0,c:[],p:_e}}function ve(){_e.r||re(_e.c),_e=_e.p}function ne(n,e){n&&n.i&&(Le.delete(n),n.i(e))}function ie(n,e,t,l){if(n&&n.o){if(Le.has(n))return;Le.add(n),_e.c.push(()=>{Le.delete(n),l&&(t&&n.d(1),l())}),n.o(e)}else l&&l()}function te(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Dn(n,e){ie(n,1,1,()=>{e.delete(n.key)})}function Mn(n,e,t,l,i,r,s,u,c,d,m,h){let _=n.length,v=r.length,w=_;const g={};for(;w--;)g[n[w].key]=w;const y=[],M=new Map,W=new Map,q=[];for(w=v;w--;){const E=h(i,r,w),L=t(E);let C=s.get(L);C?q.push(()=>C.p(E,e)):(C=d(L,E),C.c()),M.set(L,y[w]=C),L in g&&W.set(L,Math.abs(w-g[L]))}const O=new Set,P=new Set;function T(E){ne(E,1),E.m(u,m),s.set(E.key,E),m=E.first,v--}for(;_&&v;){const E=y[v-1],L=n[_-1],C=E.key,N=L.key;E===L?(m=E.first,_--,v--):M.has(N)?!s.has(C)||O.has(C)?T(E):P.has(N)?_--:W.get(C)>W.get(N)?(P.add(C),T(E)):(O.add(N),_--):(c(L,s),_--)}for(;_--;){const E=n[_];M.has(E.key)||c(E,s)}for(;v;)T(y[v-1]);return re(q),y}function je(n){n&&n.c()}function be(n,e,t){const{fragment:l,after_update:i}=n.$$;l&&l.m(e,t),Ie(()=>{const r=n.$$.on_mount.map(tl).filter(ll);n.$$.on_destroy?n.$$.on_destroy.push(...r):re(r),n.$$.on_mount=[]}),i.forEach(Ie)}function he(n,e){const t=n.$$;t.fragment!==null&&(Sn(t.after_update),re(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Nn(n,e){n.$$.dirty[0]===-1&&(ge.push(n),jn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ne(n,e,t,l,i,r,s=null,u=[-1]){const c=De;Se(n);const d=n.$$={fragment:null,ctx:[],props:r,update:J,not_equal:i,bound:ut(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:ut(),dirty:u,skip_bound:!1,root:e.target||c.$$.root};s&&s(d.root);let m=!1;if(d.ctx=t?t(n,e.props||{},(h,_,...v)=>{const w=v.length?v[0]:_;return d.ctx&&i(d.ctx[h],d.ctx[h]=w)&&(!d.skip_bound&&d.bound[h]&&d.bound[h](w),m&&Nn(n,h)),_}):[],d.update(),m=!0,re(d.before_update),d.fragment=l?l(d.ctx):!1,e.target){if(e.hydrate){const h=bn(e.target);d.fragment&&d.fragment.l(h),h.forEach(k)}else d.fragment&&d.fragment.c();e.intro&&ne(n.$$.fragment),be(n,e.target,e.anchor),rl()}Se(c)}class Ee{constructor(){Ve(this,"$$");Ve(this,"$$set")}$destroy(){he(this,1),this.$destroy=J}$on(e,t){if(!ll(t))return J;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(t),()=>{const i=l.indexOf(t);i!==-1&&l.splice(i,1)}}$set(e){this.$$set&&!kn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const En="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(En);function Fn(n){let e,t;return{c(){e=K("path"),t=K("polyline"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8")},m(l,i){b(l,e,i),b(l,t,i)},d(l){l&&(k(e),k(t))}}}function Ln(n){let e,t,l,i,r;return{c(){e=K("path"),t=K("polyline"),l=K("line"),i=K("line"),r=K("polyline"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","16"),o(l,"y1","13"),o(l,"x2","8"),o(l,"y2","13"),o(i,"x1","16"),o(i,"y1","17"),o(i,"x2","8"),o(i,"y2","17"),o(r,"points","10 9 9 9 8 9")},m(s,u){b(s,e,u),b(s,t,u),b(s,l,u),b(s,i,u),b(s,r,u)},d(s){s&&(k(e),k(t),k(l),k(i),k(r))}}}function On(n){let e,t;return{c(){e=K("polyline"),t=K("polyline"),o(e,"points","16 18 22 12 16 6"),o(t,"points","8 6 2 12 8 18")},m(l,i){b(l,e,i),b(l,t,i)},d(l){l&&(k(e),k(t))}}}function In(n){let e,t,l,i;return{c(){e=K("path"),t=K("polyline"),l=K("line"),i=K("rect"),o(e,"d","M21 8v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8"),o(t,"points","7 3 12 8 17 3"),o(l,"x1","3"),o(l,"y1","8"),o(l,"x2","21"),o(l,"y2","8"),o(i,"x","10"),o(i,"y","12"),o(i,"width","4"),o(i,"height","4"),o(i,"rx","1")},m(r,s){b(r,e,s),b(r,t,s),b(r,l,s),b(r,i,s)},d(r){r&&(k(e),k(t),k(l),k(i))}}}function Tn(n){let e,t,l,i,r;return{c(){e=K("path"),t=K("polyline"),l=K("line"),i=K("line"),r=K("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","9"),o(l,"y1","12"),o(l,"x2","15"),o(l,"y2","12"),o(i,"x1","9"),o(i,"y1","15"),o(i,"x2","13"),o(i,"y2","15"),o(r,"x1","12"),o(r,"y1","15"),o(r,"x2","12"),o(r,"y2","18")},m(s,u){b(s,e,u),b(s,t,u),b(s,l,u),b(s,i,u),b(s,r,u)},d(s){s&&(k(e),k(t),k(l),k(i),k(r))}}}function Pn(n){let e,t,l,i,r,s;return{c(){e=K("path"),t=K("polyline"),l=K("line"),i=K("line"),r=K("line"),s=K("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","8"),o(l,"y1","12"),o(l,"x2","16"),o(l,"y2","12"),o(i,"x1","8"),o(i,"y1","16"),o(i,"x2","16"),o(i,"y2","16"),o(r,"x1","8"),o(r,"y1","14"),o(r,"x2","12"),o(r,"y2","14"),o(s,"x1","12"),o(s,"y1","12"),o(s,"x2","12"),o(s,"y2","18")},m(u,c){b(u,e,c),b(u,t,c),b(u,l,c),b(u,i,c),b(u,r,c),b(u,s,c)},d(u){u&&(k(e),k(t),k(l),k(i),k(r),k(s))}}}function An(n){let e,t,l,i;return{c(){e=K("path"),t=K("polyline"),l=K("line"),i=K("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","16"),o(l,"y1","13"),o(l,"x2","8"),o(l,"y2","13"),o(i,"x1","16"),o(i,"y1","17"),o(i,"x2","8"),o(i,"y2","17")},m(r,s){b(r,e,s),b(r,t,s),b(r,l,s),b(r,i,s)},d(r){r&&(k(e),k(t),k(l),k(i))}}}function zn(n){let e,t,l,i,r;return{c(){e=K("path"),t=K("polyline"),l=K("line"),i=K("line"),r=K("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","8"),o(l,"y1","12"),o(l,"x2","16"),o(l,"y2","12"),o(i,"x1","8"),o(i,"y1","16"),o(i,"x2","16"),o(i,"y2","16"),o(r,"x1","8"),o(r,"y1","14"),o(r,"x2","12"),o(r,"y2","14")},m(s,u){b(s,e,u),b(s,t,u),b(s,l,u),b(s,i,u),b(s,r,u)},d(s){s&&(k(e),k(t),k(l),k(i),k(r))}}}function Bn(n){let e,t,l;return{c(){e=K("path"),t=K("circle"),l=K("circle"),o(e,"d","M9 18V5l12-2v13"),o(t,"cx","6"),o(t,"cy","18"),o(t,"r","3"),o(l,"cx","18"),o(l,"cy","16"),o(l,"r","3")},m(i,r){b(i,e,r),b(i,t,r),b(i,l,r)},d(i){i&&(k(e),k(t),k(l))}}}function Hn(n){let e,t;return{c(){e=K("rect"),t=K("polyline"),o(e,"x","2"),o(e,"y","4"),o(e,"width","20"),o(e,"height","16"),o(e,"rx","2"),o(t,"points","10 9 16 12 10 15 10 9")},m(l,i){b(l,e,i),b(l,t,i)},d(l){l&&(k(e),k(t))}}}function Vn(n){let e,t,l;return{c(){e=K("rect"),t=K("circle"),l=K("polyline"),o(e,"x","3"),o(e,"y","3"),o(e,"width","18"),o(e,"height","18"),o(e,"rx","2"),o(e,"ry","2"),o(t,"cx","8.5"),o(t,"cy","8.5"),o(t,"r","1.5"),o(l,"points","21 15 16 10 5 21")},m(i,r){b(i,e,r),b(i,t,r),b(i,l,r)},d(i){i&&(k(e),k(t),k(l))}}}function Wn(n){let e;return{c(){e=K("path"),o(e,"d","M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z")},m(t,l){b(t,e,l)},d(t){t&&k(e)}}}function Rn(n){let e;function t(r,s){return r[0]==="folder"?Wn:r[0]==="image"?Vn:r[0]==="video"?Hn:r[0]==="audio"?Bn:r[0]==="pdf"?zn:r[0]==="document"?An:r[0]==="spreadsheet"?Pn:r[0]==="presentation"?Tn:r[0]==="archive"?In:r[0]==="code"?On:r[0]==="text"?Ln:Fn}let l=t(n),i=l(n);return{c(){e=K("svg"),i.c(),o(e,"width",n[1]),o(e,"height",n[1]),o(e,"viewBox","0 0 24 24"),o(e,"fill","none"),o(e,"stroke","currentColor"),o(e,"stroke-width","1.5"),o(e,"stroke-linecap","round"),o(e,"stroke-linejoin","round"),o(e,"xmlns","http://www.w3.org/2000/svg")},m(r,s){b(r,e,s),i.m(e,null)},p(r,[s]){l!==(l=t(r))&&(i.d(1),i=l(r),i&&(i.c(),i.m(e,null))),s&2&&o(e,"width",r[1]),s&2&&o(e,"height",r[1])},i:J,o:J,d(r){r&&k(e),i.d()}}}function Kn(n,e,t){let{kind:l="generic"}=e,{size:i=20}=e;return n.$$set=r=>{"kind"in r&&t(0,l=r.kind),"size"in r&&t(1,i=r.size)},[l,i]}class ol extends Ee{constructor(e){super(),Ne(this,e,Kn,Rn,Me,{kind:0,size:1})}}function Te(n){if(n==null||n<0)return"—";if(n===0)return"0 B";const e=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(n)/Math.log(1024)),e.length-1),l=n/Math.pow(1024,t);return(t===0?l.toFixed(0):l.toFixed(1))+" "+e[t]}const qn={"image/jpeg":"JPEG image","image/png":"PNG image","image/gif":"GIF image","image/webp":"WebP image","image/svg+xml":"SVG image","image/bmp":"BMP image","image/tiff":"TIFF image","image/avif":"AVIF image","application/pdf":"PDF document","application/msword":"Word document","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"Word document","application/vnd.ms-excel":"Excel spreadsheet","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"Excel spreadsheet","application/vnd.ms-powerpoint":"PowerPoint presentation","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PowerPoint presentation","application/zip":"ZIP archive","application/gzip":"GZIP archive","application/x-tar":"TAR archive","application/x-7z-compressed":"7z archive","application/x-rar-compressed":"RAR archive","text/plain":"Text file","text/html":"HTML file","text/css":"CSS file","text/javascript":"JavaScript file","application/json":"JSON file","application/xml":"XML file","application/x-yaml":"YAML file","application/octet-stream":"Binary file","application/x-msdos-program":"Executable","inode/directory":"Folder"};function Pe(n){return n?qn[n]||n:"Unknown"}function cl(n){if(n.type==="folder")return"folder";const e=(n.mime||"").toLowerCase();if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";if(e.startsWith("text/"))return"text";if(e.includes("pdf"))return"pdf";if(e.includes("word")||e.includes("document"))return"document";if(e.includes("spreadsheet")||e.includes("excel"))return"spreadsheet";if(e.includes("presentation")||e.includes("powerpoint"))return"presentation";if(e.includes("zip")||e.includes("tar")||e.includes("gzip")||e.includes("rar")||e.includes("7z")||e.includes("compress"))return"archive";if(e.includes("json")||e.includes("xml")||e.includes("yaml")||e.includes("javascript")||e.includes("css")||e.includes("html"))return"code";const l=(n.name||"").toLowerCase().split(".").pop();return["js","ts","jsx","tsx","vue","svelte","py","rs","go","c","cpp","h","hpp","java","kt","swift","rb","php","pl","sh","bash","zsh","fish","yml","yaml","json","xml","toml","ini","cfg","conf","md","markdown","css","scss","less","sass","sql","graphql","proto","gradle","cmake","makefile","dockerfile","env","gitignore"].includes(l)?"code":"generic"}const Gn=["image/jpeg","image/png","image/gif","image/webp","image/bmp","image/tiff","image/avif","image/svg+xml"],Un=["text/plain","text/html","text/css","text/javascript","application/json","application/xml","application/x-yaml","text/x-shellscript"],Jn=["txt","log","conf","ini","yaml","yml","json","xml","csv","sh","py","js","ts","css","html","md","markdown","cfg"],Xn=["jpg","jpeg","png","gif","webp","bmp","tiff","tif","avif","svg"];function ul(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Gn.includes(e)||Xn.includes(l)}function al(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Un.includes(e)||Jn.includes(l)&&l!=="md"&&l!=="markdown"}function fl(n){return(n.mime||"").toLowerCase().includes("pdf")}function dl(n){const e=(n.name||"").toLowerCase();return e.endsWith(".md")||e.endsWith(".markdown")}function Zn(n){return ul(n)||fl(n)}function Yn(n){return al(n)||dl(n)}function Qn(n){let e,t=Te(n[0].size)+"",l,i,r,s=n[0].mime&&pt(n);return{c(){e=f("span"),l=I(t),i=j(),s&&s.c(),r=de()},m(u,c){b(u,e,c),a(e,l),b(u,i,c),s&&s.m(u,c),b(u,r,c)},p(u,c){c&1&&t!==(t=Te(u[0].size)+"")&&U(l,t),u[0].mime?s?s.p(u,c):(s=pt(u),s.c(),s.m(r.parentNode,r)):s&&(s.d(1),s=null)},d(u){u&&(k(e),k(i),k(r)),s&&s.d(u)}}}function xn(n){let e;return{c(){e=f("span"),e.textContent="Folder"},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function pt(n){let e,t,l,i=Pe(n[0].mime)+"",r;return{c(){e=f("span"),e.textContent="·",t=j(),l=f("span"),r=I(i),o(e,"class","meta-sep svelte-18mry1k")},m(s,u){b(s,e,u),b(s,t,u),b(s,l,u),a(l,r)},p(s,u){u&1&&i!==(i=Pe(s[0].mime)+"")&&U(r,i)},d(s){s&&(k(e),k(t),k(l))}}}function $n(n){let e,t,l;return{c(){e=f("button"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="9" y1="14" x2="15" y2="14"></line></svg>',o(e,"class","action-btn svelte-18mry1k"),o(e,"title","Open folder"),o(e,"aria-label","Open folder")},m(i,r){b(i,e,r),t||(l=F(e,"click",me(n[24])),t=!0)},p:J,d(i){i&&k(e),t=!1,l()}}}function ei(n){let e,t,l,i,r;return{c(){e=f("button"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>',t=j(),l=f("button"),l.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',o(e,"class","action-btn svelte-18mry1k"),o(e,"title","Preview"),o(e,"aria-label","Preview"),o(l,"class","action-btn svelte-18mry1k"),o(l,"title","Open in external program"),o(l,"aria-label","Open externally")},m(s,u){b(s,e,u),b(s,t,u),b(s,l,u),i||(r=[F(e,"click",me(n[23])),F(l,"click",me(n[8]))],i=!0)},p:J,d(s){s&&(k(e),k(t),k(l)),i=!1,re(r)}}}function _t(n){let e,t,l,i,r,s,u,c,d,m,h,_;return{c(){e=f("div"),t=j(),l=f("div"),i=f("button"),i.textContent="Rename",r=j(),s=f("button"),s.textContent="Duplicate",u=j(),c=f("button"),c.textContent="Cut",d=j(),m=f("button"),m.textContent="Copy",o(e,"class","menu-backdrop svelte-18mry1k"),o(e,"role","presentation"),o(i,"class","menu-item svelte-18mry1k"),o(i,"role","menuitem"),o(s,"class","menu-item svelte-18mry1k"),o(s,"role","menuitem"),o(c,"class","menu-item svelte-18mry1k"),o(c,"role","menuitem"),o(m,"class","menu-item svelte-18mry1k"),o(m,"role","menuitem"),o(l,"class","menu svelte-18mry1k"),o(l,"role","menu")},m(v,w){b(v,e,w),b(v,t,w),b(v,l,w),a(l,i),a(l,r),a(l,s),a(l,u),a(l,c),a(l,d),a(l,m),h||(_=[F(e,"click",me(n[15])),F(i,"click",n[10]),F(s,"click",n[11]),F(c,"click",n[12]),F(m,"click",n[13]),F(l,"click",me(n[22]))],h=!0)},p:J,d(v){v&&(k(e),k(t),k(l)),h=!1,re(_)}}}function ti(n){let e,t,l,i,r,s,u=n[0].name+"",c,d,m,h,_,v,w,g,y,M,W,q,O,P,T,E,L,C,N,R;l=new ol({props:{kind:n[4],size:22}});function V(H,A){return H[5]?xn:Qn}let X=V(n)(n);function Y(H,A){return H[5]?$n:ei}let ee=Y(n)(n),x=n[2]&&_t(n);return{c(){e=f("div"),t=f("div"),je(l.$$.fragment),i=j(),r=f("div"),s=f("div"),c=I(u),m=j(),h=f("div"),X.c(),_=j(),v=f("div"),ee.c(),w=j(),g=f("button"),y=K("svg"),M=K("circle"),W=K("circle"),q=K("circle"),O=j(),P=f("button"),P.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>',E=j(),x&&x.c(),L=de(),o(t,"class","file-row-icon svelte-18mry1k"),o(s,"class","file-row-name svelte-18mry1k"),o(s,"title",d=n[0].name),o(h,"class","file-row-meta svelte-18mry1k"),o(r,"class","file-row-body svelte-18mry1k"),o(M,"cx","12"),o(M,"cy","5"),o(M,"r","2"),o(W,"cx","12"),o(W,"cy","12"),o(W,"r","2"),o(q,"cx","12"),o(q,"cy","19"),o(q,"r","2"),o(y,"width","16"),o(y,"height","16"),o(y,"viewBox","0 0 24 24"),o(y,"fill","currentColor"),o(g,"class","action-btn svelte-18mry1k"),o(g,"title","More actions"),o(g,"aria-label","More actions"),o(g,"aria-expanded",n[2]),o(P,"class","action-btn action-btn-danger svelte-18mry1k"),o(P,"title","Delete"),o(P,"aria-label","Delete"),o(v,"class","file-row-actions svelte-18mry1k"),o(e,"class","file-row svelte-18mry1k"),o(e,"role","button"),o(e,"tabindex","0"),o(e,"draggable","true"),o(e,"aria-label",T=n[5]?`Folder ${n[0].name}`:`File ${n[0].name}`),We(e,"file-row--selected",n[1]),We(e,"file-row--dragover",!1)},m(H,A){b(H,e,A),a(e,t),be(l,t,null),a(e,i),a(e,r),a(r,s),a(s,c),a(r,m),a(r,h),X.m(h,null),a(e,_),a(e,v),ee.m(v,null),a(v,w),a(v,g),a(g,y),a(y,M),a(y,W),a(y,q),a(v,O),a(v,P),b(H,E,A),x&&x.m(H,A),b(H,L,A),C=!0,N||(R=[F(window,"click",n[15]),F(g,"click",me(n[14])),F(P,"click",me(n[9])),F(e,"click",n[6]),F(e,"keydown",n[7]),F(e,"dragstart",n[16]),F(e,"dragover",n[17]),F(e,"drop",n[18])],N=!0)},p(H,[A]){(!C||A&1)&&u!==(u=H[0].name+"")&&U(c,u),(!C||A&1&&d!==(d=H[0].name))&&o(s,"title",d),X.p(H,A),ee.p(H,A),(!C||A&4)&&o(g,"aria-expanded",H[2]),(!C||A&1&&T!==(T=H[5]?`Folder ${H[0].name}`:`File ${H[0].name}`))&&o(e,"aria-label",T),(!C||A&2)&&We(e,"file-row--selected",H[1]),H[2]?x?x.p(H,A):(x=_t(H),x.c(),x.m(L.parentNode,L)):x&&(x.d(1),x=null)},i(H){C||(ne(l.$$.fragment,H),C=!0)},o(H){ie(l.$$.fragment,H),C=!1},d(H){H&&(k(e),k(E),k(L)),he(l),X.d(),ee.d(),x&&x.d(H),N=!1,re(R)}}}function li(n,e,t){let{item:l}=e,{selected:i=!1}=e,{onDragStart:r}=e,{onDragOver:s}=e,{onDrop:u}=e;const c=Ue(),d=cl(l),m=l.type==="folder";let h=!1,_=null;function v(B){B.ctrlKey||B.metaKey?c("toggleSelect",l.id):B.shiftKey?c("rangeSelect",l.id):_?(clearTimeout(_),_=null,m?c("navigate",l.id):c("preview",l)):_=setTimeout(()=>{_=null,i?m?c("navigate",l.id):c("preview",l):c("selectOne",l.id)},250)}function w(B){B.key==="Enter"&&(m?c("navigate",l.id):c("preview",l))}function g(){c("openExternal",l.fileId)}function y(){c("delete",{id:l.id,type:l.type})}function M(){t(2,h=!1),c("rename",{id:l.id,name:l.name})}function W(){t(2,h=!1),c("duplicate",l.id)}function q(){t(2,h=!1),c("cut",l.id)}function O(){t(2,h=!1),c("copy",l.id)}function P(){t(2,h=!h)}function T(){t(2,h=!1)}function E(B){r&&r(B,l.id)}function L(B){s&&m&&s(B,l.id)}function C(B){u&&m&&u(B,l.id)}function N(B){gn.call(this,n,B)}const R=()=>c("preview",l),V=()=>c("navigate",l.id);return n.$$set=B=>{"item"in B&&t(0,l=B.item),"selected"in B&&t(1,i=B.selected),"onDragStart"in B&&t(19,r=B.onDragStart),"onDragOver"in B&&t(20,s=B.onDragOver),"onDrop"in B&&t(21,u=B.onDrop)},[l,i,h,c,d,m,v,w,g,y,M,W,q,O,P,T,E,L,C,r,s,u,N,R,V]}class ni extends Ee{constructor(e){super(),Ne(this,e,li,ti,Me,{item:0,selected:1,onDragStart:19,onDragOver:20,onDrop:21})}}function mt(n,e,t){const l=n.slice();return l[4]=e[t],l[6]=t,l}function ii(n){let e;return{c(){e=f("span"),e.textContent="/",o(e,"class","sep svelte-csi2lb")},m(t,l){b(t,e,l)},d(t){t&&k(e)}}}function si(n){let e,t=n[4].name+"",l,i,r;function s(){return n[2](n[6])}return{c(){e=f("button"),l=I(t),o(e,"class","crumb crumb--link svelte-csi2lb")},m(u,c){b(u,e,c),a(e,l),i||(r=F(e,"click",s),i=!0)},p(u,c){n=u,c&1&&t!==(t=n[4].name+"")&&U(l,t)},d(u){u&&k(e),i=!1,r()}}}function ri(n){let e,t=n[4].name+"",l;return{c(){e=f("span"),l=I(t),o(e,"class","crumb crumb--current svelte-csi2lb")},m(i,r){b(i,e,r),a(e,l)},p(i,r){r&1&&t!==(t=i[4].name+"")&&U(l,t)},d(i){i&&k(e)}}}function kt(n){let e,t,l=n[6]>0&&ii();function i(u,c){return u[6]===u[0].length-1?ri:si}let r=i(n),s=r(n);return{c(){l&&l.c(),e=j(),s.c(),t=de()},m(u,c){l&&l.m(u,c),b(u,e,c),s.m(u,c),b(u,t,c)},p(u,c){r===(r=i(u))&&s?s.p(u,c):(s.d(1),s=r(u),s&&(s.c(),s.m(t.parentNode,t)))},d(u){u&&(k(e),k(t)),l&&l.d(u),s.d(u)}}}function oi(n){let e,t=te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=kt(mt(n,t,i));return{c(){e=f("nav");for(let i=0;i<l.length;i+=1)l[i].c();o(e,"class","breadcrumbs svelte-csi2lb")},m(i,r){b(i,e,r);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,[r]){if(r&3){t=te(i[0]);let s;for(s=0;s<t.length;s+=1){const u=mt(i,t,s);l[s]?l[s].p(u,r):(l[s]=kt(u),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},i:J,o:J,d(i){i&&k(e),fe(l,i)}}}function ci(n,e,t){let{crumbs:l=[]}=e;const i=Ue();function r(u){i("navigate",u)}const s=u=>r(u);return n.$$set=u=>{"crumbs"in u&&t(0,l=u.crumbs)},[l,r,s]}class pl extends Ee{constructor(e){super(),Ne(this,e,ci,oi,Me,{crumbs:0})}}function ui(n){let e,t,l,i,r,s;return{c(){e=f("div"),t=f("p"),t.textContent="Preview is not available for this file type.",l=j(),i=f("button"),i.textContent="Open in external program",o(i,"class","btn btn-sm svelte-1ybaoro"),o(e,"class","preview-status svelte-1ybaoro")},m(u,c){b(u,e,c),a(e,t),a(e,l),a(e,i),r||(s=F(i,"click",n[9]),r=!0)},p:J,d(u){u&&k(e),r=!1,s()}}}function ai(n){let e,t;function l(s,u){return u&2&&(e=null),e==null&&(e=!!(s[1]&&s[1].startsWith("data:"))),e?ki:mi}let i=l(n,-1),r=i(n);return{c(){r.c(),t=de()},m(s,u){r.m(s,u),b(s,t,u)},p(s,u){i===(i=l(s,u))&&r?r.p(s,u):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&k(t),r.d(s)}}}function fi(n){let e,t,l;return{c(){e=f("pre"),t=f("code"),l=I(n[1]),o(e,"class","preview-text svelte-1ybaoro")},m(i,r){b(i,e,r),a(e,t),a(t,l)},p(i,r){r&2&&U(l,i[1])},d(i){i&&k(e)}}}function di(n){let e,t,l,i;return{c(){e=f("div"),t=f("img"),Oe(t.src,l=n[1])||o(t,"src",l),o(t,"alt",i=n[0].name),o(t,"class","preview-image svelte-1ybaoro"),o(e,"class","preview-image-container svelte-1ybaoro")},m(r,s){b(r,e,s),a(e,t)},p(r,s){s&2&&!Oe(t.src,l=r[1])&&o(t,"src",l),s&1&&i!==(i=r[0].name)&&o(t,"alt",i)},d(r){r&&k(e)}}}function pi(n){let e,t,l,i,r,s,u;return{c(){e=f("div"),t=f("p"),l=I(n[3]),i=j(),r=f("button"),r.textContent="Open in external program",o(r,"class","btn btn-sm svelte-1ybaoro"),o(e,"class","preview-status svelte-1ybaoro")},m(c,d){b(c,e,d),a(e,t),a(t,l),a(e,i),a(e,r),s||(u=F(r,"click",n[9]),s=!0)},p(c,d){d&8&&U(l,c[3])},d(c){c&&k(e),s=!1,u()}}}function _i(n){let e;return{c(){e=f("div"),e.innerHTML="<p>Loading preview...</p>",o(e,"class","preview-status svelte-1ybaoro")},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function mi(n){let e,t,l,i,r,s;return{c(){e=f("div"),t=f("p"),t.textContent="PDF preview is not available in this environment.",l=j(),i=f("button"),i.textContent="Open in external program",o(i,"class","btn btn-sm svelte-1ybaoro"),o(e,"class","preview-status svelte-1ybaoro")},m(u,c){b(u,e,c),a(e,t),a(e,l),a(e,i),r||(s=F(i,"click",n[9]),r=!0)},p:J,d(u){u&&k(e),r=!1,s()}}}function ki(n){let e,t,l;return{c(){e=f("div"),t=f("embed"),Oe(t.src,l=n[1])||o(t,"src",l),o(t,"type","application/pdf"),o(t,"class","preview-pdf svelte-1ybaoro"),o(e,"class","preview-pdf-container svelte-1ybaoro")},m(i,r){b(i,e,r),a(e,t)},p(i,r){r&2&&!Oe(t.src,l=i[1])&&o(t,"src",l)},d(i){i&&k(e)}}}function vi(n){let e,t,l,i,r,s,u,c=n[0].name+"",d,m,h,_,v=Te(n[0].size)+"",w,g,y=Pe(n[0].mime)+"",M,W,q,O,P,T,E,L,C,N,R,V;r=new ol({props:{kind:n[8],size:18}});function B(z,ee){return z[2]?_i:z[3]?pi:z[6]&&z[1]?di:z[5]&&z[1]?fi:z[4]?ai:ui}let X=B(n),Y=X(n);return{c(){e=f("div"),t=f("div"),l=f("header"),i=f("div"),je(r.$$.fragment),s=j(),u=f("span"),d=I(c),h=j(),_=f("div"),w=I(v),g=I(" · "),M=I(y),W=j(),q=f("div"),O=f("button"),O.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',P=j(),T=f("button"),T.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',E=j(),L=f("div"),Y.c(),o(u,"class","preview-name svelte-1ybaoro"),o(u,"title",m=n[0].name),o(i,"class","preview-title svelte-1ybaoro"),o(_,"class","preview-meta svelte-1ybaoro"),o(O,"class","action-btn svelte-1ybaoro"),o(O,"title","Open in external program"),o(O,"aria-label","Open externally"),o(T,"class","action-btn svelte-1ybaoro"),o(T,"title","Close"),o(T,"aria-label","Close preview"),o(q,"class","preview-actions svelte-1ybaoro"),o(l,"class","preview-header svelte-1ybaoro"),o(L,"class","preview-body svelte-1ybaoro"),o(t,"class","modal svelte-1ybaoro"),o(e,"class","overlay svelte-1ybaoro"),o(e,"role","dialog"),o(e,"aria-modal","true"),o(e,"aria-label",C=`Preview: ${n[0].name}`)},m(z,ee){b(z,e,ee),a(e,t),a(t,l),a(l,i),be(r,i,null),a(i,s),a(i,u),a(u,d),a(l,h),a(l,_),a(_,w),a(_,g),a(_,M),a(l,W),a(l,q),a(q,O),a(q,P),a(q,T),a(t,E),a(t,L),Y.m(L,null),N=!0,R||(V=[F(O,"click",n[9]),F(T,"click",n[10]),F(e,"click",qe(n[11]))],R=!0)},p(z,[ee]){(!N||ee&1)&&c!==(c=z[0].name+"")&&U(d,c),(!N||ee&1&&m!==(m=z[0].name))&&o(u,"title",m),(!N||ee&1)&&v!==(v=Te(z[0].size)+"")&&U(w,v),(!N||ee&1)&&y!==(y=Pe(z[0].mime)+"")&&U(M,y),X===(X=B(z))&&Y?Y.p(z,ee):(Y.d(1),Y=X(z),Y&&(Y.c(),Y.m(L,null))),(!N||ee&1&&C!==(C=`Preview: ${z[0].name}`))&&o(e,"aria-label",C)},i(z){N||(ne(r.$$.fragment,z),N=!0)},o(z){ie(r.$$.fragment,z),N=!1},d(z){z&&k(e),he(r),Y.d(),R=!1,re(V)}}}function bi(n,e,t){let l,i,r,{item:s}=e,{content:u=""}=e,{loading:c=!1}=e,{error:d=""}=e;const m=Ue(),h=cl(s);function _(y){y.key==="Escape"&&m("close")}function v(){m("openExternal",s.fileId)}il(()=>{window.addEventListener("keydown",_)}),sl(()=>{window.removeEventListener("keydown",_)});const w=()=>m("close"),g=()=>m("close");return n.$$set=y=>{"item"in y&&t(0,s=y.item),"content"in y&&t(1,u=y.content),"loading"in y&&t(2,c=y.loading),"error"in y&&t(3,d=y.error)},n.$$.update=()=>{n.$$.dirty&3&&t(6,l=ul(s)&&u&&u.startsWith("data:")),n.$$.dirty&1&&t(5,i=al(s)||dl(s)),n.$$.dirty&1&&t(4,r=fl(s))},[s,u,c,d,r,i,l,m,h,v,w,g]}class hi extends Ee{constructor(e){super(),Ne(this,e,bi,vi,Me,{item:0,content:1,loading:2,error:3})}}function vt(n,e,t){const l=n.slice();return l[121]=e[t],l}function bt(n,e,t){const l=n.slice();return l[124]=e[t],l}function ht(n,e,t){const l=n.slice();return l[135]=e[t],l}function wt(n,e,t){const l=n.slice();return l[132]=e[t],l}function gt(n,e,t){const l=n.slice();return l[127]=e[t],l}function yt(n,e,t){const l=n.slice();return l[124]=e[t],l}function jt(n,e,t){const l=n.slice();return l[127]=e[t],l}function Ct(n,e,t){const l=n.slice();return l[140]=e[t],l}function St(n,e,t){const l=n.slice();return l[121]=e[t],l}function Dt(n,e,t){const l=n.slice();return l[145]=e[t],l}function Mt(n,e,t){const l=n.slice();return l[148]=e[t],l}function Nt(n){let e,t=n[148].label+"",l,i,r,s,u;function c(){return n[69](n[148])}return{c(){e=f("button"),l=I(t),i=j(),o(e,"class",r="nav-item "+(n[4]===n[148].id?"selected":"")+" svelte-1rwjkun")},m(d,m){b(d,e,m),a(e,l),a(e,i),s||(u=F(e,"click",c),s=!0)},p(d,m){n=d,m[0]&1&&t!==(t=n[148].label+"")&&U(l,t),m[0]&17&&r!==(r="nav-item "+(n[4]===n[148].id?"selected":"")+" svelte-1rwjkun")&&o(e,"class",r)},d(d){d&&k(e),s=!1,u()}}}function Et(n){let e,t,l,i,r,s=n[1].length>0&&Ft(n),u=te(n[1]),c=[];for(let m=0;m<u.length;m+=1)c[m]=Lt(Dt(n,u,m));let d=n[1].length===0&&Ot();return{c(){e=f("div"),t=f("div"),l=I("Дела "),s&&s.c(),i=j();for(let m=0;m<c.length;m+=1)c[m].c();r=j(),d&&d.c(),o(t,"class","nav-label svelte-1rwjkun"),o(e,"class","nav-group svelte-1rwjkun")},m(m,h){b(m,e,h),a(e,t),a(t,l),s&&s.m(t,null),a(e,i);for(let _=0;_<c.length;_+=1)c[_]&&c[_].m(e,null);a(e,r),d&&d.m(e,null)},p(m,h){if(m[1].length>0?s?s.p(m,h):(s=Ft(m),s.c(),s.m(t,null)):s&&(s.d(1),s=null),h[0]&34|h[1]&8){u=te(m[1]);let _;for(_=0;_<u.length;_+=1){const v=Dt(m,u,_);c[_]?c[_].p(v,h):(c[_]=Lt(v),c[_].c(),c[_].m(e,r))}for(;_<c.length;_+=1)c[_].d(1);c.length=u.length}m[1].length===0?d||(d=Ot(),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},d(m){m&&k(e),s&&s.d(),fe(c,m),d&&d.d()}}}function Ft(n){let e,t=n[1].length+"",l,i;return{c(){e=I("("),l=I(t),i=I(")")},m(r,s){b(r,e,s),b(r,l,s),b(r,i,s)},p(r,s){s[0]&2&&t!==(t=r[1].length+"")&&U(l,t)},d(r){r&&(k(e),k(l),k(i))}}}function Lt(n){let e,t=n[145].title+"",l,i,r,s;function u(){return n[70](n[145])}return{c(){e=f("button"),l=I(t),o(e,"class",i="nav-item "+(n[5]&&n[5].id===n[145].id?"selected":"")+" svelte-1rwjkun")},m(c,d){b(c,e,d),a(e,l),r||(s=F(e,"click",u),r=!0)},p(c,d){n=c,d[0]&2&&t!==(t=n[145].title+"")&&U(l,t),d[0]&34&&i!==(i="nav-item "+(n[5]&&n[5].id===n[145].id?"selected":"")+" svelte-1rwjkun")&&o(e,"class",i)},d(c){c&&k(e),r=!1,s()}}}function Ot(n){let e;return{c(){e=f("div"),e.textContent="Нет дел",o(e,"class","nav-empty svelte-1rwjkun")},m(t,l){b(t,e,l)},d(t){t&&k(e)}}}function wi(n){let e;return{c(){e=f("span"),e.textContent="Выберите раздел или дело",o(e,"class","crumb placeholder svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function gi(n){let e,t=te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=It(St(n,t,i));return{c(){e=f("span");for(let i=0;i<l.length;i+=1)l[i].c();o(e,"class","crumb svelte-1rwjkun")},m(i,r){b(i,e,r);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,r){if(r[0]&17){t=te(i[0]);let s;for(s=0;s<t.length;s+=1){const u=St(i,t,s);l[s]?l[s].p(u,r):(l[s]=It(u),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&k(e),fe(l,i)}}}function yi(n){let e,t=n[5].title+"",l,i,r,s=n[5].type+"",u;return{c(){e=f("span"),l=I(t),i=j(),r=f("span"),u=I(s),o(e,"class","crumb svelte-1rwjkun"),o(r,"class","crumb-type svelte-1rwjkun")},m(c,d){b(c,e,d),a(e,l),b(c,i,d),b(c,r,d),a(r,u)},p(c,d){d[0]&32&&t!==(t=c[5].title+"")&&U(l,t),d[0]&32&&s!==(s=c[5].type+"")&&U(u,s)},d(c){c&&(k(e),k(i),k(r))}}}function It(n){let e=(n[121].id===n[4]?n[121].label:"")+"",t;return{c(){t=I(e)},m(l,i){b(l,t,i)},p(l,i){i[0]&17&&e!==(e=(l[121].id===l[4]?l[121].label:"")+"")&&U(t,e)},d(l){l&&k(t)}}}function Tt(n){let e,t,l,i,r,s;return{c(){e=f("div"),t=I(n[3]),l=j(),i=f("span"),i.textContent="✕",o(i,"class","dismiss svelte-1rwjkun"),o(e,"class","error-banner svelte-1rwjkun")},m(u,c){b(u,e,c),a(e,t),a(e,l),a(e,i),r||(s=F(e,"click",n[71]),r=!0)},p(u,c){c[0]&8&&U(t,u[3])},d(u){u&&k(e),r=!1,s()}}}function ji(n){let e,t,l;function i(u,c){if(u[18])return Ni;if(u[0].length>0)return Mi;if(u[3])return Di}let r=i(n),s=r&&r(n);return{c(){e=f("div"),t=f("h2"),t.textContent="Верстак",l=j(),s&&s.c(),o(t,"class","svelte-1rwjkun"),o(e,"class","welcome svelte-1rwjkun")},m(u,c){b(u,e,c),a(e,t),a(e,l),s&&s.m(e,null)},p(u,c){r===(r=i(u))&&s?s.p(u,c):(s&&s.d(1),s=r&&r(u),s&&(s.c(),s.m(e,null)))},i:J,o:J,d(u){u&&k(e),s&&s.d()}}}function Ci(n){let e,t,l,i,r,s,u=te(n[32]),c=[];for(let _=0;_<u.length;_+=1)c[_]=Pt(Ct(n,u,_));const d=[Ti,Ii,Oi,Li,Fi,Ei],m=[];function h(_,v){return _[6]==="overview"?0:_[6]==="notes"?1:_[6]==="files"?2:_[6]==="actions"?3:_[6]==="worklog"?4:_[6]==="activity"?5:-1}return~(i=h(n))&&(r=m[i]=d[i](n)),{c(){e=f("div");for(let _=0;_<c.length;_+=1)c[_].c();t=j(),l=f("div"),r&&r.c(),o(e,"class","tabs svelte-1rwjkun"),o(l,"class","tab-content svelte-1rwjkun")},m(_,v){b(_,e,v);for(let w=0;w<c.length;w+=1)c[w]&&c[w].m(e,null);b(_,t,v),b(_,l,v),~i&&m[i].m(l,null),s=!0},p(_,v){if(v[0]&41943136|v[1]&18|v[2]&64){u=te(_[32]);let g;for(g=0;g<u.length;g+=1){const y=Ct(_,u,g);c[g]?c[g].p(y,v):(c[g]=Pt(y),c[g].c(),c[g].m(e,null))}for(;g<c.length;g+=1)c[g].d(1);c.length=u.length}let w=i;i=h(_),i===w?~i&&m[i].p(_,v):(r&&(ke(),ie(m[w],1,1,()=>{m[w]=null}),ve()),~i?(r=m[i],r?r.p(_,v):(r=m[i]=d[i](_),r.c()),ne(r,1),r.m(l,null)):r=null)},i(_){s||(ne(r),s=!0)},o(_){ie(r),s=!1},d(_){_&&(k(e),k(t),k(l)),fe(c,_),~i&&m[i].d()}}}function Si(n){let e,t,l,i=n[8].title+"",r,s,u,c,d,m,h,_,v,w,g,y=n[8].dirty&&Xt();return{c(){e=f("div"),t=f("div"),l=f("span"),r=I(i),s=j(),y&&y.c(),u=j(),c=f("div"),d=f("button"),d.textContent="Сохранить",m=j(),h=f("button"),h.textContent="Закрыть",_=j(),v=f("textarea"),o(l,"class","note-title svelte-1rwjkun"),o(d,"class","btn btn-primary svelte-1rwjkun"),o(h,"class","btn svelte-1rwjkun"),o(c,"class","note-editor-actions svelte-1rwjkun"),o(t,"class","note-editor-header svelte-1rwjkun"),o(v,"class","note-textarea svelte-1rwjkun"),o(v,"placeholder","Начните писать..."),o(e,"class","note-editor svelte-1rwjkun")},m(M,W){b(M,e,W),a(e,t),a(t,l),a(l,r),a(t,s),y&&y.m(t,null),a(t,u),a(t,c),a(c,d),a(c,m),a(c,h),a(e,_),a(e,v),ue(v,n[8].content),w||(g=[F(d,"click",n[61]),F(h,"click",n[59]),F(v,"input",n[72]),F(v,"input",n[60])],w=!0)},p(M,W){W[0]&256&&i!==(i=M[8].title+"")&&U(r,i),M[8].dirty?y||(y=Xt(),y.c(),y.m(t,u)):y&&(y.d(1),y=null),W[0]&256&&ue(v,M[8].content)},i:J,o:J,d(M){M&&k(e),y&&y.d(),w=!1,re(g)}}}function Di(n){let e,t,l;return{c(){e=f("p"),t=I("Ошибка: "),l=I(n[3]),o(e,"class","error-text svelte-1rwjkun")},m(i,r){b(i,e,r),a(e,t),a(e,l)},p(i,r){r[0]&8&&U(l,i[3])},d(i){i&&k(e)}}}function Mi(n){let e,t,l;return{c(){e=f("p"),e.textContent="Выберите раздел в боковой панели.",t=j(),l=f("p"),l.textContent="Или создайте новое дело кнопкой «+».",o(e,"class","svelte-1rwjkun"),o(l,"class","hint svelte-1rwjkun")},m(i,r){b(i,e,r),b(i,t,r),b(i,l,r)},p:J,d(i){i&&(k(e),k(t),k(l))}}}function Ni(n){let e;return{c(){e=f("p"),e.textContent="Загрузка...",o(e,"class","svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function Pt(n){let e,t=n[140].label+"",l,i,r;function s(){return n[73](n[140])}return{c(){e=f("button"),l=I(t),o(e,"class",vn(n[68](n[140].id))+" svelte-1rwjkun")},m(u,c){b(u,e,c),a(e,l),i||(r=F(e,"click",s),i=!0)},p(u,c){n=u},d(u){u&&k(e),i=!1,r()}}}function Ei(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Активность появится позже</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,i:J,o:J,d(t){t&&k(e)}}}function Fi(n){let e,t,l,i,r,s,u,c,d,m,h,_;function v(y,M){return y[10].length===0?Ai:Pi}let w=v(n),g=w(n);return{c(){e=f("div"),t=f("div"),l=f("input"),i=j(),r=f("input"),s=j(),u=f("button"),c=I("Записать"),m=j(),g.c(),o(l,"type","text"),o(l,"placeholder","Что сделано"),o(l,"class","svelte-1rwjkun"),o(r,"type","number"),o(r,"placeholder","Мин"),o(r,"min","1"),o(r,"class","svelte-1rwjkun"),o(u,"class","btn btn-primary svelte-1rwjkun"),u.disabled=d=!n[12].trim()||!n[11],o(t,"class","worklog-form svelte-1rwjkun"),o(e,"class","worklog-tab svelte-1rwjkun")},m(y,M){b(y,e,M),a(e,t),a(t,l),ue(l,n[12]),a(t,i),a(t,r),ue(r,n[11]),a(t,s),a(t,u),a(u,c),a(e,m),g.m(e,null),h||(_=[F(l,"input",n[94]),F(r,"input",n[95]),F(u,"click",n[62])],h=!0)},p(y,M){M[0]&4096&&l.value!==y[12]&&ue(l,y[12]),M[0]&2048&&nl(r.value)!==y[11]&&ue(r,y[11]),M[0]&6144&&d!==(d=!y[12].trim()||!y[11])&&(u.disabled=d),w===(w=v(y))&&g?g.p(y,M):(g.d(1),g=w(y),g&&(g.c(),g.m(e,null)))},i:J,o:J,d(y){y&&k(e),g.d(),h=!1,re(_)}}}function Li(n){let e;function t(r,s){return r[9].length===0?Bi:zi}let l=t(n),i=l(n);return{c(){i.c(),e=de()},m(r,s){i.m(r,s),b(r,e,s)},p(r,s){l===(l=t(r))&&i?i.p(r,s):(i.d(1),i=l(r),i&&(i.c(),i.m(e.parentNode,e)))},i:J,o:J,d(r){r&&k(e),i.d(r)}}}function Oi(n){let e,t,l,i,r,s,u,c,d,m,h,_,v,w,g,y,M,W,q,O=n[30].items.length>0&&Bt(n);const P=[Vi,Hi],T=[];function E(N,R){return N[22]?0:1}_=E(n),v=T[_]=P[_](n);let L=n[19]&&!n[21]&&Vt(),C=n[26]&&Wt(n);return{c(){e=f("div"),t=f("div"),l=f("button"),i=I("+ Добавить файл"),r=j(),s=f("button"),u=I("+ Добавить папку"),c=j(),d=f("button"),d.textContent="+ Новый файл",m=j(),O&&O.c(),h=j(),v.c(),w=j(),L&&L.c(),g=j(),C&&C.c(),y=de(),o(l,"class","btn btn-primary svelte-1rwjkun"),l.disabled=n[19],o(s,"class","btn svelte-1rwjkun"),s.disabled=n[19],o(d,"class","btn svelte-1rwjkun"),o(t,"class","tab-toolbar svelte-1rwjkun"),o(e,"class","files-tab svelte-1rwjkun")},m(N,R){b(N,e,R),a(e,t),a(t,l),a(l,i),a(t,r),a(t,s),a(s,u),a(t,c),a(t,d),a(t,m),O&&O.m(t,null),a(e,h),T[_].m(e,null),a(e,w),L&&L.m(e,null),b(N,g,R),C&&C.m(N,R),b(N,y,R),M=!0,W||(q=[F(l,"click",n[63]),F(s,"click",n[64]),F(d,"click",n[41])],W=!0)},p(N,R){(!M||R[0]&524288)&&(l.disabled=N[19]),(!M||R[0]&524288)&&(s.disabled=N[19]),N[30].items.length>0?O?O.p(N,R):(O=Bt(N),O.c(),O.m(t,null)):O&&(O.d(1),O=null);let V=_;_=E(N),_===V?T[_].p(N,R):(ke(),ie(T[V],1,1,()=>{T[V]=null}),ve(),v=T[_],v?v.p(N,R):(v=T[_]=P[_](N),v.c()),ne(v,1),v.m(e,w)),N[19]&&!N[21]?L||(L=Vt(),L.c(),L.m(e,null)):L&&(L.d(1),L=null),N[26]?C?(C.p(N,R),R[0]&67108864&&ne(C,1)):(C=Wt(N),C.c(),ne(C,1),C.m(y.parentNode,y)):C&&(ke(),ie(C,1,1,()=>{C=null}),ve())},i(N){M||(ne(v),ne(C),M=!0)},o(N){ie(v),ie(C),M=!1},d(N){N&&(k(e),k(g),k(y)),O&&O.d(),T[_].d(),L&&L.d(),C&&C.d(N),W=!1,re(q)}}}function Ii(n){let e,t,l,i,r,s,u,c=n[16]&&Rt(n);function d(_,v){return _[7].length===0&&!_[16]?Ui:Gi}let m=d(n),h=m(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent="+ Добавить заметку",i=j(),c&&c.c(),r=j(),h.c(),o(l,"class","btn btn-primary svelte-1rwjkun"),o(t,"class","tab-toolbar svelte-1rwjkun"),o(e,"class","notes-tab svelte-1rwjkun")},m(_,v){b(_,e,v),a(e,t),a(t,l),a(e,i),c&&c.m(e,null),a(e,r),h.m(e,null),s||(u=F(l,"click",n[55]),s=!0)},p(_,v){_[16]?c?c.p(_,v):(c=Rt(_),c.c(),c.m(e,r)):c&&(c.d(1),c=null),m===(m=d(_))&&h?h.p(_,v):(h.d(1),h=m(_),h&&(h.c(),h.m(e,null)))},i:J,o:J,d(_){_&&k(e),c&&c.d(),h.d(),s=!1,u()}}}function Ti(n){let e,t,l=n[5].title+"",i,r,s,u,c,d,m=n[5].type+"",h,_,v,w,g,y=(n[5].section||"—")+"",M,W,q,O,P,T=pe(n[5].createdAt)+"",E,L,C,N,R,V,B,X,Y,z,ee,x,H,A,Z=n[7].length>0&&qt(n),G=n[10].length>0&&Ut(n);return{c(){e=f("div"),t=f("h2"),i=I(l),r=j(),s=f("div"),u=f("div"),c=f("span"),c.textContent="Тип",d=f("span"),h=I(m),_=j(),v=f("div"),w=f("span"),w.textContent="Раздел",g=f("span"),M=I(y),W=j(),q=f("div"),O=f("span"),O.textContent="Создано",P=f("span"),E=I(T),L=j(),C=f("div"),N=f("button"),N.textContent="✏️ Новая заметка",R=j(),V=f("button"),V.textContent="📎 Добавить файл",B=j(),X=f("button"),X.textContent="⚡ Добавить действие",Y=j(),z=f("button"),z.textContent="🕐 Записать время",ee=j(),Z&&Z.c(),x=j(),G&&G.c(),o(t,"class","svelte-1rwjkun"),o(c,"class","meta-label svelte-1rwjkun"),o(d,"class","svelte-1rwjkun"),o(u,"class","meta-item svelte-1rwjkun"),o(w,"class","meta-label svelte-1rwjkun"),o(g,"class","svelte-1rwjkun"),o(v,"class","meta-item svelte-1rwjkun"),o(O,"class","meta-label svelte-1rwjkun"),o(P,"class","svelte-1rwjkun"),o(q,"class","meta-item svelte-1rwjkun"),o(s,"class","meta-grid svelte-1rwjkun"),o(N,"class","qa-btn svelte-1rwjkun"),o(V,"class","qa-btn svelte-1rwjkun"),o(X,"class","qa-btn svelte-1rwjkun"),X.disabled=!0,o(X,"title","Следующий этап"),o(z,"class","qa-btn svelte-1rwjkun"),o(C,"class","quick-actions svelte-1rwjkun"),o(e,"class","overview svelte-1rwjkun")},m(S,Q){b(S,e,Q),a(e,t),a(t,i),a(e,r),a(e,s),a(s,u),a(u,c),a(u,d),a(d,h),a(s,_),a(s,v),a(v,w),a(v,g),a(g,M),a(s,W),a(s,q),a(q,O),a(q,P),a(P,E),a(e,L),a(e,C),a(C,N),a(C,R),a(C,V),a(C,B),a(C,X),a(C,Y),a(C,z),a(e,ee),Z&&Z.m(e,null),a(e,x),G&&G.m(e,null),H||(A=[F(N,"click",n[74]),F(V,"click",n[75]),F(z,"click",n[76])],H=!0)},p(S,Q){Q[0]&32&&l!==(l=S[5].title+"")&&U(i,l),Q[0]&32&&m!==(m=S[5].type+"")&&U(h,m),Q[0]&32&&y!==(y=(S[5].section||"—")+"")&&U(M,y),Q[0]&32&&T!==(T=pe(S[5].createdAt)+"")&&U(E,T),S[7].length>0?Z?Z.p(S,Q):(Z=qt(S),Z.c(),Z.m(e,x)):Z&&(Z.d(1),Z=null),S[10].length>0?G?G.p(S,Q):(G=Ut(S),G.c(),G.m(e,null)):G&&(G.d(1),G=null)},i:J,o:J,d(S){S&&k(e),Z&&Z.d(),G&&G.d(),H=!1,re(A)}}}function Pi(n){let e,t=te(n[10]),l=[];for(let i=0;i<t.length;i+=1)l[i]=At(bt(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=de()},m(i,r){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,r);b(i,e,r)},p(i,r){if(r[0]&1024){t=te(i[10]);let s;for(s=0;s<t.length;s+=1){const u=bt(i,t,s);l[s]?l[s].p(u,r):(l[s]=At(u),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&k(e),fe(l,i)}}}function Ai(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Записей работы пока нет</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function At(n){let e,t,l=n[124].summary+"",i,r,s,u=n[124].minutes+"",c,d,m=pe(n[124].createdAt)+"",h,_;return{c(){e=f("div"),t=f("div"),i=I(l),r=j(),s=f("div"),c=I(u),d=I(" мин · "),h=I(m),_=j(),o(t,"class","svelte-1rwjkun"),o(s,"class","wl-meta svelte-1rwjkun"),o(e,"class","worklog-entry svelte-1rwjkun")},m(v,w){b(v,e,w),a(e,t),a(t,i),a(e,r),a(e,s),a(s,c),a(s,d),a(s,h),a(e,_)},p(v,w){w[0]&1024&&l!==(l=v[124].summary+"")&&U(i,l),w[0]&1024&&u!==(u=v[124].minutes+"")&&U(c,u),w[0]&1024&&m!==(m=pe(v[124].createdAt)+"")&&U(h,m)},d(v){v&&k(e)}}}function zi(n){let e,t=te(n[9]),l=[];for(let i=0;i<t.length;i+=1)l[i]=zt(ht(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=de()},m(i,r){for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(i,r);b(i,e,r)},p(i,r){if(r[0]&512){t=te(i[9]);let s;for(s=0;s<t.length;s+=1){const u=ht(i,t,s);l[s]?l[s].p(u,r):(l[s]=zt(u),l[s].c(),l[s].m(e.parentNode,e))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&k(e),fe(l,i)}}}function Bi(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Действий пока нет</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function zt(n){let e,t,l=n[135].title+"",i,r,s=n[135].type+"",u,c,d,m,h,_;function v(){return n[93](n[135])}return{c(){e=f("div"),t=f("span"),i=I(l),r=f("span"),u=I(s),c=j(),d=f("button"),d.textContent="Запустить",m=j(),o(t,"class","svelte-1rwjkun"),o(r,"class","action-type svelte-1rwjkun"),o(d,"class","btn btn-sm svelte-1rwjkun"),o(e,"class","action-card svelte-1rwjkun")},m(w,g){b(w,e,g),a(e,t),a(t,i),a(e,r),a(r,u),a(e,c),a(e,d),a(e,m),h||(_=F(d,"click",v),h=!0)},p(w,g){n=w,g[0]&512&&l!==(l=n[135].title+"")&&U(i,l),g[0]&512&&s!==(s=n[135].type+"")&&U(u,s)},d(w){w&&k(e),h=!1,_()}}}function Bt(n){let e,t,l=n[30].items.length+"",i,r,s;return{c(){e=f("button"),t=I("Вставить "),i=I(l),o(e,"class","btn svelte-1rwjkun")},m(u,c){b(u,e,c),a(e,t),a(e,i),r||(s=F(e,"click",n[46]),r=!0)},p(u,c){c[0]&1073741824&&l!==(l=u[30].items.length+"")&&U(i,l)},d(u){u&&k(e),r=!1,s()}}}function Hi(n){let e,t,l,i,r,s,u;const c=[Ri,Wi],d=[];function m(w,g){return w[24].length>0?0:1}e=m(n),t=d[e]=c[e](n);const h=[qi,Ki],_=[];function v(w,g){return w[25].length===0?0:1}return i=v(n),r=_[i]=h[i](n),{c(){t.c(),l=j(),r.c(),s=de()},m(w,g){d[e].m(w,g),b(w,l,g),_[i].m(w,g),b(w,s,g),u=!0},p(w,g){let y=e;e=m(w),e===y?d[e].p(w,g):(ke(),ie(d[y],1,1,()=>{d[y]=null}),ve(),t=d[e],t?t.p(w,g):(t=d[e]=c[e](w),t.c()),ne(t,1),t.m(l.parentNode,l));let M=i;i=v(w),i===M?_[i].p(w,g):(ke(),ie(_[M],1,1,()=>{_[M]=null}),ve(),r=_[i],r?r.p(w,g):(r=_[i]=h[i](w),r.c()),ne(r,1),r.m(s.parentNode,s))},i(w){u||(ne(t),ne(r),u=!0)},o(w){ie(t),ie(r),u=!1},d(w){w&&(k(l),k(s)),d[e].d(w),_[i].d(w)}}}function Vi(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Загрузка...</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,i:J,o:J,d(t){t&&k(e)}}}function Wi(n){let e,t;return e=new pl({props:{crumbs:[{name:"Files"}]}}),{c(){je(e.$$.fragment)},m(l,i){be(e,l,i),t=!0},p:J,i(l){t||(ne(e.$$.fragment,l),t=!0)},o(l){ie(e.$$.fragment,l),t=!1},d(l){he(e,l)}}}function Ri(n){let e,t,l,i,r,s;return e=new pl({props:{crumbs:[{name:"Files"},...n[24]]}}),e.$on("navigate",n[81]),{c(){je(e.$$.fragment),t=j(),l=f("button"),l.textContent="← Back",o(l,"class","btn btn-sm back-btn svelte-1rwjkun")},m(u,c){be(e,u,c),b(u,t,c),b(u,l,c),i=!0,r||(s=F(l,"click",n[37]),r=!0)},p(u,c){const d={};c[0]&16777216&&(d.crumbs=[{name:"Files"},...u[24]]),e.$set(d)},i(u){i||(ne(e.$$.fragment,u),i=!0)},o(u){ie(e.$$.fragment,u),i=!1},d(u){u&&(k(t),k(l)),he(e,u),r=!1,s()}}}function Ki(n){let e,t=[],l=new Map,i,r=te(n[25]);const s=u=>u[132].id;for(let u=0;u<r.length;u+=1){let c=wt(n,r,u),d=s(c);l.set(d,t[u]=Ht(d,c))}return{c(){e=f("div");for(let u=0;u<t.length;u+=1)t[u].c();o(e,"class","file-list svelte-1rwjkun")},m(u,c){b(u,e,c);for(let d=0;d<t.length;d+=1)t[d]&&t[d].m(e,null);i=!0},p(u,c){c[0]&33554432|c[1]&2062625|c[2]&32&&(r=te(u[25]),ke(),t=Mn(t,c,s,1,u,r,l,e,Dn,Ht,null,wt),ve())},i(u){if(!i){for(let c=0;c<r.length;c+=1)ne(t[c]);i=!0}},o(u){for(let c=0;c<t.length;c+=1)ie(t[c]);i=!1},d(u){u&&k(e);for(let c=0;c<t.length;c+=1)t[c].d()}}}function qi(n){let e,t,l,i,r=n[24].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов",s,u,c,d,m,h,_,v,w,g;return{c(){e=f("div"),t=f("div"),t.innerHTML='<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="svelte-1rwjkun"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" class="svelte-1rwjkun"></path><polyline points="14 2 14 8 20 8" class="svelte-1rwjkun"></polyline></svg>',l=j(),i=f("p"),s=I(r),u=j(),c=f("p"),c.textContent="Добавьте файл или папку, чтобы сохранить материалы проекта.",d=j(),m=f("div"),h=f("button"),h.textContent="Добавить файл",_=j(),v=f("button"),v.textContent="Добавить папку",o(t,"class","empty-icon svelte-1rwjkun"),o(i,"class","svelte-1rwjkun"),o(c,"class","hint svelte-1rwjkun"),o(h,"class","btn btn-primary svelte-1rwjkun"),o(v,"class","btn svelte-1rwjkun"),o(m,"class","empty-actions svelte-1rwjkun"),o(e,"class","empty-state svelte-1rwjkun")},m(y,M){b(y,e,M),a(e,t),a(e,l),a(e,i),a(i,s),a(e,u),a(e,c),a(e,d),a(e,m),a(m,h),a(m,_),a(m,v),w||(g=[F(h,"click",n[63]),F(v,"click",n[64])],w=!0)},p(y,M){M[0]&16777216&&r!==(r=y[24].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов")&&U(s,r)},i:J,o:J,d(y){y&&k(e),w=!1,re(g)}}}function Ht(n,e){let t,l,i;return l=new ni({props:{item:e[132],selected:e[31].includes(e[132].id),onDragStart:e[49],onDragOver:e[50],onDrop:e[51]}}),l.$on("navigate",e[82]),l.$on("preview",e[83]),l.$on("openExternal",e[84]),l.$on("delete",e[85]),l.$on("rename",e[86]),l.$on("duplicate",e[87]),l.$on("cut",e[88]),l.$on("copy",e[89]),l.$on("selectOne",e[90]),l.$on("toggleSelect",e[91]),{key:n,first:null,c(){t=de(),je(l.$$.fragment),this.first=t},m(r,s){b(r,t,s),be(l,r,s),i=!0},p(r,s){e=r;const u={};s[0]&33554432&&(u.item=e[132]),s[0]&33554432|s[1]&1&&(u.selected=e[31].includes(e[132].id)),l.$set(u)},i(r){i||(ne(l.$$.fragment,r),i=!0)},o(r){ie(l.$$.fragment,r),i=!1},d(r){r&&k(t),he(l,r)}}}function Vt(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Сканирование...</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){b(t,e,l)},d(t){t&&k(e)}}}function Wt(n){let e,t;return e=new hi({props:{item:n[26],content:n[27],loading:n[28],error:n[29]}}),e.$on("close",n[40]),e.$on("openExternal",n[92]),{c(){je(e.$$.fragment)},m(l,i){be(e,l,i),t=!0},p(l,i){const r={};i[0]&67108864&&(r.item=l[26]),i[0]&134217728&&(r.content=l[27]),i[0]&268435456&&(r.loading=l[28]),i[0]&536870912&&(r.error=l[29]),e.$set(r)},i(l){t||(ne(e.$$.fragment,l),t=!0)},o(l){ie(e.$$.fragment,l),t=!1},d(l){he(e,l)}}}function Rt(n){let e,t,l,i,r,s,u,c,d;return{c(){e=f("div"),t=f("input"),l=j(),i=f("div"),r=f("button"),r.textContent="Создать",s=j(),u=f("button"),u.textContent="Отмена",o(t,"type","text"),o(t,"placeholder","Название заметки"),o(t,"class","svelte-1rwjkun"),o(r,"class","btn btn-primary svelte-1rwjkun"),o(u,"class","btn svelte-1rwjkun"),o(i,"class","form-actions svelte-1rwjkun"),o(e,"class","create-form svelte-1rwjkun")},m(m,h){b(m,e,h),a(e,t),ue(t,n[17]),a(e,l),a(e,i),a(i,r),a(i,s),a(i,u),c||(d=[F(t,"input",n[78]),F(t,"keydown",n[79]),F(r,"click",n[57]),F(u,"click",n[56])],c=!0)},p(m,h){h[0]&131072&&t.value!==m[17]&&ue(t,m[17])},d(m){m&&k(e),c=!1,re(d)}}}function Gi(n){let e,t=te(n[7]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Kt(gt(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();o(e,"class","notes-list svelte-1rwjkun")},m(i,r){b(i,e,r);for(let s=0;s<l.length;s+=1)l[s]&&l[s].m(e,null)},p(i,r){if(r[0]&128|r[1]&134217728){t=te(i[7]);let s;for(s=0;s<t.length;s+=1){const u=gt(i,t,s);l[s]?l[s].p(u,r):(l[s]=Kt(u),l[s].c(),l[s].m(e,null))}for(;s<l.length;s+=1)l[s].d(1);l.length=t.length}},d(i){i&&k(e),fe(l,i)}}}function Ui(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Нет заметок</p><p class="hint svelte-1rwjkun">Создайте первую заметку для этого дела.</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){b(t,e,l)},p:J,d(t){t&&k(e)}}}function Kt(n){let e,t,l=n[127].title+"",i,r,s,u=pe(n[127].createdAt)+"",c,d,m,h;function _(){return n[80](n[127])}return{c(){e=f("div"),t=f("div"),i=I(l),r=j(),s=f("div"),c=I(u),d=j(),o(t,"class","note-card-title svelte-1rwjkun"),o(s,"class","note-card-date svelte-1rwjkun"),o(e,"class","note-card svelte-1rwjkun")},m(v,w){b(v,e,w),a(e,t),a(t,i),a(e,r),a(e,s),a(s,c),a(e,d),m||(h=F(e,"click",_),m=!0)},p(v,w){n=v,w[0]&128&&l!==(l=n[127].title+"")&&U(i,l),w[0]&128&&u!==(u=pe(n[127].createdAt)+"")&&U(c,u)},d(v){v&&k(e),m=!1,h()}}}function qt(n){let e,t,l,i=te(n[7].slice(0,5)),r=[];for(let s=0;s<i.length;s+=1)r[s]=Gt(jt(n,i,s));return{c(){e=f("div"),t=f("h3"),t.textContent="Последние заметки",l=j();for(let s=0;s<r.length;s+=1)r[s].c();o(t,"class","svelte-1rwjkun"),o(e,"class","recent-section svelte-1rwjkun")},m(s,u){b(s,e,u),a(e,t),a(e,l);for(let c=0;c<r.length;c+=1)r[c]&&r[c].m(e,null)},p(s,u){if(u[0]&128|u[1]&134217728){i=te(s[7].slice(0,5));let c;for(c=0;c<i.length;c+=1){const d=jt(s,i,c);r[c]?r[c].p(d,u):(r[c]=Gt(d),r[c].c(),r[c].m(e,null))}for(;c<r.length;c+=1)r[c].d(1);r.length=i.length}},d(s){s&&k(e),fe(r,s)}}}function Gt(n){let e,t,l=n[127].title+"",i,r,s=pe(n[127].createdAt)+"",u,c,d,m;function h(){return n[77](n[127])}return{c(){e=f("div"),t=f("span"),i=I(l),r=f("span"),u=I(s),c=j(),o(t,"class","svelte-1rwjkun"),o(r,"class","recent-date svelte-1rwjkun"),o(e,"class","recent-note svelte-1rwjkun")},m(_,v){b(_,e,v),a(e,t),a(t,i),a(e,r),a(r,u),a(e,c),d||(m=F(e,"click",h),d=!0)},p(_,v){n=_,v[0]&128&&l!==(l=n[127].title+"")&&U(i,l),v[0]&128&&s!==(s=pe(n[127].createdAt)+"")&&U(u,s)},d(_){_&&k(e),d=!1,m()}}}function Ut(n){let e,t,l,i=te(n[10].slice(0,3)),r=[];for(let s=0;s<i.length;s+=1)r[s]=Jt(yt(n,i,s));return{c(){e=f("div"),t=f("h3"),t.textContent="Последние записи",l=j();for(let s=0;s<r.length;s+=1)r[s].c();o(t,"class","svelte-1rwjkun"),o(e,"class","recent-section svelte-1rwjkun")},m(s,u){b(s,e,u),a(e,t),a(e,l);for(let c=0;c<r.length;c+=1)r[c]&&r[c].m(e,null)},p(s,u){if(u[0]&1024){i=te(s[10].slice(0,3));let c;for(c=0;c<i.length;c+=1){const d=yt(s,i,c);r[c]?r[c].p(d,u):(r[c]=Jt(d),r[c].c(),r[c].m(e,null))}for(;c<r.length;c+=1)r[c].d(1);r.length=i.length}},d(s){s&&k(e),fe(r,s)}}}function Jt(n){let e,t=n[124].summary+"",l,i,r=n[124].minutes+"",s,u;return{c(){e=f("div"),l=I(t),i=I(" ("),s=I(r),u=I(" мин)"),o(e,"class","recent-entry svelte-1rwjkun")},m(c,d){b(c,e,d),a(e,l),a(e,i),a(e,s),a(e,u)},p(c,d){d[0]&1024&&t!==(t=c[124].summary+"")&&U(l,t),d[0]&1024&&r!==(r=c[124].minutes+"")&&U(s,r)},d(c){c&&k(e)}}}function Xt(n){let e;return{c(){e=f("span"),e.textContent="●",o(e,"class","dirty-mark svelte-1rwjkun")},m(t,l){b(t,e,l)},d(t){t&&k(e)}}}function Zt(n){let e,t,l;return{c(){e=f("div"),e.textContent="+",o(e,"class","fab svelte-1rwjkun"),o(e,"title","Добавить дело")},m(i,r){b(i,e,r),t||(l=F(e,"click",n[52]),t=!0)},p:J,d(i){i&&k(e),t=!1,l()}}}function Yt(n){let e,t,l,i,r,s,u,c,d,m,h,_,v,w,g,y,M,W,q,O,P=te(n[0].filter(el)),T=[];for(let E=0;E<P.length;E+=1)T[E]=Qt(vt(n,P,E));return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent="Новое дело",i=j(),r=f("div"),s=f("label"),s.textContent="Название",u=j(),c=f("input"),d=j(),m=f("div"),h=f("label"),h.textContent="Раздел",_=j(),v=f("select");for(let E=0;E<T.length;E+=1)T[E].c();w=j(),g=f("div"),y=f("button"),y.textContent="Создать",M=j(),W=f("button"),W.textContent="Отмена",o(l,"class","svelte-1rwjkun"),o(s,"class","svelte-1rwjkun"),o(c,"type","text"),o(c,"placeholder","Название дела"),c.autofocus=!0,o(c,"class","svelte-1rwjkun"),o(r,"class","form-group svelte-1rwjkun"),o(h,"class","svelte-1rwjkun"),o(v,"class","svelte-1rwjkun"),n[15]===void 0&&Ie(()=>n[98].call(v)),o(m,"class","form-group svelte-1rwjkun"),o(y,"class","btn btn-primary svelte-1rwjkun"),o(W,"class","btn svelte-1rwjkun"),o(g,"class","modal-actions svelte-1rwjkun"),o(t,"class","modal svelte-1rwjkun"),o(e,"class","modal-overlay svelte-1rwjkun")},m(E,L){b(E,e,L),a(e,t),a(t,l),a(t,i),a(t,r),a(r,s),a(r,u),a(r,c),ue(c,n[14]),a(t,d),a(t,m),a(m,h),a(m,_),a(m,v);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m(v,null);at(v,n[15],!0),a(t,w),a(t,g),a(g,y),a(g,M),a(g,W),c.focus(),q||(O=[F(c,"input",n[96]),F(c,"keydown",n[97]),F(v,"change",n[98]),F(y,"click",n[54]),F(W,"click",n[53]),F(e,"click",qe(n[53]))],q=!0)},p(E,L){if(L[0]&16384&&c.value!==E[14]&&ue(c,E[14]),L[0]&1){P=te(E[0].filter(el));let C;for(C=0;C<P.length;C+=1){const N=vt(E,P,C);T[C]?T[C].p(N,L):(T[C]=Qt(N),T[C].c(),T[C].m(v,null))}for(;C<T.length;C+=1)T[C].d(1);T.length=P.length}L[0]&32769&&at(v,E[15])},d(E){E&&k(e),fe(T,E),q=!1,re(O)}}}function Qt(n){let e,t=n[121].label+"",l,i;return{c(){e=f("option"),l=I(t),e.__value=i=n[121].id,ue(e,e.__value),o(e,"class","svelte-1rwjkun")},m(r,s){b(r,e,s),a(e,l)},p(r,s){s[0]&1&&t!==(t=r[121].label+"")&&U(l,t),s[0]&1&&i!==(i=r[121].id)&&(e.__value=i,ue(e,e.__value))},d(r){r&&k(e)}}}function xt(n){let e,t,l,i,r=(n[5]?n[5].title:"")+"",s,u,c,d,m,h,_,v=n[20].files+"",w,g,y,M,W,q=n[20].folders+"",O,P,T,E,L,C=(n[20].totalBytes/1024).toFixed(1)+"",N,R,V,B,X,Y,z,ee,x,H,A,Z,G=n[20].isDangerous&&$t(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),i=I("Добавить в «"),s=I(r),u=I("»"),c=j(),d=f("div"),m=f("div"),h=f("span"),h.textContent="Файлов:",_=f("span"),w=I(v),g=j(),y=f("div"),M=f("span"),M.textContent="Папок:",W=f("span"),O=I(q),P=j(),T=f("div"),E=f("span"),E.textContent="Размер:",L=f("span"),N=I(C),R=I(" KB"),V=j(),G&&G.c(),B=j(),X=f("div"),Y=f("button"),Y.textContent="Скопировать",z=j(),ee=f("button"),ee.textContent="Привязать",x=j(),H=f("button"),H.textContent="Отмена",o(l,"class","svelte-1rwjkun"),o(h,"class","svelte-1rwjkun"),o(_,"class","svelte-1rwjkun"),o(m,"class","summary-row svelte-1rwjkun"),o(M,"class","svelte-1rwjkun"),o(W,"class","svelte-1rwjkun"),o(y,"class","summary-row svelte-1rwjkun"),o(E,"class","svelte-1rwjkun"),o(L,"class","svelte-1rwjkun"),o(T,"class","summary-row svelte-1rwjkun"),o(d,"class","import-summary svelte-1rwjkun"),o(Y,"class","btn btn-primary svelte-1rwjkun"),o(ee,"class","btn svelte-1rwjkun"),o(H,"class","btn svelte-1rwjkun"),o(X,"class","modal-actions svelte-1rwjkun"),o(t,"class","modal svelte-1rwjkun"),o(e,"class","modal-overlay svelte-1rwjkun")},m(S,Q){b(S,e,Q),a(e,t),a(t,l),a(l,i),a(l,s),a(l,u),a(t,c),a(t,d),a(d,m),a(m,h),a(m,_),a(_,w),a(d,g),a(d,y),a(y,M),a(y,W),a(W,O),a(d,P),a(d,T),a(T,E),a(T,L),a(L,N),a(L,R),a(d,V),G&&G.m(d,null),a(t,B),a(t,X),a(X,Y),a(X,z),a(X,ee),a(X,x),a(X,H),A||(Z=[F(Y,"click",n[99]),F(ee,"click",n[100]),F(H,"click",n[66]),F(e,"click",qe(n[66]))],A=!0)},p(S,Q){Q[0]&32&&r!==(r=(S[5]?S[5].title:"")+"")&&U(s,r),Q[0]&1048576&&v!==(v=S[20].files+"")&&U(w,v),Q[0]&1048576&&q!==(q=S[20].folders+"")&&U(O,q),Q[0]&1048576&&C!==(C=(S[20].totalBytes/1024).toFixed(1)+"")&&U(N,C),S[20].isDangerous?G?G.p(S,Q):(G=$t(S),G.c(),G.m(d,null)):G&&(G.d(1),G=null)},d(S){S&&k(e),G&&G.d(),A=!1,re(Z)}}}function $t(n){let e,t,l=n[20].dangerReason+"",i;return{c(){e=f("div"),t=I("⚠ "),i=I(l),o(e,"class","summary-warn svelte-1rwjkun")},m(r,s){b(r,e,s),a(e,t),a(e,i)},p(r,s){s[0]&1048576&&l!==(l=r[20].dangerReason+"")&&U(i,l)},d(r){r&&k(e)}}}function Ji(n){let e,t,l,i,r,s,u,c,d,m,h,_,v,w,g,y,M,W,q,O,P,T,E,L,C,N=te(n[0]),R=[];for(let S=0;S<N.length;S+=1)R[S]=Nt(Mt(n,N,S));let V=n[4]&&Et(n);function B(S,Q){return S[5]?yi:S[4]?gi:wi}let X=B(n),Y=X(n),z=n[3]&&Tt(n);const ee=[Si,Ci,ji],x=[];function H(S,Q){return S[8]?0:S[5]?1:2}O=H(n),P=x[O]=ee[O](n);let A=!n[8]&&!n[5]&&Zt(n),Z=n[13]&&Yt(n),G=n[21]&&n[20]&&xt(n);return{c(){e=f("div"),t=f("aside"),l=f("div"),l.innerHTML='<span class="logo svelte-1rwjkun">⚒</span> <span class="brand-name svelte-1rwjkun">Верстак</span>',i=j(),r=f("nav"),s=f("div"),u=f("div"),u.textContent="Разделы",c=j();for(let S=0;S<R.length;S+=1)R[S].c();d=j(),V&&V.c(),m=j(),h=f("div"),_=f("span"),v=I(n[2]),w=j(),g=f("main"),y=f("header"),M=f("div"),Y.c(),W=j(),z&&z.c(),q=j(),P.c(),T=j(),A&&A.c(),E=j(),Z&&Z.c(),L=j(),G&&G.c(),o(l,"class","sidebar-brand svelte-1rwjkun"),o(u,"class","nav-label svelte-1rwjkun"),o(s,"class","nav-group svelte-1rwjkun"),o(r,"class","sidebar-nav svelte-1rwjkun"),o(_,"class","version svelte-1rwjkun"),o(h,"class","sidebar-footer svelte-1rwjkun"),o(t,"class","sidebar svelte-1rwjkun"),o(M,"class","header-left svelte-1rwjkun"),o(y,"class","header svelte-1rwjkun"),o(g,"class","main svelte-1rwjkun"),o(e,"class","app svelte-1rwjkun")},m(S,Q){b(S,e,Q),a(e,t),a(t,l),a(t,i),a(t,r),a(r,s),a(s,u),a(s,c);for(let ae=0;ae<R.length;ae+=1)R[ae]&&R[ae].m(s,null);a(r,d),V&&V.m(r,null),a(t,m),a(t,h),a(h,_),a(_,v),a(e,w),a(e,g),a(g,y),a(y,M),Y.m(M,null),a(g,W),z&&z.m(g,null),a(g,q),x[O].m(g,null),a(g,T),A&&A.m(g,null),a(g,E),Z&&Z.m(g,null),a(g,L),G&&G.m(g,null),C=!0},p(S,Q){if(Q[0]&17|Q[1]&4){N=te(S[0]);let oe;for(oe=0;oe<N.length;oe+=1){const se=Mt(S,N,oe);R[oe]?R[oe].p(se,Q):(R[oe]=Nt(se),R[oe].c(),R[oe].m(s,null))}for(;oe<R.length;oe+=1)R[oe].d(1);R.length=N.length}S[4]?V?V.p(S,Q):(V=Et(S),V.c(),V.m(r,null)):V&&(V.d(1),V=null),(!C||Q[0]&4)&&U(v,S[2]),X===(X=B(S))&&Y?Y.p(S,Q):(Y.d(1),Y=X(S),Y&&(Y.c(),Y.m(M,null))),S[3]?z?z.p(S,Q):(z=Tt(S),z.c(),z.m(g,q)):z&&(z.d(1),z=null);let ae=O;O=H(S),O===ae?x[O].p(S,Q):(ke(),ie(x[ae],1,1,()=>{x[ae]=null}),ve(),P=x[O],P?P.p(S,Q):(P=x[O]=ee[O](S),P.c()),ne(P,1),P.m(g,T)),!S[8]&&!S[5]?A?A.p(S,Q):(A=Zt(S),A.c(),A.m(g,E)):A&&(A.d(1),A=null),S[13]?Z?Z.p(S,Q):(Z=Yt(S),Z.c(),Z.m(g,L)):Z&&(Z.d(1),Z=null),S[21]&&S[20]?G?G.p(S,Q):(G=xt(S),G.c(),G.m(g,null)):G&&(G.d(1),G=null)},i(S){C||(ne(P),C=!0)},o(S){ie(P),C=!1},d(S){S&&k(e),fe(R,S),V&&V.d(),Y.d(),z&&z.d(),x[O].d(),A&&A.d(),Z&&Z.d(),G&&G.d()}}}function $(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails call error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function pe(n){if(!n)return"";try{return new Date(n).toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}catch{return n}}const el=n=>n.id!=="today"&&n.id!=="inbox";function Xi(n,e,t){let l=[],i=[],r="",s="",u="",c=null,d="overview",m=[],h=null,_=[],v=[],w=[],g="",y="",M=!1,W="",q="clients",O=!1,P="",T=!0,E=!1,L=null,C=!1,N="",R=!1,V=null,B=[],X=[],Y=null,z="",ee=!1,x="",H={items:[],mode:"copy"},A=[],Z=[];const G=[{id:"overview",label:"Обзор"},{id:"notes",label:"Заметки"},{id:"files",label:"Файлы"},{id:"actions",label:"Действия"},{id:"worklog",label:"Журнал"},{id:"activity",label:"Активность"}];let S=null;il(async()=>{try{t(2,r=await $("VerstakVersion")||"verstak-gui/v2"),t(0,l=await $("ListSections")||[])}catch(p){t(3,s=String(p)),t(0,l=[{id:"today",label:"Сегодня"},{id:"inbox",label:"Неразобранное"},{id:"clients",label:"Клиенты"},{id:"projects",label:"Проекты"},{id:"recipes",label:"Рецепты"},{id:"documents",label:"Документы"},{id:"archive",label:"Архив"}])}window.runtime&&window.runtime.EventsOn&&(window.runtime.EventsOn("files-dropped",Tl),S=()=>window.runtime.EventsOff("files-dropped")),window.addEventListener("keydown",nt),t(18,T=!1)}),sl(()=>{S&&S(),window.removeEventListener("keydown",nt)});async function Q(p){t(4,u=p),t(5,c=null),t(6,d="overview"),t(7,m=[]),_=[],t(9,v=[]),t(10,w=[]),t(13,M=!1),t(3,s="");try{t(1,i=await $("ListNodesBySection",p)||[])}catch(D){t(3,s=String(D)),t(1,i=[])}}async function ae(p){t(5,c=p),t(6,d="overview"),t(7,m=[]),_=[],t(9,v=[]),t(10,w=[]),t(25,X=[]),t(24,B=[]),t(23,V=null),t(26,Y=null),t(27,z=""),t(31,A=[]),Z=[],t(8,h=null),t(13,M=!1),t(16,O=!1),t(3,s=""),await oe(p.id)}async function oe(p){try{t(7,m=await $("ListNotes",p)||[])}catch{}try{_=await $("ListFiles",p)||[]}catch{}try{t(9,v=await $("ListActions",p)||[])}catch{}try{t(10,w=await $("ListWorklog",p)||[])}catch{}}async function se(p){t(22,R=!0);try{let D=await $("ListItems",p)||[];D.sort((le,ce)=>le.type!==ce.type?le.type==="folder"?-1:1:(le.name||"").localeCompare(ce.name||"")),t(25,X=D)}catch{t(25,X=[])}t(22,R=!1)}async function Je(p){if(c){try{const D=await $("GetNodeDetail",p);D&&t(24,B=[...B,{id:p,name:D.title}])}catch{t(24,B=[...B,{id:p,name:"..."}])}t(23,V=p),await se(p)}}function _l(){if(B.length<2)t(24,B=[]),t(23,V=null),se(c.id);else{const p=B[B.length-2];t(24,B=B.slice(0,-1)),t(23,V=p.id),se(p.id)}}function Xe(p){const D=B[p];t(24,B=B.slice(0,p+1)),t(23,V=D.id),se(D.id)}async function Ze(p){t(26,Y=p),t(27,z=""),t(29,x=""),t(28,ee=!0);try{Zn(p)?t(27,z=await $("GetFileBase64",p.fileId)||""):Yn(p)&&t(27,z=await $("ReadFileText",p.fileId)||"")}catch(D){t(29,x=String(D))}t(28,ee=!1)}function ml(){t(26,Y=null),t(27,z=""),t(29,x="")}async function kl(){const p=prompt("Введите имя файла:");if(!(!p||!p.trim()))try{const D=V||c.id;await $("CreateEmptyFile",D,p.trim()),await se(D)}catch(D){t(3,s=String(D))}}async function Ye(p){try{await $("DuplicateNode",p);const D=V||c.id;await se(D)}catch(D){t(3,s=String(D))}}function Qe(p){const D=prompt("Новое имя:");!D||!D.trim()||vl(p,D.trim())}async function vl(p,D){try{await $("RenameNode",p,D);const le=V||c.id;await se(le)}catch(le){t(3,s=String(le))}}function xe(p){t(30,H={items:[p],mode:"cut"})}function $e(p){t(30,H={items:[p],mode:"copy"})}async function et(){if(H.items.length===0)return;const p=V||c.id;try{if(H.mode==="copy")for(const D of H.items)await $("DuplicateNode",D);else for(const D of H.items)await $("MoveNode",D,p);t(30,H={items:[],mode:"copy"}),await se(p)}catch(D){t(3,s=String(D))}}function tt(p){A.includes(p)?t(31,A=A.filter(D=>D!==p)):t(31,A=[...A,p])}function lt(p){t(31,A=[p])}function bl(){t(31,A=X.map(p=>p.id))}function Ae(p){return p.length>0?p:X.map(D=>D.id)}async function hl(){var ce;const p=Ae(A),D=p.length===1&&((ce=X.find(Ce=>Ce.id===p[0]))==null?void 0:ce.type)==="folder"?"папку":`файлов (${p.length})`;if(!confirm(`Удалить ${D}?`))return;for(const Ce of p)try{await $("DeleteFileOrFolder",Ce)}catch(pn){t(3,s=String(pn))}t(31,A=[]);const le=V||c.id;await se(le)}function wl(){const p=Ae(A);t(30,H={items:p,mode:"cut"}),t(31,A=[])}function gl(){const p=Ae(A);t(30,H={items:p,mode:"copy"}),t(31,A=[])}function yl(p,D){const le=A.includes(D)?A:[D];Z=le,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",le.join(","))}function jl(p,D){const le=X.find(ce=>ce.id===D);le&&le.type==="folder"&&(p.preventDefault(),p.dataTransfer.dropEffect="move")}async function Cl(p,D){if(p.preventDefault(),Z.length!==0){for(const le of Z)try{await $("MoveNode",le,D)}catch(ce){t(3,s=String(ce))}Z=[],t(31,A=[]),await se(V||c.id)}}function nt(p){d==="files"&&(p.target.tagName==="INPUT"||p.target.tagName==="TEXTAREA"||(p.ctrlKey||p.metaKey?p.key==="c"?(p.preventDefault(),gl()):p.key==="x"?(p.preventDefault(),wl()):p.key==="v"?(p.preventDefault(),et()):p.key==="a"&&(p.preventDefault(),bl()):(p.key==="Delete"||p.key==="Backspace")&&A.length>0&&(p.preventDefault(),hl())))}function Sl(){t(13,M=!0),t(14,W=""),t(15,q=u||"clients")}function Dl(){t(13,M=!1),t(14,W="")}async function it(){if(W.trim())try{const p=await $("CreateNode","","case",W.trim(),q);t(13,M=!1),t(14,W=""),await Q(q)}catch(p){t(3,s=String(p))}}function st(){t(16,O=!0),t(17,P="")}function Ml(){t(16,O=!1),t(17,P="")}async function rt(){if(!(!P.trim()||!c))try{const p=await $("CreateNote",c.id,P.trim());t(7,m=[...m,p&&p.id?p:{id:Date.now().toString(),title:P.trim(),createdAt:new Date().toISOString()}]),t(16,O=!1),t(17,P="")}catch{const D={id:Date.now().toString(),title:P.trim(),createdAt:new Date().toISOString()};t(7,m=[...m,D]),t(16,O=!1),t(17,P="")}}async function ze(p){if(!(h&&h.dirty&&!confirm("Несохранённые изменения. Закрыть?")))try{const D=await $("ReadNote",p.id);t(8,h={id:p.id,title:p.title,content:D||"",dirty:!1})}catch{t(8,h={id:p.id,title:p.title,content:"# "+p.title+`
|
||
|
||
`,dirty:!1})}}function Nl(){h&&h.dirty&&!confirm("Несохранённые изменения. Закрыть?")||t(8,h=null)}function El(p){h&&(t(8,h.content=p.target.value,h),t(8,h.dirty=!0,h))}async function Fl(){if(h)try{await $("SaveNote",h.id,h.content),t(8,h.dirty=!1,h)}catch{t(8,h.dirty=!1,h)}}async function Ll(){const p=parseInt(g,10);if(!(!y.trim()||isNaN(p)||p<=0||!c)){try{const D=await $("CreateWorklog",c.id,y.trim(),p);t(10,w=[...w,D&&D.id?D:{id:Date.now().toString(),nodeId:c.id,summary:y.trim(),minutes:p,createdAt:new Date().toISOString()}])}catch{t(10,w=[...w,{id:Date.now().toString(),nodeId:c.id,summary:y.trim(),minutes:p,createdAt:new Date().toISOString()}])}t(12,y=""),t(11,g="")}}async function ot(){const p=await $("PickFile");p&&await Be(c.id,p)}async function Ol(){const p=await $("PickDirectory");p&&await Be(c.id,p)}async function Be(p,D){t(19,E=!0);try{const le=await $("PreviewImport",D);t(20,L=le),N=D,t(21,C=!0)}catch(le){t(3,s=String(le))}t(19,E=!1)}async function He(p){try{const D=p==="copy"?await $("AddPathCopy",c.id,N):await $("AddPathLink",c.id,N);t(21,C=!1),t(20,L=null),t(24,B=[]),t(23,V=null),await Promise.all([oe(c.id),se(c.id)])}catch(D){t(3,s=String(D))}}function Il(){t(21,C=!1),t(20,L=null)}async function ct({id:p,type:D}){if(confirm(`Удалить ${D==="folder"?"папку":"файл"}?`))try{await $("DeleteFileOrFolder",p),_=_.filter(Ce=>Ce.nodeId!==p);const ce=V||c.id;await se(ce)}catch(ce){t(3,s=String(ce))}}async function Tl(p){if(!p||p.length===0)return;if(!c){t(3,s="Сначала выберите дело для добавления файлов");return}const D=p[0];await Be(c.id,D)}function Pl(p){return d===p?"tab active":"tab"}const Al=p=>Q(p.id),zl=p=>ae(p),Bl=()=>t(3,s="");function Hl(){h.content=this.value,t(8,h)}const Vl=p=>{t(6,d=p.id),p.id==="files"&&c&&X.length===0&&!V&&se(c.id)},Wl=()=>{t(6,d="notes"),st()},Rl=()=>{t(6,d="files"),ot()},Kl=()=>t(6,d="worklog"),ql=p=>ze(p);function Gl(){P=this.value,t(17,P)}const Ul=p=>p.key==="Enter"&&rt(),Jl=p=>ze(p),Xl=p=>{const D=p.detail;D===0?(t(24,B=[]),t(23,V=null),se(c.id)):Xe(D-1)},Zl=p=>Je(p.detail),Yl=p=>Ze(p.detail),Ql=p=>$("OpenFile",p.detail),xl=p=>ct(p.detail),$l=p=>Qe(p.detail.id),en=p=>Ye(p.detail),tn=p=>xe(p.detail),ln=p=>$e(p.detail),nn=p=>lt(p.detail),sn=p=>tt(p.detail),rn=p=>$("OpenFile",p.detail),on=p=>$("RunAction",p.id);function cn(){y=this.value,t(12,y)}function un(){g=nl(this.value),t(11,g)}function an(){W=this.value,t(14,W)}const fn=p=>p.key==="Enter"&&it();function dn(){q=hn(this),t(15,q),t(0,l)}return[l,i,r,s,u,c,d,m,h,v,w,g,y,M,W,q,O,P,T,E,L,C,R,V,B,X,Y,z,ee,x,H,A,G,Q,ae,se,Je,_l,Xe,Ze,ml,kl,Ye,Qe,xe,$e,et,tt,lt,yl,jl,Cl,Sl,Dl,it,st,Ml,rt,ze,Nl,El,Fl,Ll,ot,Ol,He,Il,ct,Pl,Al,zl,Bl,Hl,Vl,Wl,Rl,Kl,ql,Gl,Ul,Jl,Xl,Zl,Yl,Ql,xl,$l,en,tn,ln,nn,sn,rn,on,cn,un,an,fn,dn,()=>He("copy"),()=>He("link")]}class Zi extends Ee{constructor(e){super(),Ne(this,e,Xi,Ji,Me,{},null,[-1,-1,-1,-1,-1])}}new Zi({target:document.getElementById("app")});
|