@luizleon/sf.prefeiturasp.vuecomponents 4.1.6 → 4.1.8

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.
@@ -412,5 +412,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
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[Os]=this[Os]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=bn(s);r[a]||(Mp(o,s),r[a]=!0)}return y.isArray(e)?e.forEach(i):i(e),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),y.reduceDescriptors(_e.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),y.freezeMethods(_e);function eo(t,e){const n=this||yn,r=e||n,o=_e.from(r.headers);let i=r.data;return y.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Ls(t){return!!(t&&t.__CANCEL__)}function Nt(t,e,n){U.call(this,t??"canceled",U.ERR_CANCELED,e,n),this.name="CanceledError"}y.inherits(Nt,U,{__CANCEL__:!0});function $s(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.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(),d=r[i];s||(s=u),n[o]=c,r[o]=u;let m=i,g=0;for(;m!==o;)g+=n[m++],m=m%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),u-s<e)return;const _=d&&u-d;return _?Math.round(g*1e3/_):void 0}}function Vp(t,e){let n=0,r=1e3/e,o,i;const s=(u,d=Date.now())=>{n=d,o=null,i&&(clearTimeout(i),i=null),t.apply(null,u)};return[(...u)=>{const d=Date.now(),m=d-n;m>=r?s(u,d):(o=u,i||(i=setTimeout(()=>{i=null,s(o)},r-m)))},()=>o&&s(o)]}const Jn=(t,e,n=3)=>{let r=0;const o=Hp(50,250);return Vp(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,c=s-r,u=o(c),d=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&&d?(a-s)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},n)},Rs=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Ns=t=>(...e)=>y.asap(()=>t(...e)),jp=Ke.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=y.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),Fp=Ke.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];y.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),y.isString(r)&&s.push("path="+r),y.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 Bs(t,e){return t&&!zp(e)?Kp(t,e):e}const Ds=t=>t instanceof _e?{...t}:t;function St(t,e){e=e||{};const n={};function r(u,d,m){return y.isPlainObject(u)&&y.isPlainObject(d)?y.merge.call({caseless:m},u,d):y.isPlainObject(d)?y.merge({},d):y.isArray(d)?d.slice():d}function o(u,d,m){if(y.isUndefined(d)){if(!y.isUndefined(u))return r(void 0,u,m)}else return r(u,d,m)}function i(u,d){if(!y.isUndefined(d))return r(void 0,d)}function s(u,d){if(y.isUndefined(d)){if(!y.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function a(u,d,m){if(m in e)return r(u,d);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,d)=>o(Ds(u),Ds(d),!0)};return y.forEach(Object.keys(Object.assign({},t,e)),function(d){const m=c[d]||o,g=m(t[d],e[d],d);y.isUndefined(g)&&m!==a||(n[d]=g)}),n}const Ms=t=>{const e=St({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;e.headers=s=_e.from(s),e.url=As(Bs(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(y.isFormData(n)){if(Ke.hasStandardBrowserEnv||Ke.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[u,...d]=c?c.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Ke.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&jp(e.url))){const u=o&&i&&Fp.read(i);u&&s.set(o,u)}return e},Wp=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Ms(t);let i=o.data;const s=_e.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,d,m,g,_,v;function T(){_&&_(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function B(){if(!w)return;const A=_e.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),Z={data:!a||a==="text"||a==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:A,config:t,request:w};$s(function(X){n(X),T()},function(X){r(X),T()},Z),w=null}"onloadend"in w?w.onloadend=B:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(B)},w.onabort=function(){w&&(r(new U("Request aborted",U.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new U("Network Error",U.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let z=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const Z=o.transitional||Is;o.timeoutErrorMessage&&(z=o.timeoutErrorMessage),r(new U(z,Z.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,t,w)),w=null},i===void 0&&s.setContentType(null),"setRequestHeader"in w&&y.forEach(s.toJSON(),function(z,Z){w.setRequestHeader(Z,z)}),y.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),a&&a!=="json"&&(w.responseType=o.responseType),u&&([g,v]=Jn(u,!0),w.addEventListener("progress",g)),c&&w.upload&&([m,_]=Jn(c),w.upload.addEventListener("progress",m),w.upload.addEventListener("loadend",_)),(o.cancelToken||o.signal)&&(d=A=>{w&&(r(!A||A.type?new Nt(null,t,w):A),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const C=Up(o.url);if(C&&Ke.protocols.indexOf(C)===-1){r(new U("Unsupported protocol "+C+":",U.ERR_BAD_REQUEST,t));return}w.send(i||null)})},qp=(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 U?u:new Nt(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{o(new U(`timeout ${e} of ms exceeded`,U.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}]},Gp=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},Yp=async function*(t,e,n){for await(const r of t)yield*Gp(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Us=(t,e,n,r,o)=>{const i=Yp(t,e,o);let s=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:m}=await i.next();if(d){c(),u.close();return}let g=m.byteLength;if(n){let _=s+=g;n(_)}u.enqueue(new Uint8Array(m))}catch(d){throw c(d),d}},cancel(u){return c(u),i.return()}},{highWaterMark:2})},Xn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Hs=Xn&&typeof ReadableStream=="function",to=Xn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Vs=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Jp=Hs&&Vs(()=>{let t=!1;const e=new Request(Ke.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),js=64*1024,no=Hs&&Vs(()=>y.isReadableStream(new Response("").body)),Zn={stream:no&&(t=>t.body)};Xn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Zn[e]&&(Zn[e]=y.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new U(`Response type '${e}' is not supported`,U.ERR_NOT_SUPPORT,r)})})})(new Response);const Xp=async t=>{if(t==null)return 0;if(y.isBlob(t))return t.size;if(y.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(y.isArrayBufferView(t)||y.isArrayBuffer(t))return t.byteLength;if(y.isURLSearchParams(t)&&(t=t+""),y.isString(t))return(await to(t)).byteLength},Zp=async(t,e)=>{const n=y.toFiniteNumber(t.getContentLength());return n??Xp(e)},ro={http:Sp,xhr:Wp,fetch:Xn&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:m="same-origin",fetchOptions:g}=Ms(t);u=u?(u+"").toLowerCase():"text";let[_,v]=o||i||s?qp([o,i],s):[],T,w;const B=()=>{!T&&setTimeout(()=>{_&&_.unsubscribe()}),T=!0};let C;try{if(c&&Jp&&n!=="get"&&n!=="head"&&(C=await Zp(d,r))!==0){let re=new Request(e,{method:"POST",body:r,duplex:"half"}),X;if(y.isFormData(r)&&(X=re.headers.get("content-type"))&&d.setContentType(X),re.body){const[ye,se]=Rs(C,Jn(Ns(c)));r=Us(re.body,js,ye,se,to)}}y.isString(m)||(m=m?"include":"omit"),w=new Request(e,{...g,signal:_,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:m});let A=await fetch(w);const z=no&&(u==="stream"||u==="response");if(no&&(a||z)){const re={};["status","statusText","headers"].forEach(V=>{re[V]=A[V]});const X=y.toFiniteNumber(A.headers.get("content-length")),[ye,se]=a&&Rs(X,Jn(Ns(a),!0))||[];A=new Response(Us(A.body,js,ye,()=>{se&&se(),z&&B()},to),re)}u=u||"text";let Z=await Zn[y.findKey(Zn,u)||"text"](A,t);return!z&&B(),v&&v(),await new Promise((re,X)=>{$s(re,X,{data:Z,headers:_e.from(A.headers),status:A.status,statusText:A.statusText,config:t,request:w})})}catch(A){throw B(),A&&A.name==="TypeError"&&/fetch/i.test(A.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,t,w),{cause:A.cause||A}):U.from(A,A&&A.code,t,w)}})};y.forEach(ro,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Fs=t=>`- ${t}`,Qp=t=>y.isFunction(t)||t===null||t===!1,zs={getAdapter:t=>{t=y.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,!Qp(n)&&(r=ro[(s=String(n)).toLowerCase()],r===void 0))throw new U(`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(Fs).join(`
414
414
  `):" "+Fs(i[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:ro};function oo(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Nt(null,t)}function Ks(t){return oo(t),t.headers=_e.from(t.headers),t.data=eo.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),zs.getAdapter(t.adapter||yn.adapter)(t).then(function(r){return oo(t),r.data=eo.call(t,t.transformResponse,r),r.headers=_e.from(r.headers),r},function(r){return Ls(r)||(oo(t),r&&r.response&&(r.response.data=eo.call(t,t.transformResponse,r.response),r.response.headers=_e.from(r.response.headers))),Promise.reject(r)})}const Ws="1.7.4",io={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{io[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const qs={};io.transitional=function(e,n,r){function o(i,s){return"[Axios v"+Ws+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new U(o(s," has been removed"+(n?" in "+n:"")),U.ERR_DEPRECATED);return n&&!qs[s]&&(qs[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 eh(t,e,n){if(typeof t!="object")throw new U("options must be an object",U.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 U("option "+i+" must be "+c,U.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const so={assertOptions:eh,validators:io},dt=so.validators;class _t{constructor(e){this.defaults=e,this.interceptors={request:new Ps,response:new Ps}}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=St(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&so.assertOptions(r,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean)},!1),o!=null&&(y.isFunction(o)?n.paramsSerializer={serialize:o}:so.assertOptions(o,{encode:dt.function,serialize:dt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&y.merge(i.common,i[n.method]);i&&y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=_e.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(c=c&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const u=[];this.interceptors.response.forEach(function(T){u.push(T.fulfilled,T.rejected)});let d,m=0,g;if(!c){const v=[Ks.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),g=v.length,d=Promise.resolve(n);m<g;)d=d.then(v[m++],v[m++]);return d}g=a.length;let _=n;for(m=0;m<g;){const v=a[m++],T=a[m++];try{_=v(_)}catch(w){T.call(this,w);break}}try{d=Ks.call(this,_)}catch(v){return Promise.reject(v)}for(m=0,g=u.length;m<g;)d=d.then(u[m++],u[m++]);return d}getUri(e){e=St(this.defaults,e);const n=Bs(e.baseURL,e.url);return As(n,e.params,e.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(e){_t.prototype[e]=function(n,r){return this.request(St(r||{},{method:e,url:n,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(St(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}_t.prototype[e]=n(),_t.prototype[e+"Form"]=n(!0)});class ao{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 Nt(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 ao(function(o){e=o}),cancel:e}}}function th(t){return function(n){return t.apply(null,n)}}function nh(t){return y.isObject(t)&&t.isAxiosError===!0}const lo={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(lo).forEach(([t,e])=>{lo[e]=t});function Gs(t){const e=new _t(t),n=ds(_t.prototype.request,e);return y.extend(n,_t.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Gs(St(t,o))},n}const oe=Gs(yn);oe.Axios=_t,oe.CanceledError=Nt,oe.CancelToken=ao,oe.isCancel=Ls,oe.VERSION=Ws,oe.toFormData=Gn,oe.AxiosError=U,oe.Cancel=oe.CanceledError,oe.all=function(e){return Promise.all(e)},oe.spread=th,oe.isAxiosError=nh,oe.mergeConfig=St,oe.AxiosHeaders=_e,oe.formToJSON=t=>xs(y.isHTMLForm(t)?new FormData(t):t),oe.getAdapter=zs.getAdapter,oe.HttpStatusCode=lo,oe.default=oe;class Ys{constructor(e,n){Te(this,"keycloak");Te(this,"axios");Te(this,"fileName","silent-login.html");this.keycloak=e,this.axios=oe.create(),this.axios.defaults.baseURL=n,this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async r=>{await this.SilentLogin();const o=this.keycloak.token;return r.headers.Authorization=`Bearer ${o}`,r})}ParseAppResult(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=typeof e.httpStatusCode=="number",i=Array.isArray(e.errors);return n&&r&&o&&i?e:null}catch{return null}}HandleThen(e){const n=new pn,r=this.ParseAppResult(e.data);return r===null?(n.value=e.data,n):r.hasError?(r.errors.forEach(o=>n.WithError(o)),n.httpStatusCode=r.httpStatusCode,n):(n.value=e.data.value,n)}HandleCatch(e){var o;const n=new pn,r=this.ParseAppResult((o=e.response)==null?void 0:o.data);return r===null?n.WithError(e.message):(n.WithErrors(r.errors),n.httpStatusCode=r.httpStatusCode),n}async SilentLogin(){return new Promise(async e=>{if(!this.isTokenExpired){e(!0);return}const n=this.GenerateIframe(),r=o=>{if(document.body.removeChild(n),window.removeEventListener("message",r),o.origin!==location.origin){e(!1);return}const i=o.data.action,s=o.data.code,a=o.data.state,c=o.data.error;if(i!=="silent-login-iframe-result"||c==="login_required"||!s){e(!1);return}const u=new XMLHttpRequest;u.open("POST",this.tokenExchangeUrl,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u.onreadystatechange=()=>{if(u.readyState===4){if(u.status===200){const d=JSON.parse(u.responseText);this.keycloak.setToken(d.access_token,null,d.id_token,new Date().getTime()),e(!0);return}e(!1)}},u.send(this.TokenExchangeParams(s,a))};window.addEventListener("message",r)}).then(e=>(e||(this.keycloak.clearToken(),this.keycloak.login()),e))}GetCodeVerifierFromState(e){const n=`kc-callback-${e}`,r=localStorage.getItem(n);if(r)return localStorage.removeItem(n),JSON.parse(r).pkceCodeVerifier}TokenExchangeParams(e,n){let r=`code=${e}&grant_type=authorization_code`;return r+=`&client_id=${encodeURIComponent(this.keycloak.clientId)}`,r+=`&redirect_uri=${this.silentLoginRedirectUrl}`,r+=`&code_verifier=${this.GetCodeVerifierFromState(n)}`,r}GenerateIframe(){const e=document.createElement("iframe");return e.src=this.keycloak.createLoginUrl({prompt:"none",redirectUri:this.silentLoginRedirectUrl})??"",document.body.appendChild(e),e}get silentLoginRedirectUrl(){return`${location.origin}/${this.fileName}`}get tokenExchangeUrl(){return`${this.keycloak.authServerUrl}/realms/${this.keycloak.realm}/protocol/openid-connect/token`}get isTokenExpired(){const e=this.keycloak.tokenParsed,n=e?e.exp:null;return!e||!n?!0:n-Math.ceil(new Date().getTime()/1e3)+(this.keycloak.timeSkew??0)<10}}const rh=(t,e)=>new Ys(t,e);class Js{constructor(){Te(this,"axios");Te(this,"authService",$r());this.axios=oe.create(),this.axios.defaults.baseURL=window.location.origin+"/api",this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async e=>{const n=await this.GetAccessToken();return e.headers.Authorization=n?`Bearer ${n}`:void 0,e})}GetAxios(e=!0){return e?this.axios:oe.create()}async GetAccessToken(){return await this.authService.Instance.getAccessTokenAsync()}async GetAsync(e){return this.GetAxios().get(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}async PostAsync(e,n){return this.GetAxios().post(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async PutAsync(e,n){return this.GetAxios().put(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async DeleteAsync(e){return this.GetAxios().delete(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}HandleThen(e){const n=new pn,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 pn,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=typeof e.httpStatusCode=="number",i=Array.isArray(e.errors);return n&&r&&o&&i?e:null}catch{return null}}}const oh=()=>new Js;class Qn{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 Qn.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return Qn.Mask(e.padStart(14,"0"),"##.###.###/####-##")}}function ih(){document.documentElement.classList.add("app-mounted")}function Xs(){bt.SetInitialTheme()}function sh(){bt.Toggle()}function ah(){bt.EnableDarkMode()}function lh(){bt.EnableLightMode()}function ch(){bt.ClearStoredTheme()}Xs(),M.ApiClient=Js,M.AppResult=pn,M.AxiosClient=Ys,M.ClearStoredTheme=ch,M.EnableDarkMode=ah,M.EnableLightMode=lh,M.Keycloak=Lr,M.RemovePreloader=ih,M.SetInitialTheme=Xs,M.SfButton=bo,M.SfContent=Id,M.SfDrawer=yo,M.SfIcon=kn,M.SfLayout=Ad,M.SfMessage=Dd,M.SfNavMenu=Nm,M.SfTabNavigation=Nd,M.SfTooltip=rr,M.StartAuthService=ld,M.ToggleTheme=sh,M.UseAlertService=zu,M.UseApiClient=oh,M.UseAuthService=$r,M.UseAxiosClient=rh,M.UseConfirmService=_i,M.UseNavMenuService=nr,M.Utilities=Qn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
415
+ `+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=St(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&so.assertOptions(r,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean)},!1),o!=null&&(y.isFunction(o)?n.paramsSerializer={serialize:o}:so.assertOptions(o,{encode:dt.function,serialize:dt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&y.merge(i.common,i[n.method]);i&&y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=_e.concat(s,i);const a=[];let c=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(c=c&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const u=[];this.interceptors.response.forEach(function(T){u.push(T.fulfilled,T.rejected)});let d,m=0,g;if(!c){const v=[Ks.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),g=v.length,d=Promise.resolve(n);m<g;)d=d.then(v[m++],v[m++]);return d}g=a.length;let _=n;for(m=0;m<g;){const v=a[m++],T=a[m++];try{_=v(_)}catch(w){T.call(this,w);break}}try{d=Ks.call(this,_)}catch(v){return Promise.reject(v)}for(m=0,g=u.length;m<g;)d=d.then(u[m++],u[m++]);return d}getUri(e){e=St(this.defaults,e);const n=Bs(e.baseURL,e.url);return As(n,e.params,e.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(e){_t.prototype[e]=function(n,r){return this.request(St(r||{},{method:e,url:n,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(St(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}_t.prototype[e]=n(),_t.prototype[e+"Form"]=n(!0)});class ao{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 Nt(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 ao(function(o){e=o}),cancel:e}}}function th(t){return function(n){return t.apply(null,n)}}function nh(t){return y.isObject(t)&&t.isAxiosError===!0}const lo={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(lo).forEach(([t,e])=>{lo[e]=t});function Gs(t){const e=new _t(t),n=ds(_t.prototype.request,e);return y.extend(n,_t.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Gs(St(t,o))},n}const oe=Gs(yn);oe.Axios=_t,oe.CanceledError=Nt,oe.CancelToken=ao,oe.isCancel=Ls,oe.VERSION=Ws,oe.toFormData=Gn,oe.AxiosError=U,oe.Cancel=oe.CanceledError,oe.all=function(e){return Promise.all(e)},oe.spread=th,oe.isAxiosError=nh,oe.mergeConfig=St,oe.AxiosHeaders=_e,oe.formToJSON=t=>xs(y.isHTMLForm(t)?new FormData(t):t),oe.getAdapter=zs.getAdapter,oe.HttpStatusCode=lo,oe.default=oe;class Ys{constructor(e,n){Te(this,"keycloak");Te(this,"axios");Te(this,"fileName","silent-login.html");this.keycloak=e,this.axios=oe.create(),this.axios.defaults.baseURL=n,this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async r=>{await this.SilentLogin();const o=this.keycloak.token;return r.headers.Authorization=`Bearer ${o}`,r})}ParseAppResult(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=typeof e.httpStatusCode=="number",i=Array.isArray(e.errors);return n&&r&&o&&i?e:null}catch{return null}}HandleThen(e){const n=new pn,r=this.ParseAppResult(e.data);return r===null?(n.value=e.data,n):r.hasError?(r.errors.forEach(o=>n.WithError(o)),n.httpStatusCode=r.httpStatusCode,n):(n.value=e.data.value,n)}HandleCatch(e){var o;const n=new pn,r=this.ParseAppResult((o=e.response)==null?void 0:o.data);return r===null?n.WithError(e.message):(n.WithErrors(r.errors),n.httpStatusCode=r.httpStatusCode),n}async SilentLogin(){return new Promise(async e=>{if(!this.isTokenExpired){e(!0);return}const n=this.GenerateIframe(),r=o=>{if(document.body.removeChild(n),window.removeEventListener("message",r),o.origin!==location.origin){e(!1);return}const i=o.data.action,s=o.data.code,a=o.data.state,c=o.data.error;if(i!=="silent-login-iframe-result"||c==="login_required"||!s){e(!1);return}const u=new XMLHttpRequest;u.open("POST",this.tokenExchangeUrl,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u.onreadystatechange=()=>{if(u.readyState===4){if(u.status===200){const d=JSON.parse(u.responseText);this.keycloak.setToken(d.access_token,null,d.id_token,new Date().getTime()),e(!0);return}e(!1)}},u.send(this.TokenExchangeParams(s,a))};window.addEventListener("message",r)}).then(e=>(e||(this.keycloak.clearToken(),this.keycloak.login()),e))}GetCodeVerifierFromState(e){const n=`kc-callback-${e}`,r=localStorage.getItem(n);if(r)return localStorage.removeItem(n),JSON.parse(r).pkceCodeVerifier}TokenExchangeParams(e,n){let r=`code=${e}&grant_type=authorization_code`;return r+=`&client_id=${encodeURIComponent(this.keycloak.clientId)}`,r+=`&redirect_uri=${this.silentLoginRedirectUrl}`,r+=`&code_verifier=${this.GetCodeVerifierFromState(n)}`,r}GenerateIframe(){const e=document.createElement("iframe");return e.src=this.keycloak.createLoginUrl({prompt:"none",redirectUri:this.silentLoginRedirectUrl})??"",document.body.appendChild(e),e}get silentLoginRedirectUrl(){return`${location.origin}/${this.fileName}`}get tokenExchangeUrl(){return`${this.keycloak.authServerUrl}/realms/${this.keycloak.realm}/protocol/openid-connect/token`}get isTokenExpired(){const e=this.keycloak.tokenParsed,n=e?e.exp:null;return!e||!n?!0:n-Math.ceil(new Date().getTime()/1e3)+(this.keycloak.timeSkew??0)<10}}const rh=(t,e)=>new Ys(t,e);class Js{constructor(){Te(this,"axios");Te(this,"authService",$r());this.axios=oe.create(),this.axios.defaults.baseURL=window.location.origin+"/api",this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async e=>{const n=await this.GetAccessToken();return e.headers.Authorization=n?`Bearer ${n}`:void 0,e})}GetAxios(e=!0){return e?this.axios:oe.create()}async GetAccessToken(){return await this.authService.Instance.getAccessTokenAsync()}async GetAsync(e){return this.GetAxios().get(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}async PostAsync(e,n){return this.GetAxios().post(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async PutAsync(e,n){return this.GetAxios().put(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async DeleteAsync(e){return this.GetAxios().delete(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}HandleThen(e){const n=new pn,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 pn,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=typeof e.httpStatusCode=="number",i=Array.isArray(e.errors);return n&&r&&o&&i?e:null}catch{return null}}}const oh=()=>new Js;class Qn{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 Qn.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return Qn.Mask(e.padStart(14,"0"),"##.###.###/####-##")}static async DelayAsync(e){return new Promise(n=>setTimeout(n,e))}}function ih(){document.documentElement.classList.add("app-mounted")}function Xs(){bt.SetInitialTheme()}function sh(){bt.Toggle()}function ah(){bt.EnableDarkMode()}function lh(){bt.EnableLightMode()}function ch(){bt.ClearStoredTheme()}Xs(),M.ApiClient=Js,M.AppResult=pn,M.AxiosClient=Ys,M.ClearStoredTheme=ch,M.EnableDarkMode=ah,M.EnableLightMode=lh,M.Keycloak=Lr,M.RemovePreloader=ih,M.SetInitialTheme=Xs,M.SfButton=bo,M.SfContent=Id,M.SfDrawer=yo,M.SfIcon=kn,M.SfLayout=Ad,M.SfMessage=Dd,M.SfNavMenu=Nm,M.SfTabNavigation=Nd,M.SfTooltip=rr,M.StartAuthService=ld,M.ToggleTheme=sh,M.UseAlertService=zu,M.UseApiClient=oh,M.UseAuthService=$r,M.UseAxiosClient=rh,M.UseConfirmService=_i,M.UseNavMenuService=nr,M.Utilities=Qn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
416
416
  //# sourceMappingURL=sf.prefeiturasp.vuecomponents.umd.cjs.map