shared-ritm 1.3.54 → 1.3.56

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.
@@ -17333,6 +17333,9 @@ class TS extends kn {
17333
17333
  async getUser(n) {
17334
17334
  return await this.get(`/admin/users/${n}`);
17335
17335
  }
17336
+ async changeUserPassword(n) {
17337
+ return await this.patch("/v2/auth/users/password", n);
17338
+ }
17336
17339
  async getUserWarehouses(n) {
17337
17340
  return await this.get("users/get_warehouse_list_by_user", { params: n });
17338
17341
  }
@@ -4,7 +4,7 @@
4
4
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(g){return g instanceof this?g:new this(g)}static concat(g,...B){const Q=new this(g);return B.forEach(w=>Q.set(w)),Q}static accessor(g){const Q=(this[mY]=this[mY]={accessors:{}}).accessors,w=this.prototype;function C(E){const e=kC(E);Q[e]||(xd(w,E),Q[e]=!0)}return O.isArray(g)?g.forEach(C):C(g),this}};Dg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(Dg.prototype,({value:A},g)=>{let B=g[0].toUpperCase()+g.slice(1);return{get:()=>A,set(Q){this[B]=Q}}}),O.freezeMethods(Dg);function GI(A,g){const B=this||vC,Q=g||B,w=Dg.from(Q.headers);let C=Q.data;return O.forEach(A,function(e){C=e.call(B,C,w.normalize(),g?g.status:void 0)}),w.normalize(),C}function NY(A){return!!(A&&A.__CANCEL__)}function bw(A,g,B){ZA.call(this,A??"canceled",ZA.ERR_CANCELED,g,B),this.name="CanceledError"}O.inherits(bw,ZA,{__CANCEL__:!0});function RY(A,g,B){const Q=B.config.validateStatus;!B.status||!Q||Q(B.status)?A(B):g(new ZA("Request failed with status code "+B.status,[ZA.ERR_BAD_REQUEST,ZA.ERR_BAD_RESPONSE][Math.floor(B.status/100)-4],B.config,B.request,B))}function Xd(A){const g=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return g&&g[1]||""}function Od(A,g){A=A||10;const B=new Array(A),Q=new Array(A);let w=0,C=0,E;return g=g!==void 0?g:1e3,function(t){const o=Date.now(),n=Q[C];E||(E=o),B[w]=t,Q[w]=o;let i=C,c=0;for(;i!==w;)c+=B[i++],i=i%A;if(w=(w+1)%A,w===C&&(C=(C+1)%A),o-E<g)return;const Y=n&&o-n;return Y?Math.round(c*1e3/Y):void 0}}function Zd(A,g){let B=0,Q=1e3/g,w,C;const E=(o,n=Date.now())=>{B=n,w=null,C&&(clearTimeout(C),C=null),A(...o)};return[(...o)=>{const n=Date.now(),i=n-B;i>=Q?E(o,n):(w=o,C||(C=setTimeout(()=>{C=null,E(w)},Q-i)))},()=>w&&E(w)]}const $E=(A,g,B=3)=>{let Q=0;const w=Od(50,250);return Zd(C=>{const E=C.loaded,e=C.lengthComputable?C.total:void 0,t=E-Q,o=w(t),n=E<=e;Q=E;const i={loaded:E,total:e,progress:e?E/e:void 0,bytes:t,rate:o||void 0,estimated:o&&e&&n?(e-E)/o:void 0,event:C,lengthComputable:e!=null,[g?"download":"upload"]:!0};A(i)},B)},PY=(A,g)=>{const B=A!=null;return[Q=>g[0]({lengthComputable:B,total:A,loaded:Q}),g[1]]},vY=A=>(...g)=>O.asap(()=>A(...g)),qd=Eg.hasStandardBrowserEnv?((A,g)=>B=>(B=new URL(B,Eg.origin),A.protocol===B.protocol&&A.host===B.host&&(g||A.port===B.port)))(new URL(Eg.origin),Eg.navigator&&/(msie|trident)/i.test(Eg.navigator.userAgent)):()=>!0,_d=Eg.hasStandardBrowserEnv?{write(A,g,B,Q,w,C,E){if(typeof document>"u")return;const e=[`${A}=${encodeURIComponent(g)}`];O.isNumber(B)&&e.push(`expires=${new Date(B).toUTCString()}`),O.isString(Q)&&e.push(`path=${Q}`),O.isString(w)&&e.push(`domain=${w}`),C===!0&&e.push("secure"),O.isString(E)&&e.push(`SameSite=${E}`),document.cookie=e.join("; ")},read(A){if(typeof document>"u")return null;const g=document.cookie.match(new RegExp("(?:^|; )"+A+"=([^;]*)"));return g?decodeURIComponent(g[1]):null},remove(A){this.write(A,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function $d(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function AH(A,g){return g?A.replace(/\/?\/$/,"")+"/"+g.replace(/^\/+/,""):A}function kY(A,g,B){let Q=!$d(g);return A&&(Q||B==!1)?AH(A,g):g}const TY=A=>A instanceof Dg?{...A}:A;function Bw(A,g){g=g||{};const B={};function Q(o,n,i,c){return O.isPlainObject(o)&&O.isPlainObject(n)?O.merge.call({caseless:c},o,n):O.isPlainObject(n)?O.merge({},n):O.isArray(n)?n.slice():n}function w(o,n,i,c){if(O.isUndefined(n)){if(!O.isUndefined(o))return Q(void 0,o,i,c)}else return Q(o,n,i,c)}function C(o,n){if(!O.isUndefined(n))return Q(void 0,n)}function E(o,n){if(O.isUndefined(n)){if(!O.isUndefined(o))return Q(void 0,o)}else return Q(void 0,n)}function e(o,n,i){if(i in g)return Q(o,n);if(i in A)return Q(void 0,o)}const t={url:C,method:C,data:C,baseURL:E,transformRequest:E,transformResponse:E,paramsSerializer:E,timeout:E,timeoutMessage:E,withCredentials:E,withXSRFToken:E,adapter:E,responseType:E,xsrfCookieName:E,xsrfHeaderName:E,onUploadProgress:E,onDownloadProgress:E,decompress:E,maxContentLength:E,maxBodyLength:E,beforeRedirect:E,transport:E,httpAgent:E,httpsAgent:E,cancelToken:E,socketPath:E,responseEncoding:E,validateStatus:e,headers:(o,n,i)=>w(TY(o),TY(n),i,!0)};return O.forEach(Object.keys({...A,...g}),function(n){const i=t[n]||w,c=i(A[n],g[n],n);O.isUndefined(c)&&i!==e||(B[n]=c)}),B}const jY=A=>{const g=Bw({},A);let{data:B,withXSRFToken:Q,xsrfHeaderName:w,xsrfCookieName:C,headers:E,auth:e}=g;if(g.headers=E=Dg.from(E),g.url=dY(kY(g.baseURL,g.url,g.allowAbsoluteUrls),A.params,A.paramsSerializer),e&&E.set("Authorization","Basic "+btoa((e.username||"")+":"+(e.password?unescape(encodeURIComponent(e.password)):""))),O.isFormData(B)){if(Eg.hasStandardBrowserEnv||Eg.hasStandardBrowserWebWorkerEnv)E.setContentType(void 0);else if(O.isFunction(B.getHeaders)){const t=B.getHeaders(),o=["content-type","content-length"];Object.entries(t).forEach(([n,i])=>{o.includes(n.toLowerCase())&&E.set(n,i)})}}if(Eg.hasStandardBrowserEnv&&(Q&&O.isFunction(Q)&&(Q=Q(g)),Q||Q!==!1&&qd(g.url))){const t=w&&C&&_d.read(C);t&&E.set(w,t)}return g},BH=typeof XMLHttpRequest<"u"&&function(A){return new Promise(function(B,Q){const w=jY(A);let C=w.data;const E=Dg.from(w.headers).normalize();let{responseType:e,onUploadProgress:t,onDownloadProgress:o}=w,n,i,c,Y,M;function D(){Y&&Y(),M&&M(),w.cancelToken&&w.cancelToken.unsubscribe(n),w.signal&&w.signal.removeEventListener("abort",n)}let r=new XMLHttpRequest;r.open(w.method.toUpperCase(),w.url,!0),r.timeout=w.timeout;function F(){if(!r)return;const s=Dg.from("getAllResponseHeaders"in r&&r.getAllResponseHeaders()),l={data:!e||e==="text"||e==="json"?r.responseText:r.response,status:r.status,statusText:r.statusText,headers:s,config:A,request:r};RY(function(G){B(G),D()},function(G){Q(G),D()},l),r=null}"onloadend"in r?r.onloadend=F:r.onreadystatechange=function(){!r||r.readyState!==4||r.status===0&&!(r.responseURL&&r.responseURL.indexOf("file:")===0)||setTimeout(F)},r.onabort=function(){r&&(Q(new ZA("Request aborted",ZA.ECONNABORTED,A,r)),r=null)},r.onerror=function(a){const l=a&&a.message?a.message:"Network Error",U=new ZA(l,ZA.ERR_NETWORK,A,r);U.event=a||null,Q(U),r=null},r.ontimeout=function(){let a=w.timeout?"timeout of "+w.timeout+"ms exceeded":"timeout exceeded";const l=w.transitional||fY;w.timeoutErrorMessage&&(a=w.timeoutErrorMessage),Q(new ZA(a,l.clarifyTimeoutError?ZA.ETIMEDOUT:ZA.ECONNABORTED,A,r)),r=null},C===void 0&&E.setContentType(null),"setRequestHeader"in r&&O.forEach(E.toJSON(),function(a,l){r.setRequestHeader(l,a)}),O.isUndefined(w.withCredentials)||(r.withCredentials=!!w.withCredentials),e&&e!=="json"&&(r.responseType=w.responseType),o&&([c,M]=$E(o,!0),r.addEventListener("progress",c)),t&&r.upload&&([i,Y]=$E(t),r.upload.addEventListener("progress",i),r.upload.addEventListener("loadend",Y)),(w.cancelToken||w.signal)&&(n=s=>{r&&(Q(!s||s.type?new bw(null,A,r):s),r.abort(),r=null)},w.cancelToken&&w.cancelToken.subscribe(n),w.signal&&(w.signal.aborted?n():w.signal.addEventListener("abort",n)));const u=Xd(w.url);if(u&&Eg.protocols.indexOf(u)===-1){Q(new ZA("Unsupported protocol "+u+":",ZA.ERR_BAD_REQUEST,A));return}r.send(C||null)})},gH=(A,g)=>{const{length:B}=A=A?A.filter(Boolean):[];if(g||B){let Q=new AbortController,w;const C=function(o){if(!w){w=!0,e();const n=o instanceof Error?o:this.reason;Q.abort(n instanceof ZA?n:new bw(n instanceof Error?n.message:n))}};let E=g&&setTimeout(()=>{E=null,C(new ZA(`timeout ${g} of ms exceeded`,ZA.ETIMEDOUT))},g);const e=()=>{A&&(E&&clearTimeout(E),E=null,A.forEach(o=>{o.unsubscribe?o.unsubscribe(C):o.removeEventListener("abort",C)}),A=null)};A.forEach(o=>o.addEventListener("abort",C));const{signal:t}=Q;return t.unsubscribe=()=>O.asap(e),t}},QH=function*(A,g){let B=A.byteLength;if(B<g){yield A;return}let Q=0,w;for(;Q<B;)w=Q+g,yield A.slice(Q,w),Q=w},wH=async function*(A,g){for await(const B of CH(A))yield*QH(B,g)},CH=async function*(A){if(A[Symbol.asyncIterator]){yield*A;return}const g=A.getReader();try{for(;;){const{done:B,value:Q}=await g.read();if(B)break;yield Q}}finally{await g.cancel()}},yY=(A,g,B,Q)=>{const w=wH(A,g);let C=0,E,e=t=>{E||(E=!0,Q&&Q(t))};return new ReadableStream({async pull(t){try{const{done:o,value:n}=await w.next();if(o){e(),t.close();return}let i=n.byteLength;if(B){let c=C+=i;B(c)}t.enqueue(new Uint8Array(n))}catch(o){throw e(o),o}},cancel(t){return e(t),w.return()}},{highWaterMark:2})},zY=64*1024,{isFunction:Ae}=O,EH=(({Request:A,Response:g})=>({Request:A,Response:g}))(O.global),{ReadableStream:pY,TextEncoder:WY}=O.global,bY=(A,...g)=>{try{return!!A(...g)}catch{return!1}},eH=A=>{A=O.merge.call({skipUndefined:!0},EH,A);const{fetch:g,Request:B,Response:Q}=A,w=g?Ae(g):typeof fetch=="function",C=Ae(B),E=Ae(Q);if(!w)return!1;const e=w&&Ae(pY),t=w&&(typeof WY=="function"?(M=>D=>M.encode(D))(new WY):async M=>new Uint8Array(await new B(M).arrayBuffer())),o=C&&e&&bY(()=>{let M=!1;const D=new B(Eg.origin,{body:new pY,method:"POST",get duplex(){return M=!0,"half"}}).headers.has("Content-Type");return M&&!D}),n=E&&e&&bY(()=>O.isReadableStream(new Q("").body)),i={stream:n&&(M=>M.body)};w&&["text","arrayBuffer","blob","formData","stream"].forEach(M=>{!i[M]&&(i[M]=(D,r)=>{let F=D&&D[M];if(F)return F.call(D);throw new ZA(`Response type '${M}' is not supported`,ZA.ERR_NOT_SUPPORT,r)})});const c=async M=>{if(M==null)return 0;if(O.isBlob(M))return M.size;if(O.isSpecCompliantForm(M))return(await new B(Eg.origin,{method:"POST",body:M}).arrayBuffer()).byteLength;if(O.isArrayBufferView(M)||O.isArrayBuffer(M))return M.byteLength;if(O.isURLSearchParams(M)&&(M=M+""),O.isString(M))return(await t(M)).byteLength},Y=async(M,D)=>{const r=O.toFiniteNumber(M.getContentLength());return r??c(D)};return async M=>{let{url:D,method:r,data:F,signal:u,cancelToken:s,timeout:a,onDownloadProgress:l,onUploadProgress:U,responseType:G,headers:d,withCredentials:H="same-origin",fetchOptions:h}=jY(M),f=g||fetch;G=G?(G+"").toLowerCase():"text";let J=gH([u,s&&s.toAbortSignal()],a),y=null;const m=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let k;try{if(U&&o&&r!=="get"&&r!=="head"&&(k=await Y(d,F))!==0){let j=new B(D,{method:"POST",body:F,duplex:"half"}),z;if(O.isFormData(F)&&(z=j.headers.get("content-type"))&&d.setContentType(z),j.body){const[K,$]=PY(k,$E(vY(U)));F=yY(j.body,zY,K,$)}}O.isString(H)||(H=H?"include":"omit");const p=C&&"credentials"in B.prototype,R={...h,signal:J,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:F,duplex:"half",credentials:p?H:void 0};y=C&&new B(D,R);let v=await(C?f(y,h):f(D,R));const S=n&&(G==="stream"||G==="response");if(n&&(l||S&&m)){const j={};["status","statusText","headers"].forEach(CA=>{j[CA]=v[CA]});const z=O.toFiniteNumber(v.headers.get("content-length")),[K,$]=l&&PY(z,$E(vY(l),!0))||[];v=new Q(yY(v.body,zY,K,()=>{$&&$(),m&&m()}),j)}G=G||"text";let x=await i[O.findKey(i,G)||"text"](v,M);return!S&&m&&m(),await new Promise((j,z)=>{RY(j,z,{data:x,headers:Dg.from(v.headers),status:v.status,statusText:v.statusText,config:M,request:y})})}catch(p){throw m&&m(),p&&p.name==="TypeError"&&/Load failed|fetch/i.test(p.message)?Object.assign(new ZA("Network Error",ZA.ERR_NETWORK,M,y),{cause:p.cause||p}):ZA.from(p,p&&p.code,M,y)}}},tH=new Map,SY=A=>{let g=A&&A.env||{};const{fetch:B,Request:Q,Response:w}=g,C=[Q,w,B];let E=C.length,e=E,t,o,n=tH;for(;e--;)t=C[e],o=n.get(t),o===void 0&&n.set(t,o=e?new Map:eH(g)),n=o;return o};SY();const dI={http:md,xhr:BH,fetch:{get:SY}};O.forEach(dI,(A,g)=>{if(A){try{Object.defineProperty(A,"name",{value:g})}catch{}Object.defineProperty(A,"adapterName",{value:g})}});const LY=A=>`- ${A}`,IH=A=>O.isFunction(A)||A===null||A===!1;function oH(A,g){A=O.isArray(A)?A:[A];const{length:B}=A;let Q,w;const C={};for(let E=0;E<B;E++){Q=A[E];let e;if(w=Q,!IH(Q)&&(w=dI[(e=String(Q)).toLowerCase()],w===void 0))throw new ZA(`Unknown adapter '${e}'`);if(w&&(O.isFunction(w)||(w=w.get(g))))break;C[e||"#"+E]=w}if(!w){const E=Object.entries(C).map(([t,o])=>`adapter ${t} `+(o===!1?"is not supported by the environment":"is not available in the build"));let e=B?E.length>1?`since :
5
5
  `+E.map(LY).join(`
6
6
  `):" "+LY(E[0]):"as no adapter specified";throw new ZA("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return w}const VY={getAdapter:oH,adapters:dI};function HI(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new bw(null,A)}function KY(A){return HI(A),A.headers=Dg.from(A.headers),A.data=GI.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),VY.getAdapter(A.adapter||vC.adapter,A)(A).then(function(Q){return HI(A),Q.data=GI.call(A,A.transformResponse,Q),Q.headers=Dg.from(Q.headers),Q},function(Q){return NY(Q)||(HI(A),Q&&Q.response&&(Q.response.data=GI.call(A,A.transformResponse,Q.response),Q.response.headers=Dg.from(Q.response.headers))),Promise.reject(Q)})}const xY="1.13.2",Be={};["object","boolean","number","function","string","symbol"].forEach((A,g)=>{Be[A]=function(Q){return typeof Q===A||"a"+(g<1?"n ":" ")+A}});const XY={};Be.transitional=function(g,B,Q){function w(C,E){return"[Axios v"+xY+"] Transitional option '"+C+"'"+E+(Q?". "+Q:"")}return(C,E,e)=>{if(g===!1)throw new ZA(w(E," has been removed"+(B?" in "+B:"")),ZA.ERR_DEPRECATED);return B&&!XY[E]&&(XY[E]=!0,console.warn(w(E," has been deprecated since v"+B+" and will be removed in the near future"))),g?g(C,E,e):!0}},Be.spelling=function(g){return(B,Q)=>(console.warn(`${Q} is likely a misspelling of ${g}`),!0)};function nH(A,g,B){if(typeof A!="object")throw new ZA("options must be an object",ZA.ERR_BAD_OPTION_VALUE);const Q=Object.keys(A);let w=Q.length;for(;w-- >0;){const C=Q[w],E=g[C];if(E){const e=A[C],t=e===void 0||E(e,C,A);if(t!==!0)throw new ZA("option "+C+" must be "+t,ZA.ERR_BAD_OPTION_VALUE);continue}if(B!==!0)throw new ZA("Unknown option "+C,ZA.ERR_BAD_OPTION)}}const ge={assertOptions:nH,validators:Be},Xg=ge.validators;let gw=class{constructor(g){this.defaults=g||{},this.interceptors={request:new HY,response:new HY}}async request(g,B){try{return await this._request(g,B)}catch(Q){if(Q instanceof Error){let w={};Error.captureStackTrace?Error.captureStackTrace(w):w=new Error;const C=w.stack?w.stack.replace(/^.+\n/,""):"";try{Q.stack?C&&!String(Q.stack).endsWith(C.replace(/^.+\n.+\n/,""))&&(Q.stack+=`
7
- `+C):Q.stack=C}catch{}}throw Q}}_request(g,B){typeof g=="string"?(B=B||{},B.url=g):B=g||{},B=Bw(this.defaults,B);const{transitional:Q,paramsSerializer:w,headers:C}=B;Q!==void 0&&ge.assertOptions(Q,{silentJSONParsing:Xg.transitional(Xg.boolean),forcedJSONParsing:Xg.transitional(Xg.boolean),clarifyTimeoutError:Xg.transitional(Xg.boolean)},!1),w!=null&&(O.isFunction(w)?B.paramsSerializer={serialize:w}:ge.assertOptions(w,{encode:Xg.function,serialize:Xg.function},!0)),B.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?B.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:B.allowAbsoluteUrls=!0),ge.assertOptions(B,{baseUrl:Xg.spelling("baseURL"),withXsrfToken:Xg.spelling("withXSRFToken")},!0),B.method=(B.method||this.defaults.method||"get").toLowerCase();let E=C&&O.merge(C.common,C[B.method]);C&&O.forEach(["delete","get","head","post","put","patch","common"],M=>{delete C[M]}),B.headers=Dg.concat(E,C);const e=[];let t=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(B)===!1||(t=t&&D.synchronous,e.unshift(D.fulfilled,D.rejected))});const o=[];this.interceptors.response.forEach(function(D){o.push(D.fulfilled,D.rejected)});let n,i=0,c;if(!t){const M=[KY.bind(this),void 0];for(M.unshift(...e),M.push(...o),c=M.length,n=Promise.resolve(B);i<c;)n=n.then(M[i++],M[i++]);return n}c=e.length;let Y=B;for(;i<c;){const M=e[i++],D=e[i++];try{Y=M(Y)}catch(r){D.call(this,r);break}}try{n=KY.call(this,Y)}catch(M){return Promise.reject(M)}for(i=0,c=o.length;i<c;)n=n.then(o[i++],o[i++]);return n}getUri(g){g=Bw(this.defaults,g);const B=kY(g.baseURL,g.url,g.allowAbsoluteUrls);return dY(B,g.params,g.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(g){gw.prototype[g]=function(B,Q){return this.request(Bw(Q||{},{method:g,url:B,data:(Q||{}).data}))}}),O.forEach(["post","put","patch"],function(g){function B(Q){return function(C,E,e){return this.request(Bw(e||{},{method:g,headers:Q?{"Content-Type":"multipart/form-data"}:{},url:C,data:E}))}}gw.prototype[g]=B(),gw.prototype[g+"Form"]=B(!0)});let iH=class Fa{constructor(g){if(typeof g!="function")throw new TypeError("executor must be a function.");let B;this.promise=new Promise(function(C){B=C});const Q=this;this.promise.then(w=>{if(!Q._listeners)return;let C=Q._listeners.length;for(;C-- >0;)Q._listeners[C](w);Q._listeners=null}),this.promise.then=w=>{let C;const E=new Promise(e=>{Q.subscribe(e),C=e}).then(w);return E.cancel=function(){Q.unsubscribe(C)},E},g(function(C,E,e){Q.reason||(Q.reason=new bw(C,E,e),B(Q.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(g){if(this.reason){g(this.reason);return}this._listeners?this._listeners.push(g):this._listeners=[g]}unsubscribe(g){if(!this._listeners)return;const B=this._listeners.indexOf(g);B!==-1&&this._listeners.splice(B,1)}toAbortSignal(){const g=new AbortController,B=Q=>{g.abort(Q)};return this.subscribe(B),g.signal.unsubscribe=()=>this.unsubscribe(B),g.signal}static source(){let g;return{token:new Fa(function(w){g=w}),cancel:g}}};function cH(A){return function(B){return A.apply(null,B)}}function YH(A){return O.isObject(A)&&A.isAxiosError===!0}const fI={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fI).forEach(([A,g])=>{fI[g]=A});function OY(A){const g=new gw(A),B=nY(gw.prototype.request,g);return O.extend(B,gw.prototype,g,{allOwnKeys:!0}),O.extend(B,g,null,{allOwnKeys:!0}),B.create=function(w){return OY(Bw(A,w))},B}const PB=OY(vC);PB.Axios=gw,PB.CanceledError=bw,PB.CancelToken=iH,PB.isCancel=NY,PB.VERSION=xY,PB.toFormData=qE,PB.AxiosError=ZA,PB.Cancel=PB.CanceledError,PB.all=function(g){return Promise.all(g)},PB.spread=cH,PB.isAxiosError=YH,PB.mergeConfig=Bw,PB.AxiosHeaders=Dg,PB.formToJSON=A=>JY(O.isHTMLForm(A)?new FormData(A):A),PB.getAdapter=VY.getAdapter,PB.HttpStatusCode=fI,PB.default=PB;const{Axios:w8,AxiosError:C8,CanceledError:E8,isCancel:e8,CancelToken:t8,VERSION:I8,all:o8,Cancel:n8,isAxiosError:i8,spread:c8,toFormData:Y8,AxiosHeaders:M8,HttpStatusCode:r8,formToJSON:D8,getAdapter:a8,mergeConfig:F8}=PB;class XB{constructor(){et(this,"axiosInstance");et(this,"isRefreshing",!1);et(this,"refreshSubscribers",[]);this.axiosInstance=PB.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}),this.axiosInstance.interceptors.request.use(g=>(g.headers.Authorization=`Bearer ${this.getAccessToken()}`,g),g=>Promise.reject(g)),this.axiosInstance.interceptors.response.use(g=>g.data,async g=>{var Q;const B=g.config;if(((Q=g.response)==null?void 0:Q.status)!==401||B.url==="/v2/auth/refresh"||B._retry)return Promise.reject(g);if(B._retry=!0,this.isRefreshing)return new Promise(w=>{this.subscribeTokenRefresh(()=>w(this.axiosInstance(B)))});this.isRefreshing=!0;try{const C=(await this.refresh()).accessToken;return C?(this.setAccessToken(C),this.onRefreshed(C),this.isRefreshing=!1,this.axiosInstance(B)):(this.logoutUser(),Promise.reject(g))}catch(w){return this.logoutUser(),Promise.reject(w)}})}setAccessToken(g){localStorage.setItem("token",g)}getAccessToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}subscribeTokenRefresh(g){this.refreshSubscribers.push(g)}refresh(){return this.post("/v2/auth/refresh",null)}onRefreshed(g){this.refreshSubscribers.forEach(B=>B(g)),this.refreshSubscribers=[]}logoutUser(){this.isRefreshing=!1,this.post("/v2/logout",{}),this.removeToken(),window.location.href="/sign-in"}handleError(g){g.response?console.error("API Error:",g.response.status,g.response.data):g.request?console.error("No response received:",g.request):console.error("Error during request setup:",g.message)}async get(g,B){try{const Q=await this.axiosInstance.get(g,B);return(Q==null?void 0:Q.data)===!1?!1:(Q==null?void 0:Q.data)??Q}catch(Q){const w=Q;throw this.handleError(w),Q}}async delete(g,B){try{return await this.axiosInstance.delete(g,B)}catch(Q){const w=Q;throw this.handleError(w),Q}}async post(g,B,Q){try{const w=await this.axiosInstance.post(g,B,Q);return(w==null?void 0:w.data)===!1?!1:(w==null?void 0:w.data)||w}catch(w){const C=w;throw this.handleError(C),w}}async patch(g,B,Q){try{return(await this.axiosInstance.patch(g,B,Q)).data}catch(w){const C=w;throw this.handleError(C),w}}async put(g,B,Q){try{return(await this.axiosInstance.put(g,B,Q)).data}catch(w){const C=w;throw this.handleError(C),w}}}class MH extends XB{async fetchCriticalPathTasks(g){return await this.get(`gantt/get_list_task_on_critical_path?${g}`)}async fetchGanttList(g){return await this.get(`/list/tasks/search?${g}&gantt=1`)}async setFixPlan(g){const B=new URLSearchParams;return B.append("projects[0]",g),B.append("filter[state]","1"),await this.post(`/gantt/set-planned-date?${B.toString()}`,null)}}let JI;function rH(){return JI||(JI=new MH),JI}class DH extends XB{async fetchPieProjects(g){return await this.get("repairs/pie/projects?"+g)}async fetchPieTasks(g){return await this.get("repairs/pie/tasks?"+g)}async fetchPiePersonnel(g){return await this.get("repairs/metrics/get_list_position?"+g)}async fetchPersonnelData(g){return await this.get("repairs/metrics/list_position_intersection_group_by_status?"+g)}async fetchPersonnelInfo(g){return await this.get(`repairs/metrics/list_position_intersection_details?${g}`)}async fetchPersonnelDataNew(g){return await this.get("repairs/metrics/v2/list_position_intersection_group_by_status?"+g)}async fetchPersonnelInfoNew(g){return await this.get(`repairs/metrics/v2/list_position_intersection_details?${g}`)}async fetchPersonnelUnused(g){return await this.get("repairs/metrics/v2/unused_brigade_personnel",{params:g})}async fetchPiePersonnelInfo(g){return await this.get(`repairs/metrics/get_list_user_by_position?${g}`)}async fetchPieCriticalPath(g){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+g)}async fetchPieCriticalPathInfo(g){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${g}`)}async fetchPieTmc(g){return await this.get("repairs/metrics/get_list_instrument_type?"+g)}async fetchPieTmcInfo(g){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${g}`)}async fetchPieUntimelyClosedTask(g){return await this.get("repairs/metrics/get_list_comment_type?"+g)}async fetchPieUntimelyClosedTaskInfo(g){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${g}`)}async fetchPieAdditionalTasks(g){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+g)}async fetchPieAdditionalTasksInfo(g){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${g}`)}async fetchPersonnel(g){return await this.get("repairs/statistic/personnel?"+g)}async fetchPieExpired(g){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+g)}async fetchPieExpiredInfo(g){return await this.get(`repairs/metrics/get_list_task_expired?${g}`)}async fetchEconomicsPerformance(g){return await this.get(`repairs/metrics/get_economic_performance?${g}`)}async fetchEconomicsInfo(g){return await this.get(`repairs/metrics/get_list_task_economic_performance?${g}`)}async fetchQualityMetrics(g){return await this.get(`repairs/metrics/get_quality_metrics?${g}`)}async fetchQualityInfo(g){return await this.get(`repairs/metrics/get_list_task_by_quality?${g}`)}async fetchPieWorkZone(g){return await this.get("repairs/metrics/get_statistics_on_controller_zones?"+g)}async fetchWorkZoneInfo(g){return await this.get("exposed_equipment_zones/list?"+g)}async fetchPieAllTasks(g){return await this.get("repairs/metrics/get_list_task_group_by_status?"+g)}async fetchPieAllTasksInfo(g){return await this.get("repairs/metrics/get_list_task_by_status?"+g)}}let mI;function aH(){return mI||(mI=new DH),mI}class FH extends XB{async fetchProjectById(g){return this.get(`/projects/${g}`)}createProject(g){return this.post("/projects",g)}editProject(g,B){return this.put(`/projects/${g}`,B)}fetchProjects(g){return this.get("/search/projects",{params:g})}cloneProject(g){return this.post(`projects/${g.id}/clone`,g)}archiveProject(g,B){return this.put(`/projects/${g}`,B)}unArchiveProject(g,B){return this.put(`/projects/${g}`,B)}moveAprProject(g){return this.post("repairs/move_plan_to_real",{repairs:[g]})}restoreProject(g){return this.post("/restore_project",{projects_ids:[g]})}importTasks(g){return this.post("tasks/import",g)}importKtd(g){return this.post("/parse_ktd",g,{headers:{"Content-Type":"multipart/form-data"}})}checkStatusParser(g){return this.post("/check_parse_ktd",g)}fetchProjectTeamList(g){return this.put(`/projects/${g}`,null)}deleteProject(g){return this.delete(`/projects/${g}`)}getDynamicProgressWidget(g){return this.get(`repairs/get_repair_list_dynamics_performance?repair_id_list[]=${g}`)}removeRootIntervals(){return this.post("/delete/fake/projects",null)}addRootIntervals(g,B){return this.post(`/set/fake/projects/${g}`,B)}}let NI;function sH(){return NI||(NI=new FH),NI}class uH extends XB{fetchFilters(g){return this.get(`get_list_repair?smart=1&${g}`)}fetchRepairs(g,B,Q,w,C){return this.get("get_list_repair"+(g?`${B}&per_page=100000${C?"&"+C:""}&${Q?"":w}`:`?per_page=100000${C?"&"+C:""}&${w}`))}fetchRepairTemplates(g){return this.get("repairs/get_repair_template_list",{params:g})}createRepair(g){return this.post("/repairs/equipments",g)}createRepairFromTemplate(g){return this.post("/repairs/create_repair_from_repair_template",g)}startRepair(g){return this.post(`/repairs/${g}/start`,null)}finishRepair(g){return this.post("/repairs/complete_repair_list",{repairIdList:[g]})}finishPreparationProject(g){return this.post(`/repairs/${g}/finish_preparation`,null)}moveRepairToCurrent(g){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[g]})}moveArchiveToCurrent(g){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[g]})}moveRepairToApr(g){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[g]})}moveRepairToArchive(g){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[g]})}restoreRepair(g){return this.post("/restore_repair",{repairs_ids:[g]})}updateRepair(g,B){return this.put(`/repairs/${B}`,g)}copyRepair(g){return this.post(`/repairs/${g}/clone`,null)}deleteRepair(g){return this.delete(`/repairs/${g}`)}fetchIntersection(g){return this.get(`v3/repairs/${g}/personnel/intersection`)}}let RI;function lH(){return RI||(RI=new uH),RI}class UH extends XB{fetchTaskById(g){return this.get(`/tasks/${g}`)}fetchTasksList(g){return this.get("/list/tasks/search",{params:g})}fetchSubtasksList(g){return this.get(`/task/${g}/subtasks/list`)}fetchIntersectionsList(g){return this.get(`/tasks/${g}/intersections`)}fetchTaskBranch(g){return this.get(`/get_list_task_branch?task_id=${g}`)}fetchInstrumentsList(g){return this.get("admin/instruments",{params:g})}fetchInstrumentTypeListWithPreparedWarehouse(g){return this.get("/instrument_type/get_instrument_type_list_with_prepared_warehouse",{params:g})}fetchInstrumentsEquivalentList(g){return this.get("tasks/instrument/list",{params:g})}fetchDiffInstruments(g){return this.get(`tasks/${g.taskId}/fill/module`,{params:g})}replaceInstruments(g){return this.post("/instruments/equivalent/attach",g)}fetchTaskUsagePersonal(g){return this.get(`tasks/${g}/usage/users`)}fetchTaskUsageInstrument(g){return this.get(`tasks/${g}/usage/instruments`)}fetchEquipment(g){return this.get("repairs/equipment/list",{params:g})}fetchTaskVideoSources(g){return this.get("work_zone/get_list_video_source",{params:g})}fetchTaskVideoSourcesStream(g){return this.get("horizon/video-source",{params:g})}createWorkZone(g){return this.post("admin/work-zones",g)}createTask(g){return this.post("tasks",g)}editTask(g,B){return this.put(`tasks/${g}`,B)}mergeTask(g){return this.post("tasks/merge",g)}cloneTask(g,B){return this.post(`gantt/${g}/clone`,B)}deleteTask(g){return this.delete(`tasks/${g}`)}changeStatus(g,B){return this.put(`task/${g}/change-status`,{status_id:B})}saveMetrics(g){return this.put("/update_quality_metrics",g)}checkReasonForStatus(g){return this.post("/tasks/check_reason_for_task",{task_id:g})}verifyTaskStatus(g,B){return this.get(`/task/${g}/change-status/verification`,{params:{status_id:B}})}checkBranchBeforeCloseTask(g){return this.post("/check_branch_before_close_task",{task_id:g})}}let PI;function hH(){return PI||(PI=new UH),PI}class GH extends XB{login(g,B){return this.post("/v2/login",{email:g,password:B})}loginPhoto(g){return this.post("/login/from_photo",{photo:g})}loginVideo(g){return this.post("/login/video",g,{transformRequest:B=>B})}logout(){return this.logoutUser()}userInfo(){return this.get("/users/auth")}configs(){return this.get("/v2/configs")}changePassword(g,B,Q){return this.put(`/v2/auth/users/${g}/password`,{password:B,password_confirmation:Q})}changePasswordAndActivate(g,B,Q,w){return this.post("/v2/auth/users/activate",{email:g,currentPassword:B,password:Q,passwordConfirmation:w})}}let vI;function dH(){return vI||(vI=new GH),vI}class HH extends XB{uploadFile(g){return this.post("/upload-file",g,{headers:{"Content-Type":"multipart/form-data"}})}}let kI;function fH(){return kI||(kI=new HH),kI}class JH extends XB{async startVideoAnalytics(){return await this.post("/statanly/start",null)}reloadVideoAnalytics(g){return this.post("/horizon/video-source/reload",{video_source_ids:g})}hardReloadStream(){return this.post("horizon/video-source/streams/add",null)}async fetchWorkZones(g){return await this.get("/search/work_zones",{params:g})}async fetchWorkZone(g){return await this.get(`/work_zone/get_work_zone/${g}`)}async editWorkZone(g,B){return await this.put(`/admin/work-zones/${g}`,B)}async deleteWorkZone(g){return await this.delete(`/admin/work-zones/${g}`)}async fetchVideoSources(g){return await this.get("/search/video_sources/list",{params:g})}async fetchVideoSourceEconomics(g){return await this.get("horizon/video-source/economics",{params:g})}async createVideoSource(g){return await this.post("horizon/video-source",g)}async editVideoSource(g,B){return await this.put(`/horizon/video-source/${g}`,B)}async deleteVideoSource(g){await this.delete(`/horizon/video-source/${g}`)}async fetchListRepairsVideoSource(g){return await this.get("work_zone/get_list_video_source_by_repair",{params:g})}async sendCombination(g){return await this.post("horizon/video-source/training",g)}async saveCombination(g){return await this.post("horizon/video-source/bind",g)}async fetchCombination(g){return await this.get("horizon/video-source/bind/show",{params:g})}async startTraining(g){return await this.post("horizon/video-source/training/start",g)}async stopTraining(g){return await this.post("horizon/video-source/training/stop",g)}async fetchTrainingInfo(g){return await this.get("horizon/video-source/training/info",{params:g})}async fetchTrainingStatus(g){return await this.get("horizon/video-source/training/status",{params:g})}async fetchVisualizationDataLink(g){return await this.get("horizon/video-source/link/video/training",{params:g})}async updateVisualizationData(g){return await this.get("horizon/video-source/download/video/training",{params:g})}async deleteFrameFromVideo(g){await this.delete(`horizon/video-source/delete/fragment/video/training/${g}`)}async sendEvent(g){return await this.post("alerts_callback_url",g)}}let TI;function mH(){return TI||(TI=new JH),TI}class NH extends XB{async editUser({id:g,model:B}){return await this.put(`/admin/users/${g}`,B)}async getUser(g){return await this.get(`/admin/users/${g}`)}async getUserWarehouses(g){return await this.get("users/get_warehouse_list_by_user",{params:g})}async createUser(g){return await this.post("/admin/users",g)}async deleteUser({user_id:g,archive_reason:B}){return await this.post("/users/archive_user",{user_id:g,archive_reason:B})}async deleteUserPhotos({user_id:g,photos:B}){return await this.post("/users/photos/delete",{user_id:g,photos:B})}async restoreUser(g){return await this.post("/users/restore_user",{user_id:g})}async getRoles(g){return await this.get("/search/roles",{params:g})}async getPositions(g){return await this.get("/search/positions",{params:g})}async createPosition(g){return await this.post("/admin/positions",g)}async editPosition(g,B){return await this.put(`/admin/positions/${g}`,B)}async deletePosition(g){return await this.delete(`/admin/positions/${g}`)}async getTeams(g){return await this.get("/search/teams",{params:g})}async createTeam(g){return await this.post("/teams",g)}async editTeam(g,B){return await this.patch(`/teams/${g}`,B)}async deleteTeam(g){return await this.delete(`/teams/${g}`)}async checkUserVectors(g){return await this.get(`/user/get-vectors/${g}`)}async checkArchiveUserVectors(g){return await this.get(`/users/get_vector_count_by_user?user_id=${g}`)}async addUserVectors(g){return await this.post("/user/add-vector",g,{headers:{"Content-Type":"multipart/form-data"}})}async removeUserVectors(g){return await this.delete(`/user/delete-vectors/${g}`)}async deleteUserPasses(g){return await this.post("admin/delete/passes",g)}async checkUserBeforeArchive(g){return await this.post("users/check_user_before_archive",g)}}let jI;function RH(){return jI||(jI=new NH),jI}class PH extends XB{async fetchUserInstrumentsHistory(g,B){const Q={status:"issued",page:B,desc:"desc",column:"issued_in"};return await this.get(`users/${g}/instruments`,{params:Q})}async fetchWarehouses(g){return await this.get("search/warehouses",{params:g})}async fetchWarehouse(g){return await this.get(`admin/warehouses/${g}`)}async fetchStatusHistory(g){return await this.get(`warehouses/${g}/history/status`)}async createWarehouse(g){return await this.post("admin/warehouses",g)}async editWarehouse({id:g,model:B}){return await this.put(`admin/warehouses/${g}`,B)}deleteWarehouse(g){return this.delete(`admin/warehouses/${g}`)}async unsetWarehouseRfid(g){return await this.post("warehouses/unset-rfid",g)}async searchInstruments(g){return await this.get("search/instruments",{params:g})}}let yI;function vH(){return yI||(yI=new PH),yI}class kH extends XB{fetchControlZones(g){return this.get("/frame/list",{params:g})}async fetchControlZone(g){return this.get(`/frame/${g}`)}createControlZone(g){return this.post("/frame",g)}editControlZone(g,B){return this.put(`/frame/${g}`,B)}deleteControlZone(g){return this.delete(`/frame/${g}`)}fetchControlLogs(g){return this.get("/exposed_equipment_zones/list_for_controller",{params:g})}fetchControllers(g){return this.get("/frame/controllers/list",{params:g})}fetchUsersWithPasses(){return this.get("inspector/users-with-passes")}fetchWarehousesList(){return this.get("tasks/warehouse/list?only_outside_exposed_equipment_zone=1")}manualEntry(g){return this.post("exposed_equipment_zones/hand/enter",g)}manualExit(g){return this.post("exposed_equipment_zones/hand/exit",g)}deleteControlLogs(g){return this.delete("exposed_equipment_zones",g)}fetchInstrumentTypeList(g){return this.get("search/instrument_types",{params:g})}fetchInstrumentCategoryList(g={}){return this.get("instrument_category/list",{params:g})}createInstrumentType(g){return this.post("admin/instruments",g)}editInstrumentType(g,B){return this.put(`admin/instruments/${g}`,B)}deleteInstrumentType(g){return this.delete(`admin/instruments/${g}`)}fetchRpdzLogList(g){return this.get("exposed_equipment_zones_history/list",{params:g})}exportRpdzLogList(g){return this.get("exposed_equipment_zones_history/list/export",{params:g,responseType:"blob"})}}let zI;function TH(){return zI||(zI=new kH),zI}class jH extends XB{fetchSearchUsers(g){return this.get("search/users",{params:g})}fetchSearchInstruments(g){return this.get("search/instrument_type",{params:g})}fetchSearchModules(g){return this.get("search/modules",{params:g})}}let pI;function yH(){return pI||(pI=new jH),pI}class zH extends XB{async detectModule(g){return await this.get(`module/${g}/detect`)}async createModule(g){return await this.post("admin/modules",g)}async editModule({id:g,model:B}){return await this.put(`admin/modules/${g}`,B)}deleteModule(g){return this.delete(`admin/modules/${g}`)}}let WI;function pH(){return WI||(WI=new zH),WI}class WH extends XB{async uploadComment(g){return await this.post("comments",g)}async deleteComment(g){return await this.delete(`comments/${g}`)}async editComment(g,B){return await this.put(`comments/${g}`,B)}}let bI;function bH(){return bI||(bI=new WH),bI}class SH extends XB{fetchEquipment(g){return this.get("repairs/equipment/list",{params:g})}createEquipment(g){return this.post("repairs/equipment",g)}editEquipment(g,B){return this.put(`repairs/equipment/${g}`,B)}deleteEquipment(g){return this.delete(`repairs/equipment/${g}`)}}let SI;function LH(){return SI||(SI=new SH),SI}class VH extends XB{fetchBrigades(g){return this.get("/search/brigades",{params:g})}editBrigade({id:g,model:B}){return this.put(`/brigades/${g}`,B)}getBrigade(g){return this.get(`/brigades/${g}`)}createBrigade(g){return this.post("/brigades",g)}deleteBrigade(g){return this.delete(`/brigades/${g}`)}}let LI;function KH(){return LI||(LI=new VH),LI}class xH extends XB{fetchScheduleConfig(){return this.get("schedule/config")}fetchSchedule(g){return this.get(`schedule/${g}`)}fetchScheduleTable(g){return this.get(`schedule/${g}/get_brigades_table`)}fetchBrigadesToSwap(g,B){return this.get(`schedule/${g}/selection_brigades_for_swap_shift_template`,{params:B})}completeBrigadeSchedule(g,B){return this.post(`schedule/${g}/complete_brigade_schedule`,B)}autocompleteBrigadesSchedule(g,B){return this.post(`schedule/${g}/autocomplete`,B)}addBrigadeShift(g,B){return this.post(`schedule/${g}/shifts`,B)}swapBrigadeShifts(g,B){return this.patch(`schedule/${g}/shifts/switch_shift_templates`,B)}editBrigadeShifts(g,B){return this.patch(`schedule/${g}/shifts`,B)}deleteBrigadeShifts(g,B){return this.delete(`schedule/${g}/shifts`,{data:{shift_ids:B}})}deleteBrigadesFromSchedule(g,B){return this.patch(`schedule/${g}/delete_brigades`,{brigade_ids:B})}}let VI;function XH(){return VI||(VI=new xH),VI}/**
7
+ `+C):Q.stack=C}catch{}}throw Q}}_request(g,B){typeof g=="string"?(B=B||{},B.url=g):B=g||{},B=Bw(this.defaults,B);const{transitional:Q,paramsSerializer:w,headers:C}=B;Q!==void 0&&ge.assertOptions(Q,{silentJSONParsing:Xg.transitional(Xg.boolean),forcedJSONParsing:Xg.transitional(Xg.boolean),clarifyTimeoutError:Xg.transitional(Xg.boolean)},!1),w!=null&&(O.isFunction(w)?B.paramsSerializer={serialize:w}:ge.assertOptions(w,{encode:Xg.function,serialize:Xg.function},!0)),B.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?B.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:B.allowAbsoluteUrls=!0),ge.assertOptions(B,{baseUrl:Xg.spelling("baseURL"),withXsrfToken:Xg.spelling("withXSRFToken")},!0),B.method=(B.method||this.defaults.method||"get").toLowerCase();let E=C&&O.merge(C.common,C[B.method]);C&&O.forEach(["delete","get","head","post","put","patch","common"],M=>{delete C[M]}),B.headers=Dg.concat(E,C);const e=[];let t=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(B)===!1||(t=t&&D.synchronous,e.unshift(D.fulfilled,D.rejected))});const o=[];this.interceptors.response.forEach(function(D){o.push(D.fulfilled,D.rejected)});let n,i=0,c;if(!t){const M=[KY.bind(this),void 0];for(M.unshift(...e),M.push(...o),c=M.length,n=Promise.resolve(B);i<c;)n=n.then(M[i++],M[i++]);return n}c=e.length;let Y=B;for(;i<c;){const M=e[i++],D=e[i++];try{Y=M(Y)}catch(r){D.call(this,r);break}}try{n=KY.call(this,Y)}catch(M){return Promise.reject(M)}for(i=0,c=o.length;i<c;)n=n.then(o[i++],o[i++]);return n}getUri(g){g=Bw(this.defaults,g);const B=kY(g.baseURL,g.url,g.allowAbsoluteUrls);return dY(B,g.params,g.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(g){gw.prototype[g]=function(B,Q){return this.request(Bw(Q||{},{method:g,url:B,data:(Q||{}).data}))}}),O.forEach(["post","put","patch"],function(g){function B(Q){return function(C,E,e){return this.request(Bw(e||{},{method:g,headers:Q?{"Content-Type":"multipart/form-data"}:{},url:C,data:E}))}}gw.prototype[g]=B(),gw.prototype[g+"Form"]=B(!0)});let iH=class Fa{constructor(g){if(typeof g!="function")throw new TypeError("executor must be a function.");let B;this.promise=new Promise(function(C){B=C});const Q=this;this.promise.then(w=>{if(!Q._listeners)return;let C=Q._listeners.length;for(;C-- >0;)Q._listeners[C](w);Q._listeners=null}),this.promise.then=w=>{let C;const E=new Promise(e=>{Q.subscribe(e),C=e}).then(w);return E.cancel=function(){Q.unsubscribe(C)},E},g(function(C,E,e){Q.reason||(Q.reason=new bw(C,E,e),B(Q.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(g){if(this.reason){g(this.reason);return}this._listeners?this._listeners.push(g):this._listeners=[g]}unsubscribe(g){if(!this._listeners)return;const B=this._listeners.indexOf(g);B!==-1&&this._listeners.splice(B,1)}toAbortSignal(){const g=new AbortController,B=Q=>{g.abort(Q)};return this.subscribe(B),g.signal.unsubscribe=()=>this.unsubscribe(B),g.signal}static source(){let g;return{token:new Fa(function(w){g=w}),cancel:g}}};function cH(A){return function(B){return A.apply(null,B)}}function YH(A){return O.isObject(A)&&A.isAxiosError===!0}const fI={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fI).forEach(([A,g])=>{fI[g]=A});function OY(A){const g=new gw(A),B=nY(gw.prototype.request,g);return O.extend(B,gw.prototype,g,{allOwnKeys:!0}),O.extend(B,g,null,{allOwnKeys:!0}),B.create=function(w){return OY(Bw(A,w))},B}const PB=OY(vC);PB.Axios=gw,PB.CanceledError=bw,PB.CancelToken=iH,PB.isCancel=NY,PB.VERSION=xY,PB.toFormData=qE,PB.AxiosError=ZA,PB.Cancel=PB.CanceledError,PB.all=function(g){return Promise.all(g)},PB.spread=cH,PB.isAxiosError=YH,PB.mergeConfig=Bw,PB.AxiosHeaders=Dg,PB.formToJSON=A=>JY(O.isHTMLForm(A)?new FormData(A):A),PB.getAdapter=VY.getAdapter,PB.HttpStatusCode=fI,PB.default=PB;const{Axios:w8,AxiosError:C8,CanceledError:E8,isCancel:e8,CancelToken:t8,VERSION:I8,all:o8,Cancel:n8,isAxiosError:i8,spread:c8,toFormData:Y8,AxiosHeaders:M8,HttpStatusCode:r8,formToJSON:D8,getAdapter:a8,mergeConfig:F8}=PB;class XB{constructor(){et(this,"axiosInstance");et(this,"isRefreshing",!1);et(this,"refreshSubscribers",[]);this.axiosInstance=PB.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0}),this.axiosInstance.interceptors.request.use(g=>(g.headers.Authorization=`Bearer ${this.getAccessToken()}`,g),g=>Promise.reject(g)),this.axiosInstance.interceptors.response.use(g=>g.data,async g=>{var Q;const B=g.config;if(((Q=g.response)==null?void 0:Q.status)!==401||B.url==="/v2/auth/refresh"||B._retry)return Promise.reject(g);if(B._retry=!0,this.isRefreshing)return new Promise(w=>{this.subscribeTokenRefresh(()=>w(this.axiosInstance(B)))});this.isRefreshing=!0;try{const C=(await this.refresh()).accessToken;return C?(this.setAccessToken(C),this.onRefreshed(C),this.isRefreshing=!1,this.axiosInstance(B)):(this.logoutUser(),Promise.reject(g))}catch(w){return this.logoutUser(),Promise.reject(w)}})}setAccessToken(g){localStorage.setItem("token",g)}getAccessToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}subscribeTokenRefresh(g){this.refreshSubscribers.push(g)}refresh(){return this.post("/v2/auth/refresh",null)}onRefreshed(g){this.refreshSubscribers.forEach(B=>B(g)),this.refreshSubscribers=[]}logoutUser(){this.isRefreshing=!1,this.post("/v2/logout",{}),this.removeToken(),window.location.href="/sign-in"}handleError(g){g.response?console.error("API Error:",g.response.status,g.response.data):g.request?console.error("No response received:",g.request):console.error("Error during request setup:",g.message)}async get(g,B){try{const Q=await this.axiosInstance.get(g,B);return(Q==null?void 0:Q.data)===!1?!1:(Q==null?void 0:Q.data)??Q}catch(Q){const w=Q;throw this.handleError(w),Q}}async delete(g,B){try{return await this.axiosInstance.delete(g,B)}catch(Q){const w=Q;throw this.handleError(w),Q}}async post(g,B,Q){try{const w=await this.axiosInstance.post(g,B,Q);return(w==null?void 0:w.data)===!1?!1:(w==null?void 0:w.data)||w}catch(w){const C=w;throw this.handleError(C),w}}async patch(g,B,Q){try{return(await this.axiosInstance.patch(g,B,Q)).data}catch(w){const C=w;throw this.handleError(C),w}}async put(g,B,Q){try{return(await this.axiosInstance.put(g,B,Q)).data}catch(w){const C=w;throw this.handleError(C),w}}}class MH extends XB{async fetchCriticalPathTasks(g){return await this.get(`gantt/get_list_task_on_critical_path?${g}`)}async fetchGanttList(g){return await this.get(`/list/tasks/search?${g}&gantt=1`)}async setFixPlan(g){const B=new URLSearchParams;return B.append("projects[0]",g),B.append("filter[state]","1"),await this.post(`/gantt/set-planned-date?${B.toString()}`,null)}}let JI;function rH(){return JI||(JI=new MH),JI}class DH extends XB{async fetchPieProjects(g){return await this.get("repairs/pie/projects?"+g)}async fetchPieTasks(g){return await this.get("repairs/pie/tasks?"+g)}async fetchPiePersonnel(g){return await this.get("repairs/metrics/get_list_position?"+g)}async fetchPersonnelData(g){return await this.get("repairs/metrics/list_position_intersection_group_by_status?"+g)}async fetchPersonnelInfo(g){return await this.get(`repairs/metrics/list_position_intersection_details?${g}`)}async fetchPersonnelDataNew(g){return await this.get("repairs/metrics/v2/list_position_intersection_group_by_status?"+g)}async fetchPersonnelInfoNew(g){return await this.get(`repairs/metrics/v2/list_position_intersection_details?${g}`)}async fetchPersonnelUnused(g){return await this.get("repairs/metrics/v2/unused_brigade_personnel",{params:g})}async fetchPiePersonnelInfo(g){return await this.get(`repairs/metrics/get_list_user_by_position?${g}`)}async fetchPieCriticalPath(g){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+g)}async fetchPieCriticalPathInfo(g){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${g}`)}async fetchPieTmc(g){return await this.get("repairs/metrics/get_list_instrument_type?"+g)}async fetchPieTmcInfo(g){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${g}`)}async fetchPieUntimelyClosedTask(g){return await this.get("repairs/metrics/get_list_comment_type?"+g)}async fetchPieUntimelyClosedTaskInfo(g){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${g}`)}async fetchPieAdditionalTasks(g){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+g)}async fetchPieAdditionalTasksInfo(g){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${g}`)}async fetchPersonnel(g){return await this.get("repairs/statistic/personnel?"+g)}async fetchPieExpired(g){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+g)}async fetchPieExpiredInfo(g){return await this.get(`repairs/metrics/get_list_task_expired?${g}`)}async fetchEconomicsPerformance(g){return await this.get(`repairs/metrics/get_economic_performance?${g}`)}async fetchEconomicsInfo(g){return await this.get(`repairs/metrics/get_list_task_economic_performance?${g}`)}async fetchQualityMetrics(g){return await this.get(`repairs/metrics/get_quality_metrics?${g}`)}async fetchQualityInfo(g){return await this.get(`repairs/metrics/get_list_task_by_quality?${g}`)}async fetchPieWorkZone(g){return await this.get("repairs/metrics/get_statistics_on_controller_zones?"+g)}async fetchWorkZoneInfo(g){return await this.get("exposed_equipment_zones/list?"+g)}async fetchPieAllTasks(g){return await this.get("repairs/metrics/get_list_task_group_by_status?"+g)}async fetchPieAllTasksInfo(g){return await this.get("repairs/metrics/get_list_task_by_status?"+g)}}let mI;function aH(){return mI||(mI=new DH),mI}class FH extends XB{async fetchProjectById(g){return this.get(`/projects/${g}`)}createProject(g){return this.post("/projects",g)}editProject(g,B){return this.put(`/projects/${g}`,B)}fetchProjects(g){return this.get("/search/projects",{params:g})}cloneProject(g){return this.post(`projects/${g.id}/clone`,g)}archiveProject(g,B){return this.put(`/projects/${g}`,B)}unArchiveProject(g,B){return this.put(`/projects/${g}`,B)}moveAprProject(g){return this.post("repairs/move_plan_to_real",{repairs:[g]})}restoreProject(g){return this.post("/restore_project",{projects_ids:[g]})}importTasks(g){return this.post("tasks/import",g)}importKtd(g){return this.post("/parse_ktd",g,{headers:{"Content-Type":"multipart/form-data"}})}checkStatusParser(g){return this.post("/check_parse_ktd",g)}fetchProjectTeamList(g){return this.put(`/projects/${g}`,null)}deleteProject(g){return this.delete(`/projects/${g}`)}getDynamicProgressWidget(g){return this.get(`repairs/get_repair_list_dynamics_performance?repair_id_list[]=${g}`)}removeRootIntervals(){return this.post("/delete/fake/projects",null)}addRootIntervals(g,B){return this.post(`/set/fake/projects/${g}`,B)}}let NI;function sH(){return NI||(NI=new FH),NI}class uH extends XB{fetchFilters(g){return this.get(`get_list_repair?smart=1&${g}`)}fetchRepairs(g,B,Q,w,C){return this.get("get_list_repair"+(g?`${B}&per_page=100000${C?"&"+C:""}&${Q?"":w}`:`?per_page=100000${C?"&"+C:""}&${w}`))}fetchRepairTemplates(g){return this.get("repairs/get_repair_template_list",{params:g})}createRepair(g){return this.post("/repairs/equipments",g)}createRepairFromTemplate(g){return this.post("/repairs/create_repair_from_repair_template",g)}startRepair(g){return this.post(`/repairs/${g}/start`,null)}finishRepair(g){return this.post("/repairs/complete_repair_list",{repairIdList:[g]})}finishPreparationProject(g){return this.post(`/repairs/${g}/finish_preparation`,null)}moveRepairToCurrent(g){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[g]})}moveArchiveToCurrent(g){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[g]})}moveRepairToApr(g){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[g]})}moveRepairToArchive(g){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[g]})}restoreRepair(g){return this.post("/restore_repair",{repairs_ids:[g]})}updateRepair(g,B){return this.put(`/repairs/${B}`,g)}copyRepair(g){return this.post(`/repairs/${g}/clone`,null)}deleteRepair(g){return this.delete(`/repairs/${g}`)}fetchIntersection(g){return this.get(`v3/repairs/${g}/personnel/intersection`)}}let RI;function lH(){return RI||(RI=new uH),RI}class UH extends XB{fetchTaskById(g){return this.get(`/tasks/${g}`)}fetchTasksList(g){return this.get("/list/tasks/search",{params:g})}fetchSubtasksList(g){return this.get(`/task/${g}/subtasks/list`)}fetchIntersectionsList(g){return this.get(`/tasks/${g}/intersections`)}fetchTaskBranch(g){return this.get(`/get_list_task_branch?task_id=${g}`)}fetchInstrumentsList(g){return this.get("admin/instruments",{params:g})}fetchInstrumentTypeListWithPreparedWarehouse(g){return this.get("/instrument_type/get_instrument_type_list_with_prepared_warehouse",{params:g})}fetchInstrumentsEquivalentList(g){return this.get("tasks/instrument/list",{params:g})}fetchDiffInstruments(g){return this.get(`tasks/${g.taskId}/fill/module`,{params:g})}replaceInstruments(g){return this.post("/instruments/equivalent/attach",g)}fetchTaskUsagePersonal(g){return this.get(`tasks/${g}/usage/users`)}fetchTaskUsageInstrument(g){return this.get(`tasks/${g}/usage/instruments`)}fetchEquipment(g){return this.get("repairs/equipment/list",{params:g})}fetchTaskVideoSources(g){return this.get("work_zone/get_list_video_source",{params:g})}fetchTaskVideoSourcesStream(g){return this.get("horizon/video-source",{params:g})}createWorkZone(g){return this.post("admin/work-zones",g)}createTask(g){return this.post("tasks",g)}editTask(g,B){return this.put(`tasks/${g}`,B)}mergeTask(g){return this.post("tasks/merge",g)}cloneTask(g,B){return this.post(`gantt/${g}/clone`,B)}deleteTask(g){return this.delete(`tasks/${g}`)}changeStatus(g,B){return this.put(`task/${g}/change-status`,{status_id:B})}saveMetrics(g){return this.put("/update_quality_metrics",g)}checkReasonForStatus(g){return this.post("/tasks/check_reason_for_task",{task_id:g})}verifyTaskStatus(g,B){return this.get(`/task/${g}/change-status/verification`,{params:{status_id:B}})}checkBranchBeforeCloseTask(g){return this.post("/check_branch_before_close_task",{task_id:g})}}let PI;function hH(){return PI||(PI=new UH),PI}class GH extends XB{login(g,B){return this.post("/v2/login",{email:g,password:B})}loginPhoto(g){return this.post("/login/from_photo",{photo:g})}loginVideo(g){return this.post("/login/video",g,{transformRequest:B=>B})}logout(){return this.logoutUser()}userInfo(){return this.get("/users/auth")}configs(){return this.get("/v2/configs")}changePassword(g,B,Q){return this.put(`/v2/auth/users/${g}/password`,{password:B,password_confirmation:Q})}changePasswordAndActivate(g,B,Q,w){return this.post("/v2/auth/users/activate",{email:g,currentPassword:B,password:Q,passwordConfirmation:w})}}let vI;function dH(){return vI||(vI=new GH),vI}class HH extends XB{uploadFile(g){return this.post("/upload-file",g,{headers:{"Content-Type":"multipart/form-data"}})}}let kI;function fH(){return kI||(kI=new HH),kI}class JH extends XB{async startVideoAnalytics(){return await this.post("/statanly/start",null)}reloadVideoAnalytics(g){return this.post("/horizon/video-source/reload",{video_source_ids:g})}hardReloadStream(){return this.post("horizon/video-source/streams/add",null)}async fetchWorkZones(g){return await this.get("/search/work_zones",{params:g})}async fetchWorkZone(g){return await this.get(`/work_zone/get_work_zone/${g}`)}async editWorkZone(g,B){return await this.put(`/admin/work-zones/${g}`,B)}async deleteWorkZone(g){return await this.delete(`/admin/work-zones/${g}`)}async fetchVideoSources(g){return await this.get("/search/video_sources/list",{params:g})}async fetchVideoSourceEconomics(g){return await this.get("horizon/video-source/economics",{params:g})}async createVideoSource(g){return await this.post("horizon/video-source",g)}async editVideoSource(g,B){return await this.put(`/horizon/video-source/${g}`,B)}async deleteVideoSource(g){await this.delete(`/horizon/video-source/${g}`)}async fetchListRepairsVideoSource(g){return await this.get("work_zone/get_list_video_source_by_repair",{params:g})}async sendCombination(g){return await this.post("horizon/video-source/training",g)}async saveCombination(g){return await this.post("horizon/video-source/bind",g)}async fetchCombination(g){return await this.get("horizon/video-source/bind/show",{params:g})}async startTraining(g){return await this.post("horizon/video-source/training/start",g)}async stopTraining(g){return await this.post("horizon/video-source/training/stop",g)}async fetchTrainingInfo(g){return await this.get("horizon/video-source/training/info",{params:g})}async fetchTrainingStatus(g){return await this.get("horizon/video-source/training/status",{params:g})}async fetchVisualizationDataLink(g){return await this.get("horizon/video-source/link/video/training",{params:g})}async updateVisualizationData(g){return await this.get("horizon/video-source/download/video/training",{params:g})}async deleteFrameFromVideo(g){await this.delete(`horizon/video-source/delete/fragment/video/training/${g}`)}async sendEvent(g){return await this.post("alerts_callback_url",g)}}let TI;function mH(){return TI||(TI=new JH),TI}class NH extends XB{async editUser({id:g,model:B}){return await this.put(`/admin/users/${g}`,B)}async getUser(g){return await this.get(`/admin/users/${g}`)}async changeUserPassword(g){return await this.patch("/v2/auth/users/password",g)}async getUserWarehouses(g){return await this.get("users/get_warehouse_list_by_user",{params:g})}async createUser(g){return await this.post("/admin/users",g)}async deleteUser({user_id:g,archive_reason:B}){return await this.post("/users/archive_user",{user_id:g,archive_reason:B})}async deleteUserPhotos({user_id:g,photos:B}){return await this.post("/users/photos/delete",{user_id:g,photos:B})}async restoreUser(g){return await this.post("/users/restore_user",{user_id:g})}async getRoles(g){return await this.get("/search/roles",{params:g})}async getPositions(g){return await this.get("/search/positions",{params:g})}async createPosition(g){return await this.post("/admin/positions",g)}async editPosition(g,B){return await this.put(`/admin/positions/${g}`,B)}async deletePosition(g){return await this.delete(`/admin/positions/${g}`)}async getTeams(g){return await this.get("/search/teams",{params:g})}async createTeam(g){return await this.post("/teams",g)}async editTeam(g,B){return await this.patch(`/teams/${g}`,B)}async deleteTeam(g){return await this.delete(`/teams/${g}`)}async checkUserVectors(g){return await this.get(`/user/get-vectors/${g}`)}async checkArchiveUserVectors(g){return await this.get(`/users/get_vector_count_by_user?user_id=${g}`)}async addUserVectors(g){return await this.post("/user/add-vector",g,{headers:{"Content-Type":"multipart/form-data"}})}async removeUserVectors(g){return await this.delete(`/user/delete-vectors/${g}`)}async deleteUserPasses(g){return await this.post("admin/delete/passes",g)}async checkUserBeforeArchive(g){return await this.post("users/check_user_before_archive",g)}}let jI;function RH(){return jI||(jI=new NH),jI}class PH extends XB{async fetchUserInstrumentsHistory(g,B){const Q={status:"issued",page:B,desc:"desc",column:"issued_in"};return await this.get(`users/${g}/instruments`,{params:Q})}async fetchWarehouses(g){return await this.get("search/warehouses",{params:g})}async fetchWarehouse(g){return await this.get(`admin/warehouses/${g}`)}async fetchStatusHistory(g){return await this.get(`warehouses/${g}/history/status`)}async createWarehouse(g){return await this.post("admin/warehouses",g)}async editWarehouse({id:g,model:B}){return await this.put(`admin/warehouses/${g}`,B)}deleteWarehouse(g){return this.delete(`admin/warehouses/${g}`)}async unsetWarehouseRfid(g){return await this.post("warehouses/unset-rfid",g)}async searchInstruments(g){return await this.get("search/instruments",{params:g})}}let yI;function vH(){return yI||(yI=new PH),yI}class kH extends XB{fetchControlZones(g){return this.get("/frame/list",{params:g})}async fetchControlZone(g){return this.get(`/frame/${g}`)}createControlZone(g){return this.post("/frame",g)}editControlZone(g,B){return this.put(`/frame/${g}`,B)}deleteControlZone(g){return this.delete(`/frame/${g}`)}fetchControlLogs(g){return this.get("/exposed_equipment_zones/list_for_controller",{params:g})}fetchControllers(g){return this.get("/frame/controllers/list",{params:g})}fetchUsersWithPasses(){return this.get("inspector/users-with-passes")}fetchWarehousesList(){return this.get("tasks/warehouse/list?only_outside_exposed_equipment_zone=1")}manualEntry(g){return this.post("exposed_equipment_zones/hand/enter",g)}manualExit(g){return this.post("exposed_equipment_zones/hand/exit",g)}deleteControlLogs(g){return this.delete("exposed_equipment_zones",g)}fetchInstrumentTypeList(g){return this.get("search/instrument_types",{params:g})}fetchInstrumentCategoryList(g={}){return this.get("instrument_category/list",{params:g})}createInstrumentType(g){return this.post("admin/instruments",g)}editInstrumentType(g,B){return this.put(`admin/instruments/${g}`,B)}deleteInstrumentType(g){return this.delete(`admin/instruments/${g}`)}fetchRpdzLogList(g){return this.get("exposed_equipment_zones_history/list",{params:g})}exportRpdzLogList(g){return this.get("exposed_equipment_zones_history/list/export",{params:g,responseType:"blob"})}}let zI;function TH(){return zI||(zI=new kH),zI}class jH extends XB{fetchSearchUsers(g){return this.get("search/users",{params:g})}fetchSearchInstruments(g){return this.get("search/instrument_type",{params:g})}fetchSearchModules(g){return this.get("search/modules",{params:g})}}let pI;function yH(){return pI||(pI=new jH),pI}class zH extends XB{async detectModule(g){return await this.get(`module/${g}/detect`)}async createModule(g){return await this.post("admin/modules",g)}async editModule({id:g,model:B}){return await this.put(`admin/modules/${g}`,B)}deleteModule(g){return this.delete(`admin/modules/${g}`)}}let WI;function pH(){return WI||(WI=new zH),WI}class WH extends XB{async uploadComment(g){return await this.post("comments",g)}async deleteComment(g){return await this.delete(`comments/${g}`)}async editComment(g,B){return await this.put(`comments/${g}`,B)}}let bI;function bH(){return bI||(bI=new WH),bI}class SH extends XB{fetchEquipment(g){return this.get("repairs/equipment/list",{params:g})}createEquipment(g){return this.post("repairs/equipment",g)}editEquipment(g,B){return this.put(`repairs/equipment/${g}`,B)}deleteEquipment(g){return this.delete(`repairs/equipment/${g}`)}}let SI;function LH(){return SI||(SI=new SH),SI}class VH extends XB{fetchBrigades(g){return this.get("/search/brigades",{params:g})}editBrigade({id:g,model:B}){return this.put(`/brigades/${g}`,B)}getBrigade(g){return this.get(`/brigades/${g}`)}createBrigade(g){return this.post("/brigades",g)}deleteBrigade(g){return this.delete(`/brigades/${g}`)}}let LI;function KH(){return LI||(LI=new VH),LI}class xH extends XB{fetchScheduleConfig(){return this.get("schedule/config")}fetchSchedule(g){return this.get(`schedule/${g}`)}fetchScheduleTable(g){return this.get(`schedule/${g}/get_brigades_table`)}fetchBrigadesToSwap(g,B){return this.get(`schedule/${g}/selection_brigades_for_swap_shift_template`,{params:B})}completeBrigadeSchedule(g,B){return this.post(`schedule/${g}/complete_brigade_schedule`,B)}autocompleteBrigadesSchedule(g,B){return this.post(`schedule/${g}/autocomplete`,B)}addBrigadeShift(g,B){return this.post(`schedule/${g}/shifts`,B)}swapBrigadeShifts(g,B){return this.patch(`schedule/${g}/shifts/switch_shift_templates`,B)}editBrigadeShifts(g,B){return this.patch(`schedule/${g}/shifts`,B)}deleteBrigadeShifts(g,B){return this.delete(`schedule/${g}/shifts`,{data:{shift_ids:B}})}deleteBrigadesFromSchedule(g,B){return this.patch(`schedule/${g}/delete_brigades`,{brigade_ids:B})}}let VI;function XH(){return VI||(VI=new xH),VI}/**
8
8
  * @license
9
9
  * Copyright 2020 Google LLC. All Rights Reserved.
10
10
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  import ApiService from '../settings/ApiService';
2
- import { Api_User, Api_User_Create, Api_User_Delete_Body, Api_User_Delete_Photos_Body, Api_User_Position, Api_User_Role, Api_User_Team, Api_User_Team_Search, Api_User_Warehouse } from '../types/Api_User';
2
+ import { Api_User, Api_User_Create, Api_User_Delete_Body, Api_User_Delete_Photos_Body, Api_User_Position, Api_User_Role, Api_User_Team, Api_User_Team_Search, Api_User_Warehouse, Api_User_Change_password_payload } from '../types/Api_User';
3
3
  import { ResponseApi } from '../types/Api_Service';
4
4
  declare class UserService extends ApiService {
5
5
  editUser({ id, model }: {
@@ -7,6 +7,7 @@ declare class UserService extends ApiService {
7
7
  model: any;
8
8
  }): Promise<Api_User>;
9
9
  getUser(id: string): Promise<Api_User>;
10
+ changeUserPassword(payload: Api_User_Change_password_payload): Promise<Api_User>;
10
11
  getUserWarehouses(params: {
11
12
  user_id: string;
12
13
  page?: number;
@@ -71,6 +71,15 @@ export type Api_User = {
71
71
  id: string;
72
72
  name: string;
73
73
  }[];
74
+ password_change_available_at: string;
75
+ password_change_due_at: string;
76
+ password_last_changed_at: string;
77
+ };
78
+ export type Api_User_Change_password_payload = {
79
+ email: string;
80
+ password: string;
81
+ currentPassword: string;
82
+ passwordConfirmation: string;
74
83
  };
75
84
  export type Api_User_Create = {
76
85
  last_name?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shared-ritm",
3
- "version": "1.3.54",
3
+ "version": "1.3.56",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -1,123 +1,129 @@
1
- import ApiService from '../settings/ApiService'
2
- import {
3
- Api_User,
4
- Api_User_Create,
5
- Api_User_Delete_Body,
6
- Api_User_Delete_Photos_Body,
7
- Api_User_Position,
8
- Api_User_Role,
9
- Api_User_Team,
10
- Api_User_Team_Search,
11
- Api_User_Warehouse,
12
- } from '../types/Api_User'
13
- import { ResponseApi } from '../types/Api_Service'
14
-
15
- class UserService extends ApiService {
16
- public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
17
- return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
18
- }
19
-
20
- public async getUser(id: string): Promise<Api_User> {
21
- return await this.get<Api_User>(`/admin/users/${id}`)
22
- }
23
-
24
- public async getUserWarehouses(params: {
25
- user_id: string
26
- page?: number
27
- }): Promise<ResponseApi<Api_User_Warehouse[]>> {
28
- return await this.get<ResponseApi<Api_User_Warehouse[]>>(`users/get_warehouse_list_by_user`, { params })
29
- }
30
-
31
- public async createUser(model: Api_User_Create): Promise<Api_User> {
32
- return await this.post<Api_User_Create, Api_User>('/admin/users', model)
33
- }
34
-
35
- public async deleteUser({
36
- user_id,
37
- archive_reason,
38
- }: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
39
- return await this.post(`/users/archive_user`, { user_id, archive_reason })
40
- }
41
-
42
- public async deleteUserPhotos({
43
- user_id,
44
- photos,
45
- }: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
46
- return await this.post(`/users/photos/delete`, { user_id, photos })
47
- }
48
-
49
- public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
50
- return await this.post(`/users/restore_user`, { user_id })
51
- }
52
-
53
- public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
54
- return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
55
- }
56
-
57
- public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
58
- return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
59
- }
60
-
61
- public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
62
- return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
63
- }
64
-
65
- public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
66
- return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
67
- }
68
-
69
- public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
70
- return await this.delete(`/admin/positions/${id}`)
71
- }
72
-
73
- public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
74
- return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
75
- }
76
-
77
- public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
78
- return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
79
- }
80
-
81
- public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
82
- return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
83
- }
84
-
85
- public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
86
- return await this.delete(`/teams/${id}`)
87
- }
88
-
89
- public async checkUserVectors(id: string): Promise<{ count: number }> {
90
- return await this.get(`/user/get-vectors/${id}`)
91
- }
92
-
93
- public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
94
- return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
95
- }
96
-
97
- public async addUserVectors(formData: FormData): Promise<{ response: string }> {
98
- return await this.post(`/user/add-vector`, formData, {
99
- headers: { 'Content-Type': 'multipart/form-data' },
100
- })
101
- }
102
-
103
- public async removeUserVectors(id: string): Promise<unknown> {
104
- return await this.delete(`/user/delete-vectors/${id}`)
105
- }
106
-
107
- public async deleteUserPasses(body: {
108
- personnel_number: number
109
- }): Promise<{ delete_passes: boolean; user: Partial<Api_User> }> {
110
- return await this.post('admin/delete/passes', body)
111
- }
112
-
113
- public async checkUserBeforeArchive(body: { user_id: string }): Promise<any> {
114
- return await this.post('users/check_user_before_archive', body)
115
- }
116
- }
117
-
118
- let api: UserService
119
-
120
- export default function useUserService() {
121
- if (!api) api = new UserService()
122
- return api
123
- }
1
+ import ApiService from '../settings/ApiService'
2
+ import {
3
+ Api_User,
4
+ Api_User_Create,
5
+ Api_User_Delete_Body,
6
+ Api_User_Delete_Photos_Body,
7
+ Api_User_Position,
8
+ Api_User_Role,
9
+ Api_User_Team,
10
+ Api_User_Team_Search,
11
+ Api_User_Warehouse,
12
+ Api_User_Change_password_payload,
13
+ } from '../types/Api_User'
14
+
15
+ import { ResponseApi } from '../types/Api_Service'
16
+
17
+ class UserService extends ApiService {
18
+ public async editUser({ id, model }: { id: string; model: any }): Promise<Api_User> {
19
+ return await this.put<Partial<Api_User>, Api_User>(`/admin/users/${id}`, model)
20
+ }
21
+
22
+ public async getUser(id: string): Promise<Api_User> {
23
+ return await this.get<Api_User>(`/admin/users/${id}`)
24
+ }
25
+
26
+ public async changeUserPassword(payload: Api_User_Change_password_payload): Promise<Api_User> {
27
+ return await this.patch<Api_User_Change_password_payload, Api_User>(`/v2/auth/users/password`, payload)
28
+ }
29
+
30
+ public async getUserWarehouses(params: {
31
+ user_id: string
32
+ page?: number
33
+ }): Promise<ResponseApi<Api_User_Warehouse[]>> {
34
+ return await this.get<ResponseApi<Api_User_Warehouse[]>>(`users/get_warehouse_list_by_user`, { params })
35
+ }
36
+
37
+ public async createUser(model: Api_User_Create): Promise<Api_User> {
38
+ return await this.post<Api_User_Create, Api_User>('/admin/users', model)
39
+ }
40
+
41
+ public async deleteUser({
42
+ user_id,
43
+ archive_reason,
44
+ }: Api_User_Delete_Body): Promise<{ data: boolean; status: number }> {
45
+ return await this.post(`/users/archive_user`, { user_id, archive_reason })
46
+ }
47
+
48
+ public async deleteUserPhotos({
49
+ user_id,
50
+ photos,
51
+ }: Api_User_Delete_Photos_Body): Promise<{ data: boolean; status: number }> {
52
+ return await this.post(`/users/photos/delete`, { user_id, photos })
53
+ }
54
+
55
+ public async restoreUser(user_id: string): Promise<{ data: boolean; status: number }> {
56
+ return await this.post(`/users/restore_user`, { user_id })
57
+ }
58
+
59
+ public async getRoles(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Role[]>> {
60
+ return await this.get<ResponseApi<Api_User_Role[]>>('/search/roles', { params })
61
+ }
62
+
63
+ public async getPositions(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Position[]>> {
64
+ return await this.get<ResponseApi<Api_User_Position[]>>('/search/positions', { params })
65
+ }
66
+
67
+ public async createPosition(body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
68
+ return await this.post<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>('/admin/positions', body)
69
+ }
70
+
71
+ public async editPosition(id: string, body: Partial<Api_User_Position>): Promise<ResponseApi<Api_User_Position>> {
72
+ return await this.put<Partial<Api_User_Position>, ResponseApi<Api_User_Position>>(`/admin/positions/${id}`, body)
73
+ }
74
+
75
+ public async deletePosition(id: string): Promise<{ data: boolean; status: number }> {
76
+ return await this.delete(`/admin/positions/${id}`)
77
+ }
78
+
79
+ public async getTeams(params?: { per_page?: number }): Promise<ResponseApi<Api_User_Team_Search[]>> {
80
+ return await this.get<ResponseApi<Api_User_Team_Search[]>>('/search/teams', { params })
81
+ }
82
+
83
+ public async createTeam(body: Partial<Api_User_Team_Search>): Promise<ResponseApi<Api_User_Team>> {
84
+ return await this.post<Partial<Api_User_Team_Search>, ResponseApi<Api_User_Team>>('/teams', body)
85
+ }
86
+
87
+ public async editTeam(id: string, body: Partial<Api_User_Team_Search>): Promise<{ data: boolean; status: number }> {
88
+ return await this.patch<Partial<Api_User_Team_Search>, { data: boolean; status: number }>(`/teams/${id}`, body)
89
+ }
90
+
91
+ public async deleteTeam(id: string): Promise<{ data: boolean; status: number }> {
92
+ return await this.delete(`/teams/${id}`)
93
+ }
94
+
95
+ public async checkUserVectors(id: string): Promise<{ count: number }> {
96
+ return await this.get(`/user/get-vectors/${id}`)
97
+ }
98
+
99
+ public async checkArchiveUserVectors(id: string): Promise<{ count: number }> {
100
+ return await this.get(`/users/get_vector_count_by_user?user_id=${id}`)
101
+ }
102
+
103
+ public async addUserVectors(formData: FormData): Promise<{ response: string }> {
104
+ return await this.post(`/user/add-vector`, formData, {
105
+ headers: { 'Content-Type': 'multipart/form-data' },
106
+ })
107
+ }
108
+
109
+ public async removeUserVectors(id: string): Promise<unknown> {
110
+ return await this.delete(`/user/delete-vectors/${id}`)
111
+ }
112
+
113
+ public async deleteUserPasses(body: {
114
+ personnel_number: number
115
+ }): Promise<{ delete_passes: boolean; user: Partial<Api_User> }> {
116
+ return await this.post('admin/delete/passes', body)
117
+ }
118
+
119
+ public async checkUserBeforeArchive(body: { user_id: string }): Promise<any> {
120
+ return await this.post('users/check_user_before_archive', body)
121
+ }
122
+ }
123
+
124
+ let api: UserService
125
+
126
+ export default function useUserService() {
127
+ if (!api) api = new UserService()
128
+ return api
129
+ }
@@ -74,6 +74,16 @@ export type Api_User = {
74
74
  positions: Api_Search_User_Positions[]
75
75
  warehouses?: Partial<Api_User_Warehouse>[]
76
76
  brigades: { id: string; name: string }[]
77
+ password_change_available_at: string
78
+ password_change_due_at: string
79
+ password_last_changed_at: string
80
+ }
81
+
82
+ export type Api_User_Change_password_payload = {
83
+ email: string
84
+ password: string
85
+ currentPassword: string
86
+ passwordConfirmation: string
77
87
  }
78
88
 
79
89
  export type Api_User_Create = {