sprof 0.0.86 → 0.0.87

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 CHANGED
@@ -10513,7 +10513,8 @@ const dg = [
10513
10513
  return this.Route().params[e];
10514
10514
  }
10515
10515
  static SetQueryParam(e, i) {
10516
- new URL(window.location).searchParams.set(e, i);
10516
+ const n = new URL(window.location);
10517
+ n.searchParams.set(e, String(i)), history.replaceState(null, "", n);
10517
10518
  }
10518
10519
  static Resolve(e) {
10519
10520
  return this.Get().resolve(e);
@@ -35,7 +35,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
35
35
  `)}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(o=>r.set(o)),r}static accessor(e){const r=(this[bs]=this[bs]={accessors:{}}).accessors,o=this.prototype;function s(a){const c=Mt(a);r[c]||(rh(o,a),r[c]=!0)}return C.isArray(e)?e.forEach(s):s(e),this}}me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),C.reduceDescriptors(me.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),C.freezeMethods(me);function ri(t,e){const n=this||Bt,r=e||n,o=me.from(r.headers);let s=r.data;return C.forEach(t,function(c){s=c.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function Cs(t){return!!(t&&t.__CANCEL__)}function ct(t,e,n){D.call(this,t??"canceled",D.ERR_CANCELED,e,n),this.name="CanceledError"}C.inherits(ct,D,{__CANCEL__:!0});function Ss(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new D("Request failed with status code "+n.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function oh(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function sh(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,a;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),h=r[s];a||(a=u),n[o]=l,r[o]=u;let f=s,m=0;for(;f!==o;)m+=n[f++],f=f%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),u-a<e)return;const g=h&&u-h;return g?Math.round(m*1e3/g):void 0}}function ah(t,e){let n=0,r=1e3/e,o,s;const a=(u,h=Date.now())=>{n=h,o=null,s&&(clearTimeout(s),s=null),t.apply(null,u)};return[(...u)=>{const h=Date.now(),f=h-n;f>=r?a(u,h):(o=u,s||(s=setTimeout(()=>{s=null,a(o)},r-f)))},()=>o&&a(o)]}const un=(t,e,n=3)=>{let r=0;const o=sh(50,250);return ah(s=>{const a=s.loaded,c=s.lengthComputable?s.total:void 0,l=a-r,u=o(l),h=a<=c;r=a;const f={loaded:a,total:c,progress:c?a/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&h?(c-a)/u:void 0,event:s,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(f)},n)},ks=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Es=t=>(...e)=>C.asap(()=>t(...e)),lh=fe.hasStandardBrowserEnv?function(){const e=fe.navigator&&/(msie|trident)/i.test(fe.navigator.userAgent),n=document.createElement("a");let r;function o(s){let a=s;return e&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(a){const c=C.isString(a)?o(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),ch=fe.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const a=[t+"="+encodeURIComponent(e)];C.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),C.isString(r)&&a.push("path="+r),C.isString(o)&&a.push("domain="+o),s===!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 dh(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function uh(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function vs(t,e){return t&&!dh(e)?uh(t,e):e}const xs=t=>t instanceof me?{...t}:t;function Qe(t,e){e=e||{};const n={};function r(u,h,f){return C.isPlainObject(u)&&C.isPlainObject(h)?C.merge.call({caseless:f},u,h):C.isPlainObject(h)?C.merge({},h):C.isArray(h)?h.slice():h}function o(u,h,f){if(C.isUndefined(h)){if(!C.isUndefined(u))return r(void 0,u,f)}else return r(u,h,f)}function s(u,h){if(!C.isUndefined(h))return r(void 0,h)}function a(u,h){if(C.isUndefined(h)){if(!C.isUndefined(u))return r(void 0,u)}else return r(void 0,h)}function c(u,h,f){if(f in e)return r(u,h);if(f in t)return r(void 0,u)}const l={url:s,method:s,data:s,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:c,headers:(u,h)=>o(xs(u),xs(h),!0)};return C.forEach(Object.keys(Object.assign({},t,e)),function(h){const f=l[h]||o,m=f(t[h],e[h],h);C.isUndefined(m)&&f!==c||(n[h]=m)}),n}const Bs=t=>{const e=Qe({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:c}=e;e.headers=a=me.from(a),e.url=ps(vs(e.baseURL,e.url),t.params,t.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(C.isFormData(n)){if(fe.hasStandardBrowserEnv||fe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((l=a.getContentType())!==!1){const[u,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...h].join("; "))}}if(fe.hasStandardBrowserEnv&&(r&&C.isFunction(r)&&(r=r(e)),r||r!==!1&&lh(e.url))){const u=o&&s&&ch.read(s);u&&a.set(o,u)}return e},hh=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Bs(t);let s=o.data;const a=me.from(o.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:u}=o,h,f,m,g,p;function E(){g&&g(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(h),o.signal&&o.signal.removeEventListener("abort",h)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function M(){if(!w)return;const L=me.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),z={data:!c||c==="text"||c==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:L,config:t,request:w};Ss(function(ke){n(ke),E()},function(ke){r(ke),E()},z),w=null}"onloadend"in w?w.onloadend=M:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(M)},w.onabort=function(){w&&(r(new D("Request aborted",D.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new D("Network Error",D.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let F=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const z=o.transitional||ys;o.timeoutErrorMessage&&(F=o.timeoutErrorMessage),r(new D(F,z.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,t,w)),w=null},s===void 0&&a.setContentType(null),"setRequestHeader"in w&&C.forEach(a.toJSON(),function(F,z){w.setRequestHeader(z,F)}),C.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),c&&c!=="json"&&(w.responseType=o.responseType),u&&([m,p]=un(u,!0),w.addEventListener("progress",m)),l&&w.upload&&([f,g]=un(l),w.upload.addEventListener("progress",f),w.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(h=L=>{w&&(r(!L||L.type?new ct(null,t,w):L),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(h),o.signal&&(o.signal.aborted?h():o.signal.addEventListener("abort",h)));const O=oh(o.url);if(O&&fe.protocols.indexOf(O)===-1){r(new D("Unsupported protocol "+O+":",D.ERR_BAD_REQUEST,t));return}w.send(s||null)})},fh=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const s=function(u){if(!o){o=!0,c();const h=u instanceof Error?u:this.reason;r.abort(h instanceof D?h:new ct(h instanceof Error?h.message:h))}};let a=e&&setTimeout(()=>{a=null,s(new D(`timeout ${e} of ms exceeded`,D.ETIMEDOUT))},e);const c=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>C.asap(c),l}},mh=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},ph=async function*(t,e){for await(const n of gh(t))yield*mh(n,e)},gh=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()}},Ms=(t,e,n,r)=>{const o=ph(t,e);let s=0,a,c=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await o.next();if(u){c(),l.close();return}let f=h.byteLength;if(n){let m=s+=f;n(m)}l.enqueue(new Uint8Array(h))}catch(u){throw c(u),u}},cancel(l){return c(l),o.return()}},{highWaterMark:2})},hn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Is=hn&&typeof ReadableStream=="function",yh=hn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Rs=(t,...e)=>{try{return!!t(...e)}catch{return!1}},wh=Is&&Rs(()=>{let t=!1;const e=new Request(fe.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),$s=64*1024,oi=Is&&Rs(()=>C.isReadableStream(new Response("").body)),fn={stream:oi&&(t=>t.body)};hn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!fn[e]&&(fn[e]=C.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new D(`Response type '${e}' is not supported`,D.ERR_NOT_SUPPORT,r)})})})(new Response);const bh=async t=>{if(t==null)return 0;if(C.isBlob(t))return t.size;if(C.isSpecCompliantForm(t))return(await new Request(fe.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(C.isArrayBufferView(t)||C.isArrayBuffer(t))return t.byteLength;if(C.isURLSearchParams(t)&&(t=t+""),C.isString(t))return(await yh(t)).byteLength},Ch=async(t,e)=>{const n=C.toFiniteNumber(t.getContentLength());return n??bh(e)},si={http:Hu,xhr:hh,fetch:hn&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:a,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:h,withCredentials:f="same-origin",fetchOptions:m}=Bs(t);u=u?(u+"").toLowerCase():"text";let g=fh([o,s&&s.toAbortSignal()],a),p;const E=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let w;try{if(l&&wh&&n!=="get"&&n!=="head"&&(w=await Ch(h,r))!==0){let z=new Request(e,{method:"POST",body:r,duplex:"half"}),we;if(C.isFormData(r)&&(we=z.headers.get("content-type"))&&h.setContentType(we),z.body){const[ke,je]=ks(w,un(Es(l)));r=Ms(z.body,$s,ke,je)}}C.isString(f)||(f=f?"include":"omit");const M="credentials"in Request.prototype;p=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:M?f:void 0});let O=await fetch(p);const L=oi&&(u==="stream"||u==="response");if(oi&&(c||L&&E)){const z={};["status","statusText","headers"].forEach(pt=>{z[pt]=O[pt]});const we=C.toFiniteNumber(O.headers.get("content-length")),[ke,je]=c&&ks(we,un(Es(c),!0))||[];O=new Response(Ms(O.body,$s,ke,()=>{je&&je(),E&&E()}),z)}u=u||"text";let F=await fn[C.findKey(fn,u)||"text"](O,t);return!L&&E&&E(),await new Promise((z,we)=>{Ss(z,we,{data:F,headers:me.from(O.headers),status:O.status,statusText:O.statusText,config:t,request:p})})}catch(M){throw E&&E(),M&&M.name==="TypeError"&&/fetch/i.test(M.message)?Object.assign(new D("Network Error",D.ERR_NETWORK,t,p),{cause:M.cause||M}):D.from(M,M&&M.code,t,p)}})};C.forEach(si,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const As=t=>`- ${t}`,Sh=t=>C.isFunction(t)||t===null||t===!1,Ns={getAdapter:t=>{t=C.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!Sh(n)&&(r=si[(a=String(n)).toLowerCase()],r===void 0))throw new D(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+s]=r}if(!r){const s=Object.entries(o).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
36
36
  `+s.map(As).join(`
37
37
  `):" "+As(s[0]):"as no adapter specified";throw new D("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:si};function ai(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ct(null,t)}function Ps(t){return ai(t),t.headers=me.from(t.headers),t.data=ri.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ns.getAdapter(t.adapter||Bt.adapter)(t).then(function(r){return ai(t),r.data=ri.call(t,t.transformResponse,r),r.headers=me.from(r.headers),r},function(r){return Cs(r)||(ai(t),r&&r.response&&(r.response.data=ri.call(t,t.transformResponse,r.response),r.response.headers=me.from(r.response.headers))),Promise.reject(r)})}const zs="1.7.7",li={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{li[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Vs={};li.transitional=function(e,n,r){function o(s,a){return"[Axios v"+zs+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,c)=>{if(e===!1)throw new D(o(a," has been removed"+(n?" in "+n:"")),D.ERR_DEPRECATED);return n&&!Vs[a]&&(Vs[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,c):!0}};function kh(t,e,n){if(typeof t!="object")throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],a=e[s];if(a){const c=t[s],l=c===void 0||a(c,s,t);if(l!==!0)throw new D("option "+s+" must be "+l,D.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new D("Unknown option "+s,D.ERR_BAD_OPTION)}}const ci={assertOptions:kh,validators:li},Ue=ci.validators;class Ke{constructor(e){this.defaults=e,this.interceptors={request:new gs,response:new gs}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
38
- `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Qe(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ci.assertOptions(r,{silentJSONParsing:Ue.transitional(Ue.boolean),forcedJSONParsing:Ue.transitional(Ue.boolean),clarifyTimeoutError:Ue.transitional(Ue.boolean)},!1),o!=null&&(C.isFunction(o)?n.paramsSerializer={serialize:o}:ci.assertOptions(o,{encode:Ue.function,serialize:Ue.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&C.merge(s.common,s[n.method]);s&&C.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=me.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(l=l&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const u=[];this.interceptors.response.forEach(function(E){u.push(E.fulfilled,E.rejected)});let h,f=0,m;if(!l){const p=[Ps.bind(this),void 0];for(p.unshift.apply(p,c),p.push.apply(p,u),m=p.length,h=Promise.resolve(n);f<m;)h=h.then(p[f++],p[f++]);return h}m=c.length;let g=n;for(f=0;f<m;){const p=c[f++],E=c[f++];try{g=p(g)}catch(w){E.call(this,w);break}}try{h=Ps.call(this,g)}catch(p){return Promise.reject(p)}for(f=0,m=u.length;f<m;)h=h.then(u[f++],u[f++]);return h}getUri(e){e=Qe(this.defaults,e);const n=vs(e.baseURL,e.url);return ps(n,e.params,e.paramsSerializer)}}C.forEach(["delete","get","head","options"],function(e){Ke.prototype[e]=function(n,r){return this.request(Qe(r||{},{method:e,url:n,data:(r||{}).data}))}}),C.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(Qe(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ke.prototype[e]=n(),Ke.prototype[e+"Form"]=n(!0)});class di{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new ct(s,a,c),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 di(function(o){e=o}),cancel:e}}}function Eh(t){return function(n){return t.apply(null,n)}}function vh(t){return C.isObject(t)&&t.isAxiosError===!0}const ui={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(ui).forEach(([t,e])=>{ui[e]=t});function Ts(t){const e=new Ke(t),n=Ko(Ke.prototype.request,e);return C.extend(n,Ke.prototype,e,{allOwnKeys:!0}),C.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Ts(Qe(t,o))},n}const Q=Ts(Bt);Q.Axios=Ke,Q.CanceledError=ct,Q.CancelToken=di,Q.isCancel=Cs,Q.VERSION=zs,Q.toFormData=cn,Q.AxiosError=D,Q.Cancel=Q.CanceledError,Q.all=function(e){return Promise.all(e)},Q.spread=Eh,Q.isAxiosError=vh,Q.mergeConfig=Qe,Q.AxiosHeaders=me,Q.formToJSON=t=>ws(C.isHTMLForm(t)?new FormData(t):t),Q.getAdapter=Ns.getAdapter,Q.HttpStatusCode=ui,Q.default=Q;var It=(t=>(t.GET="get",t.POST="post",t.PUT="put",t.DELETE="delete",t))(It||{});const Rt=(()=>{function t(){const l=o();return!(!l||l==="undefined")}function e(l){l.accessToken&&localStorage.setItem("access_token",l.accessToken),l.refreshToken&&localStorage.setItem("refresh_token",l.refreshToken)}function n(){const l=localStorage.getItem("user");return l?JSON.parse(l).id:""}function r(){const l=localStorage.getItem("user");if(l)return JSON.parse(l)}function o(){return localStorage.getItem("access_token")}function s(){return localStorage.getItem("refresh_token")}function a(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function c(l){if(!t())return;const u=Rt.getUser();u&&(u.human=l,localStorage.setItem("user",JSON.stringify(u)))}return{isAuth:t,setTokens:e,getAccessToken:o,getRefreshToken:s,getUserId:n,clearTokens:a,getUser:r,updateHuman:c}})();class hi{constructor(e){d(this,"code",400);d(this,"err","");T.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=Rt.getAccessToken(),e.config.headers.token=Rt.getAccessToken(),e.config.baseURL=void 0,n.request(r);if(e.response.status>=500){if(e.response.data==="неверный логин или пароль"){kt.Error("Неверный логин или пароль");return}kt.Error("Ошибка на сервере, попробуйте позже")}if(e.response.status>=400&&e.response.status<500){const o=new hi(e.response.data).getErr();o&&kt.Error(o)}return Promise.reject(e)}}}const dt=Q.create();dt.interceptors.response.use(t=>t,async t=>await hi.Handle(t,dt));class $t{static async Get(e,n,r){return await dt({method:It.GET,url:e,headers:n,responseType:r})}static async Post(e,n,r,o){return n["Content-Type"]="multipart/form-data",await dt({method:It.POST,url:e,headers:n,responseType:r,data:o})}static async Put(e,n,r){return n["Content-Type"]="multipart/form-data",await dt({method:It.PUT,url:e,headers:n,data:r})}static async Delete(e,n){return await dt({method:It.DELETE,url:e,headers:n})}}class mn{constructor(e){d(this,"name","");T.BuildClass(this,e)}static Set(){}static Get(e,n){const r=sessionStorage.getItem(e);if(r){const o=JSON.parse(r),s=new Date,a=new Date(o.time),c=s.getTime()-a.getTime();return Math.round(c/6e4)>(n||10)?null:o.data}else return null}static async TryGet(e,n,r){let o;return o=mn.Get(e,r),o||(o=await n()),o}}var fi=(t=>(t.ContentType="Content-Type",t.Token="token",t))(fi||{}),Fs=(t=>(t.ApplicationJson="application/json",t.MultipartFormData="multipart/form-data",t))(Fs||{});const G=class G{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=G.getDownloadFileName(e,n.headers),o=URL.createObjectURL(n.data),s=document.createElement("a");s.href=o,s.setAttribute("download",r),s.setAttribute("target","_blank"),document.body.appendChild(s),s.click()}static getDownloadFileName(e,n){if(e)return e;const r=n["content-disposition"],o=r.indexOf('"')+1,s=r.lastIndexOf('"'),a=r.substring(o,s);return a||"file"}static getHeaders(e){const n=Ie.Get(Se.AccessToken);return e||(e=G.headers),n&&(e[fi.Token]=n),e??G.headers}static returnResponse(e,n){if(n)return e!=null&&e.isBlob?G.download(e.downloadFileName,n):n.data}static async Get(e){return G.returnResponse(e,await $t.Get(G.buildUrl((e==null?void 0:e.query)??""),G.getHeaders(e==null?void 0:e.headers),G.getResponseType(e==null?void 0:e.isBlob)))}static async Post(e){return G.returnResponse(e,await $t.Post(G.buildUrl(e==null?void 0:e.query),G.getHeaders(e==null?void 0:e.headers),G.getResponseType(e.isBlob),G.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Put(e){return G.returnResponse(e,await $t.Put(G.buildUrl(e==null?void 0:e.query),G.getHeaders(e==null?void 0:e.headers),G.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Delete(e){return G.returnResponse(e,await $t.Delete(G.buildUrl(e==null?void 0:e.query),G.getHeaders(e==null?void 0:e.headers)))}static async Subscribe(e){const{query:n}=e;return new EventSource(G.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 o of n)o.file&&r.append(o.id??"files",o.file,o.originalName);return r}};d(G,"baseUrl",""),d(G,"apiVersion",""),d(G,"apiHost",""),d(G,"headers",{[fi.ContentType]:Fs.ApplicationJson});let le=G;const xh=[{path:"/",redirect:"/login"},{path:"/login",component:_n,meta:{layout:"LoginLayout"}},{path:"/:pathMatch(.*)*",name:"NotFound",component:Wn}],We=class We{static Set(e){this.router=e,this.AddRoutes(xh)}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 We.GetStringParam("id")}static Slug(){return We.GetStringParam("slug")}static async Back(){this.Get().go(-1)}static GetQid(){return We.GetStringQueryParam("qid")}static Route(){return this.Get().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=We.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 We.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){return this.Route().params[e]}static SetQueryParam(e,n){new URL(window.location).searchParams.set(e,n)}static Resolve(e){return this.Get().resolve(e)}};d(We,"router");let _e=We;class X{constructor(e,n){d(this,"items",i.reactive([]));d(this,"item");d(this,"count",i.ref(0));d(this,"classConstructor");d(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))}Item(){return this.item}getUrl(e){return e?`${this.url}/${e}`:this.url}async GetAll(e){let n;const r=le.Get;e&&e.withCache?n=await mn.TryGet(this.getUrl(),r):n=await r({query:this.getUrl()}),Array.isArray(n)?this.SetAll(n):this.SetAllWithCount(n)}async Get(e){e||(e=_e.Id()),this.Set(await le.Get({query:this.getUrl(e)}))}async FTSP(e){var a;const r=((e==null?void 0:e.ftsp)??Qo.Get()).clearForHTTP(),o={payload:{ftsp:r},query:this.getUrl("ftsp")},s=await le.Post(o);if(!(!s||!s.ftsp))if(Array.isArray(s.data))this.SetAll(s.data);else{if(r.p.append){this.AppendToAll((a=s.data)==null?void 0:a.items);return}this.SetAllWithCount(s.data)}}async Create(e){const n=e??this.item,r={payload:n,query:this.getUrl()};return n.getFileInfos&&(r.fileInfos=n.getFileInfos(),r.fileInfos.forEach(o=>o.url="")),await le.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(o=>o.url="")),await le.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 le.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(){T.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))}}Items(){return this.items}Count(){return this.count}}function Bh(t,e){t=="left"&&e.next(),t=="right"&&e.prev()}const Mh=["#31af5e","#ff4d3b","#006BB5","#f3911c"];class Ih{static GetRandColor(e){return He.GetRandEL(e??Mh)}}let Rh=class{constructor(){d(this,"startHour",9);d(this,"endHour",19);d(this,"timelinePxHeight",50);d(this,"timelineStep",Ct.FiveMinutes);d(this,"activeTime","");d(this,"activeObjectId","");d(this,"dragged",!1);d(this,"draggedStartTime","");d(this,"draggedEndTime","");d(this,"timelines",Kt[Ct.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=Kt[this.timelineStep]}getScheduleHeight(){return this.getHourHeight()*this.getHoursArr().length}getHourHeight(){return this.timelinePxHeight*this.timelines.length}getHoursArr(){return He.GenerateNumsRange(this.startHour,this.endHour)}};const mi=t=>t===8||t===46,$h=t=>t>46&&t<58,Ah=t=>t>34&&t<41,Nh=t=>t+".",Ph=(t,e,n)=>{mi(e)||Ah(e)||(!$h(e)||n>9)&&t.preventDefault()};function zh(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 o=t.substring(6,10).replace(".","1");Number(o)>2100&&(o="2100"),t=n+"."+r+"."+o}return t}function Vh(t){const e=t.keyCode;let n=t.srcElement.value;const r=n.length;Ph(t,e,r),!mi(e)&&(r===2||r===5)&&(n=Nh(n));const o=t.srcElement.value+String.fromCharCode(t.which);if(mi(e)){t.srcElement.value=n;return}n.length===0&&Number(o)>3&&(n="3",t.preventDefault()),n.length===1&&Number(o)>31&&(n="31",t.preventDefault()),o.length===5&&Number(o.substring(3,5))>12&&(n=n.substring(0,3)+"12",t.preventDefault()),n=zh(n,r),t.srcElement.value=n}class Th{constructor(){d(this,"dragged",!1);d(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 Fh{static Get(e){const n=e.split(".");return n[n.length-1]}}const Dh=(()=>{function t(s,a){localStorage.setItem(`${s}_favourite`,a.toString())}function e(s,a){const c=localStorage.getItem(`${s}_favourite`);return c?c.split(",").includes(a):!1}function n(s,a){const c=localStorage.getItem(`${s}_favourite`);if(!c){t(s,[a]);return}const l=c.split(",");l.push(a),t(s,l)}function r(s,a){const c=localStorage.getItem(`${s}_favourite`);if(!c)return;const l=c.split(",").filter(u=>u!==a);t(s,l)}function o(){for(const s in localStorage)s.includes("_favourite")&&localStorage.removeItem(s)}return{addToFavourite:n,removeFromFavourite:r,setFavourite:t,isFavourite:e,clearFavourite:o}})();/*!
38
+ `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Qe(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ci.assertOptions(r,{silentJSONParsing:Ue.transitional(Ue.boolean),forcedJSONParsing:Ue.transitional(Ue.boolean),clarifyTimeoutError:Ue.transitional(Ue.boolean)},!1),o!=null&&(C.isFunction(o)?n.paramsSerializer={serialize:o}:ci.assertOptions(o,{encode:Ue.function,serialize:Ue.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&C.merge(s.common,s[n.method]);s&&C.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=me.concat(a,s);const c=[];let l=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(l=l&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const u=[];this.interceptors.response.forEach(function(E){u.push(E.fulfilled,E.rejected)});let h,f=0,m;if(!l){const p=[Ps.bind(this),void 0];for(p.unshift.apply(p,c),p.push.apply(p,u),m=p.length,h=Promise.resolve(n);f<m;)h=h.then(p[f++],p[f++]);return h}m=c.length;let g=n;for(f=0;f<m;){const p=c[f++],E=c[f++];try{g=p(g)}catch(w){E.call(this,w);break}}try{h=Ps.call(this,g)}catch(p){return Promise.reject(p)}for(f=0,m=u.length;f<m;)h=h.then(u[f++],u[f++]);return h}getUri(e){e=Qe(this.defaults,e);const n=vs(e.baseURL,e.url);return ps(n,e.params,e.paramsSerializer)}}C.forEach(["delete","get","head","options"],function(e){Ke.prototype[e]=function(n,r){return this.request(Qe(r||{},{method:e,url:n,data:(r||{}).data}))}}),C.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,c){return this.request(Qe(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ke.prototype[e]=n(),Ke.prototype[e+"Form"]=n(!0)});class di{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(c=>{r.subscribe(c),s=c}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,c){r.reason||(r.reason=new ct(s,a,c),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 di(function(o){e=o}),cancel:e}}}function Eh(t){return function(n){return t.apply(null,n)}}function vh(t){return C.isObject(t)&&t.isAxiosError===!0}const ui={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(ui).forEach(([t,e])=>{ui[e]=t});function Ts(t){const e=new Ke(t),n=Ko(Ke.prototype.request,e);return C.extend(n,Ke.prototype,e,{allOwnKeys:!0}),C.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Ts(Qe(t,o))},n}const Q=Ts(Bt);Q.Axios=Ke,Q.CanceledError=ct,Q.CancelToken=di,Q.isCancel=Cs,Q.VERSION=zs,Q.toFormData=cn,Q.AxiosError=D,Q.Cancel=Q.CanceledError,Q.all=function(e){return Promise.all(e)},Q.spread=Eh,Q.isAxiosError=vh,Q.mergeConfig=Qe,Q.AxiosHeaders=me,Q.formToJSON=t=>ws(C.isHTMLForm(t)?new FormData(t):t),Q.getAdapter=Ns.getAdapter,Q.HttpStatusCode=ui,Q.default=Q;var It=(t=>(t.GET="get",t.POST="post",t.PUT="put",t.DELETE="delete",t))(It||{});const Rt=(()=>{function t(){const l=o();return!(!l||l==="undefined")}function e(l){l.accessToken&&localStorage.setItem("access_token",l.accessToken),l.refreshToken&&localStorage.setItem("refresh_token",l.refreshToken)}function n(){const l=localStorage.getItem("user");return l?JSON.parse(l).id:""}function r(){const l=localStorage.getItem("user");if(l)return JSON.parse(l)}function o(){return localStorage.getItem("access_token")}function s(){return localStorage.getItem("refresh_token")}function a(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}function c(l){if(!t())return;const u=Rt.getUser();u&&(u.human=l,localStorage.setItem("user",JSON.stringify(u)))}return{isAuth:t,setTokens:e,getAccessToken:o,getRefreshToken:s,getUserId:n,clearTokens:a,getUser:r,updateHuman:c}})();class hi{constructor(e){d(this,"code",400);d(this,"err","");T.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=Rt.getAccessToken(),e.config.headers.token=Rt.getAccessToken(),e.config.baseURL=void 0,n.request(r);if(e.response.status>=500){if(e.response.data==="неверный логин или пароль"){kt.Error("Неверный логин или пароль");return}kt.Error("Ошибка на сервере, попробуйте позже")}if(e.response.status>=400&&e.response.status<500){const o=new hi(e.response.data).getErr();o&&kt.Error(o)}return Promise.reject(e)}}}const dt=Q.create();dt.interceptors.response.use(t=>t,async t=>await hi.Handle(t,dt));class $t{static async Get(e,n,r){return await dt({method:It.GET,url:e,headers:n,responseType:r})}static async Post(e,n,r,o){return n["Content-Type"]="multipart/form-data",await dt({method:It.POST,url:e,headers:n,responseType:r,data:o})}static async Put(e,n,r){return n["Content-Type"]="multipart/form-data",await dt({method:It.PUT,url:e,headers:n,data:r})}static async Delete(e,n){return await dt({method:It.DELETE,url:e,headers:n})}}class mn{constructor(e){d(this,"name","");T.BuildClass(this,e)}static Set(){}static Get(e,n){const r=sessionStorage.getItem(e);if(r){const o=JSON.parse(r),s=new Date,a=new Date(o.time),c=s.getTime()-a.getTime();return Math.round(c/6e4)>(n||10)?null:o.data}else return null}static async TryGet(e,n,r){let o;return o=mn.Get(e,r),o||(o=await n()),o}}var fi=(t=>(t.ContentType="Content-Type",t.Token="token",t))(fi||{}),Fs=(t=>(t.ApplicationJson="application/json",t.MultipartFormData="multipart/form-data",t))(Fs||{});const G=class G{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=G.getDownloadFileName(e,n.headers),o=URL.createObjectURL(n.data),s=document.createElement("a");s.href=o,s.setAttribute("download",r),s.setAttribute("target","_blank"),document.body.appendChild(s),s.click()}static getDownloadFileName(e,n){if(e)return e;const r=n["content-disposition"],o=r.indexOf('"')+1,s=r.lastIndexOf('"'),a=r.substring(o,s);return a||"file"}static getHeaders(e){const n=Ie.Get(Se.AccessToken);return e||(e=G.headers),n&&(e[fi.Token]=n),e??G.headers}static returnResponse(e,n){if(n)return e!=null&&e.isBlob?G.download(e.downloadFileName,n):n.data}static async Get(e){return G.returnResponse(e,await $t.Get(G.buildUrl((e==null?void 0:e.query)??""),G.getHeaders(e==null?void 0:e.headers),G.getResponseType(e==null?void 0:e.isBlob)))}static async Post(e){return G.returnResponse(e,await $t.Post(G.buildUrl(e==null?void 0:e.query),G.getHeaders(e==null?void 0:e.headers),G.getResponseType(e.isBlob),G.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Put(e){return G.returnResponse(e,await $t.Put(G.buildUrl(e==null?void 0:e.query),G.getHeaders(e==null?void 0:e.headers),G.createFormDataPayload(e==null?void 0:e.payload,e==null?void 0:e.fileInfos)))}static async Delete(e){return G.returnResponse(e,await $t.Delete(G.buildUrl(e==null?void 0:e.query),G.getHeaders(e==null?void 0:e.headers)))}static async Subscribe(e){const{query:n}=e;return new EventSource(G.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 o of n)o.file&&r.append(o.id??"files",o.file,o.originalName);return r}};d(G,"baseUrl",""),d(G,"apiVersion",""),d(G,"apiHost",""),d(G,"headers",{[fi.ContentType]:Fs.ApplicationJson});let le=G;const xh=[{path:"/",redirect:"/login"},{path:"/login",component:_n,meta:{layout:"LoginLayout"}},{path:"/:pathMatch(.*)*",name:"NotFound",component:Wn}],We=class We{static Set(e){this.router=e,this.AddRoutes(xh)}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 We.GetStringParam("id")}static Slug(){return We.GetStringParam("slug")}static async Back(){this.Get().go(-1)}static GetQid(){return We.GetStringQueryParam("qid")}static Route(){return this.Get().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=We.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 We.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){return this.Route().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)}};d(We,"router");let _e=We;class X{constructor(e,n){d(this,"items",i.reactive([]));d(this,"item");d(this,"count",i.ref(0));d(this,"classConstructor");d(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))}Item(){return this.item}getUrl(e){return e?`${this.url}/${e}`:this.url}async GetAll(e){let n;const r=le.Get;e&&e.withCache?n=await mn.TryGet(this.getUrl(),r):n=await r({query:this.getUrl()}),Array.isArray(n)?this.SetAll(n):this.SetAllWithCount(n)}async Get(e){e||(e=_e.Id()),this.Set(await le.Get({query:this.getUrl(e)}))}async FTSP(e){var a;const r=((e==null?void 0:e.ftsp)??Qo.Get()).clearForHTTP(),o={payload:{ftsp:r},query:this.getUrl("ftsp")},s=await le.Post(o);if(!(!s||!s.ftsp))if(Array.isArray(s.data))this.SetAll(s.data);else{if(r.p.append){this.AppendToAll((a=s.data)==null?void 0:a.items);return}this.SetAllWithCount(s.data)}}async Create(e){const n=e??this.item,r={payload:n,query:this.getUrl()};return n.getFileInfos&&(r.fileInfos=n.getFileInfos(),r.fileInfos.forEach(o=>o.url="")),await le.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(o=>o.url="")),await le.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 le.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(){T.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))}}Items(){return this.items}Count(){return this.count}}function Bh(t,e){t=="left"&&e.next(),t=="right"&&e.prev()}const Mh=["#31af5e","#ff4d3b","#006BB5","#f3911c"];class Ih{static GetRandColor(e){return He.GetRandEL(e??Mh)}}let Rh=class{constructor(){d(this,"startHour",9);d(this,"endHour",19);d(this,"timelinePxHeight",50);d(this,"timelineStep",Ct.FiveMinutes);d(this,"activeTime","");d(this,"activeObjectId","");d(this,"dragged",!1);d(this,"draggedStartTime","");d(this,"draggedEndTime","");d(this,"timelines",Kt[Ct.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=Kt[this.timelineStep]}getScheduleHeight(){return this.getHourHeight()*this.getHoursArr().length}getHourHeight(){return this.timelinePxHeight*this.timelines.length}getHoursArr(){return He.GenerateNumsRange(this.startHour,this.endHour)}};const mi=t=>t===8||t===46,$h=t=>t>46&&t<58,Ah=t=>t>34&&t<41,Nh=t=>t+".",Ph=(t,e,n)=>{mi(e)||Ah(e)||(!$h(e)||n>9)&&t.preventDefault()};function zh(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 o=t.substring(6,10).replace(".","1");Number(o)>2100&&(o="2100"),t=n+"."+r+"."+o}return t}function Vh(t){const e=t.keyCode;let n=t.srcElement.value;const r=n.length;Ph(t,e,r),!mi(e)&&(r===2||r===5)&&(n=Nh(n));const o=t.srcElement.value+String.fromCharCode(t.which);if(mi(e)){t.srcElement.value=n;return}n.length===0&&Number(o)>3&&(n="3",t.preventDefault()),n.length===1&&Number(o)>31&&(n="31",t.preventDefault()),o.length===5&&Number(o.substring(3,5))>12&&(n=n.substring(0,3)+"12",t.preventDefault()),n=zh(n,r),t.srcElement.value=n}class Th{constructor(){d(this,"dragged",!1);d(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 Fh{static Get(e){const n=e.split(".");return n[n.length-1]}}const Dh=(()=>{function t(s,a){localStorage.setItem(`${s}_favourite`,a.toString())}function e(s,a){const c=localStorage.getItem(`${s}_favourite`);return c?c.split(",").includes(a):!1}function n(s,a){const c=localStorage.getItem(`${s}_favourite`);if(!c){t(s,[a]);return}const l=c.split(",");l.push(a),t(s,l)}function r(s,a){const c=localStorage.getItem(`${s}_favourite`);if(!c)return;const l=c.split(",").filter(u=>u!==a);t(s,l)}function o(){for(const s in localStorage)s.includes("_favourite")&&localStorage.removeItem(s)}return{addToFavourite:n,removeFromFavourite:r,setFavourite:t,isFavourite:e,clearFavourite:o}})();/*!
39
39
  * vue-router v4.4.5
40
40
  * (c) 2024 Eduardo San Martin Morote
41
41
  * @license MIT
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sprof",
3
3
  "description": "components for the designer and uikit",
4
4
  "author": "Stanislav Lushnikov, Daniil Gaivoronskiy",
5
- "version": "0.0.86",
5
+ "version": "0.0.87",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "./dist/sprof.umd.cjs",