@apia/api 0.0.7

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Initiator
2
+
3
+ Este package se creó con la única utilidad de copiarlo entero y pegarlo a la hora de crear un nuevo package.
4
+
5
+ Este iniciador permite crear un paquete que compila typescript y puede ser importado desde otros packages.
6
+
7
+ ## IMPORTANTE
8
+
9
+ Los archivos **tsconfig.json** y **tsup.config.ts** no son archivos únicos sino symlinks a archivos de configuración comunes a todos los packages. En caso de que sea necesario modificar alguno de ellos **que en la gran mayoría de los casos no sería necesario**, es necesario eliminar el archivo a modificar y crear uno nuevo.
10
+
11
+ ## Procedimiento
12
+
13
+ - Copiar la carpeta initiator y pegarla con otro nombre dentro de packages.
14
+ - Modificar el package.json:
15
+ - Eliminar la línea ```private: true```.
16
+ - Cambiar la ocurrencia `initiator` por el nombre del nuevo paquete.
17
+ - Agregar los scripts convenientes: dev, build, etc.
18
+ - Ejecutar el comando lerna bootstrap desde la carpeta raíz.
19
+
20
+ Luego de ejecutar estos pasos, el package estaría listo para comenzar a usarse.
21
+
22
+ Este package trae como dependencias por defecto theme-ui y react. Si se desea agregar más dependencias se debe ejecutar el comando ```lerna add --scope="@apia/packageName" dependencyName```. Ejemplo, si creamos un paquete con el nombre @apia/myPackage y queremos agregar lodash-es como dependencia, ejecutamos el comando ```lerna add --scope="@apia/myPackage" lodash-es```.
23
+
24
+ **Importante 1**: Dado que estamos desarrollando packages, es importante determinar si las dependencias que vamos a agregar son de tipo dependency o de tipo peerDependency.
25
+
26
+ **Importante 2**: lerna no permite instalar de a varias dependencias a la vez como lo hace npm, por lo tanto, si se desea agregar varias dependencias se debe ejecutar el comando anterior tantas veces como dependencias se quiera agregar.
@@ -0,0 +1,209 @@
1
+ import { TApiaLoad, TModify } from '@apia/util';
2
+ import { AxiosResponse, AxiosRequestConfig } from 'axios';
3
+ import QueryString from 'qs';
4
+ import { notify, TNotificationMessage } from '@apia/notifications';
5
+ import * as React from 'react';
6
+
7
+ type TApiaApiMethodHandler = {
8
+ alert: typeof notify;
9
+ close: () => void;
10
+ configuration?: THandleConfiguration;
11
+ formDefinition: TApiaLoad;
12
+ reset: () => void;
13
+ setError: typeof notify;
14
+ setMessage: (message: Record<string, unknown>) => unknown;
15
+ setState: React.Dispatch<React.SetStateAction<IApiaApiHandlerState>>;
16
+ state: IApiaApiHandlerState;
17
+ setValue: (name: string, value: string) => void;
18
+ };
19
+ interface IModalConfig {
20
+ modalTitle?: string;
21
+ onClose?: () => void;
22
+ onMessage?: (message: Record<string, unknown>) => unknown;
23
+ onMessageClose?: () => unknown;
24
+ onSubmitted?: (handler: TApiaApiMethodHandler, response: AxiosResponse<Record<string, unknown> | null> | null) => unknown;
25
+ }
26
+ type THandleConfiguration = Partial<Pick<IApiaApiRequestConfig<unknown>, 'modalConfiguration' | 'methodsPath'>>;
27
+ interface IApiaApiHandlerState {
28
+ disabled: boolean;
29
+ isLoading: boolean;
30
+ isMultipart: boolean;
31
+ progress: number;
32
+ errors: Record<string, string>;
33
+ windowIndex: number;
34
+ }
35
+
36
+ interface TColors {
37
+ exception?: string;
38
+ alert?: string;
39
+ message?: string;
40
+ }
41
+ interface IApiaApiConsoleConfig {
42
+ colors?: TColors;
43
+ debug?: boolean;
44
+ }
45
+ interface IApiaApiRequestConfig<DataType> extends IApiaApiConsoleConfig {
46
+ axiosConfig?: AxiosRequestConfig;
47
+ modalConfiguration?: IModalConfig;
48
+ handleLoad?: boolean;
49
+ /**
50
+ * Algunas veces las funciones llamadas por una acción en el servidor
51
+ * tienen el mismo nombre siendo en realidad funciones distintas. Para
52
+ * corregir este problema es posible pasar un path relativo al directorio
53
+ * apiaApi/methods
54
+ */
55
+ methodsPath?: string;
56
+ notificationsCategory?: string;
57
+ queryData?: string | Record<string, unknown>;
58
+ stringifyOptions?: QueryString.IStringifyOptions;
59
+ validateResponse?: (response: AxiosResponse<DataType | null>) => Promise<boolean | string> | boolean | string;
60
+ }
61
+ declare global {
62
+ interface Window {
63
+ [key: string]: string;
64
+ }
65
+ }
66
+
67
+ declare function getConfig<LoadType>(outerBehaveConfig?: IApiaApiRequestConfig<LoadType>): IApiaApiRequestConfig<unknown> & IApiaApiRequestConfig<LoadType> & Partial<IApiaApiRequestConfig<unknown>>;
68
+ type TApiaApiAxiosResponse<LoadType> = AxiosResponse<LoadType | null> & {
69
+ hasError: boolean;
70
+ hasMessages: boolean;
71
+ };
72
+ /**
73
+ * IMPORTANT!! The ApiaApi is programmed under the slogan that
74
+ * **should never throw an exception**. **Errors** coming from
75
+ * connectivity or exceptions on the server **will be handled
76
+ * automatically** by ApiaApi, using the notification system
77
+ * of the application. It is possible to determine in what context they should
78
+ * be thrown those exceptions (global, main, modal) using the
79
+ * alertsCategory configuration properties **(see errorsHandling.md)**.
80
+ *
81
+ * @param url String, the url you want to call
82
+ * @param config interface IApiaApiRequestConfig<DataType>;
83
+ *
84
+ * @throws Nothing
85
+ *
86
+ * @example
87
+ *
88
+ * ApiaApi.post<ResponseType>('url...', {
89
+ axiosConfig?: AxiosRequestConfig;
90
+
91
+ // Configuración de postData
92
+ postData? unknown;
93
+ postDataTreatement?: 'stringify' | undefined;
94
+
95
+ // Configuración de queryString
96
+ queryData?: string | Record<string, unknown>;
97
+ stringifyOptions?: QueryString.IStringifyOptions;
98
+
99
+ // Response validator,
100
+ // If it returns true, everything continues correctly
101
+ // If it returns false, the ApiaApi throws a standard error.
102
+ // If it returns string, ApiaApi throws the error returned in the string.
103
+ validateResponse?: (
104
+ response: AxiosResponse<DataType | null>,
105
+ ) => boolean | string;
106
+
107
+ // Configuración de alertas
108
+ alertsImportance?: TAlertImportance;
109
+
110
+ // Configuración de ApiaApiHandler, falta documentar
111
+ handleLoad?: boolean;
112
+ eventsHandler?: IEventsHandler;
113
+
114
+ // other configuration
115
+ colors?: TColors;
116
+ debug?: boolean;
117
+ }
118
+ * @returns The type of the return value depends on the type passed when calling the function. If there was an error it returns null.
119
+ */
120
+ declare function post<LoadType extends Record<string, unknown> = Record<string, unknown>, DataType = unknown>(url: string | TModify<IApiaApiRequestConfig<LoadType>, {
121
+ postData?: DataType;
122
+ postDataTreatement?: 'stringify';
123
+ }>, config?: TModify<IApiaApiRequestConfig<LoadType>, {
124
+ postData?: DataType;
125
+ postDataTreatement?: 'stringify';
126
+ }>): Promise<TApiaApiAxiosResponse<(LoadType & TNotificationMessage) | null> | null>;
127
+ declare function post<LoadType extends Record<string, unknown> = Record<string, unknown>, DataType = unknown>(config: TModify<IApiaApiRequestConfig<LoadType>, {
128
+ postData?: DataType;
129
+ postDataTreatement?: 'stringify';
130
+ }>): Promise<TApiaApiAxiosResponse<(LoadType & TNotificationMessage) | null> | null>;
131
+ /**
132
+ * IMPORTANTE!! El ApiaApi está programado bajo la consigna de que
133
+ * **no debe tirar núnca una excepción**. **Los errores** provenientes
134
+ * de la conectividad o de excepciones en el servidor **serán manejados
135
+ * automáticamente** por el ApiaApi utilizando el sistema de notificaciones
136
+ * de la aplicación. Es posible determinar en qué contexto deben
137
+ * ser lanzadas esas excepciones (global, main, modal) utilizando las
138
+ * propiedades de configuración alertsCategory **(ver errorsHandling.md)**.
139
+ *
140
+ * @param url String, el url al que se desea llamar
141
+ * @param config interface IApiaApiRequestConfig<DataType>;
142
+ *
143
+ * @throws Nothing
144
+ *
145
+ * @example
146
+ *
147
+ * ApiaApi.get<TipoDeRespuesta>('url...', {
148
+ axiosConfig?: AxiosRequestConfig;
149
+
150
+ // Configuración de queryString
151
+ queryData?: string | Record<string, unknown>;
152
+ stringifyOptions?: QueryString.IStringifyOptions;
153
+
154
+ // Validador de respuesta,
155
+ // Si devuelve true, todo sigue correctamente
156
+ // Si devuelve false, el ApiaApi tira un error estándar.
157
+ // Si devuelve string, el ApiaApi tira el error devuelto en el string.
158
+ validateResponse?: (
159
+ response: AxiosResponse<DataType | null>,
160
+ ) => boolean | string;
161
+
162
+ // Configuración de alertas
163
+ alertsImportance?: TAlertImportance;
164
+
165
+ // Configuración de ApiaApiHandler, falta documentar
166
+ handleLoad?: boolean;
167
+ eventsHandler?: IEventsHandler;
168
+
169
+ // Otra configuración
170
+ colors?: TColors;
171
+ debug?: boolean;
172
+ }
173
+ * @returns El tipo del valor devuelto depende del tipo pasado al llamar a la función. Si hubo un error devuelve null
174
+ */
175
+ declare function get<LoadType extends Record<string, unknown> = Record<string, unknown>>(url: string | IApiaApiRequestConfig<LoadType>, config?: IApiaApiRequestConfig<LoadType>): Promise<TApiaApiAxiosResponse<(LoadType & TNotificationMessage) | null> | null>;
176
+ declare function get<LoadType extends Record<string, unknown> = Record<string, unknown>>(config: IApiaApiRequestConfig<LoadType>): Promise<TApiaApiAxiosResponse<(LoadType & TNotificationMessage) | null> | null>;
177
+ declare const ApiaApi: {
178
+ get: typeof get;
179
+ getConfig: typeof getConfig;
180
+ post: typeof post;
181
+ };
182
+ /**
183
+ * Creates an url based on the general requirements of Apia.
184
+ * If the ajaxUrl property is not passed, it will use the
185
+ * window.URL_REQUEST_AJAX. Its use is very simple, just pass the objects you
186
+ * want to appear in the query string.
187
+ *
188
+ * @example makeApiaUrl({
189
+ * ajaxUrl: 'the.endpoint.you.want',
190
+ * queryString: 'an=existent&query=string',
191
+ * action: 'theAction',
192
+ * anotherProp: 15
193
+ * })
194
+ *
195
+ * @returns the well formed url, in the example, the response url is:
196
+ * /context/the.endpoint.you.want?an=existent&query=string&anotherProp=15&tabId=...&tokenId=...&action=theAction
197
+ */
198
+ declare function makeApiaUrl(props?: {
199
+ action?: string;
200
+ ajaxUrl?: string;
201
+ queryString?: string;
202
+ stringifyOptions?: QueryString.IStringifyOptions;
203
+ tabId?: string | number;
204
+ preventAsXmlParameter?: boolean;
205
+ avoidTabId?: boolean;
206
+ [key: string]: unknown;
207
+ }): string;
208
+
209
+ export { ApiaApi, makeApiaUrl };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";var ln=Object.create;var ge=Object.defineProperty,fn=Object.defineProperties,un=Object.getOwnPropertyDescriptor,cn=Object.getOwnPropertyDescriptors,pn=Object.getOwnPropertyNames,xe=Object.getOwnPropertySymbols,yn=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable;var Tt=(t,e,r)=>e in t?ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))We.call(e,r)&&Tt(t,r,e[r]);if(xe)for(var r of xe(e))bt.call(e,r)&&Tt(t,r,e[r]);return t},D=(t,e)=>fn(t,cn(e));var me=(t,e)=>{var r={};for(var n in t)We.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&xe)for(var n of xe(t))e.indexOf(n)<0&&bt.call(t,n)&&(r[n]=t[n]);return r};var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dn=(t,e)=>{for(var r in e)ge(t,r,{get:e[r],enumerable:!0})},xt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of pn(e))!We.call(t,a)&&a!==r&&ge(t,a,{get:()=>e[a],enumerable:!(n=un(e,a))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?ln(yn(t)):{},xt(e||!t||!t.__esModule?ge(r,"default",{value:t,enumerable:!0}):r,t)),gn=t=>xt(ge({},"__esModule",{value:!0}),t);var N=(t,e,r)=>new Promise((n,a)=>{var o=l=>{try{i(r.next(l))}catch(f){a(f)}},s=l=>{try{i(r.throw(l))}catch(f){a(f)}},i=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,s);i((r=r.apply(t,e)).next())});var Et=R((Oa,Rt)=>{"use strict";Rt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[r]=a;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==a||s.enumerable!==!0)return!1}return!0}});var Ct=R((Pa,Pt)=>{"use strict";var Ot=typeof Symbol!="undefined"&&Symbol,mn=Et();Pt.exports=function(){return typeof Ot!="function"||typeof Symbol!="function"||typeof Ot("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:mn()}});var It=R((Ca,Mt)=>{"use strict";var vn="Function.prototype.bind called on incompatible ",_e=Array.prototype.slice,hn=Object.prototype.toString,An="[object Function]";Mt.exports=function(e){var r=this;if(typeof r!="function"||hn.call(r)!==An)throw new TypeError(vn+r);for(var n=_e.call(arguments,1),a,o=function(){if(this instanceof a){var c=r.apply(this,n.concat(_e.call(arguments)));return Object(c)===c?c:this}else return r.apply(e,n.concat(_e.call(arguments)))},s=Math.max(0,r.length-n.length),i=[],l=0;l<s;l++)i.push("$"+l);if(a=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var f=function(){};f.prototype=r.prototype,a.prototype=new f,f.prototype=null}return a}});var Re=R((Ma,Dt)=>{"use strict";var Sn=It();Dt.exports=Function.prototype.bind||Sn});var kt=R((Ia,Lt)=>{"use strict";var wn=Re();Lt.exports=wn.call(Function.call,Object.prototype.hasOwnProperty)});var Pe=R((Da,Ut)=>{"use strict";var m,se=SyntaxError,qt=Function,ie=TypeError,Ge=function(t){try{return qt('"use strict"; return ('+t+").constructor;")()}catch(e){}},Y=Object.getOwnPropertyDescriptor;if(Y)try{Y({},"")}catch(t){Y=null}var ze=function(){throw new ie},Tn=Y?function(){try{return arguments.callee,ze}catch(t){try{return Y(arguments,"callee").get}catch(e){return ze}}}():ze,oe=Ct()(),q=Object.getPrototypeOf||function(t){return t.__proto__},ae={},bn=typeof Uint8Array=="undefined"?m:q(Uint8Array),Z={"%AggregateError%":typeof AggregateError=="undefined"?m:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?m:ArrayBuffer,"%ArrayIteratorPrototype%":oe?q([][Symbol.iterator]()):m,"%AsyncFromSyncIteratorPrototype%":m,"%AsyncFunction%":ae,"%AsyncGenerator%":ae,"%AsyncGeneratorFunction%":ae,"%AsyncIteratorPrototype%":ae,"%Atomics%":typeof Atomics=="undefined"?m:Atomics,"%BigInt%":typeof BigInt=="undefined"?m:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?m:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?m:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?m:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?m:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?m:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?m:FinalizationRegistry,"%Function%":qt,"%GeneratorFunction%":ae,"%Int8Array%":typeof Int8Array=="undefined"?m:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?m:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?m:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":oe?q(q([][Symbol.iterator]())):m,"%JSON%":typeof JSON=="object"?JSON:m,"%Map%":typeof Map=="undefined"?m:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!oe?m:q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?m:Promise,"%Proxy%":typeof Proxy=="undefined"?m:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?m:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?m:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!oe?m:q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?m:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":oe?q(""[Symbol.iterator]()):m,"%Symbol%":oe?Symbol:m,"%SyntaxError%":se,"%ThrowTypeError%":Tn,"%TypedArray%":bn,"%TypeError%":ie,"%Uint8Array%":typeof Uint8Array=="undefined"?m:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?m:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?m:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?m:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?m:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?m:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?m:WeakSet};try{null.error}catch(t){Ft=q(q(t)),Z["%Error.prototype%"]=Ft}var Ft,xn=function t(e){var r;if(e==="%AsyncFunction%")r=Ge("async function () {}");else if(e==="%GeneratorFunction%")r=Ge("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ge("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=t("%AsyncGenerator%");a&&(r=q(a.prototype))}return Z[e]=r,r},$t={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},he=Re(),Ee=kt(),Rn=he.call(Function.call,Array.prototype.concat),En=he.call(Function.apply,Array.prototype.splice),Nt=he.call(Function.call,String.prototype.replace),Oe=he.call(Function.call,String.prototype.slice),On=he.call(Function.call,RegExp.prototype.exec),Pn=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Cn=/\\(\\)?/g,Mn=function(e){var r=Oe(e,0,1),n=Oe(e,-1);if(r==="%"&&n!=="%")throw new se("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new se("invalid intrinsic syntax, expected opening `%`");var a=[];return Nt(e,Pn,function(o,s,i,l){a[a.length]=i?Nt(l,Cn,"$1"):s||o}),a},In=function(e,r){var n=e,a;if(Ee($t,n)&&(a=$t[n],n="%"+a[0]+"%"),Ee(Z,n)){var o=Z[n];if(o===ae&&(o=xn(n)),typeof o=="undefined"&&!r)throw new ie("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:o}}throw new se("intrinsic "+e+" does not exist!")};Ut.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new ie("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ie('"allowMissing" argument must be a boolean');if(On(/^%?[^%]*%?$/,e)===null)throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Mn(e),a=n.length>0?n[0]:"",o=In("%"+a+"%",r),s=o.name,i=o.value,l=!1,f=o.alias;f&&(a=f[0],En(n,Rn([0,1],f)));for(var c=1,g=!0;c<n.length;c+=1){var p=n[c],y=Oe(p,0,1),d=Oe(p,-1);if((y==='"'||y==="'"||y==="`"||d==='"'||d==="'"||d==="`")&&y!==d)throw new se("property names with quotes must have matching quotes");if((p==="constructor"||!g)&&(l=!0),a+="."+p,s="%"+a+"%",Ee(Z,s))i=Z[s];else if(i!=null){if(!(p in i)){if(!r)throw new ie("base intrinsic for "+e+" exists, but the property is not available.");return}if(Y&&c+1>=n.length){var h=Y(i,p);g=!!h,g&&"get"in h&&!("originalValue"in h.get)?i=h.get:i=i[p]}else g=Ee(i,p),i=i[p];g&&!l&&(Z[s]=i)}}return i}});var zt=R((La,Ce)=>{"use strict";var Ve=Re(),le=Pe(),Wt=le("%Function.prototype.apply%"),_t=le("%Function.prototype.call%"),Gt=le("%Reflect.apply%",!0)||Ve.call(_t,Wt),Bt=le("%Object.getOwnPropertyDescriptor%",!0),ee=le("%Object.defineProperty%",!0),Dn=le("%Math.max%");if(ee)try{ee({},"a",{value:1})}catch(t){ee=null}Ce.exports=function(e){var r=Gt(Ve,_t,arguments);if(Bt&&ee){var n=Bt(r,"length");n.configurable&&ee(r,"length",{value:1+Dn(0,e.length-(arguments.length-1))})}return r};var Ht=function(){return Gt(Ve,Wt,arguments)};ee?ee(Ce.exports,"apply",{value:Ht}):Ce.exports.apply=Ht});var Xt=R((ka,Jt)=>{"use strict";var Vt=Pe(),Qt=zt(),Ln=Qt(Vt("String.prototype.indexOf"));Jt.exports=function(e,r){var n=Vt(e,!!r);return typeof n=="function"&&Ln(e,".prototype.")>-1?Qt(n):n}});var jt=R((Fa,Kt)=>{Kt.exports=require("util").inspect});var vr=R(($a,mr)=>{var rt=typeof Map=="function"&&Map.prototype,Qe=Object.getOwnPropertyDescriptor&&rt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ie=rt&&Qe&&typeof Qe.get=="function"?Qe.get:null,Yt=rt&&Map.prototype.forEach,nt=typeof Set=="function"&&Set.prototype,Je=Object.getOwnPropertyDescriptor&&nt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,De=nt&&Je&&typeof Je.get=="function"?Je.get:null,Zt=nt&&Set.prototype.forEach,kn=typeof WeakMap=="function"&&WeakMap.prototype,Se=kn?WeakMap.prototype.has:null,Fn=typeof WeakSet=="function"&&WeakSet.prototype,we=Fn?WeakSet.prototype.has:null,$n=typeof WeakRef=="function"&&WeakRef.prototype,er=$n?WeakRef.prototype.deref:null,Nn=Boolean.prototype.valueOf,qn=Object.prototype.toString,Un=Function.prototype.toString,Bn=String.prototype.match,ot=String.prototype.slice,J=String.prototype.replace,Hn=String.prototype.toUpperCase,tr=String.prototype.toLowerCase,ur=RegExp.prototype.test,rr=Array.prototype.concat,U=Array.prototype.join,Wn=Array.prototype.slice,nr=Math.floor,je=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Xe=Object.getOwnPropertySymbols,Ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",M=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fe||"symbol")?Symbol.toStringTag:null,cr=Object.prototype.propertyIsEnumerable,or=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ar(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ur.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-nr(-t):nr(t);if(n!==t){var a=String(n),o=ot.call(e,a.length+1);return J.call(a,r,"$&_")+"."+J.call(J.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return J.call(e,r,"$&_")}var Ze=jt(),ir=Ze.custom,sr=yr(ir)?ir:null;mr.exports=function t(e,r,n,a){var o=r||{};if(Q(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Q(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Q(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Q(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Q(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var i=o.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return gr(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return i?ar(e,l):l}if(typeof e=="bigint"){var f=String(e)+"n";return i?ar(e,f):f}var c=typeof o.depth=="undefined"?5:o.depth;if(typeof n=="undefined"&&(n=0),n>=c&&c>0&&typeof e=="object")return et(e)?"[Array]":"[Object]";var g=io(o,n);if(typeof a=="undefined")a=[];else if(dr(a,e)>=0)return"[Circular]";function p($,V,_){if(V&&(a=Wn.call(a),a.push(V)),_){var de={depth:o.depth};return Q(o,"quoteStyle")&&(de.quoteStyle=o.quoteStyle),t($,de,n+1,a)}return t($,o,n+1,a)}if(typeof e=="function"&&!lr(e)){var y=jn(e),d=Me(e,p);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(d.length>0?" { "+U.call(d,", ")+" }":"")}if(yr(e)){var h=fe?J.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ye.call(e);return typeof e=="object"&&!fe?Ae(h):h}if(no(e)){for(var T="<"+tr.call(String(e.nodeName)),u=e.attributes||[],v=0;v<u.length;v++)T+=" "+u[v].name+"="+pr(_n(u[v].value),"double",o);return T+=">",e.childNodes&&e.childNodes.length&&(T+="..."),T+="</"+tr.call(String(e.nodeName))+">",T}if(et(e)){if(e.length===0)return"[]";var b=Me(e,p);return g&&!ao(b)?"["+tt(b,g)+"]":"[ "+U.call(b,", ")+" ]"}if(zn(e)){var A=Me(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!cr.call(e,"cause")?"{ ["+String(e)+"] "+U.call(rr.call("[cause]: "+p(e.cause),A),", ")+" }":A.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+U.call(A,", ")+" }"}if(typeof e=="object"&&s){if(sr&&typeof e[sr]=="function"&&Ze)return Ze(e,{depth:c-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Yn(e)){var P=[];return Yt&&Yt.call(e,function($,V){P.push(p(V,e,!0)+" => "+p($,e))}),fr("Map",Ie.call(e),P,g)}if(to(e)){var C=[];return Zt&&Zt.call(e,function($){C.push(p($,e))}),fr("Set",De.call(e),C,g)}if(Zn(e))return Ke("WeakMap");if(ro(e))return Ke("WeakSet");if(eo(e))return Ke("WeakRef");if(Qn(e))return Ae(p(Number(e)));if(Xn(e))return Ae(p(je.call(e)));if(Jn(e))return Ae(Nn.call(e));if(Vn(e))return Ae(p(String(e)));if(!Gn(e)&&!lr(e)){var I=Me(e,p),F=or?or(e)===Object.prototype:e instanceof Object||e.constructor===Object,L=e instanceof Object?"":"null prototype",W=!F&&M&&Object(e)===e&&M in e?ot.call(X(e),8,-1):L?"Object":"",j=F||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ne=j+(W||L?"["+U.call(rr.call([],W||[],L||[]),": ")+"] ":"");return I.length===0?ne+"{}":g?ne+"{"+tt(I,g)+"}":ne+"{ "+U.call(I,", ")+" }"}return String(e)};function pr(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function _n(t){return J.call(String(t),/"/g,"&quot;")}function et(t){return X(t)==="[object Array]"&&(!M||!(typeof t=="object"&&M in t))}function Gn(t){return X(t)==="[object Date]"&&(!M||!(typeof t=="object"&&M in t))}function lr(t){return X(t)==="[object RegExp]"&&(!M||!(typeof t=="object"&&M in t))}function zn(t){return X(t)==="[object Error]"&&(!M||!(typeof t=="object"&&M in t))}function Vn(t){return X(t)==="[object String]"&&(!M||!(typeof t=="object"&&M in t))}function Qn(t){return X(t)==="[object Number]"&&(!M||!(typeof t=="object"&&M in t))}function Jn(t){return X(t)==="[object Boolean]"&&(!M||!(typeof t=="object"&&M in t))}function yr(t){if(fe)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Ye)return!1;try{return Ye.call(t),!0}catch(e){}return!1}function Xn(t){if(!t||typeof t!="object"||!je)return!1;try{return je.call(t),!0}catch(e){}return!1}var Kn=Object.prototype.hasOwnProperty||function(t){return t in this};function Q(t,e){return Kn.call(t,e)}function X(t){return qn.call(t)}function jn(t){if(t.name)return t.name;var e=Bn.call(Un.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function dr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Yn(t){if(!Ie||!t||typeof t!="object")return!1;try{Ie.call(t);try{De.call(t)}catch(e){return!0}return t instanceof Map}catch(e){}return!1}function Zn(t){if(!Se||!t||typeof t!="object")return!1;try{Se.call(t,Se);try{we.call(t,we)}catch(e){return!0}return t instanceof WeakMap}catch(e){}return!1}function eo(t){if(!er||!t||typeof t!="object")return!1;try{return er.call(t),!0}catch(e){}return!1}function to(t){if(!De||!t||typeof t!="object")return!1;try{De.call(t);try{Ie.call(t)}catch(e){return!0}return t instanceof Set}catch(e){}return!1}function ro(t){if(!we||!t||typeof t!="object")return!1;try{we.call(t,we);try{Se.call(t,Se)}catch(e){return!0}return t instanceof WeakSet}catch(e){}return!1}function no(t){return!t||typeof t!="object"?!1:typeof HTMLElement!="undefined"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function gr(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return gr(ot.call(t,0,e.maxStringLength),e)+n}var a=J.call(J.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,oo);return pr(a,"single",e)}function oo(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Hn.call(e.toString(16))}function Ae(t){return"Object("+t+")"}function Ke(t){return t+" { ? }"}function fr(t,e,r,n){var a=n?tt(r,n):U.call(r,", ");return t+" ("+e+") {"+a+"}"}function ao(t){for(var e=0;e<t.length;e++)if(dr(t[e],`
2
+ `)>=0)return!1;return!0}function io(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=U.call(Array(t.indent+1)," ");else return null;return{base:r,prev:U.call(Array(e+1),r)}}function tt(t,e){if(t.length===0)return"";var r=`
3
+ `+e.prev+e.base;return r+U.call(t,","+r)+`
4
+ `+e.prev}function Me(t,e){var r=et(t),n=[];if(r){n.length=t.length;for(var a=0;a<t.length;a++)n[a]=Q(t,a)?e(t[a],t):""}var o=typeof Xe=="function"?Xe(t):[],s;if(fe){s={};for(var i=0;i<o.length;i++)s["$"+o[i]]=o[i]}for(var l in t)Q(t,l)&&(r&&String(Number(l))===l&&l<t.length||fe&&s["$"+l]instanceof Symbol||(ur.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof Xe=="function")for(var f=0;f<o.length;f++)cr.call(t,o[f])&&n.push("["+e(o[f])+"]: "+e(t[o[f]],t));return n}});var Ar=R((Na,hr)=>{"use strict";var at=Pe(),ue=Xt(),so=vr(),lo=at("%TypeError%"),Le=at("%WeakMap%",!0),ke=at("%Map%",!0),fo=ue("WeakMap.prototype.get",!0),uo=ue("WeakMap.prototype.set",!0),co=ue("WeakMap.prototype.has",!0),po=ue("Map.prototype.get",!0),yo=ue("Map.prototype.set",!0),go=ue("Map.prototype.has",!0),it=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},mo=function(t,e){var r=it(t,e);return r&&r.value},vo=function(t,e,r){var n=it(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},ho=function(t,e){return!!it(t,e)};hr.exports=function(){var e,r,n,a={assert:function(o){if(!a.has(o))throw new lo("Side channel does not contain "+so(o))},get:function(o){if(Le&&o&&(typeof o=="object"||typeof o=="function")){if(e)return fo(e,o)}else if(ke){if(r)return po(r,o)}else if(n)return mo(n,o)},has:function(o){if(Le&&o&&(typeof o=="object"||typeof o=="function")){if(e)return co(e,o)}else if(ke){if(r)return go(r,o)}else if(n)return ho(n,o);return!1},set:function(o,s){Le&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Le),uo(e,o,s)):ke?(r||(r=new ke),yo(r,o,s)):(n||(n={key:{},next:null}),vo(n,o,s))}};return a}});var Fe=R((qa,Sr)=>{"use strict";var Ao=String.prototype.replace,So=/%20/g,st={RFC1738:"RFC1738",RFC3986:"RFC3986"};Sr.exports={default:st.RFC3986,formatters:{RFC1738:function(t){return Ao.call(t,So,"+")},RFC3986:function(t){return String(t)}},RFC1738:st.RFC1738,RFC3986:st.RFC3986}});var ft=R((Ua,Tr)=>{"use strict";var wo=Fe(),lt=Object.prototype.hasOwnProperty,te=Array.isArray,B=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),To=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(te(n)){for(var a=[],o=0;o<n.length;++o)typeof n[o]!="undefined"&&a.push(n[o]);r.obj[r.prop]=a}}},wr=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]!="undefined"&&(n[a]=e[a]);return n},bo=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(te(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!lt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var a=e;return te(e)&&!te(r)&&(a=wr(e,n)),te(e)&&te(r)?(r.forEach(function(o,s){if(lt.call(e,s)){var i=e[s];i&&typeof i=="object"&&o&&typeof o=="object"?e[s]=t(i,o,n):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var i=r[s];return lt.call(o,s)?o[s]=t(o[s],i,n):o[s]=i,o},a)},xo=function(e,r){return Object.keys(r).reduce(function(n,a){return n[a]=r[a],n},e)},Ro=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(a){return n}},Eo=function(e,r,n,a,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var i="",l=0;l<s.length;++l){var f=s.charCodeAt(l);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===wo.RFC1738&&(f===40||f===41)){i+=s.charAt(l);continue}if(f<128){i=i+B[f];continue}if(f<2048){i=i+(B[192|f>>6]+B[128|f&63]);continue}if(f<55296||f>=57344){i=i+(B[224|f>>12]+B[128|f>>6&63]+B[128|f&63]);continue}l+=1,f=65536+((f&1023)<<10|s.charCodeAt(l)&1023),i+=B[240|f>>18]+B[128|f>>12&63]+B[128|f>>6&63]+B[128|f&63]}return i},Oo=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],a=0;a<r.length;++a)for(var o=r[a],s=o.obj[o.prop],i=Object.keys(s),l=0;l<i.length;++l){var f=i[l],c=s[f];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:s,prop:f}),n.push(c))}return To(r),e},Po=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Co=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Mo=function(e,r){return[].concat(e,r)},Io=function(e,r){if(te(e)){for(var n=[],a=0;a<e.length;a+=1)n.push(r(e[a]));return n}return r(e)};Tr.exports={arrayToObject:wr,assign:xo,combine:Mo,compact:Oo,decode:Ro,encode:Eo,isBuffer:Co,isRegExp:Po,maybeMap:Io,merge:bo}});var Pr=R((Ba,Or)=>{"use strict";var Rr=Ar(),ct=ft(),Te=Fe(),Do=Object.prototype.hasOwnProperty,br={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},G=Array.isArray,Lo=String.prototype.split,ko=Array.prototype.push,Er=function(t,e){ko.apply(t,G(e)?e:[e])},Fo=Date.prototype.toISOString,xr=Te.default,E={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ct.encode,encodeValuesOnly:!1,format:xr,formatter:Te.formatters[xr],indices:!1,serializeDate:function(e){return Fo.call(e)},skipNulls:!1,strictNullHandling:!1},$o=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ut={},No=function t(e,r,n,a,o,s,i,l,f,c,g,p,y,d,h,T){for(var u=e,v=T,b=0,A=!1;(v=v.get(ut))!==void 0&&!A;){var P=v.get(e);if(b+=1,typeof P!="undefined"){if(P===b)throw new RangeError("Cyclic object value");A=!0}typeof v.get(ut)=="undefined"&&(b=0)}if(typeof l=="function"?u=l(r,u):u instanceof Date?u=g(u):n==="comma"&&G(u)&&(u=ct.maybeMap(u,function(He){return He instanceof Date?g(He):He})),u===null){if(o)return i&&!d?i(r,E.encoder,h,"key",p):r;u=""}if($o(u)||ct.isBuffer(u)){if(i){var C=d?r:i(r,E.encoder,h,"key",p);if(n==="comma"&&d){for(var I=Lo.call(String(u),","),F="",L=0;L<I.length;++L)F+=(L===0?"":",")+y(i(I[L],E.encoder,h,"value",p));return[y(C)+(a&&G(u)&&I.length===1?"[]":"")+"="+F]}return[y(C)+"="+y(i(u,E.encoder,h,"value",p))]}return[y(r)+"="+y(String(u))]}var W=[];if(typeof u=="undefined")return W;var j;if(n==="comma"&&G(u))j=[{value:u.length>0?u.join(",")||null:void 0}];else if(G(l))j=l;else{var ne=Object.keys(u);j=f?ne.sort(f):ne}for(var $=a&&G(u)&&u.length===1?r+"[]":r,V=0;V<j.length;++V){var _=j[V],de=typeof _=="object"&&typeof _.value!="undefined"?_.value:u[_];if(!(s&&de===null)){var sn=G(u)?typeof n=="function"?n($,_):$:$+(c?"."+_:"["+_+"]");T.set(e,b);var wt=Rr();wt.set(ut,T),Er(W,t(de,sn,n,a,o,s,i,l,f,c,g,p,y,d,h,wt))}}return W},qo=function(e){if(!e)return E;if(e.encoder!==null&&typeof e.encoder!="undefined"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||E.charset;if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Te.default;if(typeof e.format!="undefined"){if(!Do.call(Te.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=Te.formatters[n],o=E.filter;return(typeof e.filter=="function"||G(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:E.addQueryPrefix,allowDots:typeof e.allowDots=="undefined"?E.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:E.charsetSentinel,delimiter:typeof e.delimiter=="undefined"?E.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:E.encode,encoder:typeof e.encoder=="function"?e.encoder:E.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:E.encodeValuesOnly,filter:o,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:E.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:E.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:E.strictNullHandling}};Or.exports=function(t,e){var r=t,n=qo(e),a,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):G(n.filter)&&(o=n.filter,a=o);var s=[];if(typeof r!="object"||r===null)return"";var i;e&&e.arrayFormat in br?i=e.arrayFormat:e&&"indices"in e?i=e.indices?"indices":"repeat":i="indices";var l=br[i];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=l==="comma"&&e&&e.commaRoundTrip;a||(a=Object.keys(r)),n.sort&&a.sort(n.sort);for(var c=Rr(),g=0;g<a.length;++g){var p=a[g];n.skipNulls&&r[p]===null||Er(s,No(r[p],p,l,f,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var y=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),y.length>0?d+y:""}});var Ir=R((Ha,Mr)=>{"use strict";var ce=ft(),pt=Object.prototype.hasOwnProperty,Uo=Array.isArray,x={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ce.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Bo=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Cr=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ho="utf8=%26%2310003%3B",Wo="utf8=%E2%9C%93",_o=function(e,r){var n={},a=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=a.split(r.delimiter,o),i=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===Wo?f="utf-8":s[l]===Ho&&(f="iso-8859-1"),i=l,l=s.length);for(l=0;l<s.length;++l)if(l!==i){var c=s[l],g=c.indexOf("]="),p=g===-1?c.indexOf("="):g+1,y,d;p===-1?(y=r.decoder(c,x.decoder,f,"key"),d=r.strictNullHandling?null:""):(y=r.decoder(c.slice(0,p),x.decoder,f,"key"),d=ce.maybeMap(Cr(c.slice(p+1),r),function(h){return r.decoder(h,x.decoder,f,"value")})),d&&r.interpretNumericEntities&&f==="iso-8859-1"&&(d=Bo(d)),c.indexOf("[]=")>-1&&(d=Uo(d)?[d]:d),pt.call(n,y)?n[y]=ce.combine(n[y],d):n[y]=d}return n},Go=function(t,e,r,n){for(var a=n?e:Cr(e,r),o=t.length-1;o>=0;--o){var s,i=t[o];if(i==="[]"&&r.parseArrays)s=[].concat(a);else{s=r.plainObjects?Object.create(null):{};var l=i.charAt(0)==="["&&i.charAt(i.length-1)==="]"?i.slice(1,-1):i,f=parseInt(l,10);!r.parseArrays&&l===""?s={0:a}:!isNaN(f)&&i!==l&&String(f)===l&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[],s[f]=a):l!=="__proto__"&&(s[l]=a)}a=s}return a},zo=function(e,r,n,a){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(o),f=l?o.slice(0,l.index):o,c=[];if(f){if(!n.plainObjects&&pt.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var g=0;n.depth>0&&(l=i.exec(o))!==null&&g<n.depth;){if(g+=1,!n.plainObjects&&pt.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+o.slice(l.index)+"]"),Go(c,r,n,a)}},Vo=function(e){if(!e)return x;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset=="undefined"?x.charset:e.charset;return{allowDots:typeof e.allowDots=="undefined"?x.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:x.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:x.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:x.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:x.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:x.comma,decoder:typeof e.decoder=="function"?e.decoder:x.decoder,delimiter:typeof e.delimiter=="string"||ce.isRegExp(e.delimiter)?e.delimiter:x.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:x.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:x.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:x.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:x.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:x.strictNullHandling}};Mr.exports=function(t,e){var r=Vo(e);if(t===""||t===null||typeof t=="undefined")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?_o(t,r):t,a=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var i=o[s],l=zo(i,n[i],r,typeof t=="string");a=ce.merge(a,l,r)}return r.allowSparse===!0?a:ce.compact(a)}});var Lr=R((Wa,Dr)=>{"use strict";var Qo=Pr(),Jo=Ir(),Xo=Fe();Dr.exports={formats:Xo,parse:Jo,stringify:Qo}});var Ur=R((_a,qr)=>{"use strict";var yt=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,jo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Zo=(t,e)=>{for(var r in e)yt(t,r,{get:e[r],enumerable:!0})},ea=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of jo(e))!Yo.call(t,a)&&a!==r&&yt(t,a,{get:()=>e[a],enumerable:!(n=Ko(e,a))||n.enumerable});return t},ta=t=>ea(yt({},"__esModule",{value:!0}),t),Fr=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},ra=(t,e,r)=>(Fr(t,e,"read from private field"),r?r.call(t):e.get(t)),na=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},oa=(t,e,r,n)=>(Fr(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),$r={};Zo($r,{SessionStatus:()=>Nr,session:()=>ia});qr.exports=ta($r);var aa=require("@apia/util"),Nr=(t=>(t[t.Alive=0]="Alive",t[t.Dead=1]="Dead",t))(Nr||{}),$e,kr,ia=new(kr=class extends aa.EventEmitter{constructor(){super(...arguments),na(this,$e,!0)}get isAlive(){return ra(this,$e)}invalidate(){oa(this,$e,!1),this.emit("change",1)}},$e=new WeakMap,kr)});var Ra={};dn(Ra,{ApiaApi:()=>an,makeApiaUrl:()=>Be});module.exports=gn(Ra);var St=ve(require("axios")),Yr=require("lodash-es"),Ue=ve(Lr()),Zr=ve(Ur()),H=require("@apia/util"),K=require("@apia/notifications");var w=ve(require("react")),Vr=require("theme-ui"),O=require("@apia/util"),gt=require("@apia/notifications"),Qr=require("@apia/validations"),pe=require("@apia/components"),Jr=require("@apia/theme");var Br=require("react"),Hr=ve(require("react")),_r=require("theme-ui/jsx-runtime"),sa;var la=(0,Br.createContext)("apiaApi"),fa=({children:t,id:e})=>(sa=e,(0,_r.jsx)(la.Provider,{value:e,children:t})),Wr=Hr.memo(fa);var k=require("theme-ui/jsx-runtime"),mt=new class extends O.EventEmitter{},vt=new class extends O.EventEmitter{},dt="ApiaApiForm",Gr={};function zr(t,e){return N(this,null,function*(){return new Promise(r=>{var n,a,o;try{let s=/^\/?([\w\d_-]+)\/?(?:\(([^)]*)\))?$/,i=t.match(s);if(i){let l=i[1],f=i[2],c=[...(o=(a=(n=e.configuration)==null?void 0:n.methodsPath)==null?void 0:a.split("/").filter(y=>!!y))!=null?o:[],l].join("/"),g=y=>{typeof y.default!="function"&&p();let d=y.default;Gr[l]=h=>{var T;return d(e,D(S({},h),{inlineArguments:(T=f==null?void 0:f.split(",").map(u=>u.startsWith("'")||u.startsWith('"')?u.slice(1,u.length-1):u))!=null?T:[]}))},r(Gr[l])},p=()=>{throw new Error(`${l}.ts not found at ${c}.ts nor ./${l}.ts`)};import(`/api/methods/${c}.ts`).then(g).catch(()=>{var y;((y=e.configuration)==null?void 0:y.methodsPath)!==void 0?import(`/api/methods/${l}.ts`).then(g).catch(p):p()})}}catch(s){console.error(s),e.reset(),e.setError({type:"danger",message:"Error while loading current method."})}})})}function ua(t){return typeof t.canClose=="boolean"&&typeof t.type=="string"&&!!t.form}function ca(t){return typeof t.canClose=="boolean"&&typeof t.type=="string"&&!!t.function}function pa(t){return!!(typeof t.canClose=="boolean"&&typeof t.type=="string"&&typeof t.text=="object"&&t.text&&typeof t.text.label=="string")}var ht=new O.WithEventsValue;function ya(){let[,t,e]=(0,O.useStateRef)(void 0),r=w.useCallback(n=>{t(n)},[t]);return(0,O.useMount)(()=>{ht.on("update",r)}),(0,O.useUnmount)(()=>ht.off("update",r)),e}var da,At=new class extends O.EventEmitter{emit(e,r){super.emit(e,r),da=r}};function Xr(t,e,r){return ht.value=r,ua(t)?(At.emit("form",t),!0):ca(t)?(vt.emit("method",{name:t.function.name,props:{messages:t.function.messages,attributes:t.function,currentUrl:e}}),!0):pa(t)?(mt.emit("message",{predicate:t.text.label,title:t.text.title}),!0):!1}var Ne={disabled:!1,isLoading:!1,isMultipart:!1,progress:0,errors:{}},ga=()=>{var d,h,T;let t=ya(),[e,r]=w.useState(D(S({},Ne),{windowIndex:-1})),[n,a]=w.useState(void 0);w.useEffect(()=>At.on("form",a),[]);let o=w.useCallback((u,v)=>Qr.validationsStore.setFieldValue(dt,u,v),[]);w.useEffect(()=>{var P,C,I;if(!n)return;let u=(0,O.arrayOrArray)((I=(C=(P=n==null?void 0:n.form)==null?void 0:P.elements)==null?void 0:C.element)!=null?I:[]),v=!1,b=Object.values(u),A=0;for(;A<b.length&&!v;)b[A++].type==="file"&&(v=!0);r(F=>D(S(S({},F),Ne),{isMultipart:v}))},[n]);let y=(0,pe.useModal)(),{show:s,onClose:i}=y,l=me(y,["show","onClose"]),f=w.useCallback(()=>{var u,v;i(),At.emit("form",void 0),r(b=>S(S({},b),Ne)),(v=(u=t.current)==null?void 0:u.modalConfiguration)!=null&&v.onClose&&t.current.modalConfiguration.onClose()},[i,t]),c=w.useRef(null);w.useEffect(()=>{var v;let u=(v=c.current)==null?void 0:v.querySelectorAll("a,input,textarea,button");(u==null?void 0:u.length)===1&&pe.focus.on([...u][0])});let g=w.useCallback(u=>{(0,gt.notify)(S({},u))},[]),p=w.useCallback(()=>({alert,close:f,configuration:t.current,formDefinition:n,reset:()=>r(v=>S(S({},v),Ne)),setError:g,setMessage:v=>{var b,A;(A=(b=t.current)==null?void 0:b.modalConfiguration)!=null&&A.onMessage&&t.current.modalConfiguration.onMessage(v)},setState:r,state:e,setValue:o}),[f,t,n,g,e,o]);return w.useEffect(()=>{let u=F=>N(void 0,[F],function*({name:A,props:{messages:P,attributes:C,currentUrl:I}}){let L=yield zr(`${A}`,p());L&&L({messages:P,attributes:C,currentUrl:I})}),v=A=>{var I,F,L,W;let P=p();(0,gt.notify)({message:A.predicate,type:"warning",onClose:(F=(I=P.configuration)==null?void 0:I.modalConfiguration)==null?void 0:F.onMessageClose});let C=(W=(L=P.configuration)==null?void 0:L.modalConfiguration)==null?void 0:W.onMessage;C&&C(A)},b=A=>N(void 0,null,function*(){if(A.toDo==="ajaxHiddeAll"&&f(),A.toDo==="functionTimedCall"){let P=yield zr((0,O.arrayOrArray)(A.param)[1],p());P&&setTimeout(()=>{var C;return P({currentUrl:(C=n==null?void 0:n.form.action)!=null?C:"noUrl"})},Number(A.param[0]))}});return mt.on("message",v),vt.on("method",u),qe.on("action",b),()=>{mt.off("message",v),vt.off("method",u),qe.off("action",b)}},[e.windowIndex,i,f]),w.useEffect(()=>{n&&s()},[n]),(0,k.jsx)(Wr,{id:dt,children:(0,k.jsx)(pe.Modal,D(S({ref:c,onClose:f,id:dt,title:(T=(h=(d=t.current)==null?void 0:d.modalConfiguration)==null?void 0:h.modalTitle)!=null?T:n==null?void 0:n.form.title,size:"md-fixed",shouldCloseOnEsc:!e.disabled,shouldCloseOnOverlayClick:!e.disabled,initialFocusGetter:w.useCallback(u=>u==null?void 0:u.querySelector(O.focusSelector),[])},l),{children:n&&(0,k.jsxs)(Vr.Box,D(S({},(0,Jr.getVariant)("layout.common.modals.apiaApi")),{children:["NO EST\xC1 IMPLEMENTADA LA PROPIEDAD handleLoad. Falta pasar:",(0,k.jsxs)("ul",{children:[(0,k.jsx)("li",{children:"todos los componentes de validaci\xF3n (input, check, etc)"}),(0,k.jsxs)("li",{children:["M\xE9todos y componentes del apiaApiHandler (./fields, ./buttons, etc)"," ",(0,k.jsx)("strong",{children:"Ver que quiz\xE1s no es necesario pasar todos los m\xE9todos en este momento"}),", sino solamente aquellos que sean necesarios al momento de realizar alguna acci\xF3n particular."," ",(0,k.jsx)("strong",{children:"De hecho es un buen momento para hacer limpieza y refactoreo"})]})]}),"En cambio ",(0,k.jsx)("strong",{children:"el validationsStore si est\xE1 pasado"}),". Solamente faltan los componentes."]}))}))})},ti=w.memo(ga);H.debugDispatcher.on("parseXml",e=>N(void 0,[e],function*([t]){let r=yield(0,H.parseXmlAsync)(t);console.info(r)}),"Acepta un par\xE1metro de tipo string y realiza un parseo como si fuera xml, convirti\xE9ndolo a objeto javascript.");var ye={debug:!0,colors:{exception:"red",alert:"yellow",message:"lightgreen"},handleLoad:!1},ma="ApiaApiConfig",en={},Kr=localStorage.getItem(ma);Kr&&(en=JSON.parse(Kr));function re(t){return(0,Yr.merge)({},ye,t,en)}function tn(t,e,r){let n=t,a=n.indexOf("?");a===-1?n+="?":a!==n.length-1&&!n.endsWith("&")&&(n+="&");let o=`${n}${e?Ue.default.stringify(e,r):""}`;return(o.endsWith("&")||o.endsWith("?"))&&(o=o.slice(0,o.length-1)),o}var rn=t=>{var r;let e=(r=t.match(/action=(\w+)/))==null?void 0:r[1];return e!=null?e:"noAction"},qe=new class extends H.EventEmitter{};function z(t,e=(r=>(r=ye.colors)!=null?r:{exception:"red",alert:"yellow",message:"green"})()){return e[t]}var be=t=>{let e;typeof t!="string"?t.message?e=t.message:e=t.toString():e=t,(0,K.notify)({type:"danger",message:t.message}),console.log("%c ","font-size:10vh"),console.log("%cError in ApiaApi","color:red;font-size:2em;font-weight:bold"),console.log(`red/${e}`,{error:t}),console.log("%c ","font-size:10vh")};function va(t){return t.headers["content-type"].match("application/json")}function ha(t){return t.headers["content-type"].match(/(?:application|text)?\/xml/)}function Aa(t){return t.headers["content-type"].match(/(?:application|text)?\/html/)}function Sa(t){var e,r;t&&(re().debug&&console.log("%cHandled actions: ",`color: ${(r=(e=re().colors)==null?void 0:e.message)!=null?r:"green"}`,{actions:t}),(0,H.arrayOrArray)(t.action).forEach(a=>{qe.emit("action",D(S({},a),{param:(0,H.arrayOrArray)(a.param)}))}))}function jr({exceptions:t,onClose:e,sysExceptions:r,sysMessages:n}){try{import(`/api/onClose/${e}.ts`).then(a=>{if(t||r||n){let o=(0,K.getNotificationMessageObj)({exceptions:t,onClose:e,sysExceptions:r,sysMessages:n});o?o.forEach(s=>{(0,K.notify)(D(S({},s),{onClose:a.default}))}):a.default()}else a.default()},a=>{(0,K.notify)({message:`onClose action not found: ${String(a)}`,type:"danger"})})}catch(a){nn({exceptions:t,sysExceptions:r,sysMessages:n}),console.error("Error while handling onClose"),console.error(a)}}function nn(t){if(!t)return;let{exceptions:e,sysMessages:r,sysExceptions:n}=t;if(e||n||r)try{(0,K.dispatchNotifications)({exceptions:e,sysExceptions:n,sysMessages:r})}catch(a){be(new Error(a))}}var wa=(n,a,...o)=>N(void 0,[n,a,...o],function*(t,e,r=ye){var l;let s=re(r),i;if(va(t))typeof t.data=="string"?i=JSON.parse(t.data.trim()):typeof t.data=="object"&&t.data&&(i=t.data);else if(ha(t))i=yield(0,H.parseXmlAsync)(t.data).catch(c=>{be(new Error(c))});else if(Aa(t))return console.error("El contenido devuelto es Html, no se esperaba esa respuesta"),null;if(s.validateResponse){let c=yield s.validateResponse(D(S({},t),{data:(l=i==null?void 0:i.load)!=null?l:i}));if(typeof c=="string")throw new Error(`Validation error: ${c}`);if(!c)throw new Error("Error")}if(i){let f=i,{actions:c,onClose:g,exceptions:p,sysExceptions:y,sysMessages:d,load:h}=f,T=me(f,["actions","onClose","exceptions","sysExceptions","sysMessages","load"]);return T.code==="-1"&&p?(Zr.session.invalidate(),null):(p&&s.debug&&console.log(`${z("exception",s.colors)}/parseSuccessfulResponse`,{exceptions:p}),y&&s.debug&&console.log(`${z("exception",s.colors)}/parseSuccessfulResponse`,{sysExceptions:y}),d&&s.debug&&console.log(`${z("alert",s.colors)}/parseSuccessfulResponse`,{sysMessages:d}),Sa(c),s.handleLoad&&g?jr({exceptions:p,onClose:g,sysExceptions:y,sysMessages:d}):nn({exceptions:p,sysExceptions:y,sysMessages:d}),h?(s.handleLoad&&(console.log(`${z("message",s.colors)}/handleLoad`,{load:h}),Xr(h,e,{methodsPath:r.methodsPath,modalConfiguration:D(S({},s.modalConfiguration),{onClose:()=>{var u,v;g&&jr({exceptions:p,onClose:g,sysExceptions:y,sysMessages:d}),(u=s.modalConfiguration)!=null&&u.onClose&&((v=s.modalConfiguration)==null||v.onClose())}})})||console.log(`${z("exception",s.colors)}/unhandledLoad -> There is no handler defined`,{load:h})),D(S({},h),{sysMessages:d,exceptions:p,sysExceptions:y})):D(S({},T),{sysMessages:d,exceptions:p,sysExceptions:y}))}return null});function on(n,a){return N(this,arguments,function*(t,e,r=ye){var s;let o=re(r);try{if(!t||t.data===void 0)o.debug&&console.log(`${z("alert",o.colors)}/ApiaApi wrong response`);else{let i=yield wa(t,e,o),l=rn(e);return o.debug&&console.log(`${z("message",o.colors)}/ <- ApiaApi.${(s=t.config.method)!=null?s:""} ${l} `,{data:i}),D(S({},t),{data:i,hasError:!!(i!=null&&i.exceptions)||!!(i!=null&&i.sysExceptions),hasMessages:!!(i!=null&&i.sysMessages)})}}catch(i){return be(new Error(i)),null}return null})}function Ta(t,e){return N(this,null,function*(){let r=typeof t!="string"?Be():t,n=typeof t=="string"?e!=null?e:ye:t,a=D(S({},re(n)),{postData:n.postDataTreatement==="stringify"?Ue.default.stringify(n.postData,n.stringifyOptions):n.postData}),o=tn(r,a.queryData,a.stringifyOptions);if(a.debug){let i=r.split("&"),l=rn(r);console.log(`${z("message",a.colors)}/ApiaApi.post ${l}`,{url:o,queryDataInURL:[...i],queryData:a.queryData,formData:a.postData,stringifyOptiopns:a.stringifyOptions})}let s=yield St.default.post(o,a.postData,a.axiosConfig).catch(i=>{be(new Error(i))});return s?on(s,r,a):null})}function ba(t,e){return N(this,null,function*(){let r=typeof t!="string"?Be():t,n=re(typeof t=="string"?e!=null?e:ye:t),a=tn(r,n.queryData,n.stringifyOptions);n.debug&&console.log(`${z("message",n.colors)}/ApiaApi.get`,{url:a});let o=yield St.default.get(a,n.axiosConfig).catch(s=>{be(new Error(s))});return o?yield on(o,r,n):null})}var xa={get:ba,getConfig:re,post:Ta};function Be(t){var f,c;let e={};if(t){let l=t,{ajaxUrl:g,queryString:p,stringifyOptions:y,shouldAvoidTabId:d,preventAsXmlParameter:h,avoidTabId:T}=l,u=me(l,["ajaxUrl","queryString","stringifyOptions","shouldAvoidTabId","preventAsXmlParameter","avoidTabId"]);e=S({},u)}let r=Ue.default.stringify(e,(f=t==null?void 0:t.stringifyOptions)!=null?f:{arrayFormat:"repeat",encodeValuesOnly:!1}),n=(c=t==null?void 0:t.ajaxUrl)!=null?c:window.URL_REQUEST_AJAX;n.indexOf("?")===n.length-1&&(n=n.slice(0,n.length-1)),n.startsWith("/")||(n=`/${n}`);let a=window.TAB_ID_REQUEST.match(/tokenId=(\w+)/),o=(a!=null?a:[])[1],s=(t!=null&&t.tabId?`&tabId=${t.tabId}&tokenId=${o}`:window.TAB_ID_REQUEST).slice(1);t!=null&&t.avoidTabId&&(s="");let{CONTEXT:i}=window;return i!=null&&i.endsWith("/")&&(i+=i.slice(0,i.length-1)),`${i}${n}?${t!=null&&t.preventAsXmlParameter?"":"asXml=true&"}${t!=null&&t.queryString?`${t.queryString}&`:""}${r?`${r}&`:""}${s}`}var an=xa;0&&(module.exports={ApiaApi,makeApiaUrl});
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"sourcesContent":["const Initiator = () => {\r\n return <>Reemplazar este código por cualquier otro</>;\r\n};\r\n\r\nexport default Initiator;\r\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GACS,IAAAI,EAAA,6BADHC,EAAY,OACT,mBAAE,wDAAyC,EAG7CH,EAAQG","names":["src_exports","__export","src_default","__toCommonJS","import_jsx_runtime","Initiator"]}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "author": "alexisleite <alexisleite@live.com>",
3
+ "homepage": "",
4
+ "license": "MIT",
5
+ "main": "./dist/index.js",
6
+ "name": "@apia/api",
7
+ "sideEffects": false,
8
+ "types": "./dist/index.d.ts",
9
+ "version": "0.0.7",
10
+ "dependencies": {
11
+ "@apia/components": "^0.0.7",
12
+ "@apia/notifications": "^0.0.7",
13
+ "@apia/theme": "^0.0.7",
14
+ "@apia/util": "^0.0.7",
15
+ "@apia/validations": "^0.0.7",
16
+ "@types/lodash-es": "^4.17.7",
17
+ "axios": "^1.3.4",
18
+ "lodash-es": "^4.17.21"
19
+ },
20
+ "devDependencies": {
21
+ "tsup": "^6.6.3",
22
+ "type-fest": "^3.6.1",
23
+ "typescript": "^4.9.5"
24
+ },
25
+ "peerDependencies": {
26
+ "@emotion/react": "^11.10.6",
27
+ "react": "^18.2.0",
28
+ "react-dom": "^18.2.0",
29
+ "theme-ui": "^0.15.5"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "registry": "https://registry.npmjs.org/"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "http://corp-gitlab-01.domst.st.net/products/apia/ApiaNPMPackages.git",
38
+ "directory": "packages/api"
39
+ },
40
+ "scripts": {
41
+ "build": "tsup",
42
+ "buildDev": "tsup"
43
+ },
44
+ "gitHead": "a3010b3c00d9f5eac216a167418750c391f4201d"
45
+ }