sprof 0.0.251 → 0.0.252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sprof.js +4 -1
- package/dist/sprof.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/sprof.js
CHANGED
|
@@ -3964,7 +3964,10 @@ const ae = class ae {
|
|
|
3964
3964
|
static getDownloadFileName(e, i) {
|
|
3965
3965
|
if (e)
|
|
3966
3966
|
return e;
|
|
3967
|
-
const n = i["content-disposition"]
|
|
3967
|
+
const n = i["content-disposition"];
|
|
3968
|
+
if (!n)
|
|
3969
|
+
return "file";
|
|
3970
|
+
const s = n.indexOf('"') + 1, r = n.lastIndexOf('"'), o = n.substring(s, r);
|
|
3968
3971
|
return o || "file";
|
|
3969
3972
|
}
|
|
3970
3973
|
static getHeaders(e) {
|
package/dist/sprof.umd.cjs
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[Wr]=this[Wr]={accessors:{}}).accessors,s=this.prototype;function o(a){const d=Tt(a);r[d]||(Ec(s,a),r[d]=!0)}return w.isArray(e)?e.forEach(o):o(e),this}}we.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(we.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),w.freezeMethods(we);function ui(t,e){const n=this||Vt,r=e||n,s=we.from(r.headers);let o=r.data;return w.forEach(t,function(d){o=d.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function _r(t){return!!(t&&t.__CANCEL__)}function gt(t,e,n){F.call(this,t??"canceled",F.ERR_CANCELED,e,n),this.name="CanceledError"}w.inherits(gt,F,{__CANCEL__:!0});function Gr(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xc(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Mc(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,o=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),h=r[o];a||(a=u),n[s]=c,r[s]=u;let f=o,m=0;for(;f!==s;)m+=n[f++],f=f%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),u-a<e)return;const g=h&&u-h;return g?Math.round(m*1e3/g):void 0}}function Bc(t,e){let n=0,r=1e3/e,s,o;const a=(u,h=Date.now())=>{n=h,s=null,o&&(clearTimeout(o),o=null),t.apply(null,u)};return[(...u)=>{const h=Date.now(),f=h-n;f>=r?a(u,h):(s=u,o||(o=setTimeout(()=>{o=null,a(s)},r-f)))},()=>s&&a(s)]}const pn=(t,e,n=3)=>{let r=0;const s=Mc(50,250);return Bc(o=>{const a=o.loaded,d=o.lengthComputable?o.total:void 0,c=a-r,u=s(c),h=a<=d;r=a;const f={loaded:a,total:d,progress:d?a/d:void 0,bytes:c,rate:u||void 0,estimated:u&&d&&h?(d-a)/u:void 0,event:o,lengthComputable:d!=null,[e?"download":"upload"]:!0};t(f)},n)},Zr=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Xr=t=>(...e)=>w.asap(()=>t(...e)),$c=pe.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,pe.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,Ic=pe.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const a=[t+"="+encodeURIComponent(e)];w.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),w.isString(r)&&a.push("path="+r),w.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Rc(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function vc(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Yr(t,e){return t&&!Rc(e)?vc(t,e):e}const Jr=t=>t instanceof we?{...t}:t;function at(t,e){e=e||{};const n={};function r(u,h,f,m){return w.isPlainObject(u)&&w.isPlainObject(h)?w.merge.call({caseless:m},u,h):w.isPlainObject(h)?w.merge({},h):w.isArray(h)?h.slice():h}function s(u,h,f,m){if(w.isUndefined(h)){if(!w.isUndefined(u))return r(void 0,u,f,m)}else return r(u,h,f,m)}function o(u,h){if(!w.isUndefined(h))return r(void 0,h)}function a(u,h){if(w.isUndefined(h)){if(!w.isUndefined(u))return r(void 0,u)}else return r(void 0,h)}function d(u,h,f){if(f in e)return r(u,h);if(f in t)return r(void 0,u)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:d,headers:(u,h,f)=>s(Jr(u),Jr(h),f,!0)};return w.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=c[h]||s,m=f(t[h],e[h],h);w.isUndefined(m)&&f!==d||(n[h]=m)}),n}const Qr=t=>{const e=at({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:d}=e;e.headers=a=we.from(a),e.url=Hr(Yr(e.baseURL,e.url),t.params,t.paramsSerializer),d&&a.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let c;if(w.isFormData(n)){if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...h]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...h].join("; "))}}if(pe.hasStandardBrowserEnv&&(r&&w.isFunction(r)&&(r=r(e)),r||r!==!1&&$c(e.url))){const u=s&&o&&Ic.read(o);u&&a.set(s,u)}return e},Nc=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const s=Qr(t);let o=s.data;const a=we.from(s.headers).normalize();let{responseType:d,onUploadProgress:c,onDownloadProgress:u}=s,h,f,m,g,C;function b(){g&&g(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function I(){if(!S)return;const P=we.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),H={data:!d||d==="text"||d==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:P,config:t,request:S};Gr(function($e){n($e),b()},function($e){r($e),b()},H),S=null}"onloadend"in S?S.onloadend=I:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(I)},S.onabort=function(){S&&(r(new F("Request aborted",F.ECONNABORTED,t,S)),S=null)},S.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,t,S)),S=null},S.ontimeout=function(){let v=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const H=s.transitional||Ur;s.timeoutErrorMessage&&(v=s.timeoutErrorMessage),r(new F(v,H.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,t,S)),S=null},o===void 0&&a.setContentType(null),"setRequestHeader"in S&&w.forEach(a.toJSON(),function(v,H){S.setRequestHeader(H,v)}),w.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),d&&d!=="json"&&(S.responseType=s.responseType),u&&([m,C]=pn(u,!0),S.addEventListener("progress",m)),c&&S.upload&&([f,g]=pn(c),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(h=P=>{S&&(r(!P||P.type?new gt(null,t,S):P),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const L=xc(s.url);if(L&&pe.protocols.indexOf(L)===-1){r(new F("Unsupported protocol "+L+":",F.ERR_BAD_REQUEST,t));return}S.send(o||null)})},Ac=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,d();const h=u instanceof Error?u:this.reason;r.abort(h instanceof F?h:new gt(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,o(new F(`timeout ${e} of ms exceeded`,F.ETIMEDOUT))},e);const d=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>w.asap(d),c}},zc=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},Pc=async function*(t,e){for await(const n of Vc(t))yield*zc(n,e)},Vc=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Kr=(t,e,n,r)=>{const s=Pc(t,e);let o=0,a,d=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:h}=await s.next();if(u){d(),c.close();return}let f=h.byteLength;if(n){let m=o+=f;n(m)}c.enqueue(new Uint8Array(h))}catch(u){throw d(u),u}},cancel(c){return d(c),s.return()}},{highWaterMark:2})},gn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",es=gn&&typeof ReadableStream=="function",Tc=gn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ts=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Fc=es&&ts(()=>{let t=!1;const e=new Request(pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),ns=64*1024,hi=es&&ts(()=>w.isReadableStream(new Response("").body)),yn={stream:hi&&(t=>t.body)};gn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!yn[e]&&(yn[e]=w.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new F(`Response type '${e}' is not supported`,F.ERR_NOT_SUPPORT,r)})})})(new Response);const Oc=async t=>{if(t==null)return 0;if(w.isBlob(t))return t.size;if(w.isSpecCompliantForm(t))return(await new Request(pe.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(w.isArrayBufferView(t)||w.isArrayBuffer(t))return t.byteLength;if(w.isURLSearchParams(t)&&(t=t+""),w.isString(t))return(await Tc(t)).byteLength},Dc=async(t,e)=>{const n=w.toFiniteNumber(t.getContentLength());return n??Oc(e)},fi={http:oc,xhr:Nc,fetch:gn&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:o,timeout:a,onDownloadProgress:d,onUploadProgress:c,responseType:u,headers:h,withCredentials:f="same-origin",fetchOptions:m}=Qr(t);u=u?(u+"").toLowerCase():"text";let g=Ac([s,o&&o.toAbortSignal()],a),C;const b=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let S;try{if(c&&Fc&&n!=="get"&&n!=="head"&&(S=await Dc(h,r))!==0){let H=new Request(e,{method:"POST",body:r,duplex:"half"}),Be;if(w.isFormData(r)&&(Be=H.headers.get("content-type"))&&h.setContentType(Be),H.body){const[$e,nt]=Zr(S,pn(Xr(c)));r=Kr(H.body,ns,$e,nt)}}w.isString(f)||(f=f?"include":"omit");const I="credentials"in Request.prototype;C=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:I?f:void 0});let L=await fetch(C);const P=hi&&(u==="stream"||u==="response");if(hi&&(d||P&&b)){const H={};["status","statusText","headers"].forEach(It=>{H[It]=L[It]});const Be=w.toFiniteNumber(L.headers.get("content-length")),[$e,nt]=d&&Zr(Be,pn(Xr(d),!0))||[];L=new Response(Kr(L.body,ns,$e,()=>{nt&&nt(),b&&b()}),H)}u=u||"text";let v=await yn[w.findKey(yn,u)||"text"](L,t);return!P&&b&&b(),await new Promise((H,Be)=>{Gr(H,Be,{data:v,headers:we.from(L.headers),status:L.status,statusText:L.statusText,config:t,request:C})})}catch(I){throw b&&b(),I&&I.name==="TypeError"&&/fetch/i.test(I.message)?Object.assign(new F("Network Error",F.ERR_NETWORK,t,C),{cause:I.cause||I}):F.from(I,I&&I.code,t,C)}})};w.forEach(fi,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const is=t=>`- ${t}`,Lc=t=>w.isFunction(t)||t===null||t===!1,rs={getAdapter:t=>{t=w.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let o=0;o<e;o++){n=t[o];let a;if(r=n,!Lc(n)&&(r=fi[(a=String(n)).toLowerCase()],r===void 0))throw new F(`Unknown adapter '${a}'`);if(r)break;s[a||"#"+o]=r}if(!r){const o=Object.entries(s).map(([d,c])=>`adapter ${d} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?o.length>1?`since :
|
|
17
17
|
`+o.map(is).join(`
|
|
18
18
|
`):" "+is(o[0]):"as no adapter specified";throw new F("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:fi};function mi(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new gt(null,t)}function ss(t){return mi(t),t.headers=we.from(t.headers),t.data=ui.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),rs.getAdapter(t.adapter||Vt.adapter)(t).then(function(r){return mi(t),r.data=ui.call(t,t.transformResponse,r),r.headers=we.from(r.headers),r},function(r){return _r(r)||(mi(t),r&&r.response&&(r.response.data=ui.call(t,t.transformResponse,r.response),r.response.headers=we.from(r.response.headers))),Promise.reject(r)})}const os="1.7.9",wn={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{wn[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const as={};wn.transitional=function(e,n,r){function s(o,a){return"[Axios v"+os+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,d)=>{if(e===!1)throw new F(s(a," has been removed"+(n?" in "+n:"")),F.ERR_DEPRECATED);return n&&!as[a]&&(as[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,a,d):!0}},wn.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Hc(t,e,n){if(typeof t!="object")throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],a=e[o];if(a){const d=t[o],c=d===void 0||a(d,o,t);if(c!==!0)throw new F("option "+o+" must be "+c,F.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new F("Unknown option "+o,F.ERR_BAD_OPTION)}}const bn={assertOptions:Hc,validators:wn},Pe=bn.validators;class lt{constructor(e){this.defaults=e,this.interceptors={request:new qr,response:new qr}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
19
|
-
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=at(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&bn.assertOptions(r,{silentJSONParsing:Pe.transitional(Pe.boolean),forcedJSONParsing:Pe.transitional(Pe.boolean),clarifyTimeoutError:Pe.transitional(Pe.boolean)},!1),s!=null&&(w.isFunction(s)?n.paramsSerializer={serialize:s}:bn.assertOptions(s,{encode:Pe.function,serialize:Pe.function},!0)),bn.assertOptions(n,{baseUrl:Pe.spelling("baseURL"),withXsrfToken:Pe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=we.concat(a,o);const d=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(c=c&&b.synchronous,d.unshift(b.fulfilled,b.rejected))});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let h,f=0,m;if(!c){const C=[ss.bind(this),void 0];for(C.unshift.apply(C,d),C.push.apply(C,u),m=C.length,h=Promise.resolve(n);f<m;)h=h.then(C[f++],C[f++]);return h}m=d.length;let g=n;for(f=0;f<m;){const C=d[f++],b=d[f++];try{g=C(g)}catch(S){b.call(this,S);break}}try{h=ss.call(this,g)}catch(C){return Promise.reject(C)}for(f=0,m=u.length;f<m;)h=h.then(u[f++],u[f++]);return h}getUri(e){e=at(this.defaults,e);const n=Yr(e.baseURL,e.url);return Hr(n,e.params,e.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(e){lt.prototype[e]=function(n,r){return this.request(at(r||{},{method:e,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(r){return function(o,a,d){return this.request(at(d||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}lt.prototype[e]=n(),lt.prototype[e+"Form"]=n(!0)});class pi{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(d=>{r.subscribe(d),o=d}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},e(function(o,a,d){r.reason||(r.reason=new gt(o,a,d),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new pi(function(s){e=s}),cancel:e}}}function qc(t){return function(n){return t.apply(null,n)}}function Uc(t){return w.isObject(t)&&t.isAxiosError===!0}const gi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gi).forEach(([t,e])=>{gi[e]=t});function ls(t){const e=new lt(t),n=Mr(lt.prototype.request,e);return w.extend(n,lt.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return ls(at(t,s))},n}const K=ls(Vt);K.Axios=lt,K.CanceledError=gt,K.CancelToken=pi,K.isCancel=_r,K.VERSION=os,K.toFormData=fn,K.AxiosError=F,K.Cancel=K.CanceledError,K.all=function(e){return Promise.all(e)},K.spread=qc,K.isAxiosError=Uc,K.mergeConfig=at,K.AxiosHeaders=we,K.formToJSON=t=>jr(w.isHTMLForm(t)?new FormData(t):t),K.getAdapter=rs.getAdapter,K.HttpStatusCode=gi,K.default=K;var Ft=(t=>(t.GET="get",t.POST="post",t.PUT="put",t.DELETE="delete",t))(Ft||{});const Ot=(()=>{function t(){const c=s();return!(!c||c==="undefined")}function e(c){c.accessToken&&localStorage.setItem("access_token",c.accessToken),c.refreshToken&&localStorage.setItem("refresh_token",c.refreshToken)}function n(){const c=localStorage.getItem("user");return c?JSON.parse(c).id:""}function r(){const c=localStorage.getItem("user");if(c)return JSON.parse(c)}function s(){return localStorage.getItem("access_token")}function o(){return localStorage.getItem("refresh_token")}function a(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function d(c){if(!t())return;const u=Ot.getUser();u&&(u.human=c,localStorage.setItem("user",JSON.stringify(u)))}return{isAuth:t,setTokens:e,getAccessToken:s,getRefreshToken:o,getUserId:n,clearTokens:a,getUser:r,updateHuman:d}})();class yi{constructor(e){l(this,"code",400);l(this,"err","");$.BuildClass(this,e)}getErr(){return this.capitalizedErr()}capitalizedErr(){return this.err.charAt(0).toUpperCase()+this.err.slice(1)}static async Handle(e,n){const r=e.config;if(e.response){if(e.response.status===401&&!r._retry)return r._retry=!0,n.defaults.headers.common.token=Ot.getAccessToken(),e.config.headers.token=Ot.getAccessToken(),e.config.baseURL=void 0,n.request(r);if(e.response.status>=500){if(e.response.data==="неверный логин или пароль"){ye.Error("Неверный логин или пароль");return}ye.Error("Ошибка на сервере, попробуйте позже")}if(e.response.status>=400&&e.response.status<500){const s=new yi(e.response.data).getErr();s&&ye.Error(s)}return Promise.reject(e)}}}const yt=K.create();yt.interceptors.response.use(t=>t,async t=>await yi.Handle(t,yt));class Dt{static async Get(e,n,r){return await yt({method:Ft.GET,url:e,headers:n,responseType:r})}static async Post(e,n,r,s){return n["Content-Type"]="multipart/form-data",await yt({method:Ft.POST,url:e,headers:n,responseType:r,data:s})}static async Put(e,n,r){return n["Content-Type"]="multipart/form-data",await yt({method:Ft.PUT,url:e,headers:n,data:r})}static async Delete(e,n){return await yt({method:Ft.DELETE,url:e,headers:n})}}class Cn{constructor(e){l(this,"name","");$.BuildClass(this,e)}static Set(){}static Get(e,n){const r=sessionStorage.getItem(e);if(r){const s=JSON.parse(r),o=new Date,a=new Date(s.time),d=o.getTime()-a.getTime();return Math.round(d/6e4)>(n||10)?null:s.data}else return null}static async TryGet(e,n,r){let s;return s=Cn.Get(e,r),s||(s=await n()),s}}var wi=(t=>(t.ContentType="Content-Type",t.Token="token",t))(wi||{}),cs=(t=>(t.ApplicationJson="application/json",t.MultipartFormData="multipart/form-data",t))(cs||{});const Z=class Z{static Setup(e,n,r){this.baseUrl=e,this.apiVersion=n,this.apiHost=r}static newWebSocket(e){const n=this.apiHost.replace("http","ws")+"/ws/"+e;return new WebSocket(n)}static download(e,n){const r=Z.getDownloadFileName(e,n.headers),s=URL.createObjectURL(n.data),o=document.createElement("a");o.href=s,o.setAttribute("download",r),o.setAttribute("target","_blank"),document.body.appendChild(o),o.click()}static getDownloadFileName(e,n){if(e)return e;const r=n["content-disposition"],s=r.indexOf('"')+1,o=r.lastIndexOf('"'),a=r.substring(s,o);return a||"file"}static getHeaders(e){const n=ze.Get(Re.AccessToken);return e||(e=Z.headers),n&&(e[wi.Token]=n),e??Z.headers}static returnResponse(e,n){if(n)return e!=null&&e.isBlob?Z.download(e.downloadFileName,n):n.data}static async Get(e){return Z.returnResponse(e,await Dt.Get(Z.buildUrl((e==null?void 0:e.query)??""),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e==null?void 0:e.isBlob)))}static async Post(e){return Z.returnResponse(e,await Dt.Post(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e.isBlob),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Put(e){return Z.returnResponse(e,await Dt.Put(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Delete(e){return Z.returnResponse(e,await Dt.Delete(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers)))}static async Subscribe(e){const{query:n}=e;return new EventSource(Z.buildUrl(n))}static buildUrl(e){const n=e??"";return this.baseUrl+this.apiVersion+n}static getResponseType(e){return e?"blob":"json"}static createFormDataPayload(e,n){const r=new FormData;if(r.append("form",JSON.stringify(e)),n)for(const s of n)s.file&&r.append(s.id??"files",s.file,s.originalName);return r}};l(Z,"baseUrl",""),l(Z,"apiVersion",""),l(Z,"apiHost",""),l(Z,"headers",{[wi.ContentType]:cs.ApplicationJson});let J=Z;const E=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},jc={},Wc={style:{"text-align":"center"}};function _c(t,e){return i.openBlock(),i.createElementBlock("div",Wc,e[0]||(e[0]=[i.createElementVNode("h1",null,"Страница не найдена",-1)]))}const bi=E(jc,[["render",_c]]),Gc=[{path:"/:pathMatch(.*)*",name:"NotFound",component:bi}],Le=class Le{static Set(e){this.router=e,this.AddRoutes(Gc)}static Get(){return this.router}static AddRoutes(e){e.forEach(n=>{this.Get().addRoute(n)})}static async To(e){await this.Get().push(e)}static async ToHome(){}static async Replace(e){await this.Get().replace(e)}static Id(){return Le.GetStringParam("id")}static Slug(){return Le.GetStringParam("slug")}static async Back(){this.Get().go(-1)}static GetQid(){return Le.GetStringQueryParam("qid")}static Route(){var e;return(e=this.Get())==null?void 0:e.currentRoute.value}static RouterPushBlank(e){const n=this.Get().resolve({path:e});window.open(n==null?void 0:n.href,"_blank")}static GetPath(){var n;const e=(n=Le.Route())==null?void 0:n.path.split("/");return!e||e.length<=0?"":e[e.length-1]}static async ToAdmin(e){if(!e){await this.Get().push("/admin");return}let n=e;n[0]==="/"&&(n=e.substring(1)),await Le.To(`/admin/${n}`)}static GetStringQueryParam(e){return String(this.Route().query[e])}static GetNumberQueryParam(e){return Number(this.Route().query[e]??0)}static GetStringParam(e){var n;return(n=this.Route())==null?void 0:n.params[e]}static SetQueryParam(e,n){const r=new URL(window.location);r.searchParams.set(e,String(n)),history.replaceState(null,"",r)}static Resolve(e){return this.Get().resolve(e)}};l(Le,"router"),l(Le,"ChangeDocumentTitle",(e="")=>{let n=Le.Route().meta.title??e;n&&e&&(n=n+` | ${e}`),document.title=n});let Ve=Le;class Y{constructor(e,n){l(this,"items",i.reactive([]));l(this,"item");l(this,"count",i.ref(0));l(this,"classConstructor");l(this,"url","");this.classConstructor=e,this.item=i.reactive(new this.classConstructor),this.url=n}Set(e){Object.assign(this.item,new this.classConstructor(e))}getUrl(e){return e?`${this.url}/${e}`:this.url}async GetAll(e){let n;const r=J.Get;e&&e.withCache?n=await Cn.TryGet(this.getUrl(),r):n=await r({query:this.getUrl()}),Array.isArray(n)?this.SetAll(n):this.SetAllWithCount(n)}async Get(e){e||(e=Ve.Id()),this.Set(await J.Get({query:this.getUrl(e)}))}async GetBySlug(e){e||(e=Ve.Slug()),this.Set(await A.H.HttpClient.Get({query:this.getUrl("by-slug/"+e)}))}async FTSP(e){var a;const r=((e==null?void 0:e.ftsp)??je.Get()).clearForHTTP(),s={payload:{ftsp:r},query:this.getUrl("ftsp")},o=await J.Post(s);if(!(!o||!o.ftsp))if(Array.isArray(o.data))this.SetAll(o.data);else{if(r.p.append){this.AppendToAll((a=o.data)==null?void 0:a.items);return}this.SetAllWithCount(o.data)}}async Create(e){const n=e??this.item,r={payload:n,query:this.getUrl()};return n.getFileInfos&&(r.fileInfos=n.getFileInfos()),await J.Post(r)}async CreateAndSet(e){const n=await this.Create(e);this.Set(n)}async CreateMany(e){if(!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Create(r)))}),Promise.all(n)}async Update(e){const n=e??this.item,r={query:this.getUrl(`${n.id}`),payload:n};return n.getFileInfos&&(r.fileInfos=n.getFileInfos(),r.fileInfos.forEach(s=>s.url="")),await J.Put(r)}async UpdateAndSet(e){const n=await this.Update(e);this.Set(n)}async UpdateAndReset(e){await this.Update(e??this.item),this.Set()}async Remove(e){if(!e){console.warn("BaseStore/Remove. id is undefined");return}await J.Delete({query:this.getUrl(`${e}`)}),this.RemoveItem(e)}async UpdateMany(e){if(e||(e=this.items),!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Update(r)))}),Promise.all(n)}SetAll(e){e&&(this.items.splice(0,this.items.length),this.items.push(...e.map(n=>new this.classConstructor(n))))}SetAllWithCount(e){e&&(this.SetAll(e.items),this.count.value=e.count)}RemoveItem(e){const n=this.items.findIndex(r=>r.id===e);this.items.splice(n,1)}AppendToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.push(...n);return}this.items.push(new this.classConstructor(e))}}ResetState(){this.ResetItem(),this.ClearItems(),this.count.value=0}ResetItem(){$.BuildClass(this.item,new this.classConstructor)}ClearItems(){this.items.splice(0,this.items.length)}UnshiftToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.unshift(...n);return}this.items.unshift(new this.classConstructor(e))}}get Items(){return this.items}get Item(){return this.item}get Count(){return this.count}}function Zc(t,e){t=="left"&&e.next(),t=="right"&&e.prev()}const Xc=["#31af5e","#ff4d3b","#006BB5","#f3911c"];class Yc{static GetRandColor(e){return Ue.GetRandEL(e??Xc)}}function ds(t,e){const n=[],r=e||Ee.Asc,s=r===Ee.Asc?Ee.Desc:Ee.Asc;return Object.values(t).forEach(o=>{n.push(o(r)),n.push(o(s))}),n.length>0&&!n.some(o=>o.default)&&(n[0].default=!0),e&&n.forEach(o=>{o.default&&(o.default=o.order===e)}),n}let Jc=class{constructor(){l(this,"startHour",9);l(this,"endHour",19);l(this,"timelinePxHeight",50);l(this,"timelineStep",vt.FiveMinutes);l(this,"activeTime","");l(this,"activeObjectId","");l(this,"dragged",!1);l(this,"draggedStartTime","");l(this,"draggedEndTime","");l(this,"timelines",en[vt.FiveMinutes])}startDrag(e,n){this.draggedStartTime=e,this.draggedEndTime=n,this.dragged=!0}endDrag(){this.activeTime="",this.dragged=!1}setTimelineStep(e){this.timelineStep=e,this.setTimelines()}setTimelines(){this.timelines=en[this.timelineStep]}getScheduleHeight(){return this.getHourHeight()*this.getHoursArr().length}getHourHeight(){return this.timelinePxHeight*this.timelines.length}getHoursArr(){return Ue.GenerateNumsRange(this.startHour,this.endHour)}};const Ci=t=>t===8||t===46,Qc=t=>t>46&&t<58,Kc=t=>t>34&&t<41,ed=t=>t+".",td=(t,e,n)=>{Ci(e)||Kc(e)||(!Qc(e)||n>9)&&t.preventDefault()};function nd(t,e){if(e>8){let n=t.substring(0,2).replace(".","1");Number(n)>31&&(n="31");let r=t.substring(3,5).replace(".","1");Number(r)>12&&(r="12");let s=t.substring(6,10).replace(".","1");Number(s)>2100&&(s="2100"),t=n+"."+r+"."+s}return t}function id(t){const e=t.keyCode;let n=t.srcElement.value;const r=n.length;td(t,e,r),!Ci(e)&&(r===2||r===5)&&(n=ed(n));const s=t.srcElement.value+String.fromCharCode(t.which);if(Ci(e)){t.srcElement.value=n;return}n.length===0&&Number(s)>3&&(n="3",t.preventDefault()),n.length===1&&Number(s)>31&&(n="31",t.preventDefault()),s.length===5&&Number(s.substring(3,5))>12&&(n=n.substring(0,3)+"12",t.preventDefault()),n=nd(n,r),t.srcElement.value=n}const rd=["ВС","ПН","ВТ","СР","ЧТ","ПТ","СБ"],sd="ru-RU";class Te{constructor(){l(this,"locale","ru-RU")}static Format(e,n){if(!e)return"";const r={year:"numeric",month:"2-digit",day:"2-digit",hour:void 0,minute:void 0};return n&&(r.year=n.year||n.year===void 0?n.year:r.year,r.month=n.month||n.month===void 0?n.month:r.month,r.day=n.day||n.day===void 0?n.day:r.day,r.hour=n.hour??r.hour,r.minute=n.minute??r.minute),Intl.DateTimeFormat(sd,r).format(new Date(e))}static FormatWithTime(e){return Te.Format(e,{month:"2-digit",day:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"})}static FromRuStr(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetPeriod(e,n,r){return`${this.Format(e,r)}-${this.Format(n,r)}`}static GetShortDayName(e){return e?rd[e.getDay()]:""}static GetCurrentWeekPeriod(e){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-n.getDay()+1),s=new Date(n.getFullYear(),n.getMonth(),r.getDate()+7);return this.GetPeriod(r,s,e||{month:"2-digit",day:"numeric",year:void 0})}static GetDurationInDay(e,n){const r=new Date,s=new Date,o=Te.SplitHourTime(e),a=Te.SplitHourTime(n);return r.setHours(o[0],o[1],0,0),s.setHours(a[0],a[1],0,0),(s.getTime()-r.getTime())/1e3/60}static HourTimeinMunutes(e){const n=Te.SplitHourTime(e);return n[0]*60+n[1]}static SplitHourTime(e){const n=e.split(":");return[Number(n[0]),Number(n[1])]}static AddMinutesToHM(e,n){const r=new Date,s=Te.SplitHourTime(e);r.setHours(s[0],s[1],0,0);const o=new Date(r.getTime()+n*6e4),a=o.getHours(),d=o.getMinutes();return`${a}:${d}`}static GetMonthsDiff(e,n){return n.getMonth()-e.getMonth()+12*(n.getFullYear()-e.getFullYear())}static StringToDate(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetDateOrToday(e){return e?e.date:new Date}static InPeriod(e,n,r){return new Date(e)>=new Date(n)&&new Date(e)<=new Date(r)}static GetDatesFromPeriod(e,n){const r=[new Date(e)];let s=e;for(;s<=n;)s=Te.AddDays(s,1),r.push(s);return r}static AddDays(e,n){const r=new Date(e);return r.setDate(r.getDate()+n),r}static Eq(e,n){return e.getTime()===n.getTime()}}class od{constructor(){l(this,"dragged",!1);l(this,"dragImg",new Image);this.dragImg.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="}start(e){this.dragged=!0,e&&e.dataTransfer&&e.dataTransfer.setDragImage(this.dragImg,0,0)}end(){this.dragged=!1}isDragged(){return this.dragged}}class us{static Get(e){const n=e.split(".");return n[n.length-1]}}const ad=(()=>{function t(o,a){localStorage.setItem(`${o}_favourite`,a.toString())}function e(o,a){const d=localStorage.getItem(`${o}_favourite`);return d?d.split(",").includes(a):!1}function n(o,a){const d=localStorage.getItem(`${o}_favourite`);if(!d){t(o,[a]);return}const c=d.split(",");c.push(a),t(o,c)}function r(o,a){const d=localStorage.getItem(`${o}_favourite`);if(!d)return;const c=d.split(",").filter(u=>u!==a);t(o,c)}function s(){for(const o in localStorage)o.includes("_favourite")&&localStorage.removeItem(o)}return{addToFavourite:n,removeFromFavourite:r,setFavourite:t,isFavourite:e,clearFavourite:s}})();/*!
|
|
19
|
+
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=at(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&bn.assertOptions(r,{silentJSONParsing:Pe.transitional(Pe.boolean),forcedJSONParsing:Pe.transitional(Pe.boolean),clarifyTimeoutError:Pe.transitional(Pe.boolean)},!1),s!=null&&(w.isFunction(s)?n.paramsSerializer={serialize:s}:bn.assertOptions(s,{encode:Pe.function,serialize:Pe.function},!0)),bn.assertOptions(n,{baseUrl:Pe.spelling("baseURL"),withXsrfToken:Pe.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&w.merge(o.common,o[n.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=we.concat(a,o);const d=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(c=c&&b.synchronous,d.unshift(b.fulfilled,b.rejected))});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let h,f=0,m;if(!c){const C=[ss.bind(this),void 0];for(C.unshift.apply(C,d),C.push.apply(C,u),m=C.length,h=Promise.resolve(n);f<m;)h=h.then(C[f++],C[f++]);return h}m=d.length;let g=n;for(f=0;f<m;){const C=d[f++],b=d[f++];try{g=C(g)}catch(S){b.call(this,S);break}}try{h=ss.call(this,g)}catch(C){return Promise.reject(C)}for(f=0,m=u.length;f<m;)h=h.then(u[f++],u[f++]);return h}getUri(e){e=at(this.defaults,e);const n=Yr(e.baseURL,e.url);return Hr(n,e.params,e.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(e){lt.prototype[e]=function(n,r){return this.request(at(r||{},{method:e,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(r){return function(o,a,d){return this.request(at(d||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}lt.prototype[e]=n(),lt.prototype[e+"Form"]=n(!0)});class pi{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(d=>{r.subscribe(d),o=d}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},e(function(o,a,d){r.reason||(r.reason=new gt(o,a,d),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new pi(function(s){e=s}),cancel:e}}}function qc(t){return function(n){return t.apply(null,n)}}function Uc(t){return w.isObject(t)&&t.isAxiosError===!0}const gi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gi).forEach(([t,e])=>{gi[e]=t});function ls(t){const e=new lt(t),n=Mr(lt.prototype.request,e);return w.extend(n,lt.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return ls(at(t,s))},n}const K=ls(Vt);K.Axios=lt,K.CanceledError=gt,K.CancelToken=pi,K.isCancel=_r,K.VERSION=os,K.toFormData=fn,K.AxiosError=F,K.Cancel=K.CanceledError,K.all=function(e){return Promise.all(e)},K.spread=qc,K.isAxiosError=Uc,K.mergeConfig=at,K.AxiosHeaders=we,K.formToJSON=t=>jr(w.isHTMLForm(t)?new FormData(t):t),K.getAdapter=rs.getAdapter,K.HttpStatusCode=gi,K.default=K;var Ft=(t=>(t.GET="get",t.POST="post",t.PUT="put",t.DELETE="delete",t))(Ft||{});const Ot=(()=>{function t(){const c=s();return!(!c||c==="undefined")}function e(c){c.accessToken&&localStorage.setItem("access_token",c.accessToken),c.refreshToken&&localStorage.setItem("refresh_token",c.refreshToken)}function n(){const c=localStorage.getItem("user");return c?JSON.parse(c).id:""}function r(){const c=localStorage.getItem("user");if(c)return JSON.parse(c)}function s(){return localStorage.getItem("access_token")}function o(){return localStorage.getItem("refresh_token")}function a(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function d(c){if(!t())return;const u=Ot.getUser();u&&(u.human=c,localStorage.setItem("user",JSON.stringify(u)))}return{isAuth:t,setTokens:e,getAccessToken:s,getRefreshToken:o,getUserId:n,clearTokens:a,getUser:r,updateHuman:d}})();class yi{constructor(e){l(this,"code",400);l(this,"err","");$.BuildClass(this,e)}getErr(){return this.capitalizedErr()}capitalizedErr(){return this.err.charAt(0).toUpperCase()+this.err.slice(1)}static async Handle(e,n){const r=e.config;if(e.response){if(e.response.status===401&&!r._retry)return r._retry=!0,n.defaults.headers.common.token=Ot.getAccessToken(),e.config.headers.token=Ot.getAccessToken(),e.config.baseURL=void 0,n.request(r);if(e.response.status>=500){if(e.response.data==="неверный логин или пароль"){ye.Error("Неверный логин или пароль");return}ye.Error("Ошибка на сервере, попробуйте позже")}if(e.response.status>=400&&e.response.status<500){const s=new yi(e.response.data).getErr();s&&ye.Error(s)}return Promise.reject(e)}}}const yt=K.create();yt.interceptors.response.use(t=>t,async t=>await yi.Handle(t,yt));class Dt{static async Get(e,n,r){return await yt({method:Ft.GET,url:e,headers:n,responseType:r})}static async Post(e,n,r,s){return n["Content-Type"]="multipart/form-data",await yt({method:Ft.POST,url:e,headers:n,responseType:r,data:s})}static async Put(e,n,r){return n["Content-Type"]="multipart/form-data",await yt({method:Ft.PUT,url:e,headers:n,data:r})}static async Delete(e,n){return await yt({method:Ft.DELETE,url:e,headers:n})}}class Cn{constructor(e){l(this,"name","");$.BuildClass(this,e)}static Set(){}static Get(e,n){const r=sessionStorage.getItem(e);if(r){const s=JSON.parse(r),o=new Date,a=new Date(s.time),d=o.getTime()-a.getTime();return Math.round(d/6e4)>(n||10)?null:s.data}else return null}static async TryGet(e,n,r){let s;return s=Cn.Get(e,r),s||(s=await n()),s}}var wi=(t=>(t.ContentType="Content-Type",t.Token="token",t))(wi||{}),cs=(t=>(t.ApplicationJson="application/json",t.MultipartFormData="multipart/form-data",t))(cs||{});const Z=class Z{static Setup(e,n,r){this.baseUrl=e,this.apiVersion=n,this.apiHost=r}static newWebSocket(e){const n=this.apiHost.replace("http","ws")+"/ws/"+e;return new WebSocket(n)}static download(e,n){const r=Z.getDownloadFileName(e,n.headers),s=URL.createObjectURL(n.data),o=document.createElement("a");o.href=s,o.setAttribute("download",r),o.setAttribute("target","_blank"),document.body.appendChild(o),o.click()}static getDownloadFileName(e,n){if(e)return e;const r=n["content-disposition"];if(!r)return"file";const s=r.indexOf('"')+1,o=r.lastIndexOf('"'),a=r.substring(s,o);return a||"file"}static getHeaders(e){const n=ze.Get(Re.AccessToken);return e||(e=Z.headers),n&&(e[wi.Token]=n),e??Z.headers}static returnResponse(e,n){if(n)return e!=null&&e.isBlob?Z.download(e.downloadFileName,n):n.data}static async Get(e){return Z.returnResponse(e,await Dt.Get(Z.buildUrl((e==null?void 0:e.query)??""),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e==null?void 0:e.isBlob)))}static async Post(e){return Z.returnResponse(e,await Dt.Post(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.getResponseType(e.isBlob),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Put(e){return Z.returnResponse(e,await Dt.Put(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers),Z.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Delete(e){return Z.returnResponse(e,await Dt.Delete(Z.buildUrl(e==null?void 0:e.query),Z.getHeaders(e==null?void 0:e.headers)))}static async Subscribe(e){const{query:n}=e;return new EventSource(Z.buildUrl(n))}static buildUrl(e){const n=e??"";return this.baseUrl+this.apiVersion+n}static getResponseType(e){return e?"blob":"json"}static createFormDataPayload(e,n){const r=new FormData;if(r.append("form",JSON.stringify(e)),n)for(const s of n)s.file&&r.append(s.id??"files",s.file,s.originalName);return r}};l(Z,"baseUrl",""),l(Z,"apiVersion",""),l(Z,"apiHost",""),l(Z,"headers",{[wi.ContentType]:cs.ApplicationJson});let J=Z;const E=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},jc={},Wc={style:{"text-align":"center"}};function _c(t,e){return i.openBlock(),i.createElementBlock("div",Wc,e[0]||(e[0]=[i.createElementVNode("h1",null,"Страница не найдена",-1)]))}const bi=E(jc,[["render",_c]]),Gc=[{path:"/:pathMatch(.*)*",name:"NotFound",component:bi}],Le=class Le{static Set(e){this.router=e,this.AddRoutes(Gc)}static Get(){return this.router}static AddRoutes(e){e.forEach(n=>{this.Get().addRoute(n)})}static async To(e){await this.Get().push(e)}static async ToHome(){}static async Replace(e){await this.Get().replace(e)}static Id(){return Le.GetStringParam("id")}static Slug(){return Le.GetStringParam("slug")}static async Back(){this.Get().go(-1)}static GetQid(){return Le.GetStringQueryParam("qid")}static Route(){var e;return(e=this.Get())==null?void 0:e.currentRoute.value}static RouterPushBlank(e){const n=this.Get().resolve({path:e});window.open(n==null?void 0:n.href,"_blank")}static GetPath(){var n;const e=(n=Le.Route())==null?void 0:n.path.split("/");return!e||e.length<=0?"":e[e.length-1]}static async ToAdmin(e){if(!e){await this.Get().push("/admin");return}let n=e;n[0]==="/"&&(n=e.substring(1)),await Le.To(`/admin/${n}`)}static GetStringQueryParam(e){return String(this.Route().query[e])}static GetNumberQueryParam(e){return Number(this.Route().query[e]??0)}static GetStringParam(e){var n;return(n=this.Route())==null?void 0:n.params[e]}static SetQueryParam(e,n){const r=new URL(window.location);r.searchParams.set(e,String(n)),history.replaceState(null,"",r)}static Resolve(e){return this.Get().resolve(e)}};l(Le,"router"),l(Le,"ChangeDocumentTitle",(e="")=>{let n=Le.Route().meta.title??e;n&&e&&(n=n+` | ${e}`),document.title=n});let Ve=Le;class Y{constructor(e,n){l(this,"items",i.reactive([]));l(this,"item");l(this,"count",i.ref(0));l(this,"classConstructor");l(this,"url","");this.classConstructor=e,this.item=i.reactive(new this.classConstructor),this.url=n}Set(e){Object.assign(this.item,new this.classConstructor(e))}getUrl(e){return e?`${this.url}/${e}`:this.url}async GetAll(e){let n;const r=J.Get;e&&e.withCache?n=await Cn.TryGet(this.getUrl(),r):n=await r({query:this.getUrl()}),Array.isArray(n)?this.SetAll(n):this.SetAllWithCount(n)}async Get(e){e||(e=Ve.Id()),this.Set(await J.Get({query:this.getUrl(e)}))}async GetBySlug(e){e||(e=Ve.Slug()),this.Set(await A.H.HttpClient.Get({query:this.getUrl("by-slug/"+e)}))}async FTSP(e){var a;const r=((e==null?void 0:e.ftsp)??je.Get()).clearForHTTP(),s={payload:{ftsp:r},query:this.getUrl("ftsp")},o=await J.Post(s);if(!(!o||!o.ftsp))if(Array.isArray(o.data))this.SetAll(o.data);else{if(r.p.append){this.AppendToAll((a=o.data)==null?void 0:a.items);return}this.SetAllWithCount(o.data)}}async Create(e){const n=e??this.item,r={payload:n,query:this.getUrl()};return n.getFileInfos&&(r.fileInfos=n.getFileInfos()),await J.Post(r)}async CreateAndSet(e){const n=await this.Create(e);this.Set(n)}async CreateMany(e){if(!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Create(r)))}),Promise.all(n)}async Update(e){const n=e??this.item,r={query:this.getUrl(`${n.id}`),payload:n};return n.getFileInfos&&(r.fileInfos=n.getFileInfos(),r.fileInfos.forEach(s=>s.url="")),await J.Put(r)}async UpdateAndSet(e){const n=await this.Update(e);this.Set(n)}async UpdateAndReset(e){await this.Update(e??this.item),this.Set()}async Remove(e){if(!e){console.warn("BaseStore/Remove. id is undefined");return}await J.Delete({query:this.getUrl(`${e}`)}),this.RemoveItem(e)}async UpdateMany(e){if(e||(e=this.items),!e)return;const n=[];e.forEach(r=>{n.push(new Promise(()=>this.Update(r)))}),Promise.all(n)}SetAll(e){e&&(this.items.splice(0,this.items.length),this.items.push(...e.map(n=>new this.classConstructor(n))))}SetAllWithCount(e){e&&(this.SetAll(e.items),this.count.value=e.count)}RemoveItem(e){const n=this.items.findIndex(r=>r.id===e);this.items.splice(n,1)}AppendToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.push(...n);return}this.items.push(new this.classConstructor(e))}}ResetState(){this.ResetItem(),this.ClearItems(),this.count.value=0}ResetItem(){$.BuildClass(this.item,new this.classConstructor)}ClearItems(){this.items.splice(0,this.items.length)}UnshiftToAll(e){if(e){if(Array.isArray(e)){const n=e.map(r=>new this.classConstructor(r));this.items.unshift(...n);return}this.items.unshift(new this.classConstructor(e))}}get Items(){return this.items}get Item(){return this.item}get Count(){return this.count}}function Zc(t,e){t=="left"&&e.next(),t=="right"&&e.prev()}const Xc=["#31af5e","#ff4d3b","#006BB5","#f3911c"];class Yc{static GetRandColor(e){return Ue.GetRandEL(e??Xc)}}function ds(t,e){const n=[],r=e||Ee.Asc,s=r===Ee.Asc?Ee.Desc:Ee.Asc;return Object.values(t).forEach(o=>{n.push(o(r)),n.push(o(s))}),n.length>0&&!n.some(o=>o.default)&&(n[0].default=!0),e&&n.forEach(o=>{o.default&&(o.default=o.order===e)}),n}let Jc=class{constructor(){l(this,"startHour",9);l(this,"endHour",19);l(this,"timelinePxHeight",50);l(this,"timelineStep",vt.FiveMinutes);l(this,"activeTime","");l(this,"activeObjectId","");l(this,"dragged",!1);l(this,"draggedStartTime","");l(this,"draggedEndTime","");l(this,"timelines",en[vt.FiveMinutes])}startDrag(e,n){this.draggedStartTime=e,this.draggedEndTime=n,this.dragged=!0}endDrag(){this.activeTime="",this.dragged=!1}setTimelineStep(e){this.timelineStep=e,this.setTimelines()}setTimelines(){this.timelines=en[this.timelineStep]}getScheduleHeight(){return this.getHourHeight()*this.getHoursArr().length}getHourHeight(){return this.timelinePxHeight*this.timelines.length}getHoursArr(){return Ue.GenerateNumsRange(this.startHour,this.endHour)}};const Ci=t=>t===8||t===46,Qc=t=>t>46&&t<58,Kc=t=>t>34&&t<41,ed=t=>t+".",td=(t,e,n)=>{Ci(e)||Kc(e)||(!Qc(e)||n>9)&&t.preventDefault()};function nd(t,e){if(e>8){let n=t.substring(0,2).replace(".","1");Number(n)>31&&(n="31");let r=t.substring(3,5).replace(".","1");Number(r)>12&&(r="12");let s=t.substring(6,10).replace(".","1");Number(s)>2100&&(s="2100"),t=n+"."+r+"."+s}return t}function id(t){const e=t.keyCode;let n=t.srcElement.value;const r=n.length;td(t,e,r),!Ci(e)&&(r===2||r===5)&&(n=ed(n));const s=t.srcElement.value+String.fromCharCode(t.which);if(Ci(e)){t.srcElement.value=n;return}n.length===0&&Number(s)>3&&(n="3",t.preventDefault()),n.length===1&&Number(s)>31&&(n="31",t.preventDefault()),s.length===5&&Number(s.substring(3,5))>12&&(n=n.substring(0,3)+"12",t.preventDefault()),n=nd(n,r),t.srcElement.value=n}const rd=["ВС","ПН","ВТ","СР","ЧТ","ПТ","СБ"],sd="ru-RU";class Te{constructor(){l(this,"locale","ru-RU")}static Format(e,n){if(!e)return"";const r={year:"numeric",month:"2-digit",day:"2-digit",hour:void 0,minute:void 0};return n&&(r.year=n.year||n.year===void 0?n.year:r.year,r.month=n.month||n.month===void 0?n.month:r.month,r.day=n.day||n.day===void 0?n.day:r.day,r.hour=n.hour??r.hour,r.minute=n.minute??r.minute),Intl.DateTimeFormat(sd,r).format(new Date(e))}static FormatWithTime(e){return Te.Format(e,{month:"2-digit",day:"2-digit",year:"numeric",hour:"numeric",minute:"numeric"})}static FromRuStr(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetPeriod(e,n,r){return`${this.Format(e,r)}-${this.Format(n,r)}`}static GetShortDayName(e){return e?rd[e.getDay()]:""}static GetCurrentWeekPeriod(e){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-n.getDay()+1),s=new Date(n.getFullYear(),n.getMonth(),r.getDate()+7);return this.GetPeriod(r,s,e||{month:"2-digit",day:"numeric",year:void 0})}static GetDurationInDay(e,n){const r=new Date,s=new Date,o=Te.SplitHourTime(e),a=Te.SplitHourTime(n);return r.setHours(o[0],o[1],0,0),s.setHours(a[0],a[1],0,0),(s.getTime()-r.getTime())/1e3/60}static HourTimeinMunutes(e){const n=Te.SplitHourTime(e);return n[0]*60+n[1]}static SplitHourTime(e){const n=e.split(":");return[Number(n[0]),Number(n[1])]}static AddMinutesToHM(e,n){const r=new Date,s=Te.SplitHourTime(e);r.setHours(s[0],s[1],0,0);const o=new Date(r.getTime()+n*6e4),a=o.getHours(),d=o.getMinutes();return`${a}:${d}`}static GetMonthsDiff(e,n){return n.getMonth()-e.getMonth()+12*(n.getFullYear()-e.getFullYear())}static StringToDate(e){const n=e.split(".");return new Date(`${n[2]}-${n[1]}-${n[0]}`)}static GetDateOrToday(e){return e?e.date:new Date}static InPeriod(e,n,r){return new Date(e)>=new Date(n)&&new Date(e)<=new Date(r)}static GetDatesFromPeriod(e,n){const r=[new Date(e)];let s=e;for(;s<=n;)s=Te.AddDays(s,1),r.push(s);return r}static AddDays(e,n){const r=new Date(e);return r.setDate(r.getDate()+n),r}static Eq(e,n){return e.getTime()===n.getTime()}}class od{constructor(){l(this,"dragged",!1);l(this,"dragImg",new Image);this.dragImg.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="}start(e){this.dragged=!0,e&&e.dataTransfer&&e.dataTransfer.setDragImage(this.dragImg,0,0)}end(){this.dragged=!1}isDragged(){return this.dragged}}class us{static Get(e){const n=e.split(".");return n[n.length-1]}}const ad=(()=>{function t(o,a){localStorage.setItem(`${o}_favourite`,a.toString())}function e(o,a){const d=localStorage.getItem(`${o}_favourite`);return d?d.split(",").includes(a):!1}function n(o,a){const d=localStorage.getItem(`${o}_favourite`);if(!d){t(o,[a]);return}const c=d.split(",");c.push(a),t(o,c)}function r(o,a){const d=localStorage.getItem(`${o}_favourite`);if(!d)return;const c=d.split(",").filter(u=>u!==a);t(o,c)}function s(){for(const o in localStorage)o.includes("_favourite")&&localStorage.removeItem(o)}return{addToFavourite:n,removeFromFavourite:r,setFavourite:t,isFavourite:e,clearFavourite:s}})();/*!
|
|
20
20
|
* vue-router v4.5.0
|
|
21
21
|
* (c) 2024 Eduardo San Martin Morote
|
|
22
22
|
* @license MIT
|
package/package.json
CHANGED