ooko
Version:
Task management service based on the Kanban methodology
2 lines • 811 kB
JavaScript
/*! For license information please see server.js.LICENSE.txt */
import{createRequire as e}from"node:module";import*as t from"pouchdb";import*as a from"express";var i,n,r,o,s={12:function(e){function t(e,t,a){for(;t<e.length;){for(;t<e.length;++t){const a=e.charCodeAt(t);if(32!==a&&9!==a)break}if(t===e.length)break;if(59!==e.charCodeAt(t++))return;for(;t<e.length;++t){const a=e.charCodeAt(t);if(32!==a&&9!==a)break}if(t===e.length)return;let i;const n=t;for(;t<e.length;++t){const a=e.charCodeAt(t);if(1!==o[a]){if(61!==a)return;break}}if(t===e.length)return;if(i=e.slice(n,t),++t===e.length)return;let r,c="";if(34===e.charCodeAt(t)){r=++t;let a=!1;for(;t<e.length;++t){const i=e.charCodeAt(t);if(92!==i){if(34===i){if(a){r=t,a=!1;continue}c+=e.slice(r,t);break}if(a&&(r=t-1,a=!1),1!==s[i])return}else a?(r=t,a=!1):(c+=e.slice(r,t),a=!0)}if(t===e.length)return;++t}else{for(r=t;t<e.length;++t){const a=e.charCodeAt(t);if(1!==o[a]){if(t===r)return;break}}c=e.slice(r,t)}i=i.toLowerCase(),void 0===a[i]&&(a[i]=c)}return a}function a(e,t,a,i){for(;t<e.length;){for(;t<e.length;++t){const a=e.charCodeAt(t);if(32!==a&&9!==a)break}if(t===e.length)break;if(59!==e.charCodeAt(t++))return;for(;t<e.length;++t){const a=e.charCodeAt(t);if(32!==a&&9!==a)break}if(t===e.length)return;let n;const d=t;for(;t<e.length;++t){const a=e.charCodeAt(t);if(1!==o[a]){if(61===a)break;return}}if(t===e.length)return;let u,m,h="";if(n=e.slice(d,t),42===n.charCodeAt(n.length-1)){const a=++t;for(;t<e.length;++t){const a=e.charCodeAt(t);if(1!==c[a]){if(39!==a)return;break}}if(t===e.length)return;for(m=e.slice(a,t),++t;t<e.length&&39!==e.charCodeAt(t);++t);if(t===e.length)return;if(++t===e.length)return;u=t;let i=0;for(;t<e.length;++t){const a=e.charCodeAt(t);if(1!==p[a]){if(37===a){let a,n;if(t+2<e.length&&-1!==(a=l[e.charCodeAt(t+1)])&&-1!==(n=l[e.charCodeAt(t+2)])){const r=(a<<4)+n;h+=e.slice(u,t),h+=String.fromCharCode(r),u=(t+=2)+1,r>=128?i=2:0===i&&(i=1);continue}return}break}}if(h+=e.slice(u,t),h=r(h,m,i),void 0===h)return}else{if(++t===e.length)return;if(34===e.charCodeAt(t)){u=++t;let a=!1;for(;t<e.length;++t){const i=e.charCodeAt(t);if(92!==i){if(34===i){if(a){u=t,a=!1;continue}h+=e.slice(u,t);break}if(a&&(u=t-1,a=!1),1!==s[i])return}else a?(u=t,a=!1):(h+=e.slice(u,t),a=!0)}if(t===e.length)return;++t}else{for(u=t;t<e.length;++t){const a=e.charCodeAt(t);if(1!==o[a]){if(t===u)return;break}}h=e.slice(u,t)}if(h=i(h,2),void 0===h)return}n=n.toLowerCase(),void 0===a[n]&&(a[n]=h)}return a}function i(e){let t;for(;;)switch(e){case"utf-8":case"utf8":return n.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return n.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return n.utf16le;case"base64":return n.base64;default:if(void 0===t){t=!0,e=e.toLowerCase();continue}return n.other.bind(e)}}const n={utf8:(e,t)=>{if(0===e.length)return"";if("string"==typeof e){if(t<2)return e;e=Buffer.from(e,"latin1")}return e.utf8Slice(0,e.length)},latin1:(e,t)=>0===e.length?"":"string"==typeof e?e:e.latin1Slice(0,e.length),utf16le:(e,t)=>0===e.length?"":("string"==typeof e&&(e=Buffer.from(e,"latin1")),e.ucs2Slice(0,e.length)),base64:(e,t)=>0===e.length?"":("string"==typeof e&&(e=Buffer.from(e,"latin1")),e.base64Slice(0,e.length)),other:(e,t)=>{if(0===e.length)return"";"string"==typeof e&&(e=Buffer.from(e,"latin1"));try{return new TextDecoder(this).decode(e)}catch{}}};function r(e,t,a){const n=i(t);if(n)return n(e,a)}const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];e.exports={basename:function(e){if("string"!=typeof e)return"";for(let t=e.length-1;t>=0;--t)switch(e.charCodeAt(t)){case 47:case 92:return".."===(e=e.slice(t+1))||"."===e?"":e}return".."===e||"."===e?"":e},convertToUTF8:r,getDecoder:i,parseContentType:function(e){if(0===e.length)return;const a=Object.create(null);let i=0;for(;i<e.length;++i){const t=e.charCodeAt(i);if(1!==o[t]){if(47!==t||0===i)return;break}}if(i===e.length)return;const n=e.slice(0,i).toLowerCase(),r=++i;for(;i<e.length;++i){const n=e.charCodeAt(i);if(1!==o[n]){if(i===r)return;if(void 0===t(e,i,a))return;break}}return i!==r?{type:n,subtype:e.slice(r,i).toLowerCase(),params:a}:void 0},parseDisposition:function(e,t){if(0===e.length)return;const i=Object.create(null);let n=0;for(;n<e.length;++n){const r=e.charCodeAt(n);if(1!==o[r]){if(void 0===a(e,n,i,t))return;break}}return{type:e.slice(0,n).toLowerCase(),params:i}}}},18:(e,t,a)=>{a.a(e,(async(e,t)=>{try{var i=a(4310),n=a(3317),r=a(7104),o=a(8858),s=a(7398),c=a(1682),p=a(3474),l=a(9108),d=e([i,n,r,o,s,c,p,l]);function u(e,t){return new Date(e,t+1,0).getDate()}async function m(e){var{query:t}=e,{docs:a}=e,[i,s]=await(0,n.Ol)(e);if(i)return[{code:i.code,error:i,rid:"EZar8ah"}];var c=6e4*(+t.offset||0),d=Math.max(2e3,Math.min(3e3,+t.y||0)),m=Math.max(0,Math.min(11,+t.m||0)),f=(e,t)=>t+12*e,v=new Set;{let[e,t]=await o.nx.query_(l.Q2,{include_docs:!0,key:s});if(e)return[{code:500,error:e,rid:"EaVMPfb"}];t?.rows?.forEach((({doc:e})=>{e&&!e.deleted&&v.add(e.project_id)}))}var x=a.db_get(`ut-tracker/${s}`),g=new Map,[i,b]=await(0,r.D)(p.Oe,{inclusive_end:!0,include_docs:!0,startkey:["b",s,f(d,m)],endkey:["b",s,f(d,m)]},{db:o.nx});if(i)return[{code:500,error:i,rid:"EIOL9I9"}];(b=b.filter((e=>v.has(e.project_id)))).forEach((e=>{g.set(e.id,e),a.cache_set(e)})),await Promise.all([...v].map((async e=>{let[t,i]=await(0,r.D)(p.pB,{inclusive_end:!0,include_docs:!0,startkey:[e,s],endkey:[e,s]});if(t)return[{code:500,error:t,rid:"ENoRtPF"}];i?.forEach((e=>{g.set(e.id,e),a.cache_set(e)}))})));var y=new Map,_=new Set,w=new Set,k={},E=Date.now(),[i,j]=await x;if(i&&404!=i.status)return[{code:500,error:i,rid:"EdqSHTo"}];{let[e,t]=await(0,r.D)(p.B0,{inclusive_end:!0,include_docs:!0,startkey:["b",s,f(d,m)],endkey:["b",s,f(d,m)]});if(e)return[{code:500,error:e,rid:"ENTbZpq"}];let a=e=>("0"+e).slice(-2),i=d+"-"+a(m+1)+"-",n=u(d,m);j?.progress&&t.push({project_id:j.project_id,task_id:j.task_id,start:j.start,faik:!0,end:Date.now()}),t=t.filter((e=>v.has(e.project_id))),t.forEach((e=>{var{task_id:t}=e;for(let r=1;r<=n;r++){let n=Date.UTC(d,m,r)+c,o=Date.UTC(d,m,r+1)+c,s=e.start,p=e.end;if(s<o&&p>n){let e=i+a(r),c=k[e]||=new Set,l=Math.min(p,o)-Math.max(s,n),d=e+"/"+t;y.set(d,l+(y.get(d)||0)),w.add(t),c.add(t)}}}))}g.forEach((e=>{var t=e.executor_id;(0,p.un)(e.times||[]).forEach(((a,i,n)=>{n.length;var r=a[p.Fo]||"work",o=a[p.OT];if(("work"===r||"done"===r)&&o===s){if(o!==t){if("done"===r)return;if(!(0,p.q2)(a)){let e=a[p.zv];if(a[p.jU]-e<6e4)return}}((e,t,a,i)=>{var n=e.id,r=e=>("0"+e).slice(-2),o=t+"-"+r(a+1)+"-",s=u(t,a);for(let e=1;e<=s;e++){let s,l=Date.UTC(t,a,e)+c,d=Date.UTC(t,a,e+1)+c,u=E,m=(0,p.q2)(i),h=i[p.Fo],f=(i[p.OT],i[p.zv]),v="done"===h?i[p.zv]:i[p.jU];if(v-f<6e4&&(v=f),s=m&&"done"!==h?f<d&&l<u:f<d&&(f===v?v>=l:v>l),s){let t=o+r(e),a=k[t]||=new Set;_.add(n),w.add(n),a.add(n)}}})(e,d,m,a)}}))})),w=[...w];var[i]=await h(e,w),S=[];for(let e in k)S.push([e,[...k[e]]]);return S.sort(((e,t)=>e[0]>t[0]?1:e[0]===t[0]?0:-1)),[null,{tracker_duration:[...y],month:m,year:d,docs:a,days:S}]}async function h(e,t,a=new Map){var{docs:i}=e,n=new Set,o=new Set,s=new Set,p=[],l=new Set,d=e=>l.add(e),u=async(e,t)=>{if(!s.has(e)){var r;s.add(e);var c=a.get(e);if(!c){if([r,c]=await i.db_get(e),r)return;a.set(e,c),i.push(c)}c.has_childs&&n.add(c.id),c.has_links&&d(`task-links/${e}`),(e=>{o.add(e.project_id),d(`sort-tasks/${e.column_id}`),d(e.curator_id),d(e.executor_id)})(c),c.project_id===t&&c.parent_id&&await u(c.parent_id,t)}},[m,h]=await i.db_gets(t);h.forEach((e=>a.set(e.id,e))),t.forEach((e=>{let t=a.get(e);p.push(u(e,t.project_id))})),await Promise.all(p),await(0,c.Nz)(e,o);var[m,h]=await(0,r.D)(null,{include_docs:!1,keys:[...l].filter((e=>e))},{each:e=>i.push(e)});return m?[{code:500,error:m,rid:"EPvL2E0"}]:[null]}[i,n,r,o,s,c,p,l]=d.then?(await d)():d,(0,s._0)("GET","/api/time-report-log-by",m),t()}catch(f){t(f)}}))},76:e=>{e.exports=Function.prototype.call},86:(e,t,a)=>{a.a(e,(async(e,i)=>{try{a.d(t,{X:()=>l,m:()=>c});var n=a(2347),r=a(9141),o=a(6874),s=e([n]),c=+((n=(s.then?(await s)():s)[0]).Q.LIMIT_SIZE_TASK_COMMENT??0)||2048,p={attachments:e=>(0,o.Q)(e).map(r.B).filter((e=>e)),message:e=>(0,r.B)(e)};async function l(e,t,a){var{docs:i}=e,{t:n}=e;if(t.id){var[o,s]=await i.db_get_(t.id);if(o)return[{code:500,error:o}]}else s=!1;var l={},d=!s;if(!s){(t={...t}).message||(l.message=n("property is required")),t.project_id||(l.project_id=n("property is required")),t.chat_id||(l.chat_id=n("property is required"));for(let e in l)return[{code:422,details:l,rid:"E1jqUao"}]}s.id;var u=Date.now(),m=s?{...s}:{class:"comment",created_by:e.user_id,created_at:u,updated_at:u,project_id:t.project_id,deleted:!1,chat_id:t.chat_id,attachments:[],message:"",old:[]};for(let e in t){let a=p[e];if("function"!=typeof a)continue;let i=t[e];void 0!==i&&(m[e]=a(i))}e:if(void 0!==t.message&&(d||=m.message!==s.message,(0,r.B)(m.message).length>c)){l.message=n("Комментарий не должен превышать {N} символов",{N:c});break e}for(let e in l)return[{code:422,details:l,rid:"EKSkE9A"}];return[null,m,d]}i()}catch(d){i(d)}}))},181:t=>{t.exports=e(import.meta.url)("buffer")},238:(e,t,a)=>{const i=a(6710),n=a(651);e.exports=class{constructor(e){e=e||{},this.options=e||{},this.name="StreamTransport",this.version=i.version,this.logger=n.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;let a=e.data.envelope||e.message.getEnvelope(),i=e.message.messageId(),n=[].concat(a.to||[]);n.length>3&&n.push("...and "+n.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:i},"Sending message %s to <%s> using %s line breaks",i,n.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate((()=>{let a;try{a=e.message.createReadStream()}catch(e){return this.logger.error({err:e,tnx:"send",messageId:i},"Creating send stream failed for %s. %s",i,e.message),t(e)}if(!this.options.buffer)return a.once("error",(e=>{this.logger.error({err:e,tnx:"send",messageId:i},"Failed creating message for %s. %s",i,e.message)})),t(null,{envelope:e.data.envelope||e.message.getEnvelope(),messageId:i,message:a});let n=[],r=0;a.on("readable",(()=>{let e;for(;null!==(e=a.read());)n.push(e),r+=e.length})),a.once("error",(e=>(this.logger.error({err:e,tnx:"send",messageId:i},"Failed creating message for %s. %s",i,e.message),t(e)))),a.on("end",(()=>t(null,{envelope:e.data.envelope||e.message.getEnvelope(),messageId:i,message:Buffer.concat(n,r)})))}))}}},249:e=>{function t(e,t,a,i,n){for(let r=0;r<n;++r)if(e[t+r]!==a[i+r])return!1;return!0}function a(e,a){const n=a.length,r=e._needle,o=r.length;let s=-e._lookbehindSize;const c=o-1,p=r[c],l=n-o,d=e._occ,u=e._lookbehind;if(s<0){for(;s<0&&s<=l;){const t=s+c,n=t<0?u[e._lookbehindSize+t]:a[t];if(n===p&&i(e,a,s,c))return e._lookbehindSize=0,++e.matches,s>-e._lookbehindSize?e._cb(!0,u,0,e._lookbehindSize+s,!1):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[n]}for(;s<0&&!i(e,a,s,n-s);)++s;if(s<0){const t=e._lookbehindSize+s;return t>0&&e._cb(!1,u,0,t,!1),e._lookbehindSize-=t,u.copy(u,0,t,e._lookbehindSize),u.set(a,e._lookbehindSize),e._lookbehindSize+=n,e._bufPos=n,n}e._cb(!1,u,0,e._lookbehindSize,!1),e._lookbehindSize=0}s+=e._bufPos;const m=r[0];for(;s<=l;){const i=a[s+c];if(i===p&&a[s]===m&&t(r,0,a,s,c))return++e.matches,s>0?e._cb(!0,a,e._bufPos,s,!0):e._cb(!0,void 0,0,0,!0),e._bufPos=s+o;s+=d[i]}for(;s<n;){if(a[s]===m&&t(a,s,r,0,n-s)){a.copy(u,0,s,n),e._lookbehindSize=n-s;break}++s}return s>0&&e._cb(!1,a,e._bufPos,s<n?s:n,!0),e._bufPos=n,n}function i(e,t,a,i){const n=e._lookbehind,r=e._lookbehindSize,o=e._needle;for(let e=0;e<i;++e,++a)if((a<0?n[r+a]:t[a])!==o[e])return!1;return!0}e.exports=class{constructor(e,t){if("function"!=typeof t)throw new Error("Missing match callback");if("string"==typeof e)e=Buffer.from(e);else if(!Buffer.isBuffer(e))throw new Error("Expected Buffer for needle, got "+typeof e);const a=e.length;if(this.maxMatches=1/0,this.matches=0,this._cb=t,this._lookbehindSize=0,this._needle=e,this._bufPos=0,this._lookbehind=Buffer.allocUnsafe(a),this._occ=[a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a],a>1)for(let t=0;t<a-1;++t)this._occ[e[t]]=a-1-t}reset(){this.matches=0,this._lookbehindSize=0,this._bufPos=0}push(e,t){let i;Buffer.isBuffer(e)||(e=Buffer.from(e,"latin1"));const n=e.length;for(this._bufPos=t||0;i!==n&&this.matches<this.maxMatches;)i=a(this,e);return i}destroy(){const e=this._lookbehindSize;e&&this._cb(!1,this._lookbehind,0,e,!1),this.reset()}}},290:t=>{t.exports=e(import.meta.url)("async_hooks")},315:(e,t,a)=>{a.a(e,(async(e,i)=>{try{a.d(t,{k:()=>d});var n=a(7360),r=a(4310),o=a(7746),s=a(8858),c=a(9141),p=a(6874),l=e([n,r,o,s]);async function d(e){var{data:t}=e,{task_id:a}=t||!1,{docs:i}=e,{t:l}=e,d=(0,c.B)(t.link_id),[u,m]=await s.nx.get_(a);if(u||"task"!==m.class)return[{code:404,error:u,msg:"not found task"}];var{project_id:h}=m,[u]=await(0,r.YS)(e,h,"task_update");if(u)return[{...u,error:u,rid:"E7hMe3p"}];var[u,f]=await(0,o.Fz)(e,d);if(u)return 404===u.code?[{code:422,error:u,details:{link_id:l("Not found")}}]:[{code:500,error:u}];if(f.project_id!==h)return[{code:422,details:{link_id:l("Only the tasks of your project")}}];d=f.id;var[u]=await s.nx.save_({has_links:!0,id:m.id},{only_updates:!0});if(u)return[{code:500,error:u,rid:"EBWZVVb"}];var[u,v,x]=await s.nx.save_({id:`task-links/${a}`,class:"task-links",project_id:m.project_id,task_id:a,links:[d]},{updated_by:e.user_id,each:function(e,t,a){if("links"===t){let t=(0,p.Q)(e.links).sort(),i=[...new Set([...t,...a])].sort(),n=JSON.stringify(t)!==JSON.stringify(i);return n&&(e.links=i),n}}});return u?[{code:500,error:u,rid:"Ec2Nvxx"}]:(await(0,n.mD)(x,v.doc),i.push(v.doc),i.push(f),[null,{docs:i}])}[n,r,o,s]=l.then?(await l)():l,i()}catch(u){i(u)}}))},329:(e,t,a)=>{const i=a(651),n=a(7053),r=a(8044);e.exports=class{constructor(e,t){this.mailer=e,this.data={},this.message=null,t=t||{};let a=e.options||{},i=e._defaults||{};Object.keys(t).forEach((e=>{this.data[e]=t[e]})),this.data.headers=this.data.headers||{},Object.keys(i).forEach((e=>{e in this.data?"headers"===e&&Object.keys(i.headers).forEach((e=>{e in this.data.headers||(this.data.headers[e]=i.headers[e])})):this.data[e]=i[e]})),["disableFileAccess","disableUrlAccess","normalizeHeaderKey"].forEach((e=>{e in a&&(this.data[e]=a[e])}))}resolveContent(...e){return i.resolveContent(...e)}resolveAll(e){let t=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];this.data.alternatives&&this.data.alternatives.length&&this.data.alternatives.forEach(((e,a)=>{t.push([this.data.alternatives,a])})),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach(((e,a)=>{e.filename||(e.filename=(e.path||e.href||"").split("/").pop().split("?").shift()||"attachment-"+(a+1),e.filename.indexOf(".")<0&&(e.filename+="."+r.detectExtension(e.contentType))),e.contentType||(e.contentType=r.detectMimeType(e.filename||e.path||e.href||"bin")),t.push([this.data.attachments,a])}));let a=new n;["from","to","cc","bcc","sender","replyTo"].forEach((e=>{let t;this.message?t=[].concat(a._parseAddresses(this.message.getHeader("replyTo"===e?"reply-to":e))||[]):this.data[e]&&(t=[].concat(a._parseAddresses(this.data[e])||[])),t&&t.length?this.data[e]=t:e in this.data&&(this.data[e]=null)})),["from","sender"].forEach((e=>{this.data[e]&&(this.data[e]=this.data[e].shift())}));let o=0,s=()=>{if(o>=t.length)return e(null,this.data);let a=t[o++];if(!a[0]||!a[0][a[1]])return s();i.resolveContent(...a,((t,i)=>{if(t)return e(t);let n={content:i};a[0][a[1]]&&"object"==typeof a[0][a[1]]&&!Buffer.isBuffer(a[0][a[1]])&&Object.keys(a[0][a[1]]).forEach((e=>{e in n||["content","path","href","raw"].includes(e)||(n[e]=a[0][a[1]][e])})),a[0][a[1]]=n,s()}))};setImmediate((()=>s()))}normalize(e){let t=this.data.envelope||this.message.getEnvelope(),a=this.message.messageId();this.resolveAll(((i,n)=>i?e(i):(n.envelope=t,n.messageId=a,["html","text","watchHtml","amp"].forEach((e=>{n[e]&&n[e].content&&("string"==typeof n[e].content?n[e]=n[e].content:Buffer.isBuffer(n[e].content)&&(n[e]=n[e].content.toString()))})),n.icalEvent&&Buffer.isBuffer(n.icalEvent.content)&&(n.icalEvent.content=n.icalEvent.content.toString("base64"),n.icalEvent.encoding="base64"),n.alternatives&&n.alternatives.length&&n.alternatives.forEach((e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")})),n.attachments&&n.attachments.length&&n.attachments.forEach((e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")})),n.normalizedHeaders={},Object.keys(n.headers||{}).forEach((e=>{let t=[].concat(n.headers[e]||[]).shift();t=t&&t.value||t,t&&(["references","in-reply-to","message-id","content-id"].includes(e)&&(t=this.message._encodeHeaderValue(e,t)),n.normalizedHeaders[e]=t)})),n.list&&"object"==typeof n.list&&this._getListHeaders(n.list).forEach((e=>{n.normalizedHeaders[e.key]=e.value.map((e=>e&&e.value||e)).join(", ")})),n.references&&(n.normalizedHeaders.references=this.message._encodeHeaderValue("references",n.references)),n.inReplyTo&&(n.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",n.inReplyTo)),e(null,n))))}setMailerHeader(){this.message&&this.data.xMailer&&this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(this.message&&this.data.priority)switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)"),this.message.setHeader("X-MSMail-Priority","High"),this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)"),this.message.setHeader("X-MSMail-Priority","Low"),this.message.setHeader("Importance","Low")}}setListHeaders(){this.message&&this.data.list&&"object"==typeof this.data.list&&this.data.list&&"object"==typeof this.data.list&&this._getListHeaders(this.data.list).forEach((e=>{e.value.forEach((t=>{this.message.addHeader(e.key,t)}))}))}_getListHeaders(e){return Object.keys(e).map((t=>({key:"list-"+t.toLowerCase().trim(),value:[].concat(e[t]||[]).map((e=>({prepared:!0,foldLines:!0,value:[].concat(e||[]).map((e=>{if("string"==typeof e&&(e={url:e}),e&&e.url){if("id"===t.toLowerCase().trim()){let t=e.comment||"";return t=r.isPlainText(t)?'"'+t+'"':r.encodeWord(t),(e.comment?t+" ":"")+this._formatListUrl(e.url).replace(/^<[^:]+\/{,2}/,"")}let a=e.comment||"";return r.isPlainText(a)||(a=r.encodeWord(a)),this._formatListUrl(e.url)+(e.comment?" ("+a+")":"")}return""})).filter((e=>e)).join(", ")})))})))}_formatListUrl(e){return e=e.replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(e)?"<"+e+">":/^[^@]+@[^@]+$/.test(e)?"<mailto:"+e+">":"<http://"+e+">"}}},332:(e,t,a)=>{a.a(e,(async(e,t)=>{try{var i=a(3317),n=a(5514),r=a(8858),o=a(9141),s=a(7398),c=e([i,n,r,s]);async function p(e){var{query:t}=e,{data:a}=e,{docs:s}=e,{t:c}=e,p={};(m=(0,o.B)(a?.user_id))||(p.user_id=c("property is required"));for(let e in p)return[{code:422,details:p}];var[l,d]=await(0,n.Ms)(e);if(l)return[{...l,rid:"E4vLumE"}];if(!d)return[{code:403,msg:"Access is denied",error:l,rid:"E1aIe9r"}];var[l,u]=await(0,i.$z)(e,m);if(404==l?.code)return[{code:404,details:{user_id:c("Не найден")},rid:"ErOyNxz",error:l}];if(l)return[l];var m=u.id;if((0,n.qc)(m)){let e="User cannot be blocked";return[{code:423,details:{user_id:e},msg:e,rid:"EpgUerO"}]}var h={blocked:!0,id:m},[l,f]=await r.nx.save_(h,{only_updates:!0,updated_by:e.user_id});return l?[{code:500,rid:"EorM1zu"}]:(s.push(f.doc),[null,{docs:s}])}[i,n,r,s]=c.then?(await c)():c,(0,s._0)("PUT","/api/adm-user-to-blocked",p),t()}catch(l){t(l)}}))},375:(e,t,a)=>{a.a(e,(async(e,t)=>{try{var i=a(4595),n=a(3317),r=a(8858),o=a(9141),s=a(7398),c=e([n,r,s]);async function p(e){var{data:t}=e,{docs:a}=e,{t:s}=e,[c]=await(0,n.Ol)(e);if(c)return[{...c,error:c,rid:"EcuTWV9"}];var{autostop_type:p}=t,{autostop_date:l}=t,{autostop_time:d}=t,{time_offset:u}=t,{user_id:m}=e,h={};void 0!==u&&(/^-?\d+$/.test(u)?u=+u:h.time_offset="incorrect value"),null!=p&&(/^(off|date|time)$/.test(p)||(h.autostop_type="incorrect value"));e:if(null!=l){"24:00"===l&&(l="00:00");let e=(0,o.B)(l).split(":"),t=+e[0],a=+e[1];if(t!=t||a!=a||t<0||t>23||a<0||a>59){h.autostop_date="incorrect value";break e}t<10&&(t="0"+t),a<10&&(a="0"+a),l=t+":"+a}e:if(null!=d){if(!(0,o.B)(d)){h.autostop_time="incorrect value";break e}let e=Math.ceil(60*+d);if(e!=e){let t=(0,o.B)(d),a=+t.match(/(\d+)h/)?.[1],i=+t.match(/(\d+)m/)?.[1];null!=a&&a==a&&(e=(e||0)+60*a),null!=i&&i==i&&(e=(e||0)+i)}if(e!=e){h.autostop_time="incorrect value";break e}let t=Math.floor(e/60),a=e%60;d=(0,o.B)((t?t+"h":"")+" "+(a?a+"m":""))}for(let e in h)return[{code:422,details:h,rid:"EFQTTIt"}];var[c,f]=await r.nx.save_({class:"ut-tracker",autostop_type:p,autostop_date:l,autostop_time:d,time_offset:u,stop:null,id:`ut-tracker/${m}`},{only_update:!0,before:e=>{e.stop=(0,i.L)(e)}});return c?[{code:500,error:c,rid:"EpQ2EDU"}]:(a.push(f.doc),[null,{docs:a}])}[n,r,s]=c.then?(await c)():c,(0,s._0)("PUT","/api/tracker-setup",p),t()}catch(l){t(l)}}))},414:e=>{e.exports=Math.round},453:(e,t,a)=>{var i,n=a(9612),r=a(9383),o=a(1237),s=a(9290),c=a(9538),p=a(8068),l=a(9675),d=a(5345),u=a(1514),m=a(8968),h=a(6188),f=a(8002),v=a(5880),x=a(414),g=a(3093),b=Function,y=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},_=a(5795),w=a(655),k=function(){throw new l},E=_?function(){try{return k}catch(e){try{return _(arguments,"callee").get}catch(e){return k}}}():k,j=a(4039)(),S=a(3628),T=a(1064),z=a(8648),A=a(1002),C=a(76),O={},P="undefined"!=typeof Uint8Array&&S?S(Uint8Array):i,N={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":j&&S?S([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":O,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":j&&S?S(S([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&j&&S?S((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&j&&S?S((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":j&&S?S(""[Symbol.iterator]()):i,"%Symbol%":j?Symbol:i,"%SyntaxError%":p,"%ThrowTypeError%":E,"%TypedArray%":P,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":A,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":T,"%Math.abs%":u,"%Math.floor%":m,"%Math.max%":h,"%Math.min%":f,"%Math.pow%":v,"%Math.round%":x,"%Math.sign%":g,"%Reflect.getPrototypeOf%":z};if(S)try{null.error}catch(e){var B=S(S(e));N["%Error.prototype%"]=B}var I=function e(t){var a;if("%AsyncFunction%"===t)a=y("async function () {}");else if("%GeneratorFunction%"===t)a=y("function* () {}");else if("%AsyncGeneratorFunction%"===t)a=y("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(a=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&S&&(a=S(n.prototype))}return N[t]=a,a},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=a(6743),q=a(9957),U=R.call(C,Array.prototype.concat),L=R.call(A,Array.prototype.splice),D=R.call(C,String.prototype.replace),F=R.call(C,String.prototype.slice),H=R.call(C,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$=/\\(\\)?/g,W=function(e,t){var a,i=e;if(q(M,i)&&(i="%"+(a=M[i])[0]+"%"),q(N,i)){var n=N[i];if(n===O&&(n=I(i)),void 0===n&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:i,value:n}}throw new p("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new p("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=function(e){var t=F(e,0,1),a=F(e,-1);if("%"===t&&"%"!==a)throw new p("invalid intrinsic syntax, expected closing `%`");if("%"===a&&"%"!==t)throw new p("invalid intrinsic syntax, expected opening `%`");var i=[];return D(e,Q,(function(e,t,a,n){i[i.length]=a?D(n,$,"$1"):t||e})),i}(e),i=a.length>0?a[0]:"",n=W("%"+i+"%",t),r=n.name,o=n.value,s=!1,c=n.alias;c&&(i=c[0],L(a,U([0,1],c)));for(var d=1,u=!0;d<a.length;d+=1){var m=a[d],h=F(m,0,1),f=F(m,-1);if(('"'===h||"'"===h||"`"===h||'"'===f||"'"===f||"`"===f)&&h!==f)throw new p("property names with quotes must have matching quotes");if("constructor"!==m&&u||(s=!0),q(N,r="%"+(i+="."+m)+"%"))o=N[r];else if(null!=o){if(!(m in o)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(_&&d+1>=a.length){var v=_(o,m);o=(u=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:o[m]}else u=q(o,m),o=o[m];u&&!s&&(N[r]=o)}}return o}},460:(e,t,a)=>{a.a(e,(async(e,t)=>{try{var i=a(4310),n=a(6667),r=a(9141),o=a(7398),s=e([i,n,o]);async function c(e){var{data:t}=e,{docs:a}=e,i=(0,r.B)(t.project_id);if(!i)return[{code:422,details:{project_id:"incorrect value"},rid:"Exb3AgP"}];var o=(0,r.B)(t.role);if("user"!==o&&"guest"!==o)return[{code:422,details:{role:"incorrect value"}}];var[s]=await(0,n.Qm)(e,i,{role:o});return s?[{...s,error:s,rid:"ERb9Cbn"}]:[null,{project_id:i,docs:a}]}[i,n,o]=s.then?(await s)():s,(0,o._0)("PUT","/api/invite-link-set",c),t()}catch(p){t(p)}}))},491:(e,t,a)=>{var i=a(9023),n={LIMIT_PART_COUNT:"Too many parts",LIMIT_FILE_SIZE:"File too large",LIMIT_FILE_COUNT:"Too many files",LIMIT_FIELD_KEY:"Field name too long",LIMIT_FIELD_VALUE:"Field value too long",LIMIT_FIELD_COUNT:"Too many fields",LIMIT_UNEXPECTED_FILE:"Unexpected field",MISSING_FIELD_NAME:"Field name missing"};function r(e,t){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=n[e],this.code=e,t&&(this.field=t)}i.inherits(r,Error),e.exports=r},507:(e,t,a)=>{var i=a(453),n=a(6556),r=a(8859),o=a(9675),s=i("%Map%",!0),c=n("Map.prototype.get",!0),p=n("Map.prototype.set",!0),l=n("Map.prototype.has",!0),d=n("Map.prototype.delete",!0),u=n("Map.prototype.size",!0);e.exports=!!s&&function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+r(e))},delete:function(t){if(e){var a=d(e,t);return 0===u(e)&&(e=void 0),a}return!1},get:function(t){if(e)return c(e,t)},has:function(t){return!!e&&l(e,t)},set:function(t,a){e||(e=new s),p(e,t,a)}};return t}},519:(e,t,a)=>{a.d(t,{A:()=>r});var i=a(7809),n=a(4764);function r(e,t){var a=(""+(e?.headers?.["accept-language"]??"")).trim(),r=(0,i.X)(a.match(/^(\w+)([-,]|$)/)?.[1])||(/yandex|YaBrowser/i.test(e?.headers?.["user-agent"])?"ru":"en"),o=(t=t??e.query?.key)&&(0,n.q4)(r.toLowerCase(),t)||"";return o&&(o=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")),o}},580:e=>{var t=/["'&<>]/;e.exports=function(e){var a,i=""+e,n=t.exec(i);if(!n)return i;var r="",o=0,s=0;for(o=n.index;o<i.length;o++){switch(i.charCodeAt(o)){case 34:a=""";break;case 38:a="&";break;case 39:a="'";break;case 60:a="<";break;case 62:a=">";break;default:continue}s!==o&&(r+=i.substring(s,o)),s=o+1,r+=a}return s!==o?r+i.substring(s,o):r}},609:(e,t,a)=>{const i=a(5182),n=a(651),r=a(2747),o=a(826),s=a(6151),c=a(238),p=a(8888),l=a(1755),d=a(7418),u=a(6710),m=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),h=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),f=(process.env.ETHEREAL_API_KEY||"").replace(/\s*/g,"")||null,v=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase());let x=!1;e.exports.createTransport=function(e,t){let a,d,u;return("object"==typeof e&&"function"!=typeof e.send||"string"==typeof e&&/^(smtps?|direct):/i.test(e))&&(d=(a="string"==typeof e?e:e.url)?n.parseConnectionUrl(a):e,e=d.pool?new r(d):d.sendmail?new s(d):d.streamTransport?new c(d):d.jsonTransport?new p(d):d.SES?new l(d):new o(d)),u=new i(e,d,t),u},e.exports.createTestAccount=function(e,t){let a;if(t||"function"!=typeof e||(t=e,e=!1),t||(a=new Promise(((e,a)=>{t=n.callbackPromise(e,a)}))),v&&x)return setImmediate((()=>t(null,x))),a;e=e||m;let i=[],r=0,o={},s={requestor:u.name,version:u.version};f&&(o.Authorization="Bearer "+f);let c=d(e+"/user",{contentType:"application/json",method:"POST",headers:o,body:Buffer.from(JSON.stringify(s))});return c.on("readable",(()=>{let e;for(;null!==(e=c.read());)i.push(e),r+=e.length})),c.once("error",(e=>t(e))),c.once("end",(()=>{let e,a,n=Buffer.concat(i,r);try{e=JSON.parse(n.toString())}catch(e){a=e}return a?t(a):"success"!==e.status||e.error?t(new Error(e.error||"Request failed")):(delete e.status,x=e,void t(null,x))})),a},e.exports.getTestMessageUrl=function(e){if(!e||!e.response)return!1;let t=new Map;return e.response.replace(/\[([^\]]+)\]$/,((e,a)=>{a.replace(/\b([A-Z0-9]+)=([^\s]+)/g,((e,a,i)=>{t.set(a,i)}))})),!(!t.has("STATUS")||!t.has("MSGID"))&&(x.web||h)+"/message/"+t.get("MSGID")}},651:(e,t,a)=>{const i=a(7016),n=a(9023),r=a(9896),o=a(7418),s=a(2250),c=a(9278),p=a(857),l=3e5;let d;try{d=p.networkInterfaces()}catch(e){}e.exports.networkInterfaces=d;const u=(t,a)=>{let i=e.exports.networkInterfaces;return!i||Object.keys(i).map((e=>i[e])).reduce(((e,t)=>e.concat(t)),[]).filter((e=>!e.internal||a)).filter((e=>e.family==="IPv"+t||e.family===t)).length>0},m=(e,t,a,i)=>{if(!u(e,(a=a||{}).allowInternalNetworkInterfaces))return i(null,[]);(s.Resolver?new s.Resolver(a):s)["resolve"+e](t,((e,t)=>{if(e){switch(e.code){case s.NODATA:case s.NOTFOUND:case s.NOTIMP:case s.SERVFAIL:case s.CONNREFUSED:case s.REFUSED:case"EAI_AGAIN":return i(null,[])}return i(e)}return i(null,Array.isArray(t)?t:[].concat(t||[]))}))},h=e.exports.dnsCache=new Map,f=(e,t)=>e?Object.assign({servername:e.servername,host:e.addresses&&e.addresses.length?1===e.addresses.length?e.addresses[0]:e.addresses[Math.floor(Math.random()*e.addresses.length)]:null},t||{}):Object.assign({},t||{});function v(e,t){let a=!1,i=[],n=0;e.on("error",(e=>{a||(a=!0,t(e))})),e.on("readable",(()=>{let t;for(;null!==(t=e.read());)i.push(t),n+=t.length})),e.on("end",(()=>{if(a)return;let e;a=!0;try{e=Buffer.concat(i,n)}catch(e){return t(e)}t(null,e)}))}e.exports.resolveHostname=(e,t)=>{if(!(e=e||{}).host&&e.servername&&(e.host=e.servername),!e.host||c.isIP(e.host)){let a={addresses:[e.host],servername:e.servername||!1};return t(null,f(a,{cached:!1}))}let a;if(h.has(e.host)&&(a=h.get(e.host),!a.expires||a.expires>=Date.now()))return t(null,f(a.value,{cached:!0}));m(4,e.host,e,((i,n)=>{if(i)return a?t(null,f(a.value,{cached:!0,error:i})):t(i);if(n&&n.length){let a={addresses:n,servername:e.servername||e.host};return h.set(e.host,{value:a,expires:Date.now()+(e.dnsTtl||l)}),t(null,f(a,{cached:!1}))}m(6,e.host,e,((i,n)=>{if(i)return a?t(null,f(a.value,{cached:!0,error:i})):t(i);if(n&&n.length){let a={addresses:n,servername:e.servername||e.host};return h.set(e.host,{value:a,expires:Date.now()+(e.dnsTtl||l)}),t(null,f(a,{cached:!1}))}try{s.lookup(e.host,{all:!0},((i,n)=>{if(i)return a?t(null,f(a.value,{cached:!0,error:i})):t(i);let r=!!n&&n.filter((e=>u(e.family))).map((e=>e.address)).shift();if(n&&n.length&&!r&&console.warn(`Failed to resolve IPv${n[0].family} addresses with current network`),!r&&a)return t(null,f(a.value,{cached:!0}));let o={addresses:r?[r]:[e.host],servername:e.servername||e.host};return h.set(e.host,{value:o,expires:Date.now()+(e.dnsTtl||l)}),t(null,f(o,{cached:!1}))}))}catch(i){return a?t(null,f(a.value,{cached:!0,error:i})):t(i)}}))}))},e.exports.parseConnectionUrl=e=>{e=e||"";let t={};return[i.parse(e,!0)].forEach((e=>{let a;switch(e.protocol){case"smtp:":t.secure=!1;break;case"smtps:":t.secure=!0;break;case"direct:":t.direct=!0}!isNaN(e.port)&&Number(e.port)&&(t.port=Number(e.port)),e.hostname&&(t.host=e.hostname),e.auth&&(a=e.auth.split(":"),t.auth||(t.auth={}),t.auth.user=a.shift(),t.auth.pass=a.join(":")),Object.keys(e.query||{}).forEach((a=>{let i=t,n=a,r=e.query[a];switch(isNaN(r)||(r=Number(r)),r){case"true":r=!0;break;case"false":r=!1}if(0===a.indexOf("tls."))n=a.substr(4),t.tls||(t.tls={}),i=t.tls;else if(a.indexOf(".")>=0)return;n in i||(i[n]=r)}))})),t},e.exports._logFunc=(e,t,a,i,n,...r)=>{let o={};Object.keys(a||{}).forEach((e=>{"level"!==e&&(o[e]=a[e])})),Object.keys(i||{}).forEach((e=>{"level"!==e&&(o[e]=i[e])})),e[t](o,n,...r)},e.exports.getLogger=(t,a)=>{let i={},r=["trace","debug","info","warn","error","fatal"];if(!(t=t||{}).logger)return r.forEach((e=>{i[e]=()=>!1})),i;let o=t.logger;return!0===t.logger&&(o=function(e){let t=0,a=new Map;e.forEach((e=>{e.length>t&&(t=e.length)})),e.forEach((e=>{let i=e.toUpperCase();i.length<t&&(i+=" ".repeat(t-i.length)),a.set(e,i)}));let i=(e,t,i,...r)=>{let o="";t&&("server"===t.tnx?o="S: ":"client"===t.tnx&&(o="C: "),t.sid&&(o="["+t.sid+"] "+o),t.cid&&(o="[#"+t.cid+"] "+o)),(i=n.format(i,...r)).split(/\r?\n/).forEach((t=>{console.log("[%s] %s %s",(new Date).toISOString().substr(0,19).replace(/T/," "),a.get(e),o+t)}))},r={};return e.forEach((e=>{r[e]=i.bind(null,e)})),r}(r)),r.forEach((t=>{i[t]=(i,n,...r)=>{e.exports._logFunc(o,t,a,i,n,...r)}})),i},e.exports.callbackPromise=(e,t)=>function(){let a=Array.from(arguments),i=a.shift();i?t(i):e(...a)},e.exports.parseDataURI=e=>{let t=e,a=t.indexOf(",");if(!a)return e;let i,n=t.substring(a+1),r=t.substring(5,a).split(";"),o=r.length>1&&r[r.length-1];o&&o.indexOf("=")<0&&(i=o.toLowerCase(),r.pop());let s=r.shift()||"application/octet-stream",c={};for(let e of r){let t=e.indexOf("=");if(t>=0){let a=e.substring(0,t),i=e.substring(t+1);c[a]=i}}switch(i){case"base64":n=Buffer.from(n,"base64");break;case"utf8":n=Buffer.from(n);break;default:try{n=Buffer.from(decodeURIComponent(n))}catch(e){n=Buffer.from(n)}n=Buffer.from(n)}return{data:n,encoding:i,contentType:s,params:c}},e.exports.resolveContent=(t,a,i)=>{let n;i||(n=new Promise(((t,a)=>{i=e.exports.callbackPromise(t,a)})));let s,c=t&&t[a]&&t[a].content||t[a],p=("object"==typeof t[a]&&t[a].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!c)return i(null,c);if("object"==typeof c){if("function"==typeof c.pipe)return v(c,((e,n)=>{if(e)return i(e);t[a].content?t[a].content=n:t[a]=n,i(null,n)}));if(/^https?:\/\//i.test(c.path||c.href))return s=o(c.path||c.href),v(s,i);if(/^data:/i.test(c.path||c.href)){let t=e.exports.parseDataURI(c.path||c.href);return t&&t.data?i(null,t.data):i(null,Buffer.from(0))}if(c.path)return v(r.createReadStream(c.path),i)}return"string"!=typeof t[a].content||["utf8","usascii","ascii"].includes(p)||(c=Buffer.from(t[a].content,p)),setImmediate((()=>i(null,c))),n},e.exports.assign=function(){let e=Array.from(arguments),t=e.shift()||{};return e.forEach((e=>{Object.keys(e||{}).forEach((a=>{["tls","auth"].includes(a)&&e[a]&&"object"==typeof e[a]?(t[a]||(t[a]={}),Object.keys(e[a]).forEach((i=>{t[a][i]=e[a][i]}))):t[a]=e[a]}))})),t},e.exports.encodeXText=e=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(e))return e;let t=Buffer.from(e),a="";for(let e=0,i=t.length;e<i;e++){let i=t[e];a+=i<33||i>126||43===i||61===i?"+"+(i<16?"0":"")+i.toString(16).toUpperCase():String.fromCharCode(i)}return a}},655:e=>{var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},691:(e,t,a)=>{a.a(e,(async(e,t)=>{try{var i=a(4310),n=a(6667),r=a(9141),o=a(7398),s=e([i,n,o]);async function c(e){var{data:t}=e,{docs:a}=e,i=(0,r.B)(t.project_id);if(!i)return[{code:422,details:{project_id:"incorrect value"},rid:"EKgJuAz"}];var[o]=await(0,n.XP)(e,i);return o?[{...o,error:o,rid:"E8alrL2"}]:[null,{project_id:i,docs:a}]}[i,n,o]=s.then?(await s)():s,(0,o._0)("PUT","/api/invite-link-reset",c),t()}catch(p){t(p)}}))},763:(e,t,a)=>{a.a(e,(async(e,i)=>{try{a.d(t,{Y:()=>l});var n=a(2483),r=a(4310),o=a(7746),s=a(8858),c=a(2347),p=(a(6874),e([n,r,o,s,c]));async function l(e){var t,{data:a}=e,{docs:i}=e,{t:s}=e,{board_id:c}=a;if(t=await(0,n.cX)(e))return[t];var[t,p]=await i.db_get_(c);if(404==t?.status)return[{code:422,details:{board_id:s("Not found")}}];if(t)return[{code:500,error:t,rid:"E00M1O0"}];var{project_id:l}=p||!1,[t]=await(0,r.YS)(e,l,"task_create");if(t)return[{...t,error:t,rid:"EtcPlSA"}];var[t,d]=await(0,o.ah)(e,{...a,id:null,project_id:l});return t?[{...t,error:t,rid:"EdVRV8B"}]:(i.push(d),[null,{task_id:d?.id,docs:i}])}[n,r,o,s,c]=p.then?(await p)():p,i()}catch(d){i(d)}}))},799:(e,t,a)=>{a.a(e,(async(e,i)=>{try{a.d(t,{E:()=>c});var n=a(4310),r=a(7746),o=a(8858),s=(a(6874),e([n,r,o]));async function c(e){var{data:t,docs:a}=e,{id:i}=t||!1,[o,s]=await a.db_get(i);if(o||"task"!==s.class)return[{code:404,error:o,msg:"55555 not found id: task_id"}];var{project_id:c}=s,[o]=await(0,n.YS)(e,c,"task_update");if(o){if(403!=o.code||c===(s.parent_project_id||c))return[{...o,error:o,rid:"EnxjCQl"}];{let[a]=await(0,n.YS)(e,s.parent_project_id,"task_update");if(a)return[{...a,error:a,rid:"EFO1i61"}];let{id:i,title:r,desc:o,state:c,сurator_id:p,is_subtask:l,parent_id:d,warn:u,title_hide:m,attachments:h,deps:f,repeat_sub:v}=t;t={id:i,title:r,desc:o,state:c,сurator_id:p,is_subtask:l,parent_id:d,warn:u,title_hide:m,attachments:h,deps:f,repeat_sub:v}}}var[o,p]=await(0,r.fd)(e,{...t,id:i});return o?[422==o.code?{...o}:{code:500,error:o}]:[null,{docs:a}]}[n,r,o]=s.then?(await s)():s,i()}catch(p){i(p)}}))},826:(e,t,a)=>{const i=a(4434),n=a(8685),r=a(5800),o=a(651),s=a(1021),c=a(6710);e.exports=class extends i{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let a=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=o.parseConnectionUrl(e.url),a=a||t.service),this.options=o.assign(!1,e,t,a&&r(a)),this.logger=o.getLogger(this.options,{component:this.options.component||"smtp-transport"});let i=new n(this.options);this.name="SMTP",this.version=c.version+"[client:"+i.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(e,t){return setImmediate((()=>t(null,!1)))}getAuth(e){if(!e)return this.auth;let t=!1,a={};if(this.options.auth&&"object"==typeof this.options.auth&&Object.keys(this.options.auth).forEach((e=>{t=!0,a[e]=this.options.auth[e]})),e&&"object"==typeof e&&Object.keys(e).forEach((i=>{t=!0,a[i]=e[i]})),!t)return!1;if("OAUTH2"===(a.type||"").toString().toUpperCase()){if(!a.service&&!a.user)return!1;let e=new s(a,this.logger);return e.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||e.provisionCallback,e.on("token",(e=>this.mailer.emit("token",e))),e.on("error",(e=>this.emit("error",e))),{type:"OAUTH2",user:a.user,oauth2:e,method:"XOAUTH2"}}return{type:(a.type||"").toString().toUpperCase()||"LOGIN",user:a.user,credentials:{user:a.user||"",pass:a.pass,options:a.options},method:(a.method||"").trim().toUpperCase()||this.options.authMethod||!1}}send(e,t){this.getSocket(this.options,((a,i)=>{if(a)return t(a);let r=!1,s=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,s.host||"",s.port||""),s=o.assign(!1,s),Object.keys(i).forEach((e=>{s[e]=i[e]})));let c=new n(s);c.once("error",(e=>{if(!r)return r=!0,c.close(),t(e)})),c.once("end",(()=>{if(r)return;let e=setTimeout((()=>{if(r)return;r=!0;let e=new Error("Unexpected socket close");c&&c._socket&&c._socket.upgrading&&(e.code="ETLS"),t(e)}),1e3);try{e.unref()}catch(e){}}));let p=()=>{let a=e.message.getEnvelope(),i=e.message.messageId(),n=[].concat(a.to||[]);n.length>3&&n.push("...and "+n.splice(2).length+" more"),e.data.dsn&&(a.dsn=e.data.dsn),this.logger.info({tnx:"send",messageId:i},"Sending message %s to <%s>",i,n.join(", ")),c.send(a,e.message.createReadStream(),((e,n)=>{if(r=!0,c.close(),e)return this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",i,e.message),t(e);n.envelope={from:a.from,to:a.to},n.messageId=i;try{return t(null,n)}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error for %s: %s",i,e.message)}}))};c.connect((()=>{if(r)return;let a=this.getAuth(e.data.auth);a&&(c.allowsAuth||s.forceAuth)?c.login(a,(e=>{if(a&&a!==this.auth&&a.oauth2&&a.oauth2.removeAllListeners(),!r)return e?(r=!0,c.close(),t(e)):void p()})):p()}))}))}verify(e){let t;return e||(t=new Promise(((t,a)=>{e=o.callbackPromise(t,a)}))),this.getSocket(this.options,((t,a)=>{if(t)return e(t);let i=this.options;a&&a.connection&&(this.logger.info({tnx:"proxy",remoteAddress:a.connection.remoteAddress,remotePort:a.connection.remotePort,destHost:i.host||"",destPort:i.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",a.connection.remoteAddress,a.connection.remotePort,i.host||"",i.port||""),i=o.assign(!1,i),Object.keys(a).forEach((e=>{i[e]=a[e]})));let r=new n(i),s=!1;r.once("error",(t=>{if(!s)return s=!0,r.close(),e(t)})),r.once("end",(()=>{if(!s)return s=!0,e(new Error("Connection closed"))}));let c=()=>{if(!s)return s=!0,r.quit(),e(null,!0)};r.connect((()=>{if(s)return;let t=this.getAuth({});if(t&&(r.allowsAuth||i.forceAuth))r.login(t,(t=>{if(!s)return t?(s=!0,r.close(),e(t)):void c()}));else{if(!t&&r.allowsAuth&&i.forceAuth){let t=new Error("Authentication info was not provided");return t.code="NoAuth",s=!0,r.close(),e(t)}c()}}))})),t}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}}},857:t=>{t.exports=e(import.meta.url)("os")},864:(e,t)=>{var a=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g,i=/^[\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/,r=/\\([\u0000-\u007f])/g,o=/([\\"])/g,s=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/,c=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/,p=/^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;function l(e){var t=S