@luizleon/sf.prefeiturasp.vuecomponents 4.1.14 → 4.1.16
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/http-client/apiClient.d.ts +2 -1
- package/dist/sf.prefeiturasp.vuecomponents.cjs +1 -1
- package/dist/sf.prefeiturasp.vuecomponents.cjs.map +1 -1
- package/dist/sf.prefeiturasp.vuecomponents.js +11 -10
- package/dist/sf.prefeiturasp.vuecomponents.js.map +1 -1
- package/dist/sf.prefeiturasp.vuecomponents.umd.cjs +1 -1
- package/dist/sf.prefeiturasp.vuecomponents.umd.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosResponse, CreateAxiosDefaults } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosResponse, CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';
|
|
2
2
|
import { AppResult } from '../common/appResult';
|
|
3
3
|
interface ApiClientOptions {
|
|
4
4
|
config?: CreateAxiosDefaults;
|
|
@@ -7,6 +7,7 @@ interface ApiClientOptions {
|
|
|
7
7
|
declare class ApiClient {
|
|
8
8
|
constructor(options?: ApiClientOptions);
|
|
9
9
|
axios: AxiosInstance;
|
|
10
|
+
AccessTokenInterceptor(config: InternalAxiosRequestConfig<any>): Promise<InternalAxiosRequestConfig<any>>;
|
|
10
11
|
GetAsync<T>(url: string): Promise<AppResult<T>>;
|
|
11
12
|
PostAsync<T>(url: string, data: any): Promise<AppResult<T>>;
|
|
12
13
|
PutAsync<T>(url: string, data: any): Promise<AppResult<T>>;
|
|
@@ -412,5 +412,5 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
|
|
|
412
412
|
`)}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[Pi]=this[Pi]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Wt(s);r[a]||(Mp(o,s),r[a]=!0)}return g.isArray(e)?e.forEach(i):i(e),this}}ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(ke.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});g.freezeMethods(ke);function wr(t,e){const n=this||vn,r=e||n,o=ke.from(r.headers);let i=r.data;return g.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function ta(t){return!!(t&&t.__CANCEL__)}function Dt(t,e,n){M.call(this,t??"canceled",M.ERR_CANCELED,e,n),this.name="CanceledError"}g.inherits(Dt,M,{__CANCEL__:!0});function na(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Up(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Hp(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),f=r[i];s||(s=u),n[o]=c,r[o]=u;let m=i,b=0;for(;m!==o;)b+=n[m++],m=m%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s<e)return;const _=f&&u-f;return _?Math.round(b*1e3/_):void 0}}function jp(t,e){let n=0,r=1e3/e,o,i;const s=(u,f=Date.now())=>{n=f,o=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{const f=Date.now(),m=f-n;m>=r?s(u,f):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-m)))},()=>o&&s(o)]}const Dn=(t,e,n=3)=>{let r=0;const o=Hp(50,250);return jp(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-r,u=o(c),f=s<=a;r=s;const m={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&f?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},n)},Ii=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},xi=t=>(...e)=>g.asap(()=>t(...e)),Vp=Fe.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{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(s){const a=g.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),Fp=Fe.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];g.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),g.isString(r)&&s.push("path="+r),g.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.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 zp(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Kp(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ra(t,e){return t&&!zp(e)?Kp(t,e):e}const Oi=t=>t instanceof ke?{...t}:t;function _t(t,e){e=e||{};const n={};function r(u,f,m){return g.isPlainObject(u)&&g.isPlainObject(f)?g.merge.call({caseless:m},u,f):g.isPlainObject(f)?g.merge({},f):g.isArray(f)?f.slice():f}function o(u,f,m){if(g.isUndefined(f)){if(!g.isUndefined(u))return r(void 0,u,m)}else return r(u,f,m)}function i(u,f){if(!g.isUndefined(f))return r(void 0,f)}function s(u,f){if(g.isUndefined(f)){if(!g.isUndefined(u))return r(void 0,u)}else return r(void 0,f)}function a(u,f,m){if(m in e)return r(u,f);if(m in t)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,f)=>o(Oi(u),Oi(f),!0)};return g.forEach(Object.keys(Object.assign({},t,e)),function(f){const m=c[f]||o,b=m(t[f],e[f],f);g.isUndefined(b)&&m!==a||(n[f]=b)}),n}const oa=t=>{const e=_t({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;e.headers=s=ke.from(s),e.url=Zs(ra(e.baseURL,e.url),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(g.isFormData(n)){if(Fe.hasStandardBrowserEnv||Fe.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...f]=c?c.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...f].join("; "))}}if(Fe.hasStandardBrowserEnv&&(r&&g.isFunction(r)&&(r=r(e)),r||r!==!1&&Vp(e.url))){const u=o&&i&&Fp.read(i);u&&s.set(o,u)}return e},Wp=typeof XMLHttpRequest<"u",qp=Wp&&function(t){return new Promise(function(n,r){const o=oa(t);let i=o.data;const s=ke.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,f,m,b,_,v;function x(){_&&_(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function N(){if(!w)return;const T=ke.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),Z={data:!a||a==="text"||a==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:T,config:t,request:w};na(function(X){n(X),x()},function(X){r(X),x()},Z),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(N)},w.onabort=function(){w&&(r(new M("Request aborted",M.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new M("Network Error",M.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let V=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const Z=o.transitional||Qs;o.timeoutErrorMessage&&(V=o.timeoutErrorMessage),r(new M(V,Z.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,w)),w=null},i===void 0&&s.setContentType(null),"setRequestHeader"in w&&g.forEach(s.toJSON(),function(V,Z){w.setRequestHeader(Z,V)}),g.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),a&&a!=="json"&&(w.responseType=o.responseType),u&&([b,v]=Dn(u,!0),w.addEventListener("progress",b)),c&&w.upload&&([m,_]=Dn(c),w.upload.addEventListener("progress",m),w.upload.addEventListener("loadend",_)),(o.cancelToken||o.signal)&&(f=T=>{w&&(r(!T||T.type?new Dt(null,t,w):T),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const C=Up(o.url);if(C&&Fe.protocols.indexOf(C)===-1){r(new M("Unsupported protocol "+C+":",M.ERR_BAD_REQUEST,t));return}w.send(i||null)})},Gp=(t,e)=>{let n=new AbortController,r;const o=function(c){if(!r){r=!0,s();const u=c instanceof Error?c:this.reason;n.abort(u instanceof M?u:new Dt(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{o(new M(`timeout ${e} of ms exceeded`,M.ETIMEDOUT))},e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",o):c.unsubscribe(o))}),t=null)};t.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=s,[a,()=>{i&&clearTimeout(i),i=null}]},Yp=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},Jp=async function*(t,e,n){for await(const r of t)yield*Yp(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Li=(t,e,n,r,o)=>{const i=Jp(t,e,o);let s=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:f,value:m}=await i.next();if(f){c(),u.close();return}let b=m.byteLength;if(n){let _=s+=b;n(_)}u.enqueue(new Uint8Array(m))}catch(f){throw c(f),f}},cancel(u){return c(u),i.return()}},{highWaterMark:2})},Zn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ia=Zn&&typeof ReadableStream=="function",Nr=Zn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),sa=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Xp=ia&&sa(()=>{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}),Ri=64*1024,Dr=ia&&sa(()=>g.isReadableStream(new Response("").body)),Mn={stream:Dr&&(t=>t.body)};Zn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Mn[e]&&(Mn[e]=g.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new M(`Response type '${e}' is not supported`,M.ERR_NOT_SUPPORT,r)})})})(new Response);const Zp=async t=>{if(t==null)return 0;if(g.isBlob(t))return t.size;if(g.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(g.isArrayBufferView(t)||g.isArrayBuffer(t))return t.byteLength;if(g.isURLSearchParams(t)&&(t=t+""),g.isString(t))return(await Nr(t)).byteLength},Qp=async(t,e)=>{const n=g.toFiniteNumber(t.getContentLength());return n??Zp(e)},eh=Zn&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:f,withCredentials:m="same-origin",fetchOptions:b}=oa(t);u=u?(u+"").toLowerCase():"text";let[_,v]=o||i||s?Gp([o,i],s):[],x,w;const N=()=>{!x&&setTimeout(()=>{_&&_.unsubscribe()}),x=!0};let C;try{if(c&&Xp&&n!=="get"&&n!=="head"&&(C=await Qp(f,r))!==0){let ne=new Request(e,{method:"POST",body:r,duplex:"half"}),X;if(g.isFormData(r)&&(X=ne.headers.get("content-type"))&&f.setContentType(X),ne.body){const[me,oe]=Ii(C,Dn(xi(c)));r=Li(ne.body,Ri,me,oe,Nr)}}g.isString(m)||(m=m?"include":"omit"),w=new Request(e,{...b,signal:_,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:m});let T=await fetch(w);const V=Dr&&(u==="stream"||u==="response");if(Dr&&(a||V)){const ne={};["status","statusText","headers"].forEach(U=>{ne[U]=T[U]});const X=g.toFiniteNumber(T.headers.get("content-length")),[me,oe]=a&&Ii(X,Dn(xi(a),!0))||[];T=new Response(Li(T.body,Ri,me,()=>{oe&&oe(),V&&N()},Nr),ne)}u=u||"text";let Z=await Mn[g.findKey(Mn,u)||"text"](T,t);return!V&&N(),v&&v(),await new Promise((ne,X)=>{na(ne,X,{data:Z,headers:ke.from(T.headers),status:T.status,statusText:T.statusText,config:t,request:w})})}catch(T){throw N(),T&&T.name==="TypeError"&&/fetch/i.test(T.message)?Object.assign(new M("Network Error",M.ERR_NETWORK,t,w),{cause:T.cause||T}):M.from(T,T&&T.code,t,w)}}),Mr={http:yp,xhr:qp,fetch:eh};g.forEach(Mr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const $i=t=>`- ${t}`,th=t=>g.isFunction(t)||t===null||t===!1,aa={getAdapter:t=>{t=g.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){n=t[i];let s;if(r=n,!th(n)&&(r=Mr[(s=String(n)).toLowerCase()],r===void 0))throw new M(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
|
|
413
413
|
`+i.map($i).join(`
|
|
414
414
|
`):" "+$i(i[0]):"as no adapter specified";throw new M("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Mr};function Sr(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Dt(null,t)}function Bi(t){return Sr(t),t.headers=ke.from(t.headers),t.data=wr.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),aa.getAdapter(t.adapter||vn.adapter)(t).then(function(r){return Sr(t),r.data=wr.call(t,t.transformResponse,r),r.headers=ke.from(r.headers),r},function(r){return ta(r)||(Sr(t),r&&r.response&&(r.response.data=wr.call(t,t.transformResponse,r.response),r.response.headers=ke.from(r.response.headers))),Promise.reject(r)})}const la="1.7.4",co={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{co[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ni={};co.transitional=function(e,n,r){function o(i,s){return"[Axios v"+la+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new M(o(s," has been removed"+(n?" in "+n:"")),M.ERR_DEPRECATED);return n&&!Ni[s]&&(Ni[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function nh(t,e,n){if(typeof t!="object")throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],c=a===void 0||s(a,i,t);if(c!==!0)throw new M("option "+i+" must be "+c,M.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new M("Unknown option "+i,M.ERR_BAD_OPTION)}}const Ur={assertOptions:nh,validators:co},at=Ur.validators;class vt{constructor(e){this.defaults=e,this.interceptors={request:new Ai,response:new Ai}}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 i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
415
|
-
`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=_t(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Ur.assertOptions(r,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),o!=null&&(g.isFunction(o)?n.paramsSerializer={serialize:o}:Ur.assertOptions(o,{encode:at.function,serialize:at.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=ke.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(c=c&&x.synchronous,a.unshift(x.fulfilled,x.rejected))});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let f,m=0,b;if(!c){const v=[Bi.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),b=v.length,f=Promise.resolve(n);m<b;)f=f.then(v[m++],v[m++]);return f}b=a.length;let _=n;for(m=0;m<b;){const v=a[m++],x=a[m++];try{_=v(_)}catch(w){x.call(this,w);break}}try{f=Bi.call(this,_)}catch(v){return Promise.reject(v)}for(m=0,b=u.length;m<b;)f=f.then(u[m++],u[m++]);return f}getUri(e){e=_t(this.defaults,e);const n=ra(e.baseURL,e.url);return Zs(n,e.params,e.paramsSerializer)}}g.forEach(["delete","get","head","options"],function(e){vt.prototype[e]=function(n,r){return this.request(_t(r||{},{method:e,url:n,data:(r||{}).data}))}});g.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(_t(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}vt.prototype[e]=n(),vt.prototype[e+"Form"]=n(!0)});class uo{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new Dt(i,s,a),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)}static source(){let e;return{token:new uo(function(o){e=o}),cancel:e}}}function rh(t){return function(n){return t.apply(null,n)}}function oh(t){return g.isObject(t)&&t.isAxiosError===!0}const Hr={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(Hr).forEach(([t,e])=>{Hr[e]=t});function ca(t){const e=new vt(t),n=Hs(vt.prototype.request,e);return g.extend(n,vt.prototype,e,{allOwnKeys:!0}),g.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return ca(_t(t,o))},n}const re=ca(vn);re.Axios=vt;re.CanceledError=Dt;re.CancelToken=uo;re.isCancel=ta;re.VERSION=la;re.toFormData=Xn;re.AxiosError=M;re.Cancel=re.CanceledError;re.all=function(e){return Promise.all(e)};re.spread=rh;re.isAxiosError=oh;re.mergeConfig=_t;re.AxiosHeaders=ke;re.formToJSON=t=>ea(g.isHTMLForm(t)?new FormData(t):t);re.getAdapter=aa.getAdapter;re.HttpStatusCode=Hr;re.default=re;function ih(t){const e=window.location.origin,n=new URL(t).origin;return e===n}class sh{constructor(e){Re(this,"axios");this.axios=re.create(e==null?void 0:e.config);const n=window.location.origin+"/api";this.axios.defaults.baseURL||(this.axios.defaults.baseURL=n),e!=null&&e.anonymous||this.axios.interceptors.request.use(async r=>{if(!ih(
|
|
415
|
+
`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=_t(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Ur.assertOptions(r,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),o!=null&&(g.isFunction(o)?n.paramsSerializer={serialize:o}:Ur.assertOptions(o,{encode:at.function,serialize:at.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&g.merge(i.common,i[n.method]);i&&g.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=ke.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(c=c&&x.synchronous,a.unshift(x.fulfilled,x.rejected))});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let f,m=0,b;if(!c){const v=[Bi.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),b=v.length,f=Promise.resolve(n);m<b;)f=f.then(v[m++],v[m++]);return f}b=a.length;let _=n;for(m=0;m<b;){const v=a[m++],x=a[m++];try{_=v(_)}catch(w){x.call(this,w);break}}try{f=Bi.call(this,_)}catch(v){return Promise.reject(v)}for(m=0,b=u.length;m<b;)f=f.then(u[m++],u[m++]);return f}getUri(e){e=_t(this.defaults,e);const n=ra(e.baseURL,e.url);return Zs(n,e.params,e.paramsSerializer)}}g.forEach(["delete","get","head","options"],function(e){vt.prototype[e]=function(n,r){return this.request(_t(r||{},{method:e,url:n,data:(r||{}).data}))}});g.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(_t(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}vt.prototype[e]=n(),vt.prototype[e+"Form"]=n(!0)});class uo{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new Dt(i,s,a),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)}static source(){let e;return{token:new uo(function(o){e=o}),cancel:e}}}function rh(t){return function(n){return t.apply(null,n)}}function oh(t){return g.isObject(t)&&t.isAxiosError===!0}const Hr={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(Hr).forEach(([t,e])=>{Hr[e]=t});function ca(t){const e=new vt(t),n=Hs(vt.prototype.request,e);return g.extend(n,vt.prototype,e,{allOwnKeys:!0}),g.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return ca(_t(t,o))},n}const re=ca(vn);re.Axios=vt;re.CanceledError=Dt;re.CancelToken=uo;re.isCancel=ta;re.VERSION=la;re.toFormData=Xn;re.AxiosError=M;re.Cancel=re.CanceledError;re.all=function(e){return Promise.all(e)};re.spread=rh;re.isAxiosError=oh;re.mergeConfig=_t;re.AxiosHeaders=ke;re.formToJSON=t=>ea(g.isHTMLForm(t)?new FormData(t):t);re.getAdapter=aa.getAdapter;re.HttpStatusCode=Hr;re.default=re;function ih(t){const e=window.location.origin,n=new URL(t).origin;return e===n}class sh{constructor(e){Re(this,"axios");this.axios=re.create(e==null?void 0:e.config);const n=window.location.origin+"/api";this.axios.defaults.baseURL||(this.axios.defaults.baseURL=n),e!=null&&e.anonymous||this.axios.interceptors.request.use(async r=>await this.AccessTokenInterceptor(r))}async AccessTokenInterceptor(e){if(!ih(e.baseURL+e.url))return e;const n=Us().oidc;await n.updateToken(10);const r=n.token;return r?e.headers.Authorization=`Bearer ${r}`:n.login(),e}async GetAsync(e){return this.axios.get(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}async PostAsync(e,n){return this.axios.post(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async PutAsync(e,n){return this.axios.put(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async DeleteAsync(e){return this.axios.delete(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}HandleThen(e){const n=new Rr,r=this.ParsedResponse(e.data);return r===null?(n.httpStatusCode=e.status,n.value=e.data,n):(n.httpStatusCode=r.httpStatusCode,r.hasError?(n.WithErrors(r.errors),n):(n.value=r.value,n))}HandleCatch(e){var o;const n=new Rr,r=this.ParsedResponse((o=e.response)==null?void 0:o.data);return r===null?(n.WithError(e.message),n):(n.httpStatusCode=r.httpStatusCode,n.WithErrors(r.errors),n)}ParsedResponse(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=Array.isArray(e.errors);return n&&r&&o?e:null}catch{return null}}}class Un{static get IsTouch(){return window.matchMedia("(pointer: coarse)").matches}static GetMaxZindex(e=[]){let n="body > *:not(script):not(style)";for(const o of e)n+=`, ${o}`;const r=Math.max(...Array.from(document.querySelectorAll(n)).map(o=>{const i=getComputedStyle(o).zIndex;return+i==+i?+i:0}));return r>=100?r:100}static AjustarFuso(e){const n=e.getTimezoneOffset()/60;e.setHours(e.getHours()-n)}static Mask(e,n){let r=0,o=e.toString();return n.replace(/#/g,()=>o[r++]||"")}static MaskCpf(e){return Un.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return Un.Mask(e.padStart(14,"0"),"##.###.###/####-##")}static async DelayAsync(e){return new Promise(n=>setTimeout(n,e))}}function ah(){document.documentElement.classList.add("app-mounted")}function ua(){bt.SetInitialTheme()}function lh(){bt.Toggle()}function ch(){bt.EnableDarkMode()}function uh(){bt.EnableLightMode()}function dh(){bt.ClearStoredTheme()}ua();exports.ApiClient=sh;exports.AppResult=Rr;exports.ClearStoredTheme=dh;exports.ConfigAuth=Om;exports.EnableDarkMode=ch;exports.EnableLightMode=uh;exports.RemovePreloader=ah;exports.SetInitialTheme=ua;exports.SfButton=Ja;exports.SfContent=Fa;exports.SfDrawer=rl;exports.SfIcon=On;exports.SfLayout=$a;exports.SfMessage=il;exports.SfNavMenu=tu;exports.SfTabNavigation=qa;exports.SfTooltip=Vr;exports.ToggleTheme=lh;exports.UseAlertService=mm;exports.UseAuth=Us;exports.UseConfirmService=pm;exports.UseNavMenuService=jr;exports.Utilities=Un;
|
|
416
416
|
//# sourceMappingURL=sf.prefeiturasp.vuecomponents.cjs.map
|