stac-node-validator
Version:
STAC Validator for NodeJS
2 lines • 294 kB
JavaScript
/*! For license information please see index.mjs.LICENSE.txt */
var e={1321(e,t,r){var n=r(9139);const o="1.1.0",s={classification:"https://stac-extensions.github.io/classification/v2.0.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.2.0/schema.json",eo:"https://stac-extensions.github.io/eo/v2.0.0/schema.json",file:"https://stac-extensions.github.io/file/v2.1.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.2.0/schema.json",projection:"https://stac-extensions.github.io/projection/v2.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v2.0.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.1.0/schema.json",version:"https://stac-extensions.github.io/version/v1.2.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},a={itemAndCollection:{"classification:":s.classification,"cube:":s.datacube,"eo:":s.eo,"file:":s.file,"label:":s.label,"pc:":s.pointcloud,"processing:":s.processing,"proj:":s.projection,"raster:":s.raster,"sar:":s.sar,"sat:":s.sat,"sci:":s.scientific,"view:":s.view,version:s.version,deprecated:s.version,published:s.timestamps,expires:s.timestamps,unpublished:s.timestamps},catalog:{},collection:{},item:{}};a.collection=Object.assign(a.collection,a.itemAndCollection),a.item=Object.assign(a.item,a.itemAndCollection);var i={parseExtension(e){let t=e.match(/^https?:\/\/stac-extensions.github.io\/([^\/]+)\/v([^\/]+)\/[^.]+.json$/i);if(t)return{id:t[1],version:t[2]};let r=e.match(/(\d+\.\d+(\.\d+)([a-z_.-][\w.-]+)?)/i);return r?{id:e,version:r[1]}:e in s?{id:e,version:"0.0.0"}:void 0}},c={version:o,extensions:{},set(e){if("string"!=typeof e.stac_version?c.version="0.6.0":c.version=e.stac_version,Array.isArray(e.stac_extensions))for(let t of e.stac_extensions){let e=i.parseExtension(t);e&&(c.extensions[e.id]=e.version)}},before:(e,t=null)=>c.compare("<",e,t),compare(e,t,r=null){let o=r?c.extensions[r]:c.version;return void 0!==o&&n.compare(o,t,e)}},u={type(e){let t=typeof e;if("object"===t){if(null===e)return"null";if(Array.isArray(e))return"array"}return t},is:(e,t)=>Array.isArray(t)?t.includes(u.type(e)):u.type(e)===t,isDefined:e=>void 0!==e,isObject:e=>"object"==typeof e&&e===Object(e)&&!Array.isArray(e),rename:(e,t,r)=>void 0!==e[t]&&void 0===e[r]&&(e[r]=e[t],delete e[t],!0),copy:(e,t,r)=>void 0!==e[t]&&void 0===e[r]&&(e[r]=e[t],!0),forAll(e,t,r){if(e[t]&&"object"==typeof e[t])for(let n in e[t])r(e[t][n])},toArray:(e,t)=>void 0!==e[t]&&!Array.isArray(e[t])&&(e[t]=[e[t]],!0),flattenArray(e,t,r,n=!1){if(Array.isArray(e[t])){for(let o in e[t])if("string"==typeof r[o]){let s=e[t][o];e[r[o]]=n?[s]:s}return delete e[t],!0}return!1},flattenOneElementArray:(e,t,r=!1)=>!(!r&&Array.isArray(e[t]))||1===e[t].length&&(e[t]=e[t][0],!0),removeFromArray(e,t,r){if(Array.isArray(e[t])){let n=e[t].indexOf(r);return n>-1&&e[t].splice(n,1),!0}return!1},pickFirst:(e,t)=>Array.isArray(e[t])&&e[t].length>0?(e[t]=e[t][0],!0):(delete e[t],!1),ensure:(e,t,r)=>(u.type(r)!==u.type(e[t])&&(e[t]=r),!0),upgradeExtension(e,t){let{id:r,version:o}=i.parseExtension(t),s=e.stac_extensions.findIndex(e=>{let t=i.parseExtension(e);return t&&t.id===r&&n.compare(t.version,o,"<")});return-1!==s&&(e.stac_extensions[s]=t,!0)},addExtension(e,t){let{id:r,version:o}=i.parseExtension(t),s=e.stac_extensions.findIndex(e=>{if(e===t)return!0;let s=i.parseExtension(e);return!(!s||s.id!==r||!n.compare(s.version,o,"<"))});return-1===s?e.stac_extensions.push(t):e.stac_extensions[s]=t,e.stac_extensions.sort(),!0},removeExtension:(e,t)=>u.removeFromArray(e,"stac_extensions",t),migrateExtensionShortnames(e){let t=Object.keys(s),r=Object.values(s);return u.mapValues(e,"stac_extensions",t,r)},populateExtensions(e,t){let r,n=[];for("catalog"!=t&&"collection"!=t||n.push(e),"item"!=t&&"collection"!=t||!u.isObject(e.assets)||(n=n.concat(Object.values(e.assets))),"collection"==t&&u.isObject(e.item_assets)&&(n=n.concat(Object.values(e.item_assets))),"collection"==t&&u.isObject(e.summaries)&&n.push(e.summaries),"item"==t&&u.isObject(e.properties)&&n.push(e.properties),n.push(e.links);r=n.pop();)Object.keys(r).forEach(o=>{Array.isArray(r.bands)&&(n=n.concat(r.bands));let s=o.match(/^(\w+:|[^:]+$)/i);if(Array.isArray(s)){let r=a[t][s[0]];u.is(r,"string")&&u.addExtension(e,r)}})},mapValues(e,t,r,n){let o=e=>{let t=r.indexOf(e);return t>=0?n[t]:e};return Array.isArray(e[t])?e[t]=e[t].map(o):void 0!==e[t]&&(e[t]=o(e[t])),!0},mapObject(e,t){for(let r in e)e[r]=t(e[r],r)},moveTo(e,t,r,n=!1,o=!1){let s;return s=n?o?e=>Array.isArray(e):e=>Array.isArray(e)&&1===e.length:u.isDefined,!!s(e[t])&&(r[t]=n&&!o?e[t][0]:e[t],delete e[t],!0)},runAll(e,t,r,n){for(let o in e)o.startsWith("migrate")||e[o](t,r,n)},toUTC(e,t){if(u.is(e[t],"string"))try{return e[t]=this.toISOString(e[t]),!0}catch(e){}return delete e[t],!1},toISOString:e=>(e instanceof Date||(e=new Date(e)),e.toISOString().replace(/\.0+(?=[-\+Z])/,"")),formatString(e,t,r){const n=e=>u.is(e,["string","number"])?r.replaceAll("{}",e):e;Array.isArray(e[t])?e[t]=e[t].map(n):e[t]=n(e[t])}},l={multihash:null,hexToUint8(e){if(0===e.length||e.length%2!=0)throw new Error(`The string "${e}" is not valid hex.`);return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},uint8ToHex:e=>e.reduce((e,t)=>e+t.toString(16).padStart(2,"0"),""),toMultihash(e,t,r){if(!l.multihash||!u.is(e[t],"string"))return!1;try{const n=l.multihash.encode(l.hexToUint8(e[t]),r);return e[t]=l.uint8ToHex(n),!0}catch(e){return console.warn(e),!1}}},d={migrate:(e,t=!0)=>(c.set(e),t&&(e.stac_version=o),e.type="Catalog",u.ensure(e,"stac_extensions",[]),c.before("1.0.0-rc.1")&&u.migrateExtensionShortnames(e),u.ensure(e,"id",""),u.ensure(e,"description",""),u.ensure(e,"links",[]),u.runAll(d,e,e),c.before("0.8.0")&&u.populateExtensions(e,"catalog"),e)},f={migrate:(e,t=!0)=>(d.migrate(e,t),e.type="Collection",c.before("1.0.0-rc.1")&&u.migrateExtensionShortnames(e),u.ensure(e,"license","other"),u.ensure(e,"extent",{spatial:{bbox:[]},temporal:{interval:[]}}),u.runAll(f,e,e),u.isObject(e.properties)&&(u.removeFromArray(e,"stac_extensions","commons"),delete e.properties),c.before("0.8.0")&&u.populateExtensions(e,"collection"),c.before("1.0.0-beta.1")&&u.mapValues(e,"stac_extensions",["assets"],["item-assets"]),e),extent(e){if(u.ensure(e,"extent",{}),c.before("0.8.0")&&(Array.isArray(e.extent.spatial)&&(e.extent.spatial={bbox:[e.extent.spatial]}),Array.isArray(e.extent.temporal)&&(e.extent.temporal={interval:[e.extent.temporal]})),u.ensure(e.extent,"spatial",{}),u.ensure(e.extent.spatial,"bbox",[]),u.ensure(e.extent,"temporal",{}),u.ensure(e.extent.temporal,"interval",[]),c.before("1.0.0-rc.3")){if(e.extent.temporal.interval.length>1){let t,r;for(let n of e.extent.temporal.interval){if(null===n[0])t=null;else if("string"==typeof n[0]&&null!==t)try{let e=new Date(n[0]);(void 0===t||e<t)&&(t=e)}catch(e){}if(null===n[1])r=null;else if("string"==typeof n[1]&&null!==r)try{let e=new Date(n[1]);(void 0===r||e>r)&&(r=e)}catch(e){}}e.extent.temporal.interval.unshift([t?u.toISOString(t):null,r?u.toISOString(r):null])}if(e.extent.spatial.bbox.length>1){let t=e.extent.spatial.bbox.reduce((e,t)=>Array.isArray(t)?Math.max(t.length,e):e,4);if(t>=4){let r=new Array(t).fill(null),n=t/2;for(let t of e.extent.spatial.bbox){if(!Array.isArray(t)||t.length<4)break;for(let e in t){let o=t[e];null===r[e]?r[e]=o:r[e]=e<n?Math.min(o,r[e]):Math.max(o,r[e])}}-1===r.findIndex(e=>null===e)&&e.extent.spatial.bbox.unshift(r)}}}},collectionAssets(e){c.before("1.0.0-rc.1")&&u.removeExtension(e,"collection-assets"),g.migrateAll(e)},itemAsset(e){c.before("1.0.0-beta.2")&&u.rename(e,"item_assets","assets"),u.removeExtension(e,s["item-assets"]),g.migrateAll(e,"item_assets")},summaries(e){if(u.ensure(e,"summaries",{}),c.before("0.8.0")&&u.isObject(e.other_properties)){for(let t in e.other_properties){let r=e.other_properties[t];Array.isArray(r.extent)&&2===r.extent.length?e.summaries[t]={minimum:r.extent[0],maximum:r.extent[1]}:Array.isArray(r.values)&&(r.values.filter(e=>Array.isArray(e)).length===r.values.length?e.summaries[t]=r.values.reduce((e,t)=>e.concat(t),[]):e.summaries[t]=r.values)}delete e.other_properties}if(c.before("1.0.0-beta.1")&&u.isObject(e.properties)&&!e.links.find(e=>["child","item"].includes(e.rel)))for(let t in e.properties){let r=e.properties[t];Array.isArray(r)||(r=[r]),e.summaries[t]=r}c.before("1.0.0-rc.1")&&u.mapObject(e.summaries,e=>(u.rename(e,"min","minimum"),u.rename(e,"max","maximum"),e)),v.migrate(e.summaries,e,!0),u.moveTo(e.summaries,"sci:doi",e,!0)&&u.addExtension(e,s.scientific),u.moveTo(e.summaries,"sci:publications",e,!0,!0)&&u.addExtension(e,s.scientific),u.moveTo(e.summaries,"sci:citation",e,!0)&&u.addExtension(e,s.scientific),u.moveTo(e.summaries,"cube:dimensions",e,!0)&&u.addExtension(e,s.datacube),0===Object.keys(e.summaries).length&&delete e.summaries}},h={migrate(e,t=null,r=!0){c.set(e),r&&(e.stac_version=o),u.ensure(e,"stac_extensions",[]),c.before("1.0.0-rc.1")&&u.migrateExtensionShortnames(e),u.ensure(e,"id",""),u.ensure(e,"type","Feature"),u.isObject(e.geometry)||(e.geometry=null),null!==e.geometry&&u.ensure(e,"bbox",[]),u.ensure(e,"properties",{}),u.ensure(e,"links",[]),u.ensure(e,"assets",{});let n=!1;return u.isObject(t)&&u.isObject(t.properties)&&(u.removeFromArray(e,"stac_extensions","commons"),e.properties=Object.assign({},t.properties,e.properties),n=!0),u.runAll(h,e,e),v.migrate(e.properties,e),g.migrateAll(e),(c.before("0.8.0")||n)&&u.populateExtensions(e,"item"),e}},p={migrate:(e,t=!0)=>(u.ensure(e,"collections",[]),u.ensure(e,"links",[]),u.runAll(p,e,e),e.collections=e.collections.map(e=>f.migrate(e,t)),e)},m={migrate:(e,t=!0)=>(u.ensure(e,"type","FeatureCollection"),u.ensure(e,"features",[]),u.ensure(e,"links",[]),u.runAll(m,e,e),e.features=e.features.map(e=>h.migrate(e,null,t)),e)},g={migrateAll(e,t="assets"){for(let r in e[t])g.migrate(e[t][r],e)},migrate:(e,t)=>(u.runAll(g,e,t),v.migrate(e,t),e),mediaTypes(e){u.is(e.type,"string")&&u.mapValues(e,"type",["image/vnd.stac.geotiff","image/vnd.stac.geotiff; cloud-optimized=true"],["image/tiff; application=geotiff","image/tiff; application=geotiff; profile=cloud-optimized"])}},y={migrateAll(e,t){if(c.before("1.0.0")){const r=u.isObject(t.properties)&&Array.isArray(t.properties.bands)?t.properties.bands:[];if(Array.isArray(e["eo:bands"]))for(let t in e["eo:bands"]){let n=e["eo:bands"][t];u.is(n,"number")&&u.isObject(r[n])&&(n=r[n]),u.isObject(n)||(n={}),e["eo:bands"][t]=n}}if(c.before("1.1.0-beta.1")&&(Array.isArray(e["raster:bands"])||Array.isArray(e["eo:bands"]))){u.ensure(e,"bands",[]);const r=e["raster:bands"]||[],n=e["eo:bands"]||[],o=Math.max(r.length,n.length);for(let s=0;s<o;s++)u.ensure(e.bands,s,{}),Object.assign(e.bands[s],r[s],n[s]),e.bands[s]=y.migrate(e.bands[s],t);delete e["raster:bands"],delete e["eo:bands"]}},migrate:(e,t)=>(u.runAll(y,e,t),v.migrate(e,t),e),eo(e){c.before("2.0.0-beta.1","eo")&&(u.rename(e,"common_name","eo:common_name"),u.rename(e,"center_wavelength","eo:center_wavelength"),u.rename(e,"full_width_half_max","eo:full_width_half_max"),u.rename(e,"solar_illumination","eo:solar_illumination"))},raster(e){c.before("2.0.0-beta.1","raster")&&(u.rename(e,"sampling","raster:sampling"),u.rename(e,"bits_per_sample","raster:bits_per_sample"),u.rename(e,"spatial_resolution","raster:spatial_resolution"),u.rename(e,"scale","raster:scale"),u.rename(e,"offset","raster:offset"),u.rename(e,"histogram","raster:histogram"))}},v={migrate:(e,t,r=!1)=>(u.runAll(v,e,t,r),e),_commonMetadata(e,t){c.before("1.0.0-rc.3")&&(u.toUTC(e,"created"),u.toUTC(e,"updated")),y.migrateAll(e,t)},_timestamps(e,t){u.toUTC(e,"published"),u.toUTC(e,"expires"),u.toUTC(e,"unpublished"),u.upgradeExtension(t,s.timestamps)},_versioningIndicator(e,t){u.upgradeExtension(t,s.version)},checksum(e,t){c.before("0.9.0")&&l.multihash&&(u.rename(e,"checksum:md5","checksum:multihash")&&l.toMultihash(e,"checksum:multihash","md5"),u.rename(e,"checksum:sha1","checksum:multihash")&&l.toMultihash(e,"checksum:multihash","sha1"),u.rename(e,"checksum:sha2","checksum:multihash")&&l.toMultihash(e,"checksum:multihash","sha2-256"),u.rename(e,"checksum:sha3","checksum:multihash")&&l.toMultihash(e,"checksum:multihash","sha3-256")),c.before("1.0.0-rc.1")&&u.rename(e,"checksum:multihash","file:checksum")&&u.addExtension(t,s.file),u.removeExtension(t,"checksum")},classification(e,t){c.before("1.1.0","classification")&&u.forAll(e,"classification:classes",e=>u.rename(e,"color-hint","color_hint")),c.before("2.0.0","classification")&&u.forAll(e,"classification:classes",e=>u.ensure(e,"name",e.description)),u.upgradeExtension(t,s.classification)},cube(e,t){u.upgradeExtension(t,s.datacube)},dtr(e,t){c.before("0.9.0")&&(u.rename(e,"dtr:start_datetime","start_datetime"),u.rename(e,"dtr:end_datetime","end_datetime"),u.removeExtension(t,"datetime-range"))},eo(e,t){c.before("0.9.0")&&(u.rename(e,"eo:epsg","proj:epsg")&&u.addExtension(t,s.projection),u.rename(e,"eo:platform","platform"),u.rename(e,"eo:instrument","instruments")&&u.toArray(e,"instruments"),u.rename(e,"eo:constellation","constellation"),u.rename(e,"eo:off_nadir","view:off_nadir")&&u.addExtension(t,s.view),u.rename(e,"eo:azimuth","view:azimuth")&&u.addExtension(t,s.view),u.rename(e,"eo:incidence_angle","view:incidence_angle")&&u.addExtension(t,s.view),u.rename(e,"eo:sun_azimuth","view:sun_azimuth")&&u.addExtension(t,s.view),u.rename(e,"eo:sun_elevation","view:sun_elevation")&&u.addExtension(t,s.view)),c.before("1.0.0-beta.1")&&u.rename(e,"eo:gsd","gsd"),u.upgradeExtension(t,s.eo)},file(e,t,r){u.rename(e,"file:bits_per_sample","raster:bits_per_sample")&&u.addExtension(t,s.raster),u.rename(e,"file:data_type","data_type"),u.rename(e,"file:unit","unit"),Array.isArray(e["file:nodata"])&&e["file:nodata"].length>1&&u.copy(e,"file:nodata","nodata:values"),u.rename(e,"file:nodata","nodata")&&!r&&u.pickFirst(e,"nodata"),u.upgradeExtension(t,s.file)},label(e,t){c.before("0.8.0")&&(u.rename(e,"label:property","label:properties"),u.rename(e,"label:task","label:tasks"),u.rename(e,"label:overview","label:overviews")&&u.toArray(e,"label:overviews"),u.rename(e,"label:method","label:methods"),u.toArray(e,"label:classes")),u.upgradeExtension(t,s.label)},pc(e,t){c.before("0.8.0")&&u.rename(e,"pc:schema","pc:schemas"),u.upgradeExtension(t,s.pointcloud)},processing(e,t){u.upgradeExtension(t,s.processing)},proj(e,t){u.rename(e,"proj:epsg","proj:code")&&u.formatString(e,"proj:code","EPSG:{}"),u.upgradeExtension(t,s.projection)},raster(e,t){u.upgradeExtension(t,s.raster)},sar(e,t,r){u.rename(e,"sar:incidence_angle","view:incidence_angle")&&u.addExtension(t,s.view),u.rename(e,"sar:pass_direction","sat:orbit_state")&&u.mapValues(e,"sat:orbit_state",[null],["geostationary"])&&u.addExtension(t,s.sat),c.before("0.7.0")&&(u.flattenArray(e,"sar:resolution",["sar:resolution_range","sar:resolution_azimuth"],r),u.flattenArray(e,"sar:pixel_spacing",["sar:pixel_spacing_range","sar:pixel_spacing_azimuth"],r),u.flattenArray(e,"sar:looks",["sar:looks_range","sar:looks_azimuth","sar:looks_equivalent_number"],r),u.rename(e,"sar:off_nadir","view:off_nadir")&&u.addExtension(t,s.view)),c.before("0.9.0")&&(u.rename(e,"sar:platform","platform"),u.rename(e,"sar:instrument","instruments")&&u.toArray(e,"instruments"),u.rename(e,"sar:constellation","constellation"),u.rename(e,"sar:type","sar:product_type"),u.rename(e,"sar:polarization","sar:polarizations"),u.flattenOneElementArray(e,"sar:absolute_orbit",r)&&u.rename(e,"sar:absolute_orbit","sat:absolute_orbit")&&u.addExtension(t,s.sat),u.flattenOneElementArray(e,"sar:relative_orbit",r)&&u.rename(e,"sar:relative_orbit","sat:relative_orbit")&&u.addExtension(t,s.sat)),u.upgradeExtension(t,s.sar)},sat(e,t){c.before("0.9.0")&&(u.rename(e,"sat:off_nadir_angle","sat:off_nadir"),u.rename(e,"sat:azimuth_angle","sat:azimuth"),u.rename(e,"sat:sun_azimuth_angle","sat:sun_azimuth"),u.rename(e,"sat:sun_elevation_angle","sat:sun_elevation")),u.upgradeExtension(t,s.sat)},sci(e,t){u.upgradeExtension(t,s.scientific)},item(e){c.before("0.8.0")&&(u.rename(e,"item:license","license"),u.rename(e,"item:providers","providers"))},table(e,t){u.upgradeExtension(t,s.table)},view(e,t){u.upgradeExtension(t,s.view)}},b={item:(e,t=null,r=!0)=>h.migrate(e,t,r),catalog:(e,t=!0)=>d.migrate(e,t),collection:(e,t=!0)=>f.migrate(e,t),collectionCollection:(e,t=!0)=>p.migrate(e,t),itemCollection:(e,t=!0)=>m.migrate(e,t),stac:(e,t=!0)=>"Feature"===e.type?b.item(e,null,t):"FeatureCollection"===e.type?b.itemCollection(e,t):"Collection"===e.type||!e.type&&u.isDefined(e.extent)&&u.isDefined(e.license)?b.collection(e,t):!e.type&&Array.isArray(e.collections)?b.collectionCollection(e,t):b.catalog(e,t),enableMultihash(e){l.multihash=e}};e.exports=b},9139(e,t){var r,n;void 0===(n="function"==typeof(r=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,r,n=e.replace(/^v/,"").replace(/\+.*$/,""),o=(r="-",-1===(t=n).indexOf(r)?t.length:t.indexOf(r)),s=n.substring(0,o).split(".");return s.push(n.substring(o+1)),s}function r(e){return isNaN(Number(e))?e:Number(e)}function n(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function o(e,o){[e,o].forEach(n);for(var s=t(e),a=t(o),i=0;i<Math.max(s.length-1,a.length-1);i++){var c=parseInt(s[i]||0,10),u=parseInt(a[i]||0,10);if(c>u)return 1;if(u>c)return-1}var l=s[s.length-1],d=a[a.length-1];if(l&&d){var f=l.split(".").map(r),h=d.split(".").map(r);for(i=0;i<Math.max(f.length,h.length);i++){if(void 0===f[i]||"string"==typeof h[i]&&"number"==typeof f[i])return-1;if(void 0===h[i]||"string"==typeof f[i]&&"number"==typeof h[i])return 1;if(f[i]>h[i])return 1;if(h[i]>f[i])return-1}}else if(l||d)return l?-1:1;return 0}var s=[">",">=","=","<","<="],a={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return o.validate=function(t){return"string"==typeof t&&e.test(t)},o.compare=function(e,t,r){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===s.indexOf(e))throw new TypeError("Invalid operator, expected one of "+s.join("|"))}(r);var n=o(e,t);return a[r].indexOf(n)>-1},o})?r.apply(t,[]):r)||(e.exports=n)},4018(e,t){function r(e,t){return{validate:e,compare:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(s,a),time:r(c(!0),u),"date-time":r(f(!0),h),"iso-time":r(c(),l),"iso-date-time":r(f(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return m.test(e)&&g.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(b.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return y.lastIndex=0,y.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=2147483647&&e>=-2147483648}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:v},double:{type:"number",validate:v},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(e){const t=n.exec(e);if(!t)return!1;const r=+t[1],s=+t[2],a=+t[3];return s>=1&&s<=12&&a>=1&&a<=(2===s&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:o[s])}function a(e,t){if(e&&t)return e>t?1:e<t?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){const r=i.exec(t);if(!r)return!1;const n=+r[1],o=+r[2],s=+r[3],a=r[4],c="-"===r[5]?-1:1,u=+(r[6]||0),l=+(r[7]||0);if(u>23||l>59||e&&!a)return!1;if(n<=23&&o<=59&&s<60)return!0;const d=o-l*c,f=n-u*c-(d<0?1:0);return(23===f||-1===f)&&(59===d||-1===d)&&s<61}}function u(e,t){if(!e||!t)return;const r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();return r&&n?r-n:void 0}function l(e,t){if(!e||!t)return;const r=i.exec(e),n=i.exec(t);return r&&n?(e=r[1]+r[2]+r[3])>(t=n[1]+n[2]+n[3])?1:e<t?-1:0:void 0}const d=/t|\s/i;function f(e){const t=c(e);return function(e){const r=e.split(d);return 2===r.length&&s(r[0])&&t(r[1])}}function h(e,t){if(!e||!t)return;const r=new Date(e).valueOf(),n=new Date(t).valueOf();return r&&n?r-n:void 0}function p(e,t){if(!e||!t)return;const[r,n]=e.split(d),[o,s]=t.split(d),i=a(r,o);return void 0!==i?i||u(n,s):void 0}const m=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(){return!0}const b=/[^\\]\\Z/},8182(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});const n=r(4018),o=r(6461),s=r(9029),a=new s.Name("fullFormats"),i=new s.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,n.fullFormats,a),e;const[r,s]="fast"===t.mode?[n.fastFormats,i]:[n.fullFormats,a];return u(e,t.formats||n.formatNames,r,s),t.keywords&&(0,o.default)(e),e};function u(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=s._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}c.get=(e,t="full")=>{const r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw new Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},6461(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const n=r(3282),o=r(9029),s=o.operators,a={formatMaximum:{okStr:"<=",ok:s.LTE,fail:s.GT},formatMinimum:{okStr:">=",ok:s.GTE,fail:s.LT},formatExclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},formatExclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},i={message:({keyword:e,schemaCode:t})=>o.str`should be ${a[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>o._`{comparison: ${a[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:i,code(e){const{gen:t,data:r,schemaCode:s,keyword:i,it:c}=e,{opts:u,self:l}=c;if(!u.validateFormats)return;const d=new n.KeywordCxt(c,l.RULES.all.format.definition,"format");function f(e){return o._`${e}.compare(${r}, ${s}) ${a[i].fail} 0`}d.$data?function(){const r=t.scopeValue("formats",{ref:l.formats,code:u.code.formats}),n=t.const("fmt",o._`${r}[${d.schemaCode}]`);e.fail$data((0,o.or)(o._`typeof ${n} != "object"`,o._`${n} instanceof RegExp`,o._`typeof ${n}.compare != "function"`,f(n)))}():function(){const r=d.schema,n=l.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${i}": format "${r}" does not define "compare" function`);const s=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?o._`${u.code.formats}${(0,o.getProperty)(r)}`:void 0});e.fail$data(f(s))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)},3282(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),o=r(6144),s=r(6653),a=r(2079),i=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(a,i):a;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},1520(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class o extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function s(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new o(r)}t._Code=o,t.nil=new o(""),t._=s;const a=new o("+");function i(e,...t){const r=[l(e[0])];let n=0;for(;n<t.length;)r.push(a),c(r,t[n]),r.push(a,l(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=u(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new o(r)}function c(e,t){var r;t instanceof o?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:l(Array.isArray(r)?r.join(","):r))}function u(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new o(l(e))},t.safeStringify=l,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):s`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},9029(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),o=r(7845);var s=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}});var a=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){return j(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(C(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>O(e,t.names),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class v extends g{}v.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(R(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){const e=super.names;return j(e,this.condition),this.else&&O(e,this.else.names),e}}b.kind="if";class w extends g{}w.kind="for";class _ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}}class $ extends w{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){const e=j(super.names,this.from);return j(e,this.to)}}class E extends w{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}}class x extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class S extends m{render(e){return"return "+super.render(e)}}S.kind="return";class k extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}}class A extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}A.kind="catch";class P extends g{render(e){return"finally"+super.render(e)}}function O(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function j(e,t){return t instanceof n._CodeOrName?O(e,t.names):e}function T(e,t,r){return e instanceof n.Name?s(e):(o=e)instanceof n._Code&&o._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=s(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var o;function s(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${D(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new c(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,o));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new b(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(b,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,n,s=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const a=this._scope.toName(e);return this._for(new $(s,a,t,r),()=>n(a))}forOf(e,t,r,s=o.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(a,n._`${e}[${t}]`),r(a)})}return this._for(new E("of",s,a,t),()=>r(a))}forIn(e,t,r,s=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const a=this._scope.toName(e);return this._for(new E("in",s,a,t),()=>r(a))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new k;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new A(e),t(e)}return r&&(this._currNode=n.finally=new P,this.code(r)),this._endBlockNode(A,P)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,o){return this._blockNode(new x(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(x)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=R;const N=z(t.operators.AND);t.and=function(...e){return e.reduce(N)};const I=z(t.operators.OR);function z(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${D(t)} ${e} ${D(r)}`}function D(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(I)}},7845(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(s||(t.UsedValueState=s={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class i extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=i;const c=n._`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:n.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,s=null!==(r=t.key)&&void 0!==r?r:t.ref;let a=this._values[o];if(a){const e=a.get(s);if(e)return e}else a=this._values[o]=new Map;a.set(s,n);const i=this._scope[o]||(this._scope[o]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,a={},i){let c=n.nil;for(const u in e){const l=e[u];if(!l)continue;const d=a[u]=a[u]||new Map;l.forEach(e=>{if(d.has(e))return;d.set(e,s.Started);let a=r(e);if(a){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=n._`${c}${r} ${e} = ${a};${this.opts._n}`}else{if(!(a=null==i?void 0:i(e)))throw new o(e);c=n._`${c}${a}${this.opts._n}`}d.set(e,s.Completed)})}return c}}},8708(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),o=r(4227),s=r(2023);function a(e,t){const r=e.const("err",t);e.if(n._`${s.default.vErrors} === null`,()=>e.assign(s.default.vErrors,n._`[${r}]`),n._`${s.default.vErrors}.push(${r})`),e.code(n._`${s.default.errors}++`)}function i(e,t){const{gen:r,validateName:o,schemaEnv:s}=e;s.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,s){const{it:c}=e,{gen:l,compositeRule:d,allErrors:f}=c,h=u(e,r,o);(null!=s?s:d||f)?a(l,h):i(c,n._`[${h}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:c,compositeRule:l,allErrors:d}=o;a(c,u(e,r,n)),l||d||i(o,s.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(s.default.errors,t),e.if(n._`${s.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${s.default.vErrors}.length`,t),()=>e.assign(s.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:a,it:i}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,s.default.errors,a=>{e.const(c,n._`${s.default.vErrors}[${a}]`),e.if(n._`${c}.instancePath === undefined`,()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(s.default.instancePath,i.errorPath))),e.assign(n._`${c}.schemaPath`,n.str`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,o))})};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function u(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:a}=e,i=[l(a,r),d(e,r)];return function(e,{params:t,message:r},o){const{keyword:a,data:i,schemaValue:u,it:l}=e,{opts:d,propertyName:f,topSchemaRef:h,schemaPath:p}=l;o.push([c.keyword,a],[c.params,"function"==typeof t?t(e):t||n._`{}`]),d.messages&&o.push([c.message,"function"==typeof r?r(e):r]),d.verbose&&o.push([c.schema,u],[c.parentSchema,n._`${h}${p}`],[s.default.data,i]),f&&o.push([c.propertyName,f])}(e,t,i),o.object(...i)}(e,t,r)}function l({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[s.default.instancePath,(0,n.strConcat)(s.default.instancePath,r)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:s}){let a=s?t:n.str`${t}/${e}`;return r&&(a=n.str`${a}${(0,o.getErrorPath)(r,o.Type.Str)}`),[c.schemaPath,a]}},3835(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;con