@oceanum/eidos 0.9.0 → 0.9.2
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/README.md +262 -8
- package/dist/index.cjs +8 -0
- package/dist/index.js +4631 -0
- package/package.json +6 -3
- package/index.html +0 -13
- package/project.json +0 -4
- package/scripts/debug-schema.js +0 -30
- package/scripts/generate-interfaces.js +0 -48
- package/scripts/schema-bundler.js +0 -609
- package/scripts/schema-to-typescript.js +0 -604
- package/src/index.ts +0 -3
- package/src/lib/eidosmodel.ts +0 -46
- package/src/lib/react.tsx +0 -8
- package/src/lib/render.ts +0 -86
- package/src/schema/interfaces.ts +0 -1157
- package/test-example.js +0 -64
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -25
- package/tsconfig.spec.json +0 -31
- package/vite.config.ts +0 -44
- /package/{public → dist}/favicon.ico +0 -0
package/README.md
CHANGED
|
@@ -19,13 +19,63 @@ A lightweight, reactive JavaScript library for embedding and controlling EIDOS v
|
|
|
19
19
|
npm install @oceanum/eidos
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### React Usage (Recommended)
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { EidosProvider, useEidosSpec } from "@oceanum/eidos";
|
|
26
|
+
|
|
27
|
+
// Define your EIDOS specification
|
|
28
|
+
const initialSpec = {
|
|
29
|
+
version: "0.9",
|
|
30
|
+
id: "my-app",
|
|
31
|
+
name: "My Visualization",
|
|
32
|
+
root: {
|
|
33
|
+
id: "root",
|
|
34
|
+
nodeType: "world",
|
|
35
|
+
children: [],
|
|
36
|
+
},
|
|
37
|
+
data: [],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function App() {
|
|
41
|
+
return (
|
|
42
|
+
<EidosProvider
|
|
43
|
+
initialSpec={initialSpec}
|
|
44
|
+
options={{
|
|
45
|
+
renderer: "https://render.eidos.oceanum.io",
|
|
46
|
+
eventListener: (event) => console.log("Event:", event),
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<YourComponents />
|
|
50
|
+
</EidosProvider>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// In any child component
|
|
55
|
+
function YourComponent() {
|
|
56
|
+
const spec = useEidosSpec();
|
|
57
|
+
|
|
58
|
+
const addLayer = () => {
|
|
59
|
+
// Mutate spec directly - changes propagate automatically to iframe
|
|
60
|
+
spec.root.children.push({
|
|
61
|
+
id: "new-layer",
|
|
62
|
+
nodeType: "worldlayer",
|
|
63
|
+
layerType: "track",
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return <button onClick={addLayer}>Add Layer</button>;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Vanilla JavaScript Usage
|
|
23
72
|
|
|
24
73
|
```javascript
|
|
25
|
-
import {
|
|
74
|
+
import { render } from "@oceanum/eidos";
|
|
26
75
|
|
|
27
76
|
// Define your EIDOS specification
|
|
28
77
|
const spec = {
|
|
78
|
+
version: "0.9",
|
|
29
79
|
id: "my-app",
|
|
30
80
|
name: "My Visualization",
|
|
31
81
|
root: {
|
|
@@ -34,24 +84,134 @@ const spec = {
|
|
|
34
84
|
children: [],
|
|
35
85
|
},
|
|
36
86
|
data: [],
|
|
37
|
-
transforms: [],
|
|
38
87
|
};
|
|
39
88
|
|
|
40
|
-
//
|
|
89
|
+
// Render in a container element
|
|
41
90
|
const container = document.getElementById("eidos-container");
|
|
42
|
-
const
|
|
43
|
-
|
|
91
|
+
const result = await render(container, spec, {
|
|
92
|
+
renderer: "https://render.eidos.oceanum.io",
|
|
93
|
+
eventListener: (event) => {
|
|
94
|
+
console.log("Received event:", event);
|
|
95
|
+
},
|
|
44
96
|
});
|
|
45
97
|
|
|
46
98
|
// Mutate the spec naturally - changes propagate automatically
|
|
47
|
-
|
|
48
|
-
|
|
99
|
+
result.spec.name = "Updated Visualization";
|
|
100
|
+
result.spec.root.children.push({
|
|
49
101
|
id: "layer-1",
|
|
50
102
|
nodeType: "worldlayer",
|
|
51
103
|
layerType: "track",
|
|
52
104
|
});
|
|
105
|
+
|
|
106
|
+
// Clean up when done
|
|
107
|
+
result.destroy();
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Advanced Usage
|
|
111
|
+
|
|
112
|
+
### Managing Multiple EIDOS Instances
|
|
113
|
+
|
|
114
|
+
The React Context API allows you to easily manage multiple EIDOS instances in the same application. Each `EidosProvider` creates its own isolated context with its own iframe and spec.
|
|
115
|
+
|
|
116
|
+
**Option 1: Multiple Providers (Recommended)**
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { EidosProvider, useEidosSpec } from "@oceanum/eidos";
|
|
120
|
+
|
|
121
|
+
function App() {
|
|
122
|
+
return (
|
|
123
|
+
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr' }}>
|
|
124
|
+
{/* Map view */}
|
|
125
|
+
<EidosProvider
|
|
126
|
+
initialSpec={mapSpec}
|
|
127
|
+
options={{ renderer: EIDOS_URL }}
|
|
128
|
+
>
|
|
129
|
+
<MapControls />
|
|
130
|
+
</EidosProvider>
|
|
131
|
+
|
|
132
|
+
{/* Chart view */}
|
|
133
|
+
<EidosProvider
|
|
134
|
+
initialSpec={chartSpec}
|
|
135
|
+
options={{ renderer: EIDOS_URL }}
|
|
136
|
+
>
|
|
137
|
+
<ChartControls />
|
|
138
|
+
</EidosProvider>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function MapControls() {
|
|
144
|
+
const spec = useEidosSpec(); // Gets mapSpec from nearest provider
|
|
145
|
+
// Mutations only affect this instance
|
|
146
|
+
const zoomIn = () => {
|
|
147
|
+
spec.root.viewState.zoom += 1;
|
|
148
|
+
};
|
|
149
|
+
return <button onClick={zoomIn}>Zoom In</button>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function ChartControls() {
|
|
153
|
+
const spec = useEidosSpec(); // Gets chartSpec from nearest provider
|
|
154
|
+
// Completely isolated from MapControls
|
|
155
|
+
const updateData = () => {
|
|
156
|
+
spec.data[0].dataSpec = newData;
|
|
157
|
+
};
|
|
158
|
+
return <button onClick={updateData}>Update Data</button>;
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Option 2: Low-Level Render API**
|
|
163
|
+
|
|
164
|
+
For more control, use the `render()` function directly:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
import { render } from "@oceanum/eidos";
|
|
168
|
+
import { useEffect, useRef, useState } from "react";
|
|
169
|
+
|
|
170
|
+
function MultiInstance() {
|
|
171
|
+
const container1 = useRef(null);
|
|
172
|
+
const container2 = useRef(null);
|
|
173
|
+
const [specs, setSpecs] = useState({ map: null, chart: null });
|
|
174
|
+
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
const init = async () => {
|
|
177
|
+
const map = await render(container1.current, mapSpec, { renderer: EIDOS_URL });
|
|
178
|
+
const chart = await render(container2.current, chartSpec, { renderer: EIDOS_URL });
|
|
179
|
+
|
|
180
|
+
setSpecs({ map: map.spec, chart: chart.spec });
|
|
181
|
+
|
|
182
|
+
return () => {
|
|
183
|
+
map.destroy();
|
|
184
|
+
chart.destroy();
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
init();
|
|
189
|
+
}, []);
|
|
190
|
+
|
|
191
|
+
const updateMap = () => {
|
|
192
|
+
if (specs.map) {
|
|
193
|
+
specs.map.root.viewState.zoom += 1;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<div>
|
|
199
|
+
<div ref={container1} style={{ width: '50%', height: '100%' }} />
|
|
200
|
+
<div ref={container2} style={{ width: '50%', height: '100%' }} />
|
|
201
|
+
<button onClick={updateMap}>Update Map</button>
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
53
205
|
```
|
|
54
206
|
|
|
207
|
+
**Key Points for Multiple Instances:**
|
|
208
|
+
|
|
209
|
+
- ✅ Each instance has its own iframe and spec proxy
|
|
210
|
+
- ✅ Changes to one instance don't affect others
|
|
211
|
+
- ✅ `useEidosSpec()` always returns the spec from the nearest `EidosProvider` ancestor
|
|
212
|
+
- ✅ Use unique `id` values in your specs to avoid conflicts
|
|
213
|
+
- ✅ Each instance can connect to the same or different renderer URLs
|
|
214
|
+
|
|
55
215
|
## Framework Integration
|
|
56
216
|
|
|
57
217
|
- [React Integration](./docs/eidos/react.md) - Hooks, components, and patterns
|
|
@@ -61,6 +221,100 @@ eidos.root.children.push({
|
|
|
61
221
|
|
|
62
222
|
## API Reference
|
|
63
223
|
|
|
224
|
+
### React Components and Hooks
|
|
225
|
+
|
|
226
|
+
#### `<EidosProvider>`
|
|
227
|
+
|
|
228
|
+
Renders an EIDOS iframe and provides the spec proxy to all child components via React Context.
|
|
229
|
+
|
|
230
|
+
**Props:**
|
|
231
|
+
- `initialSpec` (required): The EIDOS specification object
|
|
232
|
+
- `options` (optional): Render options
|
|
233
|
+
- `renderer` (string): URL of the EIDOS renderer (default: `https://render.eidos.oceanum.io`)
|
|
234
|
+
- `eventListener` (function): Callback for events from the renderer
|
|
235
|
+
- `authToken` (string | function): Authentication token for data fetching
|
|
236
|
+
- `containerStyle` (optional): CSS styles for the iframe container (default: `{ width: '100%', height: '100%', position: 'absolute' }`)
|
|
237
|
+
- `onInitialized` (optional): Callback called with the spec proxy after initialization
|
|
238
|
+
|
|
239
|
+
**Example:**
|
|
240
|
+
```tsx
|
|
241
|
+
<EidosProvider
|
|
242
|
+
initialSpec={mySpec}
|
|
243
|
+
options={{
|
|
244
|
+
renderer: "https://render.eidos.oceanum.io",
|
|
245
|
+
eventListener: (event) => console.log(event),
|
|
246
|
+
}}
|
|
247
|
+
containerStyle={{ width: '100vw', height: '100vh' }}
|
|
248
|
+
onInitialized={(spec) => console.log('Ready!', spec)}
|
|
249
|
+
>
|
|
250
|
+
<YourComponents />
|
|
251
|
+
</EidosProvider>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### `useEidosSpec()`
|
|
255
|
+
|
|
256
|
+
Hook that returns the EIDOS spec proxy from the nearest `EidosProvider` ancestor.
|
|
257
|
+
|
|
258
|
+
**Returns:** `Proxy<EidosSpec>` - The spec proxy (read and mutate directly)
|
|
259
|
+
|
|
260
|
+
**Throws:** Error if not used within an `EidosProvider`
|
|
261
|
+
|
|
262
|
+
**Example:**
|
|
263
|
+
```tsx
|
|
264
|
+
function MyComponent() {
|
|
265
|
+
const spec = useEidosSpec();
|
|
266
|
+
|
|
267
|
+
// Read from spec
|
|
268
|
+
const layerCount = spec.root.children.length;
|
|
269
|
+
|
|
270
|
+
// Mutate spec - changes sync to iframe automatically
|
|
271
|
+
const addLayer = () => {
|
|
272
|
+
spec.root.children.push({
|
|
273
|
+
id: 'new-layer',
|
|
274
|
+
nodeType: 'worldlayer',
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
return <button onClick={addLayer}>Add Layer ({layerCount})</button>;
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Core Functions
|
|
283
|
+
|
|
284
|
+
#### `render(element, spec, options)`
|
|
285
|
+
|
|
286
|
+
Low-level function to render EIDOS in a DOM element. Use this for vanilla JavaScript or when you need more control than `EidosProvider` offers.
|
|
287
|
+
|
|
288
|
+
**Parameters:**
|
|
289
|
+
- `element` (HTMLElement): Container element for the iframe
|
|
290
|
+
- `spec` (EidosSpec): The EIDOS specification
|
|
291
|
+
- `options` (RenderOptions): Configuration options
|
|
292
|
+
- `renderer` (string): Renderer URL
|
|
293
|
+
- `eventListener` (function): Event callback
|
|
294
|
+
- `authToken` (string | function): Auth token
|
|
295
|
+
- `id` (string): Optional override for spec ID
|
|
296
|
+
|
|
297
|
+
**Returns:** `Promise<RenderResult>`
|
|
298
|
+
- `spec`: The reactive spec proxy
|
|
299
|
+
- `iframe`: The iframe element
|
|
300
|
+
- `updateAuth(token)`: Function to update auth token
|
|
301
|
+
- `destroy()`: Cleanup function
|
|
302
|
+
|
|
303
|
+
**Example:**
|
|
304
|
+
```javascript
|
|
305
|
+
const result = await render(container, spec, {
|
|
306
|
+
renderer: EIDOS_URL,
|
|
307
|
+
eventListener: (e) => console.log(e),
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
result.spec.data.push(newData);
|
|
311
|
+
|
|
312
|
+
// Clean up
|
|
313
|
+
result.destroy();
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Additional Documentation
|
|
317
|
+
|
|
64
318
|
- [Core API](./docs/eidos/api.md) - Complete API documentation
|
|
65
319
|
- [Events](./docs/eidos/events.md) - Event handling and communication
|
|
66
320
|
- [Validation](./docs/eidos/validation.md) - Schema validation details
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Re=require("react"),Sn=Symbol(),Wt=Object.getPrototypeOf,zt=new WeakMap,Pn=e=>e&&(zt.has(e)?zt.get(e):Wt(e)===Object.prototype||Wt(e)===Array.prototype),Rn=e=>Pn(e)&&e[Sn]||null,Bt=(e,a=!0)=>{zt.set(e,a)},yt={},Ut=e=>typeof e=="object"&&e!==null,Nn=e=>Ut(e)&&!Lt.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),hn=(e,a)=>{const g=Xt.get(e);if(g?.[0]===a)return g[1];const u=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return Bt(u,!0),Xt.set(e,[a,u]),Reflect.ownKeys(e).forEach(v=>{if(Object.getOwnPropertyDescriptor(u,v))return;const o=Reflect.get(e,v),{enumerable:l}=Reflect.getOwnPropertyDescriptor(e,v),c={value:o,enumerable:l,configurable:!0};if(Lt.has(o))Bt(o,!1);else if(be.has(o)){const[d,_]=be.get(o);c.value=hn(d,_())}Object.defineProperty(u,v,c)}),Object.preventExtensions(u)},On=(e,a,g,u)=>({deleteProperty(v,o){Reflect.get(v,o),g(o);const l=Reflect.deleteProperty(v,o);return l&&u(void 0),l},set(v,o,l,c){const d=!e()&&Reflect.has(v,o),_=Reflect.get(v,o,c);if(d&&(Qt(_,l)||vt.has(l)&&Qt(_,vt.get(l))))return!0;g(o),Ut(l)&&(l=Rn(l)||l);const h=!be.has(l)&&kn(l)?pn(l):l;return a(o,h),Reflect.set(v,o,h,c),u(void 0),!0}}),be=new WeakMap,Lt=new WeakSet,Xt=new WeakMap,Nt=[1],vt=new WeakMap;let Qt=Object.is,jn=(e,a)=>new Proxy(e,a),kn=Nn,In=hn,Tn=On;function pn(e={}){if(!Ut(e))throw new Error("object required");const a=vt.get(e);if(a)return a;let g=Nt[0];const u=new Set,v=(n,r=++Nt[0])=>{g!==r&&(o=g=r,u.forEach(t=>t(n,r)))};let o=g;const l=(n=Nt[0])=>(o!==n&&(o=n,d.forEach(([r])=>{const t=r[1](n);t>g&&(g=t)})),g),c=n=>(r,t)=>{let s;r&&(s=[...r],s[1]=[n,...s[1]]),v(s,t)},d=new Map,_=(n,r)=>{const t=!Lt.has(r)&&be.get(r);if(t){if((yt?"production":void 0)!=="production"&&d.has(n))throw new Error("prop listener already exists");if(u.size){const s=t[2](c(n));d.set(n,[t,s])}else d.set(n,[t])}},h=n=>{var r;const t=d.get(n);t&&(d.delete(n),(r=t[1])==null||r.call(t))},S=n=>(u.add(n),u.size===1&&d.forEach(([t,s],f)=>{if((yt?"production":void 0)!=="production"&&s)throw new Error("remove already exists");const m=t[2](c(f));d.set(f,[t,m])}),()=>{u.delete(n),u.size===0&&d.forEach(([t,s],f)=>{s&&(s(),d.set(f,[t]))})});let R=!0;const E=Tn(()=>R,_,h,v),b=jn(e,E);vt.set(e,b);const y=[e,l,S];return be.set(b,y),Reflect.ownKeys(e).forEach(n=>{const r=Object.getOwnPropertyDescriptor(e,n);"value"in r&&r.writable&&(b[n]=e[n])}),R=!1,b}function qn(e,a,g){const u=be.get(e);(yt?"production":void 0)!=="production"&&!u&&console.warn("Please use proxy object");let v;const o=[],l=u[2];let c=!1;const _=l(h=>{h&&o.push(h),v||(v=Promise.resolve().then(()=>{v=void 0,c&&a(o.splice(0))}))});return c=!0,()=>{c=!1,_()}}function Cn(e){const a=be.get(e);(yt?"production":void 0)!=="production"&&!a&&console.warn("Please use proxy object");const[g,u]=a;return In(g,u())}function An(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Te={exports:{}},Ot={},he={},ge={},jt={},kt={},It={},Yt;function _t(){return Yt||(Yt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class a{}e._CodeOrName=a,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class g extends a{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=g;class u extends a{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((s,f)=>`${s}${f}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((s,f)=>(f instanceof g&&(s[f.str]=(s[f.str]||0)+1),s),{})}}e._Code=u,e.nil=new u("");function v(r,...t){const s=[r[0]];let f=0;for(;f<t.length;)c(s,t[f]),s.push(r[++f]);return new u(s)}e._=v;const o=new u("+");function l(r,...t){const s=[E(r[0])];let f=0;for(;f<t.length;)s.push(o),c(s,t[f]),s.push(o,E(r[++f]));return d(s),new u(s)}e.str=l;function c(r,t){t instanceof u?r.push(...t._items):t instanceof g?r.push(t):r.push(S(t))}e.addCodeArg=c;function d(r){let t=1;for(;t<r.length-1;){if(r[t]===o){const s=_(r[t-1],r[t+1]);if(s!==void 0){r.splice(t-1,3,s);continue}r[t++]="+"}t++}}function _(r,t){if(t==='""')return r;if(r==='""')return t;if(typeof r=="string")return t instanceof g||r[r.length-1]!=='"'?void 0:typeof t!="string"?`${r.slice(0,-1)}${t}"`:t[0]==='"'?r.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(r instanceof g))return`"${r}${t.slice(1)}`}function h(r,t){return t.emptyStr()?r:r.emptyStr()?t:l`${r}${t}`}e.strConcat=h;function S(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:E(Array.isArray(r)?r.join(","):r)}function R(r){return new u(E(r))}e.stringify=R;function E(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=E;function b(r){return typeof r=="string"&&e.IDENTIFIER.test(r)?new u(`.${r}`):v`[${r}]`}e.getProperty=b;function y(r){if(typeof r=="string"&&e.IDENTIFIER.test(r))return new u(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}e.getEsmExportName=y;function n(r){return new u(r.toString())}e.regexpCode=n}(It)),It}var Tt={},Zt;function xt(){return Zt||(Zt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const a=_t();class g extends Error{constructor(_){super(`CodeGen: "code" for ${_} not defined`),this.value=_.value}}var u;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(u||(e.UsedValueState=u={})),e.varKinds={const:new a.Name("const"),let:new a.Name("let"),var:new a.Name("var")};class v{constructor({prefixes:_,parent:h}={}){this._names={},this._prefixes=_,this._parent=h}toName(_){return _ instanceof a.Name?_:this.name(_)}name(_){return new a.Name(this._newName(_))}_newName(_){const h=this._names[_]||this._nameGroup(_);return`${_}${h.index++}`}_nameGroup(_){var h,S;if(!((S=(h=this._parent)===null||h===void 0?void 0:h._prefixes)===null||S===void 0)&&S.has(_)||this._prefixes&&!this._prefixes.has(_))throw new Error(`CodeGen: prefix "${_}" is not allowed in this scope`);return this._names[_]={prefix:_,index:0}}}e.Scope=v;class o extends a.Name{constructor(_,h){super(h),this.prefix=_}setValue(_,{property:h,itemIndex:S}){this.value=_,this.scopePath=(0,a._)`.${new a.Name(h)}[${S}]`}}e.ValueScopeName=o;const l=(0,a._)`\n`;class c extends v{constructor(_){super(_),this._values={},this._scope=_.scope,this.opts={..._,_n:_.lines?l:a.nil}}get(){return this._scope}name(_){return new o(_,this._newName(_))}value(_,h){var S;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const R=this.toName(_),{prefix:E}=R,b=(S=h.key)!==null&&S!==void 0?S:h.ref;let y=this._values[E];if(y){const t=y.get(b);if(t)return t}else y=this._values[E]=new Map;y.set(b,R);const n=this._scope[E]||(this._scope[E]=[]),r=n.length;return n[r]=h.ref,R.setValue(h,{property:E,itemIndex:r}),R}getValue(_,h){const S=this._values[_];if(S)return S.get(h)}scopeRefs(_,h=this._values){return this._reduceValues(h,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,a._)`${_}${S.scopePath}`})}scopeCode(_=this._values,h,S){return this._reduceValues(_,R=>{if(R.value===void 0)throw new Error(`CodeGen: name "${R}" has no value`);return R.value.code},h,S)}_reduceValues(_,h,S={},R){let E=a.nil;for(const b in _){const y=_[b];if(!y)continue;const n=S[b]=S[b]||new Map;y.forEach(r=>{if(n.has(r))return;n.set(r,u.Started);let t=h(r);if(t){const s=this.opts.es5?e.varKinds.var:e.varKinds.const;E=(0,a._)`${E}${s} ${r} = ${t};${this.opts._n}`}else if(t=R?.(r))E=(0,a._)`${E}${t}${this.opts._n}`;else throw new g(r);n.set(r,u.Completed)})}return E}}e.ValueScope=c}(Tt)),Tt}var er;function J(){return er||(er=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const a=_t(),g=xt();var u=_t();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return u.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return u.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return u.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}});var v=xt();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return v.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return v.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return v.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return v.varKinds}}),e.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class o{optimizeNodes(){return this}optimizeNames(i,w){return this}}class l extends o{constructor(i,w,I){super(),this.varKind=i,this.name=w,this.rhs=I}render({es5:i,_n:w}){const I=i?g.varKinds.var:this.varKind,V=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${V};`+w}optimizeNames(i,w){if(i[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,i,w)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class c extends o{constructor(i,w,I){super(),this.lhs=i,this.rhs=w,this.sideEffects=I}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,w){if(!(this.lhs instanceof a.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,i,w),this}get names(){const i=this.lhs instanceof a.Name?{}:{...this.lhs.names};return F(i,this.rhs)}}class d extends c{constructor(i,w,I,V){super(i,I,V),this.op=w}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}}class _ extends o{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}}class h extends o{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}}class S extends o{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}}class R extends o{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,w){return this.code=B(this.code,i,w),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class E extends o{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((w,I)=>w+I.render(i),"")}optimizeNodes(){const{nodes:i}=this;let w=i.length;for(;w--;){const I=i[w].optimizeNodes();Array.isArray(I)?i.splice(w,1,...I):I?i[w]=I:i.splice(w,1)}return i.length>0?this:void 0}optimizeNames(i,w){const{nodes:I}=this;let V=I.length;for(;V--;){const L=I[V];L.optimizeNames(i,w)||(x(i,L.names),I.splice(V,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((i,w)=>K(i,w.names),{})}}class b extends E{render(i){return"{"+i._n+super.render(i)+"}"+i._n}}class y extends E{}class n extends b{}n.kind="else";class r extends b{constructor(i,w){super(w),this.condition=i}render(i){let w=`if(${this.condition})`+super.render(i);return this.else&&(w+="else "+this.else.render(i)),w}optimizeNodes(){super.optimizeNodes();const i=this.condition;if(i===!0)return this.nodes;let w=this.else;if(w){const I=w.optimizeNodes();w=this.else=Array.isArray(I)?new n(I):I}if(w)return i===!1?w instanceof r?w:w.nodes:this.nodes.length?this:new r(de(i),w instanceof r?[w]:w.nodes);if(!(i===!1||!this.nodes.length))return this}optimizeNames(i,w){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(i,w),!!(super.optimizeNames(i,w)||this.else))return this.condition=B(this.condition,i,w),this}get names(){const i=super.names;return F(i,this.condition),this.else&&K(i,this.else.names),i}}r.kind="if";class t extends b{}t.kind="for";class s extends t{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,w){if(super.optimizeNames(i,w))return this.iteration=B(this.iteration,i,w),this}get names(){return K(super.names,this.iteration.names)}}class f extends t{constructor(i,w,I,V){super(),this.varKind=i,this.name=w,this.from=I,this.to=V}render(i){const w=i.es5?g.varKinds.var:this.varKind,{name:I,from:V,to:L}=this;return`for(${w} ${I}=${V}; ${I}<${L}; ${I}++)`+super.render(i)}get names(){const i=F(super.names,this.from);return F(i,this.to)}}class m extends t{constructor(i,w,I,V){super(),this.loop=i,this.varKind=w,this.name=I,this.iterable=V}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,w){if(super.optimizeNames(i,w))return this.iterable=B(this.iterable,i,w),this}get names(){return K(super.names,this.iterable.names)}}class p extends b{constructor(i,w,I){super(),this.name=i,this.args=w,this.async=I}render(i){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(i)}}p.kind="func";class $ extends E{render(i){return"return "+super.render(i)}}$.kind="return";class k extends b{render(i){let w="try"+super.render(i);return this.catch&&(w+=this.catch.render(i)),this.finally&&(w+=this.finally.render(i)),w}optimizeNodes(){var i,w;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(w=this.finally)===null||w===void 0||w.optimizeNodes(),this}optimizeNames(i,w){var I,V;return super.optimizeNames(i,w),(I=this.catch)===null||I===void 0||I.optimizeNames(i,w),(V=this.finally)===null||V===void 0||V.optimizeNames(i,w),this}get names(){const i=super.names;return this.catch&&K(i,this.catch.names),this.finally&&K(i,this.finally.names),i}}class C extends b{constructor(i){super(),this.error=i}render(i){return`catch(${this.error})`+super.render(i)}}C.kind="catch";class D extends b{render(i){return"finally"+super.render(i)}}D.kind="finally";class z{constructor(i,w={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...w,_n:w.lines?`
|
|
2
|
+
`:""},this._extScope=i,this._scope=new g.Scope({parent:i}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,w){const I=this._extScope.value(i,w);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(i,w){return this._extScope.getValue(i,w)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,w,I,V){const L=this._scope.toName(w);return I!==void 0&&V&&(this._constants[L.str]=I),this._leafNode(new l(i,L,I)),L}const(i,w,I){return this._def(g.varKinds.const,i,w,I)}let(i,w,I){return this._def(g.varKinds.let,i,w,I)}var(i,w,I){return this._def(g.varKinds.var,i,w,I)}assign(i,w,I){return this._leafNode(new c(i,w,I))}add(i,w){return this._leafNode(new d(i,e.operators.ADD,w))}code(i){return typeof i=="function"?i():i!==a.nil&&this._leafNode(new R(i)),this}object(...i){const w=["{"];for(const[I,V]of i)w.length>1&&w.push(","),w.push(I),(I!==V||this.opts.es5)&&(w.push(":"),(0,a.addCodeArg)(w,V));return w.push("}"),new a._Code(w)}if(i,w,I){if(this._blockNode(new r(i)),w&&I)this.code(w).else().code(I).endIf();else if(w)this.code(w).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new r(i))}else(){return this._elseNode(new n)}endIf(){return this._endBlockNode(r,n)}_for(i,w){return this._blockNode(i),w&&this.code(w).endFor(),this}for(i,w){return this._for(new s(i),w)}forRange(i,w,I,V,L=this.opts.es5?g.varKinds.var:g.varKinds.let){const Q=this._scope.toName(i);return this._for(new f(L,Q,w,I),()=>V(Q))}forOf(i,w,I,V=g.varKinds.const){const L=this._scope.toName(i);if(this.opts.es5){const Q=w instanceof a.Name?w:this.var("_arr",w);return this.forRange("_i",0,(0,a._)`${Q}.length`,W=>{this.var(L,(0,a._)`${Q}[${W}]`),I(L)})}return this._for(new m("of",V,L,w),()=>I(L))}forIn(i,w,I,V=this.opts.es5?g.varKinds.var:g.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,(0,a._)`Object.keys(${w})`,I);const L=this._scope.toName(i);return this._for(new m("in",V,L,w),()=>I(L))}endFor(){return this._endBlockNode(t)}label(i){return this._leafNode(new _(i))}break(i){return this._leafNode(new h(i))}return(i){const w=new $;if(this._blockNode(w),this.code(i),w.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(i,w,I){if(!w&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const V=new k;if(this._blockNode(V),this.code(i),w){const L=this.name("e");this._currNode=V.catch=new C(L),w(L)}return I&&(this._currNode=V.finally=new D,this.code(I)),this._endBlockNode(C,D)}throw(i){return this._leafNode(new S(i))}block(i,w){return this._blockStarts.push(this._nodes.length),i&&this.code(i).endBlock(w),this}endBlock(i){const w=this._blockStarts.pop();if(w===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-w;if(I<0||i!==void 0&&I!==i)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${i} expected`);return this._nodes.length=w,this}func(i,w=a.nil,I,V){return this._blockNode(new p(i,w,I)),V&&this.code(V).endFunc(),this}endFunc(){return this._endBlockNode(p)}optimize(i=1){for(;i-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,w){const I=this._currNode;if(I instanceof i||w&&I instanceof w)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${w?`${i.kind}/${w.kind}`:i.kind}"`)}_elseNode(i){const w=this._currNode;if(!(w instanceof r))throw new Error('CodeGen: "else" without "if"');return this._currNode=w.else=i,this}get _root(){return this._nodes[0]}get _currNode(){const i=this._nodes;return i[i.length-1]}set _currNode(i){const w=this._nodes;w[w.length-1]=i}}e.CodeGen=z;function K(j,i){for(const w in i)j[w]=(j[w]||0)+(i[w]||0);return j}function F(j,i){return i instanceof a._CodeOrName?K(j,i.names):j}function B(j,i,w){if(j instanceof a.Name)return I(j);if(!V(j))return j;return new a._Code(j._items.reduce((L,Q)=>(Q instanceof a.Name&&(Q=I(Q)),Q instanceof a._Code?L.push(...Q._items):L.push(Q),L),[]));function I(L){const Q=w[L.str];return Q===void 0||i[L.str]!==1?L:(delete i[L.str],Q)}function V(L){return L instanceof a._Code&&L._items.some(Q=>Q instanceof a.Name&&i[Q.str]===1&&w[Q.str]!==void 0)}}function x(j,i){for(const w in i)j[w]=(j[w]||0)-(i[w]||0)}function de(j){return typeof j=="boolean"||typeof j=="number"||j===null?!j:(0,a._)`!${q(j)}`}e.not=de;const fe=N(e.operators.AND);function Z(...j){return j.reduce(fe)}e.and=Z;const ye=N(e.operators.OR);function A(...j){return j.reduce(ye)}e.or=A;function N(j){return(i,w)=>i===a.nil?w:w===a.nil?i:(0,a._)`${q(i)} ${j} ${q(w)}`}function q(j){return j instanceof a.Name?j:(0,a._)`(${j})`}}(kt)),kt}var H={},tr;function X(){if(tr)return H;tr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=J(),a=_t();function g(m){const p={};for(const $ of m)p[$]=!0;return p}H.toHash=g;function u(m,p){return typeof p=="boolean"?p:Object.keys(p).length===0?!0:(v(m,p),!o(p,m.self.RULES.all))}H.alwaysValidSchema=u;function v(m,p=m.schema){const{opts:$,self:k}=m;if(!$.strictSchema||typeof p=="boolean")return;const C=k.RULES.keywords;for(const D in p)C[D]||f(m,`unknown keyword: "${D}"`)}H.checkUnknownRules=v;function o(m,p){if(typeof m=="boolean")return!m;for(const $ in m)if(p[$])return!0;return!1}H.schemaHasRules=o;function l(m,p){if(typeof m=="boolean")return!m;for(const $ in m)if($!=="$ref"&&p.all[$])return!0;return!1}H.schemaHasRulesButRef=l;function c({topSchemaRef:m,schemaPath:p},$,k,C){if(!C){if(typeof $=="number"||typeof $=="boolean")return $;if(typeof $=="string")return(0,e._)`${$}`}return(0,e._)`${m}${p}${(0,e.getProperty)(k)}`}H.schemaRefOrVal=c;function d(m){return S(decodeURIComponent(m))}H.unescapeFragment=d;function _(m){return encodeURIComponent(h(m))}H.escapeFragment=_;function h(m){return typeof m=="number"?`${m}`:m.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=h;function S(m){return m.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=S;function R(m,p){if(Array.isArray(m))for(const $ of m)p($);else p(m)}H.eachItem=R;function E({mergeNames:m,mergeToName:p,mergeValues:$,resultToName:k}){return(C,D,z,K)=>{const F=z===void 0?D:z instanceof e.Name?(D instanceof e.Name?m(C,D,z):p(C,D,z),z):D instanceof e.Name?(p(C,z,D),D):$(D,z);return K===e.Name&&!(F instanceof e.Name)?k(C,F):F}}H.mergeEvaluated={props:E({mergeNames:(m,p,$)=>m.if((0,e._)`${$} !== true && ${p} !== undefined`,()=>{m.if((0,e._)`${p} === true`,()=>m.assign($,!0),()=>m.assign($,(0,e._)`${$} || {}`).code((0,e._)`Object.assign(${$}, ${p})`))}),mergeToName:(m,p,$)=>m.if((0,e._)`${$} !== true`,()=>{p===!0?m.assign($,!0):(m.assign($,(0,e._)`${$} || {}`),y(m,$,p))}),mergeValues:(m,p)=>m===!0?!0:{...m,...p},resultToName:b}),items:E({mergeNames:(m,p,$)=>m.if((0,e._)`${$} !== true && ${p} !== undefined`,()=>m.assign($,(0,e._)`${p} === true ? true : ${$} > ${p} ? ${$} : ${p}`)),mergeToName:(m,p,$)=>m.if((0,e._)`${$} !== true`,()=>m.assign($,p===!0?!0:(0,e._)`${$} > ${p} ? ${$} : ${p}`)),mergeValues:(m,p)=>m===!0?!0:Math.max(m,p),resultToName:(m,p)=>m.var("items",p)})};function b(m,p){if(p===!0)return m.var("props",!0);const $=m.var("props",(0,e._)`{}`);return p!==void 0&&y(m,$,p),$}H.evaluatedPropsToName=b;function y(m,p,$){Object.keys($).forEach(k=>m.assign((0,e._)`${p}${(0,e.getProperty)(k)}`,!0))}H.setEvaluated=y;const n={};function r(m,p){return m.scopeValue("func",{ref:p,code:n[p.code]||(n[p.code]=new a._Code(p.code))})}H.useFunc=r;var t;(function(m){m[m.Num=0]="Num",m[m.Str=1]="Str"})(t||(H.Type=t={}));function s(m,p,$){if(m instanceof e.Name){const k=p===t.Num;return $?k?(0,e._)`"[" + ${m} + "]"`:(0,e._)`"['" + ${m} + "']"`:k?(0,e._)`"/" + ${m}`:(0,e._)`"/" + ${m}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return $?(0,e.getProperty)(m).toString():"/"+h(m)}H.getErrorPath=s;function f(m,p,$=m.opts.strictSchema){if($){if(p=`strict mode: ${p}`,$===!0)throw new Error(p);m.self.logger.warn(p)}}return H.checkStrictMode=f,H}var qe={},rr;function _e(){if(rr)return qe;rr=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=J(),a={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return qe.default=a,qe}var nr;function $t(){return nr||(nr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const a=J(),g=X(),u=_e();e.keywordError={message:({keyword:n})=>(0,a.str)`must pass "${n}" keyword validation`},e.keyword$DataError={message:({keyword:n,schemaType:r})=>r?(0,a.str)`"${n}" keyword must be ${r} ($data)`:(0,a.str)`"${n}" keyword is invalid ($data)`};function v(n,r=e.keywordError,t,s){const{it:f}=n,{gen:m,compositeRule:p,allErrors:$}=f,k=S(n,r,t);s??(p||$)?d(m,k):_(f,(0,a._)`[${k}]`)}e.reportError=v;function o(n,r=e.keywordError,t){const{it:s}=n,{gen:f,compositeRule:m,allErrors:p}=s,$=S(n,r,t);d(f,$),m||p||_(s,u.default.vErrors)}e.reportExtraError=o;function l(n,r){n.assign(u.default.errors,r),n.if((0,a._)`${u.default.vErrors} !== null`,()=>n.if(r,()=>n.assign((0,a._)`${u.default.vErrors}.length`,r),()=>n.assign(u.default.vErrors,null)))}e.resetErrorsCount=l;function c({gen:n,keyword:r,schemaValue:t,data:s,errsCount:f,it:m}){if(f===void 0)throw new Error("ajv implementation error");const p=n.name("err");n.forRange("i",f,u.default.errors,$=>{n.const(p,(0,a._)`${u.default.vErrors}[${$}]`),n.if((0,a._)`${p}.instancePath === undefined`,()=>n.assign((0,a._)`${p}.instancePath`,(0,a.strConcat)(u.default.instancePath,m.errorPath))),n.assign((0,a._)`${p}.schemaPath`,(0,a.str)`${m.errSchemaPath}/${r}`),m.opts.verbose&&(n.assign((0,a._)`${p}.schema`,t),n.assign((0,a._)`${p}.data`,s))})}e.extendErrors=c;function d(n,r){const t=n.const("err",r);n.if((0,a._)`${u.default.vErrors} === null`,()=>n.assign(u.default.vErrors,(0,a._)`[${t}]`),(0,a._)`${u.default.vErrors}.push(${t})`),n.code((0,a._)`${u.default.errors}++`)}function _(n,r){const{gen:t,validateName:s,schemaEnv:f}=n;f.$async?t.throw((0,a._)`new ${n.ValidationError}(${r})`):(t.assign((0,a._)`${s}.errors`,r),t.return(!1))}const h={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function S(n,r,t){const{createErrors:s}=n.it;return s===!1?(0,a._)`{}`:R(n,r,t)}function R(n,r,t={}){const{gen:s,it:f}=n,m=[E(f,t),b(n,t)];return y(n,r,m),s.object(...m)}function E({errorPath:n},{instancePath:r}){const t=r?(0,a.str)`${n}${(0,g.getErrorPath)(r,g.Type.Str)}`:n;return[u.default.instancePath,(0,a.strConcat)(u.default.instancePath,t)]}function b({keyword:n,it:{errSchemaPath:r}},{schemaPath:t,parentSchema:s}){let f=s?r:(0,a.str)`${r}/${n}`;return t&&(f=(0,a.str)`${f}${(0,g.getErrorPath)(t,g.Type.Str)}`),[h.schemaPath,f]}function y(n,{params:r,message:t},s){const{keyword:f,data:m,schemaValue:p,it:$}=n,{opts:k,propertyName:C,topSchemaRef:D,schemaPath:z}=$;s.push([h.keyword,f],[h.params,typeof r=="function"?r(n):r||(0,a._)`{}`]),k.messages&&s.push([h.message,typeof t=="function"?t(n):t]),k.verbose&&s.push([h.schema,p],[h.parentSchema,(0,a._)`${D}${z}`],[u.default.data,m]),C&&s.push([h.propertyName,C])}}(jt)),jt}var sr;function Mn(){if(sr)return ge;sr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.boolOrEmptySchema=ge.topBoolOrEmptySchema=void 0;const e=$t(),a=J(),g=_e(),u={message:"boolean schema is false"};function v(c){const{gen:d,schema:_,validateName:h}=c;_===!1?l(c,!1):typeof _=="object"&&_.$async===!0?d.return(g.default.data):(d.assign((0,a._)`${h}.errors`,null),d.return(!0))}ge.topBoolOrEmptySchema=v;function o(c,d){const{gen:_,schema:h}=c;h===!1?(_.var(d,!1),l(c)):_.var(d,!0)}ge.boolOrEmptySchema=o;function l(c,d){const{gen:_,data:h}=c,S={gen:_,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(S,u,void 0,d)}return ge}var re={},$e={},ar;function mn(){if(ar)return $e;ar=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.getRules=$e.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],a=new Set(e);function g(v){return typeof v=="string"&&a.has(v)}$e.isJSONType=g;function u(){const v={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...v,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},v.number,v.string,v.array,v.object],post:{rules:[]},all:{},keywords:{}}}return $e.getRules=u,$e}var pe={},or;function yn(){if(or)return pe;or=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.shouldUseRule=pe.shouldUseGroup=pe.schemaHasRulesForType=void 0;function e({schema:u,self:v},o){const l=v.RULES.types[o];return l&&l!==!0&&a(u,l)}pe.schemaHasRulesForType=e;function a(u,v){return v.rules.some(o=>g(u,o))}pe.shouldUseGroup=a;function g(u,v){var o;return u[v.keyword]!==void 0||((o=v.definition.implements)===null||o===void 0?void 0:o.some(l=>u[l]!==void 0))}return pe.shouldUseRule=g,pe}var ir;function gt(){if(ir)return re;ir=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=mn(),a=yn(),g=$t(),u=J(),v=X();var o;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(o||(re.DataType=o={}));function l(t){const s=c(t.type);if(s.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!s.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&s.push("null")}return s}re.getSchemaTypes=l;function c(t){const s=Array.isArray(t)?t:t?[t]:[];if(s.every(e.isJSONType))return s;throw new Error("type must be JSONType or JSONType[]: "+s.join(","))}re.getJSONTypes=c;function d(t,s){const{gen:f,data:m,opts:p}=t,$=h(s,p.coerceTypes),k=s.length>0&&!($.length===0&&s.length===1&&(0,a.schemaHasRulesForType)(t,s[0]));if(k){const C=b(s,m,p.strictNumbers,o.Wrong);f.if(C,()=>{$.length?S(t,s,$):n(t)})}return k}re.coerceAndCheckDataType=d;const _=new Set(["string","number","integer","boolean","null"]);function h(t,s){return s?t.filter(f=>_.has(f)||s==="array"&&f==="array"):[]}function S(t,s,f){const{gen:m,data:p,opts:$}=t,k=m.let("dataType",(0,u._)`typeof ${p}`),C=m.let("coerced",(0,u._)`undefined`);$.coerceTypes==="array"&&m.if((0,u._)`${k} == 'object' && Array.isArray(${p}) && ${p}.length == 1`,()=>m.assign(p,(0,u._)`${p}[0]`).assign(k,(0,u._)`typeof ${p}`).if(b(s,p,$.strictNumbers),()=>m.assign(C,p))),m.if((0,u._)`${C} !== undefined`);for(const z of f)(_.has(z)||z==="array"&&$.coerceTypes==="array")&&D(z);m.else(),n(t),m.endIf(),m.if((0,u._)`${C} !== undefined`,()=>{m.assign(p,C),R(t,C)});function D(z){switch(z){case"string":m.elseIf((0,u._)`${k} == "number" || ${k} == "boolean"`).assign(C,(0,u._)`"" + ${p}`).elseIf((0,u._)`${p} === null`).assign(C,(0,u._)`""`);return;case"number":m.elseIf((0,u._)`${k} == "boolean" || ${p} === null
|
|
3
|
+
|| (${k} == "string" && ${p} && ${p} == +${p})`).assign(C,(0,u._)`+${p}`);return;case"integer":m.elseIf((0,u._)`${k} === "boolean" || ${p} === null
|
|
4
|
+
|| (${k} === "string" && ${p} && ${p} == +${p} && !(${p} % 1))`).assign(C,(0,u._)`+${p}`);return;case"boolean":m.elseIf((0,u._)`${p} === "false" || ${p} === 0 || ${p} === null`).assign(C,!1).elseIf((0,u._)`${p} === "true" || ${p} === 1`).assign(C,!0);return;case"null":m.elseIf((0,u._)`${p} === "" || ${p} === 0 || ${p} === false`),m.assign(C,null);return;case"array":m.elseIf((0,u._)`${k} === "string" || ${k} === "number"
|
|
5
|
+
|| ${k} === "boolean" || ${p} === null`).assign(C,(0,u._)`[${p}]`)}}}function R({gen:t,parentData:s,parentDataProperty:f},m){t.if((0,u._)`${s} !== undefined`,()=>t.assign((0,u._)`${s}[${f}]`,m))}function E(t,s,f,m=o.Correct){const p=m===o.Correct?u.operators.EQ:u.operators.NEQ;let $;switch(t){case"null":return(0,u._)`${s} ${p} null`;case"array":$=(0,u._)`Array.isArray(${s})`;break;case"object":$=(0,u._)`${s} && typeof ${s} == "object" && !Array.isArray(${s})`;break;case"integer":$=k((0,u._)`!(${s} % 1) && !isNaN(${s})`);break;case"number":$=k();break;default:return(0,u._)`typeof ${s} ${p} ${t}`}return m===o.Correct?$:(0,u.not)($);function k(C=u.nil){return(0,u.and)((0,u._)`typeof ${s} == "number"`,C,f?(0,u._)`isFinite(${s})`:u.nil)}}re.checkDataType=E;function b(t,s,f,m){if(t.length===1)return E(t[0],s,f,m);let p;const $=(0,v.toHash)(t);if($.array&&$.object){const k=(0,u._)`typeof ${s} != "object"`;p=$.null?k:(0,u._)`!${s} || ${k}`,delete $.null,delete $.array,delete $.object}else p=u.nil;$.number&&delete $.integer;for(const k in $)p=(0,u.and)(p,E(k,s,f,m));return p}re.checkDataTypes=b;const y={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:s})=>typeof t=="string"?(0,u._)`{type: ${t}}`:(0,u._)`{type: ${s}}`};function n(t){const s=r(t);(0,g.reportError)(s,y)}re.reportTypeError=n;function r(t){const{gen:s,data:f,schema:m}=t,p=(0,v.schemaRefOrVal)(t,m,"type");return{gen:s,keyword:"type",data:f,schema:m.type,schemaCode:p,schemaValue:p,parentSchema:m,params:{},it:t}}return re}var Oe={},cr;function Dn(){if(cr)return Oe;cr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.assignDefaults=void 0;const e=J(),a=X();function g(v,o){const{properties:l,items:c}=v.schema;if(o==="object"&&l)for(const d in l)u(v,d,l[d].default);else o==="array"&&Array.isArray(c)&&c.forEach((d,_)=>u(v,_,d.default))}Oe.assignDefaults=g;function u(v,o,l){const{gen:c,compositeRule:d,data:_,opts:h}=v;if(l===void 0)return;const S=(0,e._)`${_}${(0,e.getProperty)(o)}`;if(d){(0,a.checkStrictMode)(v,`default is ignored for: ${S}`);return}let R=(0,e._)`${S} === undefined`;h.useDefaults==="empty"&&(R=(0,e._)`${R} || ${S} === null || ${S} === ""`),c.if(R,(0,e._)`${S} = ${(0,e.stringify)(l)}`)}return Oe}var ue={},Y={},ur;function le(){if(ur)return Y;ur=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.validateUnion=Y.validateArray=Y.usePattern=Y.callValidateCode=Y.schemaProperties=Y.allSchemaProperties=Y.noPropertyInData=Y.propertyInData=Y.isOwnProperty=Y.hasPropFunc=Y.reportMissingProp=Y.checkMissingProp=Y.checkReportMissingProp=void 0;const e=J(),a=X(),g=_e(),u=X();function v(t,s){const{gen:f,data:m,it:p}=t;f.if(h(f,m,s,p.opts.ownProperties),()=>{t.setParams({missingProperty:(0,e._)`${s}`},!0),t.error()})}Y.checkReportMissingProp=v;function o({gen:t,data:s,it:{opts:f}},m,p){return(0,e.or)(...m.map($=>(0,e.and)(h(t,s,$,f.ownProperties),(0,e._)`${p} = ${$}`)))}Y.checkMissingProp=o;function l(t,s){t.setParams({missingProperty:s},!0),t.error()}Y.reportMissingProp=l;function c(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Y.hasPropFunc=c;function d(t,s,f){return(0,e._)`${c(t)}.call(${s}, ${f})`}Y.isOwnProperty=d;function _(t,s,f,m){const p=(0,e._)`${s}${(0,e.getProperty)(f)} !== undefined`;return m?(0,e._)`${p} && ${d(t,s,f)}`:p}Y.propertyInData=_;function h(t,s,f,m){const p=(0,e._)`${s}${(0,e.getProperty)(f)} === undefined`;return m?(0,e.or)(p,(0,e.not)(d(t,s,f))):p}Y.noPropertyInData=h;function S(t){return t?Object.keys(t).filter(s=>s!=="__proto__"):[]}Y.allSchemaProperties=S;function R(t,s){return S(s).filter(f=>!(0,a.alwaysValidSchema)(t,s[f]))}Y.schemaProperties=R;function E({schemaCode:t,data:s,it:{gen:f,topSchemaRef:m,schemaPath:p,errorPath:$},it:k},C,D,z){const K=z?(0,e._)`${t}, ${s}, ${m}${p}`:s,F=[[g.default.instancePath,(0,e.strConcat)(g.default.instancePath,$)],[g.default.parentData,k.parentData],[g.default.parentDataProperty,k.parentDataProperty],[g.default.rootData,g.default.rootData]];k.opts.dynamicRef&&F.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);const B=(0,e._)`${K}, ${f.object(...F)}`;return D!==e.nil?(0,e._)`${C}.call(${D}, ${B})`:(0,e._)`${C}(${B})`}Y.callValidateCode=E;const b=(0,e._)`new RegExp`;function y({gen:t,it:{opts:s}},f){const m=s.unicodeRegExp?"u":"",{regExp:p}=s.code,$=p(f,m);return t.scopeValue("pattern",{key:$.toString(),ref:$,code:(0,e._)`${p.code==="new RegExp"?b:(0,u.useFunc)(t,p)}(${f}, ${m})`})}Y.usePattern=y;function n(t){const{gen:s,data:f,keyword:m,it:p}=t,$=s.name("valid");if(p.allErrors){const C=s.let("valid",!0);return k(()=>s.assign(C,!1)),C}return s.var($,!0),k(()=>s.break()),$;function k(C){const D=s.const("len",(0,e._)`${f}.length`);s.forRange("i",0,D,z=>{t.subschema({keyword:m,dataProp:z,dataPropType:a.Type.Num},$),s.if((0,e.not)($),C)})}}Y.validateArray=n;function r(t){const{gen:s,schema:f,keyword:m,it:p}=t;if(!Array.isArray(f))throw new Error("ajv implementation error");if(f.some(D=>(0,a.alwaysValidSchema)(p,D))&&!p.opts.unevaluated)return;const k=s.let("valid",!1),C=s.name("_valid");s.block(()=>f.forEach((D,z)=>{const K=t.subschema({keyword:m,schemaProp:z,compositeRule:!0},C);s.assign(k,(0,e._)`${k} || ${C}`),t.mergeValidEvaluated(K,C)||s.if((0,e.not)(k))})),t.result(k,()=>t.reset(),()=>t.error(!0))}return Y.validateUnion=r,Y}var lr;function Vn(){if(lr)return ue;lr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.validateKeywordUsage=ue.validSchemaType=ue.funcKeywordCode=ue.macroKeywordCode=void 0;const e=J(),a=_e(),g=le(),u=$t();function v(R,E){const{gen:b,keyword:y,schema:n,parentSchema:r,it:t}=R,s=E.macro.call(t.self,n,r,t),f=_(b,y,s);t.opts.validateSchema!==!1&&t.self.validateSchema(s,!0);const m=b.name("valid");R.subschema({schema:s,schemaPath:e.nil,errSchemaPath:`${t.errSchemaPath}/${y}`,topSchemaRef:f,compositeRule:!0},m),R.pass(m,()=>R.error(!0))}ue.macroKeywordCode=v;function o(R,E){var b;const{gen:y,keyword:n,schema:r,parentSchema:t,$data:s,it:f}=R;d(f,E);const m=!s&&E.compile?E.compile.call(f.self,r,t,f):E.validate,p=_(y,n,m),$=y.let("valid");R.block$data($,k),R.ok((b=E.valid)!==null&&b!==void 0?b:$);function k(){if(E.errors===!1)z(),E.modifying&&l(R),K(()=>R.error());else{const F=E.async?C():D();E.modifying&&l(R),K(()=>c(R,F))}}function C(){const F=y.let("ruleErrs",null);return y.try(()=>z((0,e._)`await `),B=>y.assign($,!1).if((0,e._)`${B} instanceof ${f.ValidationError}`,()=>y.assign(F,(0,e._)`${B}.errors`),()=>y.throw(B))),F}function D(){const F=(0,e._)`${p}.errors`;return y.assign(F,null),z(e.nil),F}function z(F=E.async?(0,e._)`await `:e.nil){const B=f.opts.passContext?a.default.this:a.default.self,x=!("compile"in E&&!s||E.schema===!1);y.assign($,(0,e._)`${F}${(0,g.callValidateCode)(R,p,B,x)}`,E.modifying)}function K(F){var B;y.if((0,e.not)((B=E.valid)!==null&&B!==void 0?B:$),F)}}ue.funcKeywordCode=o;function l(R){const{gen:E,data:b,it:y}=R;E.if(y.parentData,()=>E.assign(b,(0,e._)`${y.parentData}[${y.parentDataProperty}]`))}function c(R,E){const{gen:b}=R;b.if((0,e._)`Array.isArray(${E})`,()=>{b.assign(a.default.vErrors,(0,e._)`${a.default.vErrors} === null ? ${E} : ${a.default.vErrors}.concat(${E})`).assign(a.default.errors,(0,e._)`${a.default.vErrors}.length`),(0,u.extendErrors)(R)},()=>R.error())}function d({schemaEnv:R},E){if(E.async&&!R.$async)throw new Error("async keyword in sync schema")}function _(R,E,b){if(b===void 0)throw new Error(`keyword "${E}" failed to compile`);return R.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function h(R,E,b=!1){return!E.length||E.some(y=>y==="array"?Array.isArray(R):y==="object"?R&&typeof R=="object"&&!Array.isArray(R):typeof R==y||b&&typeof R>"u")}ue.validSchemaType=h;function S({schema:R,opts:E,self:b,errSchemaPath:y},n,r){if(Array.isArray(n.keyword)?!n.keyword.includes(r):n.keyword!==r)throw new Error("ajv implementation error");const t=n.dependencies;if(t?.some(s=>!Object.prototype.hasOwnProperty.call(R,s)))throw new Error(`parent schema must have dependencies of ${r}: ${t.join(",")}`);if(n.validateSchema&&!n.validateSchema(R[r])){const f=`keyword "${r}" value is invalid at path "${y}": `+b.errorsText(n.validateSchema.errors);if(E.validateSchema==="log")b.logger.error(f);else throw new Error(f)}}return ue.validateKeywordUsage=S,ue}var me={},dr;function zn(){if(dr)return me;dr=1,Object.defineProperty(me,"__esModule",{value:!0}),me.extendSubschemaMode=me.extendSubschemaData=me.getSubschema=void 0;const e=J(),a=X();function g(o,{keyword:l,schemaProp:c,schema:d,schemaPath:_,errSchemaPath:h,topSchemaRef:S}){if(l!==void 0&&d!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const R=o.schema[l];return c===void 0?{schema:R,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${o.errSchemaPath}/${l}`}:{schema:R[c],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(c)}`,errSchemaPath:`${o.errSchemaPath}/${l}/${(0,a.escapeFragment)(c)}`}}if(d!==void 0){if(_===void 0||h===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:_,topSchemaRef:S,errSchemaPath:h}}throw new Error('either "keyword" or "schema" must be passed')}me.getSubschema=g;function u(o,l,{dataProp:c,dataPropType:d,data:_,dataTypes:h,propertyName:S}){if(_!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:R}=l;if(c!==void 0){const{errorPath:b,dataPathArr:y,opts:n}=l,r=R.let("data",(0,e._)`${l.data}${(0,e.getProperty)(c)}`,!0);E(r),o.errorPath=(0,e.str)`${b}${(0,a.getErrorPath)(c,d,n.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${c}`,o.dataPathArr=[...y,o.parentDataProperty]}if(_!==void 0){const b=_ instanceof e.Name?_:R.let("data",_,!0);E(b),S!==void 0&&(o.propertyName=S)}h&&(o.dataTypes=h);function E(b){o.data=b,o.dataLevel=l.dataLevel+1,o.dataTypes=[],l.definedProperties=new Set,o.parentData=l.data,o.dataNames=[...l.dataNames,b]}}me.extendSubschemaData=u;function v(o,{jtdDiscriminator:l,jtdMetadata:c,compositeRule:d,createErrors:_,allErrors:h}){d!==void 0&&(o.compositeRule=d),_!==void 0&&(o.createErrors=_),h!==void 0&&(o.allErrors=h),o.jtdDiscriminator=l,o.jtdMetadata=c}return me.extendSubschemaMode=v,me}var ne={},qt,fr;function vn(){return fr||(fr=1,qt=function e(a,g){if(a===g)return!0;if(a&&g&&typeof a=="object"&&typeof g=="object"){if(a.constructor!==g.constructor)return!1;var u,v,o;if(Array.isArray(a)){if(u=a.length,u!=g.length)return!1;for(v=u;v--!==0;)if(!e(a[v],g[v]))return!1;return!0}if(a.constructor===RegExp)return a.source===g.source&&a.flags===g.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===g.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===g.toString();if(o=Object.keys(a),u=o.length,u!==Object.keys(g).length)return!1;for(v=u;v--!==0;)if(!Object.prototype.hasOwnProperty.call(g,o[v]))return!1;for(v=u;v--!==0;){var l=o[v];if(!e(a[l],g[l]))return!1}return!0}return a!==a&&g!==g}),qt}var Ct={exports:{}},hr;function Un(){if(hr)return Ct.exports;hr=1;var e=Ct.exports=function(u,v,o){typeof v=="function"&&(o=v,v={}),o=v.cb||o;var l=typeof o=="function"?o:o.pre||function(){},c=o.post||function(){};a(v,l,c,u,"",u)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function a(u,v,o,l,c,d,_,h,S,R){if(l&&typeof l=="object"&&!Array.isArray(l)){v(l,c,d,_,h,S,R);for(var E in l){var b=l[E];if(Array.isArray(b)){if(E in e.arrayKeywords)for(var y=0;y<b.length;y++)a(u,v,o,b[y],c+"/"+E+"/"+y,d,c,E,l,y)}else if(E in e.propsKeywords){if(b&&typeof b=="object")for(var n in b)a(u,v,o,b[n],c+"/"+E+"/"+g(n),d,c,E,l,n)}else(E in e.keywords||u.allKeys&&!(E in e.skipKeywords))&&a(u,v,o,b,c+"/"+E,d,c,E,l)}o(l,c,d,_,h,S,R)}}function g(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}return Ct.exports}var pr;function wt(){if(pr)return ne;pr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=X(),a=vn(),g=Un(),u=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function v(y,n=!0){return typeof y=="boolean"?!0:n===!0?!l(y):n?c(y)<=n:!1}ne.inlineRef=v;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(y){for(const n in y){if(o.has(n))return!0;const r=y[n];if(Array.isArray(r)&&r.some(l)||typeof r=="object"&&l(r))return!0}return!1}function c(y){let n=0;for(const r in y){if(r==="$ref")return 1/0;if(n++,!u.has(r)&&(typeof y[r]=="object"&&(0,e.eachItem)(y[r],t=>n+=c(t)),n===1/0))return 1/0}return n}function d(y,n="",r){r!==!1&&(n=S(n));const t=y.parse(n);return _(y,t)}ne.getFullPath=d;function _(y,n){return y.serialize(n).split("#")[0]+"#"}ne._getFullPath=_;const h=/#\/?$/;function S(y){return y?y.replace(h,""):""}ne.normalizeId=S;function R(y,n,r){return r=S(r),y.resolve(n,r)}ne.resolveUrl=R;const E=/^[a-z_][-a-z0-9._]*$/i;function b(y,n){if(typeof y=="boolean")return{};const{schemaId:r,uriResolver:t}=this.opts,s=S(y[r]||n),f={"":s},m=d(t,s,!1),p={},$=new Set;return g(y,{allKeys:!0},(D,z,K,F)=>{if(F===void 0)return;const B=m+z;let x=f[F];typeof D[r]=="string"&&(x=de.call(this,D[r])),fe.call(this,D.$anchor),fe.call(this,D.$dynamicAnchor),f[z]=x;function de(Z){const ye=this.opts.uriResolver.resolve;if(Z=S(x?ye(x,Z):Z),$.has(Z))throw C(Z);$.add(Z);let A=this.refs[Z];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(D,A.schema,Z):Z!==S(B)&&(Z[0]==="#"?(k(D,p[Z],Z),p[Z]=D):this.refs[Z]=B),Z}function fe(Z){if(typeof Z=="string"){if(!E.test(Z))throw new Error(`invalid anchor "${Z}"`);de.call(this,`#${Z}`)}}}),p;function k(D,z,K){if(z!==void 0&&!a(D,z))throw C(K)}function C(D){return new Error(`reference "${D}" resolves to more than one schema`)}}return ne.getSchemaRefs=b,ne}var mr;function bt(){if(mr)return he;mr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Mn(),a=gt(),g=yn(),u=gt(),v=Dn(),o=Vn(),l=zn(),c=J(),d=_e(),_=wt(),h=X(),S=$t();function R(P){if(m(P)&&($(P),f(P))){n(P);return}E(P,()=>(0,e.topBoolOrEmptySchema)(P))}he.validateFunctionCode=R;function E({gen:P,validateName:O,schema:T,schemaEnv:M,opts:U},G){U.code.es5?P.func(O,(0,c._)`${d.default.data}, ${d.default.valCxt}`,M.$async,()=>{P.code((0,c._)`"use strict"; ${t(T,U)}`),y(P,U),P.code(G)}):P.func(O,(0,c._)`${d.default.data}, ${b(U)}`,M.$async,()=>P.code(t(T,U)).code(G))}function b(P){return(0,c._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${P.dynamicRef?(0,c._)`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}function y(P,O){P.if(d.default.valCxt,()=>{P.var(d.default.instancePath,(0,c._)`${d.default.valCxt}.${d.default.instancePath}`),P.var(d.default.parentData,(0,c._)`${d.default.valCxt}.${d.default.parentData}`),P.var(d.default.parentDataProperty,(0,c._)`${d.default.valCxt}.${d.default.parentDataProperty}`),P.var(d.default.rootData,(0,c._)`${d.default.valCxt}.${d.default.rootData}`),O.dynamicRef&&P.var(d.default.dynamicAnchors,(0,c._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{P.var(d.default.instancePath,(0,c._)`""`),P.var(d.default.parentData,(0,c._)`undefined`),P.var(d.default.parentDataProperty,(0,c._)`undefined`),P.var(d.default.rootData,d.default.data),O.dynamicRef&&P.var(d.default.dynamicAnchors,(0,c._)`{}`)})}function n(P){const{schema:O,opts:T,gen:M}=P;E(P,()=>{T.$comment&&O.$comment&&F(P),D(P),M.let(d.default.vErrors,null),M.let(d.default.errors,0),T.unevaluated&&r(P),k(P),B(P)})}function r(P){const{gen:O,validateName:T}=P;P.evaluated=O.const("evaluated",(0,c._)`${T}.evaluated`),O.if((0,c._)`${P.evaluated}.dynamicProps`,()=>O.assign((0,c._)`${P.evaluated}.props`,(0,c._)`undefined`)),O.if((0,c._)`${P.evaluated}.dynamicItems`,()=>O.assign((0,c._)`${P.evaluated}.items`,(0,c._)`undefined`))}function t(P,O){const T=typeof P=="object"&&P[O.schemaId];return T&&(O.code.source||O.code.process)?(0,c._)`/*# sourceURL=${T} */`:c.nil}function s(P,O){if(m(P)&&($(P),f(P))){p(P,O);return}(0,e.boolOrEmptySchema)(P,O)}function f({schema:P,self:O}){if(typeof P=="boolean")return!P;for(const T in P)if(O.RULES.all[T])return!0;return!1}function m(P){return typeof P.schema!="boolean"}function p(P,O){const{schema:T,gen:M,opts:U}=P;U.$comment&&T.$comment&&F(P),z(P),K(P);const G=M.const("_errs",d.default.errors);k(P,G),M.var(O,(0,c._)`${G} === ${d.default.errors}`)}function $(P){(0,h.checkUnknownRules)(P),C(P)}function k(P,O){if(P.opts.jtd)return de(P,[],!1,O);const T=(0,a.getSchemaTypes)(P.schema),M=(0,a.coerceAndCheckDataType)(P,T);de(P,T,!M,O)}function C(P){const{schema:O,errSchemaPath:T,opts:M,self:U}=P;O.$ref&&M.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(O,U.RULES)&&U.logger.warn(`$ref: keywords ignored in schema at path "${T}"`)}function D(P){const{schema:O,opts:T}=P;O.default!==void 0&&T.useDefaults&&T.strictSchema&&(0,h.checkStrictMode)(P,"default is ignored in the schema root")}function z(P){const O=P.schema[P.opts.schemaId];O&&(P.baseId=(0,_.resolveUrl)(P.opts.uriResolver,P.baseId,O))}function K(P){if(P.schema.$async&&!P.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:P,schemaEnv:O,schema:T,errSchemaPath:M,opts:U}){const G=T.$comment;if(U.$comment===!0)P.code((0,c._)`${d.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){const ee=(0,c.str)`${M}/$comment`,ce=P.scopeValue("root",{ref:O.root});P.code((0,c._)`${d.default.self}.opts.$comment(${G}, ${ee}, ${ce}.schema)`)}}function B(P){const{gen:O,schemaEnv:T,validateName:M,ValidationError:U,opts:G}=P;T.$async?O.if((0,c._)`${d.default.errors} === 0`,()=>O.return(d.default.data),()=>O.throw((0,c._)`new ${U}(${d.default.vErrors})`)):(O.assign((0,c._)`${M}.errors`,d.default.vErrors),G.unevaluated&&x(P),O.return((0,c._)`${d.default.errors} === 0`))}function x({gen:P,evaluated:O,props:T,items:M}){T instanceof c.Name&&P.assign((0,c._)`${O}.props`,T),M instanceof c.Name&&P.assign((0,c._)`${O}.items`,M)}function de(P,O,T,M){const{gen:U,schema:G,data:ee,allErrors:ce,opts:se,self:ae}=P,{RULES:te}=ae;if(G.$ref&&(se.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(G,te))){U.block(()=>V(P,"$ref",te.all.$ref.definition));return}se.jtd||Z(P,O),U.block(()=>{for(const ie of te.rules)Ee(ie);Ee(te.post)});function Ee(ie){(0,g.shouldUseGroup)(G,ie)&&(ie.type?(U.if((0,u.checkDataType)(ie.type,ee,se.strictNumbers)),fe(P,ie),O.length===1&&O[0]===ie.type&&T&&(U.else(),(0,u.reportTypeError)(P)),U.endIf()):fe(P,ie),ce||U.if((0,c._)`${d.default.errors} === ${M||0}`))}}function fe(P,O){const{gen:T,schema:M,opts:{useDefaults:U}}=P;U&&(0,v.assignDefaults)(P,O.type),T.block(()=>{for(const G of O.rules)(0,g.shouldUseRule)(M,G)&&V(P,G.keyword,G.definition,O.type)})}function Z(P,O){P.schemaEnv.meta||!P.opts.strictTypes||(ye(P,O),P.opts.allowUnionTypes||A(P,O),N(P,P.dataTypes))}function ye(P,O){if(O.length){if(!P.dataTypes.length){P.dataTypes=O;return}O.forEach(T=>{j(P.dataTypes,T)||w(P,`type "${T}" not allowed by context "${P.dataTypes.join(",")}"`)}),i(P,O)}}function A(P,O){O.length>1&&!(O.length===2&&O.includes("null"))&&w(P,"use allowUnionTypes to allow union type keyword")}function N(P,O){const T=P.self.RULES.all;for(const M in T){const U=T[M];if(typeof U=="object"&&(0,g.shouldUseRule)(P.schema,U)){const{type:G}=U.definition;G.length&&!G.some(ee=>q(O,ee))&&w(P,`missing type "${G.join(",")}" for keyword "${M}"`)}}}function q(P,O){return P.includes(O)||O==="number"&&P.includes("integer")}function j(P,O){return P.includes(O)||O==="integer"&&P.includes("number")}function i(P,O){const T=[];for(const M of P.dataTypes)j(O,M)?T.push(M):O.includes("integer")&&M==="number"&&T.push("integer");P.dataTypes=T}function w(P,O){const T=P.schemaEnv.baseId+P.errSchemaPath;O+=` at "${T}" (strictTypes)`,(0,h.checkStrictMode)(P,O,P.opts.strictTypes)}class I{constructor(O,T,M){if((0,o.validateKeywordUsage)(O,T,M),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=M,this.data=O.data,this.schema=O.schema[M],this.$data=T.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(O,this.schema,M,this.$data),this.schemaType=T.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=T,this.$data)this.schemaCode=O.gen.const("vSchema",W(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,T.schemaType,T.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(T.schemaType)}`);("code"in T?T.trackErrors:T.errors!==!1)&&(this.errsCount=O.gen.const("_errs",d.default.errors))}result(O,T,M){this.failResult((0,c.not)(O),T,M)}failResult(O,T,M){this.gen.if(O),M?M():this.error(),T?(this.gen.else(),T(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(O,T){this.failResult((0,c.not)(O),void 0,T)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:T}=this;this.fail((0,c._)`${T} !== undefined && (${(0,c.or)(this.invalid$data(),O)})`)}error(O,T,M){if(T){this.setParams(T),this._error(O,M),this.setParams({});return}this._error(O,M)}_error(O,T){(O?S.reportExtraError:S.reportError)(this,this.def.error,T)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,T){T?Object.assign(this.params,O):this.params=O}block$data(O,T,M=c.nil){this.gen.block(()=>{this.check$data(O,M),T()})}check$data(O=c.nil,T=c.nil){if(!this.$data)return;const{gen:M,schemaCode:U,schemaType:G,def:ee}=this;M.if((0,c.or)((0,c._)`${U} === undefined`,T)),O!==c.nil&&M.assign(O,!0),(G.length||ee.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),O!==c.nil&&M.assign(O,!1)),M.else()}invalid$data(){const{gen:O,schemaCode:T,schemaType:M,def:U,it:G}=this;return(0,c.or)(ee(),ce());function ee(){if(M.length){if(!(T instanceof c.Name))throw new Error("ajv implementation error");const se=Array.isArray(M)?M:[M];return(0,c._)`${(0,u.checkDataTypes)(se,T,G.opts.strictNumbers,u.DataType.Wrong)}`}return c.nil}function ce(){if(U.validateSchema){const se=O.scopeValue("validate$data",{ref:U.validateSchema});return(0,c._)`!${se}(${T})`}return c.nil}}subschema(O,T){const M=(0,l.getSubschema)(this.it,O);(0,l.extendSubschemaData)(M,this.it,O),(0,l.extendSubschemaMode)(M,O);const U={...this.it,...M,items:void 0,props:void 0};return s(U,T),U}mergeEvaluated(O,T){const{it:M,gen:U}=this;M.opts.unevaluated&&(M.props!==!0&&O.props!==void 0&&(M.props=h.mergeEvaluated.props(U,O.props,M.props,T)),M.items!==!0&&O.items!==void 0&&(M.items=h.mergeEvaluated.items(U,O.items,M.items,T)))}mergeValidEvaluated(O,T){const{it:M,gen:U}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return U.if(T,()=>this.mergeEvaluated(O,c.Name)),!0}}he.KeywordCxt=I;function V(P,O,T,M){const U=new I(P,T,O);"code"in T?T.code(U,M):U.$data&&T.validate?(0,o.funcKeywordCode)(U,T):"macro"in T?(0,o.macroKeywordCode)(U,T):(T.compile||T.validate)&&(0,o.funcKeywordCode)(U,T)}const L=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function W(P,{dataLevel:O,dataNames:T,dataPathArr:M}){let U,G;if(P==="")return d.default.rootData;if(P[0]==="/"){if(!L.test(P))throw new Error(`Invalid JSON-pointer: ${P}`);U=P,G=d.default.rootData}else{const ae=Q.exec(P);if(!ae)throw new Error(`Invalid JSON-pointer: ${P}`);const te=+ae[1];if(U=ae[2],U==="#"){if(te>=O)throw new Error(se("property/index",te));return M[O-te]}if(te>O)throw new Error(se("data",te));if(G=T[O-te],!U)return G}let ee=G;const ce=U.split("/");for(const ae of ce)ae&&(G=(0,c._)`${G}${(0,c.getProperty)((0,h.unescapeJsonPointer)(ae))}`,ee=(0,c._)`${ee} && ${G}`);return ee;function se(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${O}`}}return he.getData=W,he}var Ce={},yr;function Ft(){if(yr)return Ce;yr=1,Object.defineProperty(Ce,"__esModule",{value:!0});class e extends Error{constructor(g){super("validation failed"),this.errors=g,this.ajv=this.validation=!0}}return Ce.default=e,Ce}var Ae={},vr;function Et(){if(vr)return Ae;vr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=wt();class a extends Error{constructor(u,v,o,l){super(l||`can't resolve reference ${o} from id ${v}`),this.missingRef=(0,e.resolveUrl)(u,v,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(u,this.missingRef))}}return Ae.default=a,Ae}var oe={},_r;function Kt(){if(_r)return oe;_r=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.resolveSchema=oe.getCompilingSchema=oe.resolveRef=oe.compileSchema=oe.SchemaEnv=void 0;const e=J(),a=Ft(),g=_e(),u=wt(),v=X(),o=bt();class l{constructor(r){var t;this.refs={},this.dynamicAnchors={};let s;typeof r.schema=="object"&&(s=r.schema),this.schema=r.schema,this.schemaId=r.schemaId,this.root=r.root||this,this.baseId=(t=r.baseId)!==null&&t!==void 0?t:(0,u.normalizeId)(s?.[r.schemaId||"$id"]),this.schemaPath=r.schemaPath,this.localRefs=r.localRefs,this.meta=r.meta,this.$async=s?.$async,this.refs={}}}oe.SchemaEnv=l;function c(n){const r=h.call(this,n);if(r)return r;const t=(0,u.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:s,lines:f}=this.opts.code,{ownProperties:m}=this.opts,p=new e.CodeGen(this.scope,{es5:s,lines:f,ownProperties:m});let $;n.$async&&($=p.scopeValue("Error",{ref:a.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const k=p.scopeName("validate");n.validateName=k;const C={gen:p,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,e.stringify)(n.schema)}:{ref:n.schema}),validateName:k,ValidationError:$,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:e.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let D;try{this._compilations.add(n),(0,o.validateFunctionCode)(C),p.optimize(this.opts.code.optimize);const z=p.toString();D=`${p.scopeRefs(g.default.scope)}return ${z}`,this.opts.code.process&&(D=this.opts.code.process(D,n));const F=new Function(`${g.default.self}`,`${g.default.scope}`,D)(this,this.scope.get());if(this.scope.value(k,{ref:F}),F.errors=null,F.schema=n.schema,F.schemaEnv=n,n.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:k,validateCode:z,scopeValues:p._values}),this.opts.unevaluated){const{props:B,items:x}=C;F.evaluated={props:B instanceof e.Name?void 0:B,items:x instanceof e.Name?void 0:x,dynamicProps:B instanceof e.Name,dynamicItems:x instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return n.validate=F,n}catch(z){throw delete n.validate,delete n.validateName,D&&this.logger.error("Error compiling schema, function code:",D),z}finally{this._compilations.delete(n)}}oe.compileSchema=c;function d(n,r,t){var s;t=(0,u.resolveUrl)(this.opts.uriResolver,r,t);const f=n.refs[t];if(f)return f;let m=R.call(this,n,t);if(m===void 0){const p=(s=n.localRefs)===null||s===void 0?void 0:s[t],{schemaId:$}=this.opts;p&&(m=new l({schema:p,schemaId:$,root:n,baseId:r}))}if(m!==void 0)return n.refs[t]=_.call(this,m)}oe.resolveRef=d;function _(n){return(0,u.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:c.call(this,n)}function h(n){for(const r of this._compilations)if(S(r,n))return r}oe.getCompilingSchema=h;function S(n,r){return n.schema===r.schema&&n.root===r.root&&n.baseId===r.baseId}function R(n,r){let t;for(;typeof(t=this.refs[r])=="string";)r=t;return t||this.schemas[r]||E.call(this,n,r)}function E(n,r){const t=this.opts.uriResolver.parse(r),s=(0,u._getFullPath)(this.opts.uriResolver,t);let f=(0,u.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&s===f)return y.call(this,t,n);const m=(0,u.normalizeId)(s),p=this.refs[m]||this.schemas[m];if(typeof p=="string"){const $=E.call(this,n,p);return typeof $?.schema!="object"?void 0:y.call(this,t,$)}if(typeof p?.schema=="object"){if(p.validate||c.call(this,p),m===(0,u.normalizeId)(r)){const{schema:$}=p,{schemaId:k}=this.opts,C=$[k];return C&&(f=(0,u.resolveUrl)(this.opts.uriResolver,f,C)),new l({schema:$,schemaId:k,root:n,baseId:f})}return y.call(this,t,p)}}oe.resolveSchema=E;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(n,{baseId:r,schema:t,root:s}){var f;if(((f=n.fragment)===null||f===void 0?void 0:f[0])!=="/")return;for(const $ of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const k=t[(0,v.unescapeFragment)($)];if(k===void 0)return;t=k;const C=typeof t=="object"&&t[this.opts.schemaId];!b.has($)&&C&&(r=(0,u.resolveUrl)(this.opts.uriResolver,r,C))}let m;if(typeof t!="boolean"&&t.$ref&&!(0,v.schemaHasRulesButRef)(t,this.RULES)){const $=(0,u.resolveUrl)(this.opts.uriResolver,r,t.$ref);m=E.call(this,s,$)}const{schemaId:p}=this.opts;if(m=m||new l({schema:t,schemaId:p,root:s,baseId:r}),m.schema!==m.root.schema)return m}return oe}const Ln="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Fn="Meta-schema for $data reference (JSON AnySchema extension proposal)",Kn="object",Hn=["$data"],Gn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Jn=!1,Wn={$id:Ln,description:Fn,type:Kn,required:Hn,properties:Gn,additionalProperties:Jn};var Me={},je={exports:{}},At,gr;function Bn(){return gr||(gr=1,At={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),At}var Mt,$r;function Xn(){if($r)return Mt;$r=1;const{HEX:e}=Bn(),a=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function g(y){if(c(y,".")<3)return{host:y,isIPV4:!1};const n=y.match(a)||[],[r]=n;return r?{host:l(r,"."),isIPV4:!0}:{host:y,isIPV4:!1}}function u(y,n=!1){let r="",t=!0;for(const s of y){if(e[s]===void 0)return;s!=="0"&&t===!0&&(t=!1),t||(r+=s)}return n&&r.length===0&&(r="0"),r}function v(y){let n=0;const r={error:!1,address:"",zone:""},t=[],s=[];let f=!1,m=!1,p=!1;function $(){if(s.length){if(f===!1){const k=u(s);if(k!==void 0)t.push(k);else return r.error=!0,!1}s.length=0}return!0}for(let k=0;k<y.length;k++){const C=y[k];if(!(C==="["||C==="]"))if(C===":"){if(m===!0&&(p=!0),!$())break;if(n++,t.push(":"),n>7){r.error=!0;break}k-1>=0&&y[k-1]===":"&&(m=!0);continue}else if(C==="%"){if(!$())break;f=!0}else{s.push(C);continue}}return s.length&&(f?r.zone=s.join(""):p?t.push(s.join("")):t.push(u(s))),r.address=t.join(""),r}function o(y){if(c(y,":")<2)return{host:y,isIPV6:!1};const n=v(y);if(n.error)return{host:y,isIPV6:!1};{let r=n.address,t=n.address;return n.zone&&(r+="%"+n.zone,t+="%25"+n.zone),{host:r,escapedHost:t,isIPV6:!0}}}function l(y,n){let r="",t=!0;const s=y.length;for(let f=0;f<s;f++){const m=y[f];m==="0"&&t?(f+1<=s&&y[f+1]===n||f+1===s)&&(r+=m,t=!1):(m===n?t=!0:t=!1,r+=m)}return r}function c(y,n){let r=0;for(let t=0;t<y.length;t++)y[t]===n&&r++;return r}const d=/^\.\.?\//u,_=/^\/\.(?:\/|$)/u,h=/^\/\.\.(?:\/|$)/u,S=/^\/?(?:.|\n)*?(?=\/|$)/u;function R(y){const n=[];for(;y.length;)if(y.match(d))y=y.replace(d,"");else if(y.match(_))y=y.replace(_,"/");else if(y.match(h))y=y.replace(h,"/"),n.pop();else if(y==="."||y==="..")y="";else{const r=y.match(S);if(r){const t=r[0];y=y.slice(t.length),n.push(t)}else throw new Error("Unexpected dot segment condition")}return n.join("")}function E(y,n){const r=n!==!0?escape:unescape;return y.scheme!==void 0&&(y.scheme=r(y.scheme)),y.userinfo!==void 0&&(y.userinfo=r(y.userinfo)),y.host!==void 0&&(y.host=r(y.host)),y.path!==void 0&&(y.path=r(y.path)),y.query!==void 0&&(y.query=r(y.query)),y.fragment!==void 0&&(y.fragment=r(y.fragment)),y}function b(y){const n=[];if(y.userinfo!==void 0&&(n.push(y.userinfo),n.push("@")),y.host!==void 0){let r=unescape(y.host);const t=g(r);if(t.isIPV4)r=t.host;else{const s=o(t.host);s.isIPV6===!0?r=`[${s.escapedHost}]`:r=y.host}n.push(r)}return(typeof y.port=="number"||typeof y.port=="string")&&(n.push(":"),n.push(String(y.port))),n.length?n.join(""):void 0}return Mt={recomposeAuthority:b,normalizeComponentEncoding:E,removeDotSegments:R,normalizeIPv4:g,normalizeIPv6:o,stringArrayToHexStripped:u},Mt}var Dt,wr;function Qn(){if(wr)return Dt;wr=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,a=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function g(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function u(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function v(t){const s=String(t.scheme).toLowerCase()==="https";return(t.port===(s?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function o(t){return t.secure=g(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function l(t){if((t.port===(g(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[s,f]=t.resourceName.split("?");t.path=s&&s!=="/"?s:void 0,t.query=f,t.resourceName=void 0}return t.fragment=void 0,t}function c(t,s){if(!t.path)return t.error="URN can not be parsed",t;const f=t.path.match(a);if(f){const m=s.scheme||t.scheme||"urn";t.nid=f[1].toLowerCase(),t.nss=f[2];const p=`${m}:${s.nid||t.nid}`,$=r[p];t.path=void 0,$&&(t=$.parse(t,s))}else t.error=t.error||"URN can not be parsed.";return t}function d(t,s){const f=s.scheme||t.scheme||"urn",m=t.nid.toLowerCase(),p=`${f}:${s.nid||m}`,$=r[p];$&&(t=$.serialize(t,s));const k=t,C=t.nss;return k.path=`${m||s.nid}:${C}`,s.skipEscape=!0,k}function _(t,s){const f=t;return f.uuid=f.nss,f.nss=void 0,!s.tolerant&&(!f.uuid||!e.test(f.uuid))&&(f.error=f.error||"UUID is not valid."),f}function h(t){const s=t;return s.nss=(t.uuid||"").toLowerCase(),s}const S={scheme:"http",domainHost:!0,parse:u,serialize:v},R={scheme:"https",domainHost:S.domainHost,parse:u,serialize:v},E={scheme:"ws",domainHost:!0,parse:o,serialize:l},b={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},r={http:S,https:R,ws:E,wss:b,urn:{scheme:"urn",parse:c,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:_,serialize:h,skipNormalize:!0}};return Dt=r,Dt}var br;function Yn(){if(br)return je.exports;br=1;const{normalizeIPv6:e,normalizeIPv4:a,removeDotSegments:g,recomposeAuthority:u,normalizeComponentEncoding:v}=Xn(),o=Qn();function l(n,r){return typeof n=="string"?n=h(b(n,r),r):typeof n=="object"&&(n=b(h(n,r),r)),n}function c(n,r,t){const s=Object.assign({scheme:"null"},t),f=d(b(n,s),b(r,s),s,!0);return h(f,{...s,skipEscape:!0})}function d(n,r,t,s){const f={};return s||(n=b(h(n,t),t),r=b(h(r,t),t)),t=t||{},!t.tolerant&&r.scheme?(f.scheme=r.scheme,f.userinfo=r.userinfo,f.host=r.host,f.port=r.port,f.path=g(r.path||""),f.query=r.query):(r.userinfo!==void 0||r.host!==void 0||r.port!==void 0?(f.userinfo=r.userinfo,f.host=r.host,f.port=r.port,f.path=g(r.path||""),f.query=r.query):(r.path?(r.path.charAt(0)==="/"?f.path=g(r.path):((n.userinfo!==void 0||n.host!==void 0||n.port!==void 0)&&!n.path?f.path="/"+r.path:n.path?f.path=n.path.slice(0,n.path.lastIndexOf("/")+1)+r.path:f.path=r.path,f.path=g(f.path)),f.query=r.query):(f.path=n.path,r.query!==void 0?f.query=r.query:f.query=n.query),f.userinfo=n.userinfo,f.host=n.host,f.port=n.port),f.scheme=n.scheme),f.fragment=r.fragment,f}function _(n,r,t){return typeof n=="string"?(n=unescape(n),n=h(v(b(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=h(v(n,!0),{...t,skipEscape:!0})),typeof r=="string"?(r=unescape(r),r=h(v(b(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=h(v(r,!0),{...t,skipEscape:!0})),n.toLowerCase()===r.toLowerCase()}function h(n,r){const t={host:n.host,scheme:n.scheme,userinfo:n.userinfo,port:n.port,path:n.path,query:n.query,nid:n.nid,nss:n.nss,uuid:n.uuid,fragment:n.fragment,reference:n.reference,resourceName:n.resourceName,secure:n.secure,error:""},s=Object.assign({},r),f=[],m=o[(s.scheme||t.scheme||"").toLowerCase()];m&&m.serialize&&m.serialize(t,s),t.path!==void 0&&(s.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),s.reference!=="suffix"&&t.scheme&&f.push(t.scheme,":");const p=u(t);if(p!==void 0&&(s.reference!=="suffix"&&f.push("//"),f.push(p),t.path&&t.path.charAt(0)!=="/"&&f.push("/")),t.path!==void 0){let $=t.path;!s.absolutePath&&(!m||!m.absolutePath)&&($=g($)),p===void 0&&($=$.replace(/^\/\//u,"/%2F")),f.push($)}return t.query!==void 0&&f.push("?",t.query),t.fragment!==void 0&&f.push("#",t.fragment),f.join("")}const S=Array.from({length:127},(n,r)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(r)));function R(n){let r=0;for(let t=0,s=n.length;t<s;++t)if(r=n.charCodeAt(t),r>126||S[r])return!0;return!1}const E=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(n,r){const t=Object.assign({},r),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},f=n.indexOf("%")!==-1;let m=!1;t.reference==="suffix"&&(n=(t.scheme?t.scheme+":":"")+"//"+n);const p=n.match(E);if(p){if(s.scheme=p[1],s.userinfo=p[3],s.host=p[4],s.port=parseInt(p[5],10),s.path=p[6]||"",s.query=p[7],s.fragment=p[8],isNaN(s.port)&&(s.port=p[5]),s.host){const k=a(s.host);if(k.isIPV4===!1){const C=e(k.host);s.host=C.host.toLowerCase(),m=C.isIPV6}else s.host=k.host,m=!0}s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference="same-document":s.scheme===void 0?s.reference="relative":s.fragment===void 0?s.reference="absolute":s.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==s.reference&&(s.error=s.error||"URI is not a "+t.reference+" reference.");const $=o[(t.scheme||s.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!$||!$.unicodeSupport)&&s.host&&(t.domainHost||$&&$.domainHost)&&m===!1&&R(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(k){s.error=s.error||"Host's domain name can not be converted to ASCII: "+k}(!$||$&&!$.skipNormalize)&&(f&&s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),f&&s.host!==void 0&&(s.host=unescape(s.host)),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),$&&$.parse&&$.parse(s,t)}else s.error=s.error||"URI can not be parsed.";return s}const y={SCHEMES:o,normalize:l,resolve:c,resolveComponents:d,equal:_,serialize:h,parse:b};return je.exports=y,je.exports.default=y,je.exports.fastUri=y,je.exports}var Er;function Zn(){if(Er)return Me;Er=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=Yn();return e.code='require("ajv/dist/runtime/uri").default',Me.default=e,Me}var Sr;function xn(){return Sr||(Sr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var a=bt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var g=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});const u=Ft(),v=Et(),o=mn(),l=Kt(),c=J(),d=wt(),_=gt(),h=X(),S=Wn,R=Zn(),E=(A,N)=>new RegExp(A,N);E.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),n={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},r={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},t=200;function s(A){var N,q,j,i,w,I,V,L,Q,W,P,O,T,M,U,G,ee,ce,se,ae,te,Ee,ie,St,Pt;const Ne=A.strict,Rt=(N=A.code)===null||N===void 0?void 0:N.optimize,Gt=Rt===!0||Rt===void 0?1:Rt||0,Jt=(j=(q=A.code)===null||q===void 0?void 0:q.regExp)!==null&&j!==void 0?j:E,En=(i=A.uriResolver)!==null&&i!==void 0?i:R.default;return{strictSchema:(I=(w=A.strictSchema)!==null&&w!==void 0?w:Ne)!==null&&I!==void 0?I:!0,strictNumbers:(L=(V=A.strictNumbers)!==null&&V!==void 0?V:Ne)!==null&&L!==void 0?L:!0,strictTypes:(W=(Q=A.strictTypes)!==null&&Q!==void 0?Q:Ne)!==null&&W!==void 0?W:"log",strictTuples:(O=(P=A.strictTuples)!==null&&P!==void 0?P:Ne)!==null&&O!==void 0?O:"log",strictRequired:(M=(T=A.strictRequired)!==null&&T!==void 0?T:Ne)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:Gt,regExp:Jt}:{optimize:Gt,regExp:Jt},loopRequired:(U=A.loopRequired)!==null&&U!==void 0?U:t,loopEnum:(G=A.loopEnum)!==null&&G!==void 0?G:t,meta:(ee=A.meta)!==null&&ee!==void 0?ee:!0,messages:(ce=A.messages)!==null&&ce!==void 0?ce:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ae=A.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=A.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(Ee=A.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(ie=A.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(St=A.unicodeRegExp)!==null&&St!==void 0?St:!0,int32range:(Pt=A.int32range)!==null&&Pt!==void 0?Pt:!0,uriResolver:En}}class f{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...s(N)};const{es5:q,lines:j}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:q,lines:j}),this.logger=K(N.logger);const i=N.validateFormats;N.validateFormats=!1,this.RULES=(0,o.getRules)(),m.call(this,n,N,"NOT SUPPORTED"),m.call(this,r,N,"DEPRECATED","warn"),this._metaOpts=D.call(this),N.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&C.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),$.call(this),N.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:q,schemaId:j}=this.opts;let i=S;j==="id"&&(i={...S},i.id=i.$id,delete i.$id),q&&N&&this.addMetaSchema(i,i[j],!1)}defaultMeta(){const{meta:N,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[q]||N:void 0}validate(N,q){let j;if(typeof N=="string"){if(j=this.getSchema(N),!j)throw new Error(`no schema with key or ref "${N}"`)}else j=this.compile(N);const i=j(q);return"$async"in j||(this.errors=j.errors),i}compile(N,q){const j=this._addSchema(N,q);return j.validate||this._compileSchemaEnv(j)}compileAsync(N,q){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:j}=this.opts;return i.call(this,N,q);async function i(W,P){await w.call(this,W.$schema);const O=this._addSchema(W,P);return O.validate||I.call(this,O)}async function w(W){W&&!this.getSchema(W)&&await i.call(this,{$ref:W},!0)}async function I(W){try{return this._compileSchemaEnv(W)}catch(P){if(!(P instanceof v.default))throw P;return V.call(this,P),await L.call(this,P.missingSchema),I.call(this,W)}}function V({missingSchema:W,missingRef:P}){if(this.refs[W])throw new Error(`AnySchema ${W} is loaded but ${P} cannot be resolved`)}async function L(W){const P=await Q.call(this,W);this.refs[W]||await w.call(this,P.$schema),this.refs[W]||this.addSchema(P,W,q)}async function Q(W){const P=this._loading[W];if(P)return P;try{return await(this._loading[W]=j(W))}finally{delete this._loading[W]}}}addSchema(N,q,j,i=this.opts.validateSchema){if(Array.isArray(N)){for(const I of N)this.addSchema(I,void 0,j,i);return this}let w;if(typeof N=="object"){const{schemaId:I}=this.opts;if(w=N[I],w!==void 0&&typeof w!="string")throw new Error(`schema ${I} must be string`)}return q=(0,d.normalizeId)(q||w),this._checkUnique(q),this.schemas[q]=this._addSchema(N,j,q,i,!0),this}addMetaSchema(N,q,j=this.opts.validateSchema){return this.addSchema(N,q,!0,j),this}validateSchema(N,q){if(typeof N=="boolean")return!0;let j;if(j=N.$schema,j!==void 0&&typeof j!="string")throw new Error("$schema must be a string");if(j=j||this.opts.defaultMeta||this.defaultMeta(),!j)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(j,N);if(!i&&q){const w="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(w);else throw new Error(w)}return i}getSchema(N){let q;for(;typeof(q=p.call(this,N))=="string";)N=q;if(q===void 0){const{schemaId:j}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:j});if(q=l.resolveSchema.call(this,i,N),!q)return;this.refs[N]=q}return q.validate||this._compileSchemaEnv(q)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const q=p.call(this,N);return typeof q=="object"&&this._cache.delete(q.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const q=N;this._cache.delete(q);let j=N[this.opts.schemaId];return j&&(j=(0,d.normalizeId)(j),delete this.schemas[j],delete this.refs[j]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const q of N)this.addKeyword(q);return this}addKeyword(N,q){let j;if(typeof N=="string")j=N,typeof q=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=j);else if(typeof N=="object"&&q===void 0){if(q=N,j=q.keyword,Array.isArray(j)&&!j.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,j,q),!q)return(0,h.eachItem)(j,w=>x.call(this,w)),this;fe.call(this,q);const i={...q,type:(0,_.getJSONTypes)(q.type),schemaType:(0,_.getJSONTypes)(q.schemaType)};return(0,h.eachItem)(j,i.type.length===0?w=>x.call(this,w,i):w=>i.type.forEach(I=>x.call(this,w,i,I))),this}getKeyword(N){const q=this.RULES.all[N];return typeof q=="object"?q.definition:!!q}removeKeyword(N){const{RULES:q}=this;delete q.keywords[N],delete q.all[N];for(const j of q.rules){const i=j.rules.findIndex(w=>w.keyword===N);i>=0&&j.rules.splice(i,1)}return this}addFormat(N,q){return typeof q=="string"&&(q=new RegExp(q)),this.formats[N]=q,this}errorsText(N=this.errors,{separator:q=", ",dataVar:j="data"}={}){return!N||N.length===0?"No errors":N.map(i=>`${j}${i.instancePath} ${i.message}`).reduce((i,w)=>i+q+w)}$dataMetaSchema(N,q){const j=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const i of q){const w=i.split("/").slice(1);let I=N;for(const V of w)I=I[V];for(const V in j){const L=j[V];if(typeof L!="object")continue;const{$data:Q}=L.definition,W=I[V];Q&&W&&(I[V]=ye(W))}}return N}_removeAllSchemas(N,q){for(const j in N){const i=N[j];(!q||q.test(j))&&(typeof i=="string"?delete N[j]:i&&!i.meta&&(this._cache.delete(i.schema),delete N[j]))}}_addSchema(N,q,j,i=this.opts.validateSchema,w=this.opts.addUsedSchema){let I;const{schemaId:V}=this.opts;if(typeof N=="object")I=N[V];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let L=this._cache.get(N);if(L!==void 0)return L;j=(0,d.normalizeId)(I||j);const Q=d.getSchemaRefs.call(this,N,j);return L=new l.SchemaEnv({schema:N,schemaId:V,meta:q,baseId:j,localRefs:Q}),this._cache.set(L.schema,L),w&&!j.startsWith("#")&&(j&&this._checkUnique(j),this.refs[j]=L),i&&this.validateSchema(N,!0),L}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):l.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const q=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,N)}finally{this.opts=q}}}f.ValidationError=u.default,f.MissingRefError=v.default,e.default=f;function m(A,N,q,j="error"){for(const i in A){const w=i;w in N&&this.logger[j](`${q}: option ${i}. ${A[w]}`)}}function p(A){return A=(0,d.normalizeId)(A),this.schemas[A]||this.refs[A]}function $(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const N in A)this.addSchema(A[N],N)}function k(){for(const A in this.opts.formats){const N=this.opts.formats[A];N&&this.addFormat(A,N)}}function C(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in A){const q=A[N];q.keyword||(q.keyword=N),this.addKeyword(q)}}function D(){const A={...this.opts};for(const N of b)delete A[N];return A}const z={log(){},warn(){},error(){}};function K(A){if(A===!1)return z;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function B(A,N){const{RULES:q}=this;if((0,h.eachItem)(A,j=>{if(q.keywords[j])throw new Error(`Keyword ${j} is already defined`);if(!F.test(j))throw new Error(`Keyword ${j} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function x(A,N,q){var j;const i=N?.post;if(q&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:w}=this;let I=i?w.post:w.rules.find(({type:L})=>L===q);if(I||(I={type:q,rules:[]},w.rules.push(I)),w.keywords[A]=!0,!N)return;const V={keyword:A,definition:{...N,type:(0,_.getJSONTypes)(N.type),schemaType:(0,_.getJSONTypes)(N.schemaType)}};N.before?de.call(this,I,V,N.before):I.rules.push(V),w.all[A]=V,(j=N.implements)===null||j===void 0||j.forEach(L=>this.addKeyword(L))}function de(A,N,q){const j=A.rules.findIndex(i=>i.keyword===q);j>=0?A.rules.splice(j,0,N):(A.rules.push(N),this.logger.warn(`rule ${q} is not defined`))}function fe(A){let{metaSchema:N}=A;N!==void 0&&(A.$data&&this.opts.$data&&(N=ye(N)),A.validateSchema=this.compile(N,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(A){return{anyOf:[A,Z]}}}(Ot)),Ot}var De={},Ve={},ze={},Pr;function es(){if(Pr)return ze;Pr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ze.default=e,ze}var ve={},Rr;function ts(){if(Rr)return ve;Rr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=Et(),a=le(),g=J(),u=_e(),v=Kt(),o=X(),l={keyword:"$ref",schemaType:"string",code(_){const{gen:h,schema:S,it:R}=_,{baseId:E,schemaEnv:b,validateName:y,opts:n,self:r}=R,{root:t}=b;if((S==="#"||S==="#/")&&E===t.baseId)return f();const s=v.resolveRef.call(r,t,E,S);if(s===void 0)throw new e.default(R.opts.uriResolver,E,S);if(s instanceof v.SchemaEnv)return m(s);return p(s);function f(){if(b===t)return d(_,y,b,b.$async);const $=h.scopeValue("root",{ref:t});return d(_,(0,g._)`${$}.validate`,t,t.$async)}function m($){const k=c(_,$);d(_,k,$,$.$async)}function p($){const k=h.scopeValue("schema",n.code.source===!0?{ref:$,code:(0,g.stringify)($)}:{ref:$}),C=h.name("valid"),D=_.subschema({schema:$,dataTypes:[],schemaPath:g.nil,topSchemaRef:k,errSchemaPath:S},C);_.mergeEvaluated(D),_.ok(C)}}};function c(_,h){const{gen:S}=_;return h.validate?S.scopeValue("validate",{ref:h.validate}):(0,g._)`${S.scopeValue("wrapper",{ref:h})}.validate`}ve.getValidate=c;function d(_,h,S,R){const{gen:E,it:b}=_,{allErrors:y,schemaEnv:n,opts:r}=b,t=r.passContext?u.default.this:g.nil;R?s():f();function s(){if(!n.$async)throw new Error("async schema referenced by sync schema");const $=E.let("valid");E.try(()=>{E.code((0,g._)`await ${(0,a.callValidateCode)(_,h,t)}`),p(h),y||E.assign($,!0)},k=>{E.if((0,g._)`!(${k} instanceof ${b.ValidationError})`,()=>E.throw(k)),m(k),y||E.assign($,!1)}),_.ok($)}function f(){_.result((0,a.callValidateCode)(_,h,t),()=>p(h),()=>m(h))}function m($){const k=(0,g._)`${$}.errors`;E.assign(u.default.vErrors,(0,g._)`${u.default.vErrors} === null ? ${k} : ${u.default.vErrors}.concat(${k})`),E.assign(u.default.errors,(0,g._)`${u.default.vErrors}.length`)}function p($){var k;if(!b.opts.unevaluated)return;const C=(k=S?.validate)===null||k===void 0?void 0:k.evaluated;if(b.props!==!0)if(C&&!C.dynamicProps)C.props!==void 0&&(b.props=o.mergeEvaluated.props(E,C.props,b.props));else{const D=E.var("props",(0,g._)`${$}.evaluated.props`);b.props=o.mergeEvaluated.props(E,D,b.props,g.Name)}if(b.items!==!0)if(C&&!C.dynamicItems)C.items!==void 0&&(b.items=o.mergeEvaluated.items(E,C.items,b.items));else{const D=E.var("items",(0,g._)`${$}.evaluated.items`);b.items=o.mergeEvaluated.items(E,D,b.items,g.Name)}}}return ve.callRef=d,ve.default=l,ve}var Nr;function rs(){if(Nr)return Ve;Nr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=es(),a=ts(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,a.default];return Ve.default=g,Ve}var Ue={},Le={},Or;function ns(){if(Or)return Le;Or=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=J(),a=e.operators,g={maximum:{okStr:"<=",ok:a.LTE,fail:a.GT},minimum:{okStr:">=",ok:a.GTE,fail:a.LT},exclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},exclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}},u={message:({keyword:o,schemaCode:l})=>(0,e.str)`must be ${g[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>(0,e._)`{comparison: ${g[o].okStr}, limit: ${l}}`},v={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:u,code(o){const{keyword:l,data:c,schemaCode:d}=o;o.fail$data((0,e._)`${c} ${g[l].fail} ${d} || isNaN(${c})`)}};return Le.default=v,Le}var Fe={},jr;function ss(){if(jr)return Fe;jr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=J(),g={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:u})=>(0,e.str)`must be multiple of ${u}`,params:({schemaCode:u})=>(0,e._)`{multipleOf: ${u}}`},code(u){const{gen:v,data:o,schemaCode:l,it:c}=u,d=c.opts.multipleOfPrecision,_=v.let("res"),h=d?(0,e._)`Math.abs(Math.round(${_}) - ${_}) > 1e-${d}`:(0,e._)`${_} !== parseInt(${_})`;u.fail$data((0,e._)`(${l} === 0 || (${_} = ${o}/${l}, ${h}))`)}};return Fe.default=g,Fe}var Ke={},He={},kr;function as(){if(kr)return He;kr=1,Object.defineProperty(He,"__esModule",{value:!0});function e(a){const g=a.length;let u=0,v=0,o;for(;v<g;)u++,o=a.charCodeAt(v++),o>=55296&&o<=56319&&v<g&&(o=a.charCodeAt(v),(o&64512)===56320&&v++);return u}return He.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',He}var Ir;function os(){if(Ir)return Ke;Ir=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=J(),a=X(),g=as(),v={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:l}){const c=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${c} than ${l} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:l,data:c,schemaCode:d,it:_}=o,h=l==="maxLength"?e.operators.GT:e.operators.LT,S=_.opts.unicode===!1?(0,e._)`${c}.length`:(0,e._)`${(0,a.useFunc)(o.gen,g.default)}(${c})`;o.fail$data((0,e._)`${S} ${h} ${d}`)}};return Ke.default=v,Ke}var Ge={},Tr;function is(){if(Tr)return Ge;Tr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=le(),a=J(),u={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:v})=>(0,a.str)`must match pattern "${v}"`,params:({schemaCode:v})=>(0,a._)`{pattern: ${v}}`},code(v){const{data:o,$data:l,schema:c,schemaCode:d,it:_}=v,h=_.opts.unicodeRegExp?"u":"",S=l?(0,a._)`(new RegExp(${d}, ${h}))`:(0,e.usePattern)(v,c);v.fail$data((0,a._)`!${S}.test(${o})`)}};return Ge.default=u,Ge}var Je={},qr;function cs(){if(qr)return Je;qr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=J(),g={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:v}){const o=u==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${v} properties`},params:({schemaCode:u})=>(0,e._)`{limit: ${u}}`},code(u){const{keyword:v,data:o,schemaCode:l}=u,c=v==="maxProperties"?e.operators.GT:e.operators.LT;u.fail$data((0,e._)`Object.keys(${o}).length ${c} ${l}`)}};return Je.default=g,Je}var We={},Cr;function us(){if(Cr)return We;Cr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=le(),a=J(),g=X(),v={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,a.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,a._)`{missingProperty: ${o}}`},code(o){const{gen:l,schema:c,schemaCode:d,data:_,$data:h,it:S}=o,{opts:R}=S;if(!h&&c.length===0)return;const E=c.length>=R.loopRequired;if(S.allErrors?b():y(),R.strictRequired){const t=o.parentSchema.properties,{definedProperties:s}=o.it;for(const f of c)if(t?.[f]===void 0&&!s.has(f)){const m=S.schemaEnv.baseId+S.errSchemaPath,p=`required property "${f}" is not defined at "${m}" (strictRequired)`;(0,g.checkStrictMode)(S,p,S.opts.strictRequired)}}function b(){if(E||h)o.block$data(a.nil,n);else for(const t of c)(0,e.checkReportMissingProp)(o,t)}function y(){const t=l.let("missing");if(E||h){const s=l.let("valid",!0);o.block$data(s,()=>r(t,s)),o.ok(s)}else l.if((0,e.checkMissingProp)(o,c,t)),(0,e.reportMissingProp)(o,t),l.else()}function n(){l.forOf("prop",d,t=>{o.setParams({missingProperty:t}),l.if((0,e.noPropertyInData)(l,_,t,R.ownProperties),()=>o.error())})}function r(t,s){o.setParams({missingProperty:t}),l.forOf(t,d,()=>{l.assign(s,(0,e.propertyInData)(l,_,t,R.ownProperties)),l.if((0,a.not)(s),()=>{o.error(),l.break()})},a.nil)}}};return We.default=v,We}var Be={},Ar;function ls(){if(Ar)return Be;Ar=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=J(),g={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:v}){const o=u==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${v} items`},params:({schemaCode:u})=>(0,e._)`{limit: ${u}}`},code(u){const{keyword:v,data:o,schemaCode:l}=u,c=v==="maxItems"?e.operators.GT:e.operators.LT;u.fail$data((0,e._)`${o}.length ${c} ${l}`)}};return Be.default=g,Be}var Xe={},Qe={},Mr;function Ht(){if(Mr)return Qe;Mr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=vn();return e.code='require("ajv/dist/runtime/equal").default',Qe.default=e,Qe}var Dr;function ds(){if(Dr)return Xe;Dr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=gt(),a=J(),g=X(),u=Ht(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:c}})=>(0,a.str)`must NOT have duplicate items (items ## ${c} and ${l} are identical)`,params:({params:{i:l,j:c}})=>(0,a._)`{i: ${l}, j: ${c}}`},code(l){const{gen:c,data:d,$data:_,schema:h,parentSchema:S,schemaCode:R,it:E}=l;if(!_&&!h)return;const b=c.let("valid"),y=S.items?(0,e.getSchemaTypes)(S.items):[];l.block$data(b,n,(0,a._)`${R} === false`),l.ok(b);function n(){const f=c.let("i",(0,a._)`${d}.length`),m=c.let("j");l.setParams({i:f,j:m}),c.assign(b,!0),c.if((0,a._)`${f} > 1`,()=>(r()?t:s)(f,m))}function r(){return y.length>0&&!y.some(f=>f==="object"||f==="array")}function t(f,m){const p=c.name("item"),$=(0,e.checkDataTypes)(y,p,E.opts.strictNumbers,e.DataType.Wrong),k=c.const("indices",(0,a._)`{}`);c.for((0,a._)`;${f}--;`,()=>{c.let(p,(0,a._)`${d}[${f}]`),c.if($,(0,a._)`continue`),y.length>1&&c.if((0,a._)`typeof ${p} == "string"`,(0,a._)`${p} += "_"`),c.if((0,a._)`typeof ${k}[${p}] == "number"`,()=>{c.assign(m,(0,a._)`${k}[${p}]`),l.error(),c.assign(b,!1).break()}).code((0,a._)`${k}[${p}] = ${f}`)})}function s(f,m){const p=(0,g.useFunc)(c,u.default),$=c.name("outer");c.label($).for((0,a._)`;${f}--;`,()=>c.for((0,a._)`${m} = ${f}; ${m}--;`,()=>c.if((0,a._)`${p}(${d}[${f}], ${d}[${m}])`,()=>{l.error(),c.assign(b,!1).break($)})))}}};return Xe.default=o,Xe}var Ye={},Vr;function fs(){if(Vr)return Ye;Vr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=J(),a=X(),g=Ht(),v={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:l,data:c,$data:d,schemaCode:_,schema:h}=o;d||h&&typeof h=="object"?o.fail$data((0,e._)`!${(0,a.useFunc)(l,g.default)}(${c}, ${_})`):o.fail((0,e._)`${h} !== ${c}`)}};return Ye.default=v,Ye}var Ze={},zr;function hs(){if(zr)return Ze;zr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=J(),a=X(),g=Ht(),v={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:l,data:c,$data:d,schema:_,schemaCode:h,it:S}=o;if(!d&&_.length===0)throw new Error("enum must have non-empty array");const R=_.length>=S.opts.loopEnum;let E;const b=()=>E??(E=(0,a.useFunc)(l,g.default));let y;if(R||d)y=l.let("valid"),o.block$data(y,n);else{if(!Array.isArray(_))throw new Error("ajv implementation error");const t=l.const("vSchema",h);y=(0,e.or)(..._.map((s,f)=>r(t,f)))}o.pass(y);function n(){l.assign(y,!1),l.forOf("v",h,t=>l.if((0,e._)`${b()}(${c}, ${t})`,()=>l.assign(y,!0).break()))}function r(t,s){const f=_[s];return typeof f=="object"&&f!==null?(0,e._)`${b()}(${c}, ${t}[${s}])`:(0,e._)`${c} === ${f}`}}};return Ze.default=v,Ze}var Ur;function ps(){if(Ur)return Ue;Ur=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=ns(),a=ss(),g=os(),u=is(),v=cs(),o=us(),l=ls(),c=ds(),d=fs(),_=hs(),h=[e.default,a.default,g.default,u.default,v.default,o.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,_.default];return Ue.default=h,Ue}var xe={},Se={},Lr;function _n(){if(Lr)return Se;Lr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateAdditionalItems=void 0;const e=J(),a=X(),u={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:l,it:c}=o,{items:d}=l;if(!Array.isArray(d)){(0,a.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}v(o,d)}};function v(o,l){const{gen:c,schema:d,data:_,keyword:h,it:S}=o;S.items=!0;const R=c.const("len",(0,e._)`${_}.length`);if(d===!1)o.setParams({len:l.length}),o.pass((0,e._)`${R} <= ${l.length}`);else if(typeof d=="object"&&!(0,a.alwaysValidSchema)(S,d)){const b=c.var("valid",(0,e._)`${R} <= ${l.length}`);c.if((0,e.not)(b),()=>E(b)),o.ok(b)}function E(b){c.forRange("i",l.length,R,y=>{o.subschema({keyword:h,dataProp:y,dataPropType:a.Type.Num},b),S.allErrors||c.if((0,e.not)(b),()=>c.break())})}}return Se.validateAdditionalItems=v,Se.default=u,Se}var et={},Pe={},Fr;function gn(){if(Fr)return Pe;Fr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.validateTuple=void 0;const e=J(),a=X(),g=le(),u={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:l,it:c}=o;if(Array.isArray(l))return v(o,"additionalItems",l);c.items=!0,!(0,a.alwaysValidSchema)(c,l)&&o.ok((0,g.validateArray)(o))}};function v(o,l,c=o.schema){const{gen:d,parentSchema:_,data:h,keyword:S,it:R}=o;y(_),R.opts.unevaluated&&c.length&&R.items!==!0&&(R.items=a.mergeEvaluated.items(d,c.length,R.items));const E=d.name("valid"),b=d.const("len",(0,e._)`${h}.length`);c.forEach((n,r)=>{(0,a.alwaysValidSchema)(R,n)||(d.if((0,e._)`${b} > ${r}`,()=>o.subschema({keyword:S,schemaProp:r,dataProp:r},E)),o.ok(E))});function y(n){const{opts:r,errSchemaPath:t}=R,s=c.length,f=s===n.minItems&&(s===n.maxItems||n[l]===!1);if(r.strictTuples&&!f){const m=`"${S}" is ${s}-tuple, but minItems or maxItems/${l} are not specified or different at path "${t}"`;(0,a.checkStrictMode)(R,m,r.strictTuples)}}}return Pe.validateTuple=v,Pe.default=u,Pe}var Kr;function ms(){if(Kr)return et;Kr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=gn(),a={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:g=>(0,e.validateTuple)(g,"items")};return et.default=a,et}var tt={},Hr;function ys(){if(Hr)return tt;Hr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=J(),a=X(),g=le(),u=_n(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:c,parentSchema:d,it:_}=l,{prefixItems:h}=d;_.items=!0,!(0,a.alwaysValidSchema)(_,c)&&(h?(0,u.validateAdditionalItems)(l,h):l.ok((0,g.validateArray)(l)))}};return tt.default=o,tt}var rt={},Gr;function vs(){if(Gr)return rt;Gr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:v,max:o}})=>o===void 0?(0,e.str)`must contain at least ${v} valid item(s)`:(0,e.str)`must contain at least ${v} and no more than ${o} valid item(s)`,params:({params:{min:v,max:o}})=>o===void 0?(0,e._)`{minContains: ${v}}`:(0,e._)`{minContains: ${v}, maxContains: ${o}}`},code(v){const{gen:o,schema:l,parentSchema:c,data:d,it:_}=v;let h,S;const{minContains:R,maxContains:E}=c;_.opts.next?(h=R===void 0?1:R,S=E):h=1;const b=o.const("len",(0,e._)`${d}.length`);if(v.setParams({min:h,max:S}),S===void 0&&h===0){(0,a.checkStrictMode)(_,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&h>S){(0,a.checkStrictMode)(_,'"minContains" > "maxContains" is always invalid'),v.fail();return}if((0,a.alwaysValidSchema)(_,l)){let s=(0,e._)`${b} >= ${h}`;S!==void 0&&(s=(0,e._)`${s} && ${b} <= ${S}`),v.pass(s);return}_.items=!0;const y=o.name("valid");S===void 0&&h===1?r(y,()=>o.if(y,()=>o.break())):h===0?(o.let(y,!0),S!==void 0&&o.if((0,e._)`${d}.length > 0`,n)):(o.let(y,!1),n()),v.result(y,()=>v.reset());function n(){const s=o.name("_valid"),f=o.let("count",0);r(s,()=>o.if(s,()=>t(f)))}function r(s,f){o.forRange("i",0,b,m=>{v.subschema({keyword:"contains",dataProp:m,dataPropType:a.Type.Num,compositeRule:!0},s),f()})}function t(s){o.code((0,e._)`${s}++`),S===void 0?o.if((0,e._)`${s} >= ${h}`,()=>o.assign(y,!0).break()):(o.if((0,e._)`${s} > ${S}`,()=>o.assign(y,!1).break()),h===1?o.assign(y,!0):o.if((0,e._)`${s} >= ${h}`,()=>o.assign(y,!0)))}}};return rt.default=u,rt}var Vt={},Jr;function _s(){return Jr||(Jr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const a=J(),g=X(),u=le();e.error={message:({params:{property:d,depsCount:_,deps:h}})=>{const S=_===1?"property":"properties";return(0,a.str)`must have ${S} ${h} when property ${d} is present`},params:({params:{property:d,depsCount:_,deps:h,missingProperty:S}})=>(0,a._)`{property: ${d},
|
|
6
|
+
missingProperty: ${S},
|
|
7
|
+
depsCount: ${_},
|
|
8
|
+
deps: ${h}}`};const v={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[_,h]=o(d);l(d,_),c(d,h)}};function o({schema:d}){const _={},h={};for(const S in d){if(S==="__proto__")continue;const R=Array.isArray(d[S])?_:h;R[S]=d[S]}return[_,h]}function l(d,_=d.schema){const{gen:h,data:S,it:R}=d;if(Object.keys(_).length===0)return;const E=h.let("missing");for(const b in _){const y=_[b];if(y.length===0)continue;const n=(0,u.propertyInData)(h,S,b,R.opts.ownProperties);d.setParams({property:b,depsCount:y.length,deps:y.join(", ")}),R.allErrors?h.if(n,()=>{for(const r of y)(0,u.checkReportMissingProp)(d,r)}):(h.if((0,a._)`${n} && (${(0,u.checkMissingProp)(d,y,E)})`),(0,u.reportMissingProp)(d,E),h.else())}}e.validatePropertyDeps=l;function c(d,_=d.schema){const{gen:h,data:S,keyword:R,it:E}=d,b=h.name("valid");for(const y in _)(0,g.alwaysValidSchema)(E,_[y])||(h.if((0,u.propertyInData)(h,S,y,E.opts.ownProperties),()=>{const n=d.subschema({keyword:R,schemaProp:y},b);d.mergeValidEvaluated(n,b)},()=>h.var(b,!0)),d.ok(b))}e.validateSchemaDeps=c,e.default=v}(Vt)),Vt}var nt={},Wr;function gs(){if(Wr)return nt;Wr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:v})=>(0,e._)`{propertyName: ${v.propertyName}}`},code(v){const{gen:o,schema:l,data:c,it:d}=v;if((0,a.alwaysValidSchema)(d,l))return;const _=o.name("valid");o.forIn("key",c,h=>{v.setParams({propertyName:h}),v.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},_),o.if((0,e.not)(_),()=>{v.error(!0),d.allErrors||o.break()})}),v.ok(_)}};return nt.default=u,nt}var st={},Br;function $n(){if(Br)return st;Br=1,Object.defineProperty(st,"__esModule",{value:!0});const e=le(),a=J(),g=_e(),u=X(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,a._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:c,schema:d,parentSchema:_,data:h,errsCount:S,it:R}=l;if(!S)throw new Error("ajv implementation error");const{allErrors:E,opts:b}=R;if(R.props=!0,b.removeAdditional!=="all"&&(0,u.alwaysValidSchema)(R,d))return;const y=(0,e.allSchemaProperties)(_.properties),n=(0,e.allSchemaProperties)(_.patternProperties);r(),l.ok((0,a._)`${S} === ${g.default.errors}`);function r(){c.forIn("key",h,p=>{!y.length&&!n.length?f(p):c.if(t(p),()=>f(p))})}function t(p){let $;if(y.length>8){const k=(0,u.schemaRefOrVal)(R,_.properties,"properties");$=(0,e.isOwnProperty)(c,k,p)}else y.length?$=(0,a.or)(...y.map(k=>(0,a._)`${p} === ${k}`)):$=a.nil;return n.length&&($=(0,a.or)($,...n.map(k=>(0,a._)`${(0,e.usePattern)(l,k)}.test(${p})`))),(0,a.not)($)}function s(p){c.code((0,a._)`delete ${h}[${p}]`)}function f(p){if(b.removeAdditional==="all"||b.removeAdditional&&d===!1){s(p);return}if(d===!1){l.setParams({additionalProperty:p}),l.error(),E||c.break();return}if(typeof d=="object"&&!(0,u.alwaysValidSchema)(R,d)){const $=c.name("valid");b.removeAdditional==="failing"?(m(p,$,!1),c.if((0,a.not)($),()=>{l.reset(),s(p)})):(m(p,$),E||c.if((0,a.not)($),()=>c.break()))}}function m(p,$,k){const C={keyword:"additionalProperties",dataProp:p,dataPropType:u.Type.Str};k===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(C,$)}}};return st.default=o,st}var at={},Xr;function $s(){if(Xr)return at;Xr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=bt(),a=le(),g=X(),u=$n(),v={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:l,schema:c,parentSchema:d,data:_,it:h}=o;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&u.default.code(new e.KeywordCxt(h,u.default,"additionalProperties"));const S=(0,a.allSchemaProperties)(c);for(const n of S)h.definedProperties.add(n);h.opts.unevaluated&&S.length&&h.props!==!0&&(h.props=g.mergeEvaluated.props(l,(0,g.toHash)(S),h.props));const R=S.filter(n=>!(0,g.alwaysValidSchema)(h,c[n]));if(R.length===0)return;const E=l.name("valid");for(const n of R)b(n)?y(n):(l.if((0,a.propertyInData)(l,_,n,h.opts.ownProperties)),y(n),h.allErrors||l.else().var(E,!0),l.endIf()),o.it.definedProperties.add(n),o.ok(E);function b(n){return h.opts.useDefaults&&!h.compositeRule&&c[n].default!==void 0}function y(n){o.subschema({keyword:"properties",schemaProp:n,dataProp:n},E)}}};return at.default=v,at}var ot={},Qr;function ws(){if(Qr)return ot;Qr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=le(),a=J(),g=X(),u=X(),v={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:l,schema:c,data:d,parentSchema:_,it:h}=o,{opts:S}=h,R=(0,e.allSchemaProperties)(c),E=R.filter(f=>(0,g.alwaysValidSchema)(h,c[f]));if(R.length===0||E.length===R.length&&(!h.opts.unevaluated||h.props===!0))return;const b=S.strictSchema&&!S.allowMatchingProperties&&_.properties,y=l.name("valid");h.props!==!0&&!(h.props instanceof a.Name)&&(h.props=(0,u.evaluatedPropsToName)(l,h.props));const{props:n}=h;r();function r(){for(const f of R)b&&t(f),h.allErrors?s(f):(l.var(y,!0),s(f),l.if(y))}function t(f){for(const m in b)new RegExp(f).test(m)&&(0,g.checkStrictMode)(h,`property ${m} matches pattern ${f} (use allowMatchingProperties)`)}function s(f){l.forIn("key",d,m=>{l.if((0,a._)`${(0,e.usePattern)(o,f)}.test(${m})`,()=>{const p=E.includes(f);p||o.subschema({keyword:"patternProperties",schemaProp:f,dataProp:m,dataPropType:u.Type.Str},y),h.opts.unevaluated&&n!==!0?l.assign((0,a._)`${n}[${m}]`,!0):!p&&!h.allErrors&&l.if((0,a.not)(y),()=>l.break())})})}}};return ot.default=v,ot}var it={},Yr;function bs(){if(Yr)return it;Yr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=X(),a={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){const{gen:u,schema:v,it:o}=g;if((0,e.alwaysValidSchema)(o,v)){g.fail();return}const l=u.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),g.failResult(l,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};return it.default=a,it}var ct={},Zr;function Es(){if(Zr)return ct;Zr=1,Object.defineProperty(ct,"__esModule",{value:!0});const a={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return ct.default=a,ct}var ut={},xr;function Ss(){if(xr)return ut;xr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:v})=>(0,e._)`{passingSchemas: ${v.passing}}`},code(v){const{gen:o,schema:l,parentSchema:c,it:d}=v;if(!Array.isArray(l))throw new Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;const _=l,h=o.let("valid",!1),S=o.let("passing",null),R=o.name("_valid");v.setParams({passing:S}),o.block(E),v.result(h,()=>v.reset(),()=>v.error(!0));function E(){_.forEach((b,y)=>{let n;(0,a.alwaysValidSchema)(d,b)?o.var(R,!0):n=v.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},R),y>0&&o.if((0,e._)`${R} && ${h}`).assign(h,!1).assign(S,(0,e._)`[${S}, ${y}]`).else(),o.if(R,()=>{o.assign(h,!0),o.assign(S,y),n&&v.mergeEvaluated(n,e.Name)})})}}};return ut.default=u,ut}var lt={},en;function Ps(){if(en)return lt;en=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=X(),a={keyword:"allOf",schemaType:"array",code(g){const{gen:u,schema:v,it:o}=g;if(!Array.isArray(v))throw new Error("ajv implementation error");const l=u.name("valid");v.forEach((c,d)=>{if((0,e.alwaysValidSchema)(o,c))return;const _=g.subschema({keyword:"allOf",schemaProp:d},l);g.ok(l),g.mergeEvaluated(_)})}};return lt.default=a,lt}var dt={},tn;function Rs(){if(tn)return dt;tn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:l,parentSchema:c,it:d}=o;c.then===void 0&&c.else===void 0&&(0,a.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const _=v(d,"then"),h=v(d,"else");if(!_&&!h)return;const S=l.let("valid",!0),R=l.name("_valid");if(E(),o.reset(),_&&h){const y=l.let("ifClause");o.setParams({ifClause:y}),l.if(R,b("then",y),b("else",y))}else _?l.if(R,b("then")):l.if((0,e.not)(R),b("else"));o.pass(S,()=>o.error(!0));function E(){const y=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},R);o.mergeEvaluated(y)}function b(y,n){return()=>{const r=o.subschema({keyword:y},R);l.assign(S,R),o.mergeValidEvaluated(r,S),n?l.assign(n,(0,e._)`${y}`):o.setParams({ifClause:y})}}}};function v(o,l){const c=o.schema[l];return c!==void 0&&!(0,a.alwaysValidSchema)(o,c)}return dt.default=u,dt}var ft={},rn;function Ns(){if(rn)return ft;rn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=X(),a={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:u,it:v}){u.if===void 0&&(0,e.checkStrictMode)(v,`"${g}" without "if" is ignored`)}};return ft.default=a,ft}var nn;function Os(){if(nn)return xe;nn=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=_n(),a=ms(),g=gn(),u=ys(),v=vs(),o=_s(),l=gs(),c=$n(),d=$s(),_=ws(),h=bs(),S=Es(),R=Ss(),E=Ps(),b=Rs(),y=Ns();function n(r=!1){const t=[h.default,S.default,R.default,E.default,b.default,y.default,l.default,c.default,o.default,d.default,_.default];return r?t.push(a.default,u.default):t.push(e.default,g.default),t.push(v.default),t}return xe.default=n,xe}var ht={},pt={},sn;function js(){if(sn)return pt;sn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=J(),g={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:u})=>(0,e.str)`must match format "${u}"`,params:({schemaCode:u})=>(0,e._)`{format: ${u}}`},code(u,v){const{gen:o,data:l,$data:c,schema:d,schemaCode:_,it:h}=u,{opts:S,errSchemaPath:R,schemaEnv:E,self:b}=h;if(!S.validateFormats)return;c?y():n();function y(){const r=o.scopeValue("formats",{ref:b.formats,code:S.code.formats}),t=o.const("fDef",(0,e._)`${r}[${_}]`),s=o.let("fType"),f=o.let("format");o.if((0,e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`,()=>o.assign(s,(0,e._)`${t}.type || "string"`).assign(f,(0,e._)`${t}.validate`),()=>o.assign(s,(0,e._)`"string"`).assign(f,t)),u.fail$data((0,e.or)(m(),p()));function m(){return S.strictSchema===!1?e.nil:(0,e._)`${_} && !${f}`}function p(){const $=E.$async?(0,e._)`(${t}.async ? await ${f}(${l}) : ${f}(${l}))`:(0,e._)`${f}(${l})`,k=(0,e._)`(typeof ${f} == "function" ? ${$} : ${f}.test(${l}))`;return(0,e._)`${f} && ${f} !== true && ${s} === ${v} && !${k}`}}function n(){const r=b.formats[d];if(!r){m();return}if(r===!0)return;const[t,s,f]=p(r);t===v&&u.pass($());function m(){if(S.strictSchema===!1){b.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${d}" ignored in schema at path "${R}"`}}function p(k){const C=k instanceof RegExp?(0,e.regexpCode)(k):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(d)}`:void 0,D=o.scopeValue("formats",{key:d,ref:k,code:C});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,e._)`${D}.validate`]:["string",k,D]}function $(){if(typeof r=="object"&&!(r instanceof RegExp)&&r.async){if(!E.$async)throw new Error("async format in sync schema");return(0,e._)`await ${f}(${l})`}return typeof s=="function"?(0,e._)`${f}(${l})`:(0,e._)`${f}.test(${l})`}}}};return pt.default=g,pt}var an;function ks(){if(an)return ht;an=1,Object.defineProperty(ht,"__esModule",{value:!0});const a=[js().default];return ht.default=a,ht}var we={},on;function Is(){return on||(on=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var cn;function Ts(){if(cn)return De;cn=1,Object.defineProperty(De,"__esModule",{value:!0});const e=rs(),a=ps(),g=Os(),u=ks(),v=Is(),o=[e.default,a.default,(0,g.default)(),u.default,v.metadataVocabulary,v.contentVocabulary];return De.default=o,De}var mt={},ke={},un;function qs(){if(un)return ke;un=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.DiscrError=void 0;var e;return function(a){a.Tag="tag",a.Mapping="mapping"}(e||(ke.DiscrError=e={})),ke}var ln;function Cs(){if(ln)return mt;ln=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=J(),a=qs(),g=Kt(),u=Et(),v=X(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:d}})=>c===a.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:_}})=>(0,e._)`{error: ${c}, tag: ${_}, tagValue: ${d}}`},code(c){const{gen:d,data:_,schema:h,parentSchema:S,it:R}=c,{oneOf:E}=S;if(!R.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=h.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!E)throw new Error("discriminator: requires oneOf keyword");const y=d.let("valid",!1),n=d.const("tag",(0,e._)`${_}${(0,e.getProperty)(b)}`);d.if((0,e._)`typeof ${n} == "string"`,()=>r(),()=>c.error(!1,{discrError:a.DiscrError.Tag,tag:n,tagName:b})),c.ok(y);function r(){const f=s();d.if(!1);for(const m in f)d.elseIf((0,e._)`${n} === ${m}`),d.assign(y,t(f[m]));d.else(),c.error(!1,{discrError:a.DiscrError.Mapping,tag:n,tagName:b}),d.endIf()}function t(f){const m=d.name("valid"),p=c.subschema({keyword:"oneOf",schemaProp:f},m);return c.mergeEvaluated(p,e.Name),m}function s(){var f;const m={},p=k(S);let $=!0;for(let z=0;z<E.length;z++){let K=E[z];if(K?.$ref&&!(0,v.schemaHasRulesButRef)(K,R.self.RULES)){const B=K.$ref;if(K=g.resolveRef.call(R.self,R.schemaEnv.root,R.baseId,B),K instanceof g.SchemaEnv&&(K=K.schema),K===void 0)throw new u.default(R.opts.uriResolver,R.baseId,B)}const F=(f=K?.properties)===null||f===void 0?void 0:f[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);$=$&&(p||k(K)),C(F,z)}if(!$)throw new Error(`discriminator: "${b}" must be required`);return m;function k({required:z}){return Array.isArray(z)&&z.includes(b)}function C(z,K){if(z.const)D(z.const,K);else if(z.enum)for(const F of z.enum)D(F,K);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function D(z,K){if(typeof z!="string"||z in m)throw new Error(`discriminator: "${b}" values must be unique strings`);m[z]=K}}}};return mt.default=l,mt}const As="http://json-schema.org/draft-07/schema#",Ms="http://json-schema.org/draft-07/schema#",Ds="Core schema meta-schema",Vs={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},zs=["object","boolean"],Us={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Ls={$schema:As,$id:Ms,title:Ds,definitions:Vs,type:zs,properties:Us,default:!0};var dn;function Fs(){return dn||(dn=1,function(e,a){Object.defineProperty(a,"__esModule",{value:!0}),a.MissingRefError=a.ValidationError=a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=a.Ajv=void 0;const g=xn(),u=Ts(),v=Cs(),o=Ls,l=["/properties"],c="http://json-schema.org/draft-07/schema";class d extends g.default{_addVocabularies(){super._addVocabularies(),u.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(v.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(o,l):o;this.addMetaSchema(b,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}a.Ajv=d,e.exports=a=d,e.exports.Ajv=d,Object.defineProperty(a,"__esModule",{value:!0}),a.default=d;var _=bt();Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return _.KeywordCxt}});var h=J();Object.defineProperty(a,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var S=Ft();Object.defineProperty(a,"ValidationError",{enumerable:!0,get:function(){return S.default}});var R=Et();Object.defineProperty(a,"MissingRefError",{enumerable:!0,get:function(){return R.default}})}(Te,Te.exports)),Te.exports}var Ks=Fs();const Hs=An(Ks),Gs="https://schemas.oceanum.io/eidos/root.json";let Ie=null;const fn=async e=>{const a=await fetch(e);if(a.statusCode>=400)throw new Error("Loading error: "+a.statusCode);return a.body},Js=async e=>{if(!Ie){const g=await fn(Gs);Ie=await new Hs({allErrors:!0,verbose:!0,strict:!1,loadSchema:fn}).compileAsync(g)}if(!Ie(e)&&Ie.errors){const g=Ie.errors.map(u=>`${u.instancePath||"root"}: ${u.message} (${JSON.stringify(u.params||{})})`).join("; ");throw new Error(`EIDOS spec validation failed: ${g}`)}return!0},Ws="https://render.eidos.oceanum.io",wn=async(e,a,g={})=>{const{id:u,eventListener:v,renderer:o=Ws,authToken:l}=g,c=e.querySelector("iframe[data-eidos-renderer]"),d=e.getAttribute("data-eidos-initialized")==="true";if(c||d)throw new Error("EIDOS renderer already mounted in this container. Call destroy() before re-rendering.");e.setAttribute("data-eidos-initialized","true");try{await Js(a)}catch(S){throw new Error(`Invalid Eidos Spec: ${S.message}`)}const _=pn(structuredClone(a)),h=u||a.id;return new Promise((S,R)=>{const E=document.createElement("iframe");E.src=`${o}?id=${h}`,E.width="100%",E.height="100%",E.frameBorder="0",E.setAttribute("data-eidos-renderer","true"),e.appendChild(E);let b=null,y=null;E.onload=()=>{const n=E.contentWindow,r=async t=>{const s=typeof t=="function"?await t():t;n?.postMessage({id:h,type:"auth",payload:s},"*")};b=t=>{t.source===n&&(t.data.id&&t.data.id!==h||(t.data.type==="init"?(n?.postMessage({id:h,type:"spec",payload:structuredClone(_)},"*"),l&&r(l)):(t.data.type||t.data.action||t.data.control)&&v?.(t.data)))},window.addEventListener("message",b),y=qn(_,()=>{n?.postMessage({id:h,type:"spec",payload:Cn(_)},"*")}),l&&r(l),S({spec:_,updateAuth:r,iframe:E,destroy:()=>{b&&window.removeEventListener("message",b),y&&y(),E.remove(),e.removeAttribute("data-eidos-initialized")}})},E.onerror=()=>{R(new Error("Failed to load EIDOS renderer"))}})},bn=Re.createContext(null),Bs=()=>{const e=Re.useContext(bn);if(!e)throw new Error("useEidosSpec must be used within an EidosProvider");return e},Xs=({children:e,initialSpec:a,options:g={},containerStyle:u={width:"100%",height:"100%",position:"absolute"},onInitialized:v})=>{const o=Re.useRef(null),[l,c]=Re.useState(null),d=Re.useRef(!1);return Re.useEffect(()=>{if(!o.current||d.current)return;d.current=!0,(async()=>{try{const h=await wn(o.current,a,g);c(h.spec),v?.(h.spec)}catch(h){console.error("Failed to initialize EIDOS:",h),d.current=!1}})()},[a,g,v]),React.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},React.createElement("div",{ref:o,style:u}),l&&React.createElement(bn.Provider,{value:l},e))};exports.EidosProvider=Xs;exports.render=wn;exports.useEidosSpec=Bs;
|